var xue=Object.defineProperty;var T4=t=>{throw TypeError(t)};var wue=(t,e,n)=>e in t?xue(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Te=(t,e,n)=>wue(t,typeof e!="symbol"?e+"":e,n),cT=(t,e,n)=>e.has(t)||T4("Cannot "+n);var R=(t,e,n)=>(cT(t,e,"read from private field"),n?n.call(t):e.get(t)),B=(t,e,n)=>e.has(t)?T4("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),$=(t,e,n,r)=>(cT(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),z=(t,e,n)=>(cT(t,e,"access private method"),n);var Cs=(t,e,n,r)=>({set _(s){$(t,e,s,n)},get _(){return R(t,e,r)}});function iH(t,e){for(var n=0;nr[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var pr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function _ue(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var s=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return t[r]}})}),n}var oH={exports:{}},OA={},aH={exports:{}},zt={};/** * @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 o_=Symbol.for("react.element"),Sue=Symbol.for("react.portal"),Cue=Symbol.for("react.fragment"),Eue=Symbol.for("react.strict_mode"),Aue=Symbol.for("react.profiler"),Rue=Symbol.for("react.provider"),Pue=Symbol.for("react.context"),Nue=Symbol.for("react.forward_ref"),Tue=Symbol.for("react.suspense"),kue=Symbol.for("react.memo"),Due=Symbol.for("react.lazy"),k4=Symbol.iterator;function Mue(t){return t===null||typeof t!="object"?null:(t=k4&&t[k4]||t["@@iterator"],typeof t=="function"?t:null)}var lH={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},cH=Object.assign,uH={};function iy(t,e,n){this.props=t,this.context=e,this.refs=uH,this.updater=n||lH}iy.prototype.isReactComponent={};iy.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};iy.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function dH(){}dH.prototype=iy.prototype;function aI(t,e,n){this.props=t,this.context=e,this.refs=uH,this.updater=n||lH}var lI=aI.prototype=new dH;lI.constructor=aI;cH(lI,iy.prototype);lI.isPureReactComponent=!0;var D4=Array.isArray,fH=Object.prototype.hasOwnProperty,cI={current:null},hH={key:!0,ref:!0,__self:!0,__source:!0};function pH(t,e,n){var r,s={},i=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(i=""+e.key),e)fH.call(e,r)&&!hH.hasOwnProperty(r)&&(s[r]=e[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1>>1,G=U[X];if(0>>1;Xs(he,te))fes(ce,he)?(U[X]=ce,U[fe]=te,X=fe):(U[X]=he,U[Z]=te,X=Z);else if(fes(ce,te))U[X]=ce,U[fe]=te,X=fe;else break e}}return Q}function s(U,Q){var te=U.sortIndex-Q.sortIndex;return te!==0?te:U.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var c=[],d=[],f=1,l=null,u=3,p=!1,h=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(U){for(var Q=n(d);Q!==null;){if(Q.callback===null)r(d);else if(Q.startTime<=U)r(d),Q.sortIndex=Q.expirationTime,e(c,Q);else break;Q=n(d)}}function _(U){if(m=!1,b(U),!h)if(n(c)!==null)h=!0,K(A);else{var Q=n(d);Q!==null&&V(_,Q.startTime-U)}}function A(U,Q){h=!1,m&&(m=!1,g(E),E=-1),p=!0;var te=u;try{for(b(Q),l=n(c);l!==null&&(!(l.expirationTime>Q)||U&&!M());){var X=l.callback;if(typeof X=="function"){l.callback=null,u=l.priorityLevel;var G=X(l.expirationTime<=Q);Q=t.unstable_now(),typeof G=="function"?l.callback=G:l===n(c)&&r(c),b(Q)}else r(c);l=n(c)}if(l!==null)var Y=!0;else{var Z=n(d);Z!==null&&V(_,Z.startTime-Q),Y=!1}return Y}finally{l=null,u=te,p=!1}}var P=!1,T=null,E=-1,N=5,k=-1;function M(){return!(t.unstable_now()-kU||125X?(U.sortIndex=te,e(d,U),n(c)===null&&U===n(d)&&(m?(g(E),E=-1):m=!0,V(_,te-X))):(U.sortIndex=G,e(c,U),h||p||(h=!0,K(A))),U},t.unstable_shouldYield=M,t.unstable_wrapCallback=function(U){var Q=u;return function(){var te=u;u=Q;try{return U.apply(this,arguments)}finally{u=te}}}})(bH);yH.exports=bH;var Vue=yH.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 que=S,So=Vue;function ke(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wD=Object.prototype.hasOwnProperty,Wue=/^[: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]*$/,O4={},j4={};function Gue(t){return wD.call(j4,t)?!0:wD.call(O4,t)?!1:Wue.test(t)?j4[t]=!0:(O4[t]=!0,!1)}function Kue(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function Yue(t,e,n,r){if(e===null||typeof e>"u"||Kue(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function ai(t,e,n,r,s,i,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=o}var xs={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){xs[t]=new ai(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];xs[e]=new ai(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){xs[t]=new ai(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){xs[t]=new ai(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){xs[t]=new ai(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){xs[t]=new ai(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){xs[t]=new ai(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){xs[t]=new ai(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){xs[t]=new ai(t,5,!1,t.toLowerCase(),null,!1,!1)});var dI=/[\-:]([a-z])/g;function fI(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(dI,fI);xs[e]=new ai(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(dI,fI);xs[e]=new ai(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(dI,fI);xs[e]=new ai(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){xs[t]=new ai(t,1,!1,t.toLowerCase(),null,!1,!1)});xs.xlinkHref=new ai("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){xs[t]=new ai(t,1,!1,t.toLowerCase(),null,!0,!0)});function hI(t,e,n,r){var s=xs.hasOwnProperty(e)?xs[e]:null;(s!==null?s.type!==0:r||!(2a||s[o]!==i[a]){var c=` `+s[o].replace(" at new "," at ");return t.displayName&&c.includes("")&&(c=c.replace("",t.displayName)),c}while(1<=o&&0<=a);break}}}finally{fT=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Fb(t):""}function Xue(t){switch(t.tag){case 5:return Fb(t.type);case 16:return Fb("Lazy");case 13:return Fb("Suspense");case 19:return Fb("SuspenseList");case 0:case 2:case 15:return t=hT(t.type,!1),t;case 11:return t=hT(t.type.render,!1),t;case 1:return t=hT(t.type,!0),t;default:return""}}function ED(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 zm:return"Fragment";case Fm:return"Portal";case _D:return"Profiler";case pI:return"StrictMode";case SD:return"Suspense";case CD:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case _H:return(t.displayName||"Context")+".Consumer";case wH:return(t._context.displayName||"Context")+".Provider";case mI:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case gI:return e=t.displayName||null,e!==null?e:ED(t.type)||"Memo";case td:e=t._payload,t=t._init;try{return ED(t(e))}catch{}}return null}function Que(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ED(e);case 8:return e===pI?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function nf(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function CH(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Zue(t){var e=CH(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function GS(t){t._valueTracker||(t._valueTracker=Zue(t))}function EH(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=CH(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function VC(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 AD(t,e){var n=e.checked;return sr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function L4(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=nf(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function AH(t,e){e=e.checked,e!=null&&hI(t,"checked",e,!1)}function RD(t,e){AH(t,e);var n=nf(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?PD(t,e.type,n):e.hasOwnProperty("defaultValue")&&PD(t,e.type,nf(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function $4(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function PD(t,e,n){(e!=="number"||VC(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var zb=Array.isArray;function rg(t,e,n,r){if(t=t.options,e){e={};for(var s=0;s"+e.valueOf().toString()+"",e=KS.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function L0(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var f0={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},Jue=["Webkit","ms","Moz","O"];Object.keys(f0).forEach(function(t){Jue.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),f0[e]=f0[t]})});function TH(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||f0.hasOwnProperty(t)&&f0[t]?(""+e).trim():e+"px"}function kH(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=TH(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,s):t[n]=s}}var ede=sr({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 kD(t,e){if(e){if(ede[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(ke(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(ke(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(ke(61))}if(e.style!=null&&typeof e.style!="object")throw Error(ke(62))}}function DD(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var MD=null;function vI(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var OD=null,sg=null,ig=null;function B4(t){if(t=u_(t)){if(typeof OD!="function")throw Error(ke(280));var e=t.stateNode;e&&(e=FA(e),OD(t.stateNode,t.type,e))}}function DH(t){sg?ig?ig.push(t):ig=[t]:sg=t}function MH(){if(sg){var t=sg,e=ig;if(ig=sg=null,B4(t),e)for(t=0;t>>=0,t===0?32:31-(dde(t)/fde|0)|0}var YS=64,XS=4194304;function Bb(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 KC(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,s=t.suspendedLanes,i=t.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=Bb(a):(i&=o,i!==0&&(r=Bb(i)))}else o=n&~s,o!==0?r=Bb(o):i!==0&&(r=Bb(i));if(r===0)return 0;if(e!==0&&e!==r&&!(e&s)&&(s=r&-r,i=e&-e,s>=i||s===16&&(i&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function l_(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Ha(e),t[e]=n}function gde(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=p0),X4=" ",Q4=!1;function JH(t,e){switch(t){case"keyup":return Vde.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function eV(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Bm=!1;function Wde(t,e){switch(t){case"compositionend":return eV(e);case"keypress":return e.which!==32?null:(Q4=!0,X4);case"textInput":return t=e.data,t===X4&&Q4?null:t;default:return null}}function Gde(t,e){if(Bm)return t==="compositionend"||!EI&&JH(t,e)?(t=QH(),K1=_I=Hd=null,Bm=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=tz(n)}}function sV(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?sV(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function iV(){for(var t=window,e=VC();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=VC(t.document)}return e}function AI(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function nfe(t){var e=iV(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&sV(n.ownerDocument.documentElement,n)){if(r!==null&&AI(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!t.extend&&i>r&&(s=r,r=i,i=s),s=nz(n,i);var o=nz(n,r);s&&o&&(t.rangeCount!==1||t.anchorNode!==s.node||t.anchorOffset!==s.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),t.removeAllRanges(),i>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Um=null,zD=null,g0=null,BD=!1;function rz(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;BD||Um==null||Um!==VC(r)||(r=Um,"selectionStart"in r&&AI(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),g0&&H0(g0,r)||(g0=r,r=QC(zD,"onSelect"),0qm||(t.current=GD[qm],GD[qm]=null,qm--)}function zn(t,e){qm++,GD[qm]=t.current,t.current=e}var rf={},$s=gf(rf),Oi=gf(!1),vp=rf;function Ov(t,e){var n=t.type.contextTypes;if(!n)return rf;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=e[i];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=s),s}function ji(t){return t=t.childContextTypes,t!=null}function JC(){Gn(Oi),Gn($s)}function uz(t,e,n){if($s.current!==rf)throw Error(ke(168));zn($s,e),zn(Oi,n)}function pV(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in e))throw Error(ke(108,Que(t)||"Unknown",s));return sr({},n,r)}function eE(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||rf,vp=$s.current,zn($s,t),zn(Oi,Oi.current),!0}function dz(t,e,n){var r=t.stateNode;if(!r)throw Error(ke(169));n?(t=pV(t,e,vp),r.__reactInternalMemoizedMergedChildContext=t,Gn(Oi),Gn($s),zn($s,t)):Gn(Oi),zn(Oi,n)}var Rc=null,zA=!1,RT=!1;function mV(t){Rc===null?Rc=[t]:Rc.push(t)}function pfe(t){zA=!0,mV(t)}function vf(){if(!RT&&Rc!==null){RT=!0;var t=0,e=xn;try{var n=Rc;for(xn=1;t>=o,s-=o,ru=1<<32-Ha(e)+s|n<E?(N=T,T=null):N=T.sibling;var k=u(g,T,b[E],_);if(k===null){T===null&&(T=N);break}t&&T&&k.alternate===null&&e(g,T),v=i(k,v,E),P===null?A=k:P.sibling=k,P=k,T=N}if(E===b.length)return n(g,T),Qn&&Vf(g,E),A;if(T===null){for(;EE?(N=T,T=null):N=T.sibling;var M=u(g,T,k.value,_);if(M===null){T===null&&(T=N);break}t&&T&&M.alternate===null&&e(g,T),v=i(M,v,E),P===null?A=M:P.sibling=M,P=M,T=N}if(k.done)return n(g,T),Qn&&Vf(g,E),A;if(T===null){for(;!k.done;E++,k=b.next())k=l(g,k.value,_),k!==null&&(v=i(k,v,E),P===null?A=k:P.sibling=k,P=k);return Qn&&Vf(g,E),A}for(T=r(g,T);!k.done;E++,k=b.next())k=p(T,g,E,k.value,_),k!==null&&(t&&k.alternate!==null&&T.delete(k.key===null?E:k.key),v=i(k,v,E),P===null?A=k:P.sibling=k,P=k);return t&&T.forEach(function(j){return e(g,j)}),Qn&&Vf(g,E),A}function y(g,v,b,_){if(typeof b=="object"&&b!==null&&b.type===zm&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case WS:e:{for(var A=b.key,P=v;P!==null;){if(P.key===A){if(A=b.type,A===zm){if(P.tag===7){n(g,P.sibling),v=s(P,b.props.children),v.return=g,g=v;break e}}else if(P.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===td&&pz(A)===P.type){n(g,P.sibling),v=s(P,b.props),v.ref=pb(g,P,b),v.return=g,g=v;break e}n(g,P);break}else e(g,P);P=P.sibling}b.type===zm?(v=fp(b.props.children,g.mode,_,b.key),v.return=g,g=v):(_=nC(b.type,b.key,b.props,null,g.mode,_),_.ref=pb(g,v,b),_.return=g,g=_)}return o(g);case Fm:e:{for(P=b.key;v!==null;){if(v.key===P)if(v.tag===4&&v.stateNode.containerInfo===b.containerInfo&&v.stateNode.implementation===b.implementation){n(g,v.sibling),v=s(v,b.children||[]),v.return=g,g=v;break e}else{n(g,v);break}else e(g,v);v=v.sibling}v=jT(b,g.mode,_),v.return=g,g=v}return o(g);case td:return P=b._init,y(g,v,P(b._payload),_)}if(zb(b))return h(g,v,b,_);if(cb(b))return m(g,v,b,_);r1(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,v!==null&&v.tag===6?(n(g,v.sibling),v=s(v,b),v.return=g,g=v):(n(g,v),v=OT(b,g.mode,_),v.return=g,g=v),o(g)):n(g,v)}return y}var Iv=bV(!0),xV=bV(!1),rE=gf(null),sE=null,Km=null,TI=null;function kI(){TI=Km=sE=null}function DI(t){var e=rE.current;Gn(rE),t._currentValue=e}function XD(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function ag(t,e){sE=t,TI=Km=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Ni=!0),t.firstContext=null)}function aa(t){var e=t._currentValue;if(TI!==t)if(t={context:t,memoizedValue:e,next:null},Km===null){if(sE===null)throw Error(ke(308));Km=t,sE.dependencies={lanes:0,firstContext:t}}else Km=Km.next=t;return e}var th=null;function MI(t){th===null?th=[t]:th.push(t)}function wV(t,e,n,r){var s=e.interleaved;return s===null?(n.next=n,MI(e)):(n.next=s.next,s.next=n),e.interleaved=n,vu(t,r)}function vu(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var nd=!1;function OI(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _V(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function ou(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Qd(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Xt&2){var s=r.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),r.pending=e,vu(t,n)}return s=r.interleaved,s===null?(e.next=e,MI(r)):(e.next=s.next,s.next=e),r.interleaved=e,vu(t,n)}function X1(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,bI(t,n)}}function mz(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=e:i=i.next=e}else s=i=e;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function iE(t,e,n,r){var s=t.updateQueue;nd=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var c=a,d=c.next;c.next=null,o===null?i=d:o.next=d,o=c;var f=t.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==o&&(a===null?f.firstBaseUpdate=d:a.next=d,f.lastBaseUpdate=c))}if(i!==null){var l=s.baseState;o=0,f=d=c=null,a=i;do{var u=a.lane,p=a.eventTime;if((r&u)===u){f!==null&&(f=f.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var h=t,m=a;switch(u=e,p=n,m.tag){case 1:if(h=m.payload,typeof h=="function"){l=h.call(p,l,u);break e}l=h;break e;case 3:h.flags=h.flags&-65537|128;case 0:if(h=m.payload,u=typeof h=="function"?h.call(p,l,u):h,u==null)break e;l=sr({},l,u);break e;case 2:nd=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,u=s.effects,u===null?s.effects=[a]:u.push(a))}else p={eventTime:p,lane:u,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(d=f=p,c=l):f=f.next=p,o|=u;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;u=a,a=u.next,u.next=null,s.lastBaseUpdate=u,s.shared.pending=null}}while(!0);if(f===null&&(c=l),s.baseState=c,s.firstBaseUpdate=d,s.lastBaseUpdate=f,e=s.shared.interleaved,e!==null){s=e;do o|=s.lane,s=s.next;while(s!==e)}else i===null&&(s.shared.lanes=0);xp|=o,t.lanes=o,t.memoizedState=l}}function gz(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=NT.transition;NT.transition={};try{t(!1),e()}finally{xn=n,NT.transition=r}}function FV(){return la().memoizedState}function yfe(t,e,n){var r=Jd(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},zV(t))BV(e,n);else if(n=wV(t,e,n,r),n!==null){var s=ni();Va(n,t,r,s),UV(n,e,r)}}function bfe(t,e,n){var r=Jd(t),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(zV(t))BV(e,s);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var o=e.lastRenderedState,a=i(o,n);if(s.hasEagerState=!0,s.eagerState=a,Ka(a,o)){var c=e.interleaved;c===null?(s.next=s,MI(e)):(s.next=c.next,c.next=s),e.interleaved=s;return}}catch{}finally{}n=wV(t,e,s,r),n!==null&&(s=ni(),Va(n,t,r,s),UV(n,e,r))}}function zV(t){var e=t.alternate;return t===rr||e!==null&&e===rr}function BV(t,e){v0=aE=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function UV(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,bI(t,n)}}var lE={readContext:aa,useCallback:Es,useContext:Es,useEffect:Es,useImperativeHandle:Es,useInsertionEffect:Es,useLayoutEffect:Es,useMemo:Es,useReducer:Es,useRef:Es,useState:Es,useDebugValue:Es,useDeferredValue:Es,useTransition:Es,useMutableSource:Es,useSyncExternalStore:Es,useId:Es,unstable_isNewReconciler:!1},xfe={readContext:aa,useCallback:function(t,e){return dl().memoizedState=[t,e===void 0?null:e],t},useContext:aa,useEffect:yz,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Z1(4194308,4,OV.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Z1(4194308,4,t,e)},useInsertionEffect:function(t,e){return Z1(4,2,t,e)},useMemo:function(t,e){var n=dl();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=dl();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=yfe.bind(null,rr,t),[r.memoizedState,t]},useRef:function(t){var e=dl();return t={current:t},e.memoizedState=t},useState:vz,useDebugValue:UI,useDeferredValue:function(t){return dl().memoizedState=t},useTransition:function(){var t=vz(!1),e=t[0];return t=vfe.bind(null,t[1]),dl().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=rr,s=dl();if(Qn){if(n===void 0)throw Error(ke(407));n=n()}else{if(n=e(),ss===null)throw Error(ke(349));bp&30||AV(r,e,n)}s.memoizedState=n;var i={value:n,getSnapshot:e};return s.queue=i,yz(PV.bind(null,r,i,t),[t]),r.flags|=2048,Q0(9,RV.bind(null,r,i,n,e),void 0,null),n},useId:function(){var t=dl(),e=ss.identifierPrefix;if(Qn){var n=su,r=ru;n=(r&~(1<<32-Ha(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Y0++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[Dl]=e,t[W0]=r,ZV(t,e,!1,!1),e.stateNode=t;e:{switch(o=DD(n,r),n){case"dialog":qn("cancel",t),qn("close",t),s=r;break;case"iframe":case"object":case"embed":qn("load",t),s=r;break;case"video":case"audio":for(s=0;sFv&&(e.flags|=128,r=!0,mb(i,!1),e.lanes=4194304)}else{if(!r)if(t=oE(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),mb(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Qn)return As(e),null}else 2*_r()-i.renderingStartTime>Fv&&n!==1073741824&&(e.flags|=128,r=!0,mb(i,!1),e.lanes=4194304);i.isBackwards?(o.sibling=e.child,e.child=o):(n=i.last,n!==null?n.sibling=o:e.child=o,i.last=o)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=_r(),e.sibling=null,n=nr.current,zn(nr,r?n&1|2:n&1),e):(As(e),null);case 22:case 23:return KI(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?fo&1073741824&&(As(e),e.subtreeFlags&6&&(e.flags|=8192)):As(e),null;case 24:return null;case 25:return null}throw Error(ke(156,e.tag))}function Pfe(t,e){switch(PI(e),e.tag){case 1:return ji(e.type)&&JC(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Lv(),Gn(Oi),Gn($s),LI(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return II(e),null;case 13:if(Gn(nr),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(ke(340));jv()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Gn(nr),null;case 4:return Lv(),null;case 10:return DI(e.type._context),null;case 22:case 23:return KI(),null;case 24:return null;default:return null}}var i1=!1,Ms=!1,Nfe=typeof WeakSet=="function"?WeakSet:Set,We=null;function Ym(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){hr(t,e,r)}else n.current=null}function iM(t,e,n){try{n()}catch(r){hr(t,e,r)}}var Nz=!1;function Tfe(t,e){if(UD=YC,t=iV(),AI(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,c=-1,d=0,f=0,l=t,u=null;t:for(;;){for(var p;l!==n||s!==0&&l.nodeType!==3||(a=o+s),l!==i||r!==0&&l.nodeType!==3||(c=o+r),l.nodeType===3&&(o+=l.nodeValue.length),(p=l.firstChild)!==null;)u=l,l=p;for(;;){if(l===t)break t;if(u===n&&++d===s&&(a=o),u===i&&++f===r&&(c=o),(p=l.nextSibling)!==null)break;l=u,u=l.parentNode}l=p}n=a===-1||c===-1?null:{start:a,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(HD={focusedElem:t,selectionRange:n},YC=!1,We=e;We!==null;)if(e=We,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,We=t;else for(;We!==null;){e=We;try{var h=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var m=h.memoizedProps,y=h.memoizedState,g=e.stateNode,v=g.getSnapshotBeforeUpdate(e.elementType===e.type?m:_a(e.type,m),y);g.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var b=e.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ke(163))}}catch(_){hr(e,e.return,_)}if(t=e.sibling,t!==null){t.return=e.return,We=t;break}We=e.return}return h=Nz,Nz=!1,h}function y0(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&t)===t){var i=s.destroy;s.destroy=void 0,i!==void 0&&iM(e,n,i)}s=s.next}while(s!==r)}}function HA(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function oM(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function t8(t){var e=t.alternate;e!==null&&(t.alternate=null,t8(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Dl],delete e[W0],delete e[WD],delete e[ffe],delete e[hfe])),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 n8(t){return t.tag===5||t.tag===3||t.tag===4}function Tz(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||n8(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 aM(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=ZC));else if(r!==4&&(t=t.child,t!==null))for(aM(t,e,n),t=t.sibling;t!==null;)aM(t,e,n),t=t.sibling}function lM(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(lM(t,e,n),t=t.sibling;t!==null;)lM(t,e,n),t=t.sibling}var gs=null,$a=!1;function Uu(t,e,n){for(n=n.child;n!==null;)r8(t,e,n),n=n.sibling}function r8(t,e,n){if(zl&&typeof zl.onCommitFiberUnmount=="function")try{zl.onCommitFiberUnmount(jA,n)}catch{}switch(n.tag){case 5:Ms||Ym(n,e);case 6:var r=gs,s=$a;gs=null,Uu(t,e,n),gs=r,$a=s,gs!==null&&($a?(t=gs,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):gs.removeChild(n.stateNode));break;case 18:gs!==null&&($a?(t=gs,n=n.stateNode,t.nodeType===8?AT(t.parentNode,n):t.nodeType===1&&AT(t,n),B0(t)):AT(gs,n.stateNode));break;case 4:r=gs,s=$a,gs=n.stateNode.containerInfo,$a=!0,Uu(t,e,n),gs=r,$a=s;break;case 0:case 11:case 14:case 15:if(!Ms&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&iM(n,e,o),s=s.next}while(s!==r)}Uu(t,e,n);break;case 1:if(!Ms&&(Ym(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){hr(n,e,a)}Uu(t,e,n);break;case 21:Uu(t,e,n);break;case 22:n.mode&1?(Ms=(r=Ms)||n.memoizedState!==null,Uu(t,e,n),Ms=r):Uu(t,e,n);break;default:Uu(t,e,n)}}function kz(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new Nfe),e.forEach(function(r){var s=Ffe.bind(null,t,r);n.has(r)||(n.add(r),r.then(s,s))})}}function xa(t,e){var n=e.deletions;if(n!==null)for(var r=0;rs&&(s=o),r&=~i}if(r=s,r=_r()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Dfe(r/1960))-r,10t?16:t,Vd===null)var r=!1;else{if(t=Vd,Vd=null,dE=0,Xt&6)throw Error(ke(331));var s=Xt;for(Xt|=4,We=t.current;We!==null;){var i=We,o=i.child;if(We.flags&16){var a=i.deletions;if(a!==null){for(var c=0;c_r()-WI?dp(t,0):qI|=n),Ii(t,e)}function d8(t,e){e===0&&(t.mode&1?(e=XS,XS<<=1,!(XS&130023424)&&(XS=4194304)):e=1);var n=ni();t=vu(t,e),t!==null&&(l_(t,e,n),Ii(t,n))}function $fe(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),d8(t,n)}function Ffe(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,s=t.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(ke(314))}r!==null&&r.delete(e),d8(t,n)}var f8;f8=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Oi.current)Ni=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Ni=!1,Afe(t,e,n);Ni=!!(t.flags&131072)}else Ni=!1,Qn&&e.flags&1048576&&gV(e,nE,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;J1(t,e),t=e.pendingProps;var s=Ov(e,$s.current);ag(e,n),s=FI(null,e,r,t,s,n);var i=zI();return e.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,ji(r)?(i=!0,eE(e)):i=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,OI(e),s.updater=UA,e.stateNode=s,s._reactInternals=e,ZD(e,r,t,n),e=tM(null,e,r,!0,i,n)):(e.tag=0,Qn&&i&&RI(e),Qs(null,e,s,n),e=e.child),e;case 16:r=e.elementType;e:{switch(J1(t,e),t=e.pendingProps,s=r._init,r=s(r._payload),e.type=r,s=e.tag=Bfe(r),t=_a(r,t),s){case 0:e=eM(null,e,r,t,n);break e;case 1:e=Az(null,e,r,t,n);break e;case 11:e=Cz(null,e,r,t,n);break e;case 14:e=Ez(null,e,r,_a(r.type,t),n);break e}throw Error(ke(306,r,""))}return e;case 0:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:_a(r,s),eM(t,e,r,s,n);case 1:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:_a(r,s),Az(t,e,r,s,n);case 3:e:{if(YV(e),t===null)throw Error(ke(387));r=e.pendingProps,i=e.memoizedState,s=i.element,_V(t,e),iE(e,r,null,n);var o=e.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){s=$v(Error(ke(423)),e),e=Rz(t,e,r,n,s);break e}else if(r!==s){s=$v(Error(ke(424)),e),e=Rz(t,e,r,n,s);break e}else for(bo=Xd(e.stateNode.containerInfo.firstChild),xo=e,Qn=!0,za=null,n=xV(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(jv(),r===s){e=yu(t,e,n);break e}Qs(t,e,r,n)}e=e.child}return e;case 5:return SV(e),t===null&&YD(e),r=e.type,s=e.pendingProps,i=t!==null?t.memoizedProps:null,o=s.children,VD(r,s)?o=null:i!==null&&VD(r,i)&&(e.flags|=32),KV(t,e),Qs(t,e,o,n),e.child;case 6:return t===null&&YD(e),null;case 13:return XV(t,e,n);case 4:return jI(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Iv(e,null,r,n):Qs(t,e,r,n),e.child;case 11:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:_a(r,s),Cz(t,e,r,s,n);case 7:return Qs(t,e,e.pendingProps,n),e.child;case 8:return Qs(t,e,e.pendingProps.children,n),e.child;case 12:return Qs(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,s=e.pendingProps,i=e.memoizedProps,o=s.value,zn(rE,r._currentValue),r._currentValue=o,i!==null)if(Ka(i.value,o)){if(i.children===s.children&&!Oi.current){e=yu(t,e,n);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var c=a.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=ou(-1,n&-n),c.tag=2;var d=i.updateQueue;if(d!==null){d=d.shared;var f=d.pending;f===null?c.next=c:(c.next=f.next,f.next=c),d.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),XD(i.return,n,e),a.lanes|=n;break}c=c.next}}else if(i.tag===10)o=i.type===e.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(ke(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),XD(o,n,e),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}Qs(t,e,s.children,n),e=e.child}return e;case 9:return s=e.type,r=e.pendingProps.children,ag(e,n),s=aa(s),r=r(s),e.flags|=1,Qs(t,e,r,n),e.child;case 14:return r=e.type,s=_a(r,e.pendingProps),s=_a(r.type,s),Ez(t,e,r,s,n);case 15:return WV(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:_a(r,s),J1(t,e),e.tag=1,ji(r)?(t=!0,eE(e)):t=!1,ag(e,n),HV(e,r,s),ZD(e,r,s,n),tM(null,e,r,!0,t,n);case 19:return QV(t,e,n);case 22:return GV(t,e,n)}throw Error(ke(156,e.tag))};function h8(t,e){return zH(t,e)}function zfe(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function na(t,e,n,r){return new zfe(t,e,n,r)}function XI(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Bfe(t){if(typeof t=="function")return XI(t)?1:0;if(t!=null){if(t=t.$$typeof,t===mI)return 11;if(t===gI)return 14}return 2}function ef(t,e){var n=t.alternate;return n===null?(n=na(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function nC(t,e,n,r,s,i){var o=2;if(r=t,typeof t=="function")XI(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case zm:return fp(n.children,s,i,e);case pI:o=8,s|=8;break;case _D:return t=na(12,n,e,s|2),t.elementType=_D,t.lanes=i,t;case SD:return t=na(13,n,e,s),t.elementType=SD,t.lanes=i,t;case CD:return t=na(19,n,e,s),t.elementType=CD,t.lanes=i,t;case SH:return qA(n,s,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case wH:o=10;break e;case _H:o=9;break e;case mI:o=11;break e;case gI:o=14;break e;case td:o=16,r=null;break e}throw Error(ke(130,t==null?t:typeof t,""))}return e=na(o,n,e,s),e.elementType=t,e.type=r,e.lanes=i,e}function fp(t,e,n,r){return t=na(7,t,r,e),t.lanes=n,t}function qA(t,e,n,r){return t=na(22,t,r,e),t.elementType=SH,t.lanes=n,t.stateNode={isHidden:!1},t}function OT(t,e,n){return t=na(6,t,null,e),t.lanes=n,t}function jT(t,e,n){return e=na(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Ufe(t,e,n,r,s){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=mT(0),this.expirationTimes=mT(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mT(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function QI(t,e,n,r,s,i,o,a,c){return t=new Ufe(t,e,n,a,c),e===1?(e=1,i===!0&&(e|=8)):e=0,i=na(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},OI(i),t}function Hfe(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(v8)}catch(t){console.error(t)}}v8(),vH.exports=Ao;var rs=vH.exports;const XA=Cu(rs),Kfe=iH({__proto__:null,default:XA},[rs]);var Fz=rs;xD.createRoot=Fz.createRoot,xD.hydrateRoot=Fz.hydrateRoot;const y8=S.createContext({}),Yfe=({children:t,authActions:e})=>{const n=i=>{var o;try{return Promise.resolve((o=e.login)==null?void 0:o.call(e,i))}catch(a){return console.error(a),Promise.reject(a)}},r=i=>{var o;try{return Promise.resolve((o=e.logout)==null?void 0:o.call(e,i))}catch(a){return console.error(a),Promise.reject(a)}},s=async()=>{var i;try{return Promise.resolve((i=e.check)==null?void 0:i.call(e))}catch(o){return console.error(o),Promise.reject(o)}};return x.jsx(y8.Provider,{value:{...e,login:n,logout:r,check:s},children:t})},QA=()=>{const t=S.useContext(y8);if(t===null)throw new Error("useAuth must be used within a AuthProvider");return t};var ly=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(){}},zv=typeof window>"u"||"Deno"in globalThis;function qo(){}function Xfe(t,e){return typeof t=="function"?t(e):t}function hM(t){return typeof t=="number"&&t>=0&&t!==1/0}function b8(t,e){return Math.max(t+(e||0)-Date.now(),0)}function cg(t,e){return typeof t=="function"?t(e):t}function Ba(t,e){return typeof t=="function"?t(e):t}function zz(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:a}=t;if(o){if(r){if(e.queryHash!==tL(o,e.options))return!1}else if(!J0(e.queryKey,o))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||s&&s!==e.state.fetchStatus||i&&!i(e))}function Bz(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(_p(e.options.mutationKey)!==_p(i))return!1}else if(!J0(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function tL(t,e){return((e==null?void 0:e.queryKeyHashFn)||_p)(t)}function _p(t){return JSON.stringify(t,(e,n)=>pM(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function J0(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(n=>!J0(t[n],e[n])):!1}function x8(t,e){if(t===e)return t;const n=Uz(t)&&Uz(e);if(n||pM(t)&&pM(e)){const r=n?t:Object.keys(t),s=r.length,i=n?e:Object.keys(e),o=i.length,a=n?[]:{};let c=0;for(let d=0;d{setTimeout(e,t)})}function mM(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?x8(t,e):e}function w8(t){return t}function Zfe(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function Jfe(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var _8=Symbol();function S8(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===_8?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var ch,pd,Eg,G6,ehe=(G6=class extends ly{constructor(){super();B(this,ch);B(this,pd);B(this,Eg);$(this,Eg,e=>{if(!zv&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){R(this,pd)||this.setEventListener(R(this,Eg))}onUnsubscribe(){var e;this.hasListeners()||((e=R(this,pd))==null||e.call(this),$(this,pd,void 0))}setEventListener(e){var n;$(this,Eg,e),(n=R(this,pd))==null||n.call(this),$(this,pd,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){R(this,ch)!==e&&($(this,ch,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof R(this,ch)=="boolean"?R(this,ch):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},ch=new WeakMap,pd=new WeakMap,Eg=new WeakMap,G6),nL=new ehe,Ag,md,Rg,K6,the=(K6=class extends ly{constructor(){super();B(this,Ag,!0);B(this,md);B(this,Rg);$(this,Rg,e=>{if(!zv&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){R(this,md)||this.setEventListener(R(this,Rg))}onUnsubscribe(){var e;this.hasListeners()||((e=R(this,md))==null||e.call(this),$(this,md,void 0))}setEventListener(e){var n;$(this,Rg,e),(n=R(this,md))==null||n.call(this),$(this,md,e(this.setOnline.bind(this)))}setOnline(e){R(this,Ag)!==e&&($(this,Ag,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return R(this,Ag)}},Ag=new WeakMap,md=new WeakMap,Rg=new WeakMap,K6),mE=new the;function nhe(t){return Math.min(1e3*2**t,3e4)}function C8(t){return(t??"online")==="online"?mE.isOnline():!0}var E8=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function IT(t){return t instanceof E8}function A8(t){let e=!1,n=0,r=!1,s,i,o;const a=new Promise((g,v)=>{i=g,o=v}),c=g=>{var v;r||(h(new E8(g)),(v=t.abort)==null||v.call(t))},d=()=>{e=!0},f=()=>{e=!1},l=()=>nL.isFocused()&&(t.networkMode==="always"||mE.isOnline())&&t.canRun(),u=()=>C8(t.networkMode)&&t.canRun(),p=g=>{var v;r||(r=!0,(v=t.onSuccess)==null||v.call(t,g),s==null||s(),i(g))},h=g=>{var v;r||(r=!0,(v=t.onError)==null||v.call(t,g),s==null||s(),o(g))},m=()=>new Promise(g=>{var v;s=b=>{(r||l())&&g(b)},(v=t.onPause)==null||v.call(t)}).then(()=>{var g;s=void 0,r||(g=t.onContinue)==null||g.call(t)}),y=()=>{if(r)return;let g;const v=n===0?t.initialPromise:void 0;try{g=v??t.fn()}catch(b){g=Promise.reject(b)}Promise.resolve(g).then(p).catch(b=>{var E;if(r)return;const _=t.retry??(zv?0:3),A=t.retryDelay??nhe,P=typeof A=="function"?A(n,b):A,T=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,b);if(e||!T){h(b);return}n++,(E=t.onFail)==null||E.call(t,n,b),Qfe(P).then(()=>l()?void 0:m()).then(()=>{e?h(b):y()})})};return{promise:a,cancel:c,continue:()=>(s==null||s(),a),cancelRetry:d,continueRetry:f,canStart:u,start:()=>(u()?y():m().then(y),a)}}function rhe(){let t=[],e=0,n=u=>{u()},r=u=>{u()},s=u=>setTimeout(u,0);const i=u=>{s=u},o=u=>{let p;e++;try{p=u()}finally{e--,e||d()}return p},a=u=>{e?t.push(u):s(()=>{n(u)})},c=u=>(...p)=>{a(()=>{u(...p)})},d=()=>{const u=t;t=[],u.length&&s(()=>{r(()=>{u.forEach(p=>{n(p)})})})};return{batch:o,batchCalls:c,schedule:a,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:i}}var qr=rhe(),uh,Y6,R8=(Y6=class{constructor(){B(this,uh)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),hM(this.gcTime)&&$(this,uh,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(zv?1/0:5*60*1e3))}clearGcTimeout(){R(this,uh)&&(clearTimeout(R(this,uh)),$(this,uh,void 0))}},uh=new WeakMap,Y6),Pg,Ng,zo,Ts,Cx,dh,Ca,bc,X6,she=(X6=class extends R8{constructor(e){super();B(this,Ca);B(this,Pg);B(this,Ng);B(this,zo);B(this,Ts);B(this,Cx);B(this,dh);$(this,dh,!1),$(this,Cx,e.defaultOptions),this.setOptions(e.options),this.observers=[],$(this,zo,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,$(this,Pg,ihe(this.options)),this.state=e.state??R(this,Pg),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=R(this,Ts))==null?void 0:e.promise}setOptions(e){this.options={...R(this,Cx),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&R(this,zo).remove(this)}setData(e,n){const r=mM(this.state.data,e,this.options);return z(this,Ca,bc).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){z(this,Ca,bc).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,s;const n=(r=R(this,Ts))==null?void 0:r.promise;return(s=R(this,Ts))==null||s.cancel(e),n?n.then(qo).catch(qo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(R(this,Pg))}isActive(){return this.observers.some(e=>Ba(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!b8(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=R(this,Ts))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=R(this,Ts))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),R(this,zo).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(R(this,Ts)&&(R(this,dh)?R(this,Ts).cancel({revert:!0}):R(this,Ts).cancelRetry()),this.scheduleGc()),R(this,zo).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||z(this,Ca,bc).call(this,{type:"invalidate"})}fetch(e,n){var c,d,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(R(this,Ts))return R(this,Ts).continueRetry(),R(this,Ts).promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(u=>u.options.queryFn);l&&this.setOptions(l.options)}const r=new AbortController,s=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>($(this,dh,!0),r.signal)})},i=()=>{const l=S8(this.options,n),u={queryKey:this.queryKey,meta:this.meta};return s(u),$(this,dh,!1),this.options.persister?this.options.persister(l,u,this):l(u)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:i};s(o),(c=this.options.behavior)==null||c.onFetch(o,this),$(this,Ng,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&z(this,Ca,bc).call(this,{type:"fetch",meta:(f=o.fetchOptions)==null?void 0:f.meta});const a=l=>{var u,p,h,m;IT(l)&&l.silent||z(this,Ca,bc).call(this,{type:"error",error:l}),IT(l)||((p=(u=R(this,zo).config).onError)==null||p.call(u,l,this),(m=(h=R(this,zo).config).onSettled)==null||m.call(h,this.state.data,l,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return $(this,Ts,A8({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:l=>{var u,p,h,m;if(l===void 0){a(new Error(`${this.queryHash} data is undefined`));return}this.setData(l),(p=(u=R(this,zo).config).onSuccess)==null||p.call(u,l,this),(m=(h=R(this,zo).config).onSettled)==null||m.call(h,l,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:a,onFail:(l,u)=>{z(this,Ca,bc).call(this,{type:"failed",failureCount:l,error:u})},onPause:()=>{z(this,Ca,bc).call(this,{type:"pause"})},onContinue:()=>{z(this,Ca,bc).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),R(this,Ts).start()}},Pg=new WeakMap,Ng=new WeakMap,zo=new WeakMap,Ts=new WeakMap,Cx=new WeakMap,dh=new WeakMap,Ca=new WeakSet,bc=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...P8(r.data,this.options),fetchMeta:e.meta??null};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=e.error;return IT(s)&&s.revert&&R(this,Ng)?{...R(this,Ng),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),qr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),R(this,zo).notify({query:this,type:"updated",action:e})})},X6);function P8(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:C8(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function ihe(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var fl,Q6,ohe=(Q6=class extends ly{constructor(e={}){super();B(this,fl);this.config=e,$(this,fl,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??tL(s,n);let o=this.get(i);return o||(o=new she({cache:this,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){R(this,fl).has(e.queryHash)||(R(this,fl).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=R(this,fl).get(e.queryHash);n&&(e.destroy(),n===e&&R(this,fl).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){qr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return R(this,fl).get(e)}getAll(){return[...R(this,fl).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>zz(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>zz(e,r)):n}notify(e){qr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){qr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){qr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},fl=new WeakMap,Q6),hl,qs,fh,pl,Ku,Z6,ahe=(Z6=class extends R8{constructor(e){super();B(this,pl);B(this,hl);B(this,qs);B(this,fh);this.mutationId=e.mutationId,$(this,qs,e.mutationCache),$(this,hl,[]),this.state=e.state||N8(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){R(this,hl).includes(e)||(R(this,hl).push(e),this.clearGcTimeout(),R(this,qs).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){$(this,hl,R(this,hl).filter(n=>n!==e)),this.scheduleGc(),R(this,qs).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){R(this,hl).length||(this.state.status==="pending"?this.scheduleGc():R(this,qs).remove(this))}continue(){var e;return((e=R(this,fh))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var s,i,o,a,c,d,f,l,u,p,h,m,y,g,v,b,_,A,P,T;$(this,fh,A8({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(E,N)=>{z(this,pl,Ku).call(this,{type:"failed",failureCount:E,error:N})},onPause:()=>{z(this,pl,Ku).call(this,{type:"pause"})},onContinue:()=>{z(this,pl,Ku).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>R(this,qs).canRun(this)}));const n=this.state.status==="pending",r=!R(this,fh).canStart();try{if(!n){z(this,pl,Ku).call(this,{type:"pending",variables:e,isPaused:r}),await((i=(s=R(this,qs).config).onMutate)==null?void 0:i.call(s,e,this));const N=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,e));N!==this.state.context&&z(this,pl,Ku).call(this,{type:"pending",context:N,variables:e,isPaused:r})}const E=await R(this,fh).start();return await((d=(c=R(this,qs).config).onSuccess)==null?void 0:d.call(c,E,e,this.state.context,this)),await((l=(f=this.options).onSuccess)==null?void 0:l.call(f,E,e,this.state.context)),await((p=(u=R(this,qs).config).onSettled)==null?void 0:p.call(u,E,null,this.state.variables,this.state.context,this)),await((m=(h=this.options).onSettled)==null?void 0:m.call(h,E,null,e,this.state.context)),z(this,pl,Ku).call(this,{type:"success",data:E}),E}catch(E){try{throw await((g=(y=R(this,qs).config).onError)==null?void 0:g.call(y,E,e,this.state.context,this)),await((b=(v=this.options).onError)==null?void 0:b.call(v,E,e,this.state.context)),await((A=(_=R(this,qs).config).onSettled)==null?void 0:A.call(_,void 0,E,this.state.variables,this.state.context,this)),await((T=(P=this.options).onSettled)==null?void 0:T.call(P,void 0,E,e,this.state.context)),E}finally{z(this,pl,Ku).call(this,{type:"error",error:E})}}finally{R(this,qs).runNext(this)}}},hl=new WeakMap,qs=new WeakMap,fh=new WeakMap,pl=new WeakSet,Ku=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),qr.batch(()=>{R(this,hl).forEach(r=>{r.onMutationUpdate(e)}),R(this,qs).notify({mutation:this,type:"updated",action:e})})},Z6);function N8(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var no,Ex,J6,lhe=(J6=class extends ly{constructor(e={}){super();B(this,no);B(this,Ex);this.config=e,$(this,no,new Map),$(this,Ex,Date.now())}build(e,n,r){const s=new ahe({mutationCache:this,mutationId:++Cs(this,Ex)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){const n=l1(e),r=R(this,no).get(n)??[];r.push(e),R(this,no).set(n,r),this.notify({type:"added",mutation:e})}remove(e){var r;const n=l1(e);if(R(this,no).has(n)){const s=(r=R(this,no).get(n))==null?void 0:r.filter(i=>i!==e);s&&(s.length===0?R(this,no).delete(n):R(this,no).set(n,s))}this.notify({type:"removed",mutation:e})}canRun(e){var r;const n=(r=R(this,no).get(l1(e)))==null?void 0:r.find(s=>s.state.status==="pending");return!n||n===e}runNext(e){var r;const n=(r=R(this,no).get(l1(e)))==null?void 0:r.find(s=>s!==e&&s.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){qr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...R(this,no).values()].flat()}find(e){const n={exact:!0,...e};return this.getAll().find(r=>Bz(n,r))}findAll(e={}){return this.getAll().filter(n=>Bz(e,n))}notify(e){qr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return qr.batch(()=>Promise.all(e.map(n=>n.continue().catch(qo))))}},no=new WeakMap,Ex=new WeakMap,J6);function l1(t){var e;return((e=t.options.scope)==null?void 0:e.id)??String(t.mutationId)}function che(t){return{onFetch:(e,n)=>{const r=async()=>{var h,m,y,g,v;const s=e.options,i=(y=(m=(h=e.fetchOptions)==null?void 0:h.meta)==null?void 0:m.fetchMore)==null?void 0:y.direction,o=((g=e.state.data)==null?void 0:g.pages)||[],a=((v=e.state.data)==null?void 0:v.pageParams)||[],c={pages:[],pageParams:[]};let d=!1;const f=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(e.signal.aborted?d=!0:e.signal.addEventListener("abort",()=>{d=!0}),e.signal)})},l=S8(e.options,e.fetchOptions),u=async(b,_,A)=>{if(d)return Promise.reject();if(_==null&&b.pages.length)return Promise.resolve(b);const P={queryKey:e.queryKey,pageParam:_,direction:A?"backward":"forward",meta:e.options.meta};f(P);const T=await l(P),{maxPages:E}=e.options,N=A?Jfe:Zfe;return{pages:N(b.pages,T,E),pageParams:N(b.pageParams,_,E)}};let p;if(i&&o.length){const b=i==="backward",_=b?uhe:Vz,A={pages:o,pageParams:a},P=_(s,A);p=await u(A,P,b)}else{p=await u(c,a[0]??s.initialPageParam);const b=t??o.length;for(let _=1;_{var s,i;return(i=(s=e.options).persister)==null?void 0:i.call(s,r,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=r}}}function Vz(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function uhe(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var dr,gd,vd,Tg,kg,yd,Dg,Mg,eH,dhe=(eH=class{constructor(t={}){B(this,dr);B(this,gd);B(this,vd);B(this,Tg);B(this,kg);B(this,yd);B(this,Dg);B(this,Mg);$(this,dr,t.queryCache||new ohe),$(this,gd,t.mutationCache||new lhe),$(this,vd,t.defaultOptions||{}),$(this,Tg,new Map),$(this,kg,new Map),$(this,yd,0)}mount(){Cs(this,yd)._++,R(this,yd)===1&&($(this,Dg,nL.subscribe(async t=>{t&&(await this.resumePausedMutations(),R(this,dr).onFocus())})),$(this,Mg,mE.subscribe(async t=>{t&&(await this.resumePausedMutations(),R(this,dr).onOnline())})))}unmount(){var t,e;Cs(this,yd)._--,R(this,yd)===0&&((t=R(this,Dg))==null||t.call(this),$(this,Dg,void 0),(e=R(this,Mg))==null||e.call(this),$(this,Mg,void 0))}isFetching(t){return R(this,dr).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return R(this,gd).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=R(this,dr).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.getQueryData(t.queryKey);if(e===void 0)return this.fetchQuery(t);{const n=this.defaultQueryOptions(t),r=R(this,dr).build(this,n);return t.revalidateIfStale&&r.isStaleByTime(cg(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(e)}}getQueriesData(t){return R(this,dr).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),s=R(this,dr).get(r.queryHash),i=s==null?void 0:s.state.data,o=Xfe(e,i);if(o!==void 0)return R(this,dr).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return qr.batch(()=>R(this,dr).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=R(this,dr).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=R(this,dr);qr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=R(this,dr),r={type:"active",...t};return qr.batch(()=>(n.findAll(t).forEach(s=>{s.reset()}),this.refetchQueries(r,e)))}cancelQueries(t={},e={}){const n={revert:!0,...e},r=qr.batch(()=>R(this,dr).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(qo).catch(qo)}invalidateQueries(t={},e={}){return qr.batch(()=>{if(R(this,dr).findAll(t).forEach(r=>{r.invalidate()}),t.refetchType==="none")return Promise.resolve();const n={...t,type:t.refetchType??t.type??"active"};return this.refetchQueries(n,e)})}refetchQueries(t={},e){const n={...e,cancelRefetch:(e==null?void 0:e.cancelRefetch)??!0},r=qr.batch(()=>R(this,dr).findAll(t).filter(s=>!s.isDisabled()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(qo)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(qo)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=R(this,dr).build(this,e);return n.isStaleByTime(cg(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(qo).catch(qo)}fetchInfiniteQuery(t){return t.behavior=che(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(qo).catch(qo)}resumePausedMutations(){return mE.isOnline()?R(this,gd).resumePausedMutations():Promise.resolve()}getQueryCache(){return R(this,dr)}getMutationCache(){return R(this,gd)}getDefaultOptions(){return R(this,vd)}setDefaultOptions(t){$(this,vd,t)}setQueryDefaults(t,e){R(this,Tg).set(_p(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...R(this,Tg).values()];let n={};return e.forEach(r=>{J0(t,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(t,e){R(this,kg).set(_p(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...R(this,kg).values()];let n={};return e.forEach(r=>{J0(t,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...R(this,vd).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=tL(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.enabled!==!0&&e.queryFn===_8&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...R(this,vd).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){R(this,dr).clear(),R(this,gd).clear()}},dr=new WeakMap,gd=new WeakMap,vd=new WeakMap,Tg=new WeakMap,kg=new WeakMap,yd=new WeakMap,Dg=new WeakMap,Mg=new WeakMap,eH),xi,Ht,Ax,Ws,hh,Og,ml,Rx,jg,Ig,ph,mh,bd,Lg,fn,Hb,gM,vM,yM,bM,xM,wM,_M,T8,tH,fhe=(tH=class extends ly{constructor(e,n){super();B(this,fn);B(this,xi);B(this,Ht);B(this,Ax);B(this,Ws);B(this,hh);B(this,Og);B(this,ml);B(this,Rx);B(this,jg);B(this,Ig);B(this,ph);B(this,mh);B(this,bd);B(this,Lg,new Set);this.options=n,$(this,xi,e),$(this,ml,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(R(this,Ht).addObserver(this),qz(R(this,Ht),this.options)?z(this,fn,Hb).call(this):this.updateResult(),z(this,fn,bM).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return SM(R(this,Ht),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return SM(R(this,Ht),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,z(this,fn,xM).call(this),z(this,fn,wM).call(this),R(this,Ht).removeObserver(this)}setOptions(e,n){const r=this.options,s=R(this,Ht);if(this.options=R(this,xi).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ba(this.options.enabled,R(this,Ht))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");z(this,fn,_M).call(this),R(this,Ht).setOptions(this.options),r._defaulted&&!pE(this.options,r)&&R(this,xi).getQueryCache().notify({type:"observerOptionsUpdated",query:R(this,Ht),observer:this});const i=this.hasListeners();i&&Wz(R(this,Ht),s,this.options,r)&&z(this,fn,Hb).call(this),this.updateResult(n),i&&(R(this,Ht)!==s||Ba(this.options.enabled,R(this,Ht))!==Ba(r.enabled,R(this,Ht))||cg(this.options.staleTime,R(this,Ht))!==cg(r.staleTime,R(this,Ht)))&&z(this,fn,gM).call(this);const o=z(this,fn,vM).call(this);i&&(R(this,Ht)!==s||Ba(this.options.enabled,R(this,Ht))!==Ba(r.enabled,R(this,Ht))||o!==R(this,bd))&&z(this,fn,yM).call(this,o)}getOptimisticResult(e){const n=R(this,xi).getQueryCache().build(R(this,xi),e),r=this.createResult(n,e);return phe(this,r)&&($(this,Ws,r),$(this,Og,this.options),$(this,hh,R(this,Ht).state)),r}getCurrentResult(){return R(this,Ws)}trackResult(e,n){const r={};return Object.keys(e).forEach(s=>{Object.defineProperty(r,s,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(s),n==null||n(s),e[s])})}),r}trackProp(e){R(this,Lg).add(e)}getCurrentQuery(){return R(this,Ht)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=R(this,xi).defaultQueryOptions(e),r=R(this,xi).getQueryCache().build(R(this,xi),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(e){return z(this,fn,Hb).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),R(this,Ws)))}createResult(e,n){var T;const r=R(this,Ht),s=this.options,i=R(this,Ws),o=R(this,hh),a=R(this,Og),d=e!==r?e.state:R(this,Ax),{state:f}=e;let l={...f},u=!1,p;if(n._optimisticResults){const E=this.hasListeners(),N=!E&&qz(e,n),k=E&&Wz(e,r,n,s);(N||k)&&(l={...l,...P8(f.data,e.options)}),n._optimisticResults==="isRestoring"&&(l.fetchStatus="idle")}let{error:h,errorUpdatedAt:m,status:y}=l;if(n.select&&l.data!==void 0)if(i&&l.data===(o==null?void 0:o.data)&&n.select===R(this,Rx))p=R(this,jg);else try{$(this,Rx,n.select),p=n.select(l.data),p=mM(i==null?void 0:i.data,p,n),$(this,jg,p),$(this,ml,null)}catch(E){$(this,ml,E)}else p=l.data;if(n.placeholderData!==void 0&&p===void 0&&y==="pending"){let E;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))E=i.data;else if(E=typeof n.placeholderData=="function"?n.placeholderData((T=R(this,Ig))==null?void 0:T.state.data,R(this,Ig)):n.placeholderData,n.select&&E!==void 0)try{E=n.select(E),$(this,ml,null)}catch(N){$(this,ml,N)}E!==void 0&&(y="success",p=mM(i==null?void 0:i.data,E,n),u=!0)}R(this,ml)&&(h=R(this,ml),p=R(this,jg),m=Date.now(),y="error");const g=l.fetchStatus==="fetching",v=y==="pending",b=y==="error",_=v&&g,A=p!==void 0;return{status:y,fetchStatus:l.fetchStatus,isPending:v,isSuccess:y==="success",isError:b,isInitialLoading:_,isLoading:_,data:p,dataUpdatedAt:l.dataUpdatedAt,error:h,errorUpdatedAt:m,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:l.dataUpdateCount>0||l.errorUpdateCount>0,isFetchedAfterMount:l.dataUpdateCount>d.dataUpdateCount||l.errorUpdateCount>d.errorUpdateCount,isFetching:g,isRefetching:g&&!v,isLoadingError:b&&!A,isPaused:l.fetchStatus==="paused",isPlaceholderData:u,isRefetchError:b&&A,isStale:rL(e,n),refetch:this.refetch}}updateResult(e){const n=R(this,Ws),r=this.createResult(R(this,Ht),this.options);if($(this,hh,R(this,Ht).state),$(this,Og,this.options),R(this,hh).data!==void 0&&$(this,Ig,R(this,Ht)),pE(r,n))return;$(this,Ws,r);const s={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!R(this,Lg).size)return!0;const c=new Set(a??R(this,Lg));return this.options.throwOnError&&c.add("error"),Object.keys(R(this,Ws)).some(d=>{const f=d;return R(this,Ws)[f]!==n[f]&&c.has(f)})};(e==null?void 0:e.listeners)!==!1&&i()&&(s.listeners=!0),z(this,fn,T8).call(this,{...s,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&z(this,fn,bM).call(this)}},xi=new WeakMap,Ht=new WeakMap,Ax=new WeakMap,Ws=new WeakMap,hh=new WeakMap,Og=new WeakMap,ml=new WeakMap,Rx=new WeakMap,jg=new WeakMap,Ig=new WeakMap,ph=new WeakMap,mh=new WeakMap,bd=new WeakMap,Lg=new WeakMap,fn=new WeakSet,Hb=function(e){z(this,fn,_M).call(this);let n=R(this,Ht).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(qo)),n},gM=function(){z(this,fn,xM).call(this);const e=cg(this.options.staleTime,R(this,Ht));if(zv||R(this,Ws).isStale||!hM(e))return;const r=b8(R(this,Ws).dataUpdatedAt,e)+1;$(this,ph,setTimeout(()=>{R(this,Ws).isStale||this.updateResult()},r))},vM=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(R(this,Ht)):this.options.refetchInterval)??!1},yM=function(e){z(this,fn,wM).call(this),$(this,bd,e),!(zv||Ba(this.options.enabled,R(this,Ht))===!1||!hM(R(this,bd))||R(this,bd)===0)&&$(this,mh,setInterval(()=>{(this.options.refetchIntervalInBackground||nL.isFocused())&&z(this,fn,Hb).call(this)},R(this,bd)))},bM=function(){z(this,fn,gM).call(this),z(this,fn,yM).call(this,z(this,fn,vM).call(this))},xM=function(){R(this,ph)&&(clearTimeout(R(this,ph)),$(this,ph,void 0))},wM=function(){R(this,mh)&&(clearInterval(R(this,mh)),$(this,mh,void 0))},_M=function(){const e=R(this,xi).getQueryCache().build(R(this,xi),this.options);if(e===R(this,Ht))return;const n=R(this,Ht);$(this,Ht,e),$(this,Ax,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},T8=function(e){qr.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(R(this,Ws))}),R(this,xi).getQueryCache().notify({query:R(this,Ht),type:"observerResultsUpdated"})})},tH);function hhe(t,e){return Ba(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function qz(t,e){return hhe(t,e)||t.state.data!==void 0&&SM(t,e,e.refetchOnMount)}function SM(t,e,n){if(Ba(e.enabled,t)!==!1){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&rL(t,e)}return!1}function Wz(t,e,n,r){return(t!==e||Ba(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&rL(t,n)}function rL(t,e){return Ba(e.enabled,t)!==!1&&t.isStaleByTime(cg(e.staleTime,t))}function phe(t,e){return!pE(t.getCurrentResult(),e)}var xd,wd,wi,Nc,fu,rC,CM,nH,mhe=(nH=class extends ly{constructor(n,r){super();B(this,fu);B(this,xd);B(this,wd);B(this,wi);B(this,Nc);$(this,xd,n),this.setOptions(r),this.bindMethods(),z(this,fu,rC).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=R(this,xd).defaultMutationOptions(n),pE(this.options,r)||R(this,xd).getMutationCache().notify({type:"observerOptionsUpdated",mutation:R(this,wi),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&_p(r.mutationKey)!==_p(this.options.mutationKey)?this.reset():((s=R(this,wi))==null?void 0:s.state.status)==="pending"&&R(this,wi).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=R(this,wi))==null||n.removeObserver(this)}onMutationUpdate(n){z(this,fu,rC).call(this),z(this,fu,CM).call(this,n)}getCurrentResult(){return R(this,wd)}reset(){var n;(n=R(this,wi))==null||n.removeObserver(this),$(this,wi,void 0),z(this,fu,rC).call(this),z(this,fu,CM).call(this)}mutate(n,r){var s;return $(this,Nc,r),(s=R(this,wi))==null||s.removeObserver(this),$(this,wi,R(this,xd).getMutationCache().build(R(this,xd),this.options)),R(this,wi).addObserver(this),R(this,wi).execute(n)}},xd=new WeakMap,wd=new WeakMap,wi=new WeakMap,Nc=new WeakMap,fu=new WeakSet,rC=function(){var r;const n=((r=R(this,wi))==null?void 0:r.state)??N8();$(this,wd,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},CM=function(n){qr.batch(()=>{var r,s,i,o,a,c,d,f;if(R(this,Nc)&&this.hasListeners()){const l=R(this,wd).variables,u=R(this,wd).context;(n==null?void 0:n.type)==="success"?((s=(r=R(this,Nc)).onSuccess)==null||s.call(r,n.data,l,u),(o=(i=R(this,Nc)).onSettled)==null||o.call(i,n.data,null,l,u)):(n==null?void 0:n.type)==="error"&&((c=(a=R(this,Nc)).onError)==null||c.call(a,n.error,l,u),(f=(d=R(this,Nc)).onSettled)==null||f.call(d,void 0,n.error,l,u))}this.listeners.forEach(l=>{l(R(this,wd))})})},nH),k8=S.createContext(void 0),Ml=t=>{const e=S.useContext(k8);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},ghe=({client:t,children:e})=>(S.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),x.jsx(k8.Provider,{value:t,children:e})),D8=S.createContext(!1),vhe=()=>S.useContext(D8);D8.Provider;function yhe(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var bhe=S.createContext(yhe()),xhe=()=>S.useContext(bhe);function M8(t,e){return typeof t=="function"?t(...e):!!t}function whe(){}var _he=(t,e)=>{(t.suspense||t.throwOnError)&&(e.isReset()||(t.retryOnMount=!1))},She=t=>{S.useEffect(()=>{t.clearReset()},[t])},Che=({result:t,errorResetBoundary:e,throwOnError:n,query:r})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&M8(n,[t.error,r]),Ehe=t=>{t.suspense&&(typeof t.staleTime!="number"&&(t.staleTime=1e3),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3)))},Ahe=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,Rhe=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function Phe(t,e,n){var d,f,l,u;const r=Ml(),s=vhe(),i=xhe(),o=r.defaultQueryOptions(t);(f=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||f.call(d,o),o._optimisticResults=s?"isRestoring":"optimistic",Ehe(o),_he(o,i),She(i);const[a]=S.useState(()=>new e(r,o)),c=a.getOptimisticResult(o);if(S.useSyncExternalStore(S.useCallback(p=>{const h=s?()=>{}:a.subscribe(qr.batchCalls(p));return a.updateResult(),h},[a,s]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),S.useEffect(()=>{a.setOptions(o,{listeners:!1})},[o,a]),Ahe(o,c))throw Rhe(o,a,i);if(Che({result:c,errorResetBoundary:i,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash)}))throw c.error;return(u=(l=r.getDefaultOptions().queries)==null?void 0:l._experimental_afterQuery)==null||u.call(l,o,c),o.notifyOnChangeProps?c:a.trackResult(c)}function ZA(t,e){return Phe(t,fhe)}function jl(t,e){const n=Ml(),[r]=S.useState(()=>new mhe(n,t));S.useEffect(()=>{r.setOptions(t)},[r,t]);const s=S.useSyncExternalStore(S.useCallback(o=>r.subscribe(qr.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=S.useCallback((o,a)=>{r.mutate(o,a).catch(whe)},[r]);if(s.error&&M8(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}class ca{constructor(e=[]){Te(this,"segments",[]);this.segments=e}key(){return this.segments}get(){return this.segments}}class yf extends ca{params(e){return new ca([...this.segments,e])}}class Nhe extends ca{id(e){return new yf([...this.segments,e?String(e):void 0])}}class The extends ca{ids(...e){return new yf([...this.segments,...e.length?[e.map(n=>String(n))]:[]])}}class khe extends ca{action(e){if(["one","report"].includes(e))return new Nhe([...this.segments,e]);if(e==="many")return new The([...this.segments,e]);if(["list","infinite"].includes(e))return new yf([...this.segments,e]);throw new Error("Invalid action type")}}class Dhe extends ca{resource(e){return new khe([...this.segments,e])}mutation(e){return new yf([...e==="custom"?this.segments:[this.segments[0]],e])}}class Mhe extends ca{action(e){return new yf([...this.segments,e])}}class Ohe extends ca{action(e){return new yf([...this.segments,e])}}class jhe extends ca{resource(e){return new Ohe([...this.segments,e])}}class Ihe extends ca{action(e){return new yf([...this.segments,e])}}class Lhe extends ca{resource(e){return new Ihe([...this.segments,e])}action(e){return new yf([...this.segments,e])}}class $he extends ca{data(e){return new Dhe(["data",e||"default"])}auth(){return new Mhe(["auth"])}access(){return new jhe(["access"])}audit(){return new Lhe(["audit"])}}const Fhe=()=>new $he([]),bu=()=>Fhe,sL=t=>{const e=bu(),{getProfile:n}=QA();return ZA({queryKey:e().auth().action("profile").get(),queryFn:n,...t})},zhe=t=>{const e=bu(),{check:n}=QA();return ZA({queryKey:e().auth().action("check").get(),queryFn:n,retry:!1,...t})};/** * @remix-run/router v1.19.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 tr(){return tr=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function Bv(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Uhe(){return Math.random().toString(36).substr(2,8)}function Kz(t,e){return{usr:t.state,key:t.key,idx:e}}function ex(t,e,n,r){return n===void 0&&(n=null),tr({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?bf(e):e,{state:n,key:e&&e.key||r||Uhe()})}function Sp(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function bf(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function Hhe(t,e,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,a=Pr.Pop,c=null,d=f();d==null&&(d=0,o.replaceState(tr({},o.state,{idx:d}),""));function f(){return(o.state||{idx:null}).idx}function l(){a=Pr.Pop;let y=f(),g=y==null?null:y-d;d=y,c&&c({action:a,location:m.location,delta:g})}function u(y,g){a=Pr.Push;let v=ex(m.location,y,g);d=f()+1;let b=Kz(v,d),_=m.createHref(v);try{o.pushState(b,"",_)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;s.location.assign(_)}i&&c&&c({action:a,location:m.location,delta:1})}function p(y,g){a=Pr.Replace;let v=ex(m.location,y,g);d=f();let b=Kz(v,d),_=m.createHref(v);o.replaceState(b,"",_),i&&c&&c({action:a,location:m.location,delta:0})}function h(y){let g=s.location.origin!=="null"?s.location.origin:s.location.href,v=typeof y=="string"?y:Sp(y);return v=v.replace(/ $/,"%20"),Ot(g,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,g)}let m={get action(){return a},get location(){return t(s,o)},listen(y){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(Gz,l),c=y,()=>{s.removeEventListener(Gz,l),c=null}},createHref(y){return e(s,y)},createURL:h,encodeLocation(y){let g=h(y);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:u,replace:p,go(y){return o.go(y)}};return m}var An;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(An||(An={}));const Vhe=new Set(["lazy","caseSensitive","path","id","index","children"]);function qhe(t){return t.index===!0}function tx(t,e,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),t.map((s,i)=>{let o=[...n,String(i)],a=typeof s.id=="string"?s.id:o.join("-");if(Ot(s.index!==!0||!s.children,"Cannot specify children on an index route"),Ot(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),qhe(s)){let c=tr({},s,e(s),{id:a});return r[a]=c,c}else{let c=tr({},s,e(s),{id:a,children:void 0});return r[a]=c,s.children&&(c.children=tx(s.children,e,o,r)),c}})}function Xf(t,e,n){return n===void 0&&(n="/"),sC(t,e,n,!1)}function sC(t,e,n,r){let s=typeof e=="string"?bf(e):e,i=sf(s.pathname||"/",n);if(i==null)return null;let o=O8(t);Ghe(o);let a=null;for(let c=0;a==null&&c{let c={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(Ot(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let d=au([r,c.relativePath]),f=n.concat(c);i.children&&i.children.length>0&&(Ot(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),O8(i.children,e,f,d)),!(i.path==null&&!i.index)&&e.push({path:d,score:epe(d,i.index),routesMeta:f})};return t.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))s(i,o);else for(let c of j8(i.path))s(i,o,c)}),e}function j8(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=j8(r.join("/")),a=[];return a.push(...o.map(c=>c===""?i:[i,c].join("/"))),s&&a.push(...o),a.map(c=>t.startsWith("/")&&c===""?"/":c)}function Ghe(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:tpe(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Khe=/^:[\w-]+$/,Yhe=3,Xhe=2,Qhe=1,Zhe=10,Jhe=-2,Yz=t=>t==="*";function epe(t,e){let n=t.split("/"),r=n.length;return n.some(Yz)&&(r+=Jhe),e&&(r+=Xhe),n.filter(s=>!Yz(s)).reduce((s,i)=>s+(Khe.test(i)?Yhe:i===""?Qhe:Zhe),r)}function tpe(t,e){return t.length===e.length&&t.slice(0,-1).every((r,s)=>r===e[s])?t[t.length-1]-e[e.length-1]:0}function npe(t,e,n){n===void 0&&(n=!1);let{routesMeta:r}=t,s={},i="/",o=[];for(let a=0;a{let{paramName:u,isOptional:p}=f;if(u==="*"){let m=a[l]||"";o=i.slice(0,i.length-m.length).replace(/(.)\/+$/,"$1")}const h=a[l];return p&&!h?d[u]=void 0:d[u]=(h||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:o,pattern:t}}function rpe(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),Bv(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],s="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,c)=>(r.push({paramName:a,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),s+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":t!==""&&t!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),r]}function spe(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Bv(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function sf(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function ipe(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:s=""}=typeof t=="string"?bf(t):t;return{pathname:n?n.startsWith("/")?n:ope(n,e):e,search:lpe(r),hash:cpe(s)}}function ope(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function LT(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function I8(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function JA(t,e){let n=I8(t);return e?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function eR(t,e,n,r){r===void 0&&(r=!1);let s;typeof t=="string"?s=bf(t):(s=tr({},t),Ot(!s.pathname||!s.pathname.includes("?"),LT("?","pathname","search",s)),Ot(!s.pathname||!s.pathname.includes("#"),LT("#","pathname","hash",s)),Ot(!s.search||!s.search.includes("#"),LT("#","search","hash",s)));let i=t===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=n;else{let l=e.length-1;if(!r&&o.startsWith("..")){let u=o.split("/");for(;u[0]==="..";)u.shift(),l-=1;s.pathname=u.join("/")}a=l>=0?e[l]:"/"}let c=ipe(s,a),d=o&&o!=="/"&&o.endsWith("/"),f=(i||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||f)&&(c.pathname+="/"),c}const au=t=>t.join("/").replace(/\/\/+/g,"/"),ape=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),lpe=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,cpe=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class gE{constructor(e,n,r,s){s===void 0&&(s=!1),this.status=e,this.statusText=n||"",this.internal=s,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function tR(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const L8=["post","put","patch","delete"],upe=new Set(L8),dpe=["get",...L8],fpe=new Set(dpe),hpe=new Set([301,302,303,307,308]),ppe=new Set([307,308]),$T={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},mpe={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Tm={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},iL=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gpe=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),$8="remix-router-transitions";function vpe(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",r=!n;Ot(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let s;if(t.mapRouteProperties)s=t.mapRouteProperties;else if(t.detectErrorBoundary){let re=t.detectErrorBoundary;s=ae=>({hasErrorBoundary:re(ae)})}else s=gpe;let i={},o=tx(t.routes,s,void 0,i),a,c=t.basename||"/",d=t.unstable_dataStrategy||_pe,f=t.unstable_patchRoutesOnMiss,l=tr({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},t.future),u=null,p=new Set,h=null,m=null,y=null,g=t.hydrationData!=null,v=Xf(o,t.history.location,c),b=null;if(v==null&&!f){let re=Ys(404,{pathname:t.history.location.pathname}),{matches:ae,route:ge}=oB(o);v=ae,b={[ge.id]:re}}v&&!t.hydrationData&&Vi(v,o,t.history.location.pathname).active&&(v=null);let _;if(v)if(v.some(re=>re.route.lazy))_=!1;else if(!v.some(re=>re.route.loader))_=!0;else if(l.v7_partialHydration){let re=t.hydrationData?t.hydrationData.loaderData:null,ae=t.hydrationData?t.hydrationData.errors:null,ge=_e=>_e.route.loader?typeof _e.route.loader=="function"&&_e.route.loader.hydrate===!0?!1:re&&re[_e.route.id]!==void 0||ae&&ae[_e.route.id]!==void 0:!0;if(ae){let _e=v.findIndex(ze=>ae[ze.route.id]!==void 0);_=v.slice(0,_e+1).every(ge)}else _=v.every(ge)}else _=t.hydrationData!=null;else if(_=!1,v=[],l.v7_partialHydration){let re=Vi(null,o,t.history.location.pathname);re.active&&re.matches&&(v=re.matches)}let A,P={historyAction:t.history.action,location:t.history.location,matches:v,initialized:_,navigation:$T,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||b,fetchers:new Map,blockers:new Map},T=Pr.Pop,E=!1,N,k=!1,M=new Map,j=null,I=!1,L=!1,H=[],K=new Set,V=new Map,U=0,Q=-1,te=new Map,X=new Set,G=new Map,Y=new Map,Z=new Set,he=new Map,fe=new Map,ce=new Map,xe=!1;function Pe(){if(u=t.history.listen(re=>{let{action:ae,location:ge,delta:_e}=re;if(xe){xe=!1;return}Bv(fe.size===0||_e!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ze=Nt({currentLocation:P.location,nextLocation:ge,historyAction:ae});if(ze&&_e!=null){xe=!0,t.history.go(_e*-1),yt(ze,{state:"blocked",location:ge,proceed(){yt(ze,{state:"proceeding",proceed:void 0,reset:void 0,location:ge}),t.history.go(_e)},reset(){let Ge=new Map(P.blockers);Ge.set(ze,Tm),Me({blockers:Ge})}});return}return nt(ae,ge)}),n){jpe(e,M);let re=()=>Ipe(e,M);e.addEventListener("pagehide",re),j=()=>e.removeEventListener("pagehide",re)}return P.initialized||nt(Pr.Pop,P.location,{initialHydration:!0}),A}function pe(){u&&u(),j&&j(),p.clear(),N&&N.abort(),P.fetchers.forEach((re,ae)=>_n(ae)),P.blockers.forEach((re,ae)=>Ze(ae))}function Le(re){return p.add(re),()=>p.delete(re)}function Me(re,ae){ae===void 0&&(ae={}),P=tr({},P,re);let ge=[],_e=[];l.v7_fetcherPersist&&P.fetchers.forEach((ze,Ge)=>{ze.state==="idle"&&(Z.has(Ge)?_e.push(Ge):ge.push(Ge))}),[...p].forEach(ze=>ze(P,{deletedFetchers:_e,unstable_viewTransitionOpts:ae.viewTransitionOpts,unstable_flushSync:ae.flushSync===!0})),l.v7_fetcherPersist&&(ge.forEach(ze=>P.fetchers.delete(ze)),_e.forEach(ze=>_n(ze)))}function Oe(re,ae,ge){var _e,ze;let{flushSync:Ge}=ge===void 0?{}:ge,ut=P.actionData!=null&&P.navigation.formMethod!=null&&Fa(P.navigation.formMethod)&&P.navigation.state==="loading"&&((_e=re.state)==null?void 0:_e._isRedirect)!==!0,Ie;ae.actionData?Object.keys(ae.actionData).length>0?Ie=ae.actionData:Ie=null:ut?Ie=P.actionData:Ie=null;let xt=ae.loaderData?sB(P.loaderData,ae.loaderData,ae.matches||[],ae.errors):P.loaderData,rt=P.blockers;rt.size>0&&(rt=new Map(rt),rt.forEach((tn,hn)=>rt.set(hn,Tm)));let st=E===!0||P.navigation.formMethod!=null&&Fa(P.navigation.formMethod)&&((ze=re.state)==null?void 0:ze._isRedirect)!==!0;a&&(o=a,a=void 0),I||T===Pr.Pop||(T===Pr.Push?t.history.push(re,re.state):T===Pr.Replace&&t.history.replace(re,re.state));let ln;if(T===Pr.Pop){let tn=M.get(P.location.pathname);tn&&tn.has(re.pathname)?ln={currentLocation:P.location,nextLocation:re}:M.has(re.pathname)&&(ln={currentLocation:re,nextLocation:P.location})}else if(k){let tn=M.get(P.location.pathname);tn?tn.add(re.pathname):(tn=new Set([re.pathname]),M.set(P.location.pathname,tn)),ln={currentLocation:P.location,nextLocation:re}}Me(tr({},ae,{actionData:Ie,loaderData:xt,historyAction:T,location:re,initialized:!0,navigation:$T,revalidation:"idle",restoreScrollPosition:Dr(re,ae.matches||P.matches),preventScrollReset:st,blockers:rt}),{viewTransitionOpts:ln,flushSync:Ge===!0}),T=Pr.Pop,E=!1,k=!1,I=!1,L=!1,H=[]}async function Fe(re,ae){if(typeof re=="number"){t.history.go(re);return}let ge=EM(P.location,P.matches,c,l.v7_prependBasename,re,l.v7_relativeSplatPath,ae==null?void 0:ae.fromRouteId,ae==null?void 0:ae.relative),{path:_e,submission:ze,error:Ge}=Qz(l.v7_normalizeFormMethod,!1,ge,ae),ut=P.location,Ie=ex(P.location,_e,ae&&ae.state);Ie=tr({},Ie,t.history.encodeLocation(Ie));let xt=ae&&ae.replace!=null?ae.replace:void 0,rt=Pr.Push;xt===!0?rt=Pr.Replace:xt===!1||ze!=null&&Fa(ze.formMethod)&&ze.formAction===P.location.pathname+P.location.search&&(rt=Pr.Replace);let st=ae&&"preventScrollReset"in ae?ae.preventScrollReset===!0:void 0,ln=(ae&&ae.unstable_flushSync)===!0,tn=Nt({currentLocation:ut,nextLocation:Ie,historyAction:rt});if(tn){yt(tn,{state:"blocked",location:Ie,proceed(){yt(tn,{state:"proceeding",proceed:void 0,reset:void 0,location:Ie}),Fe(re,ae)},reset(){let hn=new Map(P.blockers);hn.set(tn,Tm),Me({blockers:hn})}});return}return await nt(rt,Ie,{submission:ze,pendingError:Ge,preventScrollReset:st,replace:ae&&ae.replace,enableViewTransition:ae&&ae.unstable_viewTransition,flushSync:ln})}function ot(){if(gt(),Me({revalidation:"loading"}),P.navigation.state!=="submitting"){if(P.navigation.state==="idle"){nt(P.historyAction,P.location,{startUninterruptedRevalidation:!0});return}nt(T||P.historyAction,P.navigation.location,{overrideNavigation:P.navigation})}}async function nt(re,ae,ge){N&&N.abort(),N=null,T=re,I=(ge&&ge.startUninterruptedRevalidation)===!0,Cr(P.location,P.matches),E=(ge&&ge.preventScrollReset)===!0,k=(ge&&ge.enableViewTransition)===!0;let _e=a||o,ze=ge&&ge.overrideNavigation,Ge=Xf(_e,ae,c),ut=(ge&&ge.flushSync)===!0,Ie=Vi(Ge,_e,ae.pathname);if(Ie.active&&Ie.matches&&(Ge=Ie.matches),!Ge){let{error:Jt,notFoundMatches:Mr,route:lr}=St(ae.pathname);Oe(ae,{matches:Mr,loaderData:{},errors:{[lr.id]:Jt}},{flushSync:ut});return}if(P.initialized&&!L&&Ppe(P.location,ae)&&!(ge&&ge.submission&&Fa(ge.submission.formMethod))){Oe(ae,{matches:Ge},{flushSync:ut});return}N=new AbortController;let xt=gm(t.history,ae,N.signal,ge&&ge.submission),rt;if(ge&&ge.pendingError)rt=[Qm(Ge).route.id,{type:An.error,error:ge.pendingError}];else if(ge&&ge.submission&&Fa(ge.submission.formMethod)){let Jt=await At(xt,ae,ge.submission,Ge,Ie.active,{replace:ge.replace,flushSync:ut});if(Jt.shortCircuited)return;if(Jt.pendingActionResult){let[Mr,lr]=Jt.pendingActionResult;if(po(lr)&&tR(lr.error)&&lr.error.status===404){N=null,Oe(ae,{matches:Jt.matches,loaderData:{},errors:{[Mr]:lr.error}});return}}Ge=Jt.matches||Ge,rt=Jt.pendingActionResult,ze=FT(ae,ge.submission),ut=!1,Ie.active=!1,xt=gm(t.history,xt.url,xt.signal)}let{shortCircuited:st,matches:ln,loaderData:tn,errors:hn}=await ee(xt,ae,Ge,Ie.active,ze,ge&&ge.submission,ge&&ge.fetcherSubmission,ge&&ge.replace,ge&&ge.initialHydration===!0,ut,rt);st||(N=null,Oe(ae,tr({matches:ln||Ge},iB(rt),{loaderData:tn,errors:hn})))}async function At(re,ae,ge,_e,ze,Ge){Ge===void 0&&(Ge={}),gt();let ut=Mpe(ae,ge);if(Me({navigation:ut},{flushSync:Ge.flushSync===!0}),ze){let rt=await Yr(_e,ae.pathname,re.signal);if(rt.type==="aborted")return{shortCircuited:!0};if(rt.type==="error"){let{boundaryId:st,error:ln}=Wt(ae.pathname,rt);return{matches:rt.partialMatches,pendingActionResult:[st,{type:An.error,error:ln}]}}else if(rt.matches)_e=rt.matches;else{let{notFoundMatches:st,error:ln,route:tn}=St(ae.pathname);return{matches:st,pendingActionResult:[tn.id,{type:An.error,error:ln}]}}}let Ie,xt=Vb(_e,ae);if(!xt.route.action&&!xt.route.lazy)Ie={type:An.error,error:Ys(405,{method:re.method,pathname:ae.pathname,routeId:xt.route.id})};else if(Ie=(await tt("action",re,[xt],_e))[0],re.signal.aborted)return{shortCircuited:!0};if(sh(Ie)){let rt;return Ge&&Ge.replace!=null?rt=Ge.replace:rt=tB(Ie.response.headers.get("Location"),new URL(re.url),c)===P.location.pathname+P.location.search,await Ve(re,Ie,{submission:ge,replace:rt}),{shortCircuited:!0}}if(rh(Ie))throw Ys(400,{type:"defer-action"});if(po(Ie)){let rt=Qm(_e,xt.route.id);return(Ge&&Ge.replace)!==!0&&(T=Pr.Push),{matches:_e,pendingActionResult:[rt.route.id,Ie]}}return{matches:_e,pendingActionResult:[xt.route.id,Ie]}}async function ee(re,ae,ge,_e,ze,Ge,ut,Ie,xt,rt,st){let ln=ze||FT(ae,Ge),tn=Ge||ut||uB(ln),hn=!I&&(!l.v7_partialHydration||!xt);if(_e){if(hn){let Yn=de(st);Me(tr({navigation:ln},Yn!==void 0?{actionData:Yn}:{}),{flushSync:rt})}let Ct=await Yr(ge,ae.pathname,re.signal);if(Ct.type==="aborted")return{shortCircuited:!0};if(Ct.type==="error"){let{boundaryId:Yn,error:zs}=Wt(ae.pathname,Ct);return{matches:Ct.partialMatches,loaderData:{},errors:{[Yn]:zs}}}else if(Ct.matches)ge=Ct.matches;else{let{error:Yn,notFoundMatches:zs,route:In}=St(ae.pathname);return{matches:zs,loaderData:{},errors:{[In.id]:Yn}}}}let Jt=a||o,[Mr,lr]=Zz(t.history,P,ge,tn,ae,l.v7_partialHydration&&xt===!0,l.v7_skipActionErrorRevalidation,L,H,K,Z,G,X,Jt,c,st);if(Zt(Ct=>!(ge&&ge.some(Yn=>Yn.route.id===Ct))||Mr&&Mr.some(Yn=>Yn.route.id===Ct)),Q=++U,Mr.length===0&&lr.length===0){let Ct=$e();return Oe(ae,tr({matches:ge,loaderData:{},errors:st&&po(st[1])?{[st[0]]:st[1].error}:null},iB(st),Ct?{fetchers:new Map(P.fetchers)}:{}),{flushSync:rt}),{shortCircuited:!0}}if(hn){let Ct={};if(!_e){Ct.navigation=ln;let Yn=de(st);Yn!==void 0&&(Ct.actionData=Yn)}lr.length>0&&(Ct.fetchers=me(lr)),Me(Ct,{flushSync:rt})}lr.forEach(Ct=>{V.has(Ct.key)&&or(Ct.key),Ct.controller&&V.set(Ct.key,Ct.controller)});let sl=()=>lr.forEach(Ct=>or(Ct.key));N&&N.signal.addEventListener("abort",sl);let{loaderResults:il,fetcherResults:ma}=await qt(P.matches,ge,Mr,lr,re);if(re.signal.aborted)return{shortCircuited:!0};N&&N.signal.removeEventListener("abort",sl),lr.forEach(Ct=>V.delete(Ct.key));let ku=aB([...il,...ma]);if(ku){if(ku.idx>=Mr.length){let Ct=lr[ku.idx-Mr.length].key;X.add(Ct)}return await Ve(re,ku.result,{replace:Ie}),{shortCircuited:!0}}let{loaderData:Du,errors:No}=rB(P,ge,Mr,il,st,lr,ma,he);he.forEach((Ct,Yn)=>{Ct.subscribe(zs=>{(zs||Ct.done)&&he.delete(Yn)})}),l.v7_partialHydration&&xt&&P.errors&&Object.entries(P.errors).filter(Ct=>{let[Yn]=Ct;return!Mr.some(zs=>zs.route.id===Yn)}).forEach(Ct=>{let[Yn,zs]=Ct;No=Object.assign(No||{},{[Yn]:zs})});let Pf=$e(),Nf=Ye(Q),Tf=Pf||Nf||lr.length>0;return tr({matches:ge,loaderData:Du,errors:No},Tf?{fetchers:new Map(P.fetchers)}:{})}function de(re){if(re&&!po(re[1]))return{[re[0]]:re[1].data};if(P.actionData)return Object.keys(P.actionData).length===0?null:P.actionData}function me(re){return re.forEach(ae=>{let ge=P.fetchers.get(ae.key),_e=vb(void 0,ge?ge.data:void 0);P.fetchers.set(ae.key,_e)}),new Map(P.fetchers)}function Re(re,ae,ge,_e){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");V.has(re)&&or(re);let ze=(_e&&_e.unstable_flushSync)===!0,Ge=a||o,ut=EM(P.location,P.matches,c,l.v7_prependBasename,ge,l.v7_relativeSplatPath,ae,_e==null?void 0:_e.relative),Ie=Xf(Ge,ut,c),xt=Vi(Ie,Ge,ut);if(xt.active&&xt.matches&&(Ie=xt.matches),!Ie){an(re,ae,Ys(404,{pathname:ut}),{flushSync:ze});return}let{path:rt,submission:st,error:ln}=Qz(l.v7_normalizeFormMethod,!0,ut,_e);if(ln){an(re,ae,ln,{flushSync:ze});return}let tn=Vb(Ie,rt);if(E=(_e&&_e.preventScrollReset)===!0,st&&Fa(st.formMethod)){Ne(re,ae,rt,tn,Ie,xt.active,ze,st);return}G.set(re,{routeId:ae,path:rt}),Ee(re,ae,rt,tn,Ie,xt.active,ze,st)}async function Ne(re,ae,ge,_e,ze,Ge,ut,Ie){gt(),G.delete(re);function xt(In){if(!In.route.action&&!In.route.lazy){let To=Ys(405,{method:Ie.formMethod,pathname:ge,routeId:ae});return an(re,ae,To,{flushSync:ut}),!0}return!1}if(!Ge&&xt(_e))return;let rt=P.fetchers.get(re);kt(re,Ope(Ie,rt),{flushSync:ut});let st=new AbortController,ln=gm(t.history,ge,st.signal,Ie);if(Ge){let In=await Yr(ze,ge,ln.signal);if(In.type==="aborted")return;if(In.type==="error"){let{error:To}=Wt(ge,In);an(re,ae,To,{flushSync:ut});return}else if(In.matches){if(ze=In.matches,_e=Vb(ze,ge),xt(_e))return}else{an(re,ae,Ys(404,{pathname:ge}),{flushSync:ut});return}}V.set(re,st);let tn=U,Jt=(await tt("action",ln,[_e],ze))[0];if(ln.signal.aborted){V.get(re)===st&&V.delete(re);return}if(l.v7_fetcherPersist&&Z.has(re)){if(sh(Jt)||po(Jt)){kt(re,Yu(void 0));return}}else{if(sh(Jt))if(V.delete(re),Q>tn){kt(re,Yu(void 0));return}else return X.add(re),kt(re,vb(Ie)),Ve(ln,Jt,{fetcherSubmission:Ie});if(po(Jt)){an(re,ae,Jt.error);return}}if(rh(Jt))throw Ys(400,{type:"defer-action"});let Mr=P.navigation.location||P.location,lr=gm(t.history,Mr,st.signal),sl=a||o,il=P.navigation.state!=="idle"?Xf(sl,P.navigation.location,c):P.matches;Ot(il,"Didn't find any matches after fetcher action");let ma=++U;te.set(re,ma);let ku=vb(Ie,Jt.data);P.fetchers.set(re,ku);let[Du,No]=Zz(t.history,P,il,Ie,Mr,!1,l.v7_skipActionErrorRevalidation,L,H,K,Z,G,X,sl,c,[_e.route.id,Jt]);No.filter(In=>In.key!==re).forEach(In=>{let To=In.key,Gy=P.fetchers.get(To),sS=vb(void 0,Gy?Gy.data:void 0);P.fetchers.set(To,sS),V.has(To)&&or(To),In.controller&&V.set(To,In.controller)}),Me({fetchers:new Map(P.fetchers)});let Pf=()=>No.forEach(In=>or(In.key));st.signal.addEventListener("abort",Pf);let{loaderResults:Nf,fetcherResults:Tf}=await qt(P.matches,il,Du,No,lr);if(st.signal.aborted)return;st.signal.removeEventListener("abort",Pf),te.delete(re),V.delete(re),No.forEach(In=>V.delete(In.key));let Ct=aB([...Nf,...Tf]);if(Ct){if(Ct.idx>=Du.length){let In=No[Ct.idx-Du.length].key;X.add(In)}return Ve(lr,Ct.result)}let{loaderData:Yn,errors:zs}=rB(P,P.matches,Du,Nf,void 0,No,Tf,he);if(P.fetchers.has(re)){let In=Yu(Jt.data);P.fetchers.set(re,In)}Ye(ma),P.navigation.state==="loading"&&ma>Q?(Ot(T,"Expected pending action"),N&&N.abort(),Oe(P.navigation.location,{matches:il,loaderData:Yn,errors:zs,fetchers:new Map(P.fetchers)})):(Me({errors:zs,loaderData:sB(P.loaderData,Yn,il,zs),fetchers:new Map(P.fetchers)}),L=!1)}async function Ee(re,ae,ge,_e,ze,Ge,ut,Ie){let xt=P.fetchers.get(re);kt(re,vb(Ie,xt?xt.data:void 0),{flushSync:ut});let rt=new AbortController,st=gm(t.history,ge,rt.signal);if(Ge){let Jt=await Yr(ze,ge,st.signal);if(Jt.type==="aborted")return;if(Jt.type==="error"){let{error:Mr}=Wt(ge,Jt);an(re,ae,Mr,{flushSync:ut});return}else if(Jt.matches)ze=Jt.matches,_e=Vb(ze,ge);else{an(re,ae,Ys(404,{pathname:ge}),{flushSync:ut});return}}V.set(re,rt);let ln=U,hn=(await tt("loader",st,[_e],ze))[0];if(rh(hn)&&(hn=await H8(hn,st.signal,!0)||hn),V.get(re)===rt&&V.delete(re),!st.signal.aborted){if(Z.has(re)){kt(re,Yu(void 0));return}if(sh(hn))if(Q>ln){kt(re,Yu(void 0));return}else{X.add(re),await Ve(st,hn);return}if(po(hn)){an(re,ae,hn.error);return}Ot(!rh(hn),"Unhandled fetcher deferred data"),kt(re,Yu(hn.data))}}async function Ve(re,ae,ge){let{submission:_e,fetcherSubmission:ze,replace:Ge}=ge===void 0?{}:ge;ae.response.headers.has("X-Remix-Revalidate")&&(L=!0);let ut=ae.response.headers.get("Location");Ot(ut,"Expected a Location header on the redirect Response"),ut=tB(ut,new URL(re.url),c);let Ie=ex(P.location,ut,{_isRedirect:!0});if(n){let hn=!1;if(ae.response.headers.has("X-Remix-Reload-Document"))hn=!0;else if(iL.test(ut)){const Jt=t.history.createURL(ut);hn=Jt.origin!==e.location.origin||sf(Jt.pathname,c)==null}if(hn){Ge?e.location.replace(ut):e.location.assign(ut);return}}N=null;let xt=Ge===!0||ae.response.headers.has("X-Remix-Replace")?Pr.Replace:Pr.Push,{formMethod:rt,formAction:st,formEncType:ln}=P.navigation;!_e&&!ze&&rt&&st&&ln&&(_e=uB(P.navigation));let tn=_e||ze;if(ppe.has(ae.response.status)&&tn&&Fa(tn.formMethod))await nt(xt,Ie,{submission:tr({},tn,{formAction:ut}),preventScrollReset:E});else{let hn=FT(Ie,_e);await nt(xt,Ie,{overrideNavigation:hn,fetcherSubmission:ze,preventScrollReset:E})}}async function tt(re,ae,ge,_e){try{let ze=await Spe(d,re,ae,ge,_e,i,s);return await Promise.all(ze.map((Ge,ut)=>{if(Tpe(Ge)){let Ie=Ge.result;return{type:An.redirect,response:Ape(Ie,ae,ge[ut].route.id,_e,c,l.v7_relativeSplatPath)}}return Epe(Ge)}))}catch(ze){return ge.map(()=>({type:An.error,error:ze}))}}async function qt(re,ae,ge,_e,ze){let[Ge,...ut]=await Promise.all([ge.length?tt("loader",ze,ge,ae):[],..._e.map(Ie=>{if(Ie.matches&&Ie.match&&Ie.controller){let xt=gm(t.history,Ie.path,Ie.controller.signal);return tt("loader",xt,[Ie.match],Ie.matches).then(rt=>rt[0])}else return Promise.resolve({type:An.error,error:Ys(404,{pathname:Ie.path})})})]);return await Promise.all([cB(re,ge,Ge,Ge.map(()=>ze.signal),!1,P.loaderData),cB(re,_e.map(Ie=>Ie.match),ut,_e.map(Ie=>Ie.controller?Ie.controller.signal:null),!0)]),{loaderResults:Ge,fetcherResults:ut}}function gt(){L=!0,H.push(...Zt()),G.forEach((re,ae)=>{V.has(ae)&&(K.add(ae),or(ae))})}function kt(re,ae,ge){ge===void 0&&(ge={}),P.fetchers.set(re,ae),Me({fetchers:new Map(P.fetchers)},{flushSync:(ge&&ge.flushSync)===!0})}function an(re,ae,ge,_e){_e===void 0&&(_e={});let ze=Qm(P.matches,ae);_n(re),Me({errors:{[ze.route.id]:ge},fetchers:new Map(P.fetchers)},{flushSync:(_e&&_e.flushSync)===!0})}function gr(re){return l.v7_fetcherPersist&&(Y.set(re,(Y.get(re)||0)+1),Z.has(re)&&Z.delete(re)),P.fetchers.get(re)||mpe}function _n(re){let ae=P.fetchers.get(re);V.has(re)&&!(ae&&ae.state==="loading"&&te.has(re))&&or(re),G.delete(re),te.delete(re),X.delete(re),Z.delete(re),K.delete(re),P.fetchers.delete(re)}function di(re){if(l.v7_fetcherPersist){let ae=(Y.get(re)||0)-1;ae<=0?(Y.delete(re),Z.add(re)):Y.set(re,ae)}else _n(re);Me({fetchers:new Map(P.fetchers)})}function or(re){let ae=V.get(re);Ot(ae,"Expected fetch controller: "+re),ae.abort(),V.delete(re)}function fi(re){for(let ae of re){let ge=gr(ae),_e=Yu(ge.data);P.fetchers.set(ae,_e)}}function $e(){let re=[],ae=!1;for(let ge of X){let _e=P.fetchers.get(ge);Ot(_e,"Expected fetcher: "+ge),_e.state==="loading"&&(X.delete(ge),re.push(ge),ae=!0)}return fi(re),ae}function Ye(re){let ae=[];for(let[ge,_e]of te)if(_e0}function ht(re,ae){let ge=P.blockers.get(re)||Tm;return fe.get(re)!==ae&&fe.set(re,ae),ge}function Ze(re){P.blockers.delete(re),fe.delete(re)}function yt(re,ae){let ge=P.blockers.get(re)||Tm;Ot(ge.state==="unblocked"&&ae.state==="blocked"||ge.state==="blocked"&&ae.state==="blocked"||ge.state==="blocked"&&ae.state==="proceeding"||ge.state==="blocked"&&ae.state==="unblocked"||ge.state==="proceeding"&&ae.state==="unblocked","Invalid blocker state transition: "+ge.state+" -> "+ae.state);let _e=new Map(P.blockers);_e.set(re,ae),Me({blockers:_e})}function Nt(re){let{currentLocation:ae,nextLocation:ge,historyAction:_e}=re;if(fe.size===0)return;fe.size>1&&Bv(!1,"A router only supports one blocker at a time");let ze=Array.from(fe.entries()),[Ge,ut]=ze[ze.length-1],Ie=P.blockers.get(Ge);if(!(Ie&&Ie.state==="proceeding")&&ut({currentLocation:ae,nextLocation:ge,historyAction:_e}))return Ge}function St(re){let ae=Ys(404,{pathname:re}),ge=a||o,{matches:_e,route:ze}=oB(ge);return Zt(),{notFoundMatches:_e,route:ze,error:ae}}function Wt(re,ae){return{boundaryId:Qm(ae.partialMatches).route.id,error:Ys(400,{type:"route-discovery",pathname:re,message:ae.error!=null&&"message"in ae.error?ae.error:String(ae.error)})}}function Zt(re){let ae=[];return he.forEach((ge,_e)=>{(!re||re(_e))&&(ge.cancel(),ae.push(_e),he.delete(_e))}),ae}function ar(re,ae,ge){if(h=re,y=ae,m=ge||null,!g&&P.navigation===$T){g=!0;let _e=Dr(P.location,P.matches);_e!=null&&Me({restoreScrollPosition:_e})}return()=>{h=null,y=null,m=null}}function Nn(re,ae){return m&&m(re,ae.map(_e=>Whe(_e,P.loaderData)))||re.key}function Cr(re,ae){if(h&&y){let ge=Nn(re,ae);h[ge]=y()}}function Dr(re,ae){if(h){let ge=Nn(re,ae),_e=h[ge];if(typeof _e=="number")return _e}return null}function Vi(re,ae,ge){if(f)if(re){let _e=re[re.length-1].route;if(_e.path&&(_e.path==="*"||_e.path.endsWith("/*")))return{active:!0,matches:sC(ae,ge,c,!0)}}else return{active:!0,matches:sC(ae,ge,c,!0)||[]};return{active:!1,matches:null}}async function Yr(re,ae,ge){let _e=re,ze=_e.length>0?_e[_e.length-1].route:null;for(;;){let Ge=a==null,ut=a||o;try{await wpe(f,ae,_e,ut,i,s,ce,ge)}catch(st){return{type:"error",error:st,partialMatches:_e}}finally{Ge&&(o=[...o])}if(ge.aborted)return{type:"aborted"};let Ie=Xf(ut,ae,c),xt=!1;if(Ie){let st=Ie[Ie.length-1].route;if(st.index)return{type:"success",matches:Ie};if(st.path&&st.path.length>0)if(st.path==="*")xt=!0;else return{type:"success",matches:Ie}}let rt=sC(ut,ae,c,!0);if(!rt||_e.map(st=>st.route.id).join("-")===rt.map(st=>st.route.id).join("-"))return{type:"success",matches:xt?Ie:null};if(_e=rt,ze=_e[_e.length-1].route,ze.path==="*")return{type:"success",matches:_e}}}function sc(re){i={},a=tx(re,s,void 0,i)}function pa(re,ae){let ge=a==null;z8(re,ae,a||o,i,s),ge&&(o=[...o],Me({}))}return A={get basename(){return c},get future(){return l},get state(){return P},get routes(){return o},get window(){return e},initialize:Pe,subscribe:Le,enableScrollRestoration:ar,navigate:Fe,fetch:Re,revalidate:ot,createHref:re=>t.history.createHref(re),encodeLocation:re=>t.history.encodeLocation(re),getFetcher:gr,deleteFetcher:di,dispose:pe,getBlocker:ht,deleteBlocker:Ze,patchRoutes:pa,_internalFetchControllers:V,_internalActiveDeferreds:he,_internalSetRoutes:sc},A}function ype(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function EM(t,e,n,r,s,i,o,a){let c,d;if(o){c=[];for(let l of e)if(c.push(l),l.route.id===o){d=l;break}}else c=e,d=e[e.length-1];let f=eR(s||".",JA(c,i),sf(t.pathname,n)||t.pathname,a==="path");return s==null&&(f.search=t.search,f.hash=t.hash),(s==null||s===""||s===".")&&d&&d.route.index&&!oL(f.search)&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(f.pathname=f.pathname==="/"?n:au([n,f.pathname])),Sp(f)}function Qz(t,e,n,r){if(!r||!ype(r))return{path:n};if(r.formMethod&&!Dpe(r.formMethod))return{path:n,error:Ys(405,{method:r.formMethod})};let s=()=>({path:n,error:Ys(400,{type:"invalid-body"})}),i=r.formMethod||"get",o=t?i.toUpperCase():i.toLowerCase(),a=B8(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Fa(o))return s();let u=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((p,h)=>{let[m,y]=h;return""+p+m+"="+y+` `},""):String(r.body);return{path:n,submission:{formMethod:o,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:u}}}else if(r.formEncType==="application/json"){if(!Fa(o))return s();try{let u=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:o,formAction:a,formEncType:r.formEncType,formData:void 0,json:u,text:void 0}}}catch{return s()}}}Ot(typeof FormData=="function","FormData is not available in this environment");let c,d;if(r.formData)c=AM(r.formData),d=r.formData;else if(r.body instanceof FormData)c=AM(r.body),d=r.body;else if(r.body instanceof URLSearchParams)c=r.body,d=nB(c);else if(r.body==null)c=new URLSearchParams,d=new FormData;else try{c=new URLSearchParams(r.body),d=nB(c)}catch{return s()}let f={formMethod:o,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:d,json:void 0,text:void 0};if(Fa(f.formMethod))return{path:n,submission:f};let l=bf(n);return e&&l.search&&oL(l.search)&&c.append("index",""),l.search="?"+c,{path:Sp(l),submission:f}}function bpe(t,e){let n=t;if(e){let r=t.findIndex(s=>s.route.id===e);r>=0&&(n=t.slice(0,r))}return n}function Zz(t,e,n,r,s,i,o,a,c,d,f,l,u,p,h,m){let y=m?po(m[1])?m[1].error:m[1].data:void 0,g=t.createURL(e.location),v=t.createURL(s),b=m&&po(m[1])?m[0]:void 0,_=b?bpe(n,b):n,A=m?m[1].statusCode:void 0,P=o&&A&&A>=400,T=_.filter((N,k)=>{let{route:M}=N;if(M.lazy)return!0;if(M.loader==null)return!1;if(i)return typeof M.loader!="function"||M.loader.hydrate?!0:e.loaderData[M.id]===void 0&&(!e.errors||e.errors[M.id]===void 0);if(xpe(e.loaderData,e.matches[k],N)||c.some(L=>L===N.route.id))return!0;let j=e.matches[k],I=N;return Jz(N,tr({currentUrl:g,currentParams:j.params,nextUrl:v,nextParams:I.params},r,{actionResult:y,actionStatus:A,defaultShouldRevalidate:P?!1:a||g.pathname+g.search===v.pathname+v.search||g.search!==v.search||F8(j,I)}))}),E=[];return l.forEach((N,k)=>{if(i||!n.some(H=>H.route.id===N.routeId)||f.has(k))return;let M=Xf(p,N.path,h);if(!M){E.push({key:k,routeId:N.routeId,path:N.path,matches:null,match:null,controller:null});return}let j=e.fetchers.get(k),I=Vb(M,N.path),L=!1;u.has(k)?L=!1:d.has(k)?(d.delete(k),L=!0):j&&j.state!=="idle"&&j.data===void 0?L=a:L=Jz(I,tr({currentUrl:g,currentParams:e.matches[e.matches.length-1].params,nextUrl:v,nextParams:n[n.length-1].params},r,{actionResult:y,actionStatus:A,defaultShouldRevalidate:P?!1:a})),L&&E.push({key:k,routeId:N.routeId,path:N.path,matches:M,match:I,controller:new AbortController})}),[T,E]}function xpe(t,e,n){let r=!e||n.route.id!==e.route.id,s=t[n.route.id]===void 0;return r||s}function F8(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function Jz(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}async function wpe(t,e,n,r,s,i,o,a){let c=[e,...n.map(d=>d.route.id)].join("-");try{let d=o.get(c);d||(d=t({path:e,matches:n,patch:(f,l)=>{a.aborted||z8(f,l,r,s,i)}}),o.set(c,d)),d&&Npe(d)&&await d}finally{o.delete(c)}}function z8(t,e,n,r,s){if(t){var i;let o=r[t];Ot(o,"No route found to patch children into: routeId = "+t);let a=tx(e,s,[t,"patch",String(((i=o.children)==null?void 0:i.length)||"0")],r);o.children?o.children.push(...a):o.children=a}else{let o=tx(e,s,["patch",String(n.length||"0")],r);n.push(...o)}}async function eB(t,e,n){if(!t.lazy)return;let r=await t.lazy();if(!t.lazy)return;let s=n[t.id];Ot(s,"No route found in manifest");let i={};for(let o in r){let c=s[o]!==void 0&&o!=="hasErrorBoundary";Bv(!c,'Route "'+s.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!c&&!Vhe.has(o)&&(i[o]=r[o])}Object.assign(s,i),Object.assign(s,tr({},e(s),{lazy:void 0}))}function _pe(t){return Promise.all(t.matches.map(e=>e.resolve()))}async function Spe(t,e,n,r,s,i,o,a){let c=r.reduce((l,u)=>l.add(u.route.id),new Set),d=new Set,f=await t({matches:s.map(l=>{let u=c.has(l.route.id);return tr({},l,{shouldLoad:u,resolve:h=>(d.add(l.route.id),u?Cpe(e,n,l,i,o,h,a):Promise.resolve({type:An.data,result:void 0}))})}),request:n,params:s[0].params,context:a});return s.forEach(l=>Ot(d.has(l.route.id),'`match.resolve()` was not called for route id "'+l.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')),f.filter((l,u)=>c.has(s[u].route.id))}async function Cpe(t,e,n,r,s,i,o){let a,c,d=f=>{let l,u=new Promise((m,y)=>l=y);c=()=>l(),e.signal.addEventListener("abort",c);let p=m=>typeof f!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+t+'" [routeId: '+n.route.id+"]"))):f({request:e,params:n.params,context:o},...m!==void 0?[m]:[]),h;return i?h=i(m=>p(m)):h=(async()=>{try{return{type:"data",result:await p()}}catch(m){return{type:"error",result:m}}})(),Promise.race([h,u])};try{let f=n.route[t];if(n.route.lazy)if(f){let l,[u]=await Promise.all([d(f).catch(p=>{l=p}),eB(n.route,s,r)]);if(l!==void 0)throw l;a=u}else if(await eB(n.route,s,r),f=n.route[t],f)a=await d(f);else if(t==="action"){let l=new URL(e.url),u=l.pathname+l.search;throw Ys(405,{method:e.method,pathname:u,routeId:n.route.id})}else return{type:An.data,result:void 0};else if(f)a=await d(f);else{let l=new URL(e.url),u=l.pathname+l.search;throw Ys(404,{pathname:u})}Ot(a.result!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(f){return{type:An.error,result:f}}finally{c&&e.signal.removeEventListener("abort",c)}return a}async function Epe(t){let{result:e,type:n}=t;if(U8(e)){let d;try{let f=e.headers.get("Content-Type");f&&/\bapplication\/json\b/.test(f)?e.body==null?d=null:d=await e.json():d=await e.text()}catch(f){return{type:An.error,error:f}}return n===An.error?{type:An.error,error:new gE(e.status,e.statusText,d),statusCode:e.status,headers:e.headers}:{type:An.data,data:d,statusCode:e.status,headers:e.headers}}if(n===An.error){if(lB(e)){var r;if(e.data instanceof Error){var s;return{type:An.error,error:e.data,statusCode:(s=e.init)==null?void 0:s.status}}e=new gE(((r=e.init)==null?void 0:r.status)||500,void 0,e.data)}return{type:An.error,error:e,statusCode:tR(e)?e.status:void 0}}if(kpe(e)){var i,o;return{type:An.deferred,deferredData:e,statusCode:(i=e.init)==null?void 0:i.status,headers:((o=e.init)==null?void 0:o.headers)&&new Headers(e.init.headers)}}if(lB(e)){var a,c;return{type:An.data,data:e.data,statusCode:(a=e.init)==null?void 0:a.status,headers:(c=e.init)!=null&&c.headers?new Headers(e.init.headers):void 0}}return{type:An.data,data:e}}function Ape(t,e,n,r,s,i){let o=t.headers.get("Location");if(Ot(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!iL.test(o)){let a=r.slice(0,r.findIndex(c=>c.route.id===n)+1);o=EM(new URL(e.url),a,s,!0,o,i),t.headers.set("Location",o)}return t}function tB(t,e,n){if(iL.test(t)){let r=t,s=r.startsWith("//")?new URL(e.protocol+r):new URL(r),i=sf(s.pathname,n)!=null;if(s.origin===e.origin&&i)return s.pathname+s.search+s.hash}return t}function gm(t,e,n,r){let s=t.createURL(B8(e)).toString(),i={signal:n};if(r&&Fa(r.formMethod)){let{formMethod:o,formEncType:a}=r;i.method=o.toUpperCase(),a==="application/json"?(i.headers=new Headers({"Content-Type":a}),i.body=JSON.stringify(r.json)):a==="text/plain"?i.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?i.body=AM(r.formData):i.body=r.formData}return new Request(s,i)}function AM(t){let e=new URLSearchParams;for(let[n,r]of t.entries())e.append(n,typeof r=="string"?r:r.name);return e}function nB(t){let e=new FormData;for(let[n,r]of t.entries())e.append(n,r);return e}function Rpe(t,e,n,r,s,i){let o={},a=null,c,d=!1,f={},l=r&&po(r[1])?r[1].error:void 0;return n.forEach((u,p)=>{let h=e[p].route.id;if(Ot(!sh(u),"Cannot handle redirect results in processLoaderData"),po(u)){let m=u.error;l!==void 0&&(m=l,l=void 0),a=a||{};{let y=Qm(t,h);a[y.route.id]==null&&(a[y.route.id]=m)}o[h]=void 0,d||(d=!0,c=tR(u.error)?u.error.status:500),u.headers&&(f[h]=u.headers)}else rh(u)?(s.set(h,u.deferredData),o[h]=u.deferredData.data,u.statusCode!=null&&u.statusCode!==200&&!d&&(c=u.statusCode),u.headers&&(f[h]=u.headers)):(o[h]=u.data,u.statusCode&&u.statusCode!==200&&!d&&(c=u.statusCode),u.headers&&(f[h]=u.headers))}),l!==void 0&&r&&(a={[r[0]]:l},o[r[0]]=void 0),{loaderData:o,errors:a,statusCode:c||200,loaderHeaders:f}}function rB(t,e,n,r,s,i,o,a){let{loaderData:c,errors:d}=Rpe(e,n,r,s,a);for(let f=0;fr.route.id===e)+1):[...t]).reverse().find(r=>r.route.hasErrorBoundary===!0)||t[0]}function oB(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function Ys(t,e){let{pathname:n,routeId:r,method:s,type:i,message:o}=e===void 0?{}:e,a="Unknown Server Error",c="Unknown @remix-run/router error";return t===400?(a="Bad Request",i==="route-discovery"?c='Unable to match URL "'+n+'" - the `unstable_patchRoutesOnMiss()` '+(`function threw the following error: `+o):s&&n&&r?c="You made a "+s+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?c="defer() is not supported in actions":i==="invalid-body"&&(c="Unable to encode submission body")):t===403?(a="Forbidden",c='Route "'+r+'" does not match URL "'+n+'"'):t===404?(a="Not Found",c='No route matches URL "'+n+'"'):t===405&&(a="Method Not Allowed",s&&n&&r?c="You made a "+s.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":s&&(c='Invalid request method "'+s.toUpperCase()+'"')),new gE(t||500,a,new Error(c),!0)}function aB(t){for(let e=t.length-1;e>=0;e--){let n=t[e];if(sh(n))return{result:n,idx:e}}}function B8(t){let e=typeof t=="string"?bf(t):t;return Sp(tr({},e,{hash:""}))}function Ppe(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function Npe(t){return typeof t=="object"&&t!=null&&"then"in t}function Tpe(t){return U8(t.result)&&hpe.has(t.result.status)}function rh(t){return t.type===An.deferred}function po(t){return t.type===An.error}function sh(t){return(t&&t.type)===An.redirect}function lB(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function kpe(t){let e=t;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function U8(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function Dpe(t){return fpe.has(t.toLowerCase())}function Fa(t){return upe.has(t.toLowerCase())}async function cB(t,e,n,r,s,i){for(let o=0;ol.route.id===c.route.id),f=d!=null&&!F8(d,c)&&(i&&i[c.route.id])!==void 0;if(rh(a)&&(s||f)){let l=r[o];Ot(l,"Expected an AbortSignal for revalidating fetcher deferred result"),await H8(a,l,s).then(u=>{u&&(n[o]=u||n[o])})}}}async function H8(t,e,n){if(n===void 0&&(n=!1),!await t.deferredData.resolveData(e)){if(n)try{return{type:An.data,data:t.deferredData.unwrappedData}}catch(s){return{type:An.error,error:s}}return{type:An.data,data:t.deferredData.data}}}function oL(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function Vb(t,e){let n=typeof e=="string"?bf(e).search:e.search;if(t[t.length-1].route.index&&oL(n||""))return t[t.length-1];let r=I8(t);return r[r.length-1]}function uB(t){let{formMethod:e,formAction:n,formEncType:r,text:s,formData:i,json:o}=t;if(!(!e||!n||!r)){if(s!=null)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:void 0,text:s};if(i!=null)return{formMethod:e,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(o!==void 0)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function FT(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Mpe(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function vb(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Ope(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function Yu(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function jpe(t,e){try{let n=t.sessionStorage.getItem($8);if(n){let r=JSON.parse(n);for(let[s,i]of Object.entries(r||{}))i&&Array.isArray(i)&&e.set(s,new Set(i||[]))}}catch{}}function Ipe(t,e){if(e.size>0){let n={};for(let[r,s]of e)n[r]=[...s];try{t.sessionStorage.setItem($8,JSON.stringify(n))}catch(r){Bv(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** * React Router v6.26.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 Uv(){return Uv=Object.assign?Object.assign.bind():function(t){for(var e=1;e{a.current=!0}),S.useCallback(function(d,f){if(f===void 0&&(f={}),!a.current)return;if(typeof d=="number"){r.go(d);return}let l=eR(d,JSON.parse(o),i,f.relative==="path");t==null&&e!=="/"&&(l.pathname=l.pathname==="/"?e:au([e,l.pathname])),(f.replace?r.replace:r.push)(l,f.state,f)},[e,r,o,i,t])}const Fpe=S.createContext(null);function zpe(t){let e=S.useContext(Zl).outlet;return e&&S.createElement(Fpe.Provider,{value:t},e)}function Bpe(){let{matches:t}=S.useContext(Zl),e=t[t.length-1];return e?e.params:{}}function G8(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=S.useContext(xf),{matches:s}=S.useContext(Zl),{pathname:i}=wf(),o=JSON.stringify(JA(s,r.v7_relativeSplatPath));return S.useMemo(()=>eR(t,JSON.parse(o),i,n==="path"),[t,o,i,n])}function Upe(t,e,n,r){cy()||Ot(!1);let{navigator:s}=S.useContext(xf),{matches:i}=S.useContext(Zl),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let d=wf(),f;f=d;let l=f.pathname||"/",u=l;if(c!=="/"){let m=c.replace(/^\//,"").split("/");u="/"+l.replace(/^\//,"").split("/").slice(m.length).join("/")}let p=Xf(t,{pathname:u});return Gpe(p&&p.map(m=>Object.assign({},m,{params:Object.assign({},a,m.params),pathname:au([c,s.encodeLocation?s.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?c:au([c,s.encodeLocation?s.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),i,n,r)}function Hpe(){let t=Ype(),e=tR(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},e),n?S.createElement("pre",{style:s},n):null,null)}const Vpe=S.createElement(Hpe,null);class qpe extends S.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?S.createElement(Zl.Provider,{value:this.props.routeContext},S.createElement(q8.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Wpe(t){let{routeContext:e,match:n,children:r}=t,s=S.useContext(nR);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),S.createElement(Zl.Provider,{value:e},r)}function Gpe(t,e,n,r){var s;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var i;if(!n)return null;if(n.errors)t=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let o=t,a=(s=n)==null?void 0:s.errors;if(a!=null){let f=o.findIndex(l=>l.route.id&&(a==null?void 0:a[l.route.id])!==void 0);f>=0||Ot(!1),o=o.slice(0,Math.min(o.length,f+1))}let c=!1,d=-1;if(n&&r&&r.v7_partialHydration)for(let f=0;f=0?o=o.slice(0,d+1):o=[o[0]];break}}}return o.reduceRight((f,l,u)=>{let p,h=!1,m=null,y=null;n&&(p=a&&l.route.id?a[l.route.id]:void 0,m=l.route.errorElement||Vpe,c&&(d<0&&u===0?(Jpe("route-fallback"),h=!0,y=null):d===u&&(h=!0,y=l.route.hydrateFallbackElement||null)));let g=e.concat(o.slice(0,u+1)),v=()=>{let b;return p?b=m:h?b=y:l.route.Component?b=S.createElement(l.route.Component,null):l.route.element?b=l.route.element:b=f,S.createElement(Wpe,{match:l,routeContext:{outlet:f,matches:g,isDataRoute:n!=null},children:b})};return n&&(l.route.ErrorBoundary||l.route.errorElement||u===0)?S.createElement(qpe,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:v(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):v()},null)}var lL=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(lL||{}),nx=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}(nx||{});function K8(t){let e=S.useContext(nR);return e||Ot(!1),e}function Y8(t){let e=S.useContext(V8);return e||Ot(!1),e}function Kpe(t){let e=S.useContext(Zl);return e||Ot(!1),e}function X8(t){let e=Kpe(),n=e.matches[e.matches.length-1];return n.route.id||Ot(!1),n.route.id}function Ype(){var t;let e=S.useContext(q8),n=Y8(nx.UseRouteError),r=X8(nx.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}let Xpe=0;function Qpe(t){let{router:e,basename:n}=K8(lL.UseBlocker),r=Y8(nx.UseBlocker),[s,i]=S.useState(""),o=S.useCallback(a=>{if(typeof t!="function")return!!t;if(n==="/")return t(a);let{currentLocation:c,nextLocation:d,historyAction:f}=a;return t({currentLocation:Uv({},c,{pathname:sf(c.pathname,n)||c.pathname}),nextLocation:Uv({},d,{pathname:sf(d.pathname,n)||d.pathname}),historyAction:f})},[n,t]);return S.useEffect(()=>{let a=String(++Xpe);return i(a),()=>e.deleteBlocker(a)},[e]),S.useEffect(()=>{s!==""&&e.getBlocker(s,o)},[e,s,o]),s&&r.blockers.has(s)?r.blockers.get(s):Tm}function Zpe(){let{router:t}=K8(lL.UseNavigateStable),e=X8(nx.UseNavigateStable),n=S.useRef(!1);return W8(()=>{n.current=!0}),S.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?t.navigate(s):t.navigate(s,Uv({fromRouteId:e},i)))},[t,e])}const dB={};function Jpe(t,e,n){dB[t]||(dB[t]=!0)}function Q8(t){let{to:e,replace:n,state:r,relative:s}=t;cy()||Ot(!1);let{future:i,static:o}=S.useContext(xf),{matches:a}=S.useContext(Zl),{pathname:c}=wf(),d=Fs(),f=eR(e,JA(a,i.v7_relativeSplatPath),c,s==="path"),l=JSON.stringify(f);return S.useEffect(()=>d(JSON.parse(l),{replace:n,state:r,relative:s}),[d,l,s,n,r]),null}function c1(t){return zpe(t.context)}function eme(t){let{basename:e="/",children:n=null,location:r,navigationType:s=Pr.Pop,navigator:i,static:o=!1,future:a}=t;cy()&&Ot(!1);let c=e.replace(/^\/*/,"/"),d=S.useMemo(()=>({basename:c,navigator:i,static:o,future:Uv({v7_relativeSplatPath:!1},a)}),[c,a,i,o]);typeof r=="string"&&(r=bf(r));let{pathname:f="/",search:l="",hash:u="",state:p=null,key:h="default"}=r,m=S.useMemo(()=>{let y=sf(f,c);return y==null?null:{location:{pathname:y,search:l,hash:u,state:p,key:h},navigationType:s}},[c,f,l,u,p,h,s]);return m==null?null:S.createElement(xf.Provider,{value:d},S.createElement(aL.Provider,{children:n,value:m}))}new Promise(()=>{});function tme(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:S.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(e,{hydrateFallbackElement:S.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:S.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}/** * React Router DOM v6.26.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 rx(){return rx=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[s]=t[s]);return n}function rme(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function sme(t,e){return t.button===0&&(!e||e==="_self")&&!rme(t)}function RM(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function ime(t,e){let n=RM(t);return e&&e.forEach((r,s)=>{n.has(s)||e.getAll(s).forEach(i=>{n.append(s,i)})}),n}const ome=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],ame="6";try{window.__reactRouterVersion=ame}catch{}function lme(t,e){return vpe({basename:e==null?void 0:e.basename,future:rx({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:Bhe({window:e==null?void 0:e.window}),hydrationData:(e==null?void 0:e.hydrationData)||cme(),routes:t,mapRouteProperties:tme,unstable_dataStrategy:e==null?void 0:e.unstable_dataStrategy,unstable_patchRoutesOnMiss:e==null?void 0:e.unstable_patchRoutesOnMiss,window:e==null?void 0:e.window}).initialize()}function cme(){var t;let e=(t=window)==null?void 0:t.__staticRouterHydrationData;return e&&e.errors&&(e=rx({},e,{errors:ume(e.errors)})),e}function ume(t){if(!t)return null;let e=Object.entries(t),n={};for(let[r,s]of e)if(s&&s.__type==="RouteErrorResponse")n[r]=new gE(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let i=window[s.__subType];if(typeof i=="function")try{let o=new i(s.message);o.stack="",n[r]=o}catch{}}if(n[r]==null){let i=new Error(s.message);i.stack="",n[r]=i}}else n[r]=s;return n}const dme=S.createContext({isTransitioning:!1}),fme=S.createContext(new Map),hme="startTransition",fB=a_[hme],pme="flushSync",hB=Kfe[pme];function mme(t){fB?fB(t):t()}function yb(t){hB?hB(t):t()}class gme{constructor(){this.status="pending",this.promise=new Promise((e,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function vme(t){let{fallbackElement:e,router:n,future:r}=t,[s,i]=S.useState(n.state),[o,a]=S.useState(),[c,d]=S.useState({isTransitioning:!1}),[f,l]=S.useState(),[u,p]=S.useState(),[h,m]=S.useState(),y=S.useRef(new Map),{v7_startTransition:g}=r||{},v=S.useCallback(E=>{g?mme(E):E()},[g]),b=S.useCallback((E,N)=>{let{deletedFetchers:k,unstable_flushSync:M,unstable_viewTransitionOpts:j}=N;k.forEach(L=>y.current.delete(L)),E.fetchers.forEach((L,H)=>{L.data!==void 0&&y.current.set(H,L.data)});let I=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!j||I){M?yb(()=>i(E)):v(()=>i(E));return}if(M){yb(()=>{u&&(f&&f.resolve(),u.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:j.currentLocation,nextLocation:j.nextLocation})});let L=n.window.document.startViewTransition(()=>{yb(()=>i(E))});L.finished.finally(()=>{yb(()=>{l(void 0),p(void 0),a(void 0),d({isTransitioning:!1})})}),yb(()=>p(L));return}u?(f&&f.resolve(),u.skipTransition(),m({state:E,currentLocation:j.currentLocation,nextLocation:j.nextLocation})):(a(E),d({isTransitioning:!0,flushSync:!1,currentLocation:j.currentLocation,nextLocation:j.nextLocation}))},[n.window,u,f,y,v]);S.useLayoutEffect(()=>n.subscribe(b),[n,b]),S.useEffect(()=>{c.isTransitioning&&!c.flushSync&&l(new gme)},[c]),S.useEffect(()=>{if(f&&o&&n.window){let E=o,N=f.promise,k=n.window.document.startViewTransition(async()=>{v(()=>i(E)),await N});k.finished.finally(()=>{l(void 0),p(void 0),a(void 0),d({isTransitioning:!1})}),p(k)}},[v,o,f,n.window]),S.useEffect(()=>{f&&o&&s.location.key===o.location.key&&f.resolve()},[f,u,s.location,o]),S.useEffect(()=>{!c.isTransitioning&&h&&(a(h.state),d({isTransitioning:!0,flushSync:!1,currentLocation:h.currentLocation,nextLocation:h.nextLocation}),m(void 0))},[c.isTransitioning,h]),S.useEffect(()=>{},[]);let _=S.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:E=>n.navigate(E),push:(E,N,k)=>n.navigate(E,{state:N,preventScrollReset:k==null?void 0:k.preventScrollReset}),replace:(E,N,k)=>n.navigate(E,{replace:!0,state:N,preventScrollReset:k==null?void 0:k.preventScrollReset})}),[n]),A=n.basename||"/",P=S.useMemo(()=>({router:n,navigator:_,static:!1,basename:A}),[n,_,A]),T=S.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return S.createElement(S.Fragment,null,S.createElement(nR.Provider,{value:P},S.createElement(V8.Provider,{value:s},S.createElement(fme.Provider,{value:y.current},S.createElement(dme.Provider,{value:c},S.createElement(eme,{basename:A,location:s.location,navigationType:s.historyAction,navigator:_,future:T},s.initialized||n.future.v7_partialHydration?S.createElement(yme,{routes:n.routes,future:n.future,state:s}):e))))),null)}const yme=S.memo(bme);function bme(t){let{routes:e,future:n,state:r}=t;return Upe(e,void 0,r,n)}const xme=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",wme=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,eu=S.forwardRef(function(e,n){let{onClick:r,relative:s,reloadDocument:i,replace:o,state:a,target:c,to:d,preventScrollReset:f,unstable_viewTransition:l}=e,u=nme(e,ome),{basename:p}=S.useContext(xf),h,m=!1;if(typeof d=="string"&&wme.test(d)&&(h=d,xme))try{let b=new URL(window.location.href),_=d.startsWith("//")?new URL(b.protocol+d):new URL(d),A=sf(_.pathname,p);_.origin===b.origin&&A!=null?d=A+_.search+_.hash:m=!0}catch{}let y=Lpe(d,{relative:s}),g=_me(d,{replace:o,state:a,target:c,preventScrollReset:f,relative:s,unstable_viewTransition:l});function v(b){r&&r(b),b.defaultPrevented||g(b)}return S.createElement("a",rx({},u,{href:h||y,onClick:m||i?r:v,ref:n,target:c}))});var pB;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(pB||(pB={}));var mB;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(mB||(mB={}));function _me(t,e){let{target:n,replace:r,state:s,preventScrollReset:i,relative:o,unstable_viewTransition:a}=e===void 0?{}:e,c=Fs(),d=wf(),f=G8(t,{relative:o});return S.useCallback(l=>{if(sme(l,n)){l.preventDefault();let u=r!==void 0?r:Sp(d)===Sp(f);c(t,{replace:u,state:s,preventScrollReset:i,relative:o,unstable_viewTransition:a})}},[d,c,f,r,s,n,t,i,o,a])}function Sme(t){let e=S.useRef(RM(t)),n=S.useRef(!1),r=wf(),s=S.useMemo(()=>ime(r.search,n.current?null:e.current),[r.search]),i=Fs(),o=S.useCallback((a,c)=>{const d=RM(typeof a=="function"?a(s):a);n.current=!0,i("?"+d,c)},[i,s]);return[s,o]}const Cme=3,Eme=1e6;let zT=0;function Ame(){return zT=(zT+1)%Number.MAX_SAFE_INTEGER,zT.toString()}const BT=new Map,gB=t=>{if(BT.has(t))return;const e=setTimeout(()=>{BT.delete(t),w0({type:"REMOVE_TOAST",toastId:t})},Eme);BT.set(t,e)},Rme=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,Cme)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?gB(n):t.toasts.forEach(r=>{gB(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},iC=[];let oC={toasts:[]};function w0(t){oC=Rme(oC,t),iC.forEach(e=>{e(oC)})}function Pme({...t}){const e=Ame(),n=s=>w0({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>w0({type:"DISMISS_TOAST",toastId:e});return w0({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:n}}function Jl(){const[t,e]=S.useState(oC);return S.useEffect(()=>(iC.push(e),()=>{const n=iC.indexOf(e);n>-1&&iC.splice(n,1)}),[t]),{...t,toast:Pme,dismiss:n=>w0({type:"DISMISS_TOAST",toastId:n})}}const Nme=t=>{const{toast:e}=Jl(),{onSuccess:n,onError:r,...s}=t||{},i=bu(),{login:o}=QA(),a=Fs();return jl({mutationKey:i().auth().action("login").get(),mutationFn:o,onSuccess:(c,d,f)=>{const{success:l,redirectTo:u}=c;l&&a(u||"/quotes"),n&&n(c,d,f)},onError:(c,d,f)=>{const{message:l}=c;console.error(l),e({description:l,title:"Error"}),r&&r(c,d,f)},...s})};function Tme(t,e){const n=S.createContext(e);function r(i){const{children:o,...a}=i,c=S.useMemo(()=>a,Object.values(a));return x.jsx(n.Provider,{value:c,children:o})}function s(i){const o=S.useContext(n);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return r.displayName=t+"Provider",[r,s]}function jn(t,e=[]){let n=[];function r(i,o){const a=S.createContext(o),c=n.length;n=[...n,o];function d(l){const{scope:u,children:p,...h}=l,m=(u==null?void 0:u[t][c])||a,y=S.useMemo(()=>h,Object.values(h));return x.jsx(m.Provider,{value:y,children:p})}function f(l,u){const p=(u==null?void 0:u[t][c])||a,h=S.useContext(p);if(h)return h;if(o!==void 0)return o;throw new Error(`\`${l}\` must be used within \`${i}\``)}return d.displayName=i+"Provider",[d,f]}const s=()=>{const i=n.map(o=>S.createContext(o));return function(a){const c=(a==null?void 0:a[t])||i;return S.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return s.scopeName=t,[r,kme(s,...e)]}function kme(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:c,scopeName:d})=>{const l=c(i)[`__scope${d}`];return{...a,...l}},{});return S.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function Dme(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function f_(...t){return e=>t.forEach(n=>Dme(n,e))}function et(...t){return S.useCallback(f_(...t),t)}var Ya=S.forwardRef((t,e)=>{const{children:n,...r}=t,s=S.Children.toArray(n),i=s.find(Mme);if(i){const o=i.props.children,a=s.map(c=>c===i?S.Children.count(o)>1?S.Children.only(null):S.isValidElement(o)?o.props.children:null:c);return x.jsx(PM,{...r,ref:e,children:S.isValidElement(o)?S.cloneElement(o,void 0,a):null})}return x.jsx(PM,{...r,ref:e,children:n})});Ya.displayName="Slot";var PM=S.forwardRef((t,e)=>{const{children:n,...r}=t;if(S.isValidElement(n)){const s=jme(n);return S.cloneElement(n,{...Ome(r,n.props),ref:e?f_(e,s):s})}return S.Children.count(n)>1?S.Children.only(null):null});PM.displayName="SlotClone";var cL=({children:t})=>x.jsx(x.Fragment,{children:t});function Mme(t){return S.isValidElement(t)&&t.type===cL}function Ome(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...a)=>{i(...a),s(...a)}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function jme(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function Au(t){const e=t+"CollectionProvider",[n,r]=jn(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:h,children:m}=p,y=oe.useRef(null),g=oe.useRef(new Map).current;return x.jsx(s,{scope:h,itemMap:g,collectionRef:y,children:m})};o.displayName=e;const a=t+"CollectionSlot",c=oe.forwardRef((p,h)=>{const{scope:m,children:y}=p,g=i(a,m),v=et(h,g.collectionRef);return x.jsx(Ya,{ref:v,children:y})});c.displayName=a;const d=t+"CollectionItemSlot",f="data-radix-collection-item",l=oe.forwardRef((p,h)=>{const{scope:m,children:y,...g}=p,v=oe.useRef(null),b=et(h,v),_=i(d,m);return oe.useEffect(()=>(_.itemMap.set(v,{ref:v,...g}),()=>void _.itemMap.delete(v))),x.jsx(Ya,{[f]:"",ref:b,children:y})});l.displayName=d;function u(p){const h=i(t+"CollectionConsumer",p);return oe.useCallback(()=>{const y=h.collectionRef.current;if(!y)return[];const g=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(h.itemMap.values()).sort((_,A)=>g.indexOf(_.ref.current)-g.indexOf(A.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:o,Slot:c,ItemSlot:l},u,r]}function ye(t,e,{checkForDefaultPrevented:n=!0}={}){return function(s){if(t==null||t(s),n===!1||!s.defaultPrevented)return e==null?void 0:e(s)}}function on(t){const e=S.useRef(t);return S.useEffect(()=>{e.current=t}),S.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function mr({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,s]=Ime({defaultProp:e,onChange:n}),i=t!==void 0,o=i?t:r,a=on(n),c=S.useCallback(d=>{if(i){const l=typeof d=="function"?d(t):d;l!==t&&a(l)}else s(d)},[i,t,s,a]);return[o,c]}function Ime({defaultProp:t,onChange:e}){const n=S.useState(t),[r]=n,s=S.useRef(r),i=on(e);return S.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}var Lme=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],De=Lme.reduce((t,e)=>{const n=S.forwardRef((r,s)=>{const{asChild:i,...o}=r,a=i?Ya:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...o,ref:s})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function sx(t,e){t&&rs.flushSync(()=>t.dispatchEvent(e))}var ir=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{};function $me(t,e){return S.useReducer((n,r)=>e[n][r]??n,t)}var Kn=t=>{const{present:e,children:n}=t,r=Fme(e),s=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),i=et(r.ref,zme(s));return typeof n=="function"||r.isPresent?S.cloneElement(s,{ref:i}):null};Kn.displayName="Presence";function Fme(t){const[e,n]=S.useState(),r=S.useRef({}),s=S.useRef(t),i=S.useRef("none"),o=t?"mounted":"unmounted",[a,c]=$me(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const d=u1(r.current);i.current=a==="mounted"?d:"none"},[a]),ir(()=>{const d=r.current,f=s.current;if(f!==t){const u=i.current,p=u1(d);t?c("MOUNT"):p==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(f&&u!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,c]),ir(()=>{if(e){const d=l=>{const p=u1(r.current).includes(l.animationName);l.target===e&&p&&rs.flushSync(()=>c("ANIMATION_END"))},f=l=>{l.target===e&&(i.current=u1(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:S.useCallback(d=>{d&&(r.current=getComputedStyle(d)),n(d)},[])}}function u1(t){return(t==null?void 0:t.animationName)||"none"}function zme(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Bme=a_.useId||(()=>{}),Ume=0;function Ls(t){const[e,n]=S.useState(Bme());return ir(()=>{n(r=>r??String(Ume++))},[t]),e?`radix-${e}`:""}var uL="Collapsible",[Hme,Z8]=jn(uL),[Vme,dL]=Hme(uL),J8=S.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:o,...a}=t,[c=!1,d]=mr({prop:r,defaultProp:s,onChange:o});return x.jsx(Vme,{scope:n,disabled:i,contentId:Ls(),open:c,onOpenToggle:S.useCallback(()=>d(f=>!f),[d]),children:x.jsx(De.div,{"data-state":hL(c),"data-disabled":i?"":void 0,...a,ref:e})})});J8.displayName=uL;var eq="CollapsibleTrigger",tq=S.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,s=dL(eq,n);return x.jsx(De.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":hL(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:e,onClick:ye(t.onClick,s.onOpenToggle)})});tq.displayName=eq;var fL="CollapsibleContent",nq=S.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=dL(fL,t.__scopeCollapsible);return x.jsx(Kn,{present:n||s.open,children:({present:i})=>x.jsx(qme,{...r,ref:e,present:i})})});nq.displayName=fL;var qme=S.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=t,o=dL(fL,n),[a,c]=S.useState(r),d=S.useRef(null),f=et(e,d),l=S.useRef(0),u=l.current,p=S.useRef(0),h=p.current,m=o.open||a,y=S.useRef(m),g=S.useRef();return S.useEffect(()=>{const v=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(v)},[]),ir(()=>{const v=d.current;if(v){g.current=g.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const b=v.getBoundingClientRect();l.current=b.height,p.current=b.width,y.current||(v.style.transitionDuration=g.current.transitionDuration,v.style.animationName=g.current.animationName),c(r)}},[o.open,r]),x.jsx(De.div,{"data-state":hL(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!m,...i,ref:f,style:{"--radix-collapsible-content-height":u?`${u}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...t.style},children:m&&s})});function hL(t){return t?"open":"closed"}var Wme=J8,Gme=tq,Kme=nq,Yme=S.createContext(void 0);function tl(t){const e=S.useContext(Yme);return t||e||"ltr"}var Ru="Accordion",Xme=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[pL,Qme,Zme]=Au(Ru),[rR,MUe]=jn(Ru,[Zme,Z8]),mL=Z8(),Jme=oe.forwardRef((t,e)=>{const{type:n,...r}=t,s=r,i=r;return x.jsx(pL.Provider,{scope:t.__scopeAccordion,children:n==="multiple"?x.jsx(rge,{...i,ref:e}):x.jsx(nge,{...s,ref:e})})});Jme.displayName=Ru;var[rq,ege]=rR(Ru),[sq,tge]=rR(Ru,{collapsible:!1}),nge=oe.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:i=!1,...o}=t,[a,c]=mr({prop:n,defaultProp:r,onChange:s});return x.jsx(rq,{scope:t.__scopeAccordion,value:a?[a]:[],onItemOpen:c,onItemClose:oe.useCallback(()=>i&&c(""),[i,c]),children:x.jsx(sq,{scope:t.__scopeAccordion,collapsible:i,children:x.jsx(iq,{...o,ref:e})})})}),rge=oe.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=t,[o=[],a]=mr({prop:n,defaultProp:r,onChange:s}),c=oe.useCallback(f=>a((l=[])=>[...l,f]),[a]),d=oe.useCallback(f=>a((l=[])=>l.filter(u=>u!==f)),[a]);return x.jsx(rq,{scope:t.__scopeAccordion,value:o,onItemOpen:c,onItemClose:d,children:x.jsx(sq,{scope:t.__scopeAccordion,collapsible:!0,children:x.jsx(iq,{...i,ref:e})})})}),[sge,sR]=rR(Ru),iq=oe.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:i="vertical",...o}=t,a=oe.useRef(null),c=et(a,e),d=Qme(n),l=tl(s)==="ltr",u=ye(t.onKeyDown,p=>{var E;if(!Xme.includes(p.key))return;const h=p.target,m=d().filter(N=>{var k;return!((k=N.ref.current)!=null&&k.disabled)}),y=m.findIndex(N=>N.ref.current===h),g=m.length;if(y===-1)return;p.preventDefault();let v=y;const b=0,_=g-1,A=()=>{v=y+1,v>_&&(v=b)},P=()=>{v=y-1,v{const{__scopeAccordion:n,value:r,...s}=t,i=sR(vE,n),o=ege(vE,n),a=mL(n),c=Ls(),d=r&&o.value.includes(r)||!1,f=i.disabled||t.disabled;return x.jsx(ige,{scope:n,open:d,disabled:f,triggerId:c,children:x.jsx(Wme,{"data-orientation":i.orientation,"data-state":fq(d),...a,...s,ref:e,disabled:f,open:d,onOpenChange:l=>{l?o.onItemOpen(r):o.onItemClose(r)}})})});oq.displayName=vE;var aq="AccordionHeader",lq=oe.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=sR(Ru,n),i=gL(aq,n);return x.jsx(De.h3,{"data-orientation":s.orientation,"data-state":fq(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:e})});lq.displayName=aq;var NM="AccordionTrigger",cq=oe.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=sR(Ru,n),i=gL(NM,n),o=tge(NM,n),a=mL(n);return x.jsx(pL.ItemSlot,{scope:n,children:x.jsx(Gme,{"aria-disabled":i.open&&!o.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...a,...r,ref:e})})});cq.displayName=NM;var uq="AccordionContent",dq=oe.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=sR(Ru,n),i=gL(uq,n),o=mL(n);return x.jsx(Kme,{role:"region","aria-labelledby":i.triggerId,"data-orientation":s.orientation,...o,...r,ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}})});dq.displayName=uq;function fq(t){return t?"open":"closed"}var oge=oq,age=lq,hq=cq,pq=dq;/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const lge=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),mq=(...t)=>t.filter((e,n,r)=>!!e&&r.indexOf(e)===n).join(" ");/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var cge={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.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const uge=S.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...a},c)=>S.createElement("svg",{ref:c,...cge,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:mq("lucide",s),...a},[...o.map(([d,f])=>S.createElement(d,f)),...Array.isArray(i)?i:[i]]));/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _t=(t,e)=>{const n=S.forwardRef(({className:r,...s},i)=>S.createElement(uge,{ref:i,iconNode:e,className:mq(`lucide-${lge(t)}`,r),...s}));return n.displayName=`${t}`,n};/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gq=_t("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dge=_t("ArrowDownUp",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"m21 8-4-4-4 4",key:"1c9v7m"}],["path",{d:"M17 4v16",key:"7dpous"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vB=_t("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yB=_t("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const fge=_t("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.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const h_=_t("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const uy=_t("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.427.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("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dy=_t("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vq=_t("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const hge=_t("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const pge=_t("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yq=_t("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bq=_t("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const mge=_t("CirclePlus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gge=_t("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vge=_t("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const oR=_t("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yge=_t("CopyPlus",[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vL=_t("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xq=_t("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bge=_t("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wq=_t("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xge=_t("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wge=_t("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _q=_t("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _ge=_t("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.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Sge=_t("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Cge=_t("Loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ege=_t("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Age=_t("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.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Rge=_t("Package2",[["path",{d:"M3 9h18v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9Z",key:"1ront0"}],["path",{d:"m3 9 2.45-4.9A2 2 0 0 1 7.24 3h9.52a2 2 0 0 1 1.8 1.1L21 9",key:"19h2x1"}],["path",{d:"M12 3v6",key:"1holv5"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Sq=_t("PackagePlus",[["path",{d:"M16 16h6",key:"100bgy"}],["path",{d:"M19 13v6",key:"85cyf1"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Cq=_t("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Eq=_t("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Pge=_t("Scan",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Aq=_t("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Nge=_t("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Tge=_t("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const kge=_t("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Rq=_t("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Pq=_t("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const aR=_t("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Nq(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e{const e=Oge(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{const a=o.split(yL);return a[0]===""&&a.length!==1&&a.shift(),Tq(a,e)||Mge(o)},getConflictingClassGroupIds:(o,a)=>{const c=n[o]||[];return a&&r[o]?[...c,...r[o]]:c}}},Tq=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),s=r?Tq(t.slice(1),r):void 0;if(s)return s;if(e.validators.length===0)return;const i=t.join(yL);return(o=e.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},bB=/^\[(.+)\]$/,Mge=t=>{if(bB.test(t)){const e=bB.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},Oge=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return Ige(Object.entries(t.classGroups),n).forEach(([i,o])=>{TM(o,r,i,e)}),r},TM=(t,e,n,r)=>{t.forEach(s=>{if(typeof s=="string"){const i=s===""?e:xB(e,s);i.classGroupId=n;return}if(typeof s=="function"){if(jge(s)){TM(s(r),e,n,r);return}e.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{TM(o,xB(e,i),n,r)})})},xB=(t,e)=>{let n=t;return e.split(yL).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},jge=t=>t.isThemeGetter,Ige=(t,e)=>e?t.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[e+o,a])):i);return[n,s]}):t,Lge=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),e++,e>t&&(e=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return s(i,o),o},set(i,o){n.has(i)?n.set(i,o):s(i,o)}}},kq="!",$ge=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,s=e[0],i=e.length,o=a=>{const c=[];let d=0,f=0,l;for(let y=0;yf?l-f:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:m}};return n?a=>n({className:a,parseClassName:o}):o},Fge=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},zge=t=>({cache:Lge(t.cacheSize),parseClassName:$ge(t),...Dge(t)}),Bge=/\s+/,Uge=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=e,i=[],o=t.trim().split(Bge);let a="";for(let c=o.length-1;c>=0;c-=1){const d=o[c],{modifiers:f,hasImportantModifier:l,baseClassName:u,maybePostfixModifierPosition:p}=n(d);let h=!!p,m=r(h?u.substring(0,p):u);if(!m){if(!h){a=d+(a.length>0?" "+a:a);continue}if(m=r(u),!m){a=d+(a.length>0?" "+a:a);continue}h=!1}const y=Fge(f).join(":"),g=l?y+kq:y,v=g+m;if(i.includes(v))continue;i.push(v);const b=s(m,h);for(let _=0;_0?" "+a:a)}return a};function Hge(){let t=0,e,n,r="";for(;t{if(typeof t=="string")return t;let e,n="";for(let r=0;rl(f),t());return n=zge(d),r=n.cache.get,s=n.cache.set,i=a,a(c)}function a(c){const d=r(c);if(d)return d;const f=Uge(c,n);return s(c,f),f}return function(){return i(Hge.apply(null,arguments))}}const Hn=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},Mq=/^\[(?:([a-z-]+):)?(.+)\]$/i,qge=/^\d+\/\d+$/,Wge=new Set(["px","full","screen"]),Gge=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Kge=/\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$/,Yge=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Xge=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Qge=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pc=t=>ug(t)||Wge.has(t)||qge.test(t),Hu=t=>hy(t,"length",ive),ug=t=>!!t&&!Number.isNaN(Number(t)),UT=t=>hy(t,"number",ug),bb=t=>!!t&&Number.isInteger(Number(t)),Zge=t=>t.endsWith("%")&&ug(t.slice(0,-1)),Pt=t=>Mq.test(t),Vu=t=>Gge.test(t),Jge=new Set(["length","size","percentage"]),eve=t=>hy(t,Jge,Oq),tve=t=>hy(t,"position",Oq),nve=new Set(["image","url"]),rve=t=>hy(t,nve,ave),sve=t=>hy(t,"",ove),xb=()=>!0,hy=(t,e,n)=>{const r=Mq.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},ive=t=>Kge.test(t)&&!Yge.test(t),Oq=()=>!1,ove=t=>Xge.test(t),ave=t=>Qge.test(t),lve=()=>{const t=Hn("colors"),e=Hn("spacing"),n=Hn("blur"),r=Hn("brightness"),s=Hn("borderColor"),i=Hn("borderRadius"),o=Hn("borderSpacing"),a=Hn("borderWidth"),c=Hn("contrast"),d=Hn("grayscale"),f=Hn("hueRotate"),l=Hn("invert"),u=Hn("gap"),p=Hn("gradientColorStops"),h=Hn("gradientColorStopPositions"),m=Hn("inset"),y=Hn("margin"),g=Hn("opacity"),v=Hn("padding"),b=Hn("saturate"),_=Hn("scale"),A=Hn("sepia"),P=Hn("skew"),T=Hn("space"),E=Hn("translate"),N=()=>["auto","contain","none"],k=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",Pt,e],j=()=>[Pt,e],I=()=>["",pc,Hu],L=()=>["auto",ug,Pt],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],K=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>["start","end","center","between","around","evenly","stretch"],Q=()=>["","0",Pt],te=()=>["auto","avoid","all","avoid-page","page","left","right","column"],X=()=>[ug,Pt];return{cacheSize:500,separator:":",theme:{colors:[xb],spacing:[pc,Hu],blur:["none","",Vu,Pt],brightness:X(),borderColor:[t],borderRadius:["none","","full",Vu,Pt],borderSpacing:j(),borderWidth:I(),contrast:X(),grayscale:Q(),hueRotate:X(),invert:Q(),gap:j(),gradientColorStops:[t],gradientColorStopPositions:[Zge,Hu],inset:M(),margin:M(),opacity:X(),padding:j(),saturate:X(),scale:X(),sepia:Q(),skew:X(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",Pt]}],container:["container"],columns:[{columns:[Vu]}],"break-after":[{"break-after":te()}],"break-before":[{"break-before":te()}],"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:[...H(),Pt]}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",bb,Pt]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Pt]}],grow:[{grow:Q()}],shrink:[{shrink:Q()}],order:[{order:["first","last","none",bb,Pt]}],"grid-cols":[{"grid-cols":[xb]}],"col-start-end":[{col:["auto",{span:["full",bb,Pt]},Pt]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[xb]}],"row-start-end":[{row:["auto",{span:[bb,Pt]},Pt]}],"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",Pt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Pt]}],gap:[{gap:[u]}],"gap-x":[{"gap-x":[u]}],"gap-y":[{"gap-y":[u]}],"justify-content":[{justify:["normal",...U()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...U(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...U(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Pt,e]}],"min-w":[{"min-w":[Pt,e,"min","max","fit"]}],"max-w":[{"max-w":[Pt,e,"none","full","min","max","fit","prose",{screen:[Vu]},Vu]}],h:[{h:[Pt,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Pt,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Pt,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Pt,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Vu,Hu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",UT]}],"font-family":[{font:[xb]}],"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",Pt]}],"line-clamp":[{"line-clamp":["none",ug,UT]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",pc,Pt]}],"list-image":[{"list-image":["none",Pt]}],"list-style-type":[{list:["none","disc","decimal",Pt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",pc,Hu]}],"underline-offset":[{"underline-offset":["auto",pc,Pt]}],"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:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Pt]}],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",Pt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),tve]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",eve]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},rve]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...K(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:K()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...K()]}],"outline-offset":[{"outline-offset":[pc,Pt]}],"outline-w":[{outline:[pc,Hu]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:I()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[pc,Hu]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Vu,sve]}],"shadow-color":[{shadow:[xb]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Vu,Pt]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[l]}],saturate:[{saturate:[b]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[l]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Pt]}],duration:[{duration:X()}],ease:[{ease:["linear","in","out","in-out",Pt]}],delay:[{delay:X()}],animate:[{animate:["none","spin","ping","pulse","bounce",Pt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[bb,Pt]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Pt]}],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",Pt]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",Pt]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[pc,Hu,UT]}],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-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"]}}},cve=Vge(lve);function ie(...t){return cve(fy(t))}const uve=S.forwardRef(({className:t,...e},n)=>x.jsx(oge,{ref:n,className:ie("border-b",t),...e}));uve.displayName="AccordionItem";const dve=S.forwardRef(({className:t,children:e,...n},r)=>x.jsx(age,{className:"flex",children:x.jsxs(hq,{ref:r,className:ie("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",t),...n,children:[e,x.jsx(uy,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));dve.displayName=hq.displayName;const fve=S.forwardRef(({className:t,children:e,...n},r)=>x.jsx(pq,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:x.jsx("div",{className:ie("pb-4 pt-0",t),children:e})}));fve.displayName=pq.displayName;function jq(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;etypeof t=="boolean"?"".concat(t):t===0?"0":t,_B=hve,li=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return _B(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=e,o=Object.keys(s).map(d=>{const f=n==null?void 0:n[d],l=i==null?void 0:i[d];if(f===null)return null;const u=wB(f)||wB(l);return s[d][u]}),a=n&&Object.entries(n).reduce((d,f)=>{let[l,u]=f;return u===void 0||(d[l]=u),d},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,f)=>{let{class:l,className:u,...p}=f;return Object.entries(p).every(h=>{let[m,y]=h;return Array.isArray(y)?y.includes({...i,...a}[m]):{...i,...a}[m]===y})?[...d,l,u]:d},[]);return _B(t,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},pve=li("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),bL=S.forwardRef(({className:t,variant:e,...n},r)=>x.jsx("div",{ref:r,role:"alert",className:ie(pve({variant:e}),t),...n}));bL.displayName="Alert";const xL=S.forwardRef(({className:t,...e},n)=>x.jsx("h5",{ref:n,className:ie("mb-1 font-medium leading-none tracking-tight",t),...e}));xL.displayName="AlertTitle";const wL=S.forwardRef(({className:t,...e},n)=>x.jsx("div",{ref:n,className:ie("text-sm [&_p]:leading-relaxed",t),...e}));wL.displayName="AlertDescription";function mve(t,e=globalThis==null?void 0:globalThis.document){const n=on(t);S.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var gve="DismissableLayer",kM="dismissableLayer.update",vve="dismissableLayer.pointerDownOutside",yve="dismissableLayer.focusOutside",SB,Iq=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Pu=S.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...c}=t,d=S.useContext(Iq),[f,l]=S.useState(null),u=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=S.useState({}),h=et(e,T=>l(T)),m=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(y),v=f?m.indexOf(f):-1,b=d.layersWithOutsidePointerEventsDisabled.size>0,_=v>=g,A=xve(T=>{const E=T.target,N=[...d.branches].some(k=>k.contains(E));!_||N||(s==null||s(T),o==null||o(T),T.defaultPrevented||a==null||a())},u),P=wve(T=>{const E=T.target;[...d.branches].some(k=>k.contains(E))||(i==null||i(T),o==null||o(T),T.defaultPrevented||a==null||a())},u);return mve(T=>{v===d.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&a&&(T.preventDefault(),a()))},u),S.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(SB=u.body.style.pointerEvents,u.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),CB(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(u.body.style.pointerEvents=SB)}},[f,u,n,d]),S.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),CB())},[f,d]),S.useEffect(()=>{const T=()=>p({});return document.addEventListener(kM,T),()=>document.removeEventListener(kM,T)},[]),x.jsx(De.div,{...c,ref:h,style:{pointerEvents:b?_?"auto":"none":void 0,...t.style},onFocusCapture:ye(t.onFocusCapture,P.onFocusCapture),onBlurCapture:ye(t.onBlurCapture,P.onBlurCapture),onPointerDownCapture:ye(t.onPointerDownCapture,A.onPointerDownCapture)})});Pu.displayName=gve;var bve="DismissableLayerBranch",Lq=S.forwardRef((t,e)=>{const n=S.useContext(Iq),r=S.useRef(null),s=et(e,r);return S.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),x.jsx(De.div,{...t,ref:s})});Lq.displayName=bve;function xve(t,e=globalThis==null?void 0:globalThis.document){const n=on(t),r=S.useRef(!1),s=S.useRef(()=>{});return S.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let c=function(){$q(vve,n,d,{discrete:!0})};const d={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=c,e.addEventListener("click",s.current,{once:!0})):c()}else e.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function wve(t,e=globalThis==null?void 0:globalThis.document){const n=on(t),r=S.useRef(!1);return S.useEffect(()=>{const s=i=>{i.target&&!r.current&&$q(yve,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function CB(){const t=new CustomEvent(kM);document.dispatchEvent(t)}function $q(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?sx(s,i):s.dispatchEvent(i)}var _ve=Pu,Sve=Lq,HT="focusScope.autoFocusOnMount",VT="focusScope.autoFocusOnUnmount",EB={bubbles:!1,cancelable:!0},Cve="FocusScope",p_=S.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=t,[a,c]=S.useState(null),d=on(s),f=on(i),l=S.useRef(null),u=et(e,m=>c(m)),p=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(r){let m=function(b){if(p.paused||!a)return;const _=b.target;a.contains(_)?l.current=_:Xu(l.current,{select:!0})},y=function(b){if(p.paused||!a)return;const _=b.relatedTarget;_!==null&&(a.contains(_)||Xu(l.current,{select:!0}))},g=function(b){if(document.activeElement===document.body)for(const A of b)A.removedNodes.length>0&&Xu(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const v=new MutationObserver(g);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),v.disconnect()}}},[r,a,p.paused]),S.useEffect(()=>{if(a){RB.add(p);const m=document.activeElement;if(!a.contains(m)){const g=new CustomEvent(HT,EB);a.addEventListener(HT,d),a.dispatchEvent(g),g.defaultPrevented||(Eve(Tve(Fq(a)),{select:!0}),document.activeElement===m&&Xu(a))}return()=>{a.removeEventListener(HT,d),setTimeout(()=>{const g=new CustomEvent(VT,EB);a.addEventListener(VT,f),a.dispatchEvent(g),g.defaultPrevented||Xu(m??document.body,{select:!0}),a.removeEventListener(VT,f),RB.remove(p)},0)}}},[a,d,f,p]);const h=S.useCallback(m=>{if(!n&&!r||p.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,g=document.activeElement;if(y&&g){const v=m.currentTarget,[b,_]=Ave(v);b&&_?!m.shiftKey&&g===_?(m.preventDefault(),n&&Xu(b,{select:!0})):m.shiftKey&&g===b&&(m.preventDefault(),n&&Xu(_,{select:!0})):g===v&&m.preventDefault()}},[n,r,p.paused]);return x.jsx(De.div,{tabIndex:-1,...o,ref:u,onKeyDown:h})});p_.displayName=Cve;function Eve(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Xu(r,{select:e}),document.activeElement!==n)return}function Ave(t){const e=Fq(t),n=AB(e,t),r=AB(e.reverse(),t);return[n,r]}function Fq(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function AB(t,e){for(const n of t)if(!Rve(n,{upTo:e}))return n}function Rve(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function Pve(t){return t instanceof HTMLInputElement&&"select"in t}function Xu(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&Pve(t)&&e&&t.select()}}var RB=Nve();function Nve(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=PB(t,e),t.unshift(e)},remove(e){var n;t=PB(t,e),(n=t[0])==null||n.resume()}}}function PB(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function Tve(t){return t.filter(e=>e.tagName!=="A")}var kve="Portal",py=S.forwardRef((t,e)=>{var a;const{container:n,...r}=t,[s,i]=S.useState(!1);ir(()=>i(!0),[]);const o=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?XA.createPortal(x.jsx(De.div,{...r,ref:e}),o):null});py.displayName=kve;var qT=0;function lR(){S.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??NB()),document.body.insertAdjacentElement("beforeend",t[1]??NB()),qT++,()=>{qT===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),qT--}},[])}function NB(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}var Os=function(){return Os=Object.assign||function(e){for(var n,r=1,s=arguments.length;r"u")return Vve;var e=qve(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},Gve=SL(),dg="data-scroll-locked",Kve=function(t,e,n,r){var s=t.left,i=t.top,o=t.right,a=t.gap;return n===void 0&&(n="margin"),` .`.concat(Dve,` { overflow: hidden `).concat(r,`; padding-right: `).concat(a,"px ").concat(r,`; } body[`).concat(dg,`] { overflow: hidden `).concat(r,`; overscroll-behavior: contain; `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&` padding-left: `.concat(s,`px; padding-top: `).concat(i,`px; padding-right: `).concat(o,`px; margin-left:0; margin-top:0; margin-right: `).concat(a,"px ").concat(r,`; `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` } .`).concat(_0,` { right: `).concat(a,"px ").concat(r,`; } .`).concat(S0,` { margin-right: `).concat(a,"px ").concat(r,`; } .`).concat(_0," .").concat(_0,` { right: 0 `).concat(r,`; } .`).concat(S0," .").concat(S0,` { margin-right: 0 `).concat(r,`; } body[`).concat(dg,`] { `).concat(Mve,": ").concat(a,`px; } `)},kB=function(){var t=parseInt(document.body.getAttribute(dg)||"0",10);return isFinite(t)?t:0},Yve=function(){S.useEffect(function(){return document.body.setAttribute(dg,(kB()+1).toString()),function(){var t=kB()-1;t<=0?document.body.removeAttribute(dg):document.body.setAttribute(dg,t.toString())}},[])},Wq=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;Yve();var i=S.useMemo(function(){return Wve(s)},[s]);return S.createElement(Gve,{styles:Kve(i,!e,s,n?"":"!important")})},DM=!1;if(typeof window<"u")try{var d1=Object.defineProperty({},"passive",{get:function(){return DM=!0,!0}});window.addEventListener("test",d1,d1),window.removeEventListener("test",d1,d1)}catch{DM=!1}var vm=DM?{passive:!1}:!1,Xve=function(t){return t.tagName==="TEXTAREA"},Gq=function(t,e){var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!Xve(t)&&n[e]==="visible")},Qve=function(t){return Gq(t,"overflowY")},Zve=function(t){return Gq(t,"overflowX")},DB=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=Kq(t,r);if(s){var i=Yq(t,r),o=i[1],a=i[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Jve=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},eye=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},Kq=function(t,e){return t==="v"?Qve(e):Zve(e)},Yq=function(t,e){return t==="v"?Jve(e):eye(e)},tye=function(t,e){return t==="h"&&e==="rtl"?-1:1},nye=function(t,e,n,r,s){var i=tye(t,window.getComputedStyle(e).direction),o=i*r,a=n.target,c=e.contains(a),d=!1,f=o>0,l=0,u=0;do{var p=Yq(t,a),h=p[0],m=p[1],y=p[2],g=m-y-i*h;(h||g)&&Kq(t,a)&&(l+=g,u+=h),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(f&&(Math.abs(l)<1||!s)||!f&&(Math.abs(u)<1||!s))&&(d=!0),d},f1=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},MB=function(t){return[t.deltaX,t.deltaY]},OB=function(t){return t&&"current"in t?t.current:t},rye=function(t,e){return t[0]===e[0]&&t[1]===e[1]},sye=function(t){return` .block-interactivity-`.concat(t,` {pointer-events: none;} .allow-interactivity-`).concat(t,` {pointer-events: all;} `)},iye=0,ym=[];function oye(t){var e=S.useRef([]),n=S.useRef([0,0]),r=S.useRef(),s=S.useState(iye++)[0],i=S.useState(SL)[0],o=S.useRef(t);S.useEffect(function(){o.current=t},[t]),S.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var m=zq([t.lockRef.current],(t.shards||[]).map(OB),!0).filter(Boolean);return m.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var a=S.useCallback(function(m,y){if("touches"in m&&m.touches.length===2)return!o.current.allowPinchZoom;var g=f1(m),v=n.current,b="deltaX"in m?m.deltaX:v[0]-g[0],_="deltaY"in m?m.deltaY:v[1]-g[1],A,P=m.target,T=Math.abs(b)>Math.abs(_)?"h":"v";if("touches"in m&&T==="h"&&P.type==="range")return!1;var E=DB(T,P);if(!E)return!0;if(E?A=T:(A=T==="v"?"h":"v",E=DB(T,P)),!E)return!1;if(!r.current&&"changedTouches"in m&&(b||_)&&(r.current=A),!A)return!0;var N=r.current||A;return nye(N,y,m,N==="h"?b:_,!0)},[]),c=S.useCallback(function(m){var y=m;if(!(!ym.length||ym[ym.length-1]!==i)){var g="deltaY"in y?MB(y):f1(y),v=e.current.filter(function(A){return A.name===y.type&&(A.target===y.target||y.target===A.shadowParent)&&rye(A.delta,g)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var b=(o.current.shards||[]).map(OB).filter(Boolean).filter(function(A){return A.contains(y.target)}),_=b.length>0?a(y,b[0]):!o.current.noIsolation;_&&y.cancelable&&y.preventDefault()}}},[]),d=S.useCallback(function(m,y,g,v){var b={name:m,delta:y,target:g,should:v,shadowParent:aye(g)};e.current.push(b),setTimeout(function(){e.current=e.current.filter(function(_){return _!==b})},1)},[]),f=S.useCallback(function(m){n.current=f1(m),r.current=void 0},[]),l=S.useCallback(function(m){d(m.type,MB(m),m.target,a(m,t.lockRef.current))},[]),u=S.useCallback(function(m){d(m.type,f1(m),m.target,a(m,t.lockRef.current))},[]);S.useEffect(function(){return ym.push(i),t.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:u}),document.addEventListener("wheel",c,vm),document.addEventListener("touchmove",c,vm),document.addEventListener("touchstart",f,vm),function(){ym=ym.filter(function(m){return m!==i}),document.removeEventListener("wheel",c,vm),document.removeEventListener("touchmove",c,vm),document.removeEventListener("touchstart",f,vm)}},[]);var p=t.removeScrollBar,h=t.inert;return S.createElement(S.Fragment,null,h?S.createElement(i,{styles:sye(s)}):null,p?S.createElement(Wq,{gapMode:t.gapMode}):null)}function aye(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const lye=Vq(qq,oye);var m_=S.forwardRef(function(t,e){return S.createElement(cR,Os({},t,{ref:e,sideCar:lye}))});m_.classNames=cR.classNames;var cye=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},bm=new WeakMap,h1=new WeakMap,p1={},YT=0,Xq=function(t){return t&&(t.host||Xq(t.parentNode))},uye=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=Xq(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},dye=function(t,e,n,r){var s=uye(e,Array.isArray(t)?t:[t]);p1[n]||(p1[n]=new WeakMap);var i=p1[n],o=[],a=new Set,c=new Set(s),d=function(l){!l||a.has(l)||(a.add(l),d(l.parentNode))};s.forEach(d);var f=function(l){!l||c.has(l)||Array.prototype.forEach.call(l.children,function(u){if(a.has(u))f(u);else try{var p=u.getAttribute(r),h=p!==null&&p!=="false",m=(bm.get(u)||0)+1,y=(i.get(u)||0)+1;bm.set(u,m),i.set(u,y),o.push(u),m===1&&h&&h1.set(u,!0),y===1&&u.setAttribute(n,"true"),h||u.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",u,g)}})};return f(e),a.clear(),YT++,function(){o.forEach(function(l){var u=bm.get(l)-1,p=i.get(l)-1;bm.set(l,u),i.set(l,p),u||(h1.has(l)||l.removeAttribute(r),h1.delete(l)),p||l.removeAttribute(n)}),YT--,YT||(bm=new WeakMap,bm=new WeakMap,h1=new WeakMap,p1={})}},g_=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=cye(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),dye(r,s,n,"aria-hidden")):function(){return null}},CL="Dialog",[Qq,Zq]=jn(CL),[fye,nl]=Qq(CL),Jq=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=t,a=S.useRef(null),c=S.useRef(null),[d=!1,f]=mr({prop:r,defaultProp:s,onChange:i});return x.jsx(fye,{scope:e,triggerRef:a,contentRef:c,contentId:Ls(),titleId:Ls(),descriptionId:Ls(),open:d,onOpenChange:f,onOpenToggle:S.useCallback(()=>f(l=>!l),[f]),modal:o,children:n})};Jq.displayName=CL;var eW="DialogTrigger",tW=S.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=nl(eW,n),i=et(e,s.triggerRef);return x.jsx(De.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":PL(s.open),...r,ref:i,onClick:ye(t.onClick,s.onOpenToggle)})});tW.displayName=eW;var EL="DialogPortal",[hye,nW]=Qq(EL,{forceMount:void 0}),rW=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=nl(EL,e);return x.jsx(hye,{scope:e,forceMount:n,children:S.Children.map(r,o=>x.jsx(Kn,{present:n||i.open,children:x.jsx(py,{asChild:!0,container:s,children:o})}))})};rW.displayName=EL;var yE="DialogOverlay",sW=S.forwardRef((t,e)=>{const n=nW(yE,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=nl(yE,t.__scopeDialog);return i.modal?x.jsx(Kn,{present:r||i.open,children:x.jsx(pye,{...s,ref:e})}):null});sW.displayName=yE;var pye=S.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=nl(yE,n);return x.jsx(m_,{as:Ya,allowPinchZoom:!0,shards:[s.contentRef],children:x.jsx(De.div,{"data-state":PL(s.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Cp="DialogContent",iW=S.forwardRef((t,e)=>{const n=nW(Cp,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=nl(Cp,t.__scopeDialog);return x.jsx(Kn,{present:r||i.open,children:i.modal?x.jsx(mye,{...s,ref:e}):x.jsx(gye,{...s,ref:e})})});iW.displayName=Cp;var mye=S.forwardRef((t,e)=>{const n=nl(Cp,t.__scopeDialog),r=S.useRef(null),s=et(e,n.contentRef,r);return S.useEffect(()=>{const i=r.current;if(i)return g_(i)},[]),x.jsx(oW,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ye(t.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ye(t.onPointerDownOutside,i=>{const o=i.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&i.preventDefault()}),onFocusOutside:ye(t.onFocusOutside,i=>i.preventDefault())})}),gye=S.forwardRef((t,e)=>{const n=nl(Cp,t.__scopeDialog),r=S.useRef(!1),s=S.useRef(!1);return x.jsx(oW,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,d;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),oW=S.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=t,a=nl(Cp,n),c=S.useRef(null),d=et(e,c);return lR(),x.jsxs(x.Fragment,{children:[x.jsx(p_,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:x.jsx(Pu,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":PL(a.open),...o,ref:d,onDismiss:()=>a.onOpenChange(!1)})}),x.jsxs(x.Fragment,{children:[x.jsx(yye,{titleId:a.titleId}),x.jsx(xye,{contentRef:c,descriptionId:a.descriptionId})]})]})}),AL="DialogTitle",aW=S.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=nl(AL,n);return x.jsx(De.h2,{id:s.titleId,...r,ref:e})});aW.displayName=AL;var lW="DialogDescription",RL=S.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=nl(lW,n);return x.jsx(De.p,{id:s.descriptionId,...r,ref:e})});RL.displayName=lW;var cW="DialogClose",uW=S.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=nl(cW,n);return x.jsx(De.button,{type:"button",...r,ref:e,onClick:ye(t.onClick,()=>s.onOpenChange(!1))})});uW.displayName=cW;function PL(t){return t?"open":"closed"}var dW="DialogTitleWarning",[vye,fW]=Tme(dW,{contentName:Cp,titleName:AL,docsSlug:"dialog"}),yye=({titleId:t})=>{const e=fW(dW),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component. For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return S.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},bye="DialogDescriptionWarning",xye=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${fW(bye).contentName}}.`;return S.useEffect(()=>{var i;const s=(i=t.current)==null?void 0:i.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},uR=Jq,dR=tW,fR=rW,my=sW,gy=iW,vy=aW,yy=RL,by=uW,hW="AlertDialog",[wye,OUe]=jn(hW,[Zq]),Nu=Zq(),pW=t=>{const{__scopeAlertDialog:e,...n}=t,r=Nu(e);return x.jsx(uR,{...r,...n,modal:!0})};pW.displayName=hW;var _ye="AlertDialogTrigger",mW=S.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Nu(n);return x.jsx(dR,{...s,...r,ref:e})});mW.displayName=_ye;var Sye="AlertDialogPortal",gW=t=>{const{__scopeAlertDialog:e,...n}=t,r=Nu(e);return x.jsx(fR,{...r,...n})};gW.displayName=Sye;var Cye="AlertDialogOverlay",vW=S.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Nu(n);return x.jsx(my,{...s,...r,ref:e})});vW.displayName=Cye;var fg="AlertDialogContent",[Eye,Aye]=wye(fg),yW=S.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...s}=t,i=Nu(n),o=S.useRef(null),a=et(e,o),c=S.useRef(null);return x.jsx(vye,{contentName:fg,titleName:bW,docsSlug:"alert-dialog",children:x.jsx(Eye,{scope:n,cancelRef:c,children:x.jsxs(gy,{role:"alertdialog",...i,...s,ref:a,onOpenAutoFocus:ye(s.onOpenAutoFocus,d=>{var f;d.preventDefault(),(f=c.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[x.jsx(cL,{children:r}),x.jsx(Pye,{contentRef:o})]})})})});yW.displayName=fg;var bW="AlertDialogTitle",xW=S.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Nu(n);return x.jsx(vy,{...s,...r,ref:e})});xW.displayName=bW;var wW="AlertDialogDescription",_W=S.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Nu(n);return x.jsx(yy,{...s,...r,ref:e})});_W.displayName=wW;var Rye="AlertDialogAction",SW=S.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Nu(n);return x.jsx(by,{...s,...r,ref:e})});SW.displayName=Rye;var CW="AlertDialogCancel",EW=S.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:s}=Aye(CW,n),i=Nu(n),o=et(e,s);return x.jsx(by,{...i,...r,ref:o})});EW.displayName=CW;var Pye=({contentRef:t})=>{const e=`\`${fg}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${fg}\` by passing a \`${wW}\` component as a child, which also benefits sighted users by adding visible context to the dialog. Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${fg}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return S.useEffect(()=>{var r;document.getElementById((r=t.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},Nye=pW,Tye=mW,kye=gW,AW=vW,RW=yW,PW=SW,NW=EW,TW=xW,kW=_W;const ix=li("inline-flex items-center justify-center 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",{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"}}),Xe=S.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...s},i)=>{const o=r?Ya:"button";return x.jsx(o,{className:ie(ix({variant:e,size:n,className:t})),ref:i,...s})});Xe.displayName="Button";const NL=Nye,Dye=Tye,Mye=kye,DW=S.forwardRef(({className:t,...e},n)=>x.jsx(AW,{className:ie("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));DW.displayName=AW.displayName;const hR=S.forwardRef(({className:t,...e},n)=>x.jsxs(Mye,{children:[x.jsx(DW,{}),x.jsx(RW,{ref:n,className:ie("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...e})]}));hR.displayName=RW.displayName;const pR=({className:t,...e})=>x.jsx("div",{className:ie("flex flex-col space-y-2 text-center sm:text-left",t),...e});pR.displayName="AlertDialogHeader";const mR=({className:t,...e})=>x.jsx("div",{className:ie("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});mR.displayName="AlertDialogFooter";const gR=S.forwardRef(({className:t,...e},n)=>x.jsx(TW,{ref:n,className:ie("text-lg font-semibold",t),...e}));gR.displayName=TW.displayName;const vR=S.forwardRef(({className:t,...e},n)=>x.jsx(kW,{ref:n,className:ie("text-sm text-muted-foreground",t),...e}));vR.displayName=kW.displayName;const yR=S.forwardRef(({className:t,...e},n)=>x.jsx(PW,{ref:n,className:ie(ix(),t),...e}));yR.displayName=PW.displayName;const bR=S.forwardRef(({className:t,...e},n)=>x.jsx(NW,{ref:n,className:ie(ix({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));bR.displayName=NW.displayName;const Oye=({textAreaRef:t,triggerAutoSize:e,maxHeight:n=Number.MAX_SAFE_INTEGER,minHeight:r=0})=>{const[s,i]=S.useState(!0);S.useEffect(()=>{if(t){s&&(t.style.minHeight=`${r+2}px`,n>r&&(t.style.maxHeight=`${n}px`),i(!1)),t.style.height=`${r+2}px`;const a=t.scrollHeight;a>n?t.style.height=`${n}px`:t.style.height=`${a+2}px`}},[t,e,s,n,r])},MW=S.forwardRef(({maxHeight:t=Number.MAX_SAFE_INTEGER,minHeight:e=52,className:n,onChange:r,value:s,...i},o)=>{const a=S.useRef(null),[c,d]=S.useState("");return Oye({textAreaRef:a.current,triggerAutoSize:c,maxHeight:t,minHeight:e}),S.useImperativeHandle(o,()=>({textArea:a.current,focus:()=>{var f;return(f=a.current)==null?void 0:f.focus()},maxHeight:t,minHeight:e})),S.useEffect(()=>{(s||i!=null&&i.defaultValue)&&d(s)},[s||(i==null?void 0:i.defaultValue)]),x.jsx("textarea",{...i,value:s,ref:a,className:ie("flex 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",n),onChange:f=>{d(f.target.value),r==null||r(f)}})});MW.displayName="AutosizeTextarea";var TL="Avatar",[jye,jUe]=jn(TL),[Iye,OW]=jye(TL),jW=S.forwardRef((t,e)=>{const{__scopeAvatar:n,...r}=t,[s,i]=S.useState("idle");return x.jsx(Iye,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:i,children:x.jsx(De.span,{...r,ref:e})})});jW.displayName=TL;var IW="AvatarImage",LW=S.forwardRef((t,e)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s=()=>{},...i}=t,o=OW(IW,n),a=Lye(r),c=on(d=>{s(d),o.onImageLoadingStatusChange(d)});return ir(()=>{a!=="idle"&&c(a)},[a,c]),a==="loaded"?x.jsx(De.img,{...i,ref:e,src:r}):null});LW.displayName=IW;var $W="AvatarFallback",FW=S.forwardRef((t,e)=>{const{__scopeAvatar:n,delayMs:r,...s}=t,i=OW($W,n),[o,a]=S.useState(r===void 0);return S.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(c)}},[r]),o&&i.imageLoadingStatus!=="loaded"?x.jsx(De.span,{...s,ref:e}):null});FW.displayName=$W;function Lye(t){const[e,n]=S.useState("idle");return ir(()=>{if(!t){n("error");return}let r=!0;const s=new window.Image,i=o=>()=>{r&&n(o)};return n("loading"),s.onload=i("loaded"),s.onerror=i("error"),s.src=t,()=>{r=!1}},[t]),e}var zW=jW,BW=LW,UW=FW;const $ye=S.forwardRef(({className:t,...e},n)=>x.jsx(zW,{ref:n,className:ie("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...e}));$ye.displayName=zW.displayName;const Fye=S.forwardRef(({className:t,...e},n)=>x.jsx(BW,{ref:n,className:ie("aspect-square h-full w-full",t),...e}));Fye.displayName=BW.displayName;const zye=S.forwardRef(({className:t,...e},n)=>x.jsx(UW,{ref:n,className:ie("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...e}));zye.displayName=UW.displayName;const Bye=li("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 kL({className:t,variant:e,...n}){return x.jsx("div",{className:ie(Bye({variant:e}),t),...n})}const Uye=S.forwardRef(({...t},e)=>x.jsx("nav",{ref:e,"aria-label":"breadcrumb",...t}));Uye.displayName="Breadcrumb";const Hye=S.forwardRef(({className:t,...e},n)=>x.jsx("ol",{ref:n,className:ie("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",t),...e}));Hye.displayName="BreadcrumbList";const Vye=S.forwardRef(({className:t,...e},n)=>x.jsx("li",{ref:n,className:ie("inline-flex items-center gap-1.5",t),...e}));Vye.displayName="BreadcrumbItem";const qye=S.forwardRef(({asChild:t,className:e,...n},r)=>{const s=t?Ya:"a";return x.jsx(s,{ref:r,className:ie("transition-colors hover:text-foreground",e),...n})});qye.displayName="BreadcrumbLink";const Wye=S.forwardRef(({className:t,...e},n)=>x.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:ie("font-normal text-foreground",t),...e}));Wye.displayName="BreadcrumbPage";function Qt(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function Co(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function Zs(t,e){const n=Qt(t);return isNaN(e)?Co(t,NaN):(e&&n.setDate(n.getDate()+e),n)}function Xa(t,e){const n=Qt(t);if(isNaN(e))return Co(t,NaN);if(!e)return n;const r=n.getDate(),s=Co(t,n.getTime());s.setMonth(n.getMonth()+e+1,0);const i=s.getDate();return r>=i?s:(n.setFullYear(s.getFullYear(),s.getMonth(),r),n)}const DL=6048e5,Gye=864e5;let Kye={};function v_(){return Kye}function ql(t,e){var a,c,d,f;const n=v_(),r=(e==null?void 0:e.weekStartsOn)??((c=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??0,s=Qt(t),i=s.getDay(),o=(i=s.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function Hv(t){const e=Qt(t);return e.setHours(0,0,0,0),e}function bE(t){const e=Qt(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function Il(t,e){const n=Hv(t),r=Hv(e),s=+n-bE(n),i=+r-bE(r);return Math.round((s-i)/Gye)}function Yye(t){const e=HW(t),n=Co(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),Ep(n)}function MM(t,e){const n=e*7;return Zs(t,n)}function Xye(t,e){return Xa(t,e*12)}function Qye(t){let e;return t.forEach(function(n){const r=Qt(n);(e===void 0||e{const r=Qt(n);(!e||e>r||isNaN(+r))&&(e=r)}),e||new Date(NaN)}function Ti(t,e){const n=Hv(t),r=Hv(e);return+n==+r}function ML(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function Jye(t){if(!ML(t)&&typeof t!="number")return!1;const e=Qt(t);return!isNaN(Number(e))}function ox(t,e){const n=Qt(t),r=Qt(e),s=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return s*12+i}function ebe(t,e,n){const r=ql(t,n),s=ql(e,n),i=+r-bE(r),o=+s-bE(s);return Math.round((i-o)/DL)}function OL(t){const e=Qt(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function Li(t){const e=Qt(t);return e.setDate(1),e.setHours(0,0,0,0),e}function VW(t){const e=Qt(t),n=Co(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}function jL(t,e){var a,c,d,f;const n=v_(),r=(e==null?void 0:e.weekStartsOn)??((c=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??0,s=Qt(t),i=s.getDay(),o=(i{let r;const s=tbe[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function XT(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const rbe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},sbe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ibe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},obe={date:XT({formats:rbe,defaultWidth:"full"}),time:XT({formats:sbe,defaultWidth:"full"}),dateTime:XT({formats:ibe,defaultWidth:"full"})},abe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},lbe=(t,e,n,r)=>abe[t];function wb(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,a=n!=null&&n.width?String(n.width):o;s=t.formattingValues[a]||t.formattingValues[o]}else{const o=t.defaultWidth,a=n!=null&&n.width?String(n.width):t.defaultWidth;s=t.values[a]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return s[i]}}const cbe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ube={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},dbe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},fbe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},hbe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},pbe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},mbe=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},gbe={ordinalNumber:mbe,era:wb({values:cbe,defaultWidth:"wide"}),quarter:wb({values:ube,defaultWidth:"wide",argumentCallback:t=>t-1}),month:wb({values:dbe,defaultWidth:"wide"}),day:wb({values:fbe,defaultWidth:"wide"}),dayPeriod:wb({values:hbe,defaultWidth:"wide",formattingValues:pbe,defaultFormattingWidth:"wide"})};function _b(t){return(e,n={})=>{const r=n.width,s=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(s);if(!i)return null;const o=i[0],a=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(a)?ybe(a,l=>l.test(o)):vbe(a,l=>l.test(o));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const f=e.slice(o.length);return{value:d,rest:f}}}function vbe(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function ybe(t,e){for(let n=0;n{const r=e.match(t.matchPattern);if(!r)return null;const s=r[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const a=e.slice(s.length);return{value:o,rest:a}}}const xbe=/^(\d+)(th|st|nd|rd)?/i,wbe=/\d+/i,_be={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Sbe={any:[/^b/i,/^(a|c)/i]},Cbe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ebe={any:[/1/i,/2/i,/3/i,/4/i]},Abe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Rbe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Pbe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Nbe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Tbe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},kbe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Dbe={ordinalNumber:bbe({matchPattern:xbe,parsePattern:wbe,valueCallback:t=>parseInt(t,10)}),era:_b({matchPatterns:_be,defaultMatchWidth:"wide",parsePatterns:Sbe,defaultParseWidth:"any"}),quarter:_b({matchPatterns:Cbe,defaultMatchWidth:"wide",parsePatterns:Ebe,defaultParseWidth:"any",valueCallback:t=>t+1}),month:_b({matchPatterns:Abe,defaultMatchWidth:"wide",parsePatterns:Rbe,defaultParseWidth:"any"}),day:_b({matchPatterns:Pbe,defaultMatchWidth:"wide",parsePatterns:Nbe,defaultParseWidth:"any"}),dayPeriod:_b({matchPatterns:Tbe,defaultMatchWidth:"any",parsePatterns:kbe,defaultParseWidth:"any"})},WW={code:"en-US",formatDistance:nbe,formatLong:obe,formatRelative:lbe,localize:gbe,match:Dbe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Mbe(t){const e=Qt(t);return Il(e,VW(e))+1}function GW(t){const e=Qt(t),n=+Ep(e)-+Yye(e);return Math.round(n/DL)+1}function KW(t,e){var f,l,u,p;const n=Qt(t),r=n.getFullYear(),s=v_(),i=(e==null?void 0:e.firstWeekContainsDate)??((l=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:l.firstWeekContainsDate)??s.firstWeekContainsDate??((p=(u=s.locale)==null?void 0:u.options)==null?void 0:p.firstWeekContainsDate)??1,o=Co(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const a=ql(o,e),c=Co(t,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const d=ql(c,e);return n.getTime()>=a.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function Obe(t,e){var a,c,d,f;const n=v_(),r=(e==null?void 0:e.firstWeekContainsDate)??((c=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,s=KW(t,e),i=Co(t,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),ql(i,e)}function YW(t,e){const n=Qt(t),r=+ql(n,e)-+Obe(n,e);return Math.round(r/DL)+1}function vn(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const qu={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return vn(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):vn(n+1,2)},d(t,e){return vn(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return vn(t.getHours()%12||12,e.length)},H(t,e){return vn(t.getHours(),e.length)},m(t,e){return vn(t.getMinutes(),e.length)},s(t,e){return vn(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return vn(s,e.length)}},xm={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},jB={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return qu.y(t,e)},Y:function(t,e,n,r){const s=KW(t,r),i=s>0?s:1-s;if(e==="YY"){const o=i%100;return vn(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):vn(i,e.length)},R:function(t,e){const n=HW(t);return vn(n,e.length)},u:function(t,e){const n=t.getFullYear();return vn(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return vn(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return vn(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return qu.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return vn(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const s=YW(t,r);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):vn(s,e.length)},I:function(t,e,n){const r=GW(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):vn(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):qu.d(t,e)},D:function(t,e,n){const r=Mbe(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):vn(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return vn(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return vn(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),s=r===0?7:r;switch(e){case"i":return String(s);case"ii":return vn(s,e.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const s=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let s;switch(r===12?s=xm.noon:r===0?s=xm.midnight:s=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let s;switch(r>=17?s=xm.evening:r>=12?s=xm.afternoon:r>=4?s=xm.morning:s=xm.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return qu.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):qu.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):vn(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):vn(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):qu.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):qu.s(t,e)},S:function(t,e){return qu.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return LB(r);case"XXXX":case"XX":return Wf(r);case"XXXXX":case"XXX":default:return Wf(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return LB(r);case"xxxx":case"xx":return Wf(r);case"xxxxx":case"xxx":default:return Wf(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+IB(r,":");case"OOOO":default:return"GMT"+Wf(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+IB(r,":");case"zzzz":default:return"GMT"+Wf(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return vn(r,e.length)},T:function(t,e,n){const r=t.getTime();return vn(r,e.length)}};function IB(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=Math.trunc(r/60),i=r%60;return i===0?n+String(s):n+String(s)+e+vn(i,2)}function LB(t,e){return t%60===0?(t>0?"-":"+")+vn(Math.abs(t)/60,2):Wf(t,e)}function Wf(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=vn(Math.trunc(r/60),2),i=vn(r%60,2);return n+s+e+i}const $B=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},XW=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},jbe=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return $B(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",$B(r,e)).replace("{{time}}",XW(s,e))},Ibe={p:XW,P:jbe},Lbe=/^D+$/,$be=/^Y+$/,Fbe=["D","DD","YY","YYYY"];function zbe(t){return Lbe.test(t)}function Bbe(t){return $be.test(t)}function Ube(t,e,n){const r=Hbe(t,e,n);if(console.warn(r),Fbe.includes(t))throw new RangeError(r)}function Hbe(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Vbe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,qbe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Wbe=/^'([^]*?)'?$/,Gbe=/''/g,Kbe=/[a-zA-Z]/;function Up(t,e,n){var f,l,u,p,h,m,y,g;const r=v_(),s=(n==null?void 0:n.locale)??r.locale??WW,i=(n==null?void 0:n.firstWeekContainsDate)??((l=(f=n==null?void 0:n.locale)==null?void 0:f.options)==null?void 0:l.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(u=r.locale)==null?void 0:u.options)==null?void 0:p.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((m=(h=n==null?void 0:n.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??r.weekStartsOn??((g=(y=r.locale)==null?void 0:y.options)==null?void 0:g.weekStartsOn)??0,a=Qt(t);if(!Jye(a))throw new RangeError("Invalid time value");let c=e.match(qbe).map(v=>{const b=v[0];if(b==="p"||b==="P"){const _=Ibe[b];return _(v,s.formatLong)}return v}).join("").match(Vbe).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const b=v[0];if(b==="'")return{isToken:!1,value:Ybe(v)};if(jB[b])return{isToken:!0,value:v};if(b.match(Kbe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:v}});s.localize.preprocessor&&(c=s.localize.preprocessor(a,c));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:s};return c.map(v=>{if(!v.isToken)return v.value;const b=v.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Bbe(b)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&zbe(b))&&Ube(b,e,String(t));const _=jB[b[0]];return _(a,b,s.localize,d)}).join("")}function Ybe(t){const e=t.match(Wbe);return e?e[1].replace(Gbe,"'"):t}function Xbe(t){const e=Qt(t),n=e.getFullYear(),r=e.getMonth(),s=Co(t,0);return s.setFullYear(n,r+1,0),s.setHours(0,0,0,0),s.getDate()}function Qbe(t){return Math.trunc(+Qt(t)/1e3)}function Zbe(t){const e=Qt(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(0,0,0,0),e}function Jbe(t,e){return ebe(Zbe(t),Li(t),e)+1}function OM(t,e){const n=Qt(t),r=Qt(e);return n.getTime()>r.getTime()}function QW(t,e){const n=Qt(t),r=Qt(e);return+n<+r}function IL(t,e){const n=Qt(t),r=Qt(e);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function e0e(t,e){const n=Qt(t),r=Qt(e);return n.getFullYear()===r.getFullYear()}function QT(t,e){return Zs(t,-e)}function ZT(t,e){const n=Qt(t),r=n.getFullYear(),s=n.getDate(),i=Co(t,0);i.setFullYear(r,e,15),i.setHours(0,0,0,0);const o=Xbe(i);return n.setMonth(e,Math.min(s,o)),n}function FB(t,e){const n=Qt(t);return isNaN(+n)?Co(t,NaN):(n.setFullYear(e),n)}var pt=function(){return pt=Object.assign||function(e){for(var n,r=1,s=arguments.length;r1&&(c||!d),l=e>1&&(d||!c),u=function(){r&&i(r)},p=function(){s&&i(s)};return x.jsx(M0e,{displayMonth:t.displayMonth,hideNext:f,hidePrevious:l,nextMonth:s,previousMonth:r,onPreviousClick:u,onNextClick:p})}function O0e(t){var e,n=Bn(),r=n.classNames,s=n.disableNavigation,i=n.styles,o=n.captionLayout,a=n.components,c=(e=a==null?void 0:a.CaptionLabel)!==null&&e!==void 0?e:eG,d;return s?d=x.jsx(c,{id:t.id,displayMonth:t.displayMonth}):o==="dropdown"?d=x.jsx(zB,{displayMonth:t.displayMonth,id:t.id}):o==="dropdown-buttons"?d=x.jsxs(x.Fragment,{children:[x.jsx(zB,{displayMonth:t.displayMonth,displayIndex:t.displayIndex,id:t.id}),x.jsx(BB,{displayMonth:t.displayMonth,displayIndex:t.displayIndex,id:t.id})]}):d=x.jsxs(x.Fragment,{children:[x.jsx(c,{id:t.id,displayMonth:t.displayMonth,displayIndex:t.displayIndex}),x.jsx(BB,{displayMonth:t.displayMonth,id:t.id})]}),x.jsx("div",{className:r.caption,style:i.caption,children:d})}function j0e(t){var e=Bn(),n=e.footer,r=e.styles,s=e.classNames.tfoot;return n?x.jsx("tfoot",{className:s,style:r.tfoot,children:x.jsx("tr",{children:x.jsx("td",{colSpan:8,children:n})})}):x.jsx(x.Fragment,{})}function I0e(t,e,n){for(var r=n?Ep(new Date):ql(new Date,{locale:t,weekStartsOn:e}),s=[],i=0;i<7;i++){var o=Zs(r,i);s.push(o)}return s}function L0e(){var t=Bn(),e=t.classNames,n=t.styles,r=t.showWeekNumber,s=t.locale,i=t.weekStartsOn,o=t.ISOWeek,a=t.formatters.formatWeekdayName,c=t.labels.labelWeekday,d=I0e(s,i,o);return x.jsxs("tr",{style:n.head_row,className:e.head_row,children:[r&&x.jsx("td",{style:n.head_cell,className:e.head_cell}),d.map(function(f,l){return x.jsx("th",{scope:"col",className:e.head_cell,style:n.head_cell,"aria-label":c(f,{locale:s}),children:a(f,{locale:s})},l)})]})}function $0e(){var t,e=Bn(),n=e.classNames,r=e.styles,s=e.components,i=(t=s==null?void 0:s.HeadRow)!==null&&t!==void 0?t:L0e;return x.jsx("thead",{style:r.head,className:n.head,children:x.jsx(i,{})})}function F0e(t){var e=Bn(),n=e.locale,r=e.formatters.formatDay;return x.jsx(x.Fragment,{children:r(t.date,{locale:n})})}var LL=S.createContext(void 0);function z0e(t){if(!y_(t.initialProps)){var e={selected:void 0,modifiers:{disabled:[]}};return x.jsx(LL.Provider,{value:e,children:t.children})}return x.jsx(B0e,{initialProps:t.initialProps,children:t.children})}function B0e(t){var e=t.initialProps,n=t.children,r=e.selected,s=e.min,i=e.max,o=function(d,f,l){var u,p;(u=e.onDayClick)===null||u===void 0||u.call(e,d,f,l);var h=!!(f.selected&&s&&(r==null?void 0:r.length)===s);if(!h){var m=!!(!f.selected&&i&&(r==null?void 0:r.length)===i);if(!m){var y=r?ZW([],r):[];if(f.selected){var g=y.findIndex(function(v){return Ti(d,v)});y.splice(g,1)}else y.push(d);(p=e.onSelect)===null||p===void 0||p.call(e,y,d,f,l)}}},a={disabled:[]};r&&a.disabled.push(function(d){var f=i&&r.length>i-1,l=r.some(function(u){return Ti(u,d)});return!!(f&&!l)});var c={selected:r,onDayClick:o,modifiers:a};return x.jsx(LL.Provider,{value:c,children:n})}function $L(){var t=S.useContext(LL);if(!t)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return t}function U0e(t,e){var n=e||{},r=n.from,s=n.to;return r&&s?Ti(s,t)&&Ti(r,t)?void 0:Ti(s,t)?{from:s,to:void 0}:Ti(r,t)?void 0:OM(r,t)?{from:t,to:s}:{from:r,to:t}:s?OM(t,s)?{from:s,to:t}:{from:t,to:s}:r?QW(t,r)?{from:t,to:r}:{from:r,to:t}:{from:t,to:void 0}}var FL=S.createContext(void 0);function H0e(t){if(!b_(t.initialProps)){var e={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return x.jsx(FL.Provider,{value:e,children:t.children})}return x.jsx(V0e,{initialProps:t.initialProps,children:t.children})}function V0e(t){var e=t.initialProps,n=t.children,r=e.selected,s=r||{},i=s.from,o=s.to,a=e.min,c=e.max,d=function(p,h,m){var y,g;(y=e.onDayClick)===null||y===void 0||y.call(e,p,h,m);var v=U0e(p,r);(g=e.onSelect)===null||g===void 0||g.call(e,v,p,h,m)},f={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(f.range_start=[i],o?(f.range_end=[o],Ti(i,o)||(f.range_middle=[{after:i,before:o}])):f.range_end=[i]):o&&(f.range_start=[o],f.range_end=[o]),a&&(i&&!o&&f.disabled.push({after:QT(i,a-1),before:Zs(i,a-1)}),i&&o&&f.disabled.push({after:i,before:Zs(i,a-1)}),!i&&o&&f.disabled.push({after:QT(o,a-1),before:Zs(o,a-1)})),c){if(i&&!o&&(f.disabled.push({before:Zs(i,-c+1)}),f.disabled.push({after:Zs(i,c-1)})),i&&o){var l=Il(o,i)+1,u=c-l;f.disabled.push({before:QT(i,u)}),f.disabled.push({after:Zs(o,u)})}!i&&o&&(f.disabled.push({before:Zs(o,-c+1)}),f.disabled.push({after:Zs(o,c-1)}))}return x.jsx(FL.Provider,{value:{selected:r,onDayClick:d,modifiers:f},children:n})}function zL(){var t=S.useContext(FL);if(!t)throw new Error("useSelectRange must be used within a SelectRangeProvider");return t}function aC(t){return Array.isArray(t)?ZW([],t):t!==void 0?[t]:[]}function q0e(t){var e={};return Object.entries(t).forEach(function(n){var r=n[0],s=n[1];e[r]=aC(s)}),e}var Qa;(function(t){t.Outside="outside",t.Disabled="disabled",t.Selected="selected",t.Hidden="hidden",t.Today="today",t.RangeStart="range_start",t.RangeEnd="range_end",t.RangeMiddle="range_middle"})(Qa||(Qa={}));var W0e=Qa.Selected,mc=Qa.Disabled,G0e=Qa.Hidden,K0e=Qa.Today,JT=Qa.RangeEnd,ek=Qa.RangeMiddle,tk=Qa.RangeStart,Y0e=Qa.Outside;function X0e(t,e,n){var r,s=(r={},r[W0e]=aC(t.selected),r[mc]=aC(t.disabled),r[G0e]=aC(t.hidden),r[K0e]=[t.today],r[JT]=[],r[ek]=[],r[tk]=[],r[Y0e]=[],r);return t.fromDate&&s[mc].push({before:t.fromDate}),t.toDate&&s[mc].push({after:t.toDate}),y_(t)?s[mc]=s[mc].concat(e.modifiers[mc]):b_(t)&&(s[mc]=s[mc].concat(n.modifiers[mc]),s[tk]=n.modifiers[tk],s[ek]=n.modifiers[ek],s[JT]=n.modifiers[JT]),s}var rG=S.createContext(void 0);function Q0e(t){var e=Bn(),n=$L(),r=zL(),s=X0e(e,n,r),i=q0e(e.modifiers),o=pt(pt({},s),i);return x.jsx(rG.Provider,{value:o,children:t.children})}function sG(){var t=S.useContext(rG);if(!t)throw new Error("useModifiers must be used within a ModifiersProvider");return t}function Z0e(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function J0e(t){return!!(t&&typeof t=="object"&&"from"in t)}function exe(t){return!!(t&&typeof t=="object"&&"after"in t)}function txe(t){return!!(t&&typeof t=="object"&&"before"in t)}function nxe(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function rxe(t,e){var n,r=e.from,s=e.to;if(r&&s){var i=Il(s,r)<0;i&&(n=[s,r],r=n[0],s=n[1]);var o=Il(t,r)>=0&&Il(s,t)>=0;return o}return s?Ti(s,t):r?Ti(r,t):!1}function sxe(t){return ML(t)}function ixe(t){return Array.isArray(t)&&t.every(ML)}function oxe(t,e){return e.some(function(n){if(typeof n=="boolean")return n;if(sxe(n))return Ti(t,n);if(ixe(n))return n.includes(t);if(J0e(n))return rxe(t,n);if(nxe(n))return n.dayOfWeek.includes(t.getDay());if(Z0e(n)){var r=Il(n.before,t),s=Il(n.after,t),i=r>0,o=s<0,a=OM(n.before,n.after);return a?o&&i:i||o}return exe(n)?Il(t,n.after)>0:txe(n)?Il(n.before,t)>0:typeof n=="function"?n(t):!1})}function BL(t,e,n){var r=Object.keys(e).reduce(function(i,o){var a=e[o];return oxe(t,a)&&i.push(o),i},[]),s={};return r.forEach(function(i){return s[i]=!0}),n&&!IL(t,n)&&(s.outside=!0),s}function axe(t,e){for(var n=Li(t[0]),r=OL(t[t.length-1]),s,i,o=n;o<=r;){var a=BL(o,e),c=!a.disabled&&!a.hidden;if(!c){o=Zs(o,1);continue}if(a.selected)return o;a.today&&!i&&(i=o),s||(s=o),o=Zs(o,1)}return i||s}var lxe=365;function iG(t,e){var n=e.moveBy,r=e.direction,s=e.context,i=e.modifiers,o=e.retry,a=o===void 0?{count:0,lastFocused:t}:o,c=s.weekStartsOn,d=s.fromDate,f=s.toDate,l=s.locale,u={day:Zs,week:MM,month:Xa,year:Xye,startOfWeek:function(y){return s.ISOWeek?Ep(y):ql(y,{locale:l,weekStartsOn:c})},endOfWeek:function(y){return s.ISOWeek?qW(y):jL(y,{locale:l,weekStartsOn:c})}},p=u[n](t,r==="after"?1:-1);r==="before"&&d?p=Qye([d,p]):r==="after"&&f&&(p=Zye([f,p]));var h=!0;if(i){var m=BL(p,i);h=!m.disabled&&!m.hidden}return h?p:a.count>lxe?a.lastFocused:iG(p,{moveBy:n,direction:r,context:s,modifiers:i,retry:pt(pt({},a),{count:a.count+1})})}var oG=S.createContext(void 0);function cxe(t){var e=x_(),n=sG(),r=S.useState(),s=r[0],i=r[1],o=S.useState(),a=o[0],c=o[1],d=axe(e.displayMonths,n),f=s??(a&&e.isDateDisplayed(a))?a:d,l=function(){c(s),i(void 0)},u=function(y){i(y)},p=Bn(),h=function(y,g){if(s){var v=iG(s,{moveBy:y,direction:g,context:p,modifiers:n});Ti(s,v)||(e.goToDate(v,s),u(v))}},m={focusedDay:s,focusTarget:f,blur:l,focus:u,focusDayAfter:function(){return h("day","after")},focusDayBefore:function(){return h("day","before")},focusWeekAfter:function(){return h("week","after")},focusWeekBefore:function(){return h("week","before")},focusMonthBefore:function(){return h("month","before")},focusMonthAfter:function(){return h("month","after")},focusYearBefore:function(){return h("year","before")},focusYearAfter:function(){return h("year","after")},focusStartOfWeek:function(){return h("startOfWeek","before")},focusEndOfWeek:function(){return h("endOfWeek","after")}};return x.jsx(oG.Provider,{value:m,children:t.children})}function UL(){var t=S.useContext(oG);if(!t)throw new Error("useFocusContext must be used within a FocusProvider");return t}function uxe(t,e){var n=sG(),r=BL(t,n,e);return r}var HL=S.createContext(void 0);function dxe(t){if(!xR(t.initialProps)){var e={selected:void 0};return x.jsx(HL.Provider,{value:e,children:t.children})}return x.jsx(fxe,{initialProps:t.initialProps,children:t.children})}function fxe(t){var e=t.initialProps,n=t.children,r=function(i,o,a){var c,d,f;if((c=e.onDayClick)===null||c===void 0||c.call(e,i,o,a),o.selected&&!e.required){(d=e.onSelect)===null||d===void 0||d.call(e,void 0,i,o,a);return}(f=e.onSelect)===null||f===void 0||f.call(e,i,i,o,a)},s={selected:e.selected,onDayClick:r};return x.jsx(HL.Provider,{value:s,children:n})}function aG(){var t=S.useContext(HL);if(!t)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return t}function hxe(t,e){var n=Bn(),r=aG(),s=$L(),i=zL(),o=UL(),a=o.focusDayAfter,c=o.focusDayBefore,d=o.focusWeekAfter,f=o.focusWeekBefore,l=o.blur,u=o.focus,p=o.focusMonthBefore,h=o.focusMonthAfter,m=o.focusYearBefore,y=o.focusYearAfter,g=o.focusStartOfWeek,v=o.focusEndOfWeek,b=function(V){var U,Q,te,X;xR(n)?(U=r.onDayClick)===null||U===void 0||U.call(r,t,e,V):y_(n)?(Q=s.onDayClick)===null||Q===void 0||Q.call(s,t,e,V):b_(n)?(te=i.onDayClick)===null||te===void 0||te.call(i,t,e,V):(X=n.onDayClick)===null||X===void 0||X.call(n,t,e,V)},_=function(V){var U;u(t),(U=n.onDayFocus)===null||U===void 0||U.call(n,t,e,V)},A=function(V){var U;l(),(U=n.onDayBlur)===null||U===void 0||U.call(n,t,e,V)},P=function(V){var U;(U=n.onDayMouseEnter)===null||U===void 0||U.call(n,t,e,V)},T=function(V){var U;(U=n.onDayMouseLeave)===null||U===void 0||U.call(n,t,e,V)},E=function(V){var U;(U=n.onDayPointerEnter)===null||U===void 0||U.call(n,t,e,V)},N=function(V){var U;(U=n.onDayPointerLeave)===null||U===void 0||U.call(n,t,e,V)},k=function(V){var U;(U=n.onDayTouchCancel)===null||U===void 0||U.call(n,t,e,V)},M=function(V){var U;(U=n.onDayTouchEnd)===null||U===void 0||U.call(n,t,e,V)},j=function(V){var U;(U=n.onDayTouchMove)===null||U===void 0||U.call(n,t,e,V)},I=function(V){var U;(U=n.onDayTouchStart)===null||U===void 0||U.call(n,t,e,V)},L=function(V){var U;(U=n.onDayKeyUp)===null||U===void 0||U.call(n,t,e,V)},H=function(V){var U;switch(V.key){case"ArrowLeft":V.preventDefault(),V.stopPropagation(),n.dir==="rtl"?a():c();break;case"ArrowRight":V.preventDefault(),V.stopPropagation(),n.dir==="rtl"?c():a();break;case"ArrowDown":V.preventDefault(),V.stopPropagation(),d();break;case"ArrowUp":V.preventDefault(),V.stopPropagation(),f();break;case"PageUp":V.preventDefault(),V.stopPropagation(),V.shiftKey?m():p();break;case"PageDown":V.preventDefault(),V.stopPropagation(),V.shiftKey?y():h();break;case"Home":V.preventDefault(),V.stopPropagation(),g();break;case"End":V.preventDefault(),V.stopPropagation(),v();break}(U=n.onDayKeyDown)===null||U===void 0||U.call(n,t,e,V)},K={onClick:b,onFocus:_,onBlur:A,onKeyDown:H,onKeyUp:L,onMouseEnter:P,onMouseLeave:T,onPointerEnter:E,onPointerLeave:N,onTouchCancel:k,onTouchEnd:M,onTouchMove:j,onTouchStart:I};return K}function pxe(){var t=Bn(),e=aG(),n=$L(),r=zL(),s=xR(t)?e.selected:y_(t)?n.selected:b_(t)?r.selected:void 0;return s}function mxe(t){return Object.values(Qa).includes(t)}function gxe(t,e){var n=[t.classNames.day];return Object.keys(e).forEach(function(r){var s=t.modifiersClassNames[r];if(s)n.push(s);else if(mxe(r)){var i=t.classNames["day_".concat(r)];i&&n.push(i)}}),n}function vxe(t,e){var n=pt({},t.styles.day);return Object.keys(e).forEach(function(r){var s;n=pt(pt({},n),(s=t.modifiersStyles)===null||s===void 0?void 0:s[r])}),n}function yxe(t,e,n){var r,s,i,o=Bn(),a=UL(),c=uxe(t,e),d=hxe(t,c),f=pxe(),l=!!(o.onDayClick||o.mode!=="default");S.useEffect(function(){var P;c.outside||a.focusedDay&&l&&Ti(a.focusedDay,t)&&((P=n.current)===null||P===void 0||P.focus())},[a.focusedDay,t,n,l,c.outside]);var u=gxe(o,c).join(" "),p=vxe(o,c),h=!!(c.outside&&!o.showOutsideDays||c.hidden),m=(i=(s=o.components)===null||s===void 0?void 0:s.DayContent)!==null&&i!==void 0?i:F0e,y=x.jsx(m,{date:t,displayMonth:e,activeModifiers:c}),g={style:p,className:u,children:y,role:"gridcell"},v=a.focusTarget&&Ti(a.focusTarget,t)&&!c.outside,b=a.focusedDay&&Ti(a.focusedDay,t),_=pt(pt(pt({},g),(r={disabled:c.disabled,role:"gridcell"},r["aria-selected"]=c.selected,r.tabIndex=b||v?0:-1,r)),d),A={isButton:l,isHidden:h,activeModifiers:c,selectedDays:f,buttonProps:_,divProps:g};return A}function bxe(t){var e=S.useRef(null),n=yxe(t.date,t.displayMonth,e);return n.isHidden?x.jsx("div",{role:"gridcell"}):n.isButton?x.jsx(xE,pt({name:"day",ref:e},n.buttonProps)):x.jsx("div",pt({},n.divProps))}function xxe(t){var e=t.number,n=t.dates,r=Bn(),s=r.onWeekNumberClick,i=r.styles,o=r.classNames,a=r.locale,c=r.labels.labelWeekNumber,d=r.formatters.formatWeekNumber,f=d(Number(e),{locale:a});if(!s)return x.jsx("span",{className:o.weeknumber,style:i.weeknumber,children:f});var l=c(Number(e),{locale:a}),u=function(p){s(e,n,p)};return x.jsx(xE,{name:"week-number","aria-label":l,className:o.weeknumber,style:i.weeknumber,onClick:u,children:f})}function wxe(t){var e,n,r=Bn(),s=r.styles,i=r.classNames,o=r.showWeekNumber,a=r.components,c=(e=a==null?void 0:a.Day)!==null&&e!==void 0?e:bxe,d=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:xxe,f;return o&&(f=x.jsx("td",{className:i.cell,style:s.cell,children:x.jsx(d,{number:t.weekNumber,dates:t.dates})})),x.jsxs("tr",{className:i.row,style:s.row,children:[f,t.dates.map(function(l){return x.jsx("td",{className:i.cell,style:s.cell,role:"presentation",children:x.jsx(c,{displayMonth:t.displayMonth,date:l})},Qbe(l))})]})}function UB(t,e,n){for(var r=n!=null&&n.ISOWeek?qW(e):jL(e,n),s=n!=null&&n.ISOWeek?Ep(t):ql(t,n),i=Il(r,s),o=[],a=0;a<=i;a++)o.push(Zs(s,a));var c=o.reduce(function(d,f){var l=n!=null&&n.ISOWeek?GW(f):YW(f,n),u=d.find(function(p){return p.weekNumber===l});return u?(u.dates.push(f),d):(d.push({weekNumber:l,dates:[f]}),d)},[]);return c}function _xe(t,e){var n=UB(Li(t),OL(t),e);if(e!=null&&e.useFixedWeeks){var r=Jbe(t,e);if(r<6){var s=n[n.length-1],i=s.dates[s.dates.length-1],o=MM(i,6-r),a=UB(MM(i,1),o,e);n.push.apply(n,a)}}return n}function Sxe(t){var e,n,r,s=Bn(),i=s.locale,o=s.classNames,a=s.styles,c=s.hideHead,d=s.fixedWeeks,f=s.components,l=s.weekStartsOn,u=s.firstWeekContainsDate,p=s.ISOWeek,h=_xe(t.displayMonth,{useFixedWeeks:!!d,ISOWeek:p,locale:i,weekStartsOn:l,firstWeekContainsDate:u}),m=(e=f==null?void 0:f.Head)!==null&&e!==void 0?e:$0e,y=(n=f==null?void 0:f.Row)!==null&&n!==void 0?n:wxe,g=(r=f==null?void 0:f.Footer)!==null&&r!==void 0?r:j0e;return x.jsxs("table",{id:t.id,className:o.table,style:a.table,role:"grid","aria-labelledby":t["aria-labelledby"],children:[!c&&x.jsx(m,{}),x.jsx("tbody",{className:o.tbody,style:a.tbody,children:h.map(function(v){return x.jsx(y,{displayMonth:t.displayMonth,dates:v.dates,weekNumber:v.weekNumber},v.weekNumber)})}),x.jsx(g,{displayMonth:t.displayMonth})]})}function Cxe(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var Exe=Cxe()?S.useLayoutEffect:S.useEffect,nk=!1,Axe=0;function HB(){return"react-day-picker-".concat(++Axe)}function Rxe(t){var e,n=t??(nk?HB():null),r=S.useState(n),s=r[0],i=r[1];return Exe(function(){s===null&&i(HB())},[]),S.useEffect(function(){nk===!1&&(nk=!0)},[]),(e=t??s)!==null&&e!==void 0?e:void 0}function Pxe(t){var e,n,r=Bn(),s=r.dir,i=r.classNames,o=r.styles,a=r.components,c=x_().displayMonths,d=Rxe(r.id?"".concat(r.id,"-").concat(t.displayIndex):void 0),f=r.id?"".concat(r.id,"-grid-").concat(t.displayIndex):void 0,l=[i.month],u=o.month,p=t.displayIndex===0,h=t.displayIndex===c.length-1,m=!p&&!h;s==="rtl"&&(e=[p,h],h=e[0],p=e[1]),p&&(l.push(i.caption_start),u=pt(pt({},u),o.caption_start)),h&&(l.push(i.caption_end),u=pt(pt({},u),o.caption_end)),m&&(l.push(i.caption_between),u=pt(pt({},u),o.caption_between));var y=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:O0e;return x.jsxs("div",{className:l.join(" "),style:u,children:[x.jsx(y,{id:d,displayMonth:t.displayMonth,displayIndex:t.displayIndex}),x.jsx(Sxe,{id:f,"aria-labelledby":d,displayMonth:t.displayMonth})]},t.displayIndex)}function Nxe(t){var e=Bn(),n=e.classNames,r=e.styles;return x.jsx("div",{className:n.months,style:r.months,children:t.children})}function Txe(t){var e,n,r=t.initialProps,s=Bn(),i=UL(),o=x_(),a=S.useState(!1),c=a[0],d=a[1];S.useEffect(function(){s.initialFocus&&i.focusTarget&&(c||(i.focus(i.focusTarget),d(!0)))},[s.initialFocus,c,i.focus,i.focusTarget,i]);var f=[s.classNames.root,s.className];s.numberOfMonths>1&&f.push(s.classNames.multiple_months),s.showWeekNumber&&f.push(s.classNames.with_weeknumber);var l=pt(pt({},s.styles.root),s.style),u=Object.keys(r).filter(function(h){return h.startsWith("data-")}).reduce(function(h,m){var y;return pt(pt({},h),(y={},y[m]=r[m],y))},{}),p=(n=(e=r.components)===null||e===void 0?void 0:e.Months)!==null&&n!==void 0?n:Nxe;return x.jsx("div",pt({className:f.join(" "),style:l,dir:s.dir,id:s.id,nonce:r.nonce,title:r.title,lang:r.lang},u,{children:x.jsx(p,{children:o.displayMonths.map(function(h,m){return x.jsx(Pxe,{displayIndex:m,displayMonth:h},m)})})}))}function kxe(t){var e=t.children,n=t0e(t,["children"]);return x.jsx(x0e,{initialProps:n,children:x.jsx(T0e,{children:x.jsx(dxe,{initialProps:n,children:x.jsx(z0e,{initialProps:n,children:x.jsx(H0e,{initialProps:n,children:x.jsx(Q0e,{children:x.jsx(cxe,{children:e})})})})})})})}function Dxe(t){return x.jsx(kxe,pt({},t,{children:x.jsx(Txe,{initialProps:t})}))}function lG({className:t,classNames:e,showOutsideDays:n=!0,...r}){return x.jsx(Dxe,{showOutsideDays:n,className:ie("p-3",t),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:ie(ix({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:ie(ix({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...e},components:{IconLeft:()=>x.jsx(iR,{className:"w-4 h-4"}),IconRight:()=>x.jsx(dy,{className:"w-4 h-4"})},...r})}lG.displayName="Calendar";const xr=S.forwardRef(({className:t,...e},n)=>x.jsx("div",{ref:n,className:ie("rounded-md border bg-card text-card-foreground shadow",t),...e}));xr.displayName="Card";const Ei=S.forwardRef(({className:t,...e},n)=>x.jsx("div",{ref:n,className:ie("flex flex-col space-y-1.5 p-6",t),...e}));Ei.displayName="CardHeader";const ns=S.forwardRef(({className:t,...e},n)=>x.jsx("h3",{ref:n,className:ie("font-semibold leading-none tracking-tight",t),...e}));ns.displayName="CardTitle";const vs=S.forwardRef(({className:t,...e},n)=>x.jsx("p",{ref:n,className:ie("text-sm text-muted-foreground",t),...e}));vs.displayName="CardDescription";const wr=S.forwardRef(({className:t,...e},n)=>x.jsx("div",{ref:n,className:ie("p-6 pt-0",t),...e}));wr.displayName="CardContent";const Ko=S.forwardRef(({className:t,...e},n)=>x.jsx("div",{ref:n,className:ie("flex items-center p-6 pt-0",t),...e}));Ko.displayName="CardFooter";var Mxe=Array.isArray,Oxe=Mxe,jxe=typeof pr=="object"&&pr&&pr.Object===Object&&pr,Ixe=jxe,Lxe=Ixe,$xe=typeof self=="object"&&self&&self.Object===Object&&self,Fxe=Lxe||$xe||Function("return this")(),wR=Fxe,zxe=wR,Bxe=zxe.Symbol,VL=Bxe,VB=VL,cG=Object.prototype,Uxe=cG.hasOwnProperty,Hxe=cG.toString,Sb=VB?VB.toStringTag:void 0;function Vxe(t){var e=Uxe.call(t,Sb),n=t[Sb];try{t[Sb]=void 0;var r=!0}catch{}var s=Hxe.call(t);return r&&(e?t[Sb]=n:delete t[Sb]),s}var qxe=Vxe,Wxe=Object.prototype,Gxe=Wxe.toString;function Kxe(t){return Gxe.call(t)}var Yxe=Kxe,qB=VL,Xxe=qxe,Qxe=Yxe,Zxe="[object Null]",Jxe="[object Undefined]",WB=qB?qB.toStringTag:void 0;function ewe(t){return t==null?t===void 0?Jxe:Zxe:WB&&WB in Object(t)?Xxe(t):Qxe(t)}var qL=ewe;function twe(t){return t!=null&&typeof t=="object"}var uG=twe,nwe=qL,rwe=uG,swe="[object Symbol]";function iwe(t){return typeof t=="symbol"||rwe(t)&&nwe(t)==swe}var owe=iwe;function awe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var w_=awe,lwe=qL,cwe=w_,uwe="[object AsyncFunction]",dwe="[object Function]",fwe="[object GeneratorFunction]",hwe="[object Proxy]";function pwe(t){if(!cwe(t))return!1;var e=lwe(t);return e==dwe||e==fwe||e==uwe||e==hwe}var mwe=pwe,gwe=wR,vwe=gwe["__core-js_shared__"],ywe=vwe,rk=ywe,GB=function(){var t=/[^.]+$/.exec(rk&&rk.keys&&rk.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function bwe(t){return!!GB&&GB in t}var xwe=bwe,wwe=Function.prototype,_we=wwe.toString;function Swe(t){if(t!=null){try{return _we.call(t)}catch{}try{return t+""}catch{}}return""}var Cwe=Swe,Ewe=mwe,Awe=xwe,Rwe=w_,Pwe=Cwe,Nwe=/[\\^$.*+?()[\]{}|]/g,Twe=/^\[object .+?Constructor\]$/,kwe=Function.prototype,Dwe=Object.prototype,Mwe=kwe.toString,Owe=Dwe.hasOwnProperty,jwe=RegExp("^"+Mwe.call(Owe).replace(Nwe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Iwe(t){if(!Rwe(t)||Awe(t))return!1;var e=Ewe(t)?jwe:Twe;return e.test(Pwe(t))}var Lwe=Iwe;function $we(t,e){return t==null?void 0:t[e]}var Fwe=$we,zwe=Lwe,Bwe=Fwe;function Uwe(t,e){var n=Bwe(t,e);return zwe(n)?n:void 0}var dG=Uwe,Hwe=dG,Vwe=Hwe(Object,"create"),_R=Vwe,KB=_R;function qwe(){this.__data__=KB?KB(null):{},this.size=0}var Wwe=qwe;function Gwe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Kwe=Gwe,Ywe=_R,Xwe="__lodash_hash_undefined__",Qwe=Object.prototype,Zwe=Qwe.hasOwnProperty;function Jwe(t){var e=this.__data__;if(Ywe){var n=e[t];return n===Xwe?void 0:n}return Zwe.call(e,t)?e[t]:void 0}var e_e=Jwe,t_e=_R,n_e=Object.prototype,r_e=n_e.hasOwnProperty;function s_e(t){var e=this.__data__;return t_e?e[t]!==void 0:r_e.call(e,t)}var i_e=s_e,o_e=_R,a_e="__lodash_hash_undefined__";function l_e(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=o_e&&e===void 0?a_e:e,this}var c_e=l_e,u_e=Wwe,d_e=Kwe,f_e=e_e,h_e=i_e,p_e=c_e;function xy(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1}var D_e=k_e,M_e=SR;function O_e(t,e){var n=this.__data__,r=M_e(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var j_e=O_e,I_e=v_e,L_e=A_e,$_e=N_e,F_e=D_e,z_e=j_e;function wy(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e2?r-2:0),i=2;i=e||T<0||l&&E>=i}function g(){var P=ik();if(y(P))return v(P);a=setTimeout(g,m(P))}function v(P){return a=void 0,u&&r?p(P):(r=s=void 0,o)}function b(){a!==void 0&&clearTimeout(a),d=0,r=c=s=a=void 0}function _(){return a===void 0?o:v(ik())}function A(){var P=ik(),T=y(P);if(r=arguments,s=this,c=P,T){if(a===void 0)return h(c);if(l)return clearTimeout(a),a=setTimeout(g,e),p(c)}return a===void 0&&(a=setTimeout(g,e)),o}return A.cancel=b,A.flush=_,A}var c1e=l1e,u1e=c1e,d1e=w_,f1e="Expected a function";function h1e(t,e,n){var r=!0,s=!0;if(typeof t!="function")throw new TypeError(f1e);return d1e(n)&&(r="leading"in n?!!n.leading:r,s="trailing"in n?!!n.trailing:s),u1e(t,e,{leading:r,maxWait:e,trailing:s})}var p1e=h1e;const m1e=Cu(p1e);function ax(t){"@babel/helpers - typeof";return ax=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ax(t)}function n5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function g1(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&(I=m1e(I,m,{trailing:!0,leading:!1}));var L=new ResizeObserver(I),H=A.current.getBoundingClientRect(),K=H.width,V=H.height;return M(K,V),L.observe(A.current),function(){L.disconnect()}},[M,m]);var j=S.useMemo(function(){var I=N.containerWidth,L=N.containerHeight;if(I<0||L<0)return null;sk(m1(o)||m1(c),`The width(%s) and height(%s) are both fixed numbers, maybe you don't need to use a ResponsiveContainer.`,o,c),sk(!n||n>0,"The aspect(%s) must be greater than zero.",n);var H=m1(o)?I:o,K=m1(c)?L:c;n&&n>0&&(H?K=H/n:K&&(H=K*n),u&&K>u&&(K=u)),sk(H>0||K>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.`,H,K,o,c,f,l,n);var V=!Array.isArray(p)&&ZB.isElement(p)&&FSe(p.type).endsWith("Chart");return oe.Children.map(p,function(U){return ZB.isElement(U)?S.cloneElement(U,g1({width:H,height:K},V?{style:g1({height:"100%",width:"100%",maxHeight:K,maxWidth:H},U.props.style)}:{})):U})},[n,p,c,u,l,f,N,o]);return oe.createElement("div",{id:y?"".concat(y):void 0,className:fy("recharts-responsive-container",g),style:g1(g1({},_),{},{width:o,height:c,minWidth:f,minHeight:l,maxHeight:u}),ref:A},j)}),E1e="Invariant failed";function Mn(t,e){if(!t)throw new Error(E1e)}const A1e={light:"",dark:".dark"},mG=S.createContext(null);function gG(){const t=S.useContext(mG);if(!t)throw new Error("useChart must be used within a ");return t}const R1e=S.forwardRef(({id:t,className:e,children:n,config:r,...s},i)=>{const o=S.useId(),a=`chart-${t||o.replace(/:/g,"")}`;return x.jsx(mG.Provider,{value:{config:r},children:x.jsxs("div",{"data-chart":a,ref:i,className:ie("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",e),...s,children:[x.jsx(P1e,{id:a,config:r}),x.jsx(C1e,{children:n})]})})});R1e.displayName="Chart";const P1e=({id:t,config:e})=>{const n=Object.entries(e).filter(([r,s])=>s.theme||s.color);return n.length?x.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(A1e).map(([r,s])=>` ${s} [data-chart=${t}] { ${n.map(([i,o])=>{var c;const a=((c=o.theme)==null?void 0:c[r])||o.color;return a?` --color-${i}: ${a};`:null}).join(` `)} } `).join(` `)}}):null},N1e=S.forwardRef(({active:t,payload:e,className:n,indicator:r="dot",hideLabel:s=!1,hideIndicator:i=!1,label:o,labelFormatter:a,labelClassName:c,formatter:d,color:f,nameKey:l,labelKey:u},p)=>{const{config:h}=gG(),m=S.useMemo(()=>{var A;if(s||!(e!=null&&e.length))return null;const[g]=e,v=`${u||g.dataKey||g.name||"value"}`,b=jM(h,g,v),_=!u&&typeof o=="string"?((A=h[o])==null?void 0:A.label)||o:b==null?void 0:b.label;return a?x.jsx("div",{className:ie("font-medium",c),children:a(_,e)}):_?x.jsx("div",{className:ie("font-medium",c),children:_}):null},[o,a,e,s,c,h,u]);if(!t||!(e!=null&&e.length))return null;const y=e.length===1&&r!=="dot";return x.jsxs("div",{ref:p,className:ie("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",n),children:[y?null:m,x.jsx("div",{className:"grid gap-1.5",children:e.map((g,v)=>{const b=`${l||g.name||g.dataKey||"value"}`,_=jM(h,g,b),A=f||g.payload.fill||g.color;return x.jsx("div",{className:ie("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",r==="dot"&&"items-center"),children:d&&(g==null?void 0:g.value)!==void 0&&g.name?d(g.value,g.name,g,v,g.payload):x.jsxs(x.Fragment,{children:[_!=null&&_.icon?x.jsx(_.icon,{}):!i&&x.jsx("div",{className:ie("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":r==="dot","w-1":r==="line","w-0 border-[1.5px] border-dashed bg-transparent":r==="dashed","my-0.5":y&&r==="dashed"}),style:{"--color-bg":A,"--color-border":A}}),x.jsxs("div",{className:ie("flex flex-1 justify-between leading-none",y?"items-end":"items-center"),children:[x.jsxs("div",{className:"grid gap-1.5",children:[y?m:null,x.jsx("span",{className:"text-muted-foreground",children:(_==null?void 0:_.label)||g.name})]}),g.value&&x.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:g.value.toLocaleString()})]})]})},g.dataKey)})})]})});N1e.displayName="ChartTooltip";const T1e=S.forwardRef(({className:t,hideIcon:e=!1,payload:n,verticalAlign:r="bottom",nameKey:s},i)=>{const{config:o}=gG();return n!=null&&n.length?x.jsx("div",{ref:i,className:ie("flex items-center justify-center gap-4",r==="top"?"pb-3":"pt-3",t),children:n.map(a=>{const c=`${s||a.dataKey||"value"}`,d=jM(o,a,c);return x.jsxs("div",{className:ie("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[d!=null&&d.icon&&!e?x.jsx(d.icon,{}):x.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:a.color}}),d==null?void 0:d.label]},a.value)})}):null});T1e.displayName="ChartLegend";function jM(t,e,n){if(typeof e!="object"||e===null)return;const r="payload"in e&&typeof e.payload=="object"&&e.payload!==null?e.payload:void 0;let s=n;return n in e&&typeof e[n]=="string"?s=e[n]:r&&n in r&&typeof r[n]=="string"&&(s=r[n]),s in t?t[s]:t[n]}function Sy(t){const e=S.useRef({value:t,previous:t});return S.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function __(t){const[e,n]=S.useState(void 0);return ir(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,a;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;o=d.inlineSize,a=d.blockSize}else o=t.offsetWidth,a=t.offsetHeight;n({width:o,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var XL="Checkbox",[k1e,IUe]=jn(XL),[D1e,M1e]=k1e(XL),vG=S.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:i,required:o,disabled:a,value:c="on",onCheckedChange:d,...f}=t,[l,u]=S.useState(null),p=et(e,b=>u(b)),h=S.useRef(!1),m=l?!!l.closest("form"):!0,[y=!1,g]=mr({prop:s,defaultProp:i,onChange:d}),v=S.useRef(y);return S.useEffect(()=>{const b=l==null?void 0:l.form;if(b){const _=()=>g(v.current);return b.addEventListener("reset",_),()=>b.removeEventListener("reset",_)}},[l,g]),x.jsxs(D1e,{scope:n,state:y,disabled:a,children:[x.jsx(De.button,{type:"button",role:"checkbox","aria-checked":hp(y)?"mixed":y,"aria-required":o,"data-state":xG(y),"data-disabled":a?"":void 0,disabled:a,value:c,...f,ref:p,onKeyDown:ye(t.onKeyDown,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:ye(t.onClick,b=>{g(_=>hp(_)?!0:!_),m&&(h.current=b.isPropagationStopped(),h.current||b.stopPropagation())})}),m&&x.jsx(O1e,{control:l,bubbles:!h.current,name:r,value:c,checked:y,required:o,disabled:a,style:{transform:"translateX(-100%)"}})]})});vG.displayName=XL;var yG="CheckboxIndicator",bG=S.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...s}=t,i=M1e(yG,n);return x.jsx(Kn,{present:r||hp(i.state)||i.state===!0,children:x.jsx(De.span,{"data-state":xG(i.state),"data-disabled":i.disabled?"":void 0,...s,ref:e,style:{pointerEvents:"none",...t.style}})})});bG.displayName=yG;var O1e=t=>{const{control:e,checked:n,bubbles:r=!0,...s}=t,i=S.useRef(null),o=Sy(n),a=__(e);return S.useEffect(()=>{const c=i.current,d=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(d,"checked").set;if(o!==n&&l){const u=new Event("click",{bubbles:r});c.indeterminate=hp(n),l.call(c,hp(n)?!1:n),c.dispatchEvent(u)}},[o,n,r]),x.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:hp(n)?!1:n,...s,tabIndex:-1,ref:i,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function hp(t){return t==="indeterminate"}function xG(t){return hp(t)?"indeterminate":t?"checked":"unchecked"}var wG=vG,j1e=bG;const lx=S.forwardRef(({className:t,...e},n)=>x.jsx(wG,{ref:n,className:ie("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),...e,children:x.jsx(j1e,{className:ie("flex items-center justify-center text-current"),children:x.jsx(h_,{className:"h-4 w-4"})})}));lx.displayName=wG.displayName;var s5=1,I1e=.9,L1e=.8,$1e=.17,ok=.1,ak=.999,F1e=.9999,z1e=.99,B1e=/[\\\/_+.#"@\[\(\{&]/,U1e=/[\\\/_+.#"@\[\(\{&]/g,H1e=/[\s-]/,_G=/[\s-]/g;function IM(t,e,n,r,s,i,o){if(i===e.length)return s===t.length?s5:z1e;var a=`${s},${i}`;if(o[a]!==void 0)return o[a];for(var c=r.charAt(i),d=n.indexOf(c,s),f=0,l,u,p,h;d>=0;)l=IM(t,e,n,r,d+1,i+1,o),l>f&&(d===s?l*=s5:B1e.test(t.charAt(d-1))?(l*=L1e,p=t.slice(s,d-1).match(U1e),p&&s>0&&(l*=Math.pow(ak,p.length))):H1e.test(t.charAt(d-1))?(l*=I1e,h=t.slice(s,d-1).match(_G),h&&s>0&&(l*=Math.pow(ak,h.length))):(l*=$1e,s>0&&(l*=Math.pow(ak,d-s))),t.charAt(d)!==e.charAt(i)&&(l*=F1e)),(ll&&(l=u*ok)),l>f&&(f=l),d=n.indexOf(c,d+1);return o[a]=f,f}function i5(t){return t.toLowerCase().replace(_G," ")}function V1e(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,IM(t,e,i5(t),i5(e),0,0,{})}function ii(){return ii=Object.assign?Object.assign.bind():function(t){for(var e=1;et.forEach(n=>q1e(n,e))}function S_(...t){return S.useCallback(SG(...t),t)}function W1e(t,e=[]){let n=[];function r(i,o){const a=S.createContext(o),c=n.length;n=[...n,o];function d(l){const{scope:u,children:p,...h}=l,m=(u==null?void 0:u[t][c])||a,y=S.useMemo(()=>h,Object.values(h));return S.createElement(m.Provider,{value:y},p)}function f(l,u){const p=(u==null?void 0:u[t][c])||a,h=S.useContext(p);if(h)return h;if(o!==void 0)return o;throw new Error(`\`${l}\` must be used within \`${i}\``)}return d.displayName=i+"Provider",[d,f]}const s=()=>{const i=n.map(o=>S.createContext(o));return function(a){const c=(a==null?void 0:a[t])||i;return S.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return s.scopeName=t,[r,G1e(s,...e)]}function G1e(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:c,scopeName:d})=>{const l=c(i)[`__scope${d}`];return{...a,...l}},{});return S.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}const LM=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},K1e=a_.useId||(()=>{});let Y1e=0;function lk(t){const[e,n]=S.useState(K1e());return LM(()=>{t||n(r=>r??String(Y1e++))},[t]),t||(e?`radix-${e}`:"")}function Ap(t){const e=S.useRef(t);return S.useEffect(()=>{e.current=t}),S.useMemo(()=>(...n)=>{var r;return(r=e.current)===null||r===void 0?void 0:r.call(e,...n)},[])}function X1e({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,s]=Q1e({defaultProp:e,onChange:n}),i=t!==void 0,o=i?t:r,a=Ap(n),c=S.useCallback(d=>{if(i){const l=typeof d=="function"?d(t):d;l!==t&&a(l)}else s(d)},[i,t,s,a]);return[o,c]}function Q1e({defaultProp:t,onChange:e}){const n=S.useState(t),[r]=n,s=S.useRef(r),i=Ap(e);return S.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}const QL=S.forwardRef((t,e)=>{const{children:n,...r}=t,s=S.Children.toArray(n),i=s.find(J1e);if(i){const o=i.props.children,a=s.map(c=>c===i?S.Children.count(o)>1?S.Children.only(null):S.isValidElement(o)?o.props.children:null:c);return S.createElement($M,ii({},r,{ref:e}),S.isValidElement(o)?S.cloneElement(o,void 0,a):null)}return S.createElement($M,ii({},r,{ref:e}),n)});QL.displayName="Slot";const $M=S.forwardRef((t,e)=>{const{children:n,...r}=t;return S.isValidElement(n)?S.cloneElement(n,{...eCe(r,n.props),ref:e?SG(e,n.ref):n.ref}):S.Children.count(n)>1?S.Children.only(null):null});$M.displayName="SlotClone";const Z1e=({children:t})=>S.createElement(S.Fragment,null,t);function J1e(t){return S.isValidElement(t)&&t.type===Z1e}function eCe(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...a)=>{i(...a),s(...a)}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}const tCe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],da=tCe.reduce((t,e)=>{const n=S.forwardRef((r,s)=>{const{asChild:i,...o}=r,a=i?QL:e;return S.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),S.createElement(a,ii({},o,{ref:s}))});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function nCe(t,e){t&&rs.flushSync(()=>t.dispatchEvent(e))}function rCe(t,e=globalThis==null?void 0:globalThis.document){const n=Ap(t);S.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",r),()=>e.removeEventListener("keydown",r)},[n,e])}const FM="dismissableLayer.update",sCe="dismissableLayer.pointerDownOutside",iCe="dismissableLayer.focusOutside";let o5;const oCe=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),aCe=S.forwardRef((t,e)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...d}=t,f=S.useContext(oCe),[l,u]=S.useState(null),p=(n=l==null?void 0:l.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,h]=S.useState({}),m=S_(e,E=>u(E)),y=Array.from(f.layers),[g]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),v=y.indexOf(g),b=l?y.indexOf(l):-1,_=f.layersWithOutsidePointerEventsDisabled.size>0,A=b>=v,P=lCe(E=>{const N=E.target,k=[...f.branches].some(M=>M.contains(N));!A||k||(i==null||i(E),a==null||a(E),E.defaultPrevented||c==null||c())},p),T=cCe(E=>{const N=E.target;[...f.branches].some(M=>M.contains(N))||(o==null||o(E),a==null||a(E),E.defaultPrevented||c==null||c())},p);return rCe(E=>{b===f.layers.size-1&&(s==null||s(E),!E.defaultPrevented&&c&&(E.preventDefault(),c()))},p),S.useEffect(()=>{if(l)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(o5=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(l)),f.layers.add(l),a5(),()=>{r&&f.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=o5)}},[l,p,r,f]),S.useEffect(()=>()=>{l&&(f.layers.delete(l),f.layersWithOutsidePointerEventsDisabled.delete(l),a5())},[l,f]),S.useEffect(()=>{const E=()=>h({});return document.addEventListener(FM,E),()=>document.removeEventListener(FM,E)},[]),S.createElement(da.div,ii({},d,{ref:m,style:{pointerEvents:_?A?"auto":"none":void 0,...t.style},onFocusCapture:hg(t.onFocusCapture,T.onFocusCapture),onBlurCapture:hg(t.onBlurCapture,T.onBlurCapture),onPointerDownCapture:hg(t.onPointerDownCapture,P.onPointerDownCapture)}))});function lCe(t,e=globalThis==null?void 0:globalThis.document){const n=Ap(t),r=S.useRef(!1),s=S.useRef(()=>{});return S.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let f=function(){CG(sCe,n,d,{discrete:!0})};var c=f;const d={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=f,e.addEventListener("click",s.current,{once:!0})):f()}else e.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function cCe(t,e=globalThis==null?void 0:globalThis.document){const n=Ap(t),r=S.useRef(!1);return S.useEffect(()=>{const s=i=>{i.target&&!r.current&&CG(iCe,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function a5(){const t=new CustomEvent(FM);document.dispatchEvent(t)}function CG(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?nCe(s,i):s.dispatchEvent(i)}const ck="focusScope.autoFocusOnMount",uk="focusScope.autoFocusOnUnmount",l5={bubbles:!1,cancelable:!0},uCe=S.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=t,[a,c]=S.useState(null),d=Ap(s),f=Ap(i),l=S.useRef(null),u=S_(e,m=>c(m)),p=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(r){let v=function(P){if(p.paused||!a)return;const T=P.target;a.contains(T)?l.current=T:Qu(l.current,{select:!0})},b=function(P){if(p.paused||!a)return;const T=P.relatedTarget;T!==null&&(a.contains(T)||Qu(l.current,{select:!0}))},_=function(P){if(document.activeElement===document.body)for(const E of P)E.removedNodes.length>0&&Qu(a)};var m=v,y=b,g=_;document.addEventListener("focusin",v),document.addEventListener("focusout",b);const A=new MutationObserver(_);return a&&A.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",b),A.disconnect()}}},[r,a,p.paused]),S.useEffect(()=>{if(a){u5.add(p);const m=document.activeElement;if(!a.contains(m)){const g=new CustomEvent(ck,l5);a.addEventListener(ck,d),a.dispatchEvent(g),g.defaultPrevented||(dCe(gCe(EG(a)),{select:!0}),document.activeElement===m&&Qu(a))}return()=>{a.removeEventListener(ck,d),setTimeout(()=>{const g=new CustomEvent(uk,l5);a.addEventListener(uk,f),a.dispatchEvent(g),g.defaultPrevented||Qu(m??document.body,{select:!0}),a.removeEventListener(uk,f),u5.remove(p)},0)}}},[a,d,f,p]);const h=S.useCallback(m=>{if(!n&&!r||p.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,g=document.activeElement;if(y&&g){const v=m.currentTarget,[b,_]=fCe(v);b&&_?!m.shiftKey&&g===_?(m.preventDefault(),n&&Qu(b,{select:!0})):m.shiftKey&&g===b&&(m.preventDefault(),n&&Qu(_,{select:!0})):g===v&&m.preventDefault()}},[n,r,p.paused]);return S.createElement(da.div,ii({tabIndex:-1},o,{ref:u,onKeyDown:h}))});function dCe(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Qu(r,{select:e}),document.activeElement!==n)return}function fCe(t){const e=EG(t),n=c5(e,t),r=c5(e.reverse(),t);return[n,r]}function EG(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function c5(t,e){for(const n of t)if(!hCe(n,{upTo:e}))return n}function hCe(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function pCe(t){return t instanceof HTMLInputElement&&"select"in t}function Qu(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&pCe(t)&&e&&t.select()}}const u5=mCe();function mCe(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=d5(t,e),t.unshift(e)},remove(e){var n;t=d5(t,e),(n=t[0])===null||n===void 0||n.resume()}}}function d5(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function gCe(t){return t.filter(e=>e.tagName!=="A")}const vCe=S.forwardRef((t,e)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...s}=t;return r?XA.createPortal(S.createElement(da.div,ii({},s,{ref:e})),r):null});function yCe(t,e){return S.useReducer((n,r)=>{const s=e[n][r];return s??n},t)}const jR=t=>{const{present:e,children:n}=t,r=bCe(e),s=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),i=S_(r.ref,s.ref);return typeof n=="function"||r.isPresent?S.cloneElement(s,{ref:i}):null};jR.displayName="Presence";function bCe(t){const[e,n]=S.useState(),r=S.useRef({}),s=S.useRef(t),i=S.useRef("none"),o=t?"mounted":"unmounted",[a,c]=yCe(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const d=v1(r.current);i.current=a==="mounted"?d:"none"},[a]),LM(()=>{const d=r.current,f=s.current;if(f!==t){const u=i.current,p=v1(d);t?c("MOUNT"):p==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(f&&u!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,c]),LM(()=>{if(e){const d=l=>{const p=v1(r.current).includes(l.animationName);l.target===e&&p&&rs.flushSync(()=>c("ANIMATION_END"))},f=l=>{l.target===e&&(i.current=v1(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:S.useCallback(d=>{d&&(r.current=getComputedStyle(d)),n(d)},[])}}function v1(t){return(t==null?void 0:t.animationName)||"none"}let dk=0;function xCe(){S.useEffect(()=>{var t,e;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=n[0])!==null&&t!==void 0?t:f5()),document.body.insertAdjacentElement("beforeend",(e=n[1])!==null&&e!==void 0?e:f5()),dk++,()=>{dk===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),dk--}},[])}function f5(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}var AG=Uq(),fk=function(){},IR=S.forwardRef(function(t,e){var n=S.useRef(null),r=S.useState({onScrollCapture:fk,onWheelCapture:fk,onTouchMoveCapture:fk}),s=r[0],i=r[1],o=t.forwardProps,a=t.children,c=t.className,d=t.removeScrollBar,f=t.enabled,l=t.shards,u=t.sideCar,p=t.noIsolation,h=t.inert,m=t.allowPinchZoom,y=t.as,g=y===void 0?"div":y,v=_L(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),b=u,_=Bq([n,e]),A=Os(Os({},v),s);return S.createElement(S.Fragment,null,f&&S.createElement(b,{sideCar:AG,removeScrollBar:d,shards:l,noIsolation:p,inert:h,setCallbacks:i,allowPinchZoom:!!m,lockRef:n}),o?S.cloneElement(S.Children.only(a),Os(Os({},A),{ref:_})):S.createElement(g,Os({},A,{className:c,ref:_}),a))});IR.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};IR.classNames={fullWidth:S0,zeroRight:_0};var zM=!1;if(typeof window<"u")try{var y1=Object.defineProperty({},"passive",{get:function(){return zM=!0,!0}});window.addEventListener("test",y1,y1),window.removeEventListener("test",y1,y1)}catch{zM=!1}var wm=zM?{passive:!1}:!1,wCe=function(t){return t.tagName==="TEXTAREA"},RG=function(t,e){var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!wCe(t)&&n[e]==="visible")},_Ce=function(t){return RG(t,"overflowY")},SCe=function(t){return RG(t,"overflowX")},h5=function(t,e){var n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=PG(t,n);if(r){var s=NG(t,n),i=s[1],o=s[2];if(i>o)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},CCe=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},ECe=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},PG=function(t,e){return t==="v"?_Ce(e):SCe(e)},NG=function(t,e){return t==="v"?CCe(e):ECe(e)},ACe=function(t,e){return t==="h"&&e==="rtl"?-1:1},RCe=function(t,e,n,r,s){var i=ACe(t,window.getComputedStyle(e).direction),o=i*r,a=n.target,c=e.contains(a),d=!1,f=o>0,l=0,u=0;do{var p=NG(t,a),h=p[0],m=p[1],y=p[2],g=m-y-i*h;(h||g)&&PG(t,a)&&(l+=g,u+=h),a=a.parentNode}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(f&&(l===0||!s)||!f&&(u===0||!s))&&(d=!0),d},b1=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},p5=function(t){return[t.deltaX,t.deltaY]},m5=function(t){return t&&"current"in t?t.current:t},PCe=function(t,e){return t[0]===e[0]&&t[1]===e[1]},NCe=function(t){return` .block-interactivity-`.concat(t,` {pointer-events: none;} .allow-interactivity-`).concat(t,` {pointer-events: all;} `)},TCe=0,_m=[];function kCe(t){var e=S.useRef([]),n=S.useRef([0,0]),r=S.useRef(),s=S.useState(TCe++)[0],i=S.useState(function(){return SL()})[0],o=S.useRef(t);S.useEffect(function(){o.current=t},[t]),S.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var m=zq([t.lockRef.current],(t.shards||[]).map(m5),!0).filter(Boolean);return m.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var a=S.useCallback(function(m,y){if("touches"in m&&m.touches.length===2)return!o.current.allowPinchZoom;var g=b1(m),v=n.current,b="deltaX"in m?m.deltaX:v[0]-g[0],_="deltaY"in m?m.deltaY:v[1]-g[1],A,P=m.target,T=Math.abs(b)>Math.abs(_)?"h":"v";if("touches"in m&&T==="h"&&P.type==="range")return!1;var E=h5(T,P);if(!E)return!0;if(E?A=T:(A=T==="v"?"h":"v",E=h5(T,P)),!E)return!1;if(!r.current&&"changedTouches"in m&&(b||_)&&(r.current=A),!A)return!0;var N=r.current||A;return RCe(N,y,m,N==="h"?b:_,!0)},[]),c=S.useCallback(function(m){var y=m;if(!(!_m.length||_m[_m.length-1]!==i)){var g="deltaY"in y?p5(y):b1(y),v=e.current.filter(function(A){return A.name===y.type&&A.target===y.target&&PCe(A.delta,g)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var b=(o.current.shards||[]).map(m5).filter(Boolean).filter(function(A){return A.contains(y.target)}),_=b.length>0?a(y,b[0]):!o.current.noIsolation;_&&y.cancelable&&y.preventDefault()}}},[]),d=S.useCallback(function(m,y,g,v){var b={name:m,delta:y,target:g,should:v};e.current.push(b),setTimeout(function(){e.current=e.current.filter(function(_){return _!==b})},1)},[]),f=S.useCallback(function(m){n.current=b1(m),r.current=void 0},[]),l=S.useCallback(function(m){d(m.type,p5(m),m.target,a(m,t.lockRef.current))},[]),u=S.useCallback(function(m){d(m.type,b1(m),m.target,a(m,t.lockRef.current))},[]);S.useEffect(function(){return _m.push(i),t.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:u}),document.addEventListener("wheel",c,wm),document.addEventListener("touchmove",c,wm),document.addEventListener("touchstart",f,wm),function(){_m=_m.filter(function(m){return m!==i}),document.removeEventListener("wheel",c,wm),document.removeEventListener("touchmove",c,wm),document.removeEventListener("touchstart",f,wm)}},[]);var p=t.removeScrollBar,h=t.inert;return S.createElement(S.Fragment,null,h?S.createElement(i,{styles:NCe(s)}):null,p?S.createElement(Wq,{gapMode:"margin"}):null)}const DCe=Vq(AG,kCe);var TG=S.forwardRef(function(t,e){return S.createElement(IR,Os({},t,{ref:e,sideCar:DCe}))});TG.classNames=IR.classNames;const kG="Dialog",[DG,LUe]=W1e(kG),[MCe,Hp]=DG(kG),OCe=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=t,a=S.useRef(null),c=S.useRef(null),[d=!1,f]=X1e({prop:r,defaultProp:s,onChange:i});return S.createElement(MCe,{scope:e,triggerRef:a,contentRef:c,contentId:lk(),titleId:lk(),descriptionId:lk(),open:d,onOpenChange:f,onOpenToggle:S.useCallback(()=>f(l=>!l),[f]),modal:o},n)},MG="DialogPortal",[jCe,OG]=DG(MG,{forceMount:void 0}),ICe=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=Hp(MG,e);return S.createElement(jCe,{scope:e,forceMount:n},S.Children.map(r,o=>S.createElement(jR,{present:n||i.open},S.createElement(vCe,{asChild:!0,container:s},o))))},BM="DialogOverlay",LCe=S.forwardRef((t,e)=>{const n=OG(BM,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Hp(BM,t.__scopeDialog);return i.modal?S.createElement(jR,{present:r||i.open},S.createElement($Ce,ii({},s,{ref:e}))):null}),$Ce=S.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Hp(BM,n);return S.createElement(TG,{as:QL,allowPinchZoom:!0,shards:[s.contentRef]},S.createElement(da.div,ii({"data-state":IG(s.open)},r,{ref:e,style:{pointerEvents:"auto",...r.style}})))}),cx="DialogContent",FCe=S.forwardRef((t,e)=>{const n=OG(cx,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Hp(cx,t.__scopeDialog);return S.createElement(jR,{present:r||i.open},i.modal?S.createElement(zCe,ii({},s,{ref:e})):S.createElement(BCe,ii({},s,{ref:e})))}),zCe=S.forwardRef((t,e)=>{const n=Hp(cx,t.__scopeDialog),r=S.useRef(null),s=S_(e,n.contentRef,r);return S.useEffect(()=>{const i=r.current;if(i)return g_(i)},[]),S.createElement(jG,ii({},t,{ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:hg(t.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)===null||o===void 0||o.focus()}),onPointerDownOutside:hg(t.onPointerDownOutside,i=>{const o=i.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&i.preventDefault()}),onFocusOutside:hg(t.onFocusOutside,i=>i.preventDefault())}))}),BCe=S.forwardRef((t,e)=>{const n=Hp(cx,t.__scopeDialog),r=S.useRef(!1),s=S.useRef(!1);return S.createElement(jG,ii({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o;if((o=t.onCloseAutoFocus)===null||o===void 0||o.call(t,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,s.current=!1},onInteractOutside:i=>{var o,a;(o=t.onInteractOutside)===null||o===void 0||o.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(c))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}}))}),jG=S.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=t,a=Hp(cx,n),c=S.useRef(null),d=S_(e,c);return xCe(),S.createElement(S.Fragment,null,S.createElement(uCe,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i},S.createElement(aCe,ii({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":IG(a.open)},o,{ref:d,onDismiss:()=>a.onOpenChange(!1)}))),!1)});function IG(t){return t?"open":"closed"}const UCe=OCe,HCe=ICe,VCe=LCe,qCe=FCe;var Cb='[cmdk-group=""]',hk='[cmdk-group-items=""]',WCe='[cmdk-group-heading=""]',ZL='[cmdk-item=""]',g5=`${ZL}:not([aria-disabled="true"])`,UM="cmdk-item-select",Qf="data-value",GCe=(t,e,n)=>V1e(t,e,n),LG=S.createContext(void 0),C_=()=>S.useContext(LG),$G=S.createContext(void 0),JL=()=>S.useContext($G),FG=S.createContext(void 0),zG=S.forwardRef((t,e)=>{let n=km(()=>{var G,Y;return{search:"",value:(Y=(G=t.value)!=null?G:t.defaultValue)!=null?Y:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=km(()=>new Set),s=km(()=>new Map),i=km(()=>new Map),o=km(()=>new Set),a=BG(t),{label:c,children:d,value:f,onValueChange:l,filter:u,shouldFilter:p,loop:h,disablePointerSelection:m=!1,vimBindings:y=!0,...g}=t,v=S.useId(),b=S.useId(),_=S.useId(),A=S.useRef(null),P=sEe();Rp(()=>{if(f!==void 0){let G=f.trim();n.current.value=G,T.emit()}},[f]),Rp(()=>{P(6,I)},[]);let T=S.useMemo(()=>({subscribe:G=>(o.current.add(G),()=>o.current.delete(G)),snapshot:()=>n.current,setState:(G,Y,Z)=>{var he,fe,ce;if(!Object.is(n.current[G],Y)){if(n.current[G]=Y,G==="search")j(),k(),P(1,M);else if(G==="value"&&(Z||P(5,I),((he=a.current)==null?void 0:he.value)!==void 0)){let xe=Y??"";(ce=(fe=a.current).onValueChange)==null||ce.call(fe,xe);return}T.emit()}},emit:()=>{o.current.forEach(G=>G())}}),[]),E=S.useMemo(()=>({value:(G,Y,Z)=>{var he;Y!==((he=i.current.get(G))==null?void 0:he.value)&&(i.current.set(G,{value:Y,keywords:Z}),n.current.filtered.items.set(G,N(Y,Z)),P(2,()=>{k(),T.emit()}))},item:(G,Y)=>(r.current.add(G),Y&&(s.current.has(Y)?s.current.get(Y).add(G):s.current.set(Y,new Set([G]))),P(3,()=>{j(),k(),n.current.value||M(),T.emit()}),()=>{i.current.delete(G),r.current.delete(G),n.current.filtered.items.delete(G);let Z=L();P(4,()=>{j(),(Z==null?void 0:Z.getAttribute("id"))===G&&M(),T.emit()})}),group:G=>(s.current.has(G)||s.current.set(G,new Set),()=>{i.current.delete(G),s.current.delete(G)}),filter:()=>a.current.shouldFilter,label:c||t["aria-label"],disablePointerSelection:m,listId:v,inputId:_,labelId:b,listInnerRef:A}),[]);function N(G,Y){var Z,he;let fe=(he=(Z=a.current)==null?void 0:Z.filter)!=null?he:GCe;return G?fe(G,n.current.search,Y):0}function k(){if(!n.current.search||a.current.shouldFilter===!1)return;let G=n.current.filtered.items,Y=[];n.current.filtered.groups.forEach(he=>{let fe=s.current.get(he),ce=0;fe.forEach(xe=>{let Pe=G.get(xe);ce=Math.max(Pe,ce)}),Y.push([he,ce])});let Z=A.current;H().sort((he,fe)=>{var ce,xe;let Pe=he.getAttribute("id"),pe=fe.getAttribute("id");return((ce=G.get(pe))!=null?ce:0)-((xe=G.get(Pe))!=null?xe:0)}).forEach(he=>{let fe=he.closest(hk);fe?fe.appendChild(he.parentElement===fe?he:he.closest(`${hk} > *`)):Z.appendChild(he.parentElement===Z?he:he.closest(`${hk} > *`))}),Y.sort((he,fe)=>fe[1]-he[1]).forEach(he=>{let fe=A.current.querySelector(`${Cb}[${Qf}="${encodeURIComponent(he[0])}"]`);fe==null||fe.parentElement.appendChild(fe)})}function M(){let G=H().find(Z=>Z.getAttribute("aria-disabled")!=="true"),Y=G==null?void 0:G.getAttribute(Qf);T.setState("value",Y||void 0)}function j(){var G,Y,Z,he;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let fe=0;for(let ce of r.current){let xe=(Y=(G=i.current.get(ce))==null?void 0:G.value)!=null?Y:"",Pe=(he=(Z=i.current.get(ce))==null?void 0:Z.keywords)!=null?he:[],pe=N(xe,Pe);n.current.filtered.items.set(ce,pe),pe>0&&fe++}for(let[ce,xe]of s.current)for(let Pe of xe)if(n.current.filtered.items.get(Pe)>0){n.current.filtered.groups.add(ce);break}n.current.filtered.count=fe}function I(){var G,Y,Z;let he=L();he&&(((G=he.parentElement)==null?void 0:G.firstChild)===he&&((Z=(Y=he.closest(Cb))==null?void 0:Y.querySelector(WCe))==null||Z.scrollIntoView({block:"nearest"})),he.scrollIntoView({block:"nearest"}))}function L(){var G;return(G=A.current)==null?void 0:G.querySelector(`${ZL}[aria-selected="true"]`)}function H(){var G;return Array.from((G=A.current)==null?void 0:G.querySelectorAll(g5))}function K(G){let Y=H()[G];Y&&T.setState("value",Y.getAttribute(Qf))}function V(G){var Y;let Z=L(),he=H(),fe=he.findIndex(xe=>xe===Z),ce=he[fe+G];(Y=a.current)!=null&&Y.loop&&(ce=fe+G<0?he[he.length-1]:fe+G===he.length?he[0]:he[fe+G]),ce&&T.setState("value",ce.getAttribute(Qf))}function U(G){let Y=L(),Z=Y==null?void 0:Y.closest(Cb),he;for(;Z&&!he;)Z=G>0?nEe(Z,Cb):rEe(Z,Cb),he=Z==null?void 0:Z.querySelector(g5);he?T.setState("value",he.getAttribute(Qf)):V(G)}let Q=()=>K(H().length-1),te=G=>{G.preventDefault(),G.metaKey?Q():G.altKey?U(1):V(1)},X=G=>{G.preventDefault(),G.metaKey?K(0):G.altKey?U(-1):V(-1)};return S.createElement(da.div,{ref:e,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:G=>{var Y;if((Y=g.onKeyDown)==null||Y.call(g,G),!G.defaultPrevented)switch(G.key){case"n":case"j":{y&&G.ctrlKey&&te(G);break}case"ArrowDown":{te(G);break}case"p":case"k":{y&&G.ctrlKey&&X(G);break}case"ArrowUp":{X(G);break}case"Home":{G.preventDefault(),K(0);break}case"End":{G.preventDefault(),Q();break}case"Enter":if(!G.nativeEvent.isComposing&&G.keyCode!==229){G.preventDefault();let Z=L();if(Z){let he=new Event(UM);Z.dispatchEvent(he)}}}}},S.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:oEe},c),LR(t,G=>S.createElement($G.Provider,{value:T},S.createElement(LG.Provider,{value:E},G))))}),KCe=S.forwardRef((t,e)=>{var n,r;let s=S.useId(),i=S.useRef(null),o=S.useContext(FG),a=C_(),c=BG(t),d=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:o==null?void 0:o.forceMount;Rp(()=>{if(!d)return a.item(s,o==null?void 0:o.id)},[d]);let f=UG(s,i,[t.value,t.children,i],t.keywords),l=JL(),u=Pp(P=>P.value&&P.value===f.current),p=Pp(P=>d||a.filter()===!1?!0:P.search?P.filtered.items.get(s)>0:!0);S.useEffect(()=>{let P=i.current;if(!(!P||t.disabled))return P.addEventListener(UM,h),()=>P.removeEventListener(UM,h)},[p,t.onSelect,t.disabled]);function h(){var P,T;m(),(T=(P=c.current).onSelect)==null||T.call(P,f.current)}function m(){l.setState("value",f.current,!0)}if(!p)return null;let{disabled:y,value:g,onSelect:v,forceMount:b,keywords:_,...A}=t;return S.createElement(da.div,{ref:ux([i,e]),...A,id:s,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!u,"data-disabled":!!y,"data-selected":!!u,onPointerMove:y||a.disablePointerSelection?void 0:m,onClick:y?void 0:h},t.children)}),YCe=S.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:s,...i}=t,o=S.useId(),a=S.useRef(null),c=S.useRef(null),d=S.useId(),f=C_(),l=Pp(p=>s||f.filter()===!1?!0:p.search?p.filtered.groups.has(o):!0);Rp(()=>f.group(o),[]),UG(o,a,[t.value,t.heading,c]);let u=S.useMemo(()=>({id:o,forceMount:s}),[s]);return S.createElement(da.div,{ref:ux([a,e]),...i,"cmdk-group":"",role:"presentation",hidden:l?void 0:!0},n&&S.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),LR(t,p=>S.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},S.createElement(FG.Provider,{value:u},p))))}),XCe=S.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,s=S.useRef(null),i=Pp(o=>!o.search);return!n&&!i?null:S.createElement(da.div,{ref:ux([s,e]),...r,"cmdk-separator":"",role:"separator"})}),QCe=S.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,s=t.value!=null,i=JL(),o=Pp(f=>f.search),a=Pp(f=>f.value),c=C_(),d=S.useMemo(()=>{var f;let l=(f=c.listInnerRef.current)==null?void 0:f.querySelector(`${ZL}[${Qf}="${encodeURIComponent(a)}"]`);return l==null?void 0:l.getAttribute("id")},[]);return S.useEffect(()=>{t.value!=null&&i.setState("search",t.value)},[t.value]),S.createElement(da.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":d,id:c.inputId,type:"text",value:s?t.value:o,onChange:f=>{s||i.setState("search",f.target.value),n==null||n(f.target.value)}})}),ZCe=S.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...s}=t,i=S.useRef(null),o=S.useRef(null),a=C_();return S.useEffect(()=>{if(o.current&&i.current){let c=o.current,d=i.current,f,l=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let u=c.offsetHeight;d.style.setProperty("--cmdk-list-height",u.toFixed(1)+"px")})});return l.observe(c),()=>{cancelAnimationFrame(f),l.unobserve(c)}}},[]),S.createElement(da.div,{ref:ux([i,e]),...s,"cmdk-list":"",role:"listbox","aria-label":r,id:a.listId},LR(t,c=>S.createElement("div",{ref:ux([o,a.listInnerRef]),"cmdk-list-sizer":""},c)))}),JCe=S.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:o,...a}=t;return S.createElement(UCe,{open:n,onOpenChange:r},S.createElement(HCe,{container:o},S.createElement(VCe,{"cmdk-overlay":"",className:s}),S.createElement(qCe,{"aria-label":t.label,"cmdk-dialog":"",className:i},S.createElement(zG,{ref:e,...a}))))}),eEe=S.forwardRef((t,e)=>Pp(n=>n.filtered.count===0)?S.createElement(da.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),tEe=S.forwardRef((t,e)=>{let{progress:n,children:r,label:s="Loading...",...i}=t;return S.createElement(da.div,{ref:e,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},LR(t,o=>S.createElement("div",{"aria-hidden":!0},o)))}),zi=Object.assign(zG,{List:ZCe,Item:KCe,Input:QCe,Group:YCe,Separator:XCe,Dialog:JCe,Empty:eEe,Loading:tEe});function nEe(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function rEe(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function BG(t){let e=S.useRef(t);return Rp(()=>{e.current=t}),e}var Rp=typeof window>"u"?S.useEffect:S.useLayoutEffect;function km(t){let e=S.useRef();return e.current===void 0&&(e.current=t()),e}function ux(t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}function Pp(t){let e=JL(),n=()=>t(e.snapshot());return S.useSyncExternalStore(e.subscribe,n,n)}function UG(t,e,n,r=[]){let s=S.useRef(),i=C_();return Rp(()=>{var o;let a=(()=>{var d;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(d=f.current.textContent)==null?void 0:d.trim():s.current}})(),c=r.map(d=>d.trim());i.value(t,a,c),(o=e.current)==null||o.setAttribute(Qf,a),s.current=a}),s}var sEe=()=>{let[t,e]=S.useState(),n=km(()=>new Map);return Rp(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,s)=>{n.current.set(r,s),e({})}};function iEe(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function LR({asChild:t,children:e},n){return t&&S.isValidElement(e)?S.cloneElement(iEe(e),{ref:e.ref},n(e.props.children)):n(e)}var oEe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const E_=uR,e2=dR,aEe=fR,wE=by,HG=S.forwardRef(({className:t,...e},n)=>x.jsx(my,{ref:n,className:ie("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));HG.displayName=my.displayName;const Cy=S.forwardRef(({className:t,children:e,...n},r)=>x.jsxs(aEe,{children:[x.jsx(HG,{}),x.jsxs(gy,{ref:r,className:ie("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...n,children:[e,x.jsxs(by,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[x.jsx(aR,{className:"h-4 w-4"}),x.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Cy.displayName=gy.displayName;const Ey=({className:t,...e})=>x.jsx("div",{className:ie("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});Ey.displayName="DialogHeader";const Ay=({className:t,...e})=>x.jsx("div",{className:ie("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});Ay.displayName="DialogFooter";const Ry=S.forwardRef(({className:t,...e},n)=>x.jsx(vy,{ref:n,className:ie("text-lg font-semibold leading-none tracking-tight",t),...e}));Ry.displayName=vy.displayName;const $R=S.forwardRef(({className:t,...e},n)=>x.jsx(yy,{ref:n,className:ie("text-sm text-muted-foreground",t),...e}));$R.displayName=yy.displayName;const lEe=S.forwardRef(({className:t,...e},n)=>x.jsx(zi,{ref:n,className:ie("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));lEe.displayName=zi.displayName;const cEe=S.forwardRef(({className:t,...e},n)=>x.jsxs("div",{className:"flex items-center px-3 border-b","cmdk-input-wrapper":"",children:[x.jsx(Aq,{className:"w-4 h-4 mr-2 opacity-50 shrink-0"}),x.jsx(zi.Input,{ref:n,className:ie("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...e})]}));cEe.displayName=zi.Input.displayName;const uEe=S.forwardRef(({className:t,...e},n)=>x.jsx(zi.List,{ref:n,className:ie("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));uEe.displayName=zi.List.displayName;const dEe=S.forwardRef((t,e)=>x.jsx(zi.Empty,{ref:e,className:"py-6 text-sm text-center",...t}));dEe.displayName=zi.Empty.displayName;const fEe=S.forwardRef(({className:t,...e},n)=>x.jsx(zi.Group,{ref:n,className:ie("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...e}));fEe.displayName=zi.Group.displayName;const hEe=S.forwardRef(({className:t,...e},n)=>x.jsx(zi.Separator,{ref:n,className:ie("-mx-1 h-px bg-border",t),...e}));hEe.displayName=zi.Separator.displayName;const pEe=S.forwardRef(({className:t,...e},n)=>x.jsx(zi.Item,{ref:n,className:ie("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...e}));pEe.displayName=zi.Item.displayName;const mEe=["top","right","bottom","left"],Ll=Math.min,mo=Math.max,_E=Math.round,x1=Math.floor,of=t=>({x:t,y:t}),gEe={left:"right",right:"left",bottom:"top",top:"bottom"},vEe={start:"end",end:"start"};function HM(t,e,n){return mo(t,Ll(e,n))}function xu(t,e){return typeof t=="function"?t(e):t}function wu(t){return t.split("-")[0]}function Py(t){return t.split("-")[1]}function t2(t){return t==="x"?"y":"x"}function n2(t){return t==="y"?"height":"width"}function af(t){return["top","bottom"].includes(wu(t))?"y":"x"}function r2(t){return t2(af(t))}function yEe(t,e,n){n===void 0&&(n=!1);const r=Py(t),s=r2(t),i=n2(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=SE(o)),[o,SE(o)]}function bEe(t){const e=SE(t);return[VM(t),e,VM(e)]}function VM(t){return t.replace(/start|end/g,e=>vEe[e])}function xEe(t,e,n){const r=["left","right"],s=["right","left"],i=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return n?e?s:r:e?r:s;case"left":case"right":return e?i:o;default:return[]}}function wEe(t,e,n,r){const s=Py(t);let i=xEe(wu(t),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(VM)))),i}function SE(t){return t.replace(/left|right|bottom|top/g,e=>gEe[e])}function _Ee(t){return{top:0,right:0,bottom:0,left:0,...t}}function VG(t){return typeof t!="number"?_Ee(t):{top:t,right:t,bottom:t,left:t}}function CE(t){const{x:e,y:n,width:r,height:s}=t;return{width:r,height:s,top:n,left:e,right:e+r,bottom:n+s,x:e,y:n}}function v5(t,e,n){let{reference:r,floating:s}=t;const i=af(e),o=r2(e),a=n2(o),c=wu(e),d=i==="y",f=r.x+r.width/2-s.width/2,l=r.y+r.height/2-s.height/2,u=r[a]/2-s[a]/2;let p;switch(c){case"top":p={x:f,y:r.y-s.height};break;case"bottom":p={x:f,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:l};break;case"left":p={x:r.x-s.width,y:l};break;default:p={x:r.x,y:r.y}}switch(Py(e)){case"start":p[o]-=u*(n&&d?-1:1);break;case"end":p[o]+=u*(n&&d?-1:1);break}return p}const SEe=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,a=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let d=await o.getElementRects({reference:t,floating:e,strategy:s}),{x:f,y:l}=v5(d,r,c),u=r,p={},h=0;for(let m=0;m({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:o,elements:a,middlewareData:c}=e,{element:d,padding:f=0}=xu(t,e)||{};if(d==null)return{};const l=VG(f),u={x:n,y:r},p=r2(s),h=n2(p),m=await o.getDimensions(d),y=p==="y",g=y?"top":"left",v=y?"bottom":"right",b=y?"clientHeight":"clientWidth",_=i.reference[h]+i.reference[p]-u[p]-i.floating[h],A=u[p]-i.reference[p],P=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let T=P?P[b]:0;(!T||!await(o.isElement==null?void 0:o.isElement(P)))&&(T=a.floating[b]||i.floating[h]);const E=_/2-A/2,N=T/2-m[h]/2-1,k=Ll(l[g],N),M=Ll(l[v],N),j=k,I=T-m[h]-M,L=T/2-m[h]/2+E,H=HM(j,L,I),K=!c.arrow&&Py(s)!=null&&L!==H&&i.reference[h]/2-(LL<=0)){var M,j;const L=(((M=i.flip)==null?void 0:M.index)||0)+1,H=T[L];if(H)return{data:{index:L,overflows:k},reset:{placement:H}};let K=(j=k.filter(V=>V.overflows[0]<=0).sort((V,U)=>V.overflows[1]-U.overflows[1])[0])==null?void 0:j.placement;if(!K)switch(p){case"bestFit":{var I;const V=(I=k.filter(U=>{if(P){const Q=af(U.placement);return Q===v||Q==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(Q=>Q>0).reduce((Q,te)=>Q+te,0)]).sort((U,Q)=>U[1]-Q[1])[0])==null?void 0:I[0];V&&(K=V);break}case"initialPlacement":K=a;break}if(s!==K)return{reset:{placement:K}}}return{}}}};function y5(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function b5(t){return mEe.some(e=>t[e]>=0)}const AEe=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...s}=xu(t,e);switch(r){case"referenceHidden":{const i=await dx(e,{...s,elementContext:"reference"}),o=y5(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:b5(o)}}}case"escaped":{const i=await dx(e,{...s,altBoundary:!0}),o=y5(i,n.floating);return{data:{escapedOffsets:o,escaped:b5(o)}}}default:return{}}}}};async function REe(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=wu(n),a=Py(n),c=af(n)==="y",d=["left","top"].includes(o)?-1:1,f=i&&c?-1:1,l=xu(e,t);let{mainAxis:u,crossAxis:p,alignmentAxis:h}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...l};return a&&typeof h=="number"&&(p=a==="end"?h*-1:h),c?{x:p*f,y:u*d}:{x:u*d,y:p*f}}const PEe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:o,middlewareData:a}=e,c=await REe(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:o}}}}},NEe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:s}=e,{mainAxis:i=!0,crossAxis:o=!1,limiter:a={fn:y=>{let{x:g,y:v}=y;return{x:g,y:v}}},...c}=xu(t,e),d={x:n,y:r},f=await dx(e,c),l=af(wu(s)),u=t2(l);let p=d[u],h=d[l];if(i){const y=u==="y"?"top":"left",g=u==="y"?"bottom":"right",v=p+f[y],b=p-f[g];p=HM(v,p,b)}if(o){const y=l==="y"?"top":"left",g=l==="y"?"bottom":"right",v=h+f[y],b=h-f[g];h=HM(v,h,b)}const m=a.fn({...e,[u]:p,[l]:h});return{...m,data:{x:m.x-n,y:m.y-r}}}}},TEe=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:s,rects:i,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:d=!0}=xu(t,e),f={x:n,y:r},l=af(s),u=t2(l);let p=f[u],h=f[l];const m=xu(a,e),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const b=u==="y"?"height":"width",_=i.reference[u]-i.floating[b]+y.mainAxis,A=i.reference[u]+i.reference[b]-y.mainAxis;p<_?p=_:p>A&&(p=A)}if(d){var g,v;const b=u==="y"?"width":"height",_=["top","left"].includes(wu(s)),A=i.reference[l]-i.floating[b]+(_&&((g=o.offset)==null?void 0:g[l])||0)+(_?0:y.crossAxis),P=i.reference[l]+i.reference[b]+(_?0:((v=o.offset)==null?void 0:v[l])||0)-(_?y.crossAxis:0);hP&&(h=P)}return{[u]:p,[l]:h}}}},kEe=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:s,elements:i}=e,{apply:o=()=>{},...a}=xu(t,e),c=await dx(e,a),d=wu(n),f=Py(n),l=af(n)==="y",{width:u,height:p}=r.floating;let h,m;d==="top"||d==="bottom"?(h=d,m=f===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(m=d,h=f==="end"?"top":"bottom");const y=p-c.top-c.bottom,g=u-c.left-c.right,v=Ll(p-c[h],y),b=Ll(u-c[m],g),_=!e.middlewareData.shift;let A=v,P=b;if(l?P=f||_?Ll(b,g):g:A=f||_?Ll(v,y):y,_&&!f){const E=mo(c.left,0),N=mo(c.right,0),k=mo(c.top,0),M=mo(c.bottom,0);l?P=u-2*(E!==0||N!==0?E+N:mo(c.left,c.right)):A=p-2*(k!==0||M!==0?k+M:mo(c.top,c.bottom))}await o({...e,availableWidth:P,availableHeight:A});const T=await s.getDimensions(i.floating);return u!==T.width||p!==T.height?{reset:{rects:!0}}:{}}}};function Ny(t){return qG(t)?(t.nodeName||"").toLowerCase():"#document"}function wo(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Tu(t){var e;return(e=(qG(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function qG(t){return t instanceof Node||t instanceof wo(t).Node}function Wl(t){return t instanceof Element||t instanceof wo(t).Element}function Gl(t){return t instanceof HTMLElement||t instanceof wo(t).HTMLElement}function x5(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof wo(t).ShadowRoot}function A_(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=Za(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(s)}function DEe(t){return["table","td","th"].includes(Ny(t))}function FR(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function s2(t){const e=i2(),n=Za(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function MEe(t){let e=lf(t);for(;Gl(e)&&!Vv(e);){if(FR(e))return null;if(s2(e))return e;e=lf(e)}return null}function i2(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Vv(t){return["html","body","#document"].includes(Ny(t))}function Za(t){return wo(t).getComputedStyle(t)}function zR(t){return Wl(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function lf(t){if(Ny(t)==="html")return t;const e=t.assignedSlot||t.parentNode||x5(t)&&t.host||Tu(t);return x5(e)?e.host:e}function WG(t){const e=lf(t);return Vv(e)?t.ownerDocument?t.ownerDocument.body:t.body:Gl(e)&&A_(e)?e:WG(e)}function fx(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=WG(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),o=wo(s);return i?e.concat(o,o.visualViewport||[],A_(s)?s:[],o.frameElement&&n?fx(o.frameElement):[]):e.concat(s,fx(s,[],n))}function GG(t){const e=Za(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=Gl(t),i=s?t.offsetWidth:n,o=s?t.offsetHeight:r,a=_E(n)!==i||_E(r)!==o;return a&&(n=i,r=o),{width:n,height:r,$:a}}function o2(t){return Wl(t)?t:t.contextElement}function pg(t){const e=o2(t);if(!Gl(e))return of(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=GG(e);let o=(i?_E(n.width):n.width)/r,a=(i?_E(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const OEe=of(0);function KG(t){const e=wo(t);return!i2()||!e.visualViewport?OEe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function jEe(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==wo(t)?!1:e}function Np(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=o2(t);let o=of(1);e&&(r?Wl(r)&&(o=pg(r)):o=pg(t));const a=jEe(i,n,r)?KG(i):of(0);let c=(s.left+a.x)/o.x,d=(s.top+a.y)/o.y,f=s.width/o.x,l=s.height/o.y;if(i){const u=wo(i),p=r&&Wl(r)?wo(r):r;let h=u,m=h.frameElement;for(;m&&r&&p!==h;){const y=pg(m),g=m.getBoundingClientRect(),v=Za(m),b=g.left+(m.clientLeft+parseFloat(v.paddingLeft))*y.x,_=g.top+(m.clientTop+parseFloat(v.paddingTop))*y.y;c*=y.x,d*=y.y,f*=y.x,l*=y.y,c+=b,d+=_,h=wo(m),m=h.frameElement}}return CE({width:f,height:l,x:c,y:d})}function IEe(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",o=Tu(r),a=e?FR(e.floating):!1;if(r===o||a&&i)return n;let c={scrollLeft:0,scrollTop:0},d=of(1);const f=of(0),l=Gl(r);if((l||!l&&!i)&&((Ny(r)!=="body"||A_(o))&&(c=zR(r)),Gl(r))){const u=Np(r);d=pg(r),f.x=u.x+r.clientLeft,f.y=u.y+r.clientTop}return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+f.x,y:n.y*d.y-c.scrollTop*d.y+f.y}}function LEe(t){return Array.from(t.getClientRects())}function YG(t){return Np(Tu(t)).left+zR(t).scrollLeft}function $Ee(t){const e=Tu(t),n=zR(t),r=t.ownerDocument.body,s=mo(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=mo(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+YG(t);const a=-n.scrollTop;return Za(r).direction==="rtl"&&(o+=mo(e.clientWidth,r.clientWidth)-s),{width:s,height:i,x:o,y:a}}function FEe(t,e){const n=wo(t),r=Tu(t),s=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,a=0,c=0;if(s){i=s.width,o=s.height;const d=i2();(!d||d&&e==="fixed")&&(a=s.offsetLeft,c=s.offsetTop)}return{width:i,height:o,x:a,y:c}}function zEe(t,e){const n=Np(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Gl(t)?pg(t):of(1),o=t.clientWidth*i.x,a=t.clientHeight*i.y,c=s*i.x,d=r*i.y;return{width:o,height:a,x:c,y:d}}function w5(t,e,n){let r;if(e==="viewport")r=FEe(t,n);else if(e==="document")r=$Ee(Tu(t));else if(Wl(e))r=zEe(e,n);else{const s=KG(t);r={...e,x:e.x-s.x,y:e.y-s.y}}return CE(r)}function XG(t,e){const n=lf(t);return n===e||!Wl(n)||Vv(n)?!1:Za(n).position==="fixed"||XG(n,e)}function BEe(t,e){const n=e.get(t);if(n)return n;let r=fx(t,[],!1).filter(a=>Wl(a)&&Ny(a)!=="body"),s=null;const i=Za(t).position==="fixed";let o=i?lf(t):t;for(;Wl(o)&&!Vv(o);){const a=Za(o),c=s2(o);!c&&a.position==="fixed"&&(s=null),(i?!c&&!s:!c&&a.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||A_(o)&&!c&&XG(t,o))?r=r.filter(f=>f!==o):s=a,o=lf(o)}return e.set(t,r),r}function UEe(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const o=[...n==="clippingAncestors"?FR(e)?[]:BEe(e,this._c):[].concat(n),r],a=o[0],c=o.reduce((d,f)=>{const l=w5(e,f,s);return d.top=mo(l.top,d.top),d.right=Ll(l.right,d.right),d.bottom=Ll(l.bottom,d.bottom),d.left=mo(l.left,d.left),d},w5(e,a,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function HEe(t){const{width:e,height:n}=GG(t);return{width:e,height:n}}function VEe(t,e,n){const r=Gl(e),s=Tu(e),i=n==="fixed",o=Np(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const c=of(0);if(r||!r&&!i)if((Ny(e)!=="body"||A_(s))&&(a=zR(e)),r){const l=Np(e,!0,i,e);c.x=l.x+e.clientLeft,c.y=l.y+e.clientTop}else s&&(c.x=YG(s));const d=o.left+a.scrollLeft-c.x,f=o.top+a.scrollTop-c.y;return{x:d,y:f,width:o.width,height:o.height}}function pk(t){return Za(t).position==="static"}function _5(t,e){return!Gl(t)||Za(t).position==="fixed"?null:e?e(t):t.offsetParent}function QG(t,e){const n=wo(t);if(FR(t))return n;if(!Gl(t)){let s=lf(t);for(;s&&!Vv(s);){if(Wl(s)&&!pk(s))return s;s=lf(s)}return n}let r=_5(t,e);for(;r&&DEe(r)&&pk(r);)r=_5(r,e);return r&&Vv(r)&&pk(r)&&!s2(r)?n:r||MEe(t)||n}const qEe=async function(t){const e=this.getOffsetParent||QG,n=this.getDimensions,r=await n(t.floating);return{reference:VEe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function WEe(t){return Za(t).direction==="rtl"}const GEe={convertOffsetParentRelativeRectToViewportRelativeRect:IEe,getDocumentElement:Tu,getClippingRect:UEe,getOffsetParent:QG,getElementRects:qEe,getClientRects:LEe,getDimensions:HEe,getScale:pg,isElement:Wl,isRTL:WEe};function KEe(t,e){let n=null,r;const s=Tu(t);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const{left:d,top:f,width:l,height:u}=t.getBoundingClientRect();if(a||e(),!l||!u)return;const p=x1(f),h=x1(s.clientWidth-(d+l)),m=x1(s.clientHeight-(f+u)),y=x1(d),v={rootMargin:-p+"px "+-h+"px "+-m+"px "+-y+"px",threshold:mo(0,Ll(1,c))||1};let b=!0;function _(A){const P=A[0].intersectionRatio;if(P!==c){if(!b)return o();P?o(!1,P):r=setTimeout(()=>{o(!1,1e-7)},1e3)}b=!1}try{n=new IntersectionObserver(_,{...v,root:s.ownerDocument})}catch{n=new IntersectionObserver(_,v)}n.observe(t)}return o(!0),i}function YEe(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=o2(t),f=s||i?[...d?fx(d):[],...fx(e)]:[];f.forEach(g=>{s&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const l=d&&a?KEe(d,n):null;let u=-1,p=null;o&&(p=new ResizeObserver(g=>{let[v]=g;v&&v.target===d&&p&&(p.unobserve(e),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(e)})),n()}),d&&!c&&p.observe(d),p.observe(e));let h,m=c?Np(t):null;c&&y();function y(){const g=Np(t);m&&(g.x!==m.x||g.y!==m.y||g.width!==m.width||g.height!==m.height)&&n(),m=g,h=requestAnimationFrame(y)}return n(),()=>{var g;f.forEach(v=>{s&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),l==null||l(),(g=p)==null||g.disconnect(),p=null,c&&cancelAnimationFrame(h)}}const XEe=PEe,QEe=NEe,ZEe=EEe,JEe=kEe,eAe=AEe,S5=CEe,tAe=TEe,nAe=(t,e,n)=>{const r=new Map,s={platform:GEe,...n},i={...s.platform,_c:r};return SEe(t,e,{...s,platform:i})};var lC=typeof document<"u"?S.useLayoutEffect:S.useEffect;function EE(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!EE(t[r],e[r]))return!1;return!0}if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&t.$$typeof)&&!EE(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function ZG(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function C5(t,e){const n=ZG(t);return Math.round(e*n)/n}function E5(t){const e=S.useRef(t);return lC(()=>{e.current=t}),e}function rAe(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:a=!0,whileElementsMounted:c,open:d}=t,[f,l]=S.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[u,p]=S.useState(r);EE(u,r)||p(r);const[h,m]=S.useState(null),[y,g]=S.useState(null),v=S.useCallback(V=>{V!==P.current&&(P.current=V,m(V))},[]),b=S.useCallback(V=>{V!==T.current&&(T.current=V,g(V))},[]),_=i||h,A=o||y,P=S.useRef(null),T=S.useRef(null),E=S.useRef(f),N=c!=null,k=E5(c),M=E5(s),j=S.useCallback(()=>{if(!P.current||!T.current)return;const V={placement:e,strategy:n,middleware:u};M.current&&(V.platform=M.current),nAe(P.current,T.current,V).then(U=>{const Q={...U,isPositioned:!0};I.current&&!EE(E.current,Q)&&(E.current=Q,rs.flushSync(()=>{l(Q)}))})},[u,e,n,M]);lC(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,l(V=>({...V,isPositioned:!1})))},[d]);const I=S.useRef(!1);lC(()=>(I.current=!0,()=>{I.current=!1}),[]),lC(()=>{if(_&&(P.current=_),A&&(T.current=A),_&&A){if(k.current)return k.current(_,A,j);j()}},[_,A,j,k,N]);const L=S.useMemo(()=>({reference:P,floating:T,setReference:v,setFloating:b}),[v,b]),H=S.useMemo(()=>({reference:_,floating:A}),[_,A]),K=S.useMemo(()=>{const V={position:n,left:0,top:0};if(!H.floating)return V;const U=C5(H.floating,f.x),Q=C5(H.floating,f.y);return a?{...V,transform:"translate("+U+"px, "+Q+"px)",...ZG(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:U,top:Q}},[n,a,H.floating,f.x,f.y]);return S.useMemo(()=>({...f,update:j,refs:L,elements:H,floatingStyles:K}),[f,j,L,H,K])}const sAe=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:s}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?S5({element:r.current,padding:s}).fn(n):{}:r?S5({element:r,padding:s}).fn(n):{}}}},iAe=(t,e)=>({...XEe(t),options:[t,e]}),oAe=(t,e)=>({...QEe(t),options:[t,e]}),aAe=(t,e)=>({...tAe(t),options:[t,e]}),lAe=(t,e)=>({...ZEe(t),options:[t,e]}),cAe=(t,e)=>({...JEe(t),options:[t,e]}),uAe=(t,e)=>({...eAe(t),options:[t,e]}),dAe=(t,e)=>({...sAe(t),options:[t,e]});var fAe="Arrow",JG=S.forwardRef((t,e)=>{const{children:n,width:r=10,height:s=5,...i}=t;return x.jsx(De.svg,{...i,ref:e,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:x.jsx("polygon",{points:"0,0 30,0 15,10"})})});JG.displayName=fAe;var hAe=JG,a2="Popper",[e7,ec]=jn(a2),[pAe,t7]=e7(a2),n7=t=>{const{__scopePopper:e,children:n}=t,[r,s]=S.useState(null);return x.jsx(pAe,{scope:e,anchor:r,onAnchorChange:s,children:n})};n7.displayName=a2;var r7="PopperAnchor",s7=S.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...s}=t,i=t7(r7,n),o=S.useRef(null),a=et(e,o);return S.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:x.jsx(De.div,{...s,ref:a})});s7.displayName=r7;var l2="PopperContent",[mAe,gAe]=e7(l2),i7=S.forwardRef((t,e)=>{var ce,xe,Pe,pe,Le,Me;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:l="partial",hideWhenDetached:u=!1,updatePositionStrategy:p="optimized",onPlaced:h,...m}=t,y=t7(l2,n),[g,v]=S.useState(null),b=et(e,Oe=>v(Oe)),[_,A]=S.useState(null),P=__(_),T=(P==null?void 0:P.width)??0,E=(P==null?void 0:P.height)??0,N=r+(i!=="center"?"-"+i:""),k=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},M=Array.isArray(d)?d:[d],j=M.length>0,I={padding:k,boundary:M.filter(yAe),altBoundary:j},{refs:L,floatingStyles:H,placement:K,isPositioned:V,middlewareData:U}=rAe({strategy:"fixed",placement:N,whileElementsMounted:(...Oe)=>YEe(...Oe,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[iAe({mainAxis:s+E,alignmentAxis:o}),c&&oAe({mainAxis:!0,crossAxis:!1,limiter:l==="partial"?aAe():void 0,...I}),c&&lAe({...I}),cAe({...I,apply:({elements:Oe,rects:Fe,availableWidth:ot,availableHeight:nt})=>{const{width:At,height:ee}=Fe.reference,de=Oe.floating.style;de.setProperty("--radix-popper-available-width",`${ot}px`),de.setProperty("--radix-popper-available-height",`${nt}px`),de.setProperty("--radix-popper-anchor-width",`${At}px`),de.setProperty("--radix-popper-anchor-height",`${ee}px`)}}),_&&dAe({element:_,padding:a}),bAe({arrowWidth:T,arrowHeight:E}),u&&uAe({strategy:"referenceHidden",...I})]}),[Q,te]=l7(K),X=on(h);ir(()=>{V&&(X==null||X())},[V,X]);const G=(ce=U.arrow)==null?void 0:ce.x,Y=(xe=U.arrow)==null?void 0:xe.y,Z=((Pe=U.arrow)==null?void 0:Pe.centerOffset)!==0,[he,fe]=S.useState();return ir(()=>{g&&fe(window.getComputedStyle(g).zIndex)},[g]),x.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:V?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:he,"--radix-popper-transform-origin":[(pe=U.transformOrigin)==null?void 0:pe.x,(Le=U.transformOrigin)==null?void 0:Le.y].join(" "),...((Me=U.hide)==null?void 0:Me.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:x.jsx(mAe,{scope:n,placedSide:Q,onArrowChange:A,arrowX:G,arrowY:Y,shouldHideArrow:Z,children:x.jsx(De.div,{"data-side":Q,"data-align":te,...m,ref:b,style:{...m.style,animation:V?void 0:"none"}})})})});i7.displayName=l2;var o7="PopperArrow",vAe={top:"bottom",right:"left",bottom:"top",left:"right"},a7=S.forwardRef(function(e,n){const{__scopePopper:r,...s}=e,i=gAe(o7,r),o=vAe[i.placedSide];return x.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:x.jsx(hAe,{...s,ref:n,style:{...s.style,display:"block"}})})});a7.displayName=o7;function yAe(t){return t!==null}var bAe=t=>({name:"transformOrigin",options:t,fn(e){var y,g,v;const{placement:n,rects:r,middlewareData:s}=e,o=((y=s.arrow)==null?void 0:y.centerOffset)!==0,a=o?0:t.arrowWidth,c=o?0:t.arrowHeight,[d,f]=l7(n),l={start:"0%",center:"50%",end:"100%"}[f],u=(((g=s.arrow)==null?void 0:g.x)??0)+a/2,p=(((v=s.arrow)==null?void 0:v.y)??0)+c/2;let h="",m="";return d==="bottom"?(h=o?l:`${u}px`,m=`${-c}px`):d==="top"?(h=o?l:`${u}px`,m=`${r.floating.height+c}px`):d==="right"?(h=`${-c}px`,m=o?l:`${p}px`):d==="left"&&(h=`${r.floating.width+c}px`,m=o?l:`${p}px`),{data:{x:h,y:m}}}});function l7(t){const[e,n="center"]=t.split("-");return[e,n]}var BR=n7,Ty=s7,R_=i7,P_=a7,mk="rovingFocusGroup.onEntryFocus",xAe={bubbles:!1,cancelable:!0},UR="RovingFocusGroup",[qM,c7,wAe]=Au(UR),[_Ae,tc]=jn(UR,[wAe]),[SAe,CAe]=_Ae(UR),u7=S.forwardRef((t,e)=>x.jsx(qM.Provider,{scope:t.__scopeRovingFocusGroup,children:x.jsx(qM.Slot,{scope:t.__scopeRovingFocusGroup,children:x.jsx(EAe,{...t,ref:e})})}));u7.displayName=UR;var EAe=S.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...l}=t,u=S.useRef(null),p=et(e,u),h=tl(i),[m=null,y]=mr({prop:o,defaultProp:a,onChange:c}),[g,v]=S.useState(!1),b=on(d),_=c7(n),A=S.useRef(!1),[P,T]=S.useState(0);return S.useEffect(()=>{const E=u.current;if(E)return E.addEventListener(mk,b),()=>E.removeEventListener(mk,b)},[b]),x.jsx(SAe,{scope:n,orientation:r,dir:h,loop:s,currentTabStopId:m,onItemFocus:S.useCallback(E=>y(E),[y]),onItemShiftTab:S.useCallback(()=>v(!0),[]),onFocusableItemAdd:S.useCallback(()=>T(E=>E+1),[]),onFocusableItemRemove:S.useCallback(()=>T(E=>E-1),[]),children:x.jsx(De.div,{tabIndex:g||P===0?-1:0,"data-orientation":r,...l,ref:p,style:{outline:"none",...t.style},onMouseDown:ye(t.onMouseDown,()=>{A.current=!0}),onFocus:ye(t.onFocus,E=>{const N=!A.current;if(E.target===E.currentTarget&&N&&!g){const k=new CustomEvent(mk,xAe);if(E.currentTarget.dispatchEvent(k),!k.defaultPrevented){const M=_().filter(K=>K.focusable),j=M.find(K=>K.active),I=M.find(K=>K.id===m),H=[j,I,...M].filter(Boolean).map(K=>K.ref.current);h7(H,f)}}A.current=!1}),onBlur:ye(t.onBlur,()=>v(!1))})})}),d7="RovingFocusGroupItem",f7=S.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,...o}=t,a=Ls(),c=i||a,d=CAe(d7,n),f=d.currentTabStopId===c,l=c7(n),{onFocusableItemAdd:u,onFocusableItemRemove:p}=d;return S.useEffect(()=>{if(r)return u(),()=>p()},[r,u,p]),x.jsx(qM.ItemSlot,{scope:n,id:c,focusable:r,active:s,children:x.jsx(De.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...o,ref:e,onMouseDown:ye(t.onMouseDown,h=>{r?d.onItemFocus(c):h.preventDefault()}),onFocus:ye(t.onFocus,()=>d.onItemFocus(c)),onKeyDown:ye(t.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){d.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const m=PAe(h,d.orientation,d.dir);if(m!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let g=l().filter(v=>v.focusable).map(v=>v.ref.current);if(m==="last")g.reverse();else if(m==="prev"||m==="next"){m==="prev"&&g.reverse();const v=g.indexOf(h.currentTarget);g=d.loop?NAe(g,v+1):g.slice(v+1)}setTimeout(()=>h7(g))}})})})});f7.displayName=d7;var AAe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function RAe(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function PAe(t,e,n){const r=RAe(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return AAe[r]}function h7(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function NAe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var N_=u7,T_=f7,WM=["Enter"," "],TAe=["ArrowDown","PageUp","Home"],p7=["ArrowUp","PageDown","End"],kAe=[...TAe,...p7],DAe={ltr:[...WM,"ArrowRight"],rtl:[...WM,"ArrowLeft"]},MAe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},k_="Menu",[hx,OAe,jAe]=Au(k_),[Vp,D_]=jn(k_,[jAe,ec,tc]),HR=ec(),m7=tc(),[IAe,qp]=Vp(k_),[LAe,M_]=Vp(k_),g7=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:s,onOpenChange:i,modal:o=!0}=t,a=HR(e),[c,d]=S.useState(null),f=S.useRef(!1),l=on(i),u=tl(s);return S.useEffect(()=>{const p=()=>{f.current=!0,document.addEventListener("pointerdown",h,{capture:!0,once:!0}),document.addEventListener("pointermove",h,{capture:!0,once:!0})},h=()=>f.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",h,{capture:!0}),document.removeEventListener("pointermove",h,{capture:!0})}},[]),x.jsx(BR,{...a,children:x.jsx(IAe,{scope:e,open:n,onOpenChange:l,content:c,onContentChange:d,children:x.jsx(LAe,{scope:e,onClose:S.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:f,dir:u,modal:o,children:r})})})};g7.displayName=k_;var $Ae="MenuAnchor",c2=S.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=HR(n);return x.jsx(Ty,{...s,...r,ref:e})});c2.displayName=$Ae;var u2="MenuPortal",[FAe,v7]=Vp(u2,{forceMount:void 0}),y7=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:s}=t,i=qp(u2,e);return x.jsx(FAe,{scope:e,forceMount:n,children:x.jsx(Kn,{present:n||i.open,children:x.jsx(py,{asChild:!0,container:s,children:r})})})};y7.displayName=u2;var ia="MenuContent",[zAe,d2]=Vp(ia),b7=S.forwardRef((t,e)=>{const n=v7(ia,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=qp(ia,t.__scopeMenu),o=M_(ia,t.__scopeMenu);return x.jsx(hx.Provider,{scope:t.__scopeMenu,children:x.jsx(Kn,{present:r||i.open,children:x.jsx(hx.Slot,{scope:t.__scopeMenu,children:o.modal?x.jsx(BAe,{...s,ref:e}):x.jsx(UAe,{...s,ref:e})})})})}),BAe=S.forwardRef((t,e)=>{const n=qp(ia,t.__scopeMenu),r=S.useRef(null),s=et(e,r);return S.useEffect(()=>{const i=r.current;if(i)return g_(i)},[]),x.jsx(f2,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ye(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),UAe=S.forwardRef((t,e)=>{const n=qp(ia,t.__scopeMenu);return x.jsx(f2,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),f2=S.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:l,onInteractOutside:u,onDismiss:p,disableOutsideScroll:h,...m}=t,y=qp(ia,n),g=M_(ia,n),v=HR(n),b=m7(n),_=OAe(n),[A,P]=S.useState(null),T=S.useRef(null),E=et(e,T,y.onContentChange),N=S.useRef(0),k=S.useRef(""),M=S.useRef(0),j=S.useRef(null),I=S.useRef("right"),L=S.useRef(0),H=h?m_:S.Fragment,K=h?{as:Ya,allowPinchZoom:!0}:void 0,V=Q=>{var ce,xe;const te=k.current+Q,X=_().filter(Pe=>!Pe.disabled),G=document.activeElement,Y=(ce=X.find(Pe=>Pe.ref.current===G))==null?void 0:ce.textValue,Z=X.map(Pe=>Pe.textValue),he=eRe(Z,te,Y),fe=(xe=X.find(Pe=>Pe.textValue===he))==null?void 0:xe.ref.current;(function Pe(pe){k.current=pe,window.clearTimeout(N.current),pe!==""&&(N.current=window.setTimeout(()=>Pe(""),1e3))})(te),fe&&setTimeout(()=>fe.focus())};S.useEffect(()=>()=>window.clearTimeout(N.current),[]),lR();const U=S.useCallback(Q=>{var X,G;return I.current===((X=j.current)==null?void 0:X.side)&&nRe(Q,(G=j.current)==null?void 0:G.area)},[]);return x.jsx(zAe,{scope:n,searchRef:k,onItemEnter:S.useCallback(Q=>{U(Q)&&Q.preventDefault()},[U]),onItemLeave:S.useCallback(Q=>{var te;U(Q)||((te=T.current)==null||te.focus(),P(null))},[U]),onTriggerLeave:S.useCallback(Q=>{U(Q)&&Q.preventDefault()},[U]),pointerGraceTimerRef:M,onPointerGraceIntentChange:S.useCallback(Q=>{j.current=Q},[]),children:x.jsx(H,{...K,children:x.jsx(p_,{asChild:!0,trapped:s,onMountAutoFocus:ye(i,Q=>{var te;Q.preventDefault(),(te=T.current)==null||te.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:x.jsx(Pu,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:l,onInteractOutside:u,onDismiss:p,children:x.jsx(N_,{asChild:!0,...b,dir:g.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:P,onEntryFocus:ye(c,Q=>{g.isUsingKeyboardRef.current||Q.preventDefault()}),preventScrollOnEntryFocus:!0,children:x.jsx(R_,{role:"menu","aria-orientation":"vertical","data-state":j7(y.open),"data-radix-menu-content":"",dir:g.dir,...v,...m,ref:E,style:{outline:"none",...m.style},onKeyDown:ye(m.onKeyDown,Q=>{const X=Q.target.closest("[data-radix-menu-content]")===Q.currentTarget,G=Q.ctrlKey||Q.altKey||Q.metaKey,Y=Q.key.length===1;X&&(Q.key==="Tab"&&Q.preventDefault(),!G&&Y&&V(Q.key));const Z=T.current;if(Q.target!==Z||!kAe.includes(Q.key))return;Q.preventDefault();const fe=_().filter(ce=>!ce.disabled).map(ce=>ce.ref.current);p7.includes(Q.key)&&fe.reverse(),ZAe(fe)}),onBlur:ye(t.onBlur,Q=>{Q.currentTarget.contains(Q.target)||(window.clearTimeout(N.current),k.current="")}),onPointerMove:ye(t.onPointerMove,px(Q=>{const te=Q.target,X=L.current!==Q.clientX;if(Q.currentTarget.contains(te)&&X){const G=Q.clientX>L.current?"right":"left";I.current=G,L.current=Q.clientX}}))})})})})})})});b7.displayName=ia;var HAe="MenuGroup",h2=S.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return x.jsx(De.div,{role:"group",...r,ref:e})});h2.displayName=HAe;var VAe="MenuLabel",x7=S.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return x.jsx(De.div,{...r,ref:e})});x7.displayName=VAe;var AE="MenuItem",A5="menu.itemSelect",VR=S.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...s}=t,i=S.useRef(null),o=M_(AE,t.__scopeMenu),a=d2(AE,t.__scopeMenu),c=et(e,i),d=S.useRef(!1),f=()=>{const l=i.current;if(!n&&l){const u=new CustomEvent(A5,{bubbles:!0,cancelable:!0});l.addEventListener(A5,p=>r==null?void 0:r(p),{once:!0}),sx(l,u),u.defaultPrevented?d.current=!1:o.onClose()}};return x.jsx(w7,{...s,ref:c,disabled:n,onClick:ye(t.onClick,f),onPointerDown:l=>{var u;(u=t.onPointerDown)==null||u.call(t,l),d.current=!0},onPointerUp:ye(t.onPointerUp,l=>{var u;d.current||(u=l.currentTarget)==null||u.click()}),onKeyDown:ye(t.onKeyDown,l=>{const u=a.searchRef.current!=="";n||u&&l.key===" "||WM.includes(l.key)&&(l.currentTarget.click(),l.preventDefault())})})});VR.displayName=AE;var w7=S.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=t,o=d2(AE,n),a=m7(n),c=S.useRef(null),d=et(e,c),[f,l]=S.useState(!1),[u,p]=S.useState("");return S.useEffect(()=>{const h=c.current;h&&p((h.textContent??"").trim())},[i.children]),x.jsx(hx.ItemSlot,{scope:n,disabled:r,textValue:s??u,children:x.jsx(T_,{asChild:!0,...a,focusable:!r,children:x.jsx(De.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:d,onPointerMove:ye(t.onPointerMove,px(h=>{r?o.onItemLeave(h):(o.onItemEnter(h),h.defaultPrevented||h.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ye(t.onPointerLeave,px(h=>o.onItemLeave(h))),onFocus:ye(t.onFocus,()=>l(!0)),onBlur:ye(t.onBlur,()=>l(!1))})})})}),qAe="MenuCheckboxItem",_7=S.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...s}=t;return x.jsx(R7,{scope:t.__scopeMenu,checked:n,children:x.jsx(VR,{role:"menuitemcheckbox","aria-checked":RE(n)?"mixed":n,...s,ref:e,"data-state":m2(n),onSelect:ye(s.onSelect,()=>r==null?void 0:r(RE(n)?!0:!n),{checkForDefaultPrevented:!1})})})});_7.displayName=qAe;var S7="MenuRadioGroup",[WAe,GAe]=Vp(S7,{value:void 0,onValueChange:()=>{}}),C7=S.forwardRef((t,e)=>{const{value:n,onValueChange:r,...s}=t,i=on(r);return x.jsx(WAe,{scope:t.__scopeMenu,value:n,onValueChange:i,children:x.jsx(h2,{...s,ref:e})})});C7.displayName=S7;var E7="MenuRadioItem",A7=S.forwardRef((t,e)=>{const{value:n,...r}=t,s=GAe(E7,t.__scopeMenu),i=n===s.value;return x.jsx(R7,{scope:t.__scopeMenu,checked:i,children:x.jsx(VR,{role:"menuitemradio","aria-checked":i,...r,ref:e,"data-state":m2(i),onSelect:ye(r.onSelect,()=>{var o;return(o=s.onValueChange)==null?void 0:o.call(s,n)},{checkForDefaultPrevented:!1})})})});A7.displayName=E7;var p2="MenuItemIndicator",[R7,KAe]=Vp(p2,{checked:!1}),P7=S.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...s}=t,i=KAe(p2,n);return x.jsx(Kn,{present:r||RE(i.checked)||i.checked===!0,children:x.jsx(De.span,{...s,ref:e,"data-state":m2(i.checked)})})});P7.displayName=p2;var YAe="MenuSeparator",N7=S.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return x.jsx(De.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});N7.displayName=YAe;var XAe="MenuArrow",T7=S.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=HR(n);return x.jsx(P_,{...s,...r,ref:e})});T7.displayName=XAe;var QAe="MenuSub",[$Ue,k7]=Vp(QAe),qb="MenuSubTrigger",D7=S.forwardRef((t,e)=>{const n=qp(qb,t.__scopeMenu),r=M_(qb,t.__scopeMenu),s=k7(qb,t.__scopeMenu),i=d2(qb,t.__scopeMenu),o=S.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=i,d={__scopeMenu:t.__scopeMenu},f=S.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return S.useEffect(()=>f,[f]),S.useEffect(()=>{const l=a.current;return()=>{window.clearTimeout(l),c(null)}},[a,c]),x.jsx(c2,{asChild:!0,...d,children:x.jsx(w7,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":j7(n.open),...t,ref:f_(e,s.onTriggerChange),onClick:l=>{var u;(u=t.onClick)==null||u.call(t,l),!(t.disabled||l.defaultPrevented)&&(l.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ye(t.onPointerMove,px(l=>{i.onItemEnter(l),!l.defaultPrevented&&!t.disabled&&!n.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:ye(t.onPointerLeave,px(l=>{var p,h;f();const u=(p=n.content)==null?void 0:p.getBoundingClientRect();if(u){const m=(h=n.content)==null?void 0:h.dataset.side,y=m==="right",g=y?-5:5,v=u[y?"left":"right"],b=u[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:l.clientX+g,y:l.clientY},{x:v,y:u.top},{x:b,y:u.top},{x:b,y:u.bottom},{x:v,y:u.bottom}],side:m}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(l),l.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ye(t.onKeyDown,l=>{var p;const u=i.searchRef.current!=="";t.disabled||u&&l.key===" "||DAe[r.dir].includes(l.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),l.preventDefault())})})})});D7.displayName=qb;var M7="MenuSubContent",O7=S.forwardRef((t,e)=>{const n=v7(ia,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=qp(ia,t.__scopeMenu),o=M_(ia,t.__scopeMenu),a=k7(M7,t.__scopeMenu),c=S.useRef(null),d=et(e,c);return x.jsx(hx.Provider,{scope:t.__scopeMenu,children:x.jsx(Kn,{present:r||i.open,children:x.jsx(hx.Slot,{scope:t.__scopeMenu,children:x.jsx(f2,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:d,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var l;o.isUsingKeyboardRef.current&&((l=c.current)==null||l.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:ye(t.onFocusOutside,f=>{f.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ye(t.onEscapeKeyDown,f=>{o.onClose(),f.preventDefault()}),onKeyDown:ye(t.onKeyDown,f=>{var p;const l=f.currentTarget.contains(f.target),u=MAe[o.dir].includes(f.key);l&&u&&(i.onOpenChange(!1),(p=a.trigger)==null||p.focus(),f.preventDefault())})})})})})});O7.displayName=M7;function j7(t){return t?"open":"closed"}function RE(t){return t==="indeterminate"}function m2(t){return RE(t)?"indeterminate":t?"checked":"unchecked"}function ZAe(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function JAe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function eRe(t,e,n){const s=e.length>1&&Array.from(e).every(d=>d===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let o=JAe(t,Math.max(i,0));s.length===1&&(o=o.filter(d=>d!==n));const c=o.find(d=>d.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function tRe(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,o=e.length-1;ir!=f>r&&n<(d-a)*(r-c)/(f-c)+a&&(s=!s)}return s}function nRe(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return tRe(n,e)}function px(t){return e=>e.pointerType==="mouse"?t(e):void 0}var rRe=g7,g2=c2,v2=y7,y2=b7,b2=h2,x2=x7,w2=VR,_2=_7,S2=C7,C2=A7,E2=P7,A2=N7,R2=T7,P2=D7,N2=O7,I7="ContextMenu",[sRe,FUe]=jn(I7,[D_]),Bi=D_(),[zUe,L7]=sRe(I7),$7="ContextMenuTrigger",iRe=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=t,i=L7($7,n),o=Bi(n),a=S.useRef({x:0,y:0}),c=S.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),d=S.useRef(0),f=S.useCallback(()=>window.clearTimeout(d.current),[]),l=u=>{a.current={x:u.clientX,y:u.clientY},i.onOpenChange(!0)};return S.useEffect(()=>f,[f]),S.useEffect(()=>void(r&&f()),[r,f]),x.jsxs(x.Fragment,{children:[x.jsx(g2,{...o,virtualRef:c}),x.jsx(De.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:ye(t.onContextMenu,u=>{f(),l(u),u.preventDefault()}),onPointerDown:r?t.onPointerDown:ye(t.onPointerDown,w1(u=>{f(),d.current=window.setTimeout(()=>l(u),700)})),onPointerMove:r?t.onPointerMove:ye(t.onPointerMove,w1(f)),onPointerCancel:r?t.onPointerCancel:ye(t.onPointerCancel,w1(f)),onPointerUp:r?t.onPointerUp:ye(t.onPointerUp,w1(f))})]})});iRe.displayName=$7;var oRe="ContextMenuPortal",F7=t=>{const{__scopeContextMenu:e,...n}=t,r=Bi(e);return x.jsx(v2,{...r,...n})};F7.displayName=oRe;var z7="ContextMenuContent",B7=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=L7(z7,n),i=Bi(n),o=S.useRef(!1);return x.jsx(y2,{...i,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:a=>{var c;(c=t.onCloseAutoFocus)==null||c.call(t,a),!a.defaultPrevented&&o.current&&a.preventDefault(),o.current=!1},onInteractOutside:a=>{var c;(c=t.onInteractOutside)==null||c.call(t,a),!a.defaultPrevented&&!s.modal&&(o.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});B7.displayName=z7;var aRe="ContextMenuGroup",lRe=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Bi(n);return x.jsx(b2,{...s,...r,ref:e})});lRe.displayName=aRe;var cRe="ContextMenuLabel",U7=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Bi(n);return x.jsx(x2,{...s,...r,ref:e})});U7.displayName=cRe;var uRe="ContextMenuItem",H7=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Bi(n);return x.jsx(w2,{...s,...r,ref:e})});H7.displayName=uRe;var dRe="ContextMenuCheckboxItem",V7=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Bi(n);return x.jsx(_2,{...s,...r,ref:e})});V7.displayName=dRe;var fRe="ContextMenuRadioGroup",hRe=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Bi(n);return x.jsx(S2,{...s,...r,ref:e})});hRe.displayName=fRe;var pRe="ContextMenuRadioItem",q7=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Bi(n);return x.jsx(C2,{...s,...r,ref:e})});q7.displayName=pRe;var mRe="ContextMenuItemIndicator",W7=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Bi(n);return x.jsx(E2,{...s,...r,ref:e})});W7.displayName=mRe;var gRe="ContextMenuSeparator",G7=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Bi(n);return x.jsx(A2,{...s,...r,ref:e})});G7.displayName=gRe;var vRe="ContextMenuArrow",yRe=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Bi(n);return x.jsx(R2,{...s,...r,ref:e})});yRe.displayName=vRe;var bRe="ContextMenuSubTrigger",K7=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Bi(n);return x.jsx(P2,{...s,...r,ref:e})});K7.displayName=bRe;var xRe="ContextMenuSubContent",Y7=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Bi(n);return x.jsx(N2,{...s,...r,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Y7.displayName=xRe;function w1(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var wRe=F7,X7=B7,Q7=U7,Z7=H7,J7=V7,eK=q7,tK=W7,nK=G7,rK=K7,sK=Y7;const _Re=S.forwardRef(({className:t,inset:e,children:n,...r},s)=>x.jsxs(rK,{ref:s,className:ie("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e&&"pl-8",t),...r,children:[n,x.jsx(dy,{className:"ml-auto h-4 w-4"})]}));_Re.displayName=rK.displayName;const SRe=S.forwardRef(({className:t,...e},n)=>x.jsx(sK,{ref:n,className:ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 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",t),...e}));SRe.displayName=sK.displayName;const CRe=S.forwardRef(({className:t,...e},n)=>x.jsx(wRe,{children:x.jsx(X7,{ref:n,className:ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 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",t),...e})}));CRe.displayName=X7.displayName;const ERe=S.forwardRef(({className:t,inset:e,...n},r)=>x.jsx(Z7,{ref:r,className:ie("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...n}));ERe.displayName=Z7.displayName;const ARe=S.forwardRef(({className:t,children:e,checked:n,...r},s)=>x.jsxs(J7,{ref:s,className:ie("relative flex 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),checked:n,...r,children:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(tK,{children:x.jsx(h_,{className:"h-4 w-4"})})}),e]}));ARe.displayName=J7.displayName;const RRe=S.forwardRef(({className:t,children:e,...n},r)=>x.jsxs(eK,{ref:r,className:ie("relative flex 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),...n,children:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(tK,{children:x.jsx(oR,{className:"h-2 w-2 fill-current"})})}),e]}));RRe.displayName=eK.displayName;const PRe=S.forwardRef(({className:t,inset:e,...n},r)=>x.jsx(Q7,{ref:r,className:ie("px-2 py-1.5 text-sm font-semibold text-foreground",e&&"pl-8",t),...n}));PRe.displayName=Q7.displayName;const NRe=S.forwardRef(({className:t,...e},n)=>x.jsx(nK,{ref:n,className:ie("-mx-1 my-1 h-px bg-border",t),...e}));NRe.displayName=nK.displayName;function TRe(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const iK=oe.createContext({drawerRef:{current:null},overlayRef:{current:null},scaleBackground:()=>{},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,handleOnly:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},visible:!1,closeDrawer:()=>{},setVisible:()=>{},direction:"bottom"}),qR=()=>{const t=oe.useContext(iK);if(!t)throw new Error("useDrawerContext must be used within a Drawer.Root");return t};TRe("[vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1)}[vaul-drawer][vaul-drawer-direction=bottom]{transform:translate3d(0,100%,0)}[vaul-drawer][vaul-drawer-direction=top]{transform:translate3d(0,-100%,0)}[vaul-drawer][vaul-drawer-direction=left]{transform:translate3d(-100%,0,0)}[vaul-drawer][vaul-drawer-direction=right]{transform:translate3d(100%,0,0)}.vaul-dragging .vaul-scrollable [vault-drawer-direction=top]{overflow-y:hidden!important}.vaul-dragging .vaul-scrollable [vault-drawer-direction=bottom]{overflow-y:hidden!important}.vaul-dragging .vaul-scrollable [vault-drawer-direction=left]{overflow-x:hidden!important}.vaul-dragging .vaul-scrollable [vault-drawer-direction=right]{overflow-x:hidden!important}[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[vaul-overlay]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[vaul-overlay][vaul-drawer-visible=true]{opacity:1}[vaul-drawer]::after{content:'';position:absolute;background:inherit;background-color:inherit}[vaul-drawer][vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[vaul-drawer][vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[vaul-drawer][vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[vaul-drawer][vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[vaul-handle]{display:block;position:relative;opacity:.8;margin-left:auto;margin-right:auto;height:5px;width:56px;border-radius:1rem;touch-action:pan-y;cursor:grab}[vaul-handle]:active,[vaul-handle]:hover{opacity:1}[vaul-handle]:active{cursor:grabbing}[vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}[vaul-overlay][vaul-snap-points=true]:not([vaul-snap-points-overlay=true]):not([data-state=closed]){opacity:0}[vaul-overlay][vaul-snap-points-overlay=true]:not([vaul-drawer-visible=false]){opacity:1}@media (hover:hover) and (pointer:fine){[vaul-drawer]{user-select:none}}@media (pointer:fine){[vaul-handle-hitarea]:{width:100%;height:100%}}");const kRe=typeof window<"u"?S.useLayoutEffect:S.useEffect;function GM(...t){return(...e)=>{for(let n of t)typeof n=="function"&&n(...e)}}function DRe(){return T2(/^Mac/)}function MRe(){return T2(/^iPhone/)}function ORe(){return T2(/^iPad/)||DRe()&&navigator.maxTouchPoints>1}function oK(){return MRe()||ORe()}function T2(t){return typeof window<"u"&&window.navigator!=null?t.test(window.navigator.platform):void 0}const gk=typeof document<"u"&&window.visualViewport;function R5(t){let e=window.getComputedStyle(t);return/(auto|scroll)/.test(e.overflow+e.overflowX+e.overflowY)}function aK(t){for(R5(t)&&(t=t.parentElement);t&&!R5(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}const jRe=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let _1=0,vk;function IRe(t={}){let{isDisabled:e}=t;kRe(()=>{if(!e)return _1++,_1===1&&(oK()?vk=$Re():vk=LRe()),()=>{_1--,_1===0&&vk()}},[e])}function LRe(){return GM(lK(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`))}function $Re(){let t,e=0,n=l=>{t=aK(l.target),!(t===document.documentElement&&t===document.body)&&(e=l.changedTouches[0].pageY)},r=l=>{if(!t||t===document.documentElement||t===document.body){l.preventDefault();return}let u=l.changedTouches[0].pageY,p=t.scrollTop,h=t.scrollHeight-t.clientHeight;h!==0&&((p<=0&&u>e||p>=h&&u{let u=l.target;KM(u)&&u!==document.activeElement&&(l.preventDefault(),u.style.transform="translateY(-2000px)",u.focus(),requestAnimationFrame(()=>{u.style.transform=""}))},i=l=>{let u=l.target;KM(u)&&(u.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{u.style.transform="",gk&&(gk.height{P5(u)}):gk.addEventListener("resize",()=>P5(u),{once:!0}))}))},o=()=>{window.scrollTo(0,0)},a=window.pageXOffset,c=window.pageYOffset,d=GM(lK(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let f=GM(Eb(document,"touchstart",n,{passive:!1,capture:!0}),Eb(document,"touchmove",r,{passive:!1,capture:!0}),Eb(document,"touchend",s,{passive:!1,capture:!0}),Eb(document,"focus",i,!0),Eb(window,"scroll",o));return()=>{d(),f(),window.scrollTo(a,c)}}function lK(t,e,n){let r=t.style[e];return t.style[e]=n,()=>{t.style[e]=r}}function Eb(t,e,n,r){return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}}function P5(t){let e=document.scrollingElement||document.documentElement;for(;t&&t!==e;){let n=aK(t);if(n!==document.documentElement&&n!==document.body&&n!==t){let r=n.getBoundingClientRect().top,s=t.getBoundingClientRect().top,i=t.getBoundingClientRect().bottom;const o=n.getBoundingClientRect().bottom;i>o&&(n.scrollTop+=s-r)}t=n.parentElement}}function KM(t){return t instanceof HTMLInputElement&&!jRe.has(t.type)||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable}function FRe(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function zRe(...t){return e=>t.forEach(n=>FRe(n,e))}function cK(...t){return S.useCallback(zRe(...t),t)}let Ab=null;function BRe({isOpen:t,modal:e,nested:n,hasBeenOpened:r,preventScrollRestoration:s,noBodyStyles:i}){const[o,a]=oe.useState(()=>typeof window<"u"?window.location.href:""),c=oe.useRef(0),d=oe.useCallback(()=>{if(Ab===null&&t&&!i){Ab={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:l,innerHeight:u}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-c.current}px`,left:`${-l}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const p=u-window.innerHeight;p&&c.current>=u&&(document.body.style.top=`${-(c.current+p)}px`)}),300)}},[t]),f=oe.useCallback(()=>{if(Ab!==null&&!i){const l=-parseInt(document.body.style.top,10),u=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Ab),window.requestAnimationFrame(()=>{if(s&&o!==window.location.href){a(window.location.href);return}window.scrollTo(u,l)}),Ab=null}},[o]);return oe.useEffect(()=>{function l(){c.current=window.scrollY}return l(),window.addEventListener("scroll",l),()=>{window.removeEventListener("scroll",l)}},[]),oe.useEffect(()=>{n||!r||(t?(!window.matchMedia("(display-mode: standalone)").matches&&d(),e||window.setTimeout(()=>{f()},500)):f())},[t,r,o,e,n,d,f]),{restorePositionSetting:f}}const uK=new WeakMap;function Wn(t,e,n=!1){if(!t||!(t instanceof HTMLElement))return;let r={};Object.entries(e).forEach(([s,i])=>{if(s.startsWith("--")){t.style.setProperty(s,i);return}r[s]=t.style[s],t.style[s]=i}),!n&&uK.set(t,r)}function S1(t,e){if(!t||!(t instanceof HTMLElement))return;let n=uK.get(t);n&&(e?t.style[e]=n[e]:Object.entries(n).forEach(([r,s])=>{t.style[r]=s}))}const Rr=t=>{switch(t){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return t}};function C1(t,e){if(!t)return null;const n=window.getComputedStyle(t),r=n.transform||n.webkitTransform||n.mozTransform;let s=r.match(/^matrix3d\((.+)\)$/);return s?parseFloat(s[1].split(", ")[Rr(e)?13:12]):(s=r.match(/^matrix\((.+)\)$/),s?parseFloat(s[1].split(", ")[Rr(e)?5:4]):null)}function URe(t){return 8*(Math.log(t+1)-2)}const Dn={DURATION:.5,EASE:[.32,.72,0,1]},dK=.4;function fK(t){const e=oe.useRef(t);return oe.useEffect(()=>{e.current=t}),oe.useMemo(()=>(...n)=>e.current==null?void 0:e.current.call(e,...n),[])}function HRe({defaultProp:t,onChange:e}){const n=oe.useState(t),[r]=n,s=oe.useRef(r),i=fK(e);return oe.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}function VRe({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,s]=HRe({defaultProp:e,onChange:n}),i=t!==void 0,o=i?t:r,a=fK(n),c=oe.useCallback(d=>{if(i){const l=typeof d=="function"?d(t):d;l!==t&&a(l)}else s(d)},[i,t,s,a]);return[o,c]}function qRe({activeSnapPointProp:t,setActiveSnapPointProp:e,snapPoints:n,drawerRef:r,overlayRef:s,fadeFromIndex:i,onSnapPointChange:o,direction:a="bottom"}){const[c,d]=VRe({prop:t,defaultProp:n==null?void 0:n[0],onChange:e}),f=oe.useMemo(()=>c===(n==null?void 0:n[n.length-1])||null,[n,c]),l=n&&n.length>0&&(i||i===0)&&!Number.isNaN(i)&&n[i]===c||!n,u=oe.useMemo(()=>n==null?void 0:n.findIndex(b=>b===c),[n,c]),p=oe.useMemo(()=>{var b;return(b=n==null?void 0:n.map(_=>{const A=typeof window<"u",P=typeof _=="string";let T=0;if(P&&(T=parseInt(_,10)),Rr(a)){const N=P?T:A?_*window.innerHeight:0;return A?a==="bottom"?window.innerHeight-N:-window.innerHeight+N:N}const E=P?T:A?_*window.innerWidth:0;return A?a==="right"?window.innerWidth-E:-window.innerWidth+E:E}))!=null?b:[]},[n]),h=oe.useMemo(()=>u!==null?p==null?void 0:p[u]:null,[p,u]),m=oe.useCallback(b=>{var _;const A=(_=p==null?void 0:p.findIndex(P=>P===b))!=null?_:null;o(A),Wn(r.current,{transition:`transform ${Dn.DURATION}s cubic-bezier(${Dn.EASE.join(",")})`,transform:Rr(a)?`translate3d(0, ${b}px, 0)`:`translate3d(${b}px, 0, 0)`}),p&&A!==p.length-1&&A!==i?Wn(s.current,{transition:`opacity ${Dn.DURATION}s cubic-bezier(${Dn.EASE.join(",")})`,opacity:"0"}):Wn(s.current,{transition:`opacity ${Dn.DURATION}s cubic-bezier(${Dn.EASE.join(",")})`,opacity:"1"}),d(A!==null?n==null?void 0:n[A]:null)},[r.current,n,p,i,s,d]);oe.useEffect(()=>{if(c||t){var b;const _=(b=n==null?void 0:n.findIndex(A=>A===t||A===c))!=null?b:-1;p&&_!==-1&&typeof p[_]=="number"&&m(p[_])}},[c,t,n,p,m]);function y({draggedDistance:b,closeDrawer:_,velocity:A,dismissible:P}){if(i===void 0)return;const T=a==="bottom"||a==="right"?(h??0)-b:(h??0)+b,E=u===i-1,N=u===0,k=b>0;if(E&&Wn(s.current,{transition:`opacity ${Dn.DURATION}s cubic-bezier(${Dn.EASE.join(",")})`}),A>2&&!k){P?_():m(p[0]);return}if(A>2&&k&&p&&n){m(p[n.length-1]);return}const M=p==null?void 0:p.reduce((I,L)=>typeof I!="number"||typeof L!="number"?I:Math.abs(L-T)dK&&Math.abs(b)0&&f){m(p[n.length-1]);return}if(N&&I<0&&P&&_(),u===null)return;m(p[u+I]);return}m(M)}function g({draggedDistance:b}){if(h===null)return;const _=a==="bottom"||a==="right"?h-b:h+b;(a==="bottom"||a==="right")&&_p[p.length-1]||Wn(r.current,{transform:Rr(a)?`translate3d(0, ${_}px, 0)`:`translate3d(${_}px, 0, 0)`})}function v(b,_){if(!n||typeof u!="number"||!p||i===void 0)return null;const A=u===i-1;if(u>=i&&_)return 0;if(A&&!_)return 1;if(!l&&!A)return null;const T=A?u+1:u-1,E=A?p[T]-p[T-1]:p[T+1]-p[T],N=b/Math.abs(E);return A?1-N:N}return{isLastSnapPoint:f,activeSnapPoint:c,shouldFade:l,getPercentageDragged:v,setActiveSnapPoint:d,activeSnapPointIndex:u,onRelease:y,onDrag:g,snapPointsOffset:p}}const WRe=.25,GRe=100,N5=8,zf=16,T5=26,yk="vaul-dragging";function hK({open:t,onOpenChange:e,children:n,shouldScaleBackground:r,onDrag:s,onRelease:i,snapPoints:o,nested:a=!1,setBackgroundColorOnScale:c=!0,closeThreshold:d=WRe,scrollLockTimeout:f=GRe,dismissible:l=!0,handleOnly:u=!1,fadeFromIndex:p=o&&o.length-1,activeSnapPoint:h,setActiveSnapPoint:m,fixed:y,modal:g=!0,onClose:v,noBodyStyles:b,direction:_="bottom",preventScrollRestoration:A=!0,disablePreventScroll:P=!1}){var T;const[E=!1,N]=oe.useState(!1),[k,M]=oe.useState(!1),[j,I]=oe.useState(!1),[L,H]=oe.useState(!1),[K,V]=oe.useState(!1),[U,Q]=oe.useState(!1),te=oe.useRef(null),X=oe.useRef(null),G=oe.useRef(null),Y=oe.useRef(null),Z=oe.useRef(null),he=oe.useRef(!1),fe=oe.useRef(null),ce=oe.useRef(0),xe=oe.useRef(!1),Pe=oe.useRef(0),pe=oe.useRef(null),Le=oe.useRef(((T=pe.current)==null?void 0:T.getBoundingClientRect().height)||0),Me=oe.useRef(0),Oe=oe.useCallback($e=>{o&&$e===ee.length-1&&(X.current=new Date)},[]),{activeSnapPoint:Fe,activeSnapPointIndex:ot,setActiveSnapPoint:nt,onRelease:At,snapPointsOffset:ee,onDrag:de,shouldFade:me,getPercentageDragged:Re}=qRe({snapPoints:o,activeSnapPointProp:h,setActiveSnapPointProp:m,drawerRef:pe,fadeFromIndex:p,overlayRef:te,onSnapPointChange:Oe,direction:_});IRe({isDisabled:!E||K||!g||U||!k||P});const{restorePositionSetting:Ne}=BRe({isOpen:E,modal:g,nested:a,hasBeenOpened:k,preventScrollRestoration:A,noBodyStyles:b});function Ee(){return(window.innerWidth-T5)/window.innerWidth}function Ve($e){var Ye;!l&&!o||pe.current&&!pe.current.contains($e.target)||(Le.current=((Ye=pe.current)==null?void 0:Ye.getBoundingClientRect().height)||0,V(!0),G.current=new Date,oK()&&window.addEventListener("touchend",()=>he.current=!1,{once:!0}),$e.target.setPointerCapture($e.pointerId),ce.current=Rr(_)?$e.clientY:$e.clientX)}function tt($e,Ye){var ht;let Ze=$e;const yt=(ht=window.getSelection())==null?void 0:ht.toString(),Nt=pe.current?C1(pe.current,_):null,St=new Date;if(Ze.hasAttribute("data-vaul-no-drag")||Ze.closest("[data-vaul-no-drag]"))return!1;if(_==="right"||_==="left")return!0;if(X.current&&St.getTime()-X.current.getTime()<500)return!1;if(Nt!==null&&(_==="bottom"?Nt>0:Nt<0))return!0;if(yt&&yt.length>0)return!1;if(Z.current&&St.getTime()-Z.current.getTime()Ze.clientHeight){if(Ze.scrollTop!==0)return Z.current=new Date,!1;if(Ze.getAttribute("role")==="dialog")return!0}Ze=Ze.parentNode}return!0}function qt($e){if(pe.current&&K){const Ye=_==="bottom"||_==="right"?1:-1,ht=(ce.current-(Rr(_)?$e.clientY:$e.clientX))*Ye,Ze=ht>0,yt=o&&!l&&!Ze;if(yt&&ot===0)return;const Nt=Math.abs(ht),St=document.querySelector("[vaul-drawer-wrapper]");let Wt=Nt/Le.current;const Zt=Re(Nt,Ze);if(Zt!==null&&(Wt=Zt),yt&&Wt>=1||!he.current&&!tt($e.target,Ze))return;if(pe.current.classList.add(yk),he.current=!0,Wn(pe.current,{transition:"none"}),Wn(te.current,{transition:"none"}),o&&de({draggedDistance:ht}),Ze&&!o){const Nn=URe(ht),Cr=Math.min(Nn*-1,0)*Ye;Wn(pe.current,{transform:Rr(_)?`translate3d(0, ${Cr}px, 0)`:`translate3d(${Cr}px, 0, 0)`});return}const ar=1-Wt;if((me||p&&ot===p-1)&&(s==null||s($e,Wt),Wn(te.current,{opacity:`${ar}`,transition:"none"},!0)),St&&te.current&&r){const Nn=Math.min(Ee()+Wt*(1-Ee()),1),Cr=8-Wt*8,Dr=Math.max(0,14-Wt*14);Wn(St,{borderRadius:`${Cr}px`,transform:Rr(_)?`scale(${Nn}) translate3d(0, ${Dr}px, 0)`:`scale(${Nn}) translate3d(${Dr}px, 0, 0)`,transition:"none"},!0)}if(!o){const Nn=Nt*Ye;Wn(pe.current,{transform:Rr(_)?`translate3d(0, ${Nn}px, 0)`:`translate3d(${Nn}px, 0, 0)`})}}}oe.useEffect(()=>()=>{_n(!1),Ne()},[]),oe.useEffect(()=>{var $e;function Ye(){if(!pe.current)return;const ht=document.activeElement;if(KM(ht)||xe.current){var Ze;const yt=((Ze=window.visualViewport)==null?void 0:Ze.height)||0;let Nt=window.innerHeight-yt;const St=pe.current.getBoundingClientRect().height||0;Me.current||(Me.current=St);const Wt=pe.current.getBoundingClientRect().top;if(Math.abs(Pe.current-Nt)>60&&(xe.current=!xe.current),o&&o.length>0&&ee&&ot){const Zt=ee[ot]||0;Nt+=Zt}if(Pe.current=Nt,St>yt||xe.current){const Zt=pe.current.getBoundingClientRect().height;let ar=Zt;Zt>yt&&(ar=yt-T5),y?pe.current.style.height=`${Zt-Math.max(Nt,0)}px`:pe.current.style.height=`${Math.max(ar,yt-Wt)}px`}else pe.current.style.height=`${Me.current}px`;o&&o.length>0&&!xe.current?pe.current.style.bottom="0px":pe.current.style.bottom=`${Math.max(Nt,0)}px`}}return($e=window.visualViewport)==null||$e.addEventListener("resize",Ye),()=>{var ht;return(ht=window.visualViewport)==null?void 0:ht.removeEventListener("resize",Ye)}},[ot,o,ee]);function gt(){pe.current&&(an(),v==null||v(),Wn(pe.current,{transform:Rr(_)?`translate3d(0, ${_==="bottom"?"100%":"-100%"}, 0)`:`translate3d(${_==="right"?"100%":"-100%"}, 0, 0)`,transition:`transform ${Dn.DURATION}s cubic-bezier(${Dn.EASE.join(",")})`}),Wn(te.current,{opacity:"0",transition:`opacity ${Dn.DURATION}s cubic-bezier(${Dn.EASE.join(",")})`}),_n(!1),setTimeout(()=>{I(!1),N(!1)},300),setTimeout(()=>{o&&nt(o[0])},Dn.DURATION*1e3))}oe.useEffect(()=>{if(!E&&r){const $e=setTimeout(()=>{S1(document.body)},200);return()=>clearTimeout($e)}},[E,r]),oe.useLayoutEffect(()=>{t?(N(!0),M(!0)):gt()},[t]),oe.useEffect(()=>{L&&(e==null||e(E))},[E]),oe.useEffect(()=>{H(!0)},[]);function kt(){if(!pe.current)return;const $e=document.querySelector("[vaul-drawer-wrapper]"),Ye=C1(pe.current,_);Wn(pe.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${Dn.DURATION}s cubic-bezier(${Dn.EASE.join(",")})`}),Wn(te.current,{transition:`opacity ${Dn.DURATION}s cubic-bezier(${Dn.EASE.join(",")})`,opacity:"1"}),r&&Ye&&Ye>0&&E&&Wn($e,{borderRadius:`${N5}px`,overflow:"hidden",...Rr(_)?{transform:`scale(${Ee()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${Ee()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${Dn.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Dn.EASE.join(",")})`},!0)}function an(){!K||!pe.current||(pe.current.classList.remove(yk),he.current=!1,V(!1),Y.current=new Date)}function gr($e){if(!K||!pe.current)return;pe.current.classList.remove(yk),he.current=!1,V(!1),Y.current=new Date;const Ye=C1(pe.current,_);if(!tt($e.target,!1)||!Ye||Number.isNaN(Ye)||G.current===null)return;const ht=Y.current.getTime()-G.current.getTime(),Ze=ce.current-(Rr(_)?$e.clientY:$e.clientX),yt=Math.abs(Ze)/ht;if(yt>.05&&(Q(!0),setTimeout(()=>{Q(!1)},200)),o){At({draggedDistance:Ze*(_==="bottom"||_==="right"?1:-1),closeDrawer:gt,velocity:yt,dismissible:l}),i==null||i($e,!0);return}if(_==="bottom"||_==="right"?Ze>0:Ze<0){kt(),i==null||i($e,!0);return}if(yt>dK){gt(),i==null||i($e,!1);return}var Nt;const St=Math.min((Nt=pe.current.getBoundingClientRect().height)!=null?Nt:0,window.innerHeight);if(Ye>=St*d){gt(),i==null||i($e,!1);return}i==null||i($e,!0),kt()}oe.useEffect(()=>{E&&(Wn(document.documentElement,{scrollBehavior:"auto"}),X.current=new Date,_n(!0))},[E]),oe.useEffect(()=>{if(pe.current&&j){var $e;const Ye=pe==null||($e=pe.current)==null?void 0:$e.querySelectorAll("*");Ye==null||Ye.forEach(ht=>{const Ze=ht;(Ze.scrollHeight>Ze.clientHeight||Ze.scrollWidth>Ze.clientWidth)&&Ze.classList.add("vaul-scrollable")})}},[j]);function _n($e){const Ye=document.querySelector("[vaul-drawer-wrapper]");!Ye||!r||($e?(c&&(b||(Wn(document.body,{background:document.body.style.backgroundColor||document.body.style.background}),Wn(document.body,{background:"black"},!0))),Wn(Ye,{borderRadius:`${N5}px`,overflow:"hidden",...Rr(_)?{transform:`scale(${Ee()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${Ee()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${Dn.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Dn.EASE.join(",")})`})):(S1(Ye,"overflow"),S1(Ye,"transform"),S1(Ye,"borderRadius"),Wn(Ye,{transitionProperty:"transform, border-radius",transitionDuration:`${Dn.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Dn.EASE.join(",")})`})))}function di($e){const Ye=$e?(window.innerWidth-zf)/window.innerWidth:1,ht=$e?-zf:0;fe.current&&window.clearTimeout(fe.current),Wn(pe.current,{transition:`transform ${Dn.DURATION}s cubic-bezier(${Dn.EASE.join(",")})`,transform:`scale(${Ye}) translate3d(0, ${ht}px, 0)`}),!$e&&pe.current&&(fe.current=setTimeout(()=>{const Ze=C1(pe.current,_);Wn(pe.current,{transition:"none",transform:Rr(_)?`translate3d(0, ${Ze}px, 0)`:`translate3d(${Ze}px, 0, 0)`})},500))}function or($e,Ye){if(Ye<0)return;const ht=Rr(_)?window.innerHeight:window.innerWidth,Ze=(ht-zf)/ht,yt=Ze+Ye*(1-Ze),Nt=-zf+Ye*zf;Wn(pe.current,{transform:Rr(_)?`scale(${yt}) translate3d(0, ${Nt}px, 0)`:`scale(${yt}) translate3d(${Nt}px, 0, 0)`,transition:"none"})}function fi($e,Ye){const ht=Rr(_)?window.innerHeight:window.innerWidth,Ze=Ye?(ht-zf)/ht:1,yt=Ye?-zf:0;Ye&&Wn(pe.current,{transition:`transform ${Dn.DURATION}s cubic-bezier(${Dn.EASE.join(",")})`,transform:Rr(_)?`scale(${Ze}) translate3d(0, ${yt}px, 0)`:`scale(${Ze}) translate3d(${yt}px, 0, 0)`})}return oe.createElement(uR,{modal:g,onOpenChange:$e=>{if(t!==void 0){e==null||e($e);return}$e?(M(!0),N($e)):gt()},open:E},oe.createElement(iK.Provider,{value:{visible:j,activeSnapPoint:Fe,snapPoints:o,setActiveSnapPoint:nt,drawerRef:pe,overlayRef:te,scaleBackground:_n,onOpenChange:e,onPress:Ve,setVisible:I,onRelease:gr,onDrag:qt,dismissible:l,handleOnly:u,isOpen:E,isDragging:K,shouldFade:me,closeDrawer:gt,onNestedDrag:or,onNestedOpenChange:di,onNestedRelease:fi,keyboardIsOpen:xe,openProp:t,modal:g,snapPointsOffset:ee,direction:_}},n))}const KRe=250,YRe=120,pK=oe.forwardRef(function({preventCycle:t=!1,children:e,...n},r){const{visible:s,closeDrawer:i,isDragging:o,snapPoints:a,activeSnapPoint:c,setActiveSnapPoint:d,dismissible:f,handleOnly:l,onPress:u,onDrag:p}=qR(),h=oe.useRef(null),m=oe.useRef(!1);function y(){if(m.current){b();return}window.setTimeout(()=>{g()},YRe)}function g(){if(o||t||m.current){b();return}if(b(),(!a||a.length===0)&&f){i();return}if(c===a[a.length-1]&&f){i();return}const A=a.findIndex(T=>T===c);if(A===-1)return;const P=a[A+1];d(P)}function v(){h.current=window.setTimeout(()=>{m.current=!0},KRe)}function b(){window.clearTimeout(h.current),m.current=!1}return oe.createElement("div",{onClick:y,onDoubleClick:()=>{m.current=!0,i()},onPointerCancel:b,onPointerDown:_=>{l&&u(_),v()},onPointerMove:_=>{l&&p(_)},ref:r,"vaul-drawer-visible":s?"true":"false","vaul-handle":"","aria-hidden":"true",...n},oe.createElement("span",{"vaul-handle-hitarea":"","aria-hidden":"true"},e))});pK.displayName="Drawer.Handle";const mK=oe.forwardRef(function({children:t,...e},n){const{overlayRef:r,snapPoints:s,onRelease:i,shouldFade:o,isOpen:a,visible:c}=qR(),d=cK(n,r),f=s&&s.length>0;return oe.createElement(my,{onMouseUp:i,ref:d,"vaul-drawer-visible":c?"true":"false","vaul-overlay":"","vaul-snap-points":a&&f?"true":"false","vaul-snap-points-overlay":a&&o?"true":"false",...e})});mK.displayName="Drawer.Overlay";const gK=oe.forwardRef(function({onOpenAutoFocus:t,onPointerDownOutside:e,onAnimationEnd:n,style:r,...s},i){const{drawerRef:o,onPress:a,onRelease:c,onDrag:d,dismissible:f,keyboardIsOpen:l,snapPointsOffset:u,visible:p,closeDrawer:h,modal:m,openProp:y,onOpenChange:g,setVisible:v,handleOnly:b,direction:_}=qR(),A=cK(i,o),P=oe.useRef(null),T=oe.useRef(!1),E=(N,k,M=0)=>{if(T.current)return!0;const j=Math.abs(N.y),I=Math.abs(N.x),L=I>j,H=["bottom","right"].includes(k)?1:-1;if(k==="left"||k==="right"){if(!(N.x*H<0)&&I>=0&&I<=M)return L}else if(!(N.y*H<0)&&j>=0&&j<=M)return!L;return T.current=!0,!0};return oe.useEffect(()=>{v(!0)},[]),oe.createElement(gy,{"vaul-drawer":"","vaul-drawer-direction":_,"vaul-drawer-visible":p?"true":"false",...s,ref:A,style:u&&u.length>0?{"--snap-point-height":`${u[0]}px`,...r}:r,onOpenAutoFocus:N=>{if(t)t(N);else{var k;N.preventDefault(),(k=o.current)==null||k.focus()}},onPointerDown:N=>{b||(s.onPointerDown==null||s.onPointerDown.call(s,N),P.current={x:N.clientX,y:N.clientY},a(N))},onPointerDownOutside:N=>{if(e==null||e(N),!m||N.defaultPrevented){N.preventDefault();return}l.current&&(l.current=!1),N.preventDefault(),g==null||g(!1),!(!f||y!==void 0)&&h()},onFocusOutside:N=>{if(!m){N.preventDefault();return}},onEscapeKeyDown:N=>{if(!m){N.preventDefault();return}},onPointerMove:N=>{if(b||(s.onPointerMove==null||s.onPointerMove.call(s,N),!P.current))return;const k=N.clientY-P.current.y,M=N.clientX-P.current.x,j=N.pointerType==="touch"?10:2;E({x:M,y:k},_,j)?d(N):(Math.abs(M)>j||Math.abs(k)>j)&&(P.current=null)},onPointerUp:N=>{s.onPointerUp==null||s.onPointerUp.call(s,N),P.current=null,T.current=!1,c(N)}})});gK.displayName="Drawer.Content";function XRe({onDrag:t,onOpenChange:e,...n}){const{onNestedDrag:r,onNestedOpenChange:s,onNestedRelease:i}=qR();if(!r)throw new Error("Drawer.NestedRoot must be placed in another drawer");return oe.createElement(hK,{nested:!0,onClose:()=>{s(!1)},onDrag:(o,a)=>{r(o,a),t==null||t(o,a)},onOpenChange:o=>{o&&s(o),e==null||e(o)},onRelease:i,...n})}const nc={Root:hK,NestedRoot:XRe,Content:gK,Handle:pK,Overlay:mK,Trigger:dR,Portal:fR,Close:by,Title:vy,Description:yy},vK=({shouldScaleBackground:t=!0,...e})=>x.jsx(nc.Root,{shouldScaleBackground:t,...e});vK.displayName="Drawer";const QRe=nc.Portal,ZRe=nc.Close,yK=S.forwardRef(({className:t,...e},n)=>x.jsx(nc.Overlay,{ref:n,className:ie("fixed inset-0 z-50 bg-black/80",t),...e}));yK.displayName=nc.Overlay.displayName;const bK=S.forwardRef(({className:t,children:e,...n},r)=>x.jsxs(QRe,{children:[x.jsx(yK,{}),x.jsxs(nc.Content,{ref:r,className:ie("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",t),...n,children:[x.jsx("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),e]})]}));bK.displayName="DrawerContent";const xK=({className:t,...e})=>x.jsx("div",{className:ie("grid gap-1.5 p-4 text-center sm:text-left",t),...e});xK.displayName="DrawerHeader";const wK=({className:t,...e})=>x.jsx("div",{className:ie("mt-auto flex flex-col gap-2 p-4",t),...e});wK.displayName="DrawerFooter";const _K=S.forwardRef(({className:t,...e},n)=>x.jsx(nc.Title,{ref:n,className:ie("text-lg font-semibold leading-none tracking-tight",t),...e}));_K.displayName=nc.Title.displayName;const SK=S.forwardRef(({className:t,...e},n)=>x.jsx(nc.Description,{ref:n,className:ie("text-sm text-muted-foreground",t),...e}));SK.displayName=nc.Description.displayName;var k2="DropdownMenu",[JRe,BUe]=jn(k2,[D_]),ci=D_(),[ePe,CK]=JRe(k2),EK=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:o,modal:a=!0}=t,c=ci(e),d=S.useRef(null),[f=!1,l]=mr({prop:s,defaultProp:i,onChange:o});return x.jsx(ePe,{scope:e,triggerId:Ls(),triggerRef:d,contentId:Ls(),open:f,onOpenChange:l,onOpenToggle:S.useCallback(()=>l(u=>!u),[l]),modal:a,children:x.jsx(rRe,{...c,open:f,onOpenChange:l,dir:r,modal:a,children:n})})};EK.displayName=k2;var AK="DropdownMenuTrigger",RK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=t,i=CK(AK,n),o=ci(n);return x.jsx(g2,{asChild:!0,...o,children:x.jsx(De.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:f_(e,i.triggerRef),onPointerDown:ye(t.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:ye(t.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});RK.displayName=AK;var tPe="DropdownMenuPortal",PK=t=>{const{__scopeDropdownMenu:e,...n}=t,r=ci(e);return x.jsx(v2,{...r,...n})};PK.displayName=tPe;var NK="DropdownMenuContent",TK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=CK(NK,n),i=ci(n),o=S.useRef(!1);return x.jsx(y2,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:e,onCloseAutoFocus:ye(t.onCloseAutoFocus,a=>{var c;o.current||(c=s.triggerRef.current)==null||c.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:ye(t.onInteractOutside,a=>{const c=a.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,f=c.button===2||d;(!s.modal||f)&&(o.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});TK.displayName=NK;var nPe="DropdownMenuGroup",kK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=ci(n);return x.jsx(b2,{...s,...r,ref:e})});kK.displayName=nPe;var rPe="DropdownMenuLabel",DK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=ci(n);return x.jsx(x2,{...s,...r,ref:e})});DK.displayName=rPe;var sPe="DropdownMenuItem",MK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=ci(n);return x.jsx(w2,{...s,...r,ref:e})});MK.displayName=sPe;var iPe="DropdownMenuCheckboxItem",OK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=ci(n);return x.jsx(_2,{...s,...r,ref:e})});OK.displayName=iPe;var oPe="DropdownMenuRadioGroup",aPe=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=ci(n);return x.jsx(S2,{...s,...r,ref:e})});aPe.displayName=oPe;var lPe="DropdownMenuRadioItem",jK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=ci(n);return x.jsx(C2,{...s,...r,ref:e})});jK.displayName=lPe;var cPe="DropdownMenuItemIndicator",IK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=ci(n);return x.jsx(E2,{...s,...r,ref:e})});IK.displayName=cPe;var uPe="DropdownMenuSeparator",LK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=ci(n);return x.jsx(A2,{...s,...r,ref:e})});LK.displayName=uPe;var dPe="DropdownMenuArrow",fPe=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=ci(n);return x.jsx(R2,{...s,...r,ref:e})});fPe.displayName=dPe;var hPe="DropdownMenuSubTrigger",$K=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=ci(n);return x.jsx(P2,{...s,...r,ref:e})});$K.displayName=hPe;var pPe="DropdownMenuSubContent",FK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=ci(n);return x.jsx(N2,{...s,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});FK.displayName=pPe;var mPe=EK,gPe=RK,vPe=PK,zK=TK,yPe=kK,BK=DK,UK=MK,HK=OK,VK=jK,qK=IK,WK=LK,GK=$K,KK=FK;const O_=mPe,j_=gPe,bPe=yPe,xPe=S.forwardRef(({className:t,inset:e,children:n,...r},s)=>x.jsxs(GK,{ref:s,className:ie("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",e&&"pl-8",t),...r,children:[n,x.jsx(dy,{className:"w-4 h-4 ml-auto"})]}));xPe.displayName=GK.displayName;const wPe=S.forwardRef(({className:t,...e},n)=>x.jsx(KK,{ref:n,className:ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",t),...e}));wPe.displayName=KK.displayName;const ky=S.forwardRef(({className:t,sideOffset:e=4,...n},r)=>x.jsx(vPe,{children:x.jsx(zK,{ref:r,sideOffset:e,className:ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 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",t),...n})}));ky.displayName=zK.displayName;const tf=S.forwardRef(({className:t,inset:e,...n},r)=>x.jsx(UK,{ref:r,className:ie("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...n}));tf.displayName=UK.displayName;const YK=S.forwardRef(({className:t,children:e,checked:n,...r},s)=>x.jsxs(HK,{ref:s,className:ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:n,...r,children:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(qK,{children:x.jsx(h_,{className:"w-4 h-4"})})}),e]}));YK.displayName=HK.displayName;const _Pe=S.forwardRef(({className:t,children:e,...n},r)=>x.jsxs(VK,{ref:r,className:ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(qK,{children:x.jsx(oR,{className:"w-2 h-2 fill-current"})})}),e]}));_Pe.displayName=VK.displayName;const WR=S.forwardRef(({className:t,inset:e,...n},r)=>x.jsx(BK,{ref:r,className:ie("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));WR.displayName=BK.displayName;const qv=S.forwardRef(({className:t,...e},n)=>x.jsx(WK,{ref:n,className:ie("-mx-1 my-1 h-px bg-muted",t),...e}));qv.displayName=WK.displayName;const XK=({className:t,...e})=>x.jsx("span",{className:ie("ml-auto text-xs tracking-widest opacity-60",t),...e});XK.displayName="DropdownMenuShortcut";var I_=t=>t.type==="checkbox",Zm=t=>t instanceof Date,Js=t=>t==null;const QK=t=>typeof t=="object";var Kr=t=>!Js(t)&&!Array.isArray(t)&&QK(t)&&!Zm(t),ZK=t=>Kr(t)&&t.target?I_(t.target)?t.target.checked:t.target.value:t,SPe=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,JK=(t,e)=>t.has(SPe(e)),CPe=t=>{const e=t.constructor&&t.constructor.prototype;return Kr(e)&&e.hasOwnProperty("isPrototypeOf")},D2=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Br(t){let e;const n=Array.isArray(t);if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else if(!(D2&&(t instanceof Blob||t instanceof FileList))&&(n||Kr(t)))if(e=n?[]:{},!n&&!CPe(t))e=t;else for(const r in t)t.hasOwnProperty(r)&&(e[r]=Br(t[r]));else return t;return e}var L_=t=>Array.isArray(t)?t.filter(Boolean):[],Fn=t=>t===void 0,je=(t,e,n)=>{if(!e||!Kr(t))return n;const r=L_(e.split(/[,[\].]+?/)).reduce((s,i)=>Js(s)?s:s[i],t);return Fn(r)||r===t?Fn(t[e])?n:t[e]:r},Ol=t=>typeof t=="boolean",M2=t=>/^\w*$/.test(t),e9=t=>L_(t.replace(/["|']|\]/g,"").split(/\.|\[/)),sn=(t,e,n)=>{let r=-1;const s=M2(e)?[e]:e9(e),i=s.length,o=i-1;for(;++roe.useContext(t9),EPe=t=>{const{children:e,...n}=t;return oe.createElement(t9.Provider,{value:n},e)};var n9=(t,e,n,r=!0)=>{const s={defaultValues:e._defaultValues};for(const i in t)Object.defineProperty(s,i,{get:()=>{const o=i;return e._proxyFormState[o]!==Zo.all&&(e._proxyFormState[o]=!r||Zo.all),n&&(n[o]=!0),t[o]}});return s},Xs=t=>Kr(t)&&!Object.keys(t).length,r9=(t,e,n,r)=>{n(t);const{name:s,...i}=t;return Xs(i)||Object.keys(i).length>=Object.keys(e).length||Object.keys(i).find(o=>e[o]===(!r||Zo.all))},ki=t=>Array.isArray(t)?t:[t],s9=(t,e,n)=>!t||!e||t===e||ki(t).some(r=>r&&(n?r===e:r.startsWith(e)||e.startsWith(r)));function GR(t){const e=oe.useRef(t);e.current=t,oe.useEffect(()=>{const n=!t.disabled&&e.current.subject&&e.current.subject.subscribe({next:e.current.next});return()=>{n&&n.unsubscribe()}},[t.disabled])}function i9(t){const e=Ui(),{control:n=e.control,disabled:r,name:s,exact:i}=t||{},[o,a]=oe.useState(n._formState),c=oe.useRef(!0),d=oe.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),f=oe.useRef(s);return f.current=s,GR({disabled:r,next:l=>c.current&&s9(f.current,l.name,i)&&r9(l,d.current,n._updateFormState)&&a({...n._formState,...l}),subject:n._subjects.state}),oe.useEffect(()=>(c.current=!0,d.current.isValid&&n._updateValid(!0),()=>{c.current=!1}),[n]),n9(o,n,d.current,!1)}var $l=t=>typeof t=="string",o9=(t,e,n,r,s)=>$l(t)?(r&&e.watch.add(t),je(n,t,s)):Array.isArray(t)?t.map(i=>(r&&e.watch.add(i),je(n,i))):(r&&(e.watchAll=!0),n);function APe(t){const e=Ui(),{control:n=e.control,name:r,defaultValue:s,disabled:i,exact:o}=t||{},a=oe.useRef(r);a.current=r,GR({disabled:i,subject:n._subjects.values,next:f=>{s9(a.current,f.name,o)&&d(Br(o9(a.current,n._names,f.values||n._formValues,!1,s)))}});const[c,d]=oe.useState(n._getWatch(r,s));return oe.useEffect(()=>n._removeUnmounted()),c}function RPe(t){const e=Ui(),{name:n,disabled:r,control:s=e.control,shouldUnregister:i}=t,o=JK(s._names.array,n),a=APe({control:s,name:n,defaultValue:je(s._formValues,n,je(s._defaultValues,n,t.defaultValue)),exact:!0}),c=i9({control:s,name:n,exact:!0}),d=oe.useRef(s.register(n,{...t.rules,value:a,...Ol(t.disabled)?{disabled:t.disabled}:{}}));return oe.useEffect(()=>{const f=s._options.shouldUnregister||i,l=(u,p)=>{const h=je(s._fields,u);h&&h._f&&(h._f.mount=p)};if(l(n,!0),f){const u=Br(je(s._options.defaultValues,n));sn(s._defaultValues,n,u),Fn(je(s._formValues,n))&&sn(s._formValues,n,u)}return()=>{(o?f&&!s._state.action:f)?s.unregister(n):l(n,!1)}},[n,s,o,i]),oe.useEffect(()=>{je(s._fields,n)&&s._updateDisabledField({disabled:r,fields:s._fields,name:n,value:je(s._fields,n)._f.value})},[r,n,s]),{field:{name:n,value:a,...Ol(r)||c.disabled?{disabled:c.disabled||r}:{},onChange:oe.useCallback(f=>d.current.onChange({target:{value:ZK(f),name:n},type:PE.CHANGE}),[n]),onBlur:oe.useCallback(()=>d.current.onBlur({target:{value:je(s._formValues,n),name:n},type:PE.BLUR}),[n,s]),ref:oe.useCallback(f=>{const l=je(s._fields,n);l&&f&&(l._f.ref={focus:()=>f.focus(),select:()=>f.select(),setCustomValidity:u=>f.setCustomValidity(u),reportValidity:()=>f.reportValidity()})},[s._fields,n])},formState:c,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!je(c.errors,n)},isDirty:{enumerable:!0,get:()=>!!je(c.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!je(c.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!je(c.validatingFields,n)},error:{enumerable:!0,get:()=>je(c.errors,n)}})}}const PPe=t=>t.render(RPe(t));var a9=(t,e,n,r,s)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:s||!0}}:{},Wu=()=>{const t=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const n=(Math.random()*16+t)%16|0;return(e=="x"?n:n&3|8).toString(16)})},bk=(t,e,n={})=>n.shouldFocus||Fn(n.shouldFocus)?n.focusName||`${t}.${Fn(n.focusIndex)?e:n.focusIndex}.`:"",C0=t=>({isOnSubmit:!t||t===Zo.onSubmit,isOnBlur:t===Zo.onBlur,isOnChange:t===Zo.onChange,isOnAll:t===Zo.all,isOnTouch:t===Zo.onTouched}),YM=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const mg=(t,e,n,r)=>{for(const s of n||Object.keys(t)){const i=je(t,s);if(i){const{_f:o,...a}=i;if(o){if(o.refs&&o.refs[0]&&e(o.refs[0],s)&&!r)break;if(o.ref&&e(o.ref,o.name)&&!r)break;mg(a,e)}else Kr(a)&&mg(a,e)}}};var l9=(t,e,n)=>{const r=ki(je(t,n));return sn(r,"root",e[n]),sn(t,n,r),t},O2=t=>t.type==="file",qd=t=>typeof t=="function",NE=t=>{if(!D2)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},cC=t=>$l(t),j2=t=>t.type==="radio",TE=t=>t instanceof RegExp;const k5={value:!1,isValid:!1},D5={value:!0,isValid:!0};var c9=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!Fn(t[0].attributes.value)?Fn(t[0].value)||t[0].value===""?D5:{value:t[0].value,isValid:!0}:D5:k5}return k5};const M5={isValid:!1,value:null};var u9=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,M5):M5;function O5(t,e,n="validate"){if(cC(t)||Array.isArray(t)&&t.every(cC)||Ol(t)&&!t)return{type:n,message:cC(t)?t:"",ref:e}}var Sm=t=>Kr(t)&&!TE(t)?t:{value:t,message:""},XM=async(t,e,n,r,s)=>{const{ref:i,refs:o,required:a,maxLength:c,minLength:d,min:f,max:l,pattern:u,validate:p,name:h,valueAsNumber:m,mount:y,disabled:g}=t._f,v=je(e,h);if(!y||g)return{};const b=o?o[0]:i,_=j=>{r&&b.reportValidity&&(b.setCustomValidity(Ol(j)?"":j||""),b.reportValidity())},A={},P=j2(i),T=I_(i),E=P||T,N=(m||O2(i))&&Fn(i.value)&&Fn(v)||NE(i)&&i.value===""||v===""||Array.isArray(v)&&!v.length,k=a9.bind(null,h,n,A),M=(j,I,L,H=gc.maxLength,K=gc.minLength)=>{const V=j?I:L;A[h]={type:j?H:K,message:V,ref:i,...k(j?H:K,V)}};if(s?!Array.isArray(v)||!v.length:a&&(!E&&(N||Js(v))||Ol(v)&&!v||T&&!c9(o).isValid||P&&!u9(o).isValid)){const{value:j,message:I}=cC(a)?{value:!!a,message:a}:Sm(a);if(j&&(A[h]={type:gc.required,message:I,ref:b,...k(gc.required,I)},!n))return _(I),A}if(!N&&(!Js(f)||!Js(l))){let j,I;const L=Sm(l),H=Sm(f);if(!Js(v)&&!isNaN(v)){const K=i.valueAsNumber||v&&+v;Js(L.value)||(j=K>L.value),Js(H.value)||(I=Knew Date(new Date().toDateString()+" "+te),U=i.type=="time",Q=i.type=="week";$l(L.value)&&v&&(j=U?V(v)>V(L.value):Q?v>L.value:K>new Date(L.value)),$l(H.value)&&v&&(I=U?V(v)+j.value,H=!Js(I.value)&&v.length<+I.value;if((L||H)&&(M(L,j.message,I.message),!n))return _(A[h].message),A}if(u&&!N&&$l(v)){const{value:j,message:I}=Sm(u);if(TE(j)&&!v.match(j)&&(A[h]={type:gc.pattern,message:I,ref:i,...k(gc.pattern,I)},!n))return _(I),A}if(p){if(qd(p)){const j=await p(v,e),I=O5(j,b);if(I&&(A[h]={...I,...k(gc.validate,I.message)},!n))return _(I.message),A}else if(Kr(p)){let j={};for(const I in p){if(!Xs(j)&&!n)break;const L=O5(await p[I](v,e),b,I);L&&(j={...L,...k(I,L.message)},_(L.message),n&&(A[h]=j))}if(!Xs(j)&&(A[h]={ref:b,...j},!n))return A}}return _(!0),A},xk=(t,e)=>[...t,...ki(e)],wk=t=>Array.isArray(t)?t.map(()=>{}):void 0;function _k(t,e,n){return[...t.slice(0,e),...ki(n),...t.slice(e)]}var Sk=(t,e,n)=>Array.isArray(t)?(Fn(t[n])&&(t[n]=void 0),t.splice(n,0,t.splice(e,1)[0]),t):[],Ck=(t,e)=>[...ki(e),...ki(t)];function NPe(t,e){let n=0;const r=[...t];for(const s of e)r.splice(s-n,1),n++;return L_(r).length?r:[]}var Ek=(t,e)=>Fn(e)?[]:NPe(t,ki(e).sort((n,r)=>n-r)),Ak=(t,e,n)=>{[t[e],t[n]]=[t[n],t[e]]};function TPe(t,e){const n=e.slice(0,-1).length;let r=0;for(;r(t[e]=n,t);function DPe(t){const e=Ui(),{control:n=e.control,name:r,keyName:s="id",shouldUnregister:i}=t,[o,a]=oe.useState(n._getFieldArray(r)),c=oe.useRef(n._getFieldArray(r).map(Wu)),d=oe.useRef(o),f=oe.useRef(r),l=oe.useRef(!1);f.current=r,d.current=o,n._names.array.add(r),t.rules&&n.register(r,t.rules),GR({next:({values:A,name:P})=>{if(P===f.current||!P){const T=je(A,f.current);Array.isArray(T)&&(a(T),c.current=T.map(Wu))}},subject:n._subjects.array});const u=oe.useCallback(A=>{l.current=!0,n._updateFieldArray(r,A)},[n,r]),p=(A,P)=>{const T=ki(Br(A)),E=xk(n._getFieldArray(r),T);n._names.focus=bk(r,E.length-1,P),c.current=xk(c.current,T.map(Wu)),u(E),a(E),n._updateFieldArray(r,E,xk,{argA:wk(A)})},h=(A,P)=>{const T=ki(Br(A)),E=Ck(n._getFieldArray(r),T);n._names.focus=bk(r,0,P),c.current=Ck(c.current,T.map(Wu)),u(E),a(E),n._updateFieldArray(r,E,Ck,{argA:wk(A)})},m=A=>{const P=Ek(n._getFieldArray(r),A);c.current=Ek(c.current,A),u(P),a(P),n._updateFieldArray(r,P,Ek,{argA:A})},y=(A,P,T)=>{const E=ki(Br(P)),N=_k(n._getFieldArray(r),A,E);n._names.focus=bk(r,A,T),c.current=_k(c.current,A,E.map(Wu)),u(N),a(N),n._updateFieldArray(r,N,_k,{argA:A,argB:wk(P)})},g=(A,P)=>{const T=n._getFieldArray(r);Ak(T,A,P),Ak(c.current,A,P),u(T),a(T),n._updateFieldArray(r,T,Ak,{argA:A,argB:P},!1)},v=(A,P)=>{const T=n._getFieldArray(r);Sk(T,A,P),Sk(c.current,A,P),u(T),a(T),n._updateFieldArray(r,T,Sk,{argA:A,argB:P},!1)},b=(A,P)=>{const T=Br(P),E=j5(n._getFieldArray(r),A,T);c.current=[...E].map((N,k)=>!N||k===A?Wu():c.current[k]),u(E),a([...E]),n._updateFieldArray(r,E,j5,{argA:A,argB:T},!0,!1)},_=A=>{const P=ki(Br(A));c.current=P.map(Wu),u([...P]),a([...P]),n._updateFieldArray(r,[...P],T=>T,{},!0,!1)};return oe.useEffect(()=>{if(n._state.action=!1,YM(r,n._names)&&n._subjects.state.next({...n._formState}),l.current&&(!C0(n._options.mode).isOnSubmit||n._formState.isSubmitted))if(n._options.resolver)n._executeSchema([r]).then(A=>{const P=je(A.errors,r),T=je(n._formState.errors,r);(T?!P&&T.type||P&&(T.type!==P.type||T.message!==P.message):P&&P.type)&&(P?sn(n._formState.errors,r,P):Ar(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const A=je(n._fields,r);A&&A._f&&!(C0(n._options.reValidateMode).isOnSubmit&&C0(n._options.mode).isOnSubmit)&&XM(A,n._formValues,n._options.criteriaMode===Zo.all,n._options.shouldUseNativeValidation,!0).then(P=>!Xs(P)&&n._subjects.state.next({errors:l9(n._formState.errors,P,r)}))}n._subjects.values.next({name:r,values:{...n._formValues}}),n._names.focus&&mg(n._fields,(A,P)=>{if(n._names.focus&&P.startsWith(n._names.focus)&&A.focus)return A.focus(),1}),n._names.focus="",n._updateValid(),l.current=!1},[o,r,n]),oe.useEffect(()=>(!je(n._formValues,r)&&n._updateFieldArray(r),()=>{(n._options.shouldUnregister||i)&&n.unregister(r)}),[r,n,s,i]),{swap:oe.useCallback(g,[u,r,n]),move:oe.useCallback(v,[u,r,n]),prepend:oe.useCallback(h,[u,r,n]),append:oe.useCallback(p,[u,r,n]),remove:oe.useCallback(m,[u,r,n]),insert:oe.useCallback(y,[u,r,n]),update:oe.useCallback(b,[u,r,n]),replace:oe.useCallback(_,[u,r,n]),fields:oe.useMemo(()=>o.map((A,P)=>({...A,[s]:c.current[P]||Wu()})),[o,s])}}var Rk=()=>{let t=[];return{get observers(){return t},next:s=>{for(const i of t)i.next&&i.next(s)},subscribe:s=>(t.push(s),{unsubscribe:()=>{t=t.filter(i=>i!==s)}}),unsubscribe:()=>{t=[]}}},kE=t=>Js(t)||!QK(t);function ih(t,e){if(kE(t)||kE(e))return t===e;if(Zm(t)&&Zm(e))return t.getTime()===e.getTime();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const s of n){const i=t[s];if(!r.includes(s))return!1;if(s!=="ref"){const o=e[s];if(Zm(i)&&Zm(o)||Kr(i)&&Kr(o)||Array.isArray(i)&&Array.isArray(o)?!ih(i,o):i!==o)return!1}}return!0}var d9=t=>t.type==="select-multiple",MPe=t=>j2(t)||I_(t),Pk=t=>NE(t)&&t.isConnected,f9=t=>{for(const e in t)if(qd(t[e]))return!0;return!1};function DE(t,e={}){const n=Array.isArray(t);if(Kr(t)||n)for(const r in t)Array.isArray(t[r])||Kr(t[r])&&!f9(t[r])?(e[r]=Array.isArray(t[r])?[]:{},DE(t[r],e[r])):Js(t[r])||(e[r]=!0);return e}function h9(t,e,n){const r=Array.isArray(t);if(Kr(t)||r)for(const s in t)Array.isArray(t[s])||Kr(t[s])&&!f9(t[s])?Fn(e)||kE(n[s])?n[s]=Array.isArray(t[s])?DE(t[s],[]):{...DE(t[s])}:h9(t[s],Js(e)?{}:e[s],n[s]):n[s]=!ih(t[s],e[s]);return n}var E1=(t,e)=>h9(t,e,DE(e)),p9=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>Fn(t)?t:e?t===""?NaN:t&&+t:n&&$l(t)?new Date(t):r?r(t):t;function Nk(t){const e=t.ref;if(!(t.refs?t.refs.every(n=>n.disabled):e.disabled))return O2(e)?e.files:j2(e)?u9(t.refs).value:d9(e)?[...e.selectedOptions].map(({value:n})=>n):I_(e)?c9(t.refs).value:p9(Fn(e.value)?t.ref.value:e.value,t)}var OPe=(t,e,n,r)=>{const s={};for(const i of t){const o=je(e,i);o&&sn(s,i,o._f)}return{criteriaMode:n,names:[...t],fields:s,shouldUseNativeValidation:r}},Rb=t=>Fn(t)?t:TE(t)?t.source:Kr(t)?TE(t.value)?t.value.source:t.value:t,jPe=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate);function I5(t,e,n){const r=je(t,n);if(r||M2(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const i=s.join("."),o=je(e,i),a=je(t,i);if(o&&!Array.isArray(o)&&n!==i)return{name:n};if(a&&a.type)return{name:i,error:a};s.pop()}return{name:n}}var IPe=(t,e,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(e||t):(n?r.isOnBlur:s.isOnBlur)?!t:(n?r.isOnChange:s.isOnChange)?t:!0,LPe=(t,e)=>!L_(je(t,e)).length&&Ar(t,e);const $Pe={mode:Zo.onSubmit,reValidateMode:Zo.onChange,shouldFocusError:!0};function FPe(t={}){let e={...$Pe,...t},n={submitCount:0,isDirty:!1,isLoading:qd(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},r={},s=Kr(e.defaultValues)||Kr(e.values)?Br(e.defaultValues||e.values)||{}:{},i=e.shouldUnregister?{}:Br(s),o={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,d=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},l={values:Rk(),array:Rk(),state:Rk()},u=C0(e.mode),p=C0(e.reValidateMode),h=e.criteriaMode===Zo.all,m=ee=>de=>{clearTimeout(d),d=setTimeout(ee,de)},y=async ee=>{if(f.isValid||ee){const de=e.resolver?Xs((await E()).errors):await k(r,!0);de!==n.isValid&&l.state.next({isValid:de})}},g=(ee,de)=>{(f.isValidating||f.validatingFields)&&((ee||Array.from(a.mount)).forEach(me=>{me&&(de?sn(n.validatingFields,me,de):Ar(n.validatingFields,me))}),l.state.next({validatingFields:n.validatingFields,isValidating:!Xs(n.validatingFields)}))},v=(ee,de=[],me,Re,Ne=!0,Ee=!0)=>{if(Re&&me){if(o.action=!0,Ee&&Array.isArray(je(r,ee))){const Ve=me(je(r,ee),Re.argA,Re.argB);Ne&&sn(r,ee,Ve)}if(Ee&&Array.isArray(je(n.errors,ee))){const Ve=me(je(n.errors,ee),Re.argA,Re.argB);Ne&&sn(n.errors,ee,Ve),LPe(n.errors,ee)}if(f.touchedFields&&Ee&&Array.isArray(je(n.touchedFields,ee))){const Ve=me(je(n.touchedFields,ee),Re.argA,Re.argB);Ne&&sn(n.touchedFields,ee,Ve)}f.dirtyFields&&(n.dirtyFields=E1(s,i)),l.state.next({name:ee,isDirty:j(ee,de),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else sn(i,ee,de)},b=(ee,de)=>{sn(n.errors,ee,de),l.state.next({errors:n.errors})},_=ee=>{n.errors=ee,l.state.next({errors:n.errors,isValid:!1})},A=(ee,de,me,Re)=>{const Ne=je(r,ee);if(Ne){const Ee=je(i,ee,Fn(me)?je(s,ee):me);Fn(Ee)||Re&&Re.defaultChecked||de?sn(i,ee,de?Ee:Nk(Ne._f)):H(ee,Ee),o.mount&&y()}},P=(ee,de,me,Re,Ne)=>{let Ee=!1,Ve=!1;const tt={name:ee},qt=!!(je(r,ee)&&je(r,ee)._f&&je(r,ee)._f.disabled);if(!me||Re){f.isDirty&&(Ve=n.isDirty,n.isDirty=tt.isDirty=j(),Ee=Ve!==tt.isDirty);const gt=qt||ih(je(s,ee),de);Ve=!!(!qt&&je(n.dirtyFields,ee)),gt||qt?Ar(n.dirtyFields,ee):sn(n.dirtyFields,ee,!0),tt.dirtyFields=n.dirtyFields,Ee=Ee||f.dirtyFields&&Ve!==!gt}if(me){const gt=je(n.touchedFields,ee);gt||(sn(n.touchedFields,ee,me),tt.touchedFields=n.touchedFields,Ee=Ee||f.touchedFields&>!==me)}return Ee&&Ne&&l.state.next(tt),Ee?tt:{}},T=(ee,de,me,Re)=>{const Ne=je(n.errors,ee),Ee=f.isValid&&Ol(de)&&n.isValid!==de;if(t.delayError&&me?(c=m(()=>b(ee,me)),c(t.delayError)):(clearTimeout(d),c=null,me?sn(n.errors,ee,me):Ar(n.errors,ee)),(me?!ih(Ne,me):Ne)||!Xs(Re)||Ee){const Ve={...Re,...Ee&&Ol(de)?{isValid:de}:{},errors:n.errors,name:ee};n={...n,...Ve},l.state.next(Ve)}},E=async ee=>{g(ee,!0);const de=await e.resolver(i,e.context,OPe(ee||a.mount,r,e.criteriaMode,e.shouldUseNativeValidation));return g(ee),de},N=async ee=>{const{errors:de}=await E(ee);if(ee)for(const me of ee){const Re=je(de,me);Re?sn(n.errors,me,Re):Ar(n.errors,me)}else n.errors=de;return de},k=async(ee,de,me={valid:!0})=>{for(const Re in ee){const Ne=ee[Re];if(Ne){const{_f:Ee,...Ve}=Ne;if(Ee){const tt=a.array.has(Ee.name);g([Re],!0);const qt=await XM(Ne,i,h,e.shouldUseNativeValidation&&!de,tt);if(g([Re]),qt[Ee.name]&&(me.valid=!1,de))break;!de&&(je(qt,Ee.name)?tt?l9(n.errors,qt,Ee.name):sn(n.errors,Ee.name,qt[Ee.name]):Ar(n.errors,Ee.name))}!Xs(Ve)&&await k(Ve,de,me)}}return me.valid},M=()=>{for(const ee of a.unMount){const de=je(r,ee);de&&(de._f.refs?de._f.refs.every(me=>!Pk(me)):!Pk(de._f.ref))&&fe(ee)}a.unMount=new Set},j=(ee,de)=>(ee&&de&&sn(i,ee,de),!ih(X(),s)),I=(ee,de,me)=>o9(ee,a,{...o.mount?i:Fn(de)?s:$l(ee)?{[ee]:de}:de},me,de),L=ee=>L_(je(o.mount?i:s,ee,t.shouldUnregister?je(s,ee,[]):[])),H=(ee,de,me={})=>{const Re=je(r,ee);let Ne=de;if(Re){const Ee=Re._f;Ee&&(!Ee.disabled&&sn(i,ee,p9(de,Ee)),Ne=NE(Ee.ref)&&Js(de)?"":de,d9(Ee.ref)?[...Ee.ref.options].forEach(Ve=>Ve.selected=Ne.includes(Ve.value)):Ee.refs?I_(Ee.ref)?Ee.refs.length>1?Ee.refs.forEach(Ve=>(!Ve.defaultChecked||!Ve.disabled)&&(Ve.checked=Array.isArray(Ne)?!!Ne.find(tt=>tt===Ve.value):Ne===Ve.value)):Ee.refs[0]&&(Ee.refs[0].checked=!!Ne):Ee.refs.forEach(Ve=>Ve.checked=Ve.value===Ne):O2(Ee.ref)?Ee.ref.value="":(Ee.ref.value=Ne,Ee.ref.type||l.values.next({name:ee,values:{...i}})))}(me.shouldDirty||me.shouldTouch)&&P(ee,Ne,me.shouldTouch,me.shouldDirty,!0),me.shouldValidate&&te(ee)},K=(ee,de,me)=>{for(const Re in de){const Ne=de[Re],Ee=`${ee}.${Re}`,Ve=je(r,Ee);(a.array.has(ee)||!kE(Ne)||Ve&&!Ve._f)&&!Zm(Ne)?K(Ee,Ne,me):H(Ee,Ne,me)}},V=(ee,de,me={})=>{const Re=je(r,ee),Ne=a.array.has(ee),Ee=Br(de);sn(i,ee,Ee),Ne?(l.array.next({name:ee,values:{...i}}),(f.isDirty||f.dirtyFields)&&me.shouldDirty&&l.state.next({name:ee,dirtyFields:E1(s,i),isDirty:j(ee,Ee)})):Re&&!Re._f&&!Js(Ee)?K(ee,Ee,me):H(ee,Ee,me),YM(ee,a)&&l.state.next({...n}),l.values.next({name:o.mount?ee:void 0,values:{...i}})},U=async ee=>{o.mount=!0;const de=ee.target;let me=de.name,Re=!0;const Ne=je(r,me),Ee=()=>de.type?Nk(Ne._f):ZK(ee),Ve=tt=>{Re=Number.isNaN(tt)||tt===je(i,me,tt)};if(Ne){let tt,qt;const gt=Ee(),kt=ee.type===PE.BLUR||ee.type===PE.FOCUS_OUT,an=!jPe(Ne._f)&&!e.resolver&&!je(n.errors,me)&&!Ne._f.deps||IPe(kt,je(n.touchedFields,me),n.isSubmitted,p,u),gr=YM(me,a,kt);sn(i,me,gt),kt?(Ne._f.onBlur&&Ne._f.onBlur(ee),c&&c(0)):Ne._f.onChange&&Ne._f.onChange(ee);const _n=P(me,gt,kt,!1),di=!Xs(_n)||gr;if(!kt&&l.values.next({name:me,type:ee.type,values:{...i}}),an)return f.isValid&&y(),di&&l.state.next({name:me,...gr?{}:_n});if(!kt&&gr&&l.state.next({...n}),e.resolver){const{errors:or}=await E([me]);if(Ve(gt),Re){const fi=I5(n.errors,r,me),$e=I5(or,r,fi.name||me);tt=$e.error,me=$e.name,qt=Xs(or)}}else g([me],!0),tt=(await XM(Ne,i,h,e.shouldUseNativeValidation))[me],g([me]),Ve(gt),Re&&(tt?qt=!1:f.isValid&&(qt=await k(r,!0)));Re&&(Ne._f.deps&&te(Ne._f.deps),T(me,qt,tt,_n))}},Q=(ee,de)=>{if(je(n.errors,de)&&ee.focus)return ee.focus(),1},te=async(ee,de={})=>{let me,Re;const Ne=ki(ee);if(e.resolver){const Ee=await N(Fn(ee)?ee:Ne);me=Xs(Ee),Re=ee?!Ne.some(Ve=>je(Ee,Ve)):me}else ee?(Re=(await Promise.all(Ne.map(async Ee=>{const Ve=je(r,Ee);return await k(Ve&&Ve._f?{[Ee]:Ve}:Ve)}))).every(Boolean),!(!Re&&!n.isValid)&&y()):Re=me=await k(r);return l.state.next({...!$l(ee)||f.isValid&&me!==n.isValid?{}:{name:ee},...e.resolver||!ee?{isValid:me}:{},errors:n.errors}),de.shouldFocus&&!Re&&mg(r,Q,ee?Ne:a.mount),Re},X=ee=>{const de={...o.mount?i:s};return Fn(ee)?de:$l(ee)?je(de,ee):ee.map(me=>je(de,me))},G=(ee,de)=>({invalid:!!je((de||n).errors,ee),isDirty:!!je((de||n).dirtyFields,ee),error:je((de||n).errors,ee),isValidating:!!je(n.validatingFields,ee),isTouched:!!je((de||n).touchedFields,ee)}),Y=ee=>{ee&&ki(ee).forEach(de=>Ar(n.errors,de)),l.state.next({errors:ee?n.errors:{}})},Z=(ee,de,me)=>{const Re=(je(r,ee,{_f:{}})._f||{}).ref,Ne=je(n.errors,ee)||{},{ref:Ee,message:Ve,type:tt,...qt}=Ne;sn(n.errors,ee,{...qt,...de,ref:Re}),l.state.next({name:ee,errors:n.errors,isValid:!1}),me&&me.shouldFocus&&Re&&Re.focus&&Re.focus()},he=(ee,de)=>qd(ee)?l.values.subscribe({next:me=>ee(I(void 0,de),me)}):I(ee,de,!0),fe=(ee,de={})=>{for(const me of ee?ki(ee):a.mount)a.mount.delete(me),a.array.delete(me),de.keepValue||(Ar(r,me),Ar(i,me)),!de.keepError&&Ar(n.errors,me),!de.keepDirty&&Ar(n.dirtyFields,me),!de.keepTouched&&Ar(n.touchedFields,me),!de.keepIsValidating&&Ar(n.validatingFields,me),!e.shouldUnregister&&!de.keepDefaultValue&&Ar(s,me);l.values.next({values:{...i}}),l.state.next({...n,...de.keepDirty?{isDirty:j()}:{}}),!de.keepIsValid&&y()},ce=({disabled:ee,name:de,field:me,fields:Re,value:Ne})=>{if(Ol(ee)&&o.mount||ee){const Ee=ee?void 0:Fn(Ne)?Nk(me?me._f:je(Re,de)._f):Ne;sn(i,de,Ee),P(de,Ee,!1,!1,!0)}},xe=(ee,de={})=>{let me=je(r,ee);const Re=Ol(de.disabled);return sn(r,ee,{...me||{},_f:{...me&&me._f?me._f:{ref:{name:ee}},name:ee,mount:!0,...de}}),a.mount.add(ee),me?ce({field:me,disabled:de.disabled,name:ee,value:de.value}):A(ee,!0,de.value),{...Re?{disabled:de.disabled}:{},...e.progressive?{required:!!de.required,min:Rb(de.min),max:Rb(de.max),minLength:Rb(de.minLength),maxLength:Rb(de.maxLength),pattern:Rb(de.pattern)}:{},name:ee,onChange:U,onBlur:U,ref:Ne=>{if(Ne){xe(ee,de),me=je(r,ee);const Ee=Fn(Ne.value)&&Ne.querySelectorAll&&Ne.querySelectorAll("input,select,textarea")[0]||Ne,Ve=MPe(Ee),tt=me._f.refs||[];if(Ve?tt.find(qt=>qt===Ee):Ee===me._f.ref)return;sn(r,ee,{_f:{...me._f,...Ve?{refs:[...tt.filter(Pk),Ee,...Array.isArray(je(s,ee))?[{}]:[]],ref:{type:Ee.type,name:ee}}:{ref:Ee}}}),A(ee,!1,void 0,Ee)}else me=je(r,ee,{}),me._f&&(me._f.mount=!1),(e.shouldUnregister||de.shouldUnregister)&&!(JK(a.array,ee)&&o.action)&&a.unMount.add(ee)}}},Pe=()=>e.shouldFocusError&&mg(r,Q,a.mount),pe=ee=>{Ol(ee)&&(l.state.next({disabled:ee}),mg(r,(de,me)=>{const Re=je(r,me);Re&&(de.disabled=Re._f.disabled||ee,Array.isArray(Re._f.refs)&&Re._f.refs.forEach(Ne=>{Ne.disabled=Re._f.disabled||ee}))},0,!1))},Le=(ee,de)=>async me=>{let Re;me&&(me.preventDefault&&me.preventDefault(),me.persist&&me.persist());let Ne=Br(i);if(l.state.next({isSubmitting:!0}),e.resolver){const{errors:Ee,values:Ve}=await E();n.errors=Ee,Ne=Ve}else await k(r);if(Ar(n.errors,"root"),Xs(n.errors)){l.state.next({errors:{}});try{await ee(Ne,me)}catch(Ee){Re=Ee}}else de&&await de({...n.errors},me),Pe(),setTimeout(Pe);if(l.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Xs(n.errors)&&!Re,submitCount:n.submitCount+1,errors:n.errors}),Re)throw Re},Me=(ee,de={})=>{je(r,ee)&&(Fn(de.defaultValue)?V(ee,Br(je(s,ee))):(V(ee,de.defaultValue),sn(s,ee,Br(de.defaultValue))),de.keepTouched||Ar(n.touchedFields,ee),de.keepDirty||(Ar(n.dirtyFields,ee),n.isDirty=de.defaultValue?j(ee,Br(je(s,ee))):j()),de.keepError||(Ar(n.errors,ee),f.isValid&&y()),l.state.next({...n}))},Oe=(ee,de={})=>{const me=ee?Br(ee):s,Re=Br(me),Ne=Xs(ee),Ee=Ne?s:Re;if(de.keepDefaultValues||(s=me),!de.keepValues){if(de.keepDirtyValues)for(const Ve of a.mount)je(n.dirtyFields,Ve)?sn(Ee,Ve,je(i,Ve)):V(Ve,je(Ee,Ve));else{if(D2&&Fn(ee))for(const Ve of a.mount){const tt=je(r,Ve);if(tt&&tt._f){const qt=Array.isArray(tt._f.refs)?tt._f.refs[0]:tt._f.ref;if(NE(qt)){const gt=qt.closest("form");if(gt){gt.reset();break}}}}r={}}i=t.shouldUnregister?de.keepDefaultValues?Br(s):{}:Br(Ee),l.array.next({values:{...Ee}}),l.values.next({values:{...Ee}})}a={mount:de.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!f.isValid||!!de.keepIsValid||!!de.keepDirtyValues,o.watch=!!t.shouldUnregister,l.state.next({submitCount:de.keepSubmitCount?n.submitCount:0,isDirty:Ne?!1:de.keepDirty?n.isDirty:!!(de.keepDefaultValues&&!ih(ee,s)),isSubmitted:de.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Ne?{}:de.keepDirtyValues?de.keepDefaultValues&&i?E1(s,i):n.dirtyFields:de.keepDefaultValues&&ee?E1(s,ee):de.keepDirty?n.dirtyFields:{},touchedFields:de.keepTouched?n.touchedFields:{},errors:de.keepErrors?n.errors:{},isSubmitSuccessful:de.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Fe=(ee,de)=>Oe(qd(ee)?ee(i):ee,de);return{control:{register:xe,unregister:fe,getFieldState:G,handleSubmit:Le,setError:Z,_executeSchema:E,_getWatch:I,_getDirty:j,_updateValid:y,_removeUnmounted:M,_updateFieldArray:v,_updateDisabledField:ce,_getFieldArray:L,_reset:Oe,_resetDefaultValues:()=>qd(e.defaultValues)&&e.defaultValues().then(ee=>{Fe(ee,e.resetOptions),l.state.next({isLoading:!1})}),_updateFormState:ee=>{n={...n,...ee}},_disableForm:pe,_subjects:l,_proxyFormState:f,_setErrors:_,get _fields(){return r},get _formValues(){return i},get _state(){return o},set _state(ee){o=ee},get _defaultValues(){return s},get _names(){return a},set _names(ee){a=ee},get _formState(){return n},set _formState(ee){n=ee},get _options(){return e},set _options(ee){e={...e,...ee}}},trigger:te,register:xe,handleSubmit:Le,watch:he,setValue:V,getValues:X,reset:Fe,resetField:Me,clearErrors:Y,unregister:fe,setError:Z,setFocus:(ee,de={})=>{const me=je(r,ee),Re=me&&me._f;if(Re){const Ne=Re.refs?Re.refs[0]:Re.ref;Ne.focus&&(Ne.focus(),de.shouldSelect&&Ne.select())}},getFieldState:G}}function $_(t={}){const e=oe.useRef(),n=oe.useRef(),[r,s]=oe.useState({isDirty:!1,isValidating:!1,isLoading:qd(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,defaultValues:qd(t.defaultValues)?void 0:t.defaultValues});e.current||(e.current={...FPe(t),formState:r});const i=e.current.control;return i._options=t,GR({subject:i._subjects.state,next:o=>{r9(o,i._proxyFormState,i._updateFormState,!0)&&s({...i._formState})}}),oe.useEffect(()=>i._disableForm(t.disabled),[i,t.disabled]),oe.useEffect(()=>{if(i._proxyFormState.isDirty){const o=i._getDirty();o!==r.isDirty&&i._subjects.state.next({isDirty:o})}},[i,r.isDirty]),oe.useEffect(()=>{t.values&&!ih(t.values,n.current)?(i._reset(t.values,i._options.resetOptions),n.current=t.values,s(o=>({...o}))):i._resetDefaultValues()},[t.values,i]),oe.useEffect(()=>{t.errors&&i._setErrors(t.errors)},[t.errors,i]),oe.useEffect(()=>{i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),oe.useEffect(()=>{t.shouldUnregister&&i._subjects.values.next({values:i._getWatch()})},[t.shouldUnregister,i]),e.current.formState=n9(r,i),e.current}var zPe="Label",m9=S.forwardRef((t,e)=>x.jsx(De.label,{...t,ref:e,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=t.onMouseDown)==null||s.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));m9.displayName=zPe;var g9=m9;const BPe=li("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Wp=S.forwardRef(({className:t,...e},n)=>x.jsx(g9,{ref:n,className:ie(BPe(),t),...e}));Wp.displayName=g9.displayName;const F_=EPe,v9=S.createContext({}),Dy=({...t})=>x.jsx(v9.Provider,{value:{name:t.name},children:x.jsx(PPe,{...t})}),My=()=>{const t=S.useContext(v9),e=S.useContext(y9),{getFieldState:n,formState:r}=Ui(),s=n(t.name,r);if(!t)throw new Error("useFormField should be used within ");const{id:i}=e;return{id:i,name:t.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...s}},y9=S.createContext({}),Gp=S.forwardRef(({className:t,...e},n)=>{const r=S.useId();return x.jsx(y9.Provider,{value:{id:r},children:x.jsx("div",{ref:n,className:ie("space-y-2",t),...e})})});Gp.displayName="FormItem";const b9=S.forwardRef(({className:t,...e},n)=>{const{error:r,formItemId:s}=My();return x.jsx(Wp,{ref:n,className:ie(r&&"text-destructive",t),htmlFor:s,...e})});b9.displayName="FormLabel";const Kp=S.forwardRef(({...t},e)=>{const{error:n,formItemId:r,formDescriptionId:s,formMessageId:i}=My();return x.jsx(Ya,{ref:e,id:r,"aria-describedby":n?`${s} ${i}`:`${s}`,"aria-invalid":!!n,...t})});Kp.displayName="FormControl";const Yp=S.forwardRef(({className:t,...e},n)=>{const{formDescriptionId:r}=My();return x.jsx("p",{ref:n,id:r,className:ie("text-sm text-muted-foreground",t),...e})});Yp.displayName="FormDescription";const x9=S.forwardRef(({className:t,children:e,...n},r)=>{var a;const{error:s,formMessageId:i}=My(),o=s&&s.message?String((s==null?void 0:s.message)||((a=s.root)==null?void 0:a.message)):e;return o?x.jsx("p",{ref:r,id:i,className:ie("text-sm font-medium text-destructive",t),...n,children:o}):null});x9.displayName="FormMessage";var Tk,w9="HoverCard",[_9,UUe]=jn(w9,[ec]),I2=ec(),[HUe,L2]=_9(w9),S9="HoverCardTrigger",UPe=S.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,s=L2(S9,n),i=I2(n);return x.jsx(Ty,{asChild:!0,...i,children:x.jsx(De.a,{"data-state":s.open?"open":"closed",...r,ref:e,onPointerEnter:ye(t.onPointerEnter,OE(s.onOpen)),onPointerLeave:ye(t.onPointerLeave,OE(s.onClose)),onFocus:ye(t.onFocus,s.onOpen),onBlur:ye(t.onBlur,s.onClose),onTouchStart:ye(t.onTouchStart,o=>o.preventDefault())})})});UPe.displayName=S9;var HPe="HoverCardPortal",[VUe,VPe]=_9(HPe,{forceMount:void 0}),ME="HoverCardContent",C9=S.forwardRef((t,e)=>{const n=VPe(ME,t.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=t,i=L2(ME,t.__scopeHoverCard);return x.jsx(Kn,{present:r||i.open,children:x.jsx(qPe,{"data-state":i.open?"open":"closed",...s,onPointerEnter:ye(t.onPointerEnter,OE(i.onOpen)),onPointerLeave:ye(t.onPointerLeave,OE(i.onClose)),ref:e})})});C9.displayName=ME;var qPe=S.forwardRef((t,e)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,...a}=t,c=L2(ME,n),d=I2(n),f=S.useRef(null),l=et(e,f),[u,p]=S.useState(!1);return S.useEffect(()=>{if(u){const h=document.body;return Tk=h.style.userSelect||h.style.webkitUserSelect,h.style.userSelect="none",h.style.webkitUserSelect="none",()=>{h.style.userSelect=Tk,h.style.webkitUserSelect=Tk}}},[u]),S.useEffect(()=>{if(f.current){const h=()=>{p(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var y;((y=document.getSelection())==null?void 0:y.toString())!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",h),()=>{document.removeEventListener("pointerup",h),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),S.useEffect(()=>{f.current&&KPe(f.current).forEach(m=>m.setAttribute("tabindex","-1"))}),x.jsx(Pu,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:o,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:ye(i,h=>{h.preventDefault()}),onDismiss:c.onDismiss,children:x.jsx(R_,{...d,...a,onPointerDown:ye(a.onPointerDown,h=>{h.currentTarget.contains(h.target)&&p(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:l,style:{...a.style,userSelect:u?"text":void 0,WebkitUserSelect:u?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),WPe="HoverCardArrow",GPe=S.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,s=I2(n);return x.jsx(P_,{...s,...r,ref:e})});GPe.displayName=WPe;function OE(t){return e=>e.pointerType==="touch"?void 0:t()}function KPe(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)e.push(n.currentNode);return e}var E9=C9;const YPe=S.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},s)=>x.jsx(E9,{ref:s,align:e,sideOffset:n,className:ie("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r}));YPe.displayName=E9.displayName;const KR=S.forwardRef(({className:t,type:e,...n},r)=>x.jsx("input",{type:e,className:ie("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium 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:r,...n}));KR.displayName="Input";var YR="Menubar",[QM,XPe,QPe]=Au(YR),[A9,qUe]=jn(YR,[QPe,tc]),Hi=D_(),R9=tc(),[ZPe,P9]=A9(YR),N9=S.forwardRef((t,e)=>{const{__scopeMenubar:n,value:r,onValueChange:s,defaultValue:i,loop:o=!0,dir:a,...c}=t,d=tl(a),f=R9(n),[l="",u]=mr({prop:r,onChange:s,defaultProp:i}),[p,h]=S.useState(null);return x.jsx(ZPe,{scope:n,value:l,onMenuOpen:S.useCallback(m=>{u(m),h(m)},[u]),onMenuClose:S.useCallback(()=>u(""),[u]),onMenuToggle:S.useCallback(m=>{u(y=>y?"":m),h(m)},[u]),dir:d,loop:o,children:x.jsx(QM.Provider,{scope:n,children:x.jsx(QM.Slot,{scope:n,children:x.jsx(N_,{asChild:!0,...f,orientation:"horizontal",loop:o,dir:d,currentTabStopId:p,onCurrentTabStopIdChange:h,children:x.jsx(De.div,{role:"menubar",...c,ref:e})})})})})});N9.displayName=YR;var JPe="MenubarMenu",[WUe,T9]=A9(JPe),ZM="MenubarTrigger",k9=S.forwardRef((t,e)=>{const{__scopeMenubar:n,disabled:r=!1,...s}=t,i=R9(n),o=Hi(n),a=P9(ZM,n),c=T9(ZM,n),d=S.useRef(null),f=et(e,d,c.triggerRef),[l,u]=S.useState(!1),p=a.value===c.value;return x.jsx(QM.ItemSlot,{scope:n,value:c.value,disabled:r,children:x.jsx(T_,{asChild:!0,...i,focusable:!r,tabStopId:c.value,children:x.jsx(g2,{asChild:!0,...o,children:x.jsx(De.button,{type:"button",role:"menuitem",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":p,"aria-controls":p?c.contentId:void 0,"data-highlighted":l?"":void 0,"data-state":p?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:f,onPointerDown:ye(t.onPointerDown,h=>{!r&&h.button===0&&h.ctrlKey===!1&&(a.onMenuOpen(c.value),p||h.preventDefault())}),onPointerEnter:ye(t.onPointerEnter,()=>{var m;!!a.value&&!p&&(a.onMenuOpen(c.value),(m=d.current)==null||m.focus())}),onKeyDown:ye(t.onKeyDown,h=>{r||(["Enter"," "].includes(h.key)&&a.onMenuToggle(c.value),h.key==="ArrowDown"&&a.onMenuOpen(c.value),["Enter"," ","ArrowDown"].includes(h.key)&&(c.wasKeyboardTriggerOpenRef.current=!0,h.preventDefault()))}),onFocus:ye(t.onFocus,()=>u(!0)),onBlur:ye(t.onBlur,()=>u(!1))})})})})});k9.displayName=ZM;var eNe="MenubarPortal",D9=t=>{const{__scopeMenubar:e,...n}=t,r=Hi(e);return x.jsx(v2,{...r,...n})};D9.displayName=eNe;var JM="MenubarContent",M9=S.forwardRef((t,e)=>{const{__scopeMenubar:n,align:r="start",...s}=t,i=Hi(n),o=P9(JM,n),a=T9(JM,n),c=XPe(n),d=S.useRef(!1);return x.jsx(y2,{id:a.contentId,"aria-labelledby":a.triggerId,"data-radix-menubar-content":"",...i,...s,ref:e,align:r,onCloseAutoFocus:ye(t.onCloseAutoFocus,f=>{var u;!!!o.value&&!d.current&&((u=a.triggerRef.current)==null||u.focus()),d.current=!1,f.preventDefault()}),onFocusOutside:ye(t.onFocusOutside,f=>{const l=f.target;c().some(p=>{var h;return(h=p.ref.current)==null?void 0:h.contains(l)})&&f.preventDefault()}),onInteractOutside:ye(t.onInteractOutside,()=>{d.current=!0}),onEntryFocus:f=>{a.wasKeyboardTriggerOpenRef.current||f.preventDefault()},onKeyDown:ye(t.onKeyDown,f=>{if(["ArrowRight","ArrowLeft"].includes(f.key)){const l=f.target,u=l.hasAttribute("data-radix-menubar-subtrigger"),p=l.closest("[data-radix-menubar-content]")!==f.currentTarget,m=(o.dir==="rtl"?"ArrowRight":"ArrowLeft")===f.key;if(!m&&u||p&&m)return;let v=c().filter(A=>!A.disabled).map(A=>A.value);m&&v.reverse();const b=v.indexOf(a.value);v=o.loop?mNe(v,b+1):v.slice(b+1);const[_]=v;_&&o.onMenuOpen(_)}},{checkForDefaultPrevented:!1}),style:{...t.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});M9.displayName=JM;var tNe="MenubarGroup",nNe=S.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Hi(n);return x.jsx(b2,{...s,...r,ref:e})});nNe.displayName=tNe;var rNe="MenubarLabel",O9=S.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Hi(n);return x.jsx(x2,{...s,...r,ref:e})});O9.displayName=rNe;var sNe="MenubarItem",j9=S.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Hi(n);return x.jsx(w2,{...s,...r,ref:e})});j9.displayName=sNe;var iNe="MenubarCheckboxItem",I9=S.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Hi(n);return x.jsx(_2,{...s,...r,ref:e})});I9.displayName=iNe;var oNe="MenubarRadioGroup",aNe=S.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Hi(n);return x.jsx(S2,{...s,...r,ref:e})});aNe.displayName=oNe;var lNe="MenubarRadioItem",L9=S.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Hi(n);return x.jsx(C2,{...s,...r,ref:e})});L9.displayName=lNe;var cNe="MenubarItemIndicator",$9=S.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Hi(n);return x.jsx(E2,{...s,...r,ref:e})});$9.displayName=cNe;var uNe="MenubarSeparator",F9=S.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Hi(n);return x.jsx(A2,{...s,...r,ref:e})});F9.displayName=uNe;var dNe="MenubarArrow",fNe=S.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Hi(n);return x.jsx(R2,{...s,...r,ref:e})});fNe.displayName=dNe;var hNe="MenubarSubTrigger",z9=S.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Hi(n);return x.jsx(P2,{"data-radix-menubar-subtrigger":"",...s,...r,ref:e})});z9.displayName=hNe;var pNe="MenubarSubContent",B9=S.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Hi(n);return x.jsx(N2,{...s,"data-radix-menubar-content":"",...r,ref:e,style:{...t.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});B9.displayName=pNe;function mNe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var U9=N9,H9=k9,gNe=D9,V9=M9,q9=O9,W9=j9,G9=I9,K9=L9,Y9=$9,X9=F9,Q9=z9,Z9=B9;const vNe=S.forwardRef(({className:t,...e},n)=>x.jsx(U9,{ref:n,className:ie("flex h-10 items-center space-x-1 rounded-md border bg-background p-1",t),...e}));vNe.displayName=U9.displayName;const yNe=S.forwardRef(({className:t,...e},n)=>x.jsx(H9,{ref:n,className:ie("flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t),...e}));yNe.displayName=H9.displayName;const bNe=S.forwardRef(({className:t,inset:e,children:n,...r},s)=>x.jsxs(Q9,{ref:s,className:ie("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e&&"pl-8",t),...r,children:[n,x.jsx(dy,{className:"ml-auto h-4 w-4"})]}));bNe.displayName=Q9.displayName;const xNe=S.forwardRef(({className:t,...e},n)=>x.jsx(Z9,{ref:n,className:ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground 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",t),...e}));xNe.displayName=Z9.displayName;const wNe=S.forwardRef(({className:t,align:e="start",alignOffset:n=-4,sideOffset:r=8,...s},i)=>x.jsx(gNe,{children:x.jsx(V9,{ref:i,align:e,alignOffset:n,sideOffset:r,className:ie("z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in 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",t),...s})}));wNe.displayName=V9.displayName;const _Ne=S.forwardRef(({className:t,inset:e,...n},r)=>x.jsx(W9,{ref:r,className:ie("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...n}));_Ne.displayName=W9.displayName;const SNe=S.forwardRef(({className:t,children:e,checked:n,...r},s)=>x.jsxs(G9,{ref:s,className:ie("relative flex 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),checked:n,...r,children:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(Y9,{children:x.jsx(h_,{className:"h-4 w-4"})})}),e]}));SNe.displayName=G9.displayName;const CNe=S.forwardRef(({className:t,children:e,...n},r)=>x.jsxs(K9,{ref:r,className:ie("relative flex 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),...n,children:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(Y9,{children:x.jsx(oR,{className:"h-2 w-2 fill-current"})})}),e]}));CNe.displayName=K9.displayName;const ENe=S.forwardRef(({className:t,inset:e,...n},r)=>x.jsx(q9,{ref:r,className:ie("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));ENe.displayName=q9.displayName;const ANe=S.forwardRef(({className:t,...e},n)=>x.jsx(X9,{ref:n,className:ie("-mx-1 my-1 h-px bg-muted",t),...e}));ANe.displayName=X9.displayName;var RNe="VisuallyHidden",z_=S.forwardRef((t,e)=>x.jsx(De.span,{...t,ref:e,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}}));z_.displayName=RNe;var J9=z_,Oy="NavigationMenu",[$2,eY,PNe]=Au(Oy),[eO,NNe,TNe]=Au(Oy),[F2,GUe]=jn(Oy,[PNe,TNe]),[kNe,fa]=F2(Oy),[DNe,MNe]=F2(Oy),tY=S.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:s,defaultValue:i,delayDuration:o=200,skipDelayDuration:a=300,orientation:c="horizontal",dir:d,...f}=t,[l,u]=S.useState(null),p=et(e,N=>u(N)),h=tl(d),m=S.useRef(0),y=S.useRef(0),g=S.useRef(0),[v,b]=S.useState(!0),[_="",A]=mr({prop:r,onChange:N=>{const k=N!=="",M=a>0;k?(window.clearTimeout(g.current),M&&b(!1)):(window.clearTimeout(g.current),g.current=window.setTimeout(()=>b(!0),a)),s==null||s(N)},defaultProp:i}),P=S.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>A(""),150)},[A]),T=S.useCallback(N=>{window.clearTimeout(y.current),A(N)},[A]),E=S.useCallback(N=>{_===N?window.clearTimeout(y.current):m.current=window.setTimeout(()=>{window.clearTimeout(y.current),A(N)},o)},[_,A,o]);return S.useEffect(()=>()=>{window.clearTimeout(m.current),window.clearTimeout(y.current),window.clearTimeout(g.current)},[]),x.jsx(rY,{scope:n,isRootMenu:!0,value:_,dir:h,orientation:c,rootNavigationMenu:l,onTriggerEnter:N=>{window.clearTimeout(m.current),v?E(N):T(N)},onTriggerLeave:()=>{window.clearTimeout(m.current),P()},onContentEnter:()=>window.clearTimeout(y.current),onContentLeave:P,onItemSelect:N=>{A(k=>k===N?"":N)},onItemDismiss:()=>A(""),children:x.jsx(De.nav,{"aria-label":"Main","data-orientation":c,dir:h,...f,ref:p})})});tY.displayName=Oy;var nY="NavigationMenuSub",ONe=S.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:s,defaultValue:i,orientation:o="horizontal",...a}=t,c=fa(nY,n),[d="",f]=mr({prop:r,onChange:s,defaultProp:i});return x.jsx(rY,{scope:n,isRootMenu:!1,value:d,dir:c.dir,orientation:o,rootNavigationMenu:c.rootNavigationMenu,onTriggerEnter:l=>f(l),onItemSelect:l=>f(l),onItemDismiss:()=>f(""),children:x.jsx(De.div,{"data-orientation":o,...a,ref:e})})});ONe.displayName=nY;var rY=t=>{const{scope:e,isRootMenu:n,rootNavigationMenu:r,dir:s,orientation:i,children:o,value:a,onItemSelect:c,onItemDismiss:d,onTriggerEnter:f,onTriggerLeave:l,onContentEnter:u,onContentLeave:p}=t,[h,m]=S.useState(null),[y,g]=S.useState(new Map),[v,b]=S.useState(null);return x.jsx(kNe,{scope:e,isRootMenu:n,rootNavigationMenu:r,value:a,previousValue:Sy(a),baseId:Ls(),dir:s,orientation:i,viewport:h,onViewportChange:m,indicatorTrack:v,onIndicatorTrackChange:b,onTriggerEnter:on(f),onTriggerLeave:on(l),onContentEnter:on(u),onContentLeave:on(p),onItemSelect:on(c),onItemDismiss:on(d),onViewportContentChange:S.useCallback((_,A)=>{g(P=>(P.set(_,A),new Map(P)))},[]),onViewportContentRemove:S.useCallback(_=>{g(A=>A.has(_)?(A.delete(_),new Map(A)):A)},[]),children:x.jsx($2.Provider,{scope:e,children:x.jsx(DNe,{scope:e,items:y,children:o})})})},sY="NavigationMenuList",iY=S.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=fa(sY,n),i=x.jsx(De.ul,{"data-orientation":s.orientation,...r,ref:e});return x.jsx(De.div,{style:{position:"relative"},ref:s.onIndicatorTrackChange,children:x.jsx($2.Slot,{scope:n,children:s.isRootMenu?x.jsx(hY,{asChild:!0,children:i}):i})})});iY.displayName=sY;var oY="NavigationMenuItem",[jNe,aY]=F2(oY),INe=S.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,...s}=t,i=Ls(),o=r||i||"LEGACY_REACT_AUTO_VALUE",a=S.useRef(null),c=S.useRef(null),d=S.useRef(null),f=S.useRef(()=>{}),l=S.useRef(!1),u=S.useCallback((h="start")=>{if(a.current){f.current();const m=nO(a.current);m.length&&U2(h==="start"?m:m.reverse())}},[]),p=S.useCallback(()=>{if(a.current){const h=nO(a.current);h.length&&(f.current=VNe(h))}},[]);return x.jsx(jNe,{scope:n,value:o,triggerRef:c,contentRef:a,focusProxyRef:d,wasEscapeCloseRef:l,onEntryKeyDown:u,onFocusProxyEnter:u,onRootContentClose:p,onContentFocusOutside:p,children:x.jsx(De.li,{...s,ref:e})})});INe.displayName=oY;var tO="NavigationMenuTrigger",lY=S.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,disabled:r,...s}=t,i=fa(tO,t.__scopeNavigationMenu),o=aY(tO,t.__scopeNavigationMenu),a=S.useRef(null),c=et(a,o.triggerRef,e),d=mY(i.baseId,o.value),f=gY(i.baseId,o.value),l=S.useRef(!1),u=S.useRef(!1),p=o.value===i.value;return x.jsxs(x.Fragment,{children:[x.jsx($2.ItemSlot,{scope:n,value:o.value,children:x.jsx(pY,{asChild:!0,children:x.jsx(De.button,{id:d,disabled:r,"data-disabled":r?"":void 0,"data-state":H2(p),"aria-expanded":p,"aria-controls":f,...s,ref:c,onPointerEnter:ye(t.onPointerEnter,()=>{u.current=!1,o.wasEscapeCloseRef.current=!1}),onPointerMove:ye(t.onPointerMove,jE(()=>{r||u.current||o.wasEscapeCloseRef.current||l.current||(i.onTriggerEnter(o.value),l.current=!0)})),onPointerLeave:ye(t.onPointerLeave,jE(()=>{r||(i.onTriggerLeave(),l.current=!1)})),onClick:ye(t.onClick,()=>{i.onItemSelect(o.value),u.current=p}),onKeyDown:ye(t.onKeyDown,h=>{const y={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];p&&h.key===y&&(o.onEntryKeyDown(),h.preventDefault())})})})}),p&&x.jsxs(x.Fragment,{children:[x.jsx(J9,{"aria-hidden":!0,tabIndex:0,ref:o.focusProxyRef,onFocus:h=>{const m=o.contentRef.current,y=h.relatedTarget,g=y===a.current,v=m==null?void 0:m.contains(y);(g||!v)&&o.onFocusProxyEnter(g?"start":"end")}}),i.viewport&&x.jsx("span",{"aria-owns":f})]})]})});lY.displayName=tO;var LNe="NavigationMenuLink",L5="navigationMenu.linkSelect",$Ne=S.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,active:r,onSelect:s,...i}=t;return x.jsx(pY,{asChild:!0,children:x.jsx(De.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...i,ref:e,onClick:ye(t.onClick,o=>{const a=o.target,c=new CustomEvent(L5,{bubbles:!0,cancelable:!0});if(a.addEventListener(L5,d=>s==null?void 0:s(d),{once:!0}),sx(a,c),!c.defaultPrevented&&!o.metaKey){const d=new CustomEvent(uC,{bubbles:!0,cancelable:!0});sx(a,d)}},{checkForDefaultPrevented:!1})})})});$Ne.displayName=LNe;var z2="NavigationMenuIndicator",cY=S.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=fa(z2,t.__scopeNavigationMenu),i=!!s.value;return s.indicatorTrack?XA.createPortal(x.jsx(Kn,{present:n||i,children:x.jsx(FNe,{...r,ref:e})}),s.indicatorTrack):null});cY.displayName=z2;var FNe=S.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=fa(z2,n),i=eY(n),[o,a]=S.useState(null),[c,d]=S.useState(null),f=s.orientation==="horizontal",l=!!s.value;S.useEffect(()=>{var m;const h=(m=i().find(y=>y.value===s.value))==null?void 0:m.ref.current;h&&a(h)},[i,s.value]);const u=()=>{o&&d({size:f?o.offsetWidth:o.offsetHeight,offset:f?o.offsetLeft:o.offsetTop})};return rO(o,u),rO(s.indicatorTrack,u),c?x.jsx(De.div,{"aria-hidden":!0,"data-state":l?"visible":"hidden","data-orientation":s.orientation,...r,ref:e,style:{position:"absolute",...f?{left:0,width:c.size+"px",transform:`translateX(${c.offset}px)`}:{top:0,height:c.size+"px",transform:`translateY(${c.offset}px)`},...r.style}}):null}),Wv="NavigationMenuContent",uY=S.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=fa(Wv,t.__scopeNavigationMenu),i=aY(Wv,t.__scopeNavigationMenu),o=et(i.contentRef,e),a=i.value===s.value,c={value:i.value,triggerRef:i.triggerRef,focusProxyRef:i.focusProxyRef,wasEscapeCloseRef:i.wasEscapeCloseRef,onContentFocusOutside:i.onContentFocusOutside,onRootContentClose:i.onRootContentClose,...r};return s.viewport?x.jsx(zNe,{forceMount:n,...c,ref:o}):x.jsx(Kn,{present:n||a,children:x.jsx(dY,{"data-state":H2(a),...c,ref:o,onPointerEnter:ye(t.onPointerEnter,s.onContentEnter),onPointerLeave:ye(t.onPointerLeave,jE(s.onContentLeave)),style:{pointerEvents:!a&&s.isRootMenu?"none":void 0,...c.style}})})});uY.displayName=Wv;var zNe=S.forwardRef((t,e)=>{const n=fa(Wv,t.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:s}=n;return ir(()=>{r(t.value,{ref:e,...t})},[t,e,r]),ir(()=>()=>s(t.value),[t.value,s]),null}),uC="navigationMenu.rootContentDismiss",dY=S.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:s,focusProxyRef:i,wasEscapeCloseRef:o,onRootContentClose:a,onContentFocusOutside:c,...d}=t,f=fa(Wv,n),l=S.useRef(null),u=et(l,e),p=mY(f.baseId,r),h=gY(f.baseId,r),m=eY(n),y=S.useRef(null),{onItemDismiss:g}=f;S.useEffect(()=>{const b=l.current;if(f.isRootMenu&&b){const _=()=>{var A;g(),a(),b.contains(document.activeElement)&&((A=s.current)==null||A.focus())};return b.addEventListener(uC,_),()=>b.removeEventListener(uC,_)}},[f.isRootMenu,t.value,s,g,a]);const v=S.useMemo(()=>{const _=m().map(k=>k.value);f.dir==="rtl"&&_.reverse();const A=_.indexOf(f.value),P=_.indexOf(f.previousValue),T=r===f.value,E=P===_.indexOf(r);if(!T&&!E)return y.current;const N=(()=>{if(A!==P){if(T&&P!==-1)return A>P?"from-end":"from-start";if(E&&A!==-1)return A>P?"to-start":"to-end"}return null})();return y.current=N,N},[f.previousValue,f.value,f.dir,m,r]);return x.jsx(hY,{asChild:!0,children:x.jsx(Pu,{id:h,"aria-labelledby":p,"data-motion":v,"data-orientation":f.orientation,...d,ref:u,disableOutsidePointerEvents:!1,onDismiss:()=>{var _;const b=new Event(uC,{bubbles:!0,cancelable:!0});(_=l.current)==null||_.dispatchEvent(b)},onFocusOutside:ye(t.onFocusOutside,b=>{var A;c();const _=b.target;(A=f.rootNavigationMenu)!=null&&A.contains(_)&&b.preventDefault()}),onPointerDownOutside:ye(t.onPointerDownOutside,b=>{var T;const _=b.target,A=m().some(E=>{var N;return(N=E.ref.current)==null?void 0:N.contains(_)}),P=f.isRootMenu&&((T=f.viewport)==null?void 0:T.contains(_));(A||P||!f.isRootMenu)&&b.preventDefault()}),onKeyDown:ye(t.onKeyDown,b=>{var P;const _=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!_){const T=nO(b.currentTarget),E=document.activeElement,N=T.findIndex(j=>j===E),M=b.shiftKey?T.slice(0,N).reverse():T.slice(N+1,T.length);U2(M)?b.preventDefault():(P=i.current)==null||P.focus()}}),onEscapeKeyDown:ye(t.onEscapeKeyDown,b=>{o.current=!0})})})}),B2="NavigationMenuViewport",fY=S.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=!!fa(B2,t.__scopeNavigationMenu).value;return x.jsx(Kn,{present:n||i,children:x.jsx(BNe,{...r,ref:e})})});fY.displayName=B2;var BNe=S.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,children:r,...s}=t,i=fa(B2,n),o=et(e,i.onViewportChange),a=MNe(Wv,t.__scopeNavigationMenu),[c,d]=S.useState(null),[f,l]=S.useState(null),u=c?(c==null?void 0:c.width)+"px":void 0,p=c?(c==null?void 0:c.height)+"px":void 0,h=!!i.value,m=h?i.value:i.previousValue;return rO(f,()=>{f&&d({width:f.offsetWidth,height:f.offsetHeight})}),x.jsx(De.div,{"data-state":H2(h),"data-orientation":i.orientation,...s,ref:o,style:{pointerEvents:!h&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":u,"--radix-navigation-menu-viewport-height":p,...s.style},onPointerEnter:ye(t.onPointerEnter,i.onContentEnter),onPointerLeave:ye(t.onPointerLeave,jE(i.onContentLeave)),children:Array.from(a.items).map(([g,{ref:v,forceMount:b,..._}])=>{const A=m===g;return x.jsx(Kn,{present:b||A,children:x.jsx(dY,{..._,ref:f_(v,P=>{A&&P&&l(P)})})},g)})})}),UNe="FocusGroup",hY=S.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=fa(UNe,n);return x.jsx(eO.Provider,{scope:n,children:x.jsx(eO.Slot,{scope:n,children:x.jsx(De.div,{dir:s.dir,...r,ref:e})})})}),$5=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],HNe="FocusGroupItem",pY=S.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=NNe(n),i=fa(HNe,n);return x.jsx(eO.ItemSlot,{scope:n,children:x.jsx(De.button,{...r,ref:e,onKeyDown:ye(t.onKeyDown,o=>{if(["Home","End",...$5].includes(o.key)){let c=s().map(l=>l.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(o.key)&&c.reverse(),$5.includes(o.key)){const l=c.indexOf(o.currentTarget);c=c.slice(l+1)}setTimeout(()=>U2(c)),o.preventDefault()}})})})});function nO(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function U2(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}function VNe(t){return t.forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}),()=>{t.forEach(e=>{const n=e.dataset.tabindex;e.setAttribute("tabindex",n)})}}function rO(t,e){const n=on(e);ir(()=>{let r=0;if(t){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(t),()=>{window.cancelAnimationFrame(r),s.unobserve(t)}}},[t,n])}function H2(t){return t?"open":"closed"}function mY(t,e){return`${t}-trigger-${e}`}function gY(t,e){return`${t}-content-${e}`}function jE(t){return e=>e.pointerType==="mouse"?t(e):void 0}var vY=tY,yY=iY,bY=lY,xY=cY,wY=uY,_Y=fY;const qNe=S.forwardRef(({className:t,children:e,...n},r)=>x.jsxs(vY,{ref:r,className:ie("relative z-10 flex max-w-max flex-1 items-center justify-center",t),...n,children:[e,x.jsx(SY,{})]}));qNe.displayName=vY.displayName;const WNe=S.forwardRef(({className:t,...e},n)=>x.jsx(yY,{ref:n,className:ie("group flex flex-1 list-none items-center justify-center space-x-1",t),...e}));WNe.displayName=yY.displayName;const GNe=li("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"),KNe=S.forwardRef(({className:t,children:e,...n},r)=>x.jsxs(bY,{ref:r,className:ie(GNe(),"group",t),...n,children:[e," ",x.jsx(uy,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));KNe.displayName=bY.displayName;const YNe=S.forwardRef(({className:t,...e},n)=>x.jsx(wY,{ref:n,className:ie("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",t),...e}));YNe.displayName=wY.displayName;const SY=S.forwardRef(({className:t,...e},n)=>x.jsx("div",{className:ie("absolute left-0 top-full flex justify-center"),children:x.jsx(_Y,{className:ie("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",t),ref:n,...e})}));SY.displayName=_Y.displayName;const XNe=S.forwardRef(({className:t,...e},n)=>x.jsx(xY,{ref:n,className:ie("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",t),...e,children:x.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));XNe.displayName=xY.displayName;var QNe=typeof window>"u",sO=QNe?oe.useEffect:oe.useLayoutEffect,ZNe=0,F5=()=>++ZNe,z5=!1;function JNe(){let[t,e]=oe.useState(z5?F5:void 0);return sO(()=>{t===void 0&&e(F5()),z5=!0},[]),t===void 0?t:`rwb-${t.toString(32)}`}function eTe(){return oe.useMemo(()=>"useId"in oe?oe.useId:JNe,[])()}var iO="__wrap_b",E0="__wrap_n",B5="__wrap_o",CY=(t,e,n)=>{n=n||document.querySelector(`[data-br="${t}"]`);let r=n==null?void 0:n.parentElement;if(!r)return;let s=f=>n.style.maxWidth=f+"px";n.style.maxWidth="";let i=r.clientWidth,o=r.clientHeight,a=i/2-.25,c=i+.5,d;if(i){for(s(a),a=Math.max(n.scrollWidth,a);a+1{self.__wrap_b(0,+n.dataset.brr,n)})).observe(r)},tTe=CY.toString(),nTe='(self.CSS&&CSS.supports("text-wrap","balance")?1:2)',rTe=(t,e,n="")=>(n&&(n=`self.${E0}!=1&&${n}`),oe.createElement("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:(t?"":`self.${E0}=self.${E0}||${nTe};self.${iO}=${tTe};`)+n},nonce:e})),sTe=oe.createContext({preferNative:!0,hasProvider:!1});oe.forwardRef(({ratio:t=1,preferNative:e,nonce:n,children:r,as:s,...i},o)=>{let a=eTe(),c=oe.useRef(),d=oe.useContext(sTe),f=e??d.preferNative,l=s||"span";return oe.useImperativeHandle(o,()=>c.current,[]),sO(()=>{f&&self[E0]===1||c.current&&(self[iO]=CY)(0,t,c.current)},[r,f,t]),sO(()=>{if(!(f&&self[E0]===1))return()=>{if(!c.current)return;let u=c.current[B5];u&&(u.disconnect(),delete c.current[B5])}},[f]),oe.createElement(oe.Fragment,null,oe.createElement(l,{...i,"data-br":a,"data-brr":t,ref:c,style:{display:"inline-block",verticalAlign:"top",textDecoration:"inherit",textWrap:f?"balance":"initial"},suppressHydrationWarning:!0},r),rTe(d.hasProvider,n,`self.${iO}("${a}",${t})`))});var iTe="Separator",U5="horizontal",oTe=["horizontal","vertical"],EY=S.forwardRef((t,e)=>{const{decorative:n,orientation:r=U5,...s}=t,i=aTe(r)?r:U5,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return x.jsx(De.div,{"data-orientation":i,...a,...s,ref:e})});EY.displayName=iTe;function aTe(t){return oTe.includes(t)}var AY=EY;const lu=S.forwardRef(({className:t,orientation:e="horizontal",decorative:n=!0,...r},s)=>x.jsx(AY,{ref:s,decorative:n,orientation:e,className:ie("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));lu.displayName=AY.displayName;const lTe=S.forwardRef(({className:t,...e},n)=>x.jsx("ul",{ref:n,className:ie("flex flex-row items-center gap-1",t),...e}));lTe.displayName="PaginationContent";const cTe=S.forwardRef(({className:t,...e},n)=>x.jsx("li",{ref:n,className:ie("",t),...e}));cTe.displayName="PaginationItem";var V2="Popover",[RY,KUe]=jn(V2,[ec]),B_=ec(),[uTe,_f]=RY(V2),PY=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!1}=t,a=B_(e),c=S.useRef(null),[d,f]=S.useState(!1),[l=!1,u]=mr({prop:r,defaultProp:s,onChange:i});return x.jsx(BR,{...a,children:x.jsx(uTe,{scope:e,contentId:Ls(),triggerRef:c,open:l,onOpenChange:u,onOpenToggle:S.useCallback(()=>u(p=>!p),[u]),hasCustomAnchor:d,onCustomAnchorAdd:S.useCallback(()=>f(!0),[]),onCustomAnchorRemove:S.useCallback(()=>f(!1),[]),modal:o,children:n})})};PY.displayName=V2;var NY="PopoverAnchor",dTe=S.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=_f(NY,n),i=B_(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=s;return S.useEffect(()=>(o(),()=>a()),[o,a]),x.jsx(Ty,{...i,...r,ref:e})});dTe.displayName=NY;var TY="PopoverTrigger",kY=S.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=_f(TY,n),i=B_(n),o=et(e,s.triggerRef),a=x.jsx(De.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":IY(s.open),...r,ref:o,onClick:ye(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?a:x.jsx(Ty,{asChild:!0,...i,children:a})});kY.displayName=TY;var q2="PopoverPortal",[fTe,hTe]=RY(q2,{forceMount:void 0}),DY=t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=_f(q2,e);return x.jsx(fTe,{scope:e,forceMount:n,children:x.jsx(Kn,{present:n||i.open,children:x.jsx(py,{asChild:!0,container:s,children:r})})})};DY.displayName=q2;var Gv="PopoverContent",MY=S.forwardRef((t,e)=>{const n=hTe(Gv,t.__scopePopover),{forceMount:r=n.forceMount,...s}=t,i=_f(Gv,t.__scopePopover);return x.jsx(Kn,{present:r||i.open,children:i.modal?x.jsx(pTe,{...s,ref:e}):x.jsx(mTe,{...s,ref:e})})});MY.displayName=Gv;var pTe=S.forwardRef((t,e)=>{const n=_f(Gv,t.__scopePopover),r=S.useRef(null),s=et(e,r),i=S.useRef(!1);return S.useEffect(()=>{const o=r.current;if(o)return g_(o)},[]),x.jsx(m_,{as:Ya,allowPinchZoom:!0,children:x.jsx(OY,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ye(t.onCloseAutoFocus,o=>{var a;o.preventDefault(),i.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:ye(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,d=a.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:ye(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),mTe=S.forwardRef((t,e)=>{const n=_f(Gv,t.__scopePopover),r=S.useRef(!1),s=S.useRef(!1);return x.jsx(OY,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,d;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),OY=S.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,...l}=t,u=_f(Gv,n),p=B_(n);return lR(),x.jsx(p_,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:x.jsx(Pu,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:f,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>u.onOpenChange(!1),children:x.jsx(R_,{"data-state":IY(u.open),role:"dialog",id:u.contentId,...p,...l,ref:e,style:{...l.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),jY="PopoverClose",gTe=S.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=_f(jY,n);return x.jsx(De.button,{type:"button",...r,ref:e,onClick:ye(t.onClick,()=>s.onOpenChange(!1))})});gTe.displayName=jY;var vTe="PopoverArrow",yTe=S.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=B_(n);return x.jsx(P_,{...s,...r,ref:e})});yTe.displayName=vTe;function IY(t){return t?"open":"closed"}var bTe=PY,xTe=kY,wTe=DY,LY=MY;const _Te=bTe,STe=xTe,$Y=S.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},s)=>x.jsx(wTe,{children:x.jsx(LY,{ref:s,align:e,sideOffset:n,className:ie("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));$Y.displayName=LY.displayName;var W2="Progress",G2=100,[CTe,YUe]=jn(W2),[ETe,ATe]=CTe(W2),FY=S.forwardRef((t,e)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:i=RTe,...o}=t;(s||s===0)&&!H5(s)&&console.error(PTe(`${s}`,"Progress"));const a=H5(s)?s:G2;r!==null&&!V5(r,a)&&console.error(NTe(`${r}`,"Progress"));const c=V5(r,a)?r:null,d=IE(c)?i(c,a):void 0;return x.jsx(ETe,{scope:n,value:c,max:a,children:x.jsx(De.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":IE(c)?c:void 0,"aria-valuetext":d,role:"progressbar","data-state":UY(c,a),"data-value":c??void 0,"data-max":a,...o,ref:e})})});FY.displayName=W2;var zY="ProgressIndicator",BY=S.forwardRef((t,e)=>{const{__scopeProgress:n,...r}=t,s=ATe(zY,n);return x.jsx(De.div,{"data-state":UY(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:e})});BY.displayName=zY;function RTe(t,e){return`${Math.round(t/e*100)}%`}function UY(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function IE(t){return typeof t=="number"}function H5(t){return IE(t)&&!isNaN(t)&&t>0}function V5(t,e){return IE(t)&&!isNaN(t)&&t<=e&&t>=0}function PTe(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${G2}\`.`}function NTe(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be: - a positive number - less than the value passed to \`max\` (or ${G2} if no \`max\` prop is set) - \`null\` or \`undefined\` if the progress is indeterminate. Defaulting to \`null\`.`}var HY=FY,TTe=BY;const K2=S.forwardRef(({className:t,value:e,...n},r)=>x.jsx(HY,{ref:r,className:ie("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...n,children:x.jsx(TTe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));K2.displayName=HY.displayName;var Y2="Radio",[kTe,VY]=jn(Y2),[DTe,MTe]=kTe(Y2),qY=S.forwardRef((t,e)=>{const{__scopeRadio:n,name:r,checked:s=!1,required:i,disabled:o,value:a="on",onCheck:c,...d}=t,[f,l]=S.useState(null),u=et(e,m=>l(m)),p=S.useRef(!1),h=f?!!f.closest("form"):!0;return x.jsxs(DTe,{scope:n,checked:s,disabled:o,children:[x.jsx(De.button,{type:"button",role:"radio","aria-checked":s,"data-state":KY(s),"data-disabled":o?"":void 0,disabled:o,value:a,...d,ref:u,onClick:ye(t.onClick,m=>{s||c==null||c(),h&&(p.current=m.isPropagationStopped(),p.current||m.stopPropagation())})}),h&&x.jsx(OTe,{control:f,bubbles:!p.current,name:r,value:a,checked:s,required:i,disabled:o,style:{transform:"translateX(-100%)"}})]})});qY.displayName=Y2;var WY="RadioIndicator",GY=S.forwardRef((t,e)=>{const{__scopeRadio:n,forceMount:r,...s}=t,i=MTe(WY,n);return x.jsx(Kn,{present:r||i.checked,children:x.jsx(De.span,{"data-state":KY(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:e})})});GY.displayName=WY;var OTe=t=>{const{control:e,checked:n,bubbles:r=!0,...s}=t,i=S.useRef(null),o=Sy(n),a=__(e);return S.useEffect(()=>{const c=i.current,d=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(d,"checked").set;if(o!==n&&l){const u=new Event("click",{bubbles:r});l.call(c,n),c.dispatchEvent(u)}},[o,n,r]),x.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:i,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function KY(t){return t?"checked":"unchecked"}var jTe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],X2="RadioGroup",[ITe,XUe]=jn(X2,[tc,VY]),YY=tc(),XY=VY(),[LTe,$Te]=ITe(X2),QY=S.forwardRef((t,e)=>{const{__scopeRadioGroup:n,name:r,defaultValue:s,value:i,required:o=!1,disabled:a=!1,orientation:c,dir:d,loop:f=!0,onValueChange:l,...u}=t,p=YY(n),h=tl(d),[m,y]=mr({prop:i,defaultProp:s,onChange:l});return x.jsx(LTe,{scope:n,name:r,required:o,disabled:a,value:m,onValueChange:y,children:x.jsx(N_,{asChild:!0,...p,orientation:c,dir:h,loop:f,children:x.jsx(De.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":a?"":void 0,dir:h,...u,ref:e})})})});QY.displayName=X2;var ZY="RadioGroupItem",JY=S.forwardRef((t,e)=>{const{__scopeRadioGroup:n,disabled:r,...s}=t,i=$Te(ZY,n),o=i.disabled||r,a=YY(n),c=XY(n),d=S.useRef(null),f=et(e,d),l=i.value===s.value,u=S.useRef(!1);return S.useEffect(()=>{const p=m=>{jTe.includes(m.key)&&(u.current=!0)},h=()=>u.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",h),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",h)}},[]),x.jsx(T_,{asChild:!0,...a,focusable:!o,active:l,children:x.jsx(qY,{disabled:o,required:i.required,checked:l,...c,...s,name:i.name,ref:f,onCheck:()=>i.onValueChange(s.value),onKeyDown:ye(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:ye(s.onFocus,()=>{var p;u.current&&((p=d.current)==null||p.click())})})})});JY.displayName=ZY;var FTe="RadioGroupIndicator",eX=S.forwardRef((t,e)=>{const{__scopeRadioGroup:n,...r}=t,s=XY(n);return x.jsx(GY,{...s,...r,ref:e})});eX.displayName=FTe;var tX=QY,nX=JY,zTe=eX;const BTe=S.forwardRef(({className:t,...e},n)=>x.jsx(tX,{className:ie("grid gap-2",t),...e,ref:n}));BTe.displayName=tX.displayName;const UTe=S.forwardRef(({className:t,...e},n)=>x.jsx(nX,{ref:n,className:ie("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:x.jsx(zTe,{className:"flex items-center justify-center",children:x.jsx(oR,{className:"h-2.5 w-2.5 fill-current text-current"})})}));UTe.displayName=nX.displayName;const{createElement:Kv,createContext:HTe,createRef:QUe,forwardRef:rX,useCallback:yi,useContext:sX,useEffect:pp,useImperativeHandle:iX,useLayoutEffect:VTe,useMemo:qTe,useRef:Ai,useState:gg}=a_,q5=a_[`useId${Math.random()}`.slice(0,5)],WTe=VTe,XR=HTe(null);XR.displayName="PanelGroupContext";const mp=WTe,GTe=typeof q5=="function"?q5:()=>null;let KTe=0;function Q2(t=null){const e=GTe(),n=Ai(t||e||null);return n.current===null&&(n.current=""+KTe++),t??n.current}function oX({children:t,className:e="",collapsedSize:n,collapsible:r,defaultSize:s,forwardedRef:i,id:o,maxSize:a,minSize:c,onCollapse:d,onExpand:f,onResize:l,order:u,style:p,tagName:h="div",...m}){const y=sX(XR);if(y===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:g,expandPanel:v,getPanelSize:b,getPanelStyle:_,groupId:A,isPanelCollapsed:P,reevaluatePanelConstraints:T,registerPanel:E,resizePanel:N,unregisterPanel:k}=y,M=Q2(o),j=Ai({callbacks:{onCollapse:d,onExpand:f,onResize:l},constraints:{collapsedSize:n,collapsible:r,defaultSize:s,maxSize:a,minSize:c},id:M,idIsFromProps:o!==void 0,order:u});Ai({didLogMissingDefaultSizeWarning:!1}),mp(()=>{const{callbacks:L,constraints:H}=j.current,K={...H};j.current.id=M,j.current.idIsFromProps=o!==void 0,j.current.order=u,L.onCollapse=d,L.onExpand=f,L.onResize=l,H.collapsedSize=n,H.collapsible=r,H.defaultSize=s,H.maxSize=a,H.minSize=c,(K.collapsedSize!==H.collapsedSize||K.collapsible!==H.collapsible||K.maxSize!==H.maxSize||K.minSize!==H.minSize)&&T(j.current,K)}),mp(()=>{const L=j.current;return E(L),()=>{k(L)}},[u,M,E,k]),iX(i,()=>({collapse:()=>{g(j.current)},expand:L=>{v(j.current,L)},getId(){return M},getSize(){return b(j.current)},isCollapsed(){return P(j.current)},isExpanded(){return!P(j.current)},resize:L=>{N(j.current,L)}}),[g,v,b,P,M,N]);const I=_(j.current,s);return Kv(h,{...m,children:t,className:e,id:o,style:{...I,...p},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":A,"data-panel-id":M,"data-panel-size":parseFloat(""+I.flexGrow).toFixed(1)})}const aX=rX((t,e)=>Kv(oX,{...t,forwardedRef:e}));oX.displayName="Panel";aX.displayName="forwardRef(Panel)";let oO=null,oh=null;function YTe(t,e){if(e){const n=(e&fX)!==0,r=(e&hX)!==0,s=(e&pX)!==0,i=(e&mX)!==0;if(n)return s?"se-resize":i?"ne-resize":"e-resize";if(r)return s?"sw-resize":i?"nw-resize":"w-resize";if(s)return"s-resize";if(i)return"n-resize"}switch(t){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function XTe(){oh!==null&&(document.head.removeChild(oh),oO=null,oh=null)}function kk(t,e){const n=YTe(t,e);oO!==n&&(oO=n,oh===null&&(oh=document.createElement("style"),document.head.appendChild(oh)),oh.innerHTML=`*{cursor: ${n}!important;}`)}function lX(t){return t.type==="keydown"}function cX(t){return t.type.startsWith("pointer")}function uX(t){return t.type.startsWith("mouse")}function QR(t){if(cX(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(uX(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function QTe(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function ZTe(t,e,n){return t.xe.x&&t.ye.y}function JTe(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:K5(t),b:K5(e)};let r;for(;n.a.at(-1)===n.b.at(-1);)t=n.a.pop(),e=n.b.pop(),r=t;jt(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:G5(W5(n.a)),b:G5(W5(n.b))};if(s.a===s.b){const i=r.childNodes,o={a:n.a.at(-1),b:n.b.at(-1)};let a=i.length;for(;a--;){const c=i[a];if(c===o.a)return 1;if(c===o.b)return-1}}return Math.sign(s.a-s.b)}const eke=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function tke(t){var e;const n=getComputedStyle((e=dX(t))!==null&&e!==void 0?e:t).display;return n==="flex"||n==="inline-flex"}function nke(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||tke(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||eke.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function W5(t){let e=t.length;for(;e--;){const n=t[e];if(jt(n,"Missing node"),nke(n))return n}return null}function G5(t){return t&&Number(getComputedStyle(t).zIndex)||0}function K5(t){const e=[];for(;t;)e.push(t),t=dX(t);return e}function dX(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const fX=1,hX=2,pX=4,mX=8,rke=QTe()==="coarse";let qa=[],mx=!1,cd=new Map,ZR=new Map;const gx=new Set;function ske(t,e,n,r,s){var i;const{ownerDocument:o}=e,a={direction:n,element:e,hitAreaMargins:r,setResizeHandlerState:s},c=(i=cd.get(o))!==null&&i!==void 0?i:0;return cd.set(o,c+1),gx.add(a),LE(),function(){var f;ZR.delete(t),gx.delete(a);const l=(f=cd.get(o))!==null&&f!==void 0?f:1;if(cd.set(o,l-1),LE(),l===1&&cd.delete(o),qa.includes(a)){const u=qa.indexOf(a);u>=0&&qa.splice(u,1),J2()}}}function Y5(t){const{target:e}=t,{x:n,y:r}=QR(t);mx=!0,Z2({target:e,x:n,y:r}),LE(),qa.length>0&&($E("down",t),t.preventDefault(),t.stopPropagation())}function Pb(t){const{x:e,y:n}=QR(t);if(t.buttons===0&&(mx=!1,$E("up",t)),!mx){const{target:r}=t;Z2({target:r,x:e,y:n})}$E("move",t),J2(),qa.length>0&&t.preventDefault()}function Cm(t){const{target:e}=t,{x:n,y:r}=QR(t);ZR.clear(),mx=!1,qa.length>0&&t.preventDefault(),$E("up",t),Z2({target:e,x:n,y:r}),J2(),LE()}function Z2({target:t,x:e,y:n}){qa.splice(0);let r=null;t instanceof HTMLElement&&(r=t),gx.forEach(s=>{const{element:i,hitAreaMargins:o}=s,a=i.getBoundingClientRect(),{bottom:c,left:d,right:f,top:l}=a,u=rke?o.coarse:o.fine;if(e>=d-u&&e<=f+u&&n>=l-u&&n<=c+u){if(r!==null&&i!==r&&!i.contains(r)&&!r.contains(i)&&JTe(r,i)>0){let h=r,m=!1;for(;h&&!h.contains(i);){if(ZTe(h.getBoundingClientRect(),a)){m=!0;break}h=h.parentElement}if(m)return}qa.push(s)}})}function Dk(t,e){ZR.set(t,e)}function J2(){let t=!1,e=!1;qa.forEach(r=>{const{direction:s}=r;s==="horizontal"?t=!0:e=!0});let n=0;ZR.forEach(r=>{n|=r}),t&&e?kk("intersection",n):t?kk("horizontal",n):e?kk("vertical",n):XTe()}function LE(){cd.forEach((t,e)=>{const{body:n}=e;n.removeEventListener("contextmenu",Cm),n.removeEventListener("pointerdown",Y5),n.removeEventListener("pointerleave",Pb),n.removeEventListener("pointermove",Pb)}),window.removeEventListener("pointerup",Cm),window.removeEventListener("pointercancel",Cm),gx.size>0&&(mx?(qa.length>0&&cd.forEach((t,e)=>{const{body:n}=e;t>0&&(n.addEventListener("contextmenu",Cm),n.addEventListener("pointerleave",Pb),n.addEventListener("pointermove",Pb))}),window.addEventListener("pointerup",Cm),window.addEventListener("pointercancel",Cm)):cd.forEach((t,e)=>{const{body:n}=e;t>0&&(n.addEventListener("pointerdown",Y5,{capture:!0}),n.addEventListener("pointermove",Pb))}))}function $E(t,e){gx.forEach(n=>{const{setResizeHandlerState:r}=n,s=qa.includes(n);r(t,s,e)})}function ike(){const[t,e]=gg(0);return yi(()=>e(n=>n+1),[])}function jt(t,e){if(!t)throw console.error(e),Error(e)}const e$=10;function Tp(t,e,n=e$){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function tu(t,e,n=e$){return Tp(t,e,n)===0}function ho(t,e,n){return Tp(t,e,n)===0}function oke(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r0&&(t=t<0?0-g:g)}}}{const l=t<0?a:c,u=n[l];jt(u,`No panel constraints found for index ${l}`);const{collapsedSize:p=0,collapsible:h,minSize:m=0}=u;if(h){const y=e[l];if(jt(y!=null,`Previous layout not found for panel index ${l}`),ho(y,m)){const g=y-p;Tp(g,Math.abs(t))>0&&(t=t<0?0-g:g)}}}}{const l=t<0?1:-1;let u=t<0?c:a,p=0;for(;;){const m=e[u];jt(m!=null,`Previous layout not found for panel index ${u}`);const g=Jm({panelConstraints:n,panelIndex:u,size:100})-m;if(p+=g,u+=l,u<0||u>=n.length)break}const h=Math.min(Math.abs(t),Math.abs(p));t=t<0?0-h:h}{let u=t<0?a:c;for(;u>=0&&u=0))break;t<0?u--:u++}}if(oke(s,o))return s;{const l=t<0?c:a,u=e[l];jt(u!=null,`Previous layout not found for panel index ${l}`);const p=u+d,h=Jm({panelConstraints:n,panelIndex:l,size:p});if(o[l]=h,!ho(h,p)){let m=p-h,g=t<0?c:a;for(;g>=0&&g0?g--:g++}}}const f=o.reduce((l,u)=>u+l,0);return ho(f,100)?o:s}function ake({layout:t,panelsArray:e,pivotIndices:n}){let r=0,s=100,i=0,o=0;const a=n[0];jt(a!=null,"No pivot index found"),e.forEach((l,u)=>{const{constraints:p}=l,{maxSize:h=100,minSize:m=0}=p;u===a?(r=m,s=h):(i+=m,o+=h)});const c=Math.min(s,100-i),d=Math.max(r,100-o),f=t[a];return{valueMax:c,valueMin:d,valueNow:f}}function vx(t,e=document){return Array.from(e.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${t}"]`))}function gX(t,e,n=document){const s=vx(t,n).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===e);return s??null}function vX(t,e,n){const r=gX(t,e,n);return r!=null?[r,r+1]:[-1,-1]}function yX(t,e=document){var n;if(e instanceof HTMLElement&&(e==null||(n=e.dataset)===null||n===void 0?void 0:n.panelGroupId)==t)return e;const r=e.querySelector(`[data-panel-group][data-panel-group-id="${t}"]`);return r||null}function JR(t,e=document){const n=e.querySelector(`[data-panel-resize-handle-id="${t}"]`);return n||null}function lke(t,e,n,r=document){var s,i,o,a;const c=JR(e,r),d=vx(t,r),f=c?d.indexOf(c):-1,l=(s=(i=n[f])===null||i===void 0?void 0:i.id)!==null&&s!==void 0?s:null,u=(o=(a=n[f+1])===null||a===void 0?void 0:a.id)!==null&&o!==void 0?o:null;return[l,u]}function cke({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:r,panelDataArray:s,panelGroupElement:i,setLayout:o}){Ai({didWarnAboutMissingResizeHandle:!1}),mp(()=>{if(!i)return;const a=vx(n,i);for(let c=0;c{a.forEach((c,d)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[n,r,s,i]),pp(()=>{if(!i)return;const a=e.current;jt(a,"Eager values not found");const{panelDataArray:c}=a,d=yX(n,i);jt(d!=null,`No group found for id "${n}"`);const f=vx(n,i);jt(f,`No resize handles found for group id "${n}"`);const l=f.map(u=>{const p=u.getAttribute("data-panel-resize-handle-id");jt(p,"Resize handle element has no handle id attribute");const[h,m]=lke(n,p,c,i);if(h==null||m==null)return()=>{};const y=g=>{if(!g.defaultPrevented)switch(g.key){case"Enter":{g.preventDefault();const v=c.findIndex(b=>b.id===h);if(v>=0){const b=c[v];jt(b,`No panel data found for index ${v}`);const _=r[v],{collapsedSize:A=0,collapsible:P,minSize:T=0}=b.constraints;if(_!=null&&P){const E=Wb({delta:ho(_,A)?T-A:A-_,initialLayout:r,panelConstraints:c.map(N=>N.constraints),pivotIndices:vX(n,p,i),prevLayout:r,trigger:"keyboard"});r!==E&&o(E)}}break}}};return u.addEventListener("keydown",y),()=>{u.removeEventListener("keydown",y)}});return()=>{l.forEach(u=>u())}},[i,t,e,n,r,s,o])}function X5(t,e){if(t.length!==e.length)return!1;for(let n=0;ni.constraints);let r=0,s=100;for(let i=0;i{const i=t[s];jt(i,`Panel data not found for index ${s}`);const{callbacks:o,constraints:a,id:c}=i,{collapsedSize:d=0,collapsible:f}=a,l=n[c];if(l==null||r!==l){n[c]=r;const{onCollapse:u,onExpand:p,onResize:h}=o;h&&h(r,l),f&&(u||p)&&(p&&(l==null||tu(l,d))&&!tu(r,d)&&p(),u&&(l==null||!tu(l,d))&&tu(r,d)&&u())}})}function A1(t,e){if(t.length!==e.length)return!1;for(let n=0;n{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...s)},e)}}function Q5(t){try{if(typeof localStorage<"u")t.getItem=e=>localStorage.getItem(e),t.setItem=(e,n)=>{localStorage.setItem(e,n)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),t.getItem=()=>null,t.setItem=()=>{}}}function xX(t){return`react-resizable-panels:${t}`}function wX(t){return t.map(e=>{const{constraints:n,id:r,idIsFromProps:s,order:i}=e;return s?r:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((e,n)=>e.localeCompare(n)).join(",")}function _X(t,e){try{const n=xX(t),r=e.getItem(n);if(r){const s=JSON.parse(r);if(typeof s=="object"&&s!=null)return s}}catch{}return null}function mke(t,e,n){var r,s;const i=(r=_X(t,n))!==null&&r!==void 0?r:{},o=wX(e);return(s=i[o])!==null&&s!==void 0?s:null}function gke(t,e,n,r,s){var i;const o=xX(t),a=wX(e),c=(i=_X(t,s))!==null&&i!==void 0?i:{};c[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{s.setItem(o,JSON.stringify(c))}catch(d){console.error(d)}}function Z5({layout:t,panelConstraints:e}){const n=[...t],r=n.reduce((i,o)=>i+o,0);if(n.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!ho(r,100))for(let i=0;i(Q5(Gb),Gb.getItem(t)),setItem:(t,e)=>{Q5(Gb),Gb.setItem(t,e)}},J5={};function SX({autoSaveId:t=null,children:e,className:n="",direction:r,forwardedRef:s,id:i=null,onLayout:o=null,keyboardResizeBy:a=null,storage:c=Gb,style:d,tagName:f="div",...l}){const u=Q2(i),p=Ai(null),[h,m]=gg(null),[y,g]=gg([]),v=ike(),b=Ai({}),_=Ai(new Map),A=Ai(0),P=Ai({autoSaveId:t,direction:r,dragState:h,id:u,keyboardResizeBy:a,onLayout:o,storage:c}),T=Ai({layout:y,panelDataArray:[],panelDataArrayChanged:!1});Ai({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),iX(s,()=>({getId:()=>P.current.id,getLayout:()=>{const{layout:Y}=T.current;return Y},setLayout:Y=>{const{onLayout:Z}=P.current,{layout:he,panelDataArray:fe}=T.current,ce=Z5({layout:Y,panelConstraints:fe.map(xe=>xe.constraints)});X5(he,ce)||(g(ce),T.current.layout=ce,Z&&Z(ce),Em(fe,ce,b.current))}}),[]),mp(()=>{P.current.autoSaveId=t,P.current.direction=r,P.current.dragState=h,P.current.id=u,P.current.onLayout=o,P.current.storage=c}),cke({committedValuesRef:P,eagerValuesRef:T,groupId:u,layout:y,panelDataArray:T.current.panelDataArray,setLayout:g,panelGroupElement:p.current}),pp(()=>{const{panelDataArray:Y}=T.current;if(t){if(y.length===0||y.length!==Y.length)return;let Z=J5[t];Z==null&&(Z=pke(gke,vke),J5[t]=Z);const he=[...Y],fe=new Map(_.current);Z(t,he,fe,y,c)}},[t,y,c]),pp(()=>{});const E=yi(Y=>{const{onLayout:Z}=P.current,{layout:he,panelDataArray:fe}=T.current;if(Y.constraints.collapsible){const ce=fe.map(Le=>Le.constraints),{collapsedSize:xe=0,panelSize:Pe,pivotIndices:pe}=Bf(fe,Y,he);if(jt(Pe!=null,`Panel size not found for panel "${Y.id}"`),!tu(Pe,xe)){_.current.set(Y.id,Pe);const Me=Dm(fe,Y)===fe.length-1?Pe-xe:xe-Pe,Oe=Wb({delta:Me,initialLayout:he,panelConstraints:ce,pivotIndices:pe,prevLayout:he,trigger:"imperative-api"});A1(he,Oe)||(g(Oe),T.current.layout=Oe,Z&&Z(Oe),Em(fe,Oe,b.current))}}},[]),N=yi((Y,Z)=>{const{onLayout:he}=P.current,{layout:fe,panelDataArray:ce}=T.current;if(Y.constraints.collapsible){const xe=ce.map(Fe=>Fe.constraints),{collapsedSize:Pe=0,panelSize:pe=0,minSize:Le=0,pivotIndices:Me}=Bf(ce,Y,fe),Oe=Z??Le;if(tu(pe,Pe)){const Fe=_.current.get(Y.id),ot=Fe!=null&&Fe>=Oe?Fe:Oe,At=Dm(ce,Y)===ce.length-1?pe-ot:ot-pe,ee=Wb({delta:At,initialLayout:fe,panelConstraints:xe,pivotIndices:Me,prevLayout:fe,trigger:"imperative-api"});A1(fe,ee)||(g(ee),T.current.layout=ee,he&&he(ee),Em(ce,ee,b.current))}}},[]),k=yi(Y=>{const{layout:Z,panelDataArray:he}=T.current,{panelSize:fe}=Bf(he,Y,Z);return jt(fe!=null,`Panel size not found for panel "${Y.id}"`),fe},[]),M=yi((Y,Z)=>{const{panelDataArray:he}=T.current,fe=Dm(he,Y);return hke({defaultSize:Z,dragState:h,layout:y,panelData:he,panelIndex:fe})},[h,y]),j=yi(Y=>{const{layout:Z,panelDataArray:he}=T.current,{collapsedSize:fe=0,collapsible:ce,panelSize:xe}=Bf(he,Y,Z);return jt(xe!=null,`Panel size not found for panel "${Y.id}"`),ce===!0&&tu(xe,fe)},[]),I=yi(Y=>{const{layout:Z,panelDataArray:he}=T.current,{collapsedSize:fe=0,collapsible:ce,panelSize:xe}=Bf(he,Y,Z);return jt(xe!=null,`Panel size not found for panel "${Y.id}"`),!ce||Tp(xe,fe)>0},[]),L=yi(Y=>{const{panelDataArray:Z}=T.current;Z.push(Y),Z.sort((he,fe)=>{const ce=he.order,xe=fe.order;return ce==null&&xe==null?0:ce==null?-1:xe==null?1:ce-xe}),T.current.panelDataArrayChanged=!0,v()},[v]);mp(()=>{if(T.current.panelDataArrayChanged){T.current.panelDataArrayChanged=!1;const{autoSaveId:Y,onLayout:Z,storage:he}=P.current,{layout:fe,panelDataArray:ce}=T.current;let xe=null;if(Y){const pe=mke(Y,ce,he);pe&&(_.current=new Map(Object.entries(pe.expandToSizes)),xe=pe.layout)}xe==null&&(xe=fke({panelDataArray:ce}));const Pe=Z5({layout:xe,panelConstraints:ce.map(pe=>pe.constraints)});X5(fe,Pe)||(g(Pe),T.current.layout=Pe,Z&&Z(Pe),Em(ce,Pe,b.current))}}),mp(()=>{const Y=T.current;return()=>{Y.layout=[]}},[]);const H=yi(Y=>function(he){he.preventDefault();const fe=p.current;if(!fe)return()=>null;const{direction:ce,dragState:xe,id:Pe,keyboardResizeBy:pe,onLayout:Le}=P.current,{layout:Me,panelDataArray:Oe}=T.current,{initialLayout:Fe}=xe??{},ot=vX(Pe,Y,fe);let nt=dke(he,Y,ce,xe,pe,fe);const At=ce==="horizontal";document.dir==="rtl"&&At&&(nt=-nt);const ee=Oe.map(Re=>Re.constraints),de=Wb({delta:nt,initialLayout:Fe??Me,panelConstraints:ee,pivotIndices:ot,prevLayout:Me,trigger:lX(he)?"keyboard":"mouse-or-touch"}),me=!A1(Me,de);(cX(he)||uX(he))&&A.current!=nt&&(A.current=nt,me?Dk(Y,0):At?Dk(Y,nt<0?fX:hX):Dk(Y,nt<0?pX:mX)),me&&(g(de),T.current.layout=de,Le&&Le(de),Em(Oe,de,b.current))},[]),K=yi((Y,Z)=>{const{onLayout:he}=P.current,{layout:fe,panelDataArray:ce}=T.current,xe=ce.map(Fe=>Fe.constraints),{panelSize:Pe,pivotIndices:pe}=Bf(ce,Y,fe);jt(Pe!=null,`Panel size not found for panel "${Y.id}"`);const Me=Dm(ce,Y)===ce.length-1?Pe-Z:Z-Pe,Oe=Wb({delta:Me,initialLayout:fe,panelConstraints:xe,pivotIndices:pe,prevLayout:fe,trigger:"imperative-api"});A1(fe,Oe)||(g(Oe),T.current.layout=Oe,he&&he(Oe),Em(ce,Oe,b.current))},[]),V=yi((Y,Z)=>{const{layout:he,panelDataArray:fe}=T.current,{collapsedSize:ce=0,collapsible:xe}=Z,{collapsedSize:Pe=0,collapsible:pe,maxSize:Le=100,minSize:Me=0}=Y.constraints,{panelSize:Oe}=Bf(fe,Y,he);Oe!=null&&(xe&&pe&&tu(Oe,ce)?tu(ce,Pe)||K(Y,Pe):OeLe&&K(Y,Le))},[K]),U=yi((Y,Z)=>{const{direction:he}=P.current,{layout:fe}=T.current;if(!p.current)return;const ce=JR(Y,p.current);jt(ce,`Drag handle element not found for id "${Y}"`);const xe=bX(he,Z);m({dragHandleId:Y,dragHandleRect:ce.getBoundingClientRect(),initialCursorPosition:xe,initialLayout:fe})},[]),Q=yi(()=>{m(null)},[]),te=yi(Y=>{const{panelDataArray:Z}=T.current,he=Dm(Z,Y);he>=0&&(Z.splice(he,1),delete b.current[Y.id],T.current.panelDataArrayChanged=!0,v())},[v]),X=qTe(()=>({collapsePanel:E,direction:r,dragState:h,expandPanel:N,getPanelSize:k,getPanelStyle:M,groupId:u,isPanelCollapsed:j,isPanelExpanded:I,reevaluatePanelConstraints:V,registerPanel:L,registerResizeHandle:H,resizePanel:K,startDragging:U,stopDragging:Q,unregisterPanel:te,panelGroupElement:p.current}),[E,h,r,N,k,M,u,j,I,V,L,H,K,U,Q,te]),G={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Kv(XR.Provider,{value:X},Kv(f,{...l,children:e,className:n,id:i,ref:p,style:{...G,...d},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":u}))}const CX=rX((t,e)=>Kv(SX,{...t,forwardedRef:e}));SX.displayName="PanelGroup";CX.displayName="forwardRef(PanelGroup)";function Dm(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function Bf(t,e,n){const r=Dm(t,e),i=r===t.length-1?[r-1,r]:[r,r+1],o=n[r];return{...e.constraints,panelSize:o,pivotIndices:i}}function yke({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:r}){pp(()=>{if(t||n==null||r==null)return;const s=JR(e,r);if(s==null)return;const i=o=>{if(!o.defaultPrevented)switch(o.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{o.preventDefault(),n(o);break}case"F6":{o.preventDefault();const a=s.getAttribute("data-panel-group-id");jt(a,`No group element found for id "${a}"`);const c=vx(a,r),d=gX(a,e,r);jt(d!==null,`No resize element found for id "${e}"`);const f=o.shiftKey?d>0?d-1:c.length-1:d+1{s.removeEventListener("keydown",i)}},[r,t,e,n])}function EX({children:t=null,className:e="",disabled:n=!1,hitAreaMargins:r,id:s,onBlur:i,onDragging:o,onFocus:a,style:c={},tabIndex:d=0,tagName:f="div",...l}){var u,p;const h=Ai(null),m=Ai({onDragging:o});pp(()=>{m.current.onDragging=o});const y=sX(XR);if(y===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:g,groupId:v,registerResizeHandle:b,startDragging:_,stopDragging:A,panelGroupElement:P}=y,T=Q2(s),[E,N]=gg("inactive"),[k,M]=gg(!1),[j,I]=gg(null),L=Ai({state:E});mp(()=>{L.current.state=E}),pp(()=>{if(n)I(null);else{const U=b(T);I(()=>U)}},[n,T,b]);const H=(u=r==null?void 0:r.coarse)!==null&&u!==void 0?u:15,K=(p=r==null?void 0:r.fine)!==null&&p!==void 0?p:5;return pp(()=>{if(n||j==null)return;const U=h.current;return jt(U,"Element ref not attached"),ske(T,U,g,{coarse:H,fine:K},(te,X,G)=>{if(X)switch(te){case"down":{N("drag"),_(T,G);const{onDragging:Y}=m.current;Y&&Y(!0);break}case"move":{const{state:Y}=L.current;Y!=="drag"&&N("hover"),j(G);break}case"up":{N("hover"),A();const{onDragging:Y}=m.current;Y&&Y(!1);break}}else N("inactive")})},[H,g,n,K,b,T,j,_,A]),yke({disabled:n,handleId:T,resizeHandler:j,panelGroupElement:P}),Kv(f,{...l,children:t,className:e,id:s,onBlur:()=>{M(!1),i==null||i()},onFocus:()=>{M(!0),a==null||a()},ref:h,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...c},tabIndex:d,"data-panel-group-direction":g,"data-panel-group-id":v,"data-resize-handle":"","data-resize-handle-active":E==="drag"?"pointer":k?"keyboard":void 0,"data-resize-handle-state":E,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":T})}EX.displayName="PanelResizeHandle";const bke=({className:t,...e})=>x.jsx(CX,{className:ie("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),...e}),eU=aX,xke=({withHandle:t,className:e,...n})=>x.jsx(EX,{className:ie("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",e),...n,children:t&&x.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:x.jsx(_q,{className:"h-2.5 w-2.5"})})});function yx(t,[e,n]){return Math.min(n,Math.max(e,t))}function wke(t,e){return S.useReducer((n,r)=>e[n][r]??n,t)}var t$="ScrollArea",[AX,ZUe]=jn(t$),[_ke,ha]=AX(t$),RX=S.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:i=600,...o}=t,[a,c]=S.useState(null),[d,f]=S.useState(null),[l,u]=S.useState(null),[p,h]=S.useState(null),[m,y]=S.useState(null),[g,v]=S.useState(0),[b,_]=S.useState(0),[A,P]=S.useState(!1),[T,E]=S.useState(!1),N=et(e,M=>c(M)),k=tl(s);return x.jsx(_ke,{scope:n,type:r,dir:k,scrollHideDelay:i,scrollArea:a,viewport:d,onViewportChange:f,content:l,onContentChange:u,scrollbarX:p,onScrollbarXChange:h,scrollbarXEnabled:A,onScrollbarXEnabledChange:P,scrollbarY:m,onScrollbarYChange:y,scrollbarYEnabled:T,onScrollbarYEnabledChange:E,onCornerWidthChange:v,onCornerHeightChange:_,children:x.jsx(De.div,{dir:k,...o,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":b+"px",...t.style}})})});RX.displayName=t$;var PX="ScrollAreaViewport",NX=S.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,nonce:s,...i}=t,o=ha(PX,n),a=S.useRef(null),c=et(e,a,o.onViewportChange);return x.jsxs(x.Fragment,{children:[x.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),x.jsx(De.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...t.style},children:x.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});NX.displayName=PX;var rc="ScrollAreaScrollbar",n$=S.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=ha(rc,t.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=s,a=t.orientation==="horizontal";return S.useEffect(()=>(a?i(!0):o(!0),()=>{a?i(!1):o(!1)}),[a,i,o]),s.type==="hover"?x.jsx(Ske,{...r,ref:e,forceMount:n}):s.type==="scroll"?x.jsx(Cke,{...r,ref:e,forceMount:n}):s.type==="auto"?x.jsx(TX,{...r,ref:e,forceMount:n}):s.type==="always"?x.jsx(r$,{...r,ref:e}):null});n$.displayName=rc;var Ske=S.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=ha(rc,t.__scopeScrollArea),[i,o]=S.useState(!1);return S.useEffect(()=>{const a=s.scrollArea;let c=0;if(a){const d=()=>{window.clearTimeout(c),o(!0)},f=()=>{c=window.setTimeout(()=>o(!1),s.scrollHideDelay)};return a.addEventListener("pointerenter",d),a.addEventListener("pointerleave",f),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",d),a.removeEventListener("pointerleave",f)}}},[s.scrollArea,s.scrollHideDelay]),x.jsx(Kn,{present:n||i,children:x.jsx(TX,{"data-state":i?"visible":"hidden",...r,ref:e})})}),Cke=S.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=ha(rc,t.__scopeScrollArea),i=t.orientation==="horizontal",o=tP(()=>c("SCROLL_END"),100),[a,c]=wke("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return S.useEffect(()=>{if(a==="idle"){const d=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(d)}},[a,s.scrollHideDelay,c]),S.useEffect(()=>{const d=s.viewport,f=i?"scrollLeft":"scrollTop";if(d){let l=d[f];const u=()=>{const p=d[f];l!==p&&(c("SCROLL"),o()),l=p};return d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[s.viewport,i,c,o]),x.jsx(Kn,{present:n||a!=="hidden",children:x.jsx(r$,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:ye(t.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:ye(t.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),TX=S.forwardRef((t,e)=>{const n=ha(rc,t.__scopeScrollArea),{forceMount:r,...s}=t,[i,o]=S.useState(!1),a=t.orientation==="horizontal",c=tP(()=>{if(n.viewport){const d=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=t,s=ha(rc,t.__scopeScrollArea),i=S.useRef(null),o=S.useRef(0),[a,c]=S.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=jX(a.viewport,a.content),f={...r,sizes:a,onSizesChange:c,hasThumb:d>0&&d<1,onThumbChange:u=>i.current=u,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:u=>o.current=u};function l(u,p){return Tke(u,o.current,a,p)}return n==="horizontal"?x.jsx(Eke,{...f,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const u=s.viewport.scrollLeft,p=tU(u,a,s.dir);i.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:u=>{s.viewport&&(s.viewport.scrollLeft=u)},onDragScroll:u=>{s.viewport&&(s.viewport.scrollLeft=l(u,s.dir))}}):n==="vertical"?x.jsx(Ake,{...f,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const u=s.viewport.scrollTop,p=tU(u,a);i.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:u=>{s.viewport&&(s.viewport.scrollTop=u)},onDragScroll:u=>{s.viewport&&(s.viewport.scrollTop=l(u))}}):null}),Eke=S.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=ha(rc,t.__scopeScrollArea),[o,a]=S.useState(),c=S.useRef(null),d=et(e,c,i.onScrollbarXChange);return S.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),x.jsx(DX,{"data-orientation":"horizontal",...s,ref:d,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":eP(n)+"px",...t.style},onThumbPointerDown:f=>t.onThumbPointerDown(f.x),onDragScroll:f=>t.onDragScroll(f.x),onWheelScroll:(f,l)=>{if(i.viewport){const u=i.viewport.scrollLeft+f.deltaX;t.onWheelScroll(u),LX(u,l)&&f.preventDefault()}},onResize:()=>{c.current&&i.viewport&&o&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:zE(o.paddingLeft),paddingEnd:zE(o.paddingRight)}})}})}),Ake=S.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=ha(rc,t.__scopeScrollArea),[o,a]=S.useState(),c=S.useRef(null),d=et(e,c,i.onScrollbarYChange);return S.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),x.jsx(DX,{"data-orientation":"vertical",...s,ref:d,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":eP(n)+"px",...t.style},onThumbPointerDown:f=>t.onThumbPointerDown(f.y),onDragScroll:f=>t.onDragScroll(f.y),onWheelScroll:(f,l)=>{if(i.viewport){const u=i.viewport.scrollTop+f.deltaY;t.onWheelScroll(u),LX(u,l)&&f.preventDefault()}},onResize:()=>{c.current&&i.viewport&&o&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:zE(o.paddingTop),paddingEnd:zE(o.paddingBottom)}})}})}),[Rke,kX]=AX(rc),DX=S.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:d,onWheelScroll:f,onResize:l,...u}=t,p=ha(rc,n),[h,m]=S.useState(null),y=et(e,N=>m(N)),g=S.useRef(null),v=S.useRef(""),b=p.viewport,_=r.content-r.viewport,A=on(f),P=on(c),T=tP(l,10);function E(N){if(g.current){const k=N.clientX-g.current.left,M=N.clientY-g.current.top;d({x:k,y:M})}}return S.useEffect(()=>{const N=k=>{const M=k.target;(h==null?void 0:h.contains(M))&&A(k,_)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[b,h,_,A]),S.useEffect(P,[r,P]),Yv(h,T),Yv(p.content,T),x.jsx(Rke,{scope:n,scrollbar:h,hasThumb:s,onThumbChange:on(i),onThumbPointerUp:on(o),onThumbPositionChange:P,onThumbPointerDown:on(a),children:x.jsx(De.div,{...u,ref:y,style:{position:"absolute",...u.style},onPointerDown:ye(t.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),g.current=h.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),E(N))}),onPointerMove:ye(t.onPointerMove,E),onPointerUp:ye(t.onPointerUp,N=>{const k=N.target;k.hasPointerCapture(N.pointerId)&&k.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=""),g.current=null})})})}),FE="ScrollAreaThumb",MX=S.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=kX(FE,t.__scopeScrollArea);return x.jsx(Kn,{present:n||s.hasThumb,children:x.jsx(Pke,{ref:e,...r})})}),Pke=S.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...s}=t,i=ha(FE,n),o=kX(FE,n),{onThumbPositionChange:a}=o,c=et(e,l=>o.onThumbChange(l)),d=S.useRef(),f=tP(()=>{d.current&&(d.current(),d.current=void 0)},100);return S.useEffect(()=>{const l=i.viewport;if(l){const u=()=>{if(f(),!d.current){const p=kke(l,a);d.current=p,a()}};return a(),l.addEventListener("scroll",u),()=>l.removeEventListener("scroll",u)}},[i.viewport,f,a]),x.jsx(De.div,{"data-state":o.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ye(t.onPointerDownCapture,l=>{const p=l.target.getBoundingClientRect(),h=l.clientX-p.left,m=l.clientY-p.top;o.onThumbPointerDown({x:h,y:m})}),onPointerUp:ye(t.onPointerUp,o.onThumbPointerUp)})});MX.displayName=FE;var s$="ScrollAreaCorner",OX=S.forwardRef((t,e)=>{const n=ha(s$,t.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?x.jsx(Nke,{...t,ref:e}):null});OX.displayName=s$;var Nke=S.forwardRef((t,e)=>{const{__scopeScrollArea:n,...r}=t,s=ha(s$,n),[i,o]=S.useState(0),[a,c]=S.useState(0),d=!!(i&&a);return Yv(s.scrollbarX,()=>{var l;const f=((l=s.scrollbarX)==null?void 0:l.offsetHeight)||0;s.onCornerHeightChange(f),c(f)}),Yv(s.scrollbarY,()=>{var l;const f=((l=s.scrollbarY)==null?void 0:l.offsetWidth)||0;s.onCornerWidthChange(f),o(f)}),d?x.jsx(De.div,{...r,ref:e,style:{width:i,height:a,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function zE(t){return t?parseInt(t,10):0}function jX(t,e){const n=t/e;return isNaN(n)?0:n}function eP(t){const e=jX(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function Tke(t,e,n,r="ltr"){const s=eP(n),i=s/2,o=e||i,a=s-o,c=n.scrollbar.paddingStart+o,d=n.scrollbar.size-n.scrollbar.paddingEnd-a,f=n.content-n.viewport,l=r==="ltr"?[0,f]:[f*-1,0];return IX([c,d],l)(t)}function tU(t,e,n="ltr"){const r=eP(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=e.scrollbar.size-s,o=e.content-e.viewport,a=i-r,c=n==="ltr"?[0,o]:[o*-1,0],d=yx(t,c);return IX([0,o],[0,a])(d)}function IX(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function LX(t,e){return t>0&&t{})=>{let n={left:t.scrollLeft,top:t.scrollTop},r=0;return function s(){const i={left:t.scrollLeft,top:t.scrollTop},o=n.left!==i.left,a=n.top!==i.top;(o||a)&&e(),n=i,r=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(r)};function tP(t,e){const n=on(t),r=S.useRef(0);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),S.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function Yv(t,e){const n=on(e);ir(()=>{let r=0;if(t){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(t),()=>{window.cancelAnimationFrame(r),s.unobserve(t)}}},[t,n])}var $X=RX,Dke=NX,Mke=OX;const i$=S.forwardRef(({className:t,children:e,...n},r)=>x.jsxs($X,{ref:r,className:ie("relative overflow-hidden",t),...n,children:[x.jsx(Dke,{className:"h-full w-full rounded-[inherit]",children:e}),x.jsx(FX,{}),x.jsx(Mke,{})]}));i$.displayName=$X.displayName;const FX=S.forwardRef(({className:t,orientation:e="vertical",...n},r)=>x.jsx(n$,{ref:r,orientation:e,className:ie("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...n,children:x.jsx(MX,{className:"relative flex-1 rounded-full bg-border"})}));FX.displayName=n$.displayName;var Oke=[" ","Enter","ArrowUp","ArrowDown"],jke=[" ","Enter"],U_="Select",[nP,rP,Ike]=Au(U_),[jy,JUe]=jn(U_,[Ike,ec]),sP=ec(),[Lke,Sf]=jy(U_),[$ke,Fke]=jy(U_),zX=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:s,onOpenChange:i,value:o,defaultValue:a,onValueChange:c,dir:d,name:f,autoComplete:l,disabled:u,required:p}=t,h=sP(e),[m,y]=S.useState(null),[g,v]=S.useState(null),[b,_]=S.useState(!1),A=tl(d),[P=!1,T]=mr({prop:r,defaultProp:s,onChange:i}),[E,N]=mr({prop:o,defaultProp:a,onChange:c}),k=S.useRef(null),M=m?!!m.closest("form"):!0,[j,I]=S.useState(new Set),L=Array.from(j).map(H=>H.props.value).join(";");return x.jsx(BR,{...h,children:x.jsxs(Lke,{required:p,scope:e,trigger:m,onTriggerChange:y,valueNode:g,onValueNodeChange:v,valueNodeHasChildren:b,onValueNodeHasChildrenChange:_,contentId:Ls(),value:E,onValueChange:N,open:P,onOpenChange:T,dir:A,triggerPointerDownPosRef:k,disabled:u,children:[x.jsx(nP.Provider,{scope:e,children:x.jsx($ke,{scope:t.__scopeSelect,onNativeOptionAdd:S.useCallback(H=>{I(K=>new Set(K).add(H))},[]),onNativeOptionRemove:S.useCallback(H=>{I(K=>{const V=new Set(K);return V.delete(H),V})},[]),children:n})}),M?x.jsxs(dQ,{"aria-hidden":!0,required:p,tabIndex:-1,name:f,autoComplete:l,value:E,onChange:H=>N(H.target.value),disabled:u,children:[E===void 0?x.jsx("option",{value:""}):null,Array.from(j)]},L):null]})})};zX.displayName=U_;var BX="SelectTrigger",UX=S.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...s}=t,i=sP(n),o=Sf(BX,n),a=o.disabled||r,c=et(e,o.onTriggerChange),d=rP(n),[f,l,u]=fQ(h=>{const m=d().filter(v=>!v.disabled),y=m.find(v=>v.value===o.value),g=hQ(m,h,y);g!==void 0&&o.onValueChange(g.value)}),p=()=>{a||(o.onOpenChange(!0),u())};return x.jsx(Ty,{asChild:!0,...i,children:x.jsx(De.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":uQ(o.value)?"":void 0,...s,ref:c,onClick:ye(s.onClick,h=>{h.currentTarget.focus()}),onPointerDown:ye(s.onPointerDown,h=>{const m=h.target;m.hasPointerCapture(h.pointerId)&&m.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&(p(),o.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)},h.preventDefault())}),onKeyDown:ye(s.onKeyDown,h=>{const m=f.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&l(h.key),!(m&&h.key===" ")&&Oke.includes(h.key)&&(p(),h.preventDefault())})})})});UX.displayName=BX;var HX="SelectValue",VX=S.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:o="",...a}=t,c=Sf(HX,n),{onValueNodeHasChildrenChange:d}=c,f=i!==void 0,l=et(e,c.onValueNodeChange);return ir(()=>{d(f)},[d,f]),x.jsx(De.span,{...a,ref:l,style:{pointerEvents:"none"},children:uQ(c.value)?x.jsx(x.Fragment,{children:o}):i})});VX.displayName=HX;var zke="SelectIcon",qX=S.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...s}=t;return x.jsx(De.span,{"aria-hidden":!0,...s,ref:e,children:r||"▼"})});qX.displayName=zke;var Bke="SelectPortal",WX=t=>x.jsx(py,{asChild:!0,...t});WX.displayName=Bke;var kp="SelectContent",GX=S.forwardRef((t,e)=>{const n=Sf(kp,t.__scopeSelect),[r,s]=S.useState();if(ir(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?rs.createPortal(x.jsx(KX,{scope:t.__scopeSelect,children:x.jsx(nP.Slot,{scope:t.__scopeSelect,children:x.jsx("div",{children:t.children})})}),i):null}return x.jsx(YX,{...t,ref:e})});GX.displayName=kp;var _c=10,[KX,Cf]=jy(kp),Uke="SelectContentImpl",YX=S.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:o,side:a,sideOffset:c,align:d,alignOffset:f,arrowPadding:l,collisionBoundary:u,collisionPadding:p,sticky:h,hideWhenDetached:m,avoidCollisions:y,...g}=t,v=Sf(kp,n),[b,_]=S.useState(null),[A,P]=S.useState(null),T=et(e,ce=>_(ce)),[E,N]=S.useState(null),[k,M]=S.useState(null),j=rP(n),[I,L]=S.useState(!1),H=S.useRef(!1);S.useEffect(()=>{if(b)return g_(b)},[b]),lR();const K=S.useCallback(ce=>{const[xe,...Pe]=j().map(Me=>Me.ref.current),[pe]=Pe.slice(-1),Le=document.activeElement;for(const Me of ce)if(Me===Le||(Me==null||Me.scrollIntoView({block:"nearest"}),Me===xe&&A&&(A.scrollTop=0),Me===pe&&A&&(A.scrollTop=A.scrollHeight),Me==null||Me.focus(),document.activeElement!==Le))return},[j,A]),V=S.useCallback(()=>K([E,b]),[K,E,b]);S.useEffect(()=>{I&&V()},[I,V]);const{onOpenChange:U,triggerPointerDownPosRef:Q}=v;S.useEffect(()=>{if(b){let ce={x:0,y:0};const xe=pe=>{var Le,Me;ce={x:Math.abs(Math.round(pe.pageX)-(((Le=Q.current)==null?void 0:Le.x)??0)),y:Math.abs(Math.round(pe.pageY)-(((Me=Q.current)==null?void 0:Me.y)??0))}},Pe=pe=>{ce.x<=10&&ce.y<=10?pe.preventDefault():b.contains(pe.target)||U(!1),document.removeEventListener("pointermove",xe),Q.current=null};return Q.current!==null&&(document.addEventListener("pointermove",xe),document.addEventListener("pointerup",Pe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",xe),document.removeEventListener("pointerup",Pe,{capture:!0})}}},[b,U,Q]),S.useEffect(()=>{const ce=()=>U(!1);return window.addEventListener("blur",ce),window.addEventListener("resize",ce),()=>{window.removeEventListener("blur",ce),window.removeEventListener("resize",ce)}},[U]);const[te,X]=fQ(ce=>{const xe=j().filter(Le=>!Le.disabled),Pe=xe.find(Le=>Le.ref.current===document.activeElement),pe=hQ(xe,ce,Pe);pe&&setTimeout(()=>pe.ref.current.focus())}),G=S.useCallback((ce,xe,Pe)=>{const pe=!H.current&&!Pe;(v.value!==void 0&&v.value===xe||pe)&&(N(ce),pe&&(H.current=!0))},[v.value]),Y=S.useCallback(()=>b==null?void 0:b.focus(),[b]),Z=S.useCallback((ce,xe,Pe)=>{const pe=!H.current&&!Pe;(v.value!==void 0&&v.value===xe||pe)&&M(ce)},[v.value]),he=r==="popper"?aO:XX,fe=he===aO?{side:a,sideOffset:c,align:d,alignOffset:f,arrowPadding:l,collisionBoundary:u,collisionPadding:p,sticky:h,hideWhenDetached:m,avoidCollisions:y}:{};return x.jsx(KX,{scope:n,content:b,viewport:A,onViewportChange:P,itemRefCallback:G,selectedItem:E,onItemLeave:Y,itemTextRefCallback:Z,focusSelectedItem:V,selectedItemText:k,position:r,isPositioned:I,searchRef:te,children:x.jsx(m_,{as:Ya,allowPinchZoom:!0,children:x.jsx(p_,{asChild:!0,trapped:v.open,onMountAutoFocus:ce=>{ce.preventDefault()},onUnmountAutoFocus:ye(s,ce=>{var xe;(xe=v.trigger)==null||xe.focus({preventScroll:!0}),ce.preventDefault()}),children:x.jsx(Pu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:ce=>ce.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:x.jsx(he,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:ce=>ce.preventDefault(),...g,...fe,onPlaced:()=>L(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:ye(g.onKeyDown,ce=>{const xe=ce.ctrlKey||ce.altKey||ce.metaKey;if(ce.key==="Tab"&&ce.preventDefault(),!xe&&ce.key.length===1&&X(ce.key),["ArrowUp","ArrowDown","Home","End"].includes(ce.key)){let pe=j().filter(Le=>!Le.disabled).map(Le=>Le.ref.current);if(["ArrowUp","End"].includes(ce.key)&&(pe=pe.slice().reverse()),["ArrowUp","ArrowDown"].includes(ce.key)){const Le=ce.target,Me=pe.indexOf(Le);pe=pe.slice(Me+1)}setTimeout(()=>K(pe)),ce.preventDefault()}})})})})})})});YX.displayName=Uke;var Hke="SelectItemAlignedPosition",XX=S.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...s}=t,i=Sf(kp,n),o=Cf(kp,n),[a,c]=S.useState(null),[d,f]=S.useState(null),l=et(e,T=>f(T)),u=rP(n),p=S.useRef(!1),h=S.useRef(!0),{viewport:m,selectedItem:y,selectedItemText:g,focusSelectedItem:v}=o,b=S.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&d&&m&&y&&g){const T=i.trigger.getBoundingClientRect(),E=d.getBoundingClientRect(),N=i.valueNode.getBoundingClientRect(),k=g.getBoundingClientRect();if(i.dir!=="rtl"){const Le=k.left-E.left,Me=N.left-Le,Oe=T.left-Me,Fe=T.width+Oe,ot=Math.max(Fe,E.width),nt=window.innerWidth-_c,At=yx(Me,[_c,nt-ot]);a.style.minWidth=Fe+"px",a.style.left=At+"px"}else{const Le=E.right-k.right,Me=window.innerWidth-N.right-Le,Oe=window.innerWidth-T.right-Me,Fe=T.width+Oe,ot=Math.max(Fe,E.width),nt=window.innerWidth-_c,At=yx(Me,[_c,nt-ot]);a.style.minWidth=Fe+"px",a.style.right=At+"px"}const M=u(),j=window.innerHeight-_c*2,I=m.scrollHeight,L=window.getComputedStyle(d),H=parseInt(L.borderTopWidth,10),K=parseInt(L.paddingTop,10),V=parseInt(L.borderBottomWidth,10),U=parseInt(L.paddingBottom,10),Q=H+K+I+U+V,te=Math.min(y.offsetHeight*5,Q),X=window.getComputedStyle(m),G=parseInt(X.paddingTop,10),Y=parseInt(X.paddingBottom,10),Z=T.top+T.height/2-_c,he=j-Z,fe=y.offsetHeight/2,ce=y.offsetTop+fe,xe=H+K+ce,Pe=Q-xe;if(xe<=Z){const Le=y===M[M.length-1].ref.current;a.style.bottom="0px";const Me=d.clientHeight-m.offsetTop-m.offsetHeight,Oe=Math.max(he,fe+(Le?Y:0)+Me+V),Fe=xe+Oe;a.style.height=Fe+"px"}else{const Le=y===M[0].ref.current;a.style.top="0px";const Oe=Math.max(Z,H+m.offsetTop+(Le?G:0)+fe)+Pe;a.style.height=Oe+"px",m.scrollTop=xe-Z+m.offsetTop}a.style.margin=`${_c}px 0`,a.style.minHeight=te+"px",a.style.maxHeight=j+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[u,i.trigger,i.valueNode,a,d,m,y,g,i.dir,r]);ir(()=>b(),[b]);const[_,A]=S.useState();ir(()=>{d&&A(window.getComputedStyle(d).zIndex)},[d]);const P=S.useCallback(T=>{T&&h.current===!0&&(b(),v==null||v(),h.current=!1)},[b,v]);return x.jsx(qke,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:P,children:x.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:x.jsx(De.div,{...s,ref:l,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});XX.displayName=Hke;var Vke="SelectPopperPosition",aO=S.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=_c,...i}=t,o=sP(n);return x.jsx(R_,{...o,...i,ref:e,align:r,collisionPadding:s,style:{boxSizing:"border-box",...i.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)"}})});aO.displayName=Vke;var[qke,o$]=jy(kp,{}),lO="SelectViewport",QX=S.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...s}=t,i=Cf(lO,n),o=o$(lO,n),a=et(e,i.onViewportChange),c=S.useRef(0);return x.jsxs(x.Fragment,{children:[x.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),x.jsx(nP.Slot,{scope:n,children:x.jsx(De.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"auto",...s.style},onScroll:ye(s.onScroll,d=>{const f=d.currentTarget,{contentWrapper:l,shouldExpandOnScrollRef:u}=o;if(u!=null&&u.current&&l){const p=Math.abs(c.current-f.scrollTop);if(p>0){const h=window.innerHeight-_c*2,m=parseFloat(l.style.minHeight),y=parseFloat(l.style.height),g=Math.max(m,y);if(g0?_:0,l.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});QX.displayName=lO;var ZX="SelectGroup",[Wke,Gke]=jy(ZX),Kke=S.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=Ls();return x.jsx(Wke,{scope:n,id:s,children:x.jsx(De.div,{role:"group","aria-labelledby":s,...r,ref:e})})});Kke.displayName=ZX;var JX="SelectLabel",eQ=S.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=Gke(JX,n);return x.jsx(De.div,{id:s.id,...r,ref:e})});eQ.displayName=JX;var BE="SelectItem",[Yke,tQ]=jy(BE),nQ=S.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...o}=t,a=Sf(BE,n),c=Cf(BE,n),d=a.value===r,[f,l]=S.useState(i??""),[u,p]=S.useState(!1),h=et(e,g=>{var v;return(v=c.itemRefCallback)==null?void 0:v.call(c,g,r,s)}),m=Ls(),y=()=>{s||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")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 x.jsx(Yke,{scope:n,value:r,disabled:s,textId:m,isSelected:d,onItemTextChange:S.useCallback(g=>{l(v=>v||((g==null?void 0:g.textContent)??"").trim())},[]),children:x.jsx(nP.ItemSlot,{scope:n,value:r,disabled:s,textValue:f,children:x.jsx(De.div,{role:"option","aria-labelledby":m,"data-highlighted":u?"":void 0,"aria-selected":d&&u,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:h,onFocus:ye(o.onFocus,()=>p(!0)),onBlur:ye(o.onBlur,()=>p(!1)),onPointerUp:ye(o.onPointerUp,y),onPointerMove:ye(o.onPointerMove,g=>{var v;s?(v=c.onItemLeave)==null||v.call(c):g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ye(o.onPointerLeave,g=>{var v;g.currentTarget===document.activeElement&&((v=c.onItemLeave)==null||v.call(c))}),onKeyDown:ye(o.onKeyDown,g=>{var b;((b=c.searchRef)==null?void 0:b.current)!==""&&g.key===" "||(jke.includes(g.key)&&y(),g.key===" "&&g.preventDefault())})})})})});nQ.displayName=BE;var Kb="SelectItemText",rQ=S.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:s,...i}=t,o=Sf(Kb,n),a=Cf(Kb,n),c=tQ(Kb,n),d=Fke(Kb,n),[f,l]=S.useState(null),u=et(e,g=>l(g),c.onItemTextChange,g=>{var v;return(v=a.itemTextRefCallback)==null?void 0:v.call(a,g,c.value,c.disabled)}),p=f==null?void 0:f.textContent,h=S.useMemo(()=>x.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:m,onNativeOptionRemove:y}=d;return ir(()=>(m(h),()=>y(h)),[m,y,h]),x.jsxs(x.Fragment,{children:[x.jsx(De.span,{id:c.textId,...i,ref:u}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?rs.createPortal(i.children,o.valueNode):null]})});rQ.displayName=Kb;var sQ="SelectItemIndicator",iQ=S.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return tQ(sQ,n).isSelected?x.jsx(De.span,{"aria-hidden":!0,...r,ref:e}):null});iQ.displayName=sQ;var cO="SelectScrollUpButton",oQ=S.forwardRef((t,e)=>{const n=Cf(cO,t.__scopeSelect),r=o$(cO,t.__scopeSelect),[s,i]=S.useState(!1),o=et(e,r.onScrollButtonChange);return ir(()=>{if(n.viewport&&n.isPositioned){let a=function(){const d=c.scrollTop>0;i(d)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?x.jsx(lQ,{...t,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});oQ.displayName=cO;var uO="SelectScrollDownButton",aQ=S.forwardRef((t,e)=>{const n=Cf(uO,t.__scopeSelect),r=o$(uO,t.__scopeSelect),[s,i]=S.useState(!1),o=et(e,r.onScrollButtonChange);return ir(()=>{if(n.viewport&&n.isPositioned){let a=function(){const d=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?x.jsx(lQ,{...t,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});aQ.displayName=uO;var lQ=S.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=t,i=Cf("SelectScrollButton",n),o=S.useRef(null),a=rP(n),c=S.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return S.useEffect(()=>()=>c(),[c]),ir(()=>{var f;const d=a().find(l=>l.ref.current===document.activeElement);(f=d==null?void 0:d.ref.current)==null||f.scrollIntoView({block:"nearest"})},[a]),x.jsx(De.div,{"aria-hidden":!0,...s,ref:e,style:{flexShrink:0,...s.style},onPointerDown:ye(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:ye(s.onPointerMove,()=>{var d;(d=i.onItemLeave)==null||d.call(i),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:ye(s.onPointerLeave,()=>{c()})})}),Xke="SelectSeparator",cQ=S.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return x.jsx(De.div,{"aria-hidden":!0,...r,ref:e})});cQ.displayName=Xke;var dO="SelectArrow",Qke=S.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=sP(n),i=Sf(dO,n),o=Cf(dO,n);return i.open&&o.position==="popper"?x.jsx(P_,{...s,...r,ref:e}):null});Qke.displayName=dO;function uQ(t){return t===""||t===void 0}var dQ=S.forwardRef((t,e)=>{const{value:n,...r}=t,s=S.useRef(null),i=et(e,s),o=Sy(n);return S.useEffect(()=>{const a=s.current,c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==n&&f){const l=new Event("change",{bubbles:!0});f.call(a,n),a.dispatchEvent(l)}},[o,n]),x.jsx(z_,{asChild:!0,children:x.jsx("select",{...r,ref:i,defaultValue:n})})});dQ.displayName="BubbleSelect";function fQ(t){const e=on(t),n=S.useRef(""),r=S.useRef(0),s=S.useCallback(o=>{const a=n.current+o;e(a),function c(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(a)},[e]),i=S.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function hQ(t,e,n){const s=e.length>1&&Array.from(e).every(d=>d===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let o=Zke(t,Math.max(i,0));s.length===1&&(o=o.filter(d=>d!==n));const c=o.find(d=>d.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function Zke(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var Jke=zX,pQ=UX,eDe=VX,tDe=qX,nDe=WX,mQ=GX,rDe=QX,gQ=eQ,vQ=nQ,sDe=rQ,iDe=iQ,yQ=oQ,bQ=aQ,xQ=cQ;const a$=Jke,l$=eDe,iP=S.forwardRef(({className:t,children:e,...n},r)=>x.jsxs(pQ,{ref:r,className:ie("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),...n,children:[e,x.jsx(tDe,{asChild:!0,children:x.jsx(uy,{className:"h-4 w-4 opacity-50"})})]}));iP.displayName=pQ.displayName;const wQ=S.forwardRef(({className:t,...e},n)=>x.jsx(yQ,{ref:n,className:ie("flex cursor-default items-center justify-center py-1",t),...e,children:x.jsx(vq,{className:"h-4 w-4"})}));wQ.displayName=yQ.displayName;const _Q=S.forwardRef(({className:t,...e},n)=>x.jsx(bQ,{ref:n,className:ie("flex cursor-default items-center justify-center py-1",t),...e,children:x.jsx(uy,{className:"h-4 w-4"})}));_Q.displayName=bQ.displayName;const oP=S.forwardRef(({className:t,children:e,position:n="popper",...r},s)=>x.jsx(nDe,{children:x.jsxs(mQ,{ref:s,className:ie("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:[x.jsx(wQ,{}),x.jsx(rDe,{className:ie("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),x.jsx(_Q,{})]})}));oP.displayName=mQ.displayName;const oDe=S.forwardRef(({className:t,...e},n)=>x.jsx(gQ,{ref:n,className:ie("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));oDe.displayName=gQ.displayName;const vg=S.forwardRef(({className:t,children:e,...n},r)=>x.jsxs(vQ,{ref:r,className:ie("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),...n,children:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(iDe,{children:x.jsx(h_,{className:"h-4 w-4"})})}),x.jsx(sDe,{children:e})]}));vg.displayName=vQ.displayName;const aDe=S.forwardRef(({className:t,...e},n)=>x.jsx(xQ,{ref:n,className:ie("-mx-1 my-1 h-px bg-muted",t),...e}));aDe.displayName=xQ.displayName;const lDe=uR,cDe=dR,uDe=fR,SQ=S.forwardRef(({className:t,...e},n)=>x.jsx(my,{className:ie("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));SQ.displayName=my.displayName;const dDe=li("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),CQ=S.forwardRef(({side:t="right",className:e,children:n,...r},s)=>x.jsxs(uDe,{children:[x.jsx(SQ,{}),x.jsxs(gy,{ref:s,className:ie(dDe({side:t}),e),...r,children:[n,x.jsxs(by,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[x.jsx(aR,{className:"h-4 w-4"}),x.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));CQ.displayName=gy.displayName;const fDe=S.forwardRef(({className:t,...e},n)=>x.jsx(vy,{ref:n,className:ie("text-lg font-semibold text-foreground",t),...e}));fDe.displayName=vy.displayName;const hDe=S.forwardRef(({className:t,...e},n)=>x.jsx(yy,{ref:n,className:ie("text-sm text-muted-foreground",t),...e}));hDe.displayName=yy.displayName;function bi({className:t,...e}){return x.jsx("div",{className:ie("animate-pulse rounded-md bg-muted",t),...e})}var EQ=["PageUp","PageDown"],AQ=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],RQ={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Iy="Slider",[fO,pDe,mDe]=Au(Iy),[PQ,e6e]=jn(Iy,[mDe]),[gDe,aP]=PQ(Iy),NQ=S.forwardRef((t,e)=>{const{name:n,min:r=0,max:s=100,step:i=1,orientation:o="horizontal",disabled:a=!1,minStepsBetweenThumbs:c=0,defaultValue:d=[r],value:f,onValueChange:l=()=>{},onValueCommit:u=()=>{},inverted:p=!1,...h}=t,m=S.useRef(new Set),y=S.useRef(0),v=o==="horizontal"?vDe:yDe,[b=[],_]=mr({prop:f,defaultProp:d,onChange:k=>{var j;(j=[...m.current][y.current])==null||j.focus(),l(k)}}),A=S.useRef(b);function P(k){const M=SDe(b,k);N(k,M)}function T(k){N(k,y.current)}function E(){const k=A.current[y.current];b[y.current]!==k&&u(b)}function N(k,M,{commit:j}={commit:!1}){const I=RDe(i),L=PDe(Math.round((k-r)/i)*i+r,I),H=yx(L,[r,s]);_((K=[])=>{const V=wDe(K,H,M);if(ADe(V,c*i)){y.current=V.indexOf(H);const U=String(V)!==String(K);return U&&j&&u(V),U?V:K}else return K})}return x.jsx(gDe,{scope:t.__scopeSlider,name:n,disabled:a,min:r,max:s,valueIndexToChangeRef:y,thumbs:m.current,values:b,orientation:o,children:x.jsx(fO.Provider,{scope:t.__scopeSlider,children:x.jsx(fO.Slot,{scope:t.__scopeSlider,children:x.jsx(v,{"aria-disabled":a,"data-disabled":a?"":void 0,...h,ref:e,onPointerDown:ye(h.onPointerDown,()=>{a||(A.current=b)}),min:r,max:s,inverted:p,onSlideStart:a?void 0:P,onSlideMove:a?void 0:T,onSlideEnd:a?void 0:E,onHomeKeyDown:()=>!a&&N(r,0,{commit:!0}),onEndKeyDown:()=>!a&&N(s,b.length-1,{commit:!0}),onStepKeyDown:({event:k,direction:M})=>{if(!a){const L=EQ.includes(k.key)||k.shiftKey&&AQ.includes(k.key)?10:1,H=y.current,K=b[H],V=i*L*M;N(K+V,H,{commit:!0})}}})})})})});NQ.displayName=Iy;var[TQ,kQ]=PQ(Iy,{startEdge:"left",endEdge:"right",size:"width",direction:1}),vDe=S.forwardRef((t,e)=>{const{min:n,max:r,dir:s,inverted:i,onSlideStart:o,onSlideMove:a,onSlideEnd:c,onStepKeyDown:d,...f}=t,[l,u]=S.useState(null),p=et(e,b=>u(b)),h=S.useRef(),m=tl(s),y=m==="ltr",g=y&&!i||!y&&i;function v(b){const _=h.current||l.getBoundingClientRect(),A=[0,_.width],T=c$(A,g?[n,r]:[r,n]);return h.current=_,T(b-_.left)}return x.jsx(TQ,{scope:t.__scopeSlider,startEdge:g?"left":"right",endEdge:g?"right":"left",direction:g?1:-1,size:"width",children:x.jsx(DQ,{dir:m,"data-orientation":"horizontal",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:b=>{const _=v(b.clientX);o==null||o(_)},onSlideMove:b=>{const _=v(b.clientX);a==null||a(_)},onSlideEnd:()=>{h.current=void 0,c==null||c()},onStepKeyDown:b=>{const A=RQ[g?"from-left":"from-right"].includes(b.key);d==null||d({event:b,direction:A?-1:1})}})})}),yDe=S.forwardRef((t,e)=>{const{min:n,max:r,inverted:s,onSlideStart:i,onSlideMove:o,onSlideEnd:a,onStepKeyDown:c,...d}=t,f=S.useRef(null),l=et(e,f),u=S.useRef(),p=!s;function h(m){const y=u.current||f.current.getBoundingClientRect(),g=[0,y.height],b=c$(g,p?[r,n]:[n,r]);return u.current=y,b(m-y.top)}return x.jsx(TQ,{scope:t.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:x.jsx(DQ,{"data-orientation":"vertical",...d,ref:l,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:m=>{const y=h(m.clientY);i==null||i(y)},onSlideMove:m=>{const y=h(m.clientY);o==null||o(y)},onSlideEnd:()=>{u.current=void 0,a==null||a()},onStepKeyDown:m=>{const g=RQ[p?"from-bottom":"from-top"].includes(m.key);c==null||c({event:m,direction:g?-1:1})}})})}),DQ=S.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:o,onEndKeyDown:a,onStepKeyDown:c,...d}=t,f=aP(Iy,n);return x.jsx(De.span,{...d,ref:e,onKeyDown:ye(t.onKeyDown,l=>{l.key==="Home"?(o(l),l.preventDefault()):l.key==="End"?(a(l),l.preventDefault()):EQ.concat(AQ).includes(l.key)&&(c(l),l.preventDefault())}),onPointerDown:ye(t.onPointerDown,l=>{const u=l.target;u.setPointerCapture(l.pointerId),l.preventDefault(),f.thumbs.has(u)?u.focus():r(l)}),onPointerMove:ye(t.onPointerMove,l=>{l.target.hasPointerCapture(l.pointerId)&&s(l)}),onPointerUp:ye(t.onPointerUp,l=>{const u=l.target;u.hasPointerCapture(l.pointerId)&&(u.releasePointerCapture(l.pointerId),i(l))})})}),MQ="SliderTrack",OQ=S.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=aP(MQ,n);return x.jsx(De.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:e})});OQ.displayName=MQ;var hO="SliderRange",jQ=S.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=aP(hO,n),i=kQ(hO,n),o=S.useRef(null),a=et(e,o),c=s.values.length,d=s.values.map(u=>LQ(u,s.min,s.max)),f=c>1?Math.min(...d):0,l=100-Math.max(...d);return x.jsx(De.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:a,style:{...t.style,[i.startEdge]:f+"%",[i.endEdge]:l+"%"}})});jQ.displayName=hO;var pO="SliderThumb",IQ=S.forwardRef((t,e)=>{const n=pDe(t.__scopeSlider),[r,s]=S.useState(null),i=et(e,a=>s(a)),o=S.useMemo(()=>r?n().findIndex(a=>a.ref.current===r):-1,[n,r]);return x.jsx(bDe,{...t,ref:i,index:o})}),bDe=S.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:s,...i}=t,o=aP(pO,n),a=kQ(pO,n),[c,d]=S.useState(null),f=et(e,v=>d(v)),l=c?!!c.closest("form"):!0,u=__(c),p=o.values[r],h=p===void 0?0:LQ(p,o.min,o.max),m=_De(r,o.values.length),y=u==null?void 0:u[a.size],g=y?CDe(y,h,a.direction):0;return S.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]),x.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${h}% + ${g}px)`},children:[x.jsx(fO.ItemSlot,{scope:t.__scopeSlider,children:x.jsx(De.span,{role:"slider","aria-label":t["aria-label"]||m,"aria-valuemin":o.min,"aria-valuenow":p,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...i,ref:f,style:p===void 0?{display:"none"}:t.style,onFocus:ye(t.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),l&&x.jsx(xDe,{name:s??(o.name?o.name+(o.values.length>1?"[]":""):void 0),value:p},r)]})});IQ.displayName=pO;var xDe=t=>{const{value:e,...n}=t,r=S.useRef(null),s=Sy(e);return S.useEffect(()=>{const i=r.current,o=window.HTMLInputElement.prototype,c=Object.getOwnPropertyDescriptor(o,"value").set;if(s!==e&&c){const d=new Event("input",{bubbles:!0});c.call(i,e),i.dispatchEvent(d)}},[s,e]),x.jsx("input",{style:{display:"none"},...n,ref:r,defaultValue:e})};function wDe(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}function LQ(t,e,n){const i=100/(n-e)*(t-e);return yx(i,[0,100])}function _De(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function SDe(t,e){if(t.length===1)return 0;const n=t.map(s=>Math.abs(s-e)),r=Math.min(...n);return n.indexOf(r)}function CDe(t,e,n){const r=t/2,i=c$([0,50],[0,r]);return(r-i(e)*n)*n}function EDe(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function ADe(t,e){if(e>0){const n=EDe(t);return Math.min(...n)>=e}return!0}function c$(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function RDe(t){return(String(t).split(".")[1]||"").length}function PDe(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var $Q=NQ,NDe=OQ,TDe=jQ,kDe=IQ;const DDe=S.forwardRef(({className:t,...e},n)=>x.jsxs($Q,{ref:n,className:ie("relative flex w-full touch-none select-none items-center",t),...e,children:[x.jsx(NDe,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:x.jsx(TDe,{className:"absolute h-full bg-primary"})}),x.jsx(kDe,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background 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"})]}));DDe.displayName=$Q.displayName;var u$="Switch",[MDe,t6e]=jn(u$),[ODe,jDe]=MDe(u$),FQ=S.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:o,disabled:a,value:c="on",onCheckedChange:d,...f}=t,[l,u]=S.useState(null),p=et(e,v=>u(v)),h=S.useRef(!1),m=l?!!l.closest("form"):!0,[y=!1,g]=mr({prop:s,defaultProp:i,onChange:d});return x.jsxs(ODe,{scope:n,checked:y,disabled:a,children:[x.jsx(De.button,{type:"button",role:"switch","aria-checked":y,"aria-required":o,"data-state":UQ(y),"data-disabled":a?"":void 0,disabled:a,value:c,...f,ref:p,onClick:ye(t.onClick,v=>{g(b=>!b),m&&(h.current=v.isPropagationStopped(),h.current||v.stopPropagation())})}),m&&x.jsx(IDe,{control:l,bubbles:!h.current,name:r,value:c,checked:y,required:o,disabled:a,style:{transform:"translateX(-100%)"}})]})});FQ.displayName=u$;var zQ="SwitchThumb",BQ=S.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,s=jDe(zQ,n);return x.jsx(De.span,{"data-state":UQ(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:e})});BQ.displayName=zQ;var IDe=t=>{const{control:e,checked:n,bubbles:r=!0,...s}=t,i=S.useRef(null),o=Sy(n),a=__(e);return S.useEffect(()=>{const c=i.current,d=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(d,"checked").set;if(o!==n&&l){const u=new Event("click",{bubbles:r});l.call(c,n),c.dispatchEvent(u)}},[o,n,r]),x.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:i,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function UQ(t){return t?"checked":"unchecked"}var HQ=FQ,LDe=BQ;const VQ=S.forwardRef(({className:t,...e},n)=>x.jsx(HQ,{className:ie("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...e,ref:n,children:x.jsx(LDe,{className:ie("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));VQ.displayName=HQ.displayName;const ud=S.forwardRef(({className:t,...e},n)=>x.jsx("div",{className:"relative w-full overflow-auto",children:x.jsx("table",{ref:n,className:ie("w-full caption-bottom text-sm",t),...e})}));ud.displayName="Table";const lP=S.forwardRef(({className:t,...e},n)=>x.jsx("thead",{ref:n,className:ie("[&_tr]:border-b",t),...e}));lP.displayName="TableHeader";const dd=S.forwardRef(({className:t,...e},n)=>x.jsx("tbody",{ref:n,className:ie("[&_tr:last-child]:border-0",t),...e}));dd.displayName="TableBody";const $De=S.forwardRef(({className:t,...e},n)=>x.jsx("tfoot",{ref:n,className:ie("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));$De.displayName="TableFooter";const Jo=S.forwardRef(({className:t,...e},n)=>x.jsx("tr",{ref:n,className:ie("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...e}));Jo.displayName="TableRow";const cP=S.forwardRef(({className:t,...e},n)=>x.jsx("th",{ref:n,className:ie("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...e}));cP.displayName="TableHead";const nu=S.forwardRef(({className:t,...e},n)=>x.jsx("td",{ref:n,className:ie("py-2 px-4 align-middle [&:has([role=checkbox])]:pr-0",t),...e}));nu.displayName="TableCell";const qQ=S.forwardRef(({className:t,...e},n)=>x.jsx("caption",{ref:n,className:ie("mt-4 text-sm text-muted-foreground",t),...e}));qQ.displayName="TableCaption";var d$="Tabs",[FDe,n6e]=jn(d$,[tc]),WQ=tc(),[zDe,f$]=FDe(d$),GQ=S.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:o="horizontal",dir:a,activationMode:c="automatic",...d}=t,f=tl(a),[l,u]=mr({prop:r,onChange:s,defaultProp:i});return x.jsx(zDe,{scope:n,baseId:Ls(),value:l,onValueChange:u,orientation:o,dir:f,activationMode:c,children:x.jsx(De.div,{dir:f,"data-orientation":o,...d,ref:e})})});GQ.displayName=d$;var KQ="TabsList",YQ=S.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...s}=t,i=f$(KQ,n),o=WQ(n);return x.jsx(N_,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:x.jsx(De.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:e})})});YQ.displayName=KQ;var XQ="TabsTrigger",QQ=S.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=t,o=f$(XQ,n),a=WQ(n),c=eZ(o.baseId,r),d=tZ(o.baseId,r),f=r===o.value;return x.jsx(T_,{asChild:!0,...a,focusable:!s,active:f,children:x.jsx(De.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":d,"data-state":f?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...i,ref:e,onMouseDown:ye(t.onMouseDown,l=>{!s&&l.button===0&&l.ctrlKey===!1?o.onValueChange(r):l.preventDefault()}),onKeyDown:ye(t.onKeyDown,l=>{[" ","Enter"].includes(l.key)&&o.onValueChange(r)}),onFocus:ye(t.onFocus,()=>{const l=o.activationMode!=="manual";!f&&!s&&l&&o.onValueChange(r)})})})});QQ.displayName=XQ;var ZQ="TabsContent",JQ=S.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...o}=t,a=f$(ZQ,n),c=eZ(a.baseId,r),d=tZ(a.baseId,r),f=r===a.value,l=S.useRef(f);return S.useEffect(()=>{const u=requestAnimationFrame(()=>l.current=!1);return()=>cancelAnimationFrame(u)},[]),x.jsx(Kn,{present:s||f,children:({present:u})=>x.jsx(De.div,{"data-state":f?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!u,id:d,tabIndex:0,...o,ref:e,style:{...t.style,animationDuration:l.current?"0s":void 0},children:u&&i})})});JQ.displayName=ZQ;function eZ(t,e){return`${t}-trigger-${e}`}function tZ(t,e){return`${t}-content-${e}`}var BDe=GQ,nZ=YQ,rZ=QQ,sZ=JQ;const h$=BDe,uP=S.forwardRef(({className:t,...e},n)=>x.jsx(nZ,{ref:n,className:ie("inline-flex h-9 items-center justify-center rounded-lg bg-accent p-1 text-muted-foreground",t),...e}));uP.displayName=nZ.displayName;const Xv=S.forwardRef(({className:t,...e},n)=>x.jsx(rZ,{ref:n,className:ie("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",t),...e}));Xv.displayName=rZ.displayName;const Qv=S.forwardRef(({className:t,...e},n)=>x.jsx(sZ,{ref:n,className:ie("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));Qv.displayName=sZ.displayName;const iZ=S.forwardRef(({className:t,...e},n)=>x.jsx("textarea",{className:ie("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/75 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:n,...e}));iZ.displayName="Textarea";var p$="ToastProvider",[m$,UDe,HDe]=Au("Toast"),[oZ,r6e]=jn("Toast",[HDe]),[VDe,dP]=oZ(p$),aZ=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=t,[a,c]=S.useState(null),[d,f]=S.useState(0),l=S.useRef(!1),u=S.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${p$}\`. Expected non-empty \`string\`.`),x.jsx(m$.Provider,{scope:e,children:x.jsx(VDe,{scope:e,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:d,viewport:a,onViewportChange:c,onToastAdd:S.useCallback(()=>f(p=>p+1),[]),onToastRemove:S.useCallback(()=>f(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:l,isClosePausedRef:u,children:o})})};aZ.displayName=p$;var lZ="ToastViewport",qDe=["F8"],mO="toast.viewportPause",gO="toast.viewportResume",cZ=S.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=qDe,label:s="Notifications ({hotkey})",...i}=t,o=dP(lZ,n),a=UDe(n),c=S.useRef(null),d=S.useRef(null),f=S.useRef(null),l=S.useRef(null),u=et(e,l,o.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),h=o.toastCount>0;S.useEffect(()=>{const y=g=>{var b;r.every(_=>g[_]||g.code===_)&&((b=l.current)==null||b.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),S.useEffect(()=>{const y=c.current,g=l.current;if(h&&y&&g){const v=()=>{if(!o.isClosePausedRef.current){const P=new CustomEvent(mO);g.dispatchEvent(P),o.isClosePausedRef.current=!0}},b=()=>{if(o.isClosePausedRef.current){const P=new CustomEvent(gO);g.dispatchEvent(P),o.isClosePausedRef.current=!1}},_=P=>{!y.contains(P.relatedTarget)&&b()},A=()=>{y.contains(document.activeElement)||b()};return y.addEventListener("focusin",v),y.addEventListener("focusout",_),y.addEventListener("pointermove",v),y.addEventListener("pointerleave",A),window.addEventListener("blur",v),window.addEventListener("focus",b),()=>{y.removeEventListener("focusin",v),y.removeEventListener("focusout",_),y.removeEventListener("pointermove",v),y.removeEventListener("pointerleave",A),window.removeEventListener("blur",v),window.removeEventListener("focus",b)}}},[h,o.isClosePausedRef]);const m=S.useCallback(({tabbingDirection:y})=>{const v=a().map(b=>{const _=b.ref.current,A=[_,...sMe(_)];return y==="forwards"?A:A.reverse()});return(y==="forwards"?v.reverse():v).flat()},[a]);return S.useEffect(()=>{const y=l.current;if(y){const g=v=>{var A,P,T;const b=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!b){const E=document.activeElement,N=v.shiftKey;if(v.target===y&&N){(A=d.current)==null||A.focus();return}const j=m({tabbingDirection:N?"backwards":"forwards"}),I=j.findIndex(L=>L===E);Mk(j.slice(I+1))?v.preventDefault():N?(P=d.current)==null||P.focus():(T=f.current)==null||T.focus()}};return y.addEventListener("keydown",g),()=>y.removeEventListener("keydown",g)}},[a,m]),x.jsxs(Sve,{ref:c,role:"region","aria-label":s.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:h?void 0:"none"},children:[h&&x.jsx(vO,{ref:d,onFocusFromOutsideViewport:()=>{const y=m({tabbingDirection:"forwards"});Mk(y)}}),x.jsx(m$.Slot,{scope:n,children:x.jsx(De.ol,{tabIndex:-1,...i,ref:u})}),h&&x.jsx(vO,{ref:f,onFocusFromOutsideViewport:()=>{const y=m({tabbingDirection:"backwards"});Mk(y)}})]})});cZ.displayName=lZ;var uZ="ToastFocusProxy",vO=S.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=t,i=dP(uZ,n);return x.jsx(z_,{"aria-hidden":!0,tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:o=>{var d;const a=o.relatedTarget;!((d=i.viewport)!=null&&d.contains(a))&&r()}})});vO.displayName=uZ;var fP="Toast",WDe="toast.swipeStart",GDe="toast.swipeMove",KDe="toast.swipeCancel",YDe="toast.swipeEnd",dZ=S.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...o}=t,[a=!0,c]=mr({prop:r,defaultProp:s,onChange:i});return x.jsx(Kn,{present:n||a,children:x.jsx(ZDe,{open:a,...o,ref:e,onClose:()=>c(!1),onPause:on(t.onPause),onResume:on(t.onResume),onSwipeStart:ye(t.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ye(t.onSwipeMove,d=>{const{x:f,y:l}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${l}px`)}),onSwipeCancel:ye(t.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ye(t.onSwipeEnd,d=>{const{x:f,y:l}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${l}px`),c(!1)})})})});dZ.displayName=fP;var[XDe,QDe]=oZ(fP,{onClose(){}}),ZDe=S.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:a,onPause:c,onResume:d,onSwipeStart:f,onSwipeMove:l,onSwipeCancel:u,onSwipeEnd:p,...h}=t,m=dP(fP,n),[y,g]=S.useState(null),v=et(e,L=>g(L)),b=S.useRef(null),_=S.useRef(null),A=s||m.duration,P=S.useRef(0),T=S.useRef(A),E=S.useRef(0),{onToastAdd:N,onToastRemove:k}=m,M=on(()=>{var H;(y==null?void 0:y.contains(document.activeElement))&&((H=m.viewport)==null||H.focus()),o()}),j=S.useCallback(L=>{!L||L===1/0||(window.clearTimeout(E.current),P.current=new Date().getTime(),E.current=window.setTimeout(M,L))},[M]);S.useEffect(()=>{const L=m.viewport;if(L){const H=()=>{j(T.current),d==null||d()},K=()=>{const V=new Date().getTime()-P.current;T.current=T.current-V,window.clearTimeout(E.current),c==null||c()};return L.addEventListener(mO,K),L.addEventListener(gO,H),()=>{L.removeEventListener(mO,K),L.removeEventListener(gO,H)}}},[m.viewport,A,c,d,j]),S.useEffect(()=>{i&&!m.isClosePausedRef.current&&j(A)},[i,A,m.isClosePausedRef,j]),S.useEffect(()=>(N(),()=>k()),[N,k]);const I=S.useMemo(()=>y?yZ(y):null,[y]);return m.viewport?x.jsxs(x.Fragment,{children:[I&&x.jsx(JDe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:I}),x.jsx(XDe,{scope:n,onClose:M,children:rs.createPortal(x.jsx(m$.ItemSlot,{scope:n,children:x.jsx(_ve,{asChild:!0,onEscapeKeyDown:ye(a,()=>{m.isFocusedToastEscapeKeyDownRef.current||M(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:x.jsx(De.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":m.swipeDirection,...h,ref:v,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:ye(t.onKeyDown,L=>{L.key==="Escape"&&(a==null||a(L.nativeEvent),L.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,M()))}),onPointerDown:ye(t.onPointerDown,L=>{L.button===0&&(b.current={x:L.clientX,y:L.clientY})}),onPointerMove:ye(t.onPointerMove,L=>{if(!b.current)return;const H=L.clientX-b.current.x,K=L.clientY-b.current.y,V=!!_.current,U=["left","right"].includes(m.swipeDirection),Q=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,te=U?Q(0,H):0,X=U?0:Q(0,K),G=L.pointerType==="touch"?10:2,Y={x:te,y:X},Z={originalEvent:L,delta:Y};V?(_.current=Y,R1(GDe,l,Z,{discrete:!1})):nU(Y,m.swipeDirection,G)?(_.current=Y,R1(WDe,f,Z,{discrete:!1}),L.target.setPointerCapture(L.pointerId)):(Math.abs(H)>G||Math.abs(K)>G)&&(b.current=null)}),onPointerUp:ye(t.onPointerUp,L=>{const H=_.current,K=L.target;if(K.hasPointerCapture(L.pointerId)&&K.releasePointerCapture(L.pointerId),_.current=null,b.current=null,H){const V=L.currentTarget,U={originalEvent:L,delta:H};nU(H,m.swipeDirection,m.swipeThreshold)?R1(YDe,p,U,{discrete:!0}):R1(KDe,u,U,{discrete:!0}),V.addEventListener("click",Q=>Q.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),JDe=t=>{const{__scopeToast:e,children:n,...r}=t,s=dP(fP,e),[i,o]=S.useState(!1),[a,c]=S.useState(!1);return nMe(()=>o(!0)),S.useEffect(()=>{const d=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(d)},[]),a?null:x.jsx(py,{asChild:!0,children:x.jsx(z_,{...r,children:i&&x.jsxs(x.Fragment,{children:[s.label," ",n]})})})},eMe="ToastTitle",fZ=S.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return x.jsx(De.div,{...r,ref:e})});fZ.displayName=eMe;var tMe="ToastDescription",hZ=S.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return x.jsx(De.div,{...r,ref:e})});hZ.displayName=tMe;var pZ="ToastAction",mZ=S.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?x.jsx(vZ,{altText:n,asChild:!0,children:x.jsx(g$,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${pZ}\`. Expected non-empty \`string\`.`),null)});mZ.displayName=pZ;var gZ="ToastClose",g$=S.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,s=QDe(gZ,n);return x.jsx(vZ,{asChild:!0,children:x.jsx(De.button,{type:"button",...r,ref:e,onClick:ye(t.onClick,s.onClose)})})});g$.displayName=gZ;var vZ=S.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...s}=t;return x.jsx(De.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function yZ(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),rMe(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...yZ(r))}}),e}function R1(t,e,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?sx(s,i):s.dispatchEvent(i)}var nU=(t,e,n=0)=>{const r=Math.abs(t.x),s=Math.abs(t.y),i=r>s;return e==="left"||e==="right"?i&&r>n:!i&&s>n};function nMe(t=()=>{}){const e=on(t);ir(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function rMe(t){return t.nodeType===t.ELEMENT_NODE}function sMe(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Mk(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var iMe=aZ,bZ=cZ,xZ=dZ,wZ=fZ,_Z=hZ,SZ=mZ,CZ=g$;const oMe=iMe,EZ=S.forwardRef(({className:t,...e},n)=>x.jsx(bZ,{ref:n,className:ie("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));EZ.displayName=bZ.displayName;const aMe=li("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-bottom-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",success:"success bg-green-300 text-success-foreground border-green-400 group"},position:{center:"bottom-0 mx-auto w-auto sm:bottom-0"}},defaultVariants:{variant:"default"}}),AZ=S.forwardRef(({className:t,variant:e,...n},r)=>x.jsx(xZ,{ref:r,className:ie(aMe({variant:e}),t),...n}));AZ.displayName=xZ.displayName;const lMe=S.forwardRef(({className:t,...e},n)=>x.jsx(SZ,{ref:n,className:ie("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),...e}));lMe.displayName=SZ.displayName;const RZ=S.forwardRef(({className:t,...e},n)=>x.jsx(CZ,{ref:n,className:ie("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":"",...e,children:x.jsx(aR,{className:"w-4 h-4"})}));RZ.displayName=CZ.displayName;const PZ=S.forwardRef(({className:t,...e},n)=>x.jsx(wZ,{ref:n,className:ie("text-sm font-semibold",t),...e}));PZ.displayName=wZ.displayName;const NZ=S.forwardRef(({className:t,...e},n)=>x.jsx(_Z,{ref:n,className:ie("text-sm opacity-90",t),...e}));NZ.displayName=_Z.displayName;function TZ(){const{toasts:t}=Jl();return x.jsxs(oMe,{swipeDirection:"down",children:[t.map(function({id:e,title:n,description:r,action:s,...i}){return x.jsxs(AZ,{...i,children:[x.jsxs("div",{className:"grid gap-1",children:[n&&x.jsx(PZ,{children:n}),r&&x.jsx(NZ,{children:r})]}),s,x.jsx(RZ,{})]},e)}),x.jsx(EZ,{className:"bottom-0 w-auto mx-auto sm:bottom-0 sm:left-0 sm:right-0"})]})}var cMe="Toggle",v$=S.forwardRef((t,e)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:s,...i}=t,[o=!1,a]=mr({prop:n,onChange:s,defaultProp:r});return x.jsx(De.button,{type:"button","aria-pressed":o,"data-state":o?"on":"off","data-disabled":t.disabled?"":void 0,...i,ref:e,onClick:ye(t.onClick,()=>{t.disabled||a(!o)})})});v$.displayName=cMe;var kZ=v$;const DZ=li("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),MZ=S.forwardRef(({className:t,variant:e,size:n,...r},s)=>x.jsx(kZ,{ref:s,className:ie(DZ({variant:e,size:n,className:t})),...r}));MZ.displayName=kZ.displayName;var Ly="ToggleGroup",[OZ,s6e]=jn(Ly,[tc]),jZ=tc(),y$=oe.forwardRef((t,e)=>{const{type:n,...r}=t;if(n==="single"){const s=r;return x.jsx(uMe,{...s,ref:e})}if(n==="multiple"){const s=r;return x.jsx(dMe,{...s,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${Ly}\``)});y$.displayName=Ly;var[IZ,LZ]=OZ(Ly),uMe=oe.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=t,[o,a]=mr({prop:n,defaultProp:r,onChange:s});return x.jsx(IZ,{scope:t.__scopeToggleGroup,type:"single",value:o?[o]:[],onItemActivate:a,onItemDeactivate:oe.useCallback(()=>a(""),[a]),children:x.jsx($Z,{...i,ref:e})})}),dMe=oe.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=t,[o=[],a]=mr({prop:n,defaultProp:r,onChange:s}),c=oe.useCallback(f=>a((l=[])=>[...l,f]),[a]),d=oe.useCallback(f=>a((l=[])=>l.filter(u=>u!==f)),[a]);return x.jsx(IZ,{scope:t.__scopeToggleGroup,type:"multiple",value:o,onItemActivate:c,onItemDeactivate:d,children:x.jsx($Z,{...i,ref:e})})});y$.displayName=Ly;var[fMe,hMe]=OZ(Ly),$Z=oe.forwardRef((t,e)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:s=!0,orientation:i,dir:o,loop:a=!0,...c}=t,d=jZ(n),f=tl(o),l={role:"group",dir:f,...c};return x.jsx(fMe,{scope:n,rovingFocus:s,disabled:r,children:s?x.jsx(N_,{asChild:!0,...d,orientation:i,dir:f,loop:a,children:x.jsx(De.div,{...l,ref:e})}):x.jsx(De.div,{...l,ref:e})})}),UE="ToggleGroupItem",FZ=oe.forwardRef((t,e)=>{const n=LZ(UE,t.__scopeToggleGroup),r=hMe(UE,t.__scopeToggleGroup),s=jZ(t.__scopeToggleGroup),i=n.value.includes(t.value),o=r.disabled||t.disabled,a={...t,pressed:i,disabled:o},c=oe.useRef(null);return r.rovingFocus?x.jsx(T_,{asChild:!0,...s,focusable:!o,active:i,ref:c,children:x.jsx(rU,{...a,ref:e})}):x.jsx(rU,{...a,ref:e})});FZ.displayName=UE;var rU=oe.forwardRef((t,e)=>{const{__scopeToggleGroup:n,value:r,...s}=t,i=LZ(UE,n),o={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},a=i.type==="single"?o:void 0;return x.jsx(v$,{...a,...s,ref:e,onPressedChange:c=>{c?i.onItemActivate(r):i.onItemDeactivate(r)}})}),zZ=y$,BZ=FZ;const UZ=S.createContext({size:"default",variant:"default"}),pMe=S.forwardRef(({className:t,variant:e,size:n,children:r,...s},i)=>x.jsx(zZ,{ref:i,className:ie("flex items-center justify-center gap-1",t),...s,children:x.jsx(UZ.Provider,{value:{variant:e,size:n},children:r})}));pMe.displayName=zZ.displayName;const mMe=S.forwardRef(({className:t,children:e,variant:n,size:r,...s},i)=>{const o=S.useContext(UZ);return x.jsx(BZ,{ref:i,className:ie(DZ({variant:o.variant||n,size:o.size||r}),t),...s,children:e})});mMe.displayName=BZ.displayName;var[hP,i6e]=jn("Tooltip",[ec]),pP=ec(),HZ="TooltipProvider",gMe=700,yO="tooltip.open",[vMe,b$]=hP(HZ),VZ=t=>{const{__scopeTooltip:e,delayDuration:n=gMe,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,[o,a]=S.useState(!0),c=S.useRef(!1),d=S.useRef(0);return S.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),x.jsx(vMe,{scope:e,isOpenDelayed:o,delayDuration:n,onOpen:S.useCallback(()=>{window.clearTimeout(d.current),a(!1)},[]),onClose:S.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:S.useCallback(f=>{c.current=f},[]),disableHoverableContent:s,children:i})};VZ.displayName=HZ;var mP="Tooltip",[yMe,gP]=hP(mP),qZ=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s=!1,onOpenChange:i,disableHoverableContent:o,delayDuration:a}=t,c=b$(mP,t.__scopeTooltip),d=pP(e),[f,l]=S.useState(null),u=Ls(),p=S.useRef(0),h=o??c.disableHoverableContent,m=a??c.delayDuration,y=S.useRef(!1),[g=!1,v]=mr({prop:r,defaultProp:s,onChange:T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(yO))):c.onClose(),i==null||i(T)}}),b=S.useMemo(()=>g?y.current?"delayed-open":"instant-open":"closed",[g]),_=S.useCallback(()=>{window.clearTimeout(p.current),y.current=!1,v(!0)},[v]),A=S.useCallback(()=>{window.clearTimeout(p.current),v(!1)},[v]),P=S.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,v(!0)},m)},[m,v]);return S.useEffect(()=>()=>window.clearTimeout(p.current),[]),x.jsx(BR,{...d,children:x.jsx(yMe,{scope:e,contentId:u,open:g,stateAttribute:b,trigger:f,onTriggerChange:l,onTriggerEnter:S.useCallback(()=>{c.isOpenDelayed?P():_()},[c.isOpenDelayed,P,_]),onTriggerLeave:S.useCallback(()=>{h?A():window.clearTimeout(p.current)},[A,h]),onOpen:_,onClose:A,disableHoverableContent:h,children:n})})};qZ.displayName=mP;var bO="TooltipTrigger",WZ=S.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=gP(bO,n),i=b$(bO,n),o=pP(n),a=S.useRef(null),c=et(e,a,s.onTriggerChange),d=S.useRef(!1),f=S.useRef(!1),l=S.useCallback(()=>d.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",l),[l]),x.jsx(Ty,{asChild:!0,...o,children:x.jsx(De.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:ye(t.onPointerMove,u=>{u.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:ye(t.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:ye(t.onPointerDown,()=>{d.current=!0,document.addEventListener("pointerup",l,{once:!0})}),onFocus:ye(t.onFocus,()=>{d.current||s.onOpen()}),onBlur:ye(t.onBlur,s.onClose),onClick:ye(t.onClick,s.onClose)})})});WZ.displayName=bO;var bMe="TooltipPortal",[o6e,xMe]=hP(bMe,{forceMount:void 0}),Zv="TooltipContent",GZ=S.forwardRef((t,e)=>{const n=xMe(Zv,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,o=gP(Zv,t.__scopeTooltip);return x.jsx(Kn,{present:r||o.open,children:o.disableHoverableContent?x.jsx(KZ,{side:s,...i,ref:e}):x.jsx(wMe,{side:s,...i,ref:e})})}),wMe=S.forwardRef((t,e)=>{const n=gP(Zv,t.__scopeTooltip),r=b$(Zv,t.__scopeTooltip),s=S.useRef(null),i=et(e,s),[o,a]=S.useState(null),{trigger:c,onClose:d}=n,f=s.current,{onPointerInTransitChange:l}=r,u=S.useCallback(()=>{a(null),l(!1)},[l]),p=S.useCallback((h,m)=>{const y=h.currentTarget,g={x:h.clientX,y:h.clientY},v=EMe(g,y.getBoundingClientRect()),b=AMe(g,v),_=RMe(m.getBoundingClientRect()),A=NMe([...b,..._]);a(A),l(!0)},[l]);return S.useEffect(()=>()=>u(),[u]),S.useEffect(()=>{if(c&&f){const h=y=>p(y,f),m=y=>p(y,c);return c.addEventListener("pointerleave",h),f.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",h),f.removeEventListener("pointerleave",m)}}},[c,f,p,u]),S.useEffect(()=>{if(o){const h=m=>{const y=m.target,g={x:m.clientX,y:m.clientY},v=(c==null?void 0:c.contains(y))||(f==null?void 0:f.contains(y)),b=!PMe(g,o);v?u():b&&(u(),d())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[c,f,o,d,u]),x.jsx(KZ,{...t,ref:i})}),[_Me,SMe]=hP(mP,{isInside:!1}),KZ=S.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=t,c=gP(Zv,n),d=pP(n),{onClose:f}=c;return S.useEffect(()=>(document.addEventListener(yO,f),()=>document.removeEventListener(yO,f)),[f]),S.useEffect(()=>{if(c.trigger){const l=u=>{const p=u.target;p!=null&&p.contains(c.trigger)&&f()};return window.addEventListener("scroll",l,{capture:!0}),()=>window.removeEventListener("scroll",l,{capture:!0})}},[c.trigger,f]),x.jsx(Pu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:l=>l.preventDefault(),onDismiss:f,children:x.jsxs(R_,{"data-state":c.stateAttribute,...d,...a,ref:e,style:{...a.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:[x.jsx(cL,{children:r}),x.jsx(_Me,{scope:n,isInside:!0,children:x.jsx(J9,{id:c.contentId,role:"tooltip",children:s||r})})]})})});GZ.displayName=Zv;var YZ="TooltipArrow",CMe=S.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=pP(n);return SMe(YZ,n).isInside?null:x.jsx(P_,{...s,...r,ref:e})});CMe.displayName=YZ;function EMe(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function AMe(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function RMe(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}function PMe(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,o=e.length-1;ir!=f>r&&n<(d-a)*(r-c)/(f-c)+a&&(s=!s)}return s}function NMe(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),TMe(e)}function TMe(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const i=e[e.length-1],o=e[e.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var kMe=VZ,DMe=qZ,MMe=WZ,XZ=GZ;const OMe=kMe,vo=DMe,yo=MMe,Pi=S.forwardRef(({className:t,sideOffset:e=4,...n},r)=>x.jsx(XZ,{ref:r,sideOffset:e,className:ie("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),...n}));Pi.displayName=XZ.displayName;const QZ=({isOpen:t,onCancel:e,onConfirm:n,title:r,description:s,cancelLabel:i,confirmLabel:o})=>x.jsx(NL,{open:t,children:x.jsxs(hR,{children:[x.jsxs(pR,{children:[x.jsx(gR,{children:r}),x.jsx(vR,{children:s})]}),x.jsxs(mR,{children:[x.jsx(bR,{children:x.jsx(eu,{to:"#",onClick:e,children:i})}),x.jsx(yR,{children:x.jsx(eu,{to:"#",onClick:n,children:o})})]})]})}),jMe={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console&&console[t]&&console[t].apply(console,e)}};class HE{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=e||jMe,this.options=n,this.debug=n.debug}log(){for(var e=arguments.length,n=new Array(e),r=0;r{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(n)||0;this.observers[r].set(n,s+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s{let[a,c]=o;for(let d=0;d{let[a,c]=o;for(let d=0;d{t=r,e=s});return n.resolve=t,n.reject=e,n}function sU(t){return t==null?"":""+t}function IMe(t,e,n){t.forEach(r=>{e[r]&&(n[r]=e[r])})}const LMe=/###/g;function A0(t,e,n){function r(a){return a&&a.indexOf("###")>-1?a.replace(LMe,"."):a}function s(){return!t||typeof t=="string"}const i=typeof e!="string"?e:e.split(".");let o=0;for(;o":">",'"':""","'":"'","/":"/"};function BMe(t){return typeof t=="string"?t.replace(/[&<>"'\/]/g,e=>zMe[e]):t}class UMe{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const HMe=[" ",",","?","!",";"],VMe=new UMe(20);function qMe(t,e,n){e=e||"",n=n||"";const r=HMe.filter(o=>e.indexOf(o)<0&&n.indexOf(o)<0);if(r.length===0)return!0;const s=VMe.getRegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let i=!s.test(t);if(!i){const o=t.indexOf(n);o>0&&!s.test(t.substring(0,o))&&(i=!0)}return i}function xO(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return t[e];const r=e.split(n);let s=t;for(let i=0;i-1&&c0?t.replace("_","-"):t}class oU extends vP{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,o=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,n],r&&(Array.isArray(r)?a.push(...r):typeof r=="string"&&i?a.push(...r.split(i)):a.push(r)));const c=VE(this.data,a);return!c&&!n&&!r&&e.indexOf(".")>-1&&(e=a[0],n=a[1],r=a.slice(2).join(".")),c||!o||typeof r!="string"?c:xO(this.data&&this.data[e]&&this.data[e][n],r,i)}addResource(e,n,r,s){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let a=[e,n];r&&(a=a.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(a=e.split("."),s=n,n=a[1]),this.addNamespaces(n),iU(this.data,a,s),i.silent||this.emit("added",e,n,r,s)}addResources(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const i in r)(typeof r[i]=="string"||Array.isArray(r[i]))&&this.addResource(e,n,i,r[i],{silent:!0});s.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,s,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},a=[e,n];e.indexOf(".")>-1&&(a=e.split("."),s=r,r=n,n=a[1]),this.addNamespaces(n);let c=VE(this.data,a)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?ZZ(c,r,i):c={...c,...r},iU(this.data,a,c),o.silent||this.emit("added",e,n,r)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,n)}:this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var JZ={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,s){return t.forEach(i=>{this.processors[i]&&(e=this.processors[i].process(e,n,r,s))}),e}};const aU={};class WE extends vP{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),IMe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Fl.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const r=this.resolve(e,n);return r&&r.res!==void 0}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const o=r&&e.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!qMe(e,r,s);if(o&&!a){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:i};const d=e.split(r);(r!==s||r===s&&this.options.ns.indexOf(d[0])>-1)&&(i=d.shift()),e=d.join(s)}return typeof i=="string"&&(i=[i]),{key:e,namespaces:i}}translate(e,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const s=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:o,namespaces:a}=this.extractFromKey(e[e.length-1],n),c=a[a.length-1],d=n.lng||this.language,f=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&d.toLowerCase()==="cimode"){if(f){const _=n.nsSeparator||this.options.nsSeparator;return s?{res:`${c}${_}${o}`,usedKey:o,exactUsedKey:o,usedLng:d,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${_}${o}`}return s?{res:o,usedKey:o,exactUsedKey:o,usedLng:d,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:o}const l=this.resolve(e,n);let u=l&&l.res;const p=l&&l.usedKey||o,h=l&&l.exactUsedKey||o,m=Object.prototype.toString.apply(u),y=["[object Number]","[object Function]","[object RegExp]"],g=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject;if(v&&u&&(typeof u!="string"&&typeof u!="boolean"&&typeof u!="number")&&y.indexOf(m)<0&&!(typeof g=="string"&&Array.isArray(u))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const _=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,u,{...n,ns:a}):`key '${o} (${this.language})' returned an object instead of string.`;return s?(l.res=_,l.usedParams=this.getUsedParamsDetails(n),l):_}if(i){const _=Array.isArray(u),A=_?[]:{},P=_?h:p;for(const T in u)if(Object.prototype.hasOwnProperty.call(u,T)){const E=`${P}${i}${T}`;A[T]=this.translate(E,{...n,joinArrays:!1,ns:a}),A[T]===E&&(A[T]=u[T])}u=A}}else if(v&&typeof g=="string"&&Array.isArray(u))u=u.join(g),u&&(u=this.extendTranslation(u,e,n,r));else{let _=!1,A=!1;const P=n.count!==void 0&&typeof n.count!="string",T=WE.hasDefaultValue(n),E=P?this.pluralResolver.getSuffix(d,n.count,n):"",N=n.ordinal&&P?this.pluralResolver.getSuffix(d,n.count,{ordinal:!1}):"",k=P&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),M=k&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${E}`]||n[`defaultValue${N}`]||n.defaultValue;!this.isValidLookup(u)&&T&&(_=!0,u=M),this.isValidLookup(u)||(A=!0,u=o);const I=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&A?void 0:u,L=T&&M!==u&&this.options.updateMissing;if(A||_||L){if(this.logger.log(L?"updateKey":"missingKey",d,c,o,L?M:u),i){const U=this.resolve(o,{...n,keySeparator:!1});U&&U.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let H=[];const K=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&K&&K[0])for(let U=0;U{const X=T&&te!==u?te:I;this.options.missingKeyHandler?this.options.missingKeyHandler(U,c,Q,X,L,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(U,c,Q,X,L,n),this.emit("missingKey",U,c,Q,u)};this.options.saveMissing&&(this.options.saveMissingPlurals&&P?H.forEach(U=>{const Q=this.pluralResolver.getSuffixes(U,n);k&&n[`defaultValue${this.options.pluralSeparator}zero`]&&Q.indexOf(`${this.options.pluralSeparator}zero`)<0&&Q.push(`${this.options.pluralSeparator}zero`),Q.forEach(te=>{V([U],o+te,n[`defaultValue${te}`]||M)})}):V(H,o,M))}u=this.extendTranslation(u,e,n,l,r),A&&u===o&&this.options.appendNamespaceToMissingKey&&(u=`${c}:${o}`),(A||_)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?u=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${o}`:o,_?u:void 0):u=this.options.parseMissingKeyHandler(u))}return s?(l.res=u,l.usedParams=this.getUsedParamsDetails(n),l):u}extendTranslation(e,n,r,s,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const d=typeof e=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(d){const u=e.match(this.interpolator.nestingRegexp);f=u&&u.length}let l=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),e=this.interpolator.interpolate(e,l,r.lng||this.language||s.usedLng,r),d){const u=e.match(this.interpolator.nestingRegexp),p=u&&u.length;f1&&arguments[1]!==void 0?arguments[1]:{},r,s,i,o,a;return typeof e=="string"&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(r))return;const d=this.extractFromKey(c,n),f=d.key;s=f;let l=d.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const u=n.count!==void 0&&typeof n.count!="string",p=u&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),h=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",m=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);l.forEach(y=>{this.isValidLookup(r)||(a=y,!aU[`${m[0]}-${y}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(aU[`${m[0]}-${y}`]=!0,this.logger.warn(`key "${s}" for languages "${m.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),m.forEach(g=>{if(this.isValidLookup(r))return;o=g;const v=[f];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(v,f,g,y,n);else{let _;u&&(_=this.pluralResolver.getSuffix(g,n.count,n));const A=`${this.options.pluralSeparator}zero`,P=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(v.push(f+_),n.ordinal&&_.indexOf(P)===0&&v.push(f+_.replace(P,this.options.pluralSeparator)),p&&v.push(f+A)),h){const T=`${f}${this.options.contextSeparator}${n.context}`;v.push(T),u&&(v.push(T+_),n.ordinal&&_.indexOf(P)===0&&v.push(T+_.replace(P,this.options.pluralSeparator)),p&&v.push(T+A))}}let b;for(;b=v.pop();)this.isValidLookup(r)||(i=b,r=this.getResource(g,y,b,n))}))})}),{res:r,usedKey:s,exactUsedKey:i,usedLng:o,usedNS:a}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,n,r,s):this.resourceStore.getResource(e,n,r,s)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&typeof e.replace!="string";let s=r?e.replace:e;if(r&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const i of n)delete s[i]}return s}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n===r.substring(0,n.length)&&e[r]!==void 0)return!0;return!1}}function Ok(t){return t.charAt(0).toUpperCase()+t.slice(1)}class lU{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Fl.create("languageUtils")}getScriptPartFromCode(e){if(e=qE(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=qE(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(typeof e=="string"&&e.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=e.split("-");return this.options.lowerCaseLng?r=r.map(s=>s.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Ok(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Ok(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=Ok(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(i=>{if(i===s)return i;if(!(i.indexOf("-")<0&&s.indexOf("-")<0)&&(i.indexOf("-")>0&&s.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===s||i.indexOf(s)===0&&s.length>1))return i})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),typeof e=="string"&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],e),s=[],i=o=>{o&&(this.isSupportedCode(o)?s.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return typeof e=="string"&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(e))):typeof e=="string"&&i(this.formatLanguageCode(e)),r.forEach(o=>{s.indexOf(o)<0&&i(this.formatLanguageCode(o))}),s}}let WMe=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],GMe={1:function(t){return+(t>1)},2:function(t){return+(t!=1)},3:function(t){return 0},4:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},5:function(t){return t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5},6:function(t){return t==1?0:t>=2&&t<=4?1:2},7:function(t){return t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},8:function(t){return t==1?0:t==2?1:t!=8&&t!=11?2:3},9:function(t){return+(t>=2)},10:function(t){return t==1?0:t==2?1:t<7?2:t<11?3:4},11:function(t){return t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3},12:function(t){return+(t%10!=1||t%100==11)},13:function(t){return+(t!==0)},14:function(t){return t==1?0:t==2?1:t==3?2:3},15:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2},16:function(t){return t%10==1&&t%100!=11?0:t!==0?1:2},17:function(t){return t==1||t%10==1&&t%100!=11?0:1},18:function(t){return t==0?0:t==1?1:2},19:function(t){return t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3},20:function(t){return t==1?0:t==0||t%100>0&&t%100<20?1:2},21:function(t){return t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0},22:function(t){return t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3}};const KMe=["v1","v2","v3"],YMe=["v4"],cU={zero:0,one:1,two:2,few:3,many:4,other:5};function XMe(){const t={};return WMe.forEach(e=>{e.lngs.forEach(n=>{t[n]={numbers:e.nr,plurals:GMe[e.fc]}})}),t}class QMe{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=Fl.create("pluralResolver"),(!this.options.compatibilityJSON||YMe.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=XMe()}addRule(e,n){this.rules[e]=n}getRule(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(qE(e==="dev"?"en":e),{type:n.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(e,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,r).map(s=>`${n}${s}`)}getSuffixes(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((s,i)=>cU[s]-cU[i]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):r.numbers.map(s=>this.getSuffix(e,s,n)):[]}getSuffix(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.getRule(e,r);return s?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:this.getSuffixRetroCompatible(s,n):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,n){const r=e.noAbs?e.plurals(n):e.plurals(Math.abs(n));let s=e.numbers[r];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));const i=()=>this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString();return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?`_plural_${s.toString()}`:i():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!KMe.includes(this.options.compatibilityJSON)}}function uU(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=FMe(t,e,n);return!i&&s&&typeof n=="string"&&(i=xO(t,n,r),i===void 0&&(i=xO(e,n,r))),i}class ZMe{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Fl.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(n=>n),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:c,formatSeparator:d,unescapeSuffix:f,unescapePrefix:l,nestingPrefix:u,nestingPrefixEscaped:p,nestingSuffix:h,nestingSuffixEscaped:m,nestingOptionsSeparator:y,maxReplaces:g,alwaysFormat:v}=e.interpolation;this.escape=n!==void 0?n:BMe,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=i?Am(i):o||"{{",this.suffix=a?Am(a):c||"}}",this.formatSeparator=d||",",this.unescapePrefix=f?"":l||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=u?Am(u):p||Am("$t("),this.nestingSuffix=h?Am(h):m||Am(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=g||1e3,this.alwaysFormat=v!==void 0?v:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,n,r,s){let i,o,a;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function d(h){return h.replace(/\$/g,"$$$$")}const f=h=>{if(h.indexOf(this.formatSeparator)<0){const v=uU(n,c,h,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(v,void 0,r,{...s,...n,interpolationkey:h}):v}const m=h.split(this.formatSeparator),y=m.shift().trim(),g=m.join(this.formatSeparator).trim();return this.format(uU(n,c,y,this.options.keySeparator,this.options.ignoreJSONStructure),g,r,{...s,...n,interpolationkey:y})};this.resetRegExp();const l=s&&s.missingInterpolationHandler||this.options.missingInterpolationHandler,u=s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:h=>d(h)},{regex:this.regexp,safeValue:h=>this.escapeValue?d(this.escape(h)):d(h)}].forEach(h=>{for(a=0;i=h.regex.exec(e);){const m=i[1].trim();if(o=f(m),o===void 0)if(typeof l=="function"){const g=l(e,i,s);o=typeof g=="string"?g:""}else if(s&&Object.prototype.hasOwnProperty.call(s,m))o="";else if(u){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${e}`),o="";else typeof o!="string"&&!this.useRawValueToEscape&&(o=sU(o));const y=h.safeValue(o);if(e=e.replace(i[0],y),u?(h.regex.lastIndex+=o.length,h.regex.lastIndex-=i[0].length):h.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,i,o;function a(c,d){const f=this.nestingOptionsSeparator;if(c.indexOf(f)<0)return c;const l=c.split(new RegExp(`${f}[ ]*{`));let u=`{${l[1]}`;c=l[0],u=this.interpolate(u,o);const p=u.match(/'/g),h=u.match(/"/g);(p&&p.length%2===0&&!h||h.length%2!==0)&&(u=u.replace(/'/g,'"'));try{o=JSON.parse(u),d&&(o={...d,...o})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,m),`${c}${f}${u}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,c}for(;s=this.nestingRegexp.exec(e);){let c=[];o={...r},o=o.replace&&typeof o.replace!="string"?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let d=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const f=s[1].split(this.formatSeparator).map(l=>l.trim());s[1]=f.shift(),c=f,d=!0}if(i=n(a.call(this,s[1].trim(),o),o),i&&s[0]===e&&typeof i!="string")return i;typeof i!="string"&&(i=sU(i)),i||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),i=""),d&&(i=c.reduce((f,l)=>this.format(f,l,r.lng,{...r,interpolationkey:s[1].trim()}),i.trim())),e=e.replace(s[0],i),this.regexp.lastIndex=0}return e}}function JMe(t){let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);e==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(o=>{if(o){const[a,...c]=o.split(":"),d=c.join(":").trim().replace(/^'+|'+$/g,""),f=a.trim();n[f]||(n[f]=d),d==="false"&&(n[f]=!1),d==="true"&&(n[f]=!0),isNaN(d)||(n[f]=parseInt(d,10))}})}return{formatName:e,formatOptions:n}}function Rm(t){const e={};return function(r,s,i){const o=s+JSON.stringify(i);let a=e[o];return a||(a=t(qE(s),i),e[o]=a),a(r)}}class eOe{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Fl.create("formatter"),this.options=e,this.formats={number:Rm((n,r)=>{const s=new Intl.NumberFormat(n,{...r});return i=>s.format(i)}),currency:Rm((n,r)=>{const s=new Intl.NumberFormat(n,{...r,style:"currency"});return i=>s.format(i)}),datetime:Rm((n,r)=>{const s=new Intl.DateTimeFormat(n,{...r});return i=>s.format(i)}),relativetime:Rm((n,r)=>{const s=new Intl.RelativeTimeFormat(n,{...r});return i=>s.format(i,r.range||"day")}),list:Rm((n,r)=>{const s=new Intl.ListFormat(n,{...r});return i=>s.format(i)})},this.init(e)}init(e){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=Rm(n)}format(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return n.split(this.formatSeparator).reduce((a,c)=>{const{formatName:d,formatOptions:f}=JMe(c);if(this.formats[d]){let l=a;try{const u=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},p=u.locale||u.lng||s.locale||s.lng||r;l=this.formats[d](a,p,{...f,...s,...u})}catch(u){this.logger.warn(u)}return l}else this.logger.warn(`there was no format function for ${d}`);return a},e)}}function tOe(t,e){t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)}class nOe extends vP{constructor(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=Fl.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,s.backend,s)}queueLoad(e,n,r,s){const i={},o={},a={},c={};return e.forEach(d=>{let f=!0;n.forEach(l=>{const u=`${d}|${l}`;!r.reload&&this.store.hasResourceBundle(d,l)?this.state[u]=2:this.state[u]<0||(this.state[u]===1?o[u]===void 0&&(o[u]=!0):(this.state[u]=1,f=!1,o[u]===void 0&&(o[u]=!0),i[u]===void 0&&(i[u]=!0),c[l]===void 0&&(c[l]=!0)))}),f||(a[d]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(c)}}loaded(e,n,r){const s=e.split("|"),i=s[0],o=s[1];n&&this.emit("failedLoading",i,o,n),r&&this.store.addResourceBundle(i,o,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2;const a={};this.queue.forEach(c=>{$Me(c.loaded,[i],o),tOe(c,e),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(d=>{a[d]||(a[d]={});const f=c.loaded[d];f.length&&f.forEach(l=>{a[d][l]===void 0&&(a[d][l]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(c=>!c.done)}read(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:s,wait:i,callback:o});return}this.readingCalls++;const a=(d,f)=>{if(this.readingCalls--,this.waitingReads.length>0){const l=this.waitingReads.shift();this.read(l.lng,l.ns,l.fcName,l.tried,l.wait,l.callback)}if(d&&f&&s{this.read.call(this,e,n,r,s+1,i*2,o)},i);return}o(d,f)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const d=c(e,n);d&&typeof d.then=="function"?d.then(f=>a(null,f)).catch(a):a(null,d)}catch(d){a(d)}return}return c(e,n,a)}prepareLoading(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();typeof e=="string"&&(e=this.languageUtils.toResolveHierarchy(e)),typeof n=="string"&&(n=[n]);const i=this.queueLoad(e,n,r,s);if(!i.toLoad.length)return i.pending.length||s(),null;i.toLoad.forEach(o=>{this.loadOne(o)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=e.split("|"),s=r[0],i=r[1];this.read(s,i,"read",void 0,void 0,(o,a)=>{o&&this.logger.warn(`${n}loading namespace ${i} for language ${s} failed`,o),!o&&a&&this.logger.log(`${n}loaded namespace ${i} for language ${s}`,a),this.loaded(e,o,a)})}saveMissing(e,n,r,s,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const c={...o,isUpdate:i},d=this.backend.create.bind(this.backend);if(d.length<6)try{let f;d.length===5?f=d(e,n,r,s,c):f=d(e,n,r,s),f&&typeof f.then=="function"?f.then(l=>a(null,l)).catch(a):a(null,f)}catch(f){a(f)}else d(e,n,r,s,a,c)}!e||!e[0]||this.store.addResource(e[0],n,r,s)}}}function dU(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){let n={};if(typeof e[1]=="object"&&(n=e[1]),typeof e[1]=="string"&&(n.defaultValue=e[1]),typeof e[2]=="string"&&(n.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const r=e[3]||e[2];Object.keys(r).forEach(s=>{n[s]=r[s]})}return n},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function fU(t){return typeof t.ns=="string"&&(t.ns=[t.ns]),typeof t.fallbackLng=="string"&&(t.fallbackLng=[t.fallbackLng]),typeof t.fallbackNS=="string"&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function P1(){}function rOe(t){Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})}class bx extends vP{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=fU(e),this.services={},this.logger=Fl,this.modules={external:[]},rOe(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const s=dU();this.options={...s,...this.options,...fU(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...s.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);function i(f){return f?typeof f=="function"?new f:f:null}if(!this.options.isClone){this.modules.logger?Fl.init(i(this.modules.logger),this.options):Fl.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:typeof Intl<"u"&&(f=eOe);const l=new lU(this.options);this.store=new oU(this.options.resources,this.options);const u=this.services;u.logger=Fl,u.resourceStore=this.store,u.languageUtils=l,u.pluralResolver=new QMe(l,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),f&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(u.formatter=i(f),u.formatter.init(u,this.options),this.options.interpolation.format=u.formatter.format.bind(u.formatter)),u.interpolator=new ZMe(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new nOe(i(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",function(p){for(var h=arguments.length,m=new Array(h>1?h-1:0),y=1;y1?h-1:0),y=1;y{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,r||(r=P1),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(f=>{this[f]=function(){return e.store[f](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(f=>{this[f]=function(){return e.store[f](...arguments),e}});const c=Nb(),d=()=>{const f=(l,u)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(u),r(l,u)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return f(null,this.t.bind(this));this.changeLanguage(this.options.lng,f)};return this.options.resources||!this.options.initImmediate?d():setTimeout(d,0),c}loadResources(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:P1;const s=typeof e=="string"?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(s&&s.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const i=[],o=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(d=>{d!=="cimode"&&i.indexOf(d)<0&&i.push(d)})};s?o(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>o(c)),this.options.preload&&this.options.preload.forEach(a=>o(a)),this.services.backendConnector.load(i,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(a)})}else r(null)}reloadResources(e,n,r){const s=Nb();return e||(e=this.languages),n||(n=this.options.ns),r||(r=P1),this.services.backendConnector.reload(e,n,i=>{s.resolve(),r(i)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&JZ.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(e,n){var r=this;this.isLanguageChangingTo=e;const s=Nb();this.emit("languageChanging",e);const i=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},o=(c,d)=>{d?(i(d),this.translator.changeLanguage(d),this.isLanguageChangingTo=void 0,this.emit("languageChanged",d),this.logger.log("languageChanged",d)):this.isLanguageChangingTo=void 0,s.resolve(function(){return r.t(...arguments)}),n&&n(c,function(){return r.t(...arguments)})},a=c=>{!e&&!c&&this.services.languageDetector&&(c=[]);const d=typeof c=="string"?c:this.services.languageUtils.getBestMatchFromCodes(c);d&&(this.language||i(d),this.translator.language||this.translator.changeLanguage(d),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(d)),this.loadResources(d,f=>{o(f,d)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),s}getFixedT(e,n,r){var s=this;const i=function(o,a){let c;if(typeof a!="object"){for(var d=arguments.length,f=new Array(d>2?d-2:0),l=2;l`${c.keyPrefix}${u}${h}`):p=c.keyPrefix?`${c.keyPrefix}${u}${o}`:o,s.t(p,c)};return typeof e=="string"?i.lng=e:i.lngs=e,i.ns=n,i.keyPrefix=r,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(a,c)=>{const d=this.services.backendConnector.state[`${a}|${c}`];return d===-1||d===2};if(n.precheck){const a=n.precheck(this,o);if(a!==void 0)return a}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,e)&&(!s||o(i,e)))}loadNamespaces(e,n){const r=Nb();return this.options.ns?(typeof e=="string"&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}loadLanguages(e,n){const r=Nb();typeof e=="string"&&(e=[e]);const s=this.options.preload||[],i=e.filter(o=>s.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return i.length?(this.options.preload=s.concat(i),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new lU(dU());return n.indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new bx(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:P1;const r=e.forkResourceStore;r&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},i=new bx(s);return(e.debug!==void 0||e.prefix!==void 0)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(a=>{i[a]=this[a]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r&&(i.store=new oU(this.store.data,s),i.services.resourceStore=i.store),i.translator=new WE(i.services,s),i.translator.on("*",function(a){for(var c=arguments.length,d=new Array(c>1?c-1:0),f=1;f{const[e,n]=S.useState(!1),[r,s]=S.useState({title:"Título",description:"Descripción",cancelLabel:ne("common.no"),confirmLabel:ne("common.yes"),onCancel:()=>{},onConfirm:()=>{},...t}),i=(d,f)=>{d==null||d.preventDefault(),f&&s(f),n(!0)},o=d=>{d==null||d.preventDefault(),n(!1),r==null||r.onCancel(d)},a=d=>{d==null||d.preventDefault(),n(!1),r==null||r.onConfirm(d)},c=r?x.jsx(QZ,{isOpen:e,onCancel:o,onConfirm:a,title:r.title,description:r.description,cancelLabel:r.cancelLabel,confirmLabel:r.confirmLabel}):x.jsx(x.Fragment,{});return{openDialog:i,cancelDialog:o,confirmDialog:a,DialogComponent:c}};var eJ={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(self,()=>{return n={7629:(s,i,o)=>{const a=o(375),c=o(8571),d=o(9474),f=o(1687),l=o(8652),u=o(8160),p=o(3292),h=o(6354),m=o(8901),y=o(9708),g=o(6914),v=o(2294),b=o(6133),_=o(1152),A=o(8863),P=o(2036),T={Base:class{constructor(E){this.type=E,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new v.Ids,this._preferences=null,this._refs=new b.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return a(typeof y.describe=="function","Manifest functionality disabled"),y.describe(this)}allow(...E){return u.verifyFlat(E,"allow"),this._values(E,"_valids")}alter(E){a(E&&typeof E=="object"&&!Array.isArray(E),"Invalid targets argument"),a(!this._inRuleset(),"Cannot set alterations inside a ruleset");const N=this.clone();N.$_terms.alterations=N.$_terms.alterations||[];for(const k in E){const M=E[k];a(typeof M=="function","Alteration adjuster for",k,"must be a function"),N.$_terms.alterations.push({target:k,adjuster:M})}return N.$_temp.ruleset=!1,N}artifact(E){return a(E!==void 0,"Artifact cannot be undefined"),a(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",E)}cast(E){return a(E===!1||typeof E=="string","Invalid to value"),a(E===!1||this._definition.cast[E],"Type",this.type,"does not support casting to",E),this.$_setFlag("cast",E===!1?void 0:E)}default(E,N){return this._default("default",E,N)}description(E){return a(E&&typeof E=="string","Description must be a non-empty string"),this.$_setFlag("description",E)}empty(E){const N=this.clone();return E!==void 0&&(E=N.$_compile(E,{override:!1})),N.$_setFlag("empty",E,{clone:!1})}error(E){return a(E,"Missing error"),a(E instanceof Error||typeof E=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",E)}example(E,N={}){return a(E!==void 0,"Missing example"),u.assertOptions(N,["override"]),this._inner("examples",E,{single:!0,override:N.override})}external(E,N){return typeof E=="object"&&(a(!N,"Cannot combine options with description"),N=E.description,E=E.method),a(typeof E=="function","Method must be a function"),a(N===void 0||N&&typeof N=="string","Description must be a non-empty string"),this._inner("externals",{method:E,description:N},{single:!0})}failover(E,N){return this._default("failover",E,N)}forbidden(){return this.presence("forbidden")}id(E){return E?(a(typeof E=="string","id must be a non-empty string"),a(/^[^\.]+$/.test(E),"id cannot contain period character"),this.$_setFlag("id",E)):this.$_setFlag("id",void 0)}invalid(...E){return this._values(E,"_invalids")}label(E){return a(E&&typeof E=="string","Label name must be a non-empty string"),this.$_setFlag("label",E)}meta(E){return a(E!==void 0,"Meta cannot be undefined"),this._inner("metas",E,{single:!0})}note(...E){a(E.length,"Missing notes");for(const N of E)a(N&&typeof N=="string","Notes must be non-empty strings");return this._inner("notes",E)}only(E=!0){return a(typeof E=="boolean","Invalid mode:",E),this.$_setFlag("only",E)}optional(){return this.presence("optional")}prefs(E){a(E,"Missing preferences"),a(E.context===void 0,"Cannot override context"),a(E.externals===void 0,"Cannot override externals"),a(E.warnings===void 0,"Cannot override warnings"),a(E.debug===void 0,"Cannot override debug"),u.checkPreferences(E);const N=this.clone();return N._preferences=u.preferences(N._preferences,E),N}presence(E){return a(["optional","required","forbidden"].includes(E),"Unknown presence mode",E),this.$_setFlag("presence",E)}raw(E=!0){return this.$_setFlag("result",E?"raw":void 0)}result(E){return a(["raw","strip"].includes(E),"Unknown result mode",E),this.$_setFlag("result",E)}required(){return this.presence("required")}strict(E){const N=this.clone(),k=E!==void 0&&!E;return N._preferences=u.preferences(N._preferences,{convert:k}),N}strip(E=!0){return this.$_setFlag("result",E?"strip":void 0)}tag(...E){a(E.length,"Missing tags");for(const N of E)a(N&&typeof N=="string","Tags must be non-empty strings");return this._inner("tags",E)}unit(E){return a(E&&typeof E=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",E)}valid(...E){u.verifyFlat(E,"valid");const N=this.allow(...E);return N.$_setFlag("only",!!N._valids,{clone:!1}),N}when(E,N){const k=this.clone();k.$_terms.whens||(k.$_terms.whens=[]);const M=p.when(k,E,N);if(!["any","link"].includes(k.type)){const j=M.is?[M]:M.switch;for(const I of j)a(!I.then||I.then.type==="any"||I.then.type===k.type,"Cannot combine",k.type,"with",I.then&&I.then.type),a(!I.otherwise||I.otherwise.type==="any"||I.otherwise.type===k.type,"Cannot combine",k.type,"with",I.otherwise&&I.otherwise.type)}return k.$_terms.whens.push(M),k.$_mutateRebuild()}cache(E){a(!this._inRuleset(),"Cannot set caching inside a ruleset"),a(!this._cache,"Cannot override schema cache"),a(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const N=this.clone();return N._cache=E||l.provider.provision(),N.$_temp.ruleset=!1,N}clone(){const E=Object.create(Object.getPrototypeOf(this));return this._assign(E)}concat(E){a(u.isSchema(E),"Invalid schema object"),a(this.type==="any"||E.type==="any"||E.type===this.type,"Cannot merge type",this.type,"with another type:",E.type),a(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),a(!E._inRuleset(),"Cannot concatenate a schema with open ruleset");let N=this.clone();if(this.type==="any"&&E.type!=="any"){const k=E.clone();for(const M of Object.keys(N))M!=="type"&&(k[M]=N[M]);N=k}N._ids.concat(E._ids),N._refs.register(E,b.toSibling),N._preferences=N._preferences?u.preferences(N._preferences,E._preferences):E._preferences,N._valids=P.merge(N._valids,E._valids,E._invalids),N._invalids=P.merge(N._invalids,E._invalids,E._valids);for(const k of E._singleRules.keys())N._singleRules.has(k)&&(N._rules=N._rules.filter(M=>M.keep||M.name!==k),N._singleRules.delete(k));for(const k of E._rules)E._definition.rules[k.method].multi||N._singleRules.set(k.name,k),N._rules.push(k);if(N._flags.empty&&E._flags.empty){N._flags.empty=N._flags.empty.concat(E._flags.empty);const k=Object.assign({},E._flags);delete k.empty,f(N._flags,k)}else if(E._flags.empty){N._flags.empty=E._flags.empty;const k=Object.assign({},E._flags);delete k.empty,f(N._flags,k)}else f(N._flags,E._flags);for(const k in E.$_terms){const M=E.$_terms[k];M?N.$_terms[k]?N.$_terms[k]=N.$_terms[k].concat(M):N.$_terms[k]=M.slice():N.$_terms[k]||(N.$_terms[k]=M)}return this.$_root._tracer&&this.$_root._tracer._combine(N,[this,E]),N.$_mutateRebuild()}extend(E){return a(!E.base,"Cannot extend type with another base"),m.type(this,E)}extract(E){return E=Array.isArray(E)?E:E.split("."),this._ids.reach(E)}fork(E,N){a(!this._inRuleset(),"Cannot fork inside a ruleset");let k=this;for(let M of[].concat(E))M=Array.isArray(M)?M:M.split("."),k=k._ids.fork(M,N,k);return k.$_temp.ruleset=!1,k}rule(E){const N=this._definition;u.assertOptions(E,Object.keys(N.modifiers)),a(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const k=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;a(k>=0&&kk.tailor(E),ref:!1}),N.$_temp.ruleset=!1,N.$_mutateRebuild()}tracer(){return _.location?_.location(this):this}validate(E,N){return A.entry(E,this,N)}validateAsync(E,N){return A.entryAsync(E,this,N)}$_addRule(E){typeof E=="string"&&(E={name:E}),a(E&&typeof E=="object","Invalid options"),a(E.name&&typeof E.name=="string","Invalid rule name");for(const I in E)a(I[0]!=="_","Cannot set private rule properties");const N=Object.assign({},E);N._resolve=[],N.method=N.method||N.name;const k=this._definition.rules[N.method],M=N.args;a(k,"Unknown rule",N.method);const j=this.clone();if(M){a(Object.keys(M).length===1||Object.keys(M).length===this._definition.rules[N.name].args.length,"Invalid rule definition for",this.type,N.name);for(const I in M){let L=M[I];if(k.argsByName){const H=k.argsByName.get(I);if(H.ref&&u.isResolvable(L))N._resolve.push(I),j.$_mutateRegister(L);else if(H.normalize&&(L=H.normalize(L),M[I]=L),H.assert){const K=u.validateArg(L,I,H);a(!K,K,"or reference")}}L!==void 0?M[I]=L:delete M[I]}}return k.multi||(j._ruleRemove(N.name,{clone:!1}),j._singleRules.set(N.name,N)),j.$_temp.ruleset===!1&&(j.$_temp.ruleset=null),k.priority?j._rules.unshift(N):j._rules.push(N),j}$_compile(E,N){return p.schema(this.$_root,E,N)}$_createError(E,N,k,M,j,I={}){const L=I.flags!==!1?this._flags:{},H=I.messages?g.merge(this._definition.messages,I.messages):this._definition.messages;return new h.Report(E,N,k,L,H,M,j)}$_getFlag(E){return this._flags[E]}$_getRule(E){return this._singleRules.get(E)}$_mapLabels(E){return E=Array.isArray(E)?E:E.split("."),this._ids.labels(E)}$_match(E,N,k,M){(k=Object.assign({},k)).abortEarly=!0,k._externals=!1,N.snapshot();const j=!A.validate(E,this,N,k,M).errors;return N.restore(),j}$_modify(E){return u.assertOptions(E,["each","once","ref","schema"]),v.schema(this,E)||this}$_mutateRebuild(){return a(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(E,{source:N,name:k,path:M,key:j})=>{const I=this._definition[N][k]&&this._definition[N][k].register;I!==!1&&this.$_mutateRegister(E,{family:I,key:j})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(E,{family:N,key:k}={}){this._refs.register(E,N),this._ids.register(E,{key:k})}$_property(E){return this._definition.properties[E]}$_reach(E){return this._ids.reach(E)}$_rootReferences(){return this._refs.roots()}$_setFlag(E,N,k={}){a(E[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const M=this._definition.flags[E]||{};if(d(N,M.default)&&(N=void 0),d(N,this._flags[E]))return this;const j=k.clone!==!1?this.clone():this;return N!==void 0?(j._flags[E]=N,j.$_mutateRegister(N)):delete j._flags[E],E[0]!=="_"&&(j.$_temp.ruleset=!1),j}$_parent(E,...N){return this[E][u.symbols.parent].call(this,...N)}$_validate(E,N,k){return A.validate(E,this,N,k)}_assign(E){E.type=this.type,E.$_root=this.$_root,E.$_temp=Object.assign({},this.$_temp),E.$_temp.whens={},E._ids=this._ids.clone(),E._preferences=this._preferences,E._valids=this._valids&&this._valids.clone(),E._invalids=this._invalids&&this._invalids.clone(),E._rules=this._rules.slice(),E._singleRules=c(this._singleRules,{shallow:!0}),E._refs=this._refs.clone(),E._flags=Object.assign({},this._flags),E._cache=null,E.$_terms={};for(const N in this.$_terms)E.$_terms[N]=this.$_terms[N]?this.$_terms[N].slice():null;E.$_super={};for(const N in this.$_super)E.$_super[N]=this._super[N].bind(E);return E}_bare(){const E=this.clone();E._reset();const N=E._definition.terms;for(const k in N){const M=N[k];E.$_terms[k]=M.init}return E.$_mutateRebuild()}_default(E,N,k={}){return u.assertOptions(k,"literal"),a(N!==void 0,"Missing",E,"value"),a(typeof N=="function"||!k.literal,"Only function value supports literal option"),typeof N=="function"&&k.literal&&(N={[u.symbols.literal]:!0,literal:N}),this.$_setFlag(E,N)}_generate(E,N,k){if(!this.$_terms.whens)return{schema:this};const M=[],j=[];for(let H=0;HQ)break}const I=j.join(", ");if(N.mainstay.tracer.debug(N,"rule","when",I),!I)return{schema:this};if(!N.mainstay.tracer.active&&this.$_temp.whens[I])return{schema:this.$_temp.whens[I],id:I};let L=this;this._definition.generate&&(L=this._definition.generate(this,E,N,k));for(const H of M)L=L.concat(H);return this.$_root._tracer&&this.$_root._tracer._combine(L,[this,...M]),this.$_temp.whens[I]=L,{schema:L,id:I}}_inner(E,N,k={}){a(!this._inRuleset(),`Cannot set ${E} inside a ruleset`);const M=this.clone();return M.$_terms[E]&&!k.override||(M.$_terms[E]=[]),k.single?M.$_terms[E].push(N):M.$_terms[E].push(...N),M.$_temp.ruleset=!1,M}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(E,N={}){if(!this._singleRules.has(E))return this;const k=N.clone!==!1?this.clone():this;k._singleRules.delete(E);const M=[];for(let j=0;j{const a=o(375),c=o(8571),d=o(8160),f={max:1e3,supported:new Set(["undefined","boolean","number","string"])};i.provider={provision:l=>new f.Cache(l)},f.Cache=class{constructor(l={}){d.assertOptions(l,["max"]),a(l.max===void 0||l.max&&l.max>0&&isFinite(l.max),"Invalid max cache size"),this._max=l.max||f.max,this._map=new Map,this._list=new f.List}get length(){return this._map.size}set(l,u){if(l!==null&&!f.supported.has(typeof l))return;let p=this._map.get(l);if(p)return p.value=u,void this._list.first(p);p=this._list.unshift({key:l,value:u}),this._map.set(l,p),this._compact()}get(l){const u=this._map.get(l);if(u)return this._list.first(u),c(u.value)}_compact(){if(this._map.size>this._max){const l=this._list.pop();this._map.delete(l.key)}}},f.List=class{constructor(){this.tail=null,this.head=null}unshift(l){return l.next=null,l.prev=this.head,this.head&&(this.head.next=l),this.head=l,this.tail||(this.tail=l),l}first(l){l!==this.head&&(this._remove(l),this.unshift(l))}pop(){return this._remove(this.tail)}_remove(l){const{next:u,prev:p}=l;return u.prev=p,p&&(p.next=u),l===this.tail&&(this.tail=u),l.prev=null,l.next=null,l}}},8160:(s,i,o)=>{const a=o(375),c=o(7916),d=o(5934);let f,l;const u={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};i.version=d.version,i.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1},i.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")},i.assertOptions=function(p,h,m="Options"){a(p&&typeof p=="object"&&!Array.isArray(p),"Options must be of type object");const y=Object.keys(p).filter(g=>!h.includes(g));a(y.length===0,`${m} contain unknown keys: ${y}`)},i.checkPreferences=function(p){l=l||o(3378);const h=l.preferences.validate(p);if(h.error)throw new c([h.error.details[0].message])},i.compare=function(p,h,m){switch(m){case"=":return p===h;case">":return p>h;case"<":return p=":return p>=h;case"<=":return p<=h}},i.default=function(p,h){return p===void 0?h:p},i.isIsoDate=function(p){return u.isoDate.test(p)},i.isNumber=function(p){return typeof p=="number"&&!isNaN(p)},i.isResolvable=function(p){return!!p&&(p[i.symbols.ref]||p[i.symbols.template])},i.isSchema=function(p,h={}){const m=p&&p[i.symbols.any];return!!m&&(a(h.legacy||m.version===i.version,"Cannot mix different versions of joi schemas"),!0)},i.isValues=function(p){return p[i.symbols.values]},i.limit=function(p){return Number.isSafeInteger(p)&&p>=0},i.preferences=function(p,h){f=f||o(6914),p=p||{},h=h||{};const m=Object.assign({},p,h);return h.errors&&p.errors&&(m.errors=Object.assign({},p.errors,h.errors),m.errors.wrap=Object.assign({},p.errors.wrap,h.errors.wrap)),h.messages&&(m.messages=f.compile(h.messages,p.messages)),delete m[i.symbols.prefs],m},i.tryWithPath=function(p,h,m={}){try{return p()}catch(y){throw y.path!==void 0?y.path=h+"."+y.path:y.path=h,m.append&&(y.message=`${y.message} (${y.path})`),y}},i.validateArg=function(p,h,{assert:m,message:y}){if(i.isSchema(m)){const g=m.validate(p);return g.error?g.error.message:void 0}if(!m(p))return h?`${h} ${y}`:y},i.verifyFlat=function(p,h){for(const m of p)a(!Array.isArray(m),"Method no longer accepts array arguments:",h)}},3292:(s,i,o)=>{const a=o(375),c=o(8160),d=o(6133),f={};i.schema=function(l,u,p={}){c.assertOptions(p,["appendPath","override"]);try{return f.schema(l,u,p)}catch(h){throw p.appendPath&&h.path!==void 0&&(h.message=`${h.message} (${h.path})`),h}},f.schema=function(l,u,p){a(u!==void 0,"Invalid undefined schema"),Array.isArray(u)&&(a(u.length,"Invalid empty array schema"),u.length===1&&(u=u[0]));const h=(m,...y)=>p.override!==!1?m.valid(l.override,...y):m.valid(...y);if(f.simple(u))return h(l,u);if(typeof u=="function")return l.custom(u);if(a(typeof u=="object","Invalid schema content:",typeof u),c.isResolvable(u))return h(l,u);if(c.isSchema(u))return u;if(Array.isArray(u)){for(const m of u)if(!f.simple(m))return l.alternatives().try(...u);return h(l,...u)}return u instanceof RegExp?l.string().regex(u):u instanceof Date?h(l.date(),u):(a(Object.getPrototypeOf(u)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),l.object().keys(u))},i.ref=function(l,u){return d.isRef(l)?l:d.create(l,u)},i.compile=function(l,u,p={}){c.assertOptions(p,["legacy"]);const h=u&&u[c.symbols.any];if(h)return a(p.legacy||h.version===c.version,"Cannot mix different versions of joi schemas:",h.version,c.version),u;if(typeof u!="object"||!p.legacy)return i.schema(l,u,{appendPath:!0});const m=f.walk(u);return m?m.compile(m.root,u):i.schema(l,u,{appendPath:!0})},f.walk=function(l){if(typeof l!="object")return null;if(Array.isArray(l)){for(const p of l){const h=f.walk(p);if(h)return h}return null}const u=l[c.symbols.any];if(u)return{root:l[u.root],compile:u.compile};a(Object.getPrototypeOf(l)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const p in l){const h=f.walk(l[p]);if(h)return h}return null},f.simple=function(l){return l===null||["boolean","string","number"].includes(typeof l)},i.when=function(l,u,p){if(p===void 0&&(a(u&&typeof u=="object","Missing options"),p=u,u=d.create(".")),Array.isArray(p)&&(p={switch:p}),c.assertOptions(p,["is","not","then","otherwise","switch","break"]),c.isSchema(u))return a(p.is===void 0,'"is" can not be used with a schema condition'),a(p.not===void 0,'"not" can not be used with a schema condition'),a(p.switch===void 0,'"switch" can not be used with a schema condition'),f.condition(l,{is:u,then:p.then,otherwise:p.otherwise,break:p.break});if(a(d.isRef(u)||typeof u=="string","Invalid condition:",u),a(p.not===void 0||p.is===void 0,'Cannot combine "is" with "not"'),p.switch===void 0){let m=p;p.not!==void 0&&(m={is:p.not,then:p.otherwise,otherwise:p.then,break:p.break});let y=m.is!==void 0?l.$_compile(m.is):l.$_root.invalid(null,!1,0,"").required();return a(m.then!==void 0||m.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),a(m.break===void 0||m.then===void 0||m.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),p.is===void 0||d.isRef(p.is)||c.isSchema(p.is)||(y=y.required()),f.condition(l,{ref:i.ref(u),is:y,then:m.then,otherwise:m.otherwise,break:m.break})}a(Array.isArray(p.switch),'"switch" must be an array'),a(p.is===void 0,'Cannot combine "switch" with "is"'),a(p.not===void 0,'Cannot combine "switch" with "not"'),a(p.then===void 0,'Cannot combine "switch" with "then"');const h={ref:i.ref(u),switch:[],break:p.break};for(let m=0;m{const a=o(5688),c=o(8160),d=o(3328);i.Report=class{constructor(f,l,u,p,h,m,y){if(this.code=f,this.flags=p,this.messages=h,this.path=m.path,this.prefs=y,this.state=m,this.value=l,this.message=null,this.template=null,this.local=u||{},this.local.label=i.label(this.flags,this.state,this.prefs,this.messages),this.value===void 0||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const g=this.path[this.path.length-1];typeof g!="object"&&(this.local.key=g)}}_setTemplate(f){if(this.template=f,!this.flags.label&&this.path.length===0){const l=this._template(this.template,"root");l&&(this.local.label=l)}}toString(){if(this.message)return this.message;const f=this.code;if(!this.prefs.errors.render)return this.code;const l=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return l===void 0?`Error code "${f}" is not defined, your custom type is missing the correct messages definition`:(this.message=l.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(f,l){return i.template(this.value,f,l||this.code,this.state,this.prefs)}},i.path=function(f){let l="";for(const u of f)typeof u!="object"&&(typeof u=="string"?(l&&(l+="."),l+=u):l+=`[${u}]`);return l},i.template=function(f,l,u,p,h){if(!l)return;if(d.isTemplate(l))return u!=="root"?l:null;let m=h.errors.language;if(c.isResolvable(m)&&(m=m.resolve(f,p,h)),m&&l[m]){if(l[m][u]!==void 0)return l[m][u];if(l[m]["*"]!==void 0)return l[m]["*"]}return l[u]?l[u]:l["*"]},i.label=function(f,l,u,p){if(!u.errors.label)return"";if(f.label)return f.label;let h=l.path;return u.errors.label==="key"&&l.path.length>1&&(h=l.path.slice(-1)),i.path(h)||i.template(null,u.messages,"root",l,u)||p&&i.template(null,p,"root",l,u)||"value"},i.process=function(f,l,u){if(!f)return null;const{override:p,message:h,details:m}=i.details(f);if(p)return p;if(u.errors.stack)return new i.ValidationError(h,m,l);const y=Error.stackTraceLimit;Error.stackTraceLimit=0;const g=new i.ValidationError(h,m,l);return Error.stackTraceLimit=y,g},i.details=function(f,l={}){let u=[];const p=[];for(const h of f){if(h instanceof Error){if(l.override!==!1)return{override:h};const y=h.toString();u.push(y),p.push({message:y,type:"override",context:{error:h}});continue}const m=h.toString();u.push(m),p.push({message:m,path:h.path.filter(y=>typeof y!="object"),type:h.code,context:h.local})}return u.length>1&&(u=[...new Set(u)]),{message:u.join(". "),details:p}},i.ValidationError=class extends Error{constructor(f,l,u){super(f),this._original=u,this.details=l}static isError(f){return f instanceof i.ValidationError}},i.ValidationError.prototype.isJoi=!0,i.ValidationError.prototype.name="ValidationError",i.ValidationError.prototype.annotate=a.error},8901:(s,i,o)=>{const a=o(375),c=o(8571),d=o(8160),f=o(6914),l={};i.type=function(u,p){const h=Object.getPrototypeOf(u),m=c(h),y=u._assign(Object.create(m)),g=Object.assign({},p);delete g.base,m._definition=g;const v=h._definition||{};g.messages=f.merge(v.messages,g.messages),g.properties=Object.assign({},v.properties,g.properties),y.type=g.type,g.flags=Object.assign({},v.flags,g.flags);const b=Object.assign({},v.terms);if(g.terms)for(const T in g.terms){const E=g.terms[T];a(y.$_terms[T]===void 0,"Invalid term override for",g.type,T),y.$_terms[T]=E.init,b[T]=E}g.terms=b,g.args||(g.args=v.args),g.prepare=l.prepare(g.prepare,v.prepare),g.coerce&&(typeof g.coerce=="function"&&(g.coerce={method:g.coerce}),g.coerce.from&&!Array.isArray(g.coerce.from)&&(g.coerce={method:g.coerce.method,from:[].concat(g.coerce.from)})),g.coerce=l.coerce(g.coerce,v.coerce),g.validate=l.validate(g.validate,v.validate);const _=Object.assign({},v.rules);if(g.rules)for(const T in g.rules){const E=g.rules[T];a(typeof E=="object","Invalid rule definition for",g.type,T);let N=E.method;if(N===void 0&&(N=function(){return this.$_addRule(T)}),N&&(a(!m[T],"Rule conflict in",g.type,T),m[T]=N),a(!_[T],"Rule conflict in",g.type,T),_[T]=E,E.alias){const k=[].concat(E.alias);for(const M of k)m[M]=E.method}E.args&&(E.argsByName=new Map,E.args=E.args.map(k=>(typeof k=="string"&&(k={name:k}),a(!E.argsByName.has(k.name),"Duplicated argument name",k.name),d.isSchema(k.assert)&&(k.assert=k.assert.strict().label(k.name)),E.argsByName.set(k.name,k),k)))}g.rules=_;const A=Object.assign({},v.modifiers);if(g.modifiers)for(const T in g.modifiers){a(!m[T],"Rule conflict in",g.type,T);const E=g.modifiers[T];a(typeof E=="function","Invalid modifier definition for",g.type,T);const N=function(k){return this.rule({[T]:k})};m[T]=N,A[T]=E}if(g.modifiers=A,g.overrides){m._super=h,y.$_super={};for(const T in g.overrides)a(h[T],"Cannot override missing",T),g.overrides[T][d.symbols.parent]=h[T],y.$_super[T]=h[T].bind(y);Object.assign(m,g.overrides)}g.cast=Object.assign({},v.cast,g.cast);const P=Object.assign({},v.manifest,g.manifest);return P.build=l.build(g.manifest&&g.manifest.build,v.manifest&&v.manifest.build),g.manifest=P,g.rebuild=l.rebuild(g.rebuild,v.rebuild),y},l.build=function(u,p){return u&&p?function(h,m){return p(u(h,m),m)}:u||p},l.coerce=function(u,p){return u&&p?{from:u.from&&p.from?[...new Set([...u.from,...p.from])]:null,method(h,m){let y;if((!p.from||p.from.includes(typeof h))&&(y=p.method(h,m),y)){if(y.errors||y.value===void 0)return y;h=y.value}if(!u.from||u.from.includes(typeof h)){const g=u.method(h,m);if(g)return g}return y}}:u||p},l.prepare=function(u,p){return u&&p?function(h,m){const y=u(h,m);if(y){if(y.errors||y.value===void 0)return y;h=y.value}return p(h,m)||y}:u||p},l.rebuild=function(u,p){return u&&p?function(h){p(h),u(h)}:u||p},l.validate=function(u,p){return u&&p?function(h,m){const y=p(h,m);if(y){if(y.errors&&(!Array.isArray(y.errors)||y.errors.length))return y;h=y.value}return u(h,m)||y}:u||p}},5107:(s,i,o)=>{const a=o(375),c=o(8571),d=o(8652),f=o(8160),l=o(3292),u=o(6354),p=o(8901),h=o(9708),m=o(6133),y=o(3328),g=o(1152);let v;const b={types:{alternatives:o(4946),any:o(8068),array:o(546),boolean:o(4937),date:o(7500),function:o(390),link:o(8785),number:o(3832),object:o(8966),string:o(7417),symbol:o(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const _={_types:new Set(Object.keys(b.types))};for(const A of _._types)_[A]=function(...P){return a(!P.length||["alternatives","link","object"].includes(A),"The",A,"type does not allow arguments"),b.generate(this,b.types[A],P)};for(const A of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])_[A]=function(...P){return this.any()[A](...P)};Object.assign(_,b.methods);for(const A in b.aliases){const P=b.aliases[A];_[A]=_[P]}return _.x=_.expression,g.setup&&g.setup(_),_}};b.methods={ValidationError:u.ValidationError,version:f.version,cache:d.provider,assert(_,A,...P){b.assert(_,A,!0,P)},attempt:(_,A,...P)=>b.assert(_,A,!1,P),build(_){return a(typeof h.build=="function","Manifest functionality disabled"),h.build(this,_)},checkPreferences(_){f.checkPreferences(_)},compile(_,A){return l.compile(this,_,A)},defaults(_){a(typeof _=="function","modifier must be a function");const A=Object.assign({},this);for(const P of A._types){const T=_(A[P]());a(f.isSchema(T),"modifier must return a valid schema object"),A[P]=function(...E){return b.generate(this,T,E)}}return A},expression:(..._)=>new y(..._),extend(..._){f.verifyFlat(_,"extend"),v=v||o(3378),a(_.length,"You need to provide at least one extension"),this.assert(_,v.extensions);const A=Object.assign({},this);A._types=new Set(A._types);for(let P of _){typeof P=="function"&&(P=P(A)),this.assert(P,v.extension);const T=b.expandExtension(P,A);for(const E of T){a(A[E.type]===void 0||A._types.has(E.type),"Cannot override name",E.type);const N=E.base||this.any(),k=p.type(N,E);A._types.add(E.type),A[E.type]=function(...M){return b.generate(this,k,M)}}}return A},isError:u.ValidationError.isError,isExpression:y.isTemplate,isRef:m.isRef,isSchema:f.isSchema,in:(..._)=>m.in(..._),override:f.symbols.override,ref:(..._)=>m.create(..._),types(){const _={};for(const A of this._types)_[A]=this[A]();for(const A in b.aliases)_[A]=this[A]();return _}},b.assert=function(_,A,P,T){const E=T[0]instanceof Error||typeof T[0]=="string"?T[0]:null,N=E!==null?T[1]:T[0],k=A.validate(_,f.preferences({errors:{stack:!0}},N||{}));let M=k.error;if(!M)return k.value;if(E instanceof Error)throw E;const j=P&&typeof M.annotate=="function"?M.annotate():M.message;throw M instanceof u.ValidationError==0&&(M=c(M)),M.message=E?`${E} ${j}`:j,M},b.generate=function(_,A,P){return a(_,"Must be invoked on a Joi instance."),A.$_root=_,A._definition.args&&P.length?A._definition.args(A,...P):A},b.expandExtension=function(_,A){if(typeof _.type=="string")return[_];const P=[];for(const T of A._types)if(_.type.test(T)){const E=Object.assign({},_);E.type=T,E.base=A[T](),P.push(E)}return P},s.exports=b.root()},6914:(s,i,o)=>{const a=o(375),c=o(8571),d=o(3328);i.compile=function(f,l){if(typeof f=="string")return a(!l,"Cannot set single message string"),new d(f);if(d.isTemplate(f))return a(!l,"Cannot set single message template"),f;a(typeof f=="object"&&!Array.isArray(f),"Invalid message options"),l=l?c(l):{};for(let u in f){const p=f[u];if(u==="root"||d.isTemplate(p)){l[u]=p;continue}if(typeof p=="string"){l[u]=new d(p);continue}a(typeof p=="object"&&!Array.isArray(p),"Invalid message for",u);const h=u;for(u in l[h]=l[h]||{},p){const m=p[u];u==="root"||d.isTemplate(m)?l[h][u]=m:(a(typeof m=="string","Invalid message for",u,"in",h),l[h][u]=new d(m))}}return l},i.decompile=function(f){const l={};for(let u in f){const p=f[u];if(u==="root"){l.root=p;continue}if(d.isTemplate(p)){l[u]=p.describe({compact:!0});continue}const h=u;for(u in l[h]={},p){const m=p[u];u!=="root"?l[h][u]=m.describe({compact:!0}):l[h].root=m}}return l},i.merge=function(f,l){if(!f)return i.compile(l);if(!l)return f;if(typeof l=="string")return new d(l);if(d.isTemplate(l))return l;const u=c(f);for(let p in l){const h=l[p];if(p==="root"||d.isTemplate(h)){u[p]=h;continue}if(typeof h=="string"){u[p]=new d(h);continue}a(typeof h=="object"&&!Array.isArray(h),"Invalid message for",p);const m=p;for(p in u[m]=u[m]||{},h){const y=h[p];p==="root"||d.isTemplate(y)?u[m][p]=y:(a(typeof y=="string","Invalid message for",p,"in",m),u[m][p]=new d(y))}}return u}},2294:(s,i,o)=>{const a=o(375),c=o(8160),d=o(6133),f={};i.Ids=f.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const l=new f.Ids;return l._byId=new Map(this._byId),l._byKey=new Map(this._byKey),l._schemaChain=this._schemaChain,l}concat(l){l._schemaChain&&(this._schemaChain=!0);for(const[u,p]of l._byId.entries())a(!this._byKey.has(u),"Schema id conflicts with existing key:",u),this._byId.set(u,p);for(const[u,p]of l._byKey.entries())a(!this._byId.has(u),"Schema key conflicts with existing id:",u),this._byKey.set(u,p)}fork(l,u,p){const h=this._collect(l);h.push({schema:p});const m=h.shift();let y={id:m.id,schema:u(m.schema)};a(c.isSchema(y.schema),"adjuster function failed to return a joi schema type");for(const g of h)y={id:g.id,schema:f.fork(g.schema,y.id,y.schema)};return y.schema}labels(l,u=[]){const p=l[0],h=this._get(p);if(!h)return[...u,...l].join(".");const m=l.slice(1);return u=[...u,h.schema._flags.label||p],m.length?h.schema._ids.labels(m,u):u.join(".")}reach(l,u=[]){const p=l[0],h=this._get(p);a(h,"Schema does not contain path",[...u,...l].join("."));const m=l.slice(1);return m.length?h.schema._ids.reach(m,[...u,p]):h.schema}register(l,{key:u}={}){if(!l||!c.isSchema(l))return;(l.$_property("schemaChain")||l._ids._schemaChain)&&(this._schemaChain=!0);const p=l._flags.id;if(p){const h=this._byId.get(p);a(!h||h.schema===l,"Cannot add different schemas with the same id:",p),a(!this._byKey.has(p),"Schema id conflicts with existing key:",p),this._byId.set(p,{schema:l,id:p})}u&&(a(!this._byKey.has(u),"Schema already contains key:",u),a(!this._byId.has(u),"Schema key conflicts with existing id:",u),this._byKey.set(u,{schema:l,id:u}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(l,u=[],p=[]){const h=l[0],m=this._get(h);a(m,"Schema does not contain path",[...u,...l].join(".")),p=[m,...p];const y=l.slice(1);return y.length?m.schema._ids._collect(y,[...u,h],p):p}_get(l){return this._byId.get(l)||this._byKey.get(l)}},f.fork=function(l,u,p){const h=i.schema(l,{each:(m,{key:y})=>{if(u===(m._flags.id||y))return p},ref:!1});return h?h.$_mutateRebuild():l},i.schema=function(l,u){let p;for(const h in l._flags){if(h[0]==="_")continue;const m=f.scan(l._flags[h],{source:"flags",name:h},u);m!==void 0&&(p=p||l.clone(),p._flags[h]=m)}for(let h=0;h{const a=o(375),c=o(8571),d=o(9621),f=o(8160);let l;const u={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};i.create=function(p,h={}){a(typeof p=="string","Invalid reference key:",p),f.assertOptions(h,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),a(!h.prefix||typeof h.prefix=="object","options.prefix must be of type object");const m=Object.assign({},u.defaults,h);delete m.prefix;const y=m.separator,g=u.context(p,y,h.prefix);if(m.type=g.type,p=g.key,m.type==="value")if(g.root&&(a(!y||p[0]!==y,"Cannot specify relative path with root prefix"),m.ancestor="root",p||(p=null)),y&&y===p)p=null,m.ancestor=0;else if(m.ancestor!==void 0)a(!y||!p||p[0]!==y,"Cannot combine prefix with ancestor option");else{const[v,b]=u.ancestor(p,y);b&&(p=p.slice(b))===""&&(p=null),m.ancestor=v}return m.path=y?p===null?[]:p.split(y):[p],new u.Ref(m)},i.in=function(p,h={}){return i.create(p,{...h,in:!0})},i.isRef=function(p){return!!p&&!!p[f.symbols.ref]},u.Ref=class{constructor(p){a(typeof p=="object","Invalid reference construction"),f.assertOptions(p,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),a([!1,void 0].includes(p.separator)||typeof p.separator=="string"&&p.separator.length===1,"Invalid separator"),a(!p.adjust||typeof p.adjust=="function","options.adjust must be a function"),a(!p.map||Array.isArray(p.map),"options.map must be an array"),a(!p.map||!p.adjust,"Cannot set both map and adjust options"),Object.assign(this,u.defaults,p),a(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(p,h,m,y,g={}){return a(!this.in||g.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(m.context,h,g):this.type==="local"?this._resolve(y,h,g):this.ancestor?this.ancestor==="root"?this._resolve(h.ancestors[h.ancestors.length-1],h,g):(a(this.ancestor<=h.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(h.ancestors[this.ancestor-1],h,g)):this._resolve(p,h,g)}_resolve(p,h,m){let y;if(this.type==="value"&&h.mainstay.shadow&&m.shadow!==!1&&(y=h.mainstay.shadow.get(this.absolute(h))),y===void 0&&(y=d(p,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(y=this.adjust(y)),this.map){const g=this.map.get(y);g!==void 0&&(y=g)}return h.mainstay&&h.mainstay.tracer.resolve(h,this,y),y}toString(){return this.display}absolute(p){return[...p.path.slice(0,-this.ancestor),...this.path]}clone(){return new u.Ref(this)}describe(){const p={path:this.path};this.type!=="value"&&(p.type=this.type),this.separator!=="."&&(p.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(p.ancestor=this.ancestor),this.map&&(p.map=[...this.map]);for(const h of["adjust","iterables","render"])this[h]!==null&&this[h]!==void 0&&(p[h]=this[h]);return this.in!==!1&&(p.in=!0),{ref:p}}updateDisplay(){const p=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${p}`);if(!this.separator)return void(this.display=`ref:${p}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${p}`);if(this.ancestor==="root")return void(this.display=`ref:root:${p}`);if(this.ancestor===1)return void(this.display=`ref:${p||".."}`);const h=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${h}${p||""}`}},u.Ref.prototype[f.symbols.ref]=!0,i.build=function(p){return(p=Object.assign({},u.defaults,p)).type==="value"&&p.ancestor===void 0&&(p.ancestor=1),new u.Ref(p)},u.context=function(p,h,m={}){if(p=p.trim(),m){const y=m.global===void 0?"$":m.global;if(y!==h&&p.startsWith(y))return{key:p.slice(y.length),type:"global"};const g=m.local===void 0?"#":m.local;if(g!==h&&p.startsWith(g))return{key:p.slice(g.length),type:"local"};const v=m.root===void 0?"/":m.root;if(v!==h&&p.startsWith(v))return{key:p.slice(v.length),type:"value",root:!0}}return{key:p,type:"value"}},u.ancestor=function(p,h){if(!h)return[1,0];if(p[0]!==h)return[1,0];if(p[1]!==h)return[0,1];let m=2;for(;p[m]===h;)++m;return[m-1,m]},i.toSibling=0,i.toParent=1,i.Manager=class{constructor(){this.refs=[]}register(p,h){if(p)if(h=h===void 0?i.toParent:h,Array.isArray(p))for(const m of p)this.register(m,h);else if(f.isSchema(p))for(const m of p._refs.refs)m.ancestor-h>=0&&this.refs.push({ancestor:m.ancestor-h,root:m.root});else i.isRef(p)&&p.type==="value"&&p.ancestor-h>=0&&this.refs.push({ancestor:p.ancestor-h,root:p.root}),l=l||o(3328),l.isTemplate(p)&&this.register(p.refs(),h)}get length(){return this.refs.length}clone(){const p=new i.Manager;return p.refs=c(this.refs),p}reset(){this.refs=[]}roots(){return this.refs.filter(p=>!p.ancestor).map(p=>p.root)}}},3378:(s,i,o)=>{const a=o(5107),c={};c.wrap=a.string().min(1).max(2).allow(!1),i.preferences=a.object({allowUnknown:a.boolean(),abortEarly:a.boolean(),artifacts:a.boolean(),cache:a.boolean(),context:a.object(),convert:a.boolean(),dateFormat:a.valid("date","iso","string","time","utc"),debug:a.boolean(),errors:{escapeHtml:a.boolean(),label:a.valid("path","key",!1),language:[a.string(),a.object().ref()],render:a.boolean(),stack:a.boolean(),wrap:{label:c.wrap,array:c.wrap,string:c.wrap}},externals:a.boolean(),messages:a.object(),noDefaults:a.boolean(),nonEnumerables:a.boolean(),presence:a.valid("required","optional","forbidden"),skipFunctions:a.boolean(),stripUnknown:a.object({arrays:a.boolean(),objects:a.boolean()}).or("arrays","objects").allow(!0,!1),warnings:a.boolean()}).strict(),c.nameRx=/^[a-zA-Z0-9]\w*$/,c.rule=a.object({alias:a.array().items(a.string().pattern(c.nameRx)).single(),args:a.array().items(a.string(),a.object({name:a.string().pattern(c.nameRx).required(),ref:a.boolean(),assert:a.alternatives([a.function(),a.object().schema()]).conditional("ref",{is:!0,then:a.required()}),normalize:a.function(),message:a.string().when("assert",{is:a.function(),then:a.required()})})),convert:a.boolean(),manifest:a.boolean(),method:a.function().allow(!1),multi:a.boolean(),validate:a.function()}),i.extension=a.object({type:a.alternatives([a.string(),a.object().regex()]).required(),args:a.function(),cast:a.object().pattern(c.nameRx,a.object({from:a.function().maxArity(1).required(),to:a.function().minArity(1).maxArity(2).required()})),base:a.object().schema().when("type",{is:a.object().regex(),then:a.forbidden()}),coerce:[a.function().maxArity(3),a.object({method:a.function().maxArity(3).required(),from:a.array().items(a.string()).single()})],flags:a.object().pattern(c.nameRx,a.object({setter:a.string(),default:a.any()})),manifest:{build:a.function().arity(2)},messages:[a.object(),a.string()],modifiers:a.object().pattern(c.nameRx,a.function().minArity(1).maxArity(2)),overrides:a.object().pattern(c.nameRx,a.function()),prepare:a.function().maxArity(3),rebuild:a.function().arity(1),rules:a.object().pattern(c.nameRx,c.rule),terms:a.object().pattern(c.nameRx,a.object({init:a.array().allow(null).required(),manifest:a.object().pattern(/.+/,[a.valid("schema","single"),a.object({mapped:a.object({from:a.string().required(),to:a.string().required()}).required()})])})),validate:a.function().maxArity(3)}).strict(),i.extensions=a.array().items(a.object(),a.function().arity(1)).strict(),c.desc={buffer:a.object({buffer:a.string()}),func:a.object({function:a.function().required(),options:{literal:!0}}),override:a.object({override:!0}),ref:a.object({ref:a.object({type:a.valid("value","global","local"),path:a.array().required(),separator:a.string().length(1).allow(!1),ancestor:a.number().min(0).integer().allow("root"),map:a.array().items(a.array().length(2)).min(1),adjust:a.function(),iterables:a.boolean(),in:a.boolean(),render:a.boolean()}).required()}),regex:a.object({regex:a.string().min(3)}),special:a.object({special:a.valid("deep").required()}),template:a.object({template:a.string().required(),options:a.object()}),value:a.object({value:a.alternatives([a.object(),a.array()]).required()})},c.desc.entity=a.alternatives([a.array().items(a.link("...")),a.boolean(),a.function(),a.number(),a.string(),c.desc.buffer,c.desc.func,c.desc.ref,c.desc.regex,c.desc.special,c.desc.template,c.desc.value,a.link("/")]),c.desc.values=a.array().items(null,a.boolean(),a.function(),a.number().allow(1/0,-1/0),a.string().allow(""),a.symbol(),c.desc.buffer,c.desc.func,c.desc.override,c.desc.ref,c.desc.regex,c.desc.template,c.desc.value),c.desc.messages=a.object().pattern(/.+/,[a.string(),c.desc.template,a.object().pattern(/.+/,[a.string(),c.desc.template])]),i.description=a.object({type:a.string().required(),flags:a.object({cast:a.string(),default:a.any(),description:a.string(),empty:a.link("/"),failover:c.desc.entity,id:a.string(),label:a.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:a.boolean(),unit:a.string()}).unknown(),preferences:{allowUnknown:a.boolean(),abortEarly:a.boolean(),artifacts:a.boolean(),cache:a.boolean(),convert:a.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:a.boolean(),label:["path","key"],language:[a.string(),c.desc.ref],wrap:{label:c.wrap,array:c.wrap}},externals:a.boolean(),messages:c.desc.messages,noDefaults:a.boolean(),nonEnumerables:a.boolean(),presence:["required","optional","forbidden"],skipFunctions:a.boolean(),stripUnknown:a.object({arrays:a.boolean(),objects:a.boolean()}).or("arrays","objects").allow(!0,!1),warnings:a.boolean()},allow:c.desc.values,invalid:c.desc.values,rules:a.array().min(1).items({name:a.string().required(),args:a.object().min(1),keep:a.boolean(),message:[a.string(),c.desc.messages],warn:a.boolean()}),keys:a.object().pattern(/.*/,a.link("/")),link:c.desc.ref}).pattern(/^[a-z]\w*$/,a.any())},493:(s,i,o)=>{const a=o(8571),c=o(9621),d=o(8160),f={value:Symbol("value")};s.exports=f.State=class{constructor(l,u,p){this.path=l,this.ancestors=u,this.mainstay=p.mainstay,this.schemas=p.schemas,this.debug=null}localize(l,u=null,p=null){const h=new f.State(l,u,this);return p&&h.schemas&&(h.schemas=[f.schemas(p),...h.schemas]),h}nest(l,u){const p=new f.State(this.path,this.ancestors,this);return p.schemas=p.schemas&&[f.schemas(l),...p.schemas],p.debug=u,p}shadow(l,u){this.mainstay.shadow=this.mainstay.shadow||new f.Shadow,this.mainstay.shadow.set(this.path,l,u)}snapshot(){this.mainstay.shadow&&(this._snapshot=a(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}},f.schemas=function(l){return d.isSchema(l)?{schema:l}:l},f.Shadow=class{constructor(){this._values=null}set(l,u,p){if(!l.length||p==="strip"&&typeof l[l.length-1]=="number")return;this._values=this._values||new Map;let h=this._values;for(let m=0;m{const a=o(375),c=o(8571),d=o(5277),f=o(1447),l=o(8160),u=o(6354),p=o(6133),h={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};s.exports=h.Template=class{constructor(m,y){if(a(typeof m=="string","Template source must be a string"),a(!m.includes("\0")&&!m.includes(""),"Template source cannot contain reserved control characters"),this.source=m,this.rendered=m,this._template=null,y){const{functions:g,...v}=y;this._settings=Object.keys(v).length?c(v):void 0,this._functions=g,this._functions&&(a(Object.keys(this._functions).every(b=>typeof b=="string"),"Functions keys must be strings"),a(Object.values(this._functions).every(b=>typeof b=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const m=h.encode(this.source),y=h.split(m);let g=!1;const v=[],b=y.shift();b&&v.push(b);for(const _ of y){const A=_[0]!=="{",P=A?"}":"}}",T=_.indexOf(P);if(T===-1||_[1]==="{"){v.push(`{${h.decode(_)}`);continue}let E=_.slice(A?0:1,T);const N=E[0]===":";N&&(E=E.slice(1));const k=this._ref(h.decode(E),{raw:A,wrapped:N});v.push(k),typeof k!="string"&&(g=!0);const M=_.slice(T+P.length);M&&v.push(h.decode(M))}g?this._template=v:this.rendered=v.join("")}static date(m,y){return h.dateFormat[y.dateFormat].call(m)}describe(m={}){if(!this._settings&&m.compact)return this.source;const y={template:this.source};return this._settings&&(y.options=this._settings),this._functions&&(y.functions=this._functions),y}static build(m){return new h.Template(m.template,m.options||m.functions?{...m.options,functions:m.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(m){return!!m&&!!m[l.symbols.template]}refs(){if(!this._template)return;const m=[];for(const y of this._template)typeof y!="string"&&m.push(...y.refs);return m}resolve(m,y,g,v){return this._template&&this._template.length===1?this._part(this._template[0],m,y,g,v,{}):this.render(m,y,g,v)}_part(m,...y){return m.ref?m.ref.resolve(...y):m.formula.evaluate(y)}render(m,y,g,v,b={}){if(!this.isDynamic())return this.rendered;const _=[];for(const A of this._template)if(typeof A=="string")_.push(A);else{const P=this._part(A,m,y,g,v,b),T=h.stringify(P,m,y,g,v,b);if(T!==void 0){const E=A.raw||(b.errors&&b.errors.escapeHtml)===!1?T:d(T);_.push(h.wrap(E,A.wrapped&&g.errors.wrap.label))}}return _.join("")}_ref(m,{raw:y,wrapped:g}){const v=[],b=A=>{const P=p.create(A,this._settings);return v.push(P),T=>{const E=P.resolve(...T);return E!==void 0?E:null}};try{const A=this._functions?{...h.functions,...this._functions}:h.functions;var _=new f.Parser(m,{reference:b,functions:A,constants:h.constants})}catch(A){throw A.message=`Invalid template variable "${m}" fails due to: ${A.message}`,A}if(_.single){if(_.single.type==="reference"){const A=v[0];return{ref:A,raw:y,refs:v,wrapped:g||A.type==="local"&&A.key==="label"}}return h.stringify(_.single.value)}return{formula:_,raw:y,refs:v}}toString(){return this.source}},h.Template.prototype[l.symbols.template]=!0,h.Template.prototype.isImmutable=!0,h.encode=function(m){return m.replace(/\\(\{+)/g,(y,g)=>h.opens.slice(0,g.length)).replace(/\\(\}+)/g,(y,g)=>h.closes.slice(0,g.length))},h.decode=function(m){return m.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},h.split=function(m){const y=[];let g="";for(let v=0;v ${M.toString()}`);m=N}if(!Array.isArray(m))return m.toString();const E=[];for(const N of m)E.push(h.stringify(N,y,g,v,b,{arrayItems:!0,..._}));return h.wrap(E.join(", "),!T&&P.array)},h.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},h.functions={if:(m,y,g)=>m?y:g,length:m=>typeof m=="string"?m.length:m&&typeof m=="object"?Array.isArray(m)?m.length:Object.keys(m).length:null,msg(m){const[y,g,v,b,_]=this,A=_.messages;if(!A)return"";const P=u.template(y,A[0],m,g,v)||u.template(y,A[1],m,g,v);return P?P.render(y,g,v,b,_):""},number:m=>typeof m=="number"?m:typeof m=="string"?parseFloat(m):typeof m=="boolean"?m?1:0:m instanceof Date?m.getTime():null}},4946:(s,i,o)=>{const a=o(375),c=o(1687),d=o(8068),f=o(8160),l=o(3292),u=o(6354),p=o(6133),h={};s.exports=d.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:p.toSibling}},args:(m,...y)=>y.length===1&&Array.isArray(y[0])?m.try(...y[0]):m.try(...y),validate(m,y){const{schema:g,error:v,state:b,prefs:_}=y;if(g._flags.match){const P=[],T=[];for(let N=0;Nu.details(N,{override:!1}))})};if(g._flags.match==="one")return P.length===1?{value:P[0]}:{errors:v("alternatives.one")};if(P.length!==g.$_terms.matches.length)return{errors:v("alternatives.all",{details:T.map(N=>u.details(N,{override:!1}))})};const E=N=>N.$_terms.matches.some(k=>k.schema.type==="object"||k.schema.type==="alternatives"&&E(k.schema));return E(g)?{value:P.reduce((N,k)=>c(N,k,{mergeArrays:!1}))}:{value:P[P.length-1]}}const A=[];for(let P=0;Pg.path[0]!=="is"&&typeof y._flags.label!="string"?y.label(m):void 0,ref:!1})}},rebuild(m){m.$_modify({each:y=>{f.isSchema(y)&&y.type==="array"&&m.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(m,y){if(y.matches)for(const g of y.matches){const{schema:v,ref:b,is:_,not:A,then:P,otherwise:T}=g;m=v?m.try(v):b?m.conditional(b,{is:_,then:P,not:A,otherwise:T,switch:g.switch}):m.conditional(_,{then:P,otherwise:T})}return m}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),h.errors=function(m,{error:y,state:g}){if(!m.length)return{errors:y("alternatives.any")};if(m.length===1)return{errors:m[0].reports};const v=new Set,b=[];for(const{reports:_,schema:A}of m){if(_.length>1)return h.unmatched(m,y);const P=_[0];if(P instanceof u.Report==0)return h.unmatched(m,y);if(P.state.path.length!==g.path.length){b.push({type:A.type,report:P});continue}if(P.code==="any.only"){for(const N of P.local.valids)v.add(N);continue}const[T,E]=P.code.split(".");E!=="base"?b.push({type:A.type,report:P}):P.code==="object.base"?v.add(P.local.type):v.add(T)}return b.length?b.length===1?{errors:b[0].report}:h.unmatched(m,y):{errors:y("alternatives.types",{types:[...v]})}},h.unmatched=function(m,y){const g=[];for(const v of m)g.push(...v.reports);return{errors:y("alternatives.match",u.details(g,{override:!1}))}}},8068:(s,i,o)=>{const a=o(375),c=o(7629),d=o(8160),f=o(6914);s.exports=c.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(l,u){return a(typeof l=="function","Method must be a function"),a(u===void 0||u&&typeof u=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:l,description:u}})},validate(l,u,{method:p}){try{return p(l,u)}catch(h){return u.error("any.custom",{error:h})}},args:["method","description"],multi:!0},messages:{method(l){return this.prefs({messages:l})}},shared:{method(l){a(d.isSchema(l)&&l._flags.id,"Schema must be a schema with an id");const u=this.clone();return u.$_terms.shared=u.$_terms.shared||[],u.$_terms.shared.push(l),u.$_mutateRegister(l),u}},warning:{method(l,u){return a(l&&typeof l=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:l,local:u},warn:!0})},validate:(l,u,{code:p,local:h})=>u.error(p,h),args:["code","local"],multi:!0}},modifiers:{keep(l,u=!0){l.keep=u},message(l,u){l.message=f.compile(u)},warn(l,u=!0){l.warn=u}},manifest:{build(l,u){for(const p in u){const h=u[p];if(["examples","externals","metas","notes","tags"].includes(p))for(const m of h)l=l[p.slice(0,-1)](m);else if(p!=="alterations")if(p!=="whens"){if(p==="shared")for(const m of h)l=l.shared(m)}else for(const m of h){const{ref:y,is:g,not:v,then:b,otherwise:_,concat:A}=m;l=A?l.concat(A):y?l.when(y,{is:g,not:v,then:b,otherwise:_,switch:m.switch,break:m.break}):l.when(g,{then:b,otherwise:_,break:m.break})}else{const m={};for(const{target:y,adjuster:g}of h)m[y]=g;l=l.alter(m)}}return l}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(s,i,o)=>{const a=o(375),c=o(9474),d=o(9621),f=o(8068),l=o(8160),u=o(3292),p={};s.exports=f.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(h,{schema:m,state:y,prefs:g}){if(!Array.isArray(h))return;const v=m.$_getRule("sort");return v?p.sort(m,h,v.args.options,y,g):void 0}},validate(h,{schema:m,error:y}){if(!Array.isArray(h)){if(m._flags.single){const g=[h];return g[l.symbols.arraySingle]=!0,{value:g}}return{errors:y("array.base")}}if(m.$_getRule("items")||m.$_terms.externals)return{value:h.slice()}},rules:{has:{method(h){h=this.$_compile(h,{appendPath:!0});const m=this.$_addRule({name:"has",args:{schema:h}});return m.$_mutateRegister(h),m},validate(h,{state:m,prefs:y,error:g},{schema:v}){const b=[h,...m.ancestors];for(let A=0;Athis.$_compile(h[y]),y,{append:!0});m.$_terms.items.push(g)}return m.$_mutateRebuild()},validate(h,{schema:m,error:y,state:g,prefs:v,errorsArray:b}){const _=m.$_terms._requireds.slice(),A=m.$_terms.ordered.slice(),P=[...m.$_terms._inclusions,..._],T=!h[l.symbols.arraySingle];delete h[l.symbols.arraySingle];const E=b();let N=h.length;for(let k=0;k="})}},ordered:{method(...h){l.verifyFlat(h,"ordered");const m=this.$_addRule("items");for(let y=0;ythis.$_compile(h[y]),y,{append:!0});p.validateSingle(g,m),m.$_mutateRegister(g),m.$_terms.ordered.push(g)}return m.$_mutateRebuild()}},single:{method(h){const m=h===void 0||!!h;return a(!m||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",m)}},sort:{method(h={}){l.assertOptions(h,["by","order"]);const m={order:h.order||"ascending"};return h.by&&(m.by=u.ref(h.by,{ancestor:0}),a(!m.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:m}})},validate(h,{error:m,state:y,prefs:g,schema:v},{options:b}){const{value:_,errors:A}=p.sort(v,h,b,y,g);if(A)return A;for(let P=0;Pnew Set(h)}},rebuild(h){h.$_terms._inclusions=[],h.$_terms._exclusions=[],h.$_terms._requireds=[];for(const m of h.$_terms.items)p.validateSingle(m,h),m._flags.presence==="required"?h.$_terms._requireds.push(m):m._flags.presence==="forbidden"?h.$_terms._exclusions.push(m):h.$_terms._inclusions.push(m);for(const m of h.$_terms.ordered)p.validateSingle(m,h)},manifest:{build:(h,m)=>(m.items&&(h=h.items(...m.items)),m.ordered&&(h=h.ordered(...m.ordered)),h)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),p.fillMissedErrors=function(h,m,y,g,v,b){const _=[];let A=0;for(const P of y){const T=P._flags.label;T?_.push(T):++A}_.length?A?m.push(h.$_createError("array.includesRequiredBoth",g,{knownMisses:_,unknownMisses:A},v,b)):m.push(h.$_createError("array.includesRequiredKnowns",g,{knownMisses:_},v,b)):m.push(h.$_createError("array.includesRequiredUnknowns",g,{unknownMisses:A},v,b))},p.fillOrderedErrors=function(h,m,y,g,v,b){const _=[];for(const A of y)A._flags.presence==="required"&&_.push(A);_.length&&p.fillMissedErrors(h,m,_,g,v,b)},p.fillDefault=function(h,m,y,g){const v=[];let b=!0;for(let _=h.length-1;_>=0;--_){const A=h[_],P=[m,...y.ancestors],T=A.$_validate(void 0,y.localize(y.path,P,A),g).value;if(b){if(T===void 0)continue;b=!1}v.unshift(T)}v.length&&m.push(...v)},p.fastSplice=function(h,m){let y=m;for(;y{let N=p.compare(T,E,_,A);if(N!==null||(y.by&&(T=y.by.resolve(T,g,v),E=y.by.resolve(E,g,v)),N=p.compare(T,E,_,A),N!==null))return N;const k=typeof T;if(k!==typeof E)throw h.$_createError("array.sort.mismatching",m,null,g,v);if(k!=="number"&&k!=="string")throw h.$_createError("array.sort.unsupported",m,{type:k},g,v);return k==="number"?(T-E)*b:T{const a=o(375),c=o(8068),d=o(8160),f=o(2036),l={isBool:function(u){return typeof u=="boolean"}};s.exports=c.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(u,{schema:p}){if(typeof u!="boolean"){if(typeof u=="string"){const h=p._flags.sensitive?u:u.toLowerCase();u=h==="true"||h!=="false"&&u}return typeof u!="boolean"&&(u=p.$_terms.truthy&&p.$_terms.truthy.has(u,null,null,!p._flags.sensitive)||(!p.$_terms.falsy||!p.$_terms.falsy.has(u,null,null,!p._flags.sensitive))&&u),{value:u}}},validate(u,{error:p}){if(typeof u!="boolean")return{value:u,errors:p("boolean.base")}},rules:{truthy:{method(...u){d.verifyFlat(u,"truthy");const p=this.clone();p.$_terms.truthy=p.$_terms.truthy||new f;for(let h=0;hu?1:0},string:{from:l.isBool,to:(u,p)=>u?"true":"false"}},manifest:{build:(u,p)=>(p.truthy&&(u=u.truthy(...p.truthy)),p.falsy&&(u=u.falsy(...p.falsy)),u)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(s,i,o)=>{const a=o(375),c=o(8068),d=o(8160),f=o(3328),l={isDate:function(u){return u instanceof Date}};s.exports=c.extend({type:"date",coerce:{from:["number","string"],method:(u,{schema:p})=>({value:l.parse(u,p._flags.format)||u})},validate(u,{schema:p,error:h,prefs:m}){if(u instanceof Date&&!isNaN(u.getTime()))return;const y=p._flags.format;return m.convert&&y&&typeof u=="string"?{value:u,errors:h("date.format",{format:y})}:{value:u,errors:h("date.base")}},rules:{compare:{method:!1,validate(u,p,{date:h},{name:m,operator:y,args:g}){const v=h==="now"?Date.now():h.getTime();return d.compare(u.getTime(),v,y)?u:p.error("date."+m,{limit:g.date,value:u})},args:[{name:"date",ref:!0,normalize:u=>u==="now"?u:l.parse(u),assert:u=>u!==null,message:"must have a valid date format"}]},format:{method(u){return a(["iso","javascript","unix"].includes(u),"Unknown date format",u),this.$_setFlag("format",u)}},greater:{method(u){return this.$_addRule({name:"greater",method:"compare",args:{date:u},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(u){return this.$_addRule({name:"less",method:"compare",args:{date:u},operator:"<"})}},max:{method(u){return this.$_addRule({name:"max",method:"compare",args:{date:u},operator:"<="})}},min:{method(u){return this.$_addRule({name:"min",method:"compare",args:{date:u},operator:">="})}},timestamp:{method(u="javascript"){return a(["javascript","unix"].includes(u),'"type" must be one of "javascript, unix"'),this.format(u)}}},cast:{number:{from:l.isDate,to:(u,p)=>u.getTime()},string:{from:l.isDate,to:(u,{prefs:p})=>f.date(u,p)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),l.parse=function(u,p){if(u instanceof Date)return u;if(typeof u!="string"&&(isNaN(u)||!isFinite(u))||/^\s*$/.test(u))return null;if(p==="iso")return d.isIsoDate(u)?l.date(u.toString()):null;const h=u;if(typeof u=="string"&&/^[+-]?\d+(\.\d+)?$/.test(u)&&(u=parseFloat(u)),p){if(p==="javascript")return l.date(1*u);if(p==="unix")return l.date(1e3*u);if(typeof h=="string")return null}return l.date(u)},l.date=function(u){const p=new Date(u);return isNaN(p.getTime())?null:p}},390:(s,i,o)=>{const a=o(375),c=o(7824);s.exports=c.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(d){return a(Number.isSafeInteger(d)&&d>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:d}})},validate:(d,f,{n:l})=>d.length===l?d:f.error("function.arity",{n:l})},class:{method(){return this.$_addRule("class")},validate:(d,f)=>/^\s*class\s/.test(d.toString())?d:f.error("function.class",{value:d})},minArity:{method(d){return a(Number.isSafeInteger(d)&&d>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:d}})},validate:(d,f,{n:l})=>d.length>=l?d:f.error("function.minArity",{n:l})},maxArity:{method(d){return a(Number.isSafeInteger(d)&&d>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:d}})},validate:(d,f,{n:l})=>d.length<=l?d:f.error("function.maxArity",{n:l})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(s,i,o)=>{const a=o(978),c=o(375),d=o(8571),f=o(3652),l=o(8068),u=o(8160),p=o(3292),h=o(6354),m=o(6133),y=o(3328),g={renameDefaults:{alias:!1,multiple:!1,override:!1}};s.exports=l.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:void 0}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(v,b)=>v.keys(b),validate(v,{schema:b,error:_,state:A,prefs:P}){if(!v||typeof v!==b.$_property("typeof")||Array.isArray(v))return{value:v,errors:_("object.base",{type:b.$_property("typeof")})};if(!(b.$_terms.renames||b.$_terms.dependencies||b.$_terms.keys||b.$_terms.patterns||b.$_terms.externals))return;v=g.clone(v,P);const T=[];if(b.$_terms.renames&&!g.rename(b,v,A,P,T))return{value:v,errors:T};if(!b.$_terms.keys&&!b.$_terms.patterns&&!b.$_terms.dependencies)return{value:v,errors:T};const E=new Set(Object.keys(v));if(b.$_terms.keys){const N=[v,...A.ancestors];for(const k of b.$_terms.keys){const M=k.key,j=v[M];E.delete(M);const I=A.localize([...A.path,M],N,k),L=k.schema.$_validate(j,I,P);if(L.errors){if(P.abortEarly)return{value:v,errors:L.errors};L.value!==void 0&&(v[M]=L.value),T.push(...L.errors)}else k.schema._flags.result==="strip"||L.value===void 0&&j!==void 0?delete v[M]:L.value!==void 0&&(v[M]=L.value)}}if(E.size||b._flags._hasPatternMatch){const N=g.unknown(b,v,E,T,A,P);if(N)return N}if(b.$_terms.dependencies)for(const N of b.$_terms.dependencies){if(N.key!==null&&g.isPresent(N.options)(N.key.resolve(v,A,P,null,{shadow:!1}))===!1)continue;const k=g.dependencies[N.rel](b,N,v,A,P);if(k){const M=b.$_createError(k.code,v,k.context,A,P);if(P.abortEarly)return{value:v,errors:M};T.push(M)}}return{value:v,errors:T}},rules:{and:{method(...v){return u.verifyFlat(v,"and"),g.dependency(this,"and",null,v)}},append:{method(v){return v==null||Object.keys(v).length===0?this:this.keys(v)}},assert:{method(v,b,_){y.isTemplate(v)||(v=p.ref(v)),c(_===void 0||typeof _=="string","Message must be a string"),b=this.$_compile(b,{appendPath:!0});const A=this.$_addRule({name:"assert",args:{subject:v,schema:b,message:_}});return A.$_mutateRegister(v),A.$_mutateRegister(b),A},validate(v,{error:b,prefs:_,state:A},{subject:P,schema:T,message:E}){const N=P.resolve(v,A,_),k=m.isRef(P)?P.absolute(A):[];return T.$_match(N,A.localize(k,[v,...A.ancestors],T),_)?v:b("object.assert",{subject:P,message:E})},args:["subject","schema","message"],multi:!0},instance:{method(v,b){return c(typeof v=="function","constructor must be a function"),b=b||v.name,this.$_addRule({name:"instance",args:{constructor:v,name:b}})},validate:(v,b,{constructor:_,name:A})=>v instanceof _?v:b.error("object.instance",{type:A,value:v}),args:["constructor","name"]},keys:{method(v){c(v===void 0||typeof v=="object","Object schema must be a valid object"),c(!u.isSchema(v),"Object schema cannot be a joi schema");const b=this.clone();if(v)if(Object.keys(v).length){b.$_terms.keys=b.$_terms.keys?b.$_terms.keys.filter(_=>!v.hasOwnProperty(_.key)):new g.Keys;for(const _ in v)u.tryWithPath(()=>b.$_terms.keys.push({key:_,schema:this.$_compile(v[_])}),_)}else b.$_terms.keys=new g.Keys;else b.$_terms.keys=null;return b.$_mutateRebuild()}},length:{method(v){return this.$_addRule({name:"length",args:{limit:v},operator:"="})},validate:(v,b,{limit:_},{name:A,operator:P,args:T})=>u.compare(Object.keys(v).length,_,P)?v:b.error("object."+A,{limit:T.limit,value:v}),args:[{name:"limit",ref:!0,assert:u.limit,message:"must be a positive integer"}]},max:{method(v){return this.$_addRule({name:"max",method:"length",args:{limit:v},operator:"<="})}},min:{method(v){return this.$_addRule({name:"min",method:"length",args:{limit:v},operator:">="})}},nand:{method(...v){return u.verifyFlat(v,"nand"),g.dependency(this,"nand",null,v)}},or:{method(...v){return u.verifyFlat(v,"or"),g.dependency(this,"or",null,v)}},oxor:{method(...v){return g.dependency(this,"oxor",null,v)}},pattern:{method(v,b,_={}){const A=v instanceof RegExp;A||(v=this.$_compile(v,{appendPath:!0})),c(b!==void 0,"Invalid rule"),u.assertOptions(_,["fallthrough","matches"]),A&&c(!v.flags.includes("g")&&!v.flags.includes("y"),"pattern should not use global or sticky mode"),b=this.$_compile(b,{appendPath:!0});const P=this.clone();P.$_terms.patterns=P.$_terms.patterns||[];const T={[A?"regex":"schema"]:v,rule:b};return _.matches&&(T.matches=this.$_compile(_.matches),T.matches.type!=="array"&&(T.matches=T.matches.$_root.array().items(T.matches)),P.$_mutateRegister(T.matches),P.$_setFlag("_hasPatternMatch",!0,{clone:!1})),_.fallthrough&&(T.fallthrough=!0),P.$_terms.patterns.push(T),P.$_mutateRegister(b),P}},ref:{method(){return this.$_addRule("ref")},validate:(v,b)=>m.isRef(v)?v:b.error("object.refType",{value:v})},regex:{method(){return this.$_addRule("regex")},validate:(v,b)=>v instanceof RegExp?v:b.error("object.regex",{value:v})},rename:{method(v,b,_={}){c(typeof v=="string"||v instanceof RegExp,"Rename missing the from argument"),c(typeof b=="string"||b instanceof y,"Invalid rename to argument"),c(b!==v,"Cannot rename key to same name:",v),u.assertOptions(_,["alias","ignoreUndefined","override","multiple"]);const A=this.clone();A.$_terms.renames=A.$_terms.renames||[];for(const P of A.$_terms.renames)c(P.from!==v,"Cannot rename the same key multiple times");return b instanceof y&&A.$_mutateRegister(b),A.$_terms.renames.push({from:v,to:b,options:a(g.renameDefaults,_)}),A}},schema:{method(v="any"){return this.$_addRule({name:"schema",args:{type:v}})},validate:(v,b,{type:_})=>!u.isSchema(v)||_!=="any"&&v.type!==_?b.error("object.schema",{type:_}):v},unknown:{method(v){return this.$_setFlag("unknown",v!==!1)}},with:{method(v,b,_={}){return g.dependency(this,"with",v,b,_)}},without:{method(v,b,_={}){return g.dependency(this,"without",v,b,_)}},xor:{method(...v){return u.verifyFlat(v,"xor"),g.dependency(this,"xor",null,v)}}},overrides:{default(v,b){return v===void 0&&(v=u.symbols.deepDefault),this.$_parent("default",v,b)}},rebuild(v){if(v.$_terms.keys){const b=new f.Sorter;for(const _ of v.$_terms.keys)u.tryWithPath(()=>b.add(_,{after:_.schema.$_rootReferences(),group:_.key}),_.key);v.$_terms.keys=new g.Keys(...b.nodes)}},manifest:{build(v,b){if(b.keys&&(v=v.keys(b.keys)),b.dependencies)for(const{rel:_,key:A=null,peers:P,options:T}of b.dependencies)v=g.dependency(v,_,A,P,T);if(b.patterns)for(const{regex:_,schema:A,rule:P,fallthrough:T,matches:E}of b.patterns)v=v.pattern(_||A,P,{fallthrough:T,matches:E});if(b.renames)for(const{from:_,to:A,options:P}of b.renames)v=v.rename(_,A,P);return v}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),g.clone=function(v,b){if(typeof v=="object"){if(b.nonEnumerables)return d(v,{shallow:!0});const A=Object.create(Object.getPrototypeOf(v));return Object.assign(A,v),A}const _=function(...A){return v.apply(this,A)};return _.prototype=d(v.prototype),Object.defineProperty(_,"name",{value:v.name,writable:!1}),Object.defineProperty(_,"length",{value:v.length,writable:!1}),Object.assign(_,v),_},g.dependency=function(v,b,_,A,P){c(_===null||typeof _=="string",b,"key must be a strings"),P||(P=A.length>1&&typeof A[A.length-1]=="object"?A.pop():{}),u.assertOptions(P,["separator","isPresent"]),A=[].concat(A);const T=u.default(P.separator,"."),E=[];for(const k of A)c(typeof k=="string",b,"peers must be strings"),E.push(p.ref(k,{separator:T,ancestor:0,prefix:!1}));_!==null&&(_=p.ref(_,{separator:T,ancestor:0,prefix:!1}));const N=v.clone();return N.$_terms.dependencies=N.$_terms.dependencies||[],N.$_terms.dependencies.push(new g.Dependency(b,_,E,A,P)),N},g.dependencies={and(v,b,_,A,P){const T=[],E=[],N=b.peers.length,k=g.isPresent(b.options);for(const M of b.peers)k(M.resolve(_,A,P,null,{shadow:!1}))===!1?T.push(M.key):E.push(M.key);if(T.length!==N&&E.length!==N)return{code:"object.and",context:{present:E,presentWithLabels:g.keysToLabels(v,E),missing:T,missingWithLabels:g.keysToLabels(v,T)}}},nand(v,b,_,A,P){const T=[],E=g.isPresent(b.options);for(const M of b.peers)E(M.resolve(_,A,P,null,{shadow:!1}))&&T.push(M.key);if(T.length!==b.peers.length)return;const N=b.paths[0],k=b.paths.slice(1);return{code:"object.nand",context:{main:N,mainWithLabel:g.keysToLabels(v,N),peers:k,peersWithLabels:g.keysToLabels(v,k)}}},or(v,b,_,A,P){const T=g.isPresent(b.options);for(const E of b.peers)if(T(E.resolve(_,A,P,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:b.paths,peersWithLabels:g.keysToLabels(v,b.paths)}}},oxor(v,b,_,A,P){const T=[],E=g.isPresent(b.options);for(const k of b.peers)E(k.resolve(_,A,P,null,{shadow:!1}))&&T.push(k.key);if(!T.length||T.length===1)return;const N={peers:b.paths,peersWithLabels:g.keysToLabels(v,b.paths)};return N.present=T,N.presentWithLabels=g.keysToLabels(v,T),{code:"object.oxor",context:N}},with(v,b,_,A,P){const T=g.isPresent(b.options);for(const E of b.peers)if(T(E.resolve(_,A,P,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:b.key.key,mainWithLabel:g.keysToLabels(v,b.key.key),peer:E.key,peerWithLabel:g.keysToLabels(v,E.key)}}},without(v,b,_,A,P){const T=g.isPresent(b.options);for(const E of b.peers)if(T(E.resolve(_,A,P,null,{shadow:!1})))return{code:"object.without",context:{main:b.key.key,mainWithLabel:g.keysToLabels(v,b.key.key),peer:E.key,peerWithLabel:g.keysToLabels(v,E.key)}}},xor(v,b,_,A,P){const T=[],E=g.isPresent(b.options);for(const k of b.peers)E(k.resolve(_,A,P,null,{shadow:!1}))&&T.push(k.key);if(T.length===1)return;const N={peers:b.paths,peersWithLabels:g.keysToLabels(v,b.paths)};return T.length===0?{code:"object.missing",context:N}:(N.present=T,N.presentWithLabels=g.keysToLabels(v,T),{code:"object.xor",context:N})}},g.keysToLabels=function(v,b){return Array.isArray(b)?b.map(_=>v.$_mapLabels(_)):v.$_mapLabels(b)},g.isPresent=function(v){return typeof v.isPresent=="function"?v.isPresent:b=>b!==void 0},g.rename=function(v,b,_,A,P){const T={};for(const E of v.$_terms.renames){const N=[],k=typeof E.from!="string";if(k)for(const M in b){if(b[M]===void 0&&E.options.ignoreUndefined||M===E.to)continue;const j=E.from.exec(M);j&&N.push({from:M,to:E.to,match:j})}else!Object.prototype.hasOwnProperty.call(b,E.from)||b[E.from]===void 0&&E.options.ignoreUndefined||N.push(E);for(const M of N){const j=M.from;let I=M.to;if(I instanceof y&&(I=I.render(b,_,A,M.match)),j!==I){if(!E.options.multiple&&T[I]&&(P.push(v.$_createError("object.rename.multiple",b,{from:j,to:I,pattern:k},_,A)),A.abortEarly)||Object.prototype.hasOwnProperty.call(b,I)&&!E.options.override&&!T[I]&&(P.push(v.$_createError("object.rename.override",b,{from:j,to:I,pattern:k},_,A)),A.abortEarly))return!1;b[j]===void 0?delete b[I]:b[I]=b[j],T[I]=!0,E.options.alias||delete b[j]}}}return!0},g.unknown=function(v,b,_,A,P,T){if(v.$_terms.patterns){let E=!1;const N=v.$_terms.patterns.map(M=>{if(M.matches)return E=!0,[]}),k=[b,...P.ancestors];for(const M of _){const j=b[M],I=[...P.path,M];for(let L=0;L{const a=o(375),c=o(8068),d=o(8160),f=o(3292),l=o(6354),u={};s.exports=c.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(p,h)=>p.ref(h),validate(p,{schema:h,state:m,prefs:y}){a(h.$_terms.link,"Uninitialized link schema");const g=u.generate(h,p,m,y),v=h.$_terms.link[0].ref;return g.$_validate(p,m.nest(g,`link:${v.display}:${g.type}`),y)},generate:(p,h,m,y)=>u.generate(p,h,m,y),rules:{ref:{method(p){a(!this.$_terms.link,"Cannot reinitialize schema"),p=f.ref(p),a(p.type==="value"||p.type==="local","Invalid reference type:",p.type),a(p.type==="local"||p.ancestor==="root"||p.ancestor>0,"Link cannot reference itself");const h=this.clone();return h.$_terms.link=[{ref:p}],h}},relative:{method(p=!0){return this.$_setFlag("relative",p)}}},overrides:{concat(p){a(this.$_terms.link,"Uninitialized link schema"),a(d.isSchema(p),"Invalid schema object"),a(p.type!=="link","Cannot merge type link with another link");const h=this.clone();return h.$_terms.whens||(h.$_terms.whens=[]),h.$_terms.whens.push({concat:p}),h.$_mutateRebuild()}},manifest:{build:(p,h)=>(a(h.link,"Invalid link description missing link"),p.ref(h.link))}}),u.generate=function(p,h,m,y){let g=m.mainstay.links.get(p);if(g)return g._generate(h,m,y).schema;const v=p.$_terms.link[0].ref,{perspective:b,path:_}=u.perspective(v,m);u.assert(b,"which is outside of schema boundaries",v,p,m,y);try{g=_.length?b.$_reach(_):b}catch{u.assert(!1,"to non-existing schema",v,p,m,y)}return u.assert(g.type!=="link","which is another link",v,p,m,y),p._flags.relative||m.mainstay.links.set(p,g),g._generate(h,m,y).schema},u.perspective=function(p,h){if(p.type==="local"){for(const{schema:m,key:y}of h.schemas){if((m._flags.id||y)===p.path[0])return{perspective:m,path:p.path.slice(1)};if(m.$_terms.shared){for(const g of m.$_terms.shared)if(g._flags.id===p.path[0])return{perspective:g,path:p.path.slice(1)}}}return{perspective:null,path:null}}return p.ancestor==="root"?{perspective:h.schemas[h.schemas.length-1].schema,path:p.path}:{perspective:h.schemas[p.ancestor]&&h.schemas[p.ancestor].schema,path:p.path}},u.assert=function(p,h,m,y,g,v){p||a(!1,`"${l.label(y._flags,g,v)}" contains link reference "${m.display}" ${h}`)}},3832:(s,i,o)=>{const a=o(375),c=o(8068),d=o(8160),f={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(l){const u=l.toString(),p=u.indexOf("."),h=u.indexOf("e");return(p<0?0:(h<0?u.length:h)-p-1)+(h<0?0:Math.max(0,-parseInt(u.slice(h+1))))}};s.exports=c.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(l,{schema:u,error:p}){if(!l.match(f.numberRx))return;l=l.trim();const h={value:parseFloat(l)};if(h.value===0&&(h.value=0),!u._flags.unsafe)if(l.match(/e/i)){if(f.extractSignificantDigits(l)!==f.extractSignificantDigits(String(h.value)))return h.errors=p("number.unsafe"),h}else{const m=h.value.toString();if(m.match(/e/i))return h;if(m!==f.normalizeDecimal(l))return h.errors=p("number.unsafe"),h}return h}},validate(l,{schema:u,error:p,prefs:h}){if(l===1/0||l===-1/0)return{value:l,errors:p("number.infinity")};if(!d.isNumber(l))return{value:l,errors:p("number.base")};const m={value:l};if(h.convert){const y=u.$_getRule("precision");if(y){const g=Math.pow(10,y.args.limit);m.value=Math.round(m.value*g)/g}}return m.value===0&&(m.value=0),!u._flags.unsafe&&(l>Number.MAX_SAFE_INTEGER||ld.compare(l,p,m)?l:u.error("number."+h,{limit:y.limit,value:l}),args:[{name:"limit",ref:!0,assert:d.isNumber,message:"must be a number"}]},greater:{method(l){return this.$_addRule({name:"greater",method:"compare",args:{limit:l},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(l,u)=>Math.trunc(l)-l==0?l:u.error("number.integer")},less:{method(l){return this.$_addRule({name:"less",method:"compare",args:{limit:l},operator:"<"})}},max:{method(l){return this.$_addRule({name:"max",method:"compare",args:{limit:l},operator:"<="})}},min:{method(l){return this.$_addRule({name:"min",method:"compare",args:{limit:l},operator:">="})}},multiple:{method(l){const u=typeof l=="number"?f.decimalPlaces(l):null,p=Math.pow(10,u);return this.$_addRule({name:"multiple",args:{base:l,baseDecimalPlace:u,pfactor:p}})},validate:(l,u,{base:p,baseDecimalPlace:h,pfactor:m},y)=>f.decimalPlaces(l)>h?u.error("number.multiple",{multiple:y.args.base,value:l}):Math.round(m*l)%Math.round(m*p)==0?l:u.error("number.multiple",{multiple:y.args.base,value:l}),args:[{name:"base",ref:!0,assert:l=>typeof l=="number"&&isFinite(l)&&l>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(l,u)=>Number.isSafeInteger(l)&&l>=0&&l<=65535?l:u.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(l){return a(Number.isSafeInteger(l),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:l}})},validate(l,u,{limit:p}){const h=l.toString().match(f.precisionRx);return Math.max((h[1]?h[1].length:0)-(h[2]?parseInt(h[2],10):0),0)<=p?l:u.error("number.precision",{limit:p,value:l})},convert:!0},sign:{method(l){return a(["negative","positive"].includes(l),"Invalid sign",l),this.$_addRule({name:"sign",args:{sign:l}})},validate:(l,u,{sign:p})=>p==="negative"&&l<0||p==="positive"&&l>0?l:u.error(`number.${p}`)},unsafe:{method(l=!0){return a(typeof l=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",l)}}},cast:{string:{from:l=>typeof l=="number",to:(l,u)=>l.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),f.extractSignificantDigits=function(l){return l.replace(f.exponentialPartRegex,"").replace(f.dotRegex,"").replace(f.trailingZerosRegex,"").replace(f.leadingSignAndZerosRegex,"")},f.normalizeDecimal=function(l){return(l=l.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&l.endsWith("0")&&(l=l.replace(/0+$/,"")),l==="-0"?"0":l}},8966:(s,i,o)=>{const a=o(7824);s.exports=a.extend({type:"object",cast:{map:{from:c=>c&&typeof c=="object",to:(c,d)=>new Map(Object.entries(c))}}})},7417:(s,i,o)=>{const a=o(375),c=o(5380),d=o(1745),f=o(9959),l=o(6064),u=o(9926),p=o(5752),h=o(8068),m=o(8160),y={tlds:u instanceof Set&&{tlds:{allow:u,deny:null}},base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:{withPrefix:/^0x[0-9a-f]+$/i,withOptionalPrefix:/^(?:0x)?[0-9a-f]+$/i,withoutPrefix:/^[0-9a-f]+$/i},ipRegex:f.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};s.exports=h.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(g,{schema:v,state:b,prefs:_}){const A=v.$_getRule("normalize");A&&(g=g.normalize(A.args.form));const P=v.$_getRule("case");P&&(g=P.args.direction==="upper"?g.toLocaleUpperCase():g.toLocaleLowerCase());const T=v.$_getRule("trim");if(T&&T.args.enabled&&(g=g.trim()),v.$_terms.replacements)for(const N of v.$_terms.replacements)g=g.replace(N.pattern,N.replacement);const E=v.$_getRule("hex");if(E&&E.args.options.byteAligned&&g.length%2!=0&&(g=`0${g}`),v.$_getRule("isoDate")){const N=y.isoDate(g);N&&(g=N)}if(v._flags.truncate){const N=v.$_getRule("max");if(N){let k=N.args.limit;if(m.isResolvable(k)&&(k=k.resolve(g,b,_),!m.limit(k)))return{value:g,errors:v.$_createError("any.ref",k,{ref:N.args.limit,arg:"limit",reason:"must be a positive integer"},b,_)};g=g.slice(0,k)}}return{value:g}}},validate(g,{schema:v,error:b}){if(typeof g!="string")return{value:g,errors:b("string.base")};if(g===""){const _=v.$_getRule("min");return _&&_.args.limit===0?void 0:{value:g,errors:b("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(g,v)=>/^[a-zA-Z0-9]+$/.test(g)?g:v.error("string.alphanum")},base64:{method(g={}){return m.assertOptions(g,["paddingRequired","urlSafe"]),g={urlSafe:!1,paddingRequired:!0,...g},a(typeof g.paddingRequired=="boolean","paddingRequired must be boolean"),a(typeof g.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:g}})},validate:(g,v,{options:b})=>y.base64Regex[b.paddingRequired][b.urlSafe].test(g)?g:v.error("string.base64")},case:{method(g){return a(["lower","upper"].includes(g),"Invalid case:",g),this.$_addRule({name:"case",args:{direction:g}})},validate:(g,v,{direction:b})=>b==="lower"&&g===g.toLocaleLowerCase()||b==="upper"&&g===g.toLocaleUpperCase()?g:v.error(`string.${b}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(g,v){let b=g.length,_=0,A=1;for(;b--;){const P=g.charAt(b)*A;_+=P-9*(P>9),A^=3}return _>0&&_%10==0?g:v.error("string.creditCard")}},dataUri:{method(g={}){return m.assertOptions(g,["paddingRequired"]),g={paddingRequired:!0,...g},a(typeof g.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:g}})},validate(g,v,{options:b}){const _=g.match(y.dataUriRegex);return _&&(!_[2]||_[2]!=="base64"||y.base64Regex[b.paddingRequired].false.test(_[3]))?g:v.error("string.dataUri")}},domain:{method(g){g&&m.assertOptions(g,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const v=y.addressOptions(g);return this.$_addRule({name:"domain",args:{options:g},address:v})},validate:(g,v,b,{address:_})=>c.isValid(g,_)?g:v.error("string.domain")},email:{method(g={}){m.assertOptions(g,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),a(g.multiple===void 0||typeof g.multiple=="boolean","multiple option must be an boolean");const v=y.addressOptions(g),b=new RegExp(`\\s*[${g.separator?l(g.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:g},regex:b,address:v})},validate(g,v,{options:b},{regex:_,address:A}){const P=b.multiple?g.split(_):[g],T=[];for(const E of P)d.isValid(E,A)||T.push(E);return T.length?v.error("string.email",{value:g,invalids:T}):g}},guid:{alias:"uuid",method(g={}){m.assertOptions(g,["version","separator"]);let v="";if(g.version){const A=[].concat(g.version);a(A.length>=1,"version must have at least 1 valid version specified");const P=new Set;for(let T=0;T(b.prefix==="optional"?y.hexRegex.withOptionalPrefix:b.prefix===!0?y.hexRegex.withPrefix:y.hexRegex.withoutPrefix).test(g)?b.byteAligned&&g.length%2!=0?v.error("string.hexAlign"):g:v.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(g,v)=>c.isValid(g,{minDomainSegments:1})||y.ipRegex.test(g)?g:v.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(g={}){m.assertOptions(g,["cidr","version"]);const{cidr:v,versions:b,regex:_}=f.regex(g),A=g.version?b:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:v,version:A}},regex:_})},validate:(g,v,{options:b},{regex:_})=>_.test(g)?g:b.version?v.error("string.ipVersion",{value:g,cidr:b.cidr,version:b.version}):v.error("string.ip",{value:g,cidr:b.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(g,{error:v})=>y.isoDate(g)?g:v("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(g,v)=>y.isoDurationRegex.test(g)?g:v.error("string.isoDuration")},length:{method(g,v){return y.length(this,"length",g,"=",v)},validate(g,v,{limit:b,encoding:_},{name:A,operator:P,args:T}){const E=!_&&g.length;return m.compare(E,b,P)?g:v.error("string."+A,{limit:T.limit,value:g,encoding:_})},args:[{name:"limit",ref:!0,assert:m.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(g,v){return y.length(this,"max",g,"<=",v)},args:["limit","encoding"]},min:{method(g,v){return y.length(this,"min",g,">=",v)},args:["limit","encoding"]},normalize:{method(g="NFC"){return a(y.normalizationForms.includes(g),"normalization form must be one of "+y.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:g}})},validate:(g,{error:v},{form:b})=>g===g.normalize(b)?g:v("string.normalize",{value:g,form:b}),convert:!0},pattern:{alias:"regex",method(g,v={}){a(g instanceof RegExp,"regex must be a RegExp"),a(!g.flags.includes("g")&&!g.flags.includes("y"),"regex should not use global or sticky mode"),typeof v=="string"&&(v={name:v}),m.assertOptions(v,["invert","name"]);const b=["string.pattern",v.invert?".invert":"",v.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:g,options:v},errorCode:b})},validate:(g,v,{regex:b,options:_},{errorCode:A})=>b.test(g)^_.invert?g:v.error(A,{name:_.name,regex:b,value:g}),args:["regex","options"],multi:!0},replace:{method(g,v){typeof g=="string"&&(g=new RegExp(l(g),"g")),a(g instanceof RegExp,"pattern must be a RegExp"),a(typeof v=="string","replacement must be a String");const b=this.clone();return b.$_terms.replacements||(b.$_terms.replacements=[]),b.$_terms.replacements.push({pattern:g,replacement:v}),b}},token:{method(){return this.$_addRule("token")},validate:(g,v)=>/^\w+$/.test(g)?g:v.error("string.token")},trim:{method(g=!0){return a(typeof g=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:g}})},validate:(g,v,{enabled:b})=>b&&g!==g.trim()?v.error("string.trim"):g,convert:!0},truncate:{method(g=!0){return a(typeof g=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",g)}},uppercase:{method(){return this.case("upper")}},uri:{method(g={}){m.assertOptions(g,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),g.domain&&m.assertOptions(g.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:v,scheme:b}=p.regex(g),_=g.domain?y.addressOptions(g.domain):null;return this.$_addRule({name:"uri",args:{options:g},regex:v,domain:_,scheme:b})},validate(g,v,{options:b},{regex:_,domain:A,scheme:P}){if(["http:/","https:/"].includes(g))return v.error("string.uri");let T=_.exec(g);if(!T&&v.prefs.convert&&b.encodeUri){const E=encodeURI(g);T=_.exec(E),T&&(g=E)}if(T){const E=T[1]||T[2];return!A||b.allowRelative&&!E||c.isValid(E,A)?g:v.error("string.domain",{value:E})}return b.relativeOnly?v.error("string.uriRelativeOnly"):b.scheme?v.error("string.uriCustomScheme",{scheme:P,value:g}):v.error("string.uri")}}},manifest:{build(g,v){if(v.replacements)for(const{pattern:b,replacement:_}of v.replacements)g=g.replace(b,_);return g}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),y.addressOptions=function(g){if(!g)return y.tlds||g;if(a(g.minDomainSegments===void 0||Number.isSafeInteger(g.minDomainSegments)&&g.minDomainSegments>0,"minDomainSegments must be a positive integer"),a(g.maxDomainSegments===void 0||Number.isSafeInteger(g.maxDomainSegments)&&g.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),g.tlds===!1)return g;if(g.tlds===!0||g.tlds===void 0)return a(y.tlds,"Built-in TLD list disabled"),Object.assign({},g,y.tlds);a(typeof g.tlds=="object","tlds must be true, false, or an object");const v=g.tlds.deny;if(v)return Array.isArray(v)&&(g=Object.assign({},g,{tlds:{deny:new Set(v)}})),a(g.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),a(!g.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),y.validateTlds(g.tlds.deny,"tlds.deny"),g;const b=g.tlds.allow;return b?b===!0?(a(y.tlds,"Built-in TLD list disabled"),Object.assign({},g,y.tlds)):(Array.isArray(b)&&(g=Object.assign({},g,{tlds:{allow:new Set(b)}})),a(g.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),y.validateTlds(g.tlds.allow,"tlds.allow"),g):g},y.validateTlds=function(g,v){for(const b of g)a(c.isValid(b,{minDomainSegments:1,maxDomainSegments:1}),`${v} must contain valid top level domain names`)},y.isoDate=function(g){if(!m.isIsoDate(g))return null;/.*T.*[+-]\d\d$/.test(g)&&(g+="00");const v=new Date(g);return isNaN(v.getTime())?null:v.toISOString()},y.length=function(g,v,b,_,A){return a(!A||!1,"Invalid encoding:",A),g.$_addRule({name:v,method:"length",args:{limit:b,encoding:A},operator:_})}},8826:(s,i,o)=>{const a=o(375),c=o(8068),d={};d.Map=class extends Map{slice(){return new d.Map(this)}},s.exports=c.extend({type:"symbol",terms:{map:{init:new d.Map}},coerce:{method(f,{schema:l,error:u}){const p=l.$_terms.map.get(f);return p&&(f=p),l._flags.only&&typeof f!="symbol"?{value:f,errors:u("symbol.map",{map:l.$_terms.map})}:{value:f}}},validate(f,{error:l}){if(typeof f!="symbol")return{value:f,errors:l("symbol.base")}},rules:{map:{method(f){f&&!f[Symbol.iterator]&&typeof f=="object"&&(f=Object.entries(f)),a(f&&f[Symbol.iterator],"Iterable must be an iterable or object");const l=this.clone(),u=[];for(const p of f){a(p&&p[Symbol.iterator],"Entry must be an iterable");const[h,m]=p;a(typeof h!="object"&&typeof h!="function"&&typeof h!="symbol","Key must not be of type object, function, or Symbol"),a(typeof m=="symbol","Value must be a Symbol"),l.$_terms.map.set(h,m),u.push(m)}return l.valid(...u)}}},manifest:{build:(f,l)=>(l.map&&(f=f.map(l.map)),f)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(s,i,o)=>{const a=o(375),c=o(8571),d=o(738),f=o(9621),l=o(8160),u=o(6354),p=o(493),h={result:Symbol("result")};i.entry=function(m,y,g){let v=l.defaults;g&&(a(g.warnings===void 0,"Cannot override warnings preference in synchronous validation"),a(g.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),v=l.preferences(l.defaults,g));const b=h.entry(m,y,v);a(!b.mainstay.externals.length,"Schema with external rules must use validateAsync()");const _={value:b.value};return b.error&&(_.error=b.error),b.mainstay.warnings.length&&(_.warning=u.details(b.mainstay.warnings)),b.mainstay.debug&&(_.debug=b.mainstay.debug),b.mainstay.artifacts&&(_.artifacts=b.mainstay.artifacts),_},i.entryAsync=async function(m,y,g){let v=l.defaults;g&&(v=l.preferences(l.defaults,g));const b=h.entry(m,y,v),_=b.mainstay;if(b.error)throw _.debug&&(b.error.debug=_.debug),b.error;if(_.externals.length){let P=b.value;const T=[];for(const E of _.externals){const N=E.state.path,k=E.schema.type==="link"?_.links.get(E.schema):null;let M,j,I=P;const L=N.length?[P]:[],H=N.length?f(m,N):m;if(N.length){M=N[N.length-1];let K=P;for(const V of N.slice(0,-1))K=K[V],L.unshift(K);j=L[0],I=j[M]}try{const K=(U,Q)=>(k||E.schema).$_createError(U,I,Q,E.state,v),V=await E.method(I,{schema:E.schema,linked:k,state:E.state,prefs:g,original:H,error:K,errorsArray:h.errorsArray,warn:(U,Q)=>_.warnings.push((k||E.schema).$_createError(U,I,Q,E.state,v)),message:(U,Q)=>(k||E.schema).$_createError("external",I,Q,E.state,v,{messages:U})});if(V===void 0||V===I)continue;if(V instanceof u.Report){if(_.tracer.log(E.schema,E.state,"rule","external","error"),T.push(V),v.abortEarly)break;continue}if(Array.isArray(V)&&V[l.symbols.errors]){if(_.tracer.log(E.schema,E.state,"rule","external","error"),T.push(...V),v.abortEarly)break;continue}j?(_.tracer.value(E.state,"rule",I,V,"external"),j[M]=V):(_.tracer.value(E.state,"rule",P,V,"external"),P=V)}catch(K){throw v.errors.label&&(K.message+=` (${E.label})`),K}}if(b.value=P,T.length)throw b.error=u.process(T,m,v),_.debug&&(b.error.debug=_.debug),b.error}if(!v.warnings&&!v.debug&&!v.artifacts)return b.value;const A={value:b.value};return _.warnings.length&&(A.warning=u.details(_.warnings)),_.debug&&(A.debug=_.debug),_.artifacts&&(A.artifacts=_.artifacts),A},h.Mainstay=class{constructor(m,y,g){this.externals=[],this.warnings=[],this.tracer=m,this.debug=y,this.links=g,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const m=this._snapshots.pop();this.externals=m.externals,this.warnings=m.warnings}commit(){this._snapshots.pop()}},h.entry=function(m,y,g){const{tracer:v,cleanup:b}=h.tracer(y,g),_=g.debug?[]:null,A=y._ids._schemaChain?new Map:null,P=new h.Mainstay(v,_,A),T=y._ids._schemaChain?[{schema:y}]:null,E=new p([],[],{mainstay:P,schemas:T}),N=i.validate(m,y,E,g);b&&y.$_root.untrace();const k=u.process(N.errors,m,g);return{value:N.value,error:k,mainstay:P}},h.tracer=function(m,y){return m.$_root._tracer?{tracer:m.$_root._tracer._register(m)}:y.debug?(a(m.$_root.trace,"Debug mode not supported"),{tracer:m.$_root.trace()._register(m),cleanup:!0}):{tracer:h.ignore}},i.validate=function(m,y,g,v,b={}){if(y.$_terms.whens&&(y=y._generate(m,g,v).schema),y._preferences&&(v=h.prefs(y,v)),y._cache&&v.cache){const k=y._cache.get(m);if(g.mainstay.tracer.debug(g,"validate","cached",!!k),k)return k}const _=(k,M,j)=>y.$_createError(k,m,M,j||g,v),A={original:m,prefs:v,schema:y,state:g,error:_,errorsArray:h.errorsArray,warn:(k,M,j)=>g.mainstay.warnings.push(_(k,M,j)),message:(k,M)=>y.$_createError("custom",m,M,g,v,{messages:k})};g.mainstay.tracer.entry(y,g);const P=y._definition;if(P.prepare&&m!==void 0&&v.convert){const k=P.prepare(m,A);if(k){if(g.mainstay.tracer.value(g,"prepare",m,k.value),k.errors)return h.finalize(k.value,[].concat(k.errors),A);m=k.value}}if(P.coerce&&m!==void 0&&v.convert&&(!P.coerce.from||P.coerce.from.includes(typeof m))){const k=P.coerce.method(m,A);if(k){if(g.mainstay.tracer.value(g,"coerced",m,k.value),k.errors)return h.finalize(k.value,[].concat(k.errors),A);m=k.value}}const T=y._flags.empty;T&&T.$_match(h.trim(m,y),g.nest(T),l.defaults)&&(g.mainstay.tracer.value(g,"empty",m,void 0),m=void 0);const E=b.presence||y._flags.presence||(y._flags._endedSwitch?null:v.presence);if(m===void 0){if(E==="forbidden")return h.finalize(m,null,A);if(E==="required")return h.finalize(m,[y.$_createError("any.required",m,null,g,v)],A);if(E==="optional"){if(y._flags.default!==l.symbols.deepDefault)return h.finalize(m,null,A);g.mainstay.tracer.value(g,"default",m,{}),m={}}}else if(E==="forbidden")return h.finalize(m,[y.$_createError("any.unknown",m,null,g,v)],A);const N=[];if(y._valids){const k=y._valids.get(m,g,v,y._flags.insensitive);if(k)return v.convert&&(g.mainstay.tracer.value(g,"valids",m,k.value),m=k.value),g.mainstay.tracer.filter(y,g,"valid",k),h.finalize(m,null,A);if(y._flags.only){const M=y.$_createError("any.only",m,{valids:y._valids.values({display:!0})},g,v);if(v.abortEarly)return h.finalize(m,[M],A);N.push(M)}}if(y._invalids){const k=y._invalids.get(m,g,v,y._flags.insensitive);if(k){g.mainstay.tracer.filter(y,g,"invalid",k);const M=y.$_createError("any.invalid",m,{invalids:y._invalids.values({display:!0})},g,v);if(v.abortEarly)return h.finalize(m,[M],A);N.push(M)}}if(P.validate){const k=P.validate(m,A);if(k&&(g.mainstay.tracer.value(g,"base",m,k.value),m=k.value,k.errors)){if(!Array.isArray(k.errors))return N.push(k.errors),h.finalize(m,N,A);if(k.errors.length)return N.push(...k.errors),h.finalize(m,N,A)}}return y._rules.length?h.rules(m,N,A):h.finalize(m,N,A)},h.rules=function(m,y,g){const{schema:v,state:b,prefs:_}=g;for(const A of v._rules){const P=v._definition.rules[A.method];if(P.convert&&_.convert){b.mainstay.tracer.log(v,b,"rule",A.name,"full");continue}let T,E=A.args;if(A._resolve.length){E=Object.assign({},E);for(const k of A._resolve){const M=P.argsByName.get(k),j=E[k].resolve(m,b,_),I=M.normalize?M.normalize(j):j,L=l.validateArg(I,null,M);if(L){T=v.$_createError("any.ref",j,{arg:k,ref:E[k],reason:L},b,_);break}E[k]=I}}T=T||P.validate(m,g,E,A);const N=h.rule(T,A);if(N.errors){if(b.mainstay.tracer.log(v,b,"rule",A.name,"error"),A.warn){b.mainstay.warnings.push(...N.errors);continue}if(_.abortEarly)return h.finalize(m,N.errors,g);y.push(...N.errors)}else b.mainstay.tracer.log(v,b,"rule",A.name,"pass"),b.mainstay.tracer.value(b,"rule",m,N.value,A.name),m=N.value}return h.finalize(m,y,g)},h.rule=function(m,y){return m instanceof u.Report?(h.error(m,y),{errors:[m],value:null}):Array.isArray(m)&&m[l.symbols.errors]?(m.forEach(g=>h.error(g,y)),{errors:m,value:null}):{errors:null,value:m}},h.error=function(m,y){return y.message&&m._setTemplate(y.message),m},h.finalize=function(m,y,g){y=y||[];const{schema:v,state:b,prefs:_}=g;if(y.length){const P=h.default("failover",void 0,y,g);P!==void 0&&(b.mainstay.tracer.value(b,"failover",m,P),m=P,y=[])}if(y.length&&v._flags.error)if(typeof v._flags.error=="function"){y=v._flags.error(y),Array.isArray(y)||(y=[y]);for(const P of y)a(P instanceof Error||P instanceof u.Report,"error() must return an Error object")}else y=[v._flags.error];if(m===void 0){const P=h.default("default",m,y,g);b.mainstay.tracer.value(b,"default",m,P),m=P}if(v._flags.cast&&m!==void 0){const P=v._definition.cast[v._flags.cast];if(P.from(m)){const T=P.to(m,g);b.mainstay.tracer.value(b,"cast",m,T,v._flags.cast),m=T}}if(v.$_terms.externals&&_.externals&&_._externals!==!1)for(const{method:P}of v.$_terms.externals)b.mainstay.externals.push({method:P,schema:v,state:b,label:u.label(v._flags,b,_)});const A={value:m,errors:y.length?y:null};return v._flags.result&&(A.value=v._flags.result==="strip"?void 0:g.original,b.mainstay.tracer.value(b,v._flags.result,m,A.value),b.shadow(m,v._flags.result)),v._cache&&_.cache!==!1&&!v._refs.length&&v._cache.set(g.original,A),m===void 0||A.errors||v._flags.artifact===void 0||(b.mainstay.artifacts=b.mainstay.artifacts||new Map,b.mainstay.artifacts.has(v._flags.artifact)||b.mainstay.artifacts.set(v._flags.artifact,[]),b.mainstay.artifacts.get(v._flags.artifact).push(b.path)),A},h.prefs=function(m,y){const g=y===l.defaults;return g&&m._preferences[l.symbols.prefs]?m._preferences[l.symbols.prefs]:(y=l.preferences(y,m._preferences),g&&(m._preferences[l.symbols.prefs]=y),y)},h.default=function(m,y,g,v){const{schema:b,state:_,prefs:A}=v,P=b._flags[m];if(A.noDefaults||P===void 0)return y;if(_.mainstay.tracer.log(b,_,"rule",m,"full"),!P)return P;if(typeof P=="function"){const T=P.length?[c(_.ancestors[0]),v]:[];try{return P(...T)}catch(E){return void g.push(b.$_createError(`any.${m}`,null,{error:E},_,A))}}return typeof P!="object"?P:P[l.symbols.literal]?P.literal:l.isResolvable(P)?P.resolve(y,_,A):c(P)},h.trim=function(m,y){if(typeof m!="string")return m;const g=y.$_getRule("trim");return g&&g.args.enabled?m.trim():m},h.ignore={active:!1,debug:d,entry:d,filter:d,log:d,resolve:d,value:d},h.errorsArray=function(){const m=[];return m[l.symbols.errors]=!0,m}},2036:(s,i,o)=>{const a=o(375),c=o(9474),d=o(8160),f={};s.exports=f.Values=class{constructor(l,u){this._values=new Set(l),this._refs=new Set(u),this._lowercase=f.lowercases(l),this._override=!1}get length(){return this._values.size+this._refs.size}add(l,u){d.isResolvable(l)?this._refs.has(l)||(this._refs.add(l),u&&u.register(l)):this.has(l,null,null,!1)||(this._values.add(l),typeof l=="string"&&this._lowercase.set(l.toLowerCase(),l))}static merge(l,u,p){if(l=l||new f.Values,u){if(u._override)return u.clone();for(const h of[...u._values,...u._refs])l.add(h)}if(p)for(const h of[...p._values,...p._refs])l.remove(h);return l.length?l:null}remove(l){d.isResolvable(l)?this._refs.delete(l):(this._values.delete(l),typeof l=="string"&&this._lowercase.delete(l.toLowerCase()))}has(l,u,p,h){return!!this.get(l,u,p,h)}get(l,u,p,h){if(!this.length)return!1;if(this._values.has(l))return{value:l};if(typeof l=="string"&&l&&h){const m=this._lowercase.get(l.toLowerCase());if(m)return{value:m}}if(!this._refs.size&&typeof l!="object")return!1;if(typeof l=="object"){for(const m of this._values)if(c(m,l))return{value:m}}if(u)for(const m of this._refs){const y=m.resolve(l,u,p,null,{in:!0});if(y===void 0)continue;const g=m.in&&typeof y=="object"?Array.isArray(y)?y:Object.keys(y):[y];for(const v of g)if(typeof v==typeof l){if(h&&l&&typeof l=="string"){if(v.toLowerCase()===l.toLowerCase())return{value:v,ref:m}}else if(c(v,l))return{value:v,ref:m}}}return!1}override(){this._override=!0}values(l){if(l&&l.display){const u=[];for(const p of[...this._values,...this._refs])p!==void 0&&u.push(p);return u}return Array.from([...this._values,...this._refs])}clone(){const l=new f.Values(this._values,this._refs);return l._override=this._override,l}concat(l){a(!l._override,"Cannot concat override set of values");const u=new f.Values([...this._values,...l._values],[...this._refs,...l._refs]);return u._override=this._override,u}describe(){const l=[];this._override&&l.push({override:!0});for(const u of this._values.values())l.push(u&&typeof u=="object"?{value:u}:u);for(const u of this._refs.values())l.push(u.describe());return l}},f.Values.prototype[d.symbols.values]=!0,f.Values.prototype.slice=f.Values.prototype.clone,f.lowercases=function(l){const u=new Map;if(l)for(const p of l)typeof p=="string"&&u.set(p.toLowerCase(),p);return u}},978:(s,i,o)=>{const a=o(375),c=o(8571),d=o(1687),f=o(9621),l={};s.exports=function(u,p,h={}){if(a(u&&typeof u=="object","Invalid defaults value: must be an object"),a(!p||p===!0||typeof p=="object","Invalid source value: must be true, falsy or an object"),a(typeof h=="object","Invalid options: must be an object"),!p)return null;if(h.shallow)return l.applyToDefaultsWithShallow(u,p,h);const m=c(u);if(p===!0)return m;const y=h.nullOverride!==void 0&&h.nullOverride;return d(m,p,{nullOverride:y,mergeArrays:!1})},l.applyToDefaultsWithShallow=function(u,p,h){const m=h.shallow;a(Array.isArray(m),"Invalid keys");const y=new Map,g=p===!0?null:new Set;for(let _ of m){_=Array.isArray(_)?_:_.split(".");const A=f(u,_);A&&typeof A=="object"?y.set(A,g&&f(p,_)||A):g&&g.add(_)}const v=c(u,{},y);if(!g)return v;for(const _ of g)l.reachCopy(v,p,_);const b=h.nullOverride!==void 0&&h.nullOverride;return d(v,p,{nullOverride:b,mergeArrays:!1})},l.reachCopy=function(u,p,h){for(const g of h){if(!(g in p))return;const v=p[g];if(typeof v!="object"||v===null)return;p=v}const m=p;let y=u;for(let g=0;g{const a=o(7916);s.exports=function(c,...d){if(!c)throw d.length===1&&d[0]instanceof Error?d[0]:new a(d)}},8571:(s,i,o)=>{const a=o(9621),c=o(4277),d=o(7043),f={needsProtoHack:new Set([c.set,c.map,c.weakSet,c.weakMap])};s.exports=f.clone=function(l,u={},p=null){if(typeof l!="object"||l===null)return l;let h=f.clone,m=p;if(u.shallow){if(u.shallow!==!0)return f.cloneWithShallow(l,u);h=b=>b}else if(m){const b=m.get(l);if(b)return b}else m=new Map;const y=c.getInternalProto(l);if(y===c.buffer)return!1;if(y===c.date)return new Date(l.getTime());if(y===c.regex)return new RegExp(l);const g=f.base(l,y,u);if(g===l)return l;if(m&&m.set(l,g),y===c.set)for(const b of l)g.add(h(b,u,m));else if(y===c.map)for(const[b,_]of l)g.set(b,h(_,u,m));const v=d.keys(l,u);for(const b of v){if(b==="__proto__")continue;if(y===c.array&&b==="length"){g.length=l.length;continue}const _=Object.getOwnPropertyDescriptor(l,b);_?_.get||_.set?Object.defineProperty(g,b,_):_.enumerable?g[b]=h(l[b],u,m):Object.defineProperty(g,b,{enumerable:!1,writable:!0,configurable:!0,value:h(l[b],u,m)}):Object.defineProperty(g,b,{enumerable:!0,writable:!0,configurable:!0,value:h(l[b],u,m)})}return g},f.cloneWithShallow=function(l,u){const p=u.shallow;(u=Object.assign({},u)).shallow=!1;const h=new Map;for(const m of p){const y=a(l,m);typeof y!="object"&&typeof y!="function"||h.set(y,y)}return f.clone(l,u,h)},f.base=function(l,u,p){if(p.prototype===!1)return f.needsProtoHack.has(u)?new u.constructor:u===c.array?[]:{};const h=Object.getPrototypeOf(l);if(h&&h.isImmutable)return l;if(u===c.array){const m=[];return h!==u&&Object.setPrototypeOf(m,h),m}if(f.needsProtoHack.has(u)){const m=new h.constructor;return h!==u&&Object.setPrototypeOf(m,h),m}return Object.create(h)}},9474:(s,i,o)=>{const a=o(4277),c={mismatched:null};s.exports=function(d,f,l){return l=Object.assign({prototype:!0},l),!!c.isDeepEqual(d,f,l,[])},c.isDeepEqual=function(d,f,l,u){if(d===f)return d!==0||1/d==1/f;const p=typeof d;if(p!==typeof f||d===null||f===null)return!1;if(p==="function"){if(!l.deepFunction||d.toString()!==f.toString())return!1}else if(p!=="object")return d!=d&&f!=f;const h=c.getSharedType(d,f,!!l.prototype);switch(h){case a.buffer:return!1;case a.promise:return d===f;case a.regex:return d.toString()===f.toString();case c.mismatched:return!1}for(let m=u.length-1;m>=0;--m)if(u[m].isSame(d,f))return!0;u.push(new c.SeenEntry(d,f));try{return!!c.isDeepEqualObj(h,d,f,l,u)}finally{u.pop()}},c.getSharedType=function(d,f,l){if(l)return Object.getPrototypeOf(d)!==Object.getPrototypeOf(f)?c.mismatched:a.getInternalProto(d);const u=a.getInternalProto(d);return u!==a.getInternalProto(f)?c.mismatched:u},c.valueOf=function(d){const f=d.valueOf;if(f===void 0)return d;try{return f.call(d)}catch(l){return l}},c.hasOwnEnumerableProperty=function(d,f){return Object.prototype.propertyIsEnumerable.call(d,f)},c.isSetSimpleEqual=function(d,f){for(const l of Set.prototype.values.call(d))if(!Set.prototype.has.call(f,l))return!1;return!0},c.isDeepEqualObj=function(d,f,l,u,p){const{isDeepEqual:h,valueOf:m,hasOwnEnumerableProperty:y}=c,{keys:g,getOwnPropertySymbols:v}=Object;if(d===a.array){if(!u.part){if(f.length!==l.length)return!1;for(let T=0;T{const a=o(8761);s.exports=class extends Error{constructor(c){super(c.filter(d=>d!=="").map(d=>typeof d=="string"?d:d instanceof Error?d.message:a(d)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,i.assert)}}},5277:s=>{const i={};s.exports=function(o){if(!o)return"";let a="";for(let c=0;c=256?"&#"+o+";":`&#x${o.toString(16).padStart(2,"0")};`)},i.isSafe=function(o){return i.safeCharCodes.has(o)},i.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),i.safeCharCodes=function(){const o=new Set;for(let a=32;a<123;++a)(a>=97||a>=65&&a<=90||a>=48&&a<=57||a===32||a===46||a===44||a===45||a===58||a===95)&&o.add(a);return o}()},6064:s=>{s.exports=function(i){return i.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:s=>{s.exports=function(){}},1687:(s,i,o)=>{const a=o(375),c=o(8571),d=o(7043),f={};s.exports=f.merge=function(l,u,p){if(a(l&&typeof l=="object","Invalid target value: must be an object"),a(u==null||typeof u=="object","Invalid source value: must be null, undefined, or an object"),!u)return l;if(p=Object.assign({nullOverride:!0,mergeArrays:!0},p),Array.isArray(u)){a(Array.isArray(l),"Cannot merge array onto an object"),p.mergeArrays||(l.length=0);for(let m=0;m{const a=o(375),c={};s.exports=function(d,f,l){if(f===!1||f==null)return d;typeof(l=l||{})=="string"&&(l={separator:l});const u=Array.isArray(f);a(!u||!l.separator,"Separator option is not valid for array-based chain");const p=u?f:f.split(l.separator||".");let h=d;for(let m=0;m{s.exports=function(...i){try{return JSON.stringify(...i)}catch(o){return"[Cannot display object: "+o.message+"]"}}},4277:(s,i)=>{const o={};i=s.exports={array:Array.prototype,buffer:!1,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},o.typeMap=new Map([["[object Error]",i.error],["[object Map]",i.map],["[object Promise]",i.promise],["[object Set]",i.set],["[object WeakMap]",i.weakMap],["[object WeakSet]",i.weakSet]]),i.getInternalProto=function(a){if(Array.isArray(a))return i.array;if(a instanceof Date)return i.date;if(a instanceof RegExp)return i.regex;if(a instanceof Error)return i.error;const c=Object.prototype.toString.call(a);return o.typeMap.get(c)||i.generic}},7043:(s,i)=>{i.keys=function(o,a={}){return a.symbols!==!1?Reflect.ownKeys(o):Object.getOwnPropertyNames(o)}},3652:(s,i,o)=>{const a=o(375),c={};i.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(d,f){const l=[].concat((f=f||{}).before||[]),u=[].concat(f.after||[]),p=f.group||"?",h=f.sort||0;a(!l.includes(p),`Item cannot come before itself: ${p}`),a(!l.includes("?"),"Item cannot come before unassociated items"),a(!u.includes(p),`Item cannot come after itself: ${p}`),a(!u.includes("?"),"Item cannot come after unassociated items"),Array.isArray(d)||(d=[d]);for(const m of d){const y={seq:this._items.length,sort:h,before:l,after:u,group:p,node:m};this._items.push(y)}if(!f.manual){const m=this._sort();a(m,"item",p!=="?"?`added into group ${p}`:"","created a dependencies error")}return this.nodes}merge(d){Array.isArray(d)||(d=[d]);for(const l of d)if(l)for(const u of l._items)this._items.push(Object.assign({},u));this._items.sort(c.mergeSort);for(let l=0;ld.sort===f.sort?0:d.sort{const a=o(443),c=o(2178),d={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:a.URL||URL};i.analyze=function(f,l={}){if(!f)return c.code("DOMAIN_NON_EMPTY_STRING");if(typeof f!="string")throw new Error("Invalid input: domain must be a string");if(f.length>256)return c.code("DOMAIN_TOO_LONG");if(d.nonAsciiRx.test(f)){if(l.allowUnicode===!1)return c.code("DOMAIN_INVALID_UNICODE_CHARS");f=f.normalize("NFC")}if(d.domainControlRx.test(f))return c.code("DOMAIN_INVALID_CHARS");f=d.punycode(f),l.allowFullyQualified&&f[f.length-1]==="."&&(f=f.slice(0,-1));const u=l.minDomainSegments||d.minDomainSegments,p=f.split(".");if(p.lengthl.maxDomainSegments)return c.code("DOMAIN_SEGMENTS_COUNT_MAX");const h=l.tlds;if(h){const m=p[p.length-1].toLowerCase();if(h.deny&&h.deny.has(m)||h.allow&&!h.allow.has(m))return c.code("DOMAIN_FORBIDDEN_TLDS")}for(let m=0;m63)return c.code("DOMAIN_LONG_SEGMENT");if(m{const a=o(9848),c=o(5380),d=o(2178),f={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(a.TextEncoder||TextEncoder)};i.analyze=function(l,u){return f.email(l,u)},i.isValid=function(l,u){return!f.email(l,u)},f.email=function(l,u={}){if(typeof l!="string")throw new Error("Invalid input: email must be a string");if(!l)return d.code("EMPTY_STRING");const p=!f.nonAsciiRx.test(l);if(!p){if(u.allowUnicode===!1)return d.code("FORBIDDEN_UNICODE");l=l.normalize("NFC")}const h=l.split("@");if(h.length!==2)return h.length>2?d.code("MULTIPLE_AT_CHAR"):d.code("MISSING_AT_CHAR");const[m,y]=h;if(!m)return d.code("EMPTY_LOCAL");if(!u.ignoreLength){if(l.length>254)return d.code("ADDRESS_TOO_LONG");if(f.encoder.encode(m).length>64)return d.code("LOCAL_TOO_LONG")}return f.local(m,p)||c.analyze(y,u)},f.local=function(l,u){const p=l.split(".");for(const h of p){if(!h.length)return d.code("EMPTY_LOCAL_SEGMENT");if(u){if(!f.atextRx.test(h))return d.code("INVALID_LOCAL_CHARS")}else for(const m of h){if(f.atextRx.test(m))continue;const y=f.binary(m);if(!f.atomRx.test(y))return d.code("INVALID_LOCAL_CHARS")}}},f.binary=function(l){return Array.from(f.encoder.encode(l)).map(u=>String.fromCharCode(u)).join("")},f.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,f.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))},2178:(s,i)=>{i.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"},i.code=function(o){return{code:o,error:i.codes[o]}}},9959:(s,i,o)=>{const a=o(375),c=o(5752);i.regex=function(d={}){a(d.cidr===void 0||typeof d.cidr=="string","options.cidr must be a string");const f=d.cidr?d.cidr.toLowerCase():"optional";a(["required","optional","forbidden"].includes(f),"options.cidr must be one of required, optional, forbidden"),a(d.version===void 0||typeof d.version=="string"||Array.isArray(d.version),"options.version must be a string or an array of string");let l=d.version||["ipv4","ipv6","ipvfuture"];Array.isArray(l)||(l=[l]),a(l.length>=1,"options.version must have at least 1 version specified");for(let h=0;h{if(f==="forbidden")return c.ip[h];const m=`\\/${h==="ipv4"?c.ip.v4Cidr:c.ip.v6Cidr}`;return f==="required"?`${c.ip[h]}${m}`:`${c.ip[h]}(?:${m})?`}).join("|")})`,p=new RegExp(`^${u}$`);return{cidr:f,versions:l,regex:p,raw:u}}},5752:(s,i,o)=>{const a=o(375),c=o(6064),d={generate:function(){const f={},l="\\dA-Fa-f",u="["+l+"]",p="\\w-\\.~",h="!\\$&'\\(\\)\\*\\+,;=",m="%"+l,y=p+m+h+":@",g="["+y+"]",v="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";f.ipv4address="(?:"+v+"\\.){3}"+v;const b=u+"{1,4}",_="(?:"+b+":"+b+"|"+f.ipv4address+")",A="(?:"+b+":){6}"+_,P="::(?:"+b+":){5}"+_,T="(?:"+b+")?::(?:"+b+":){4}"+_,E="(?:(?:"+b+":){0,1}"+b+")?::(?:"+b+":){3}"+_,N="(?:(?:"+b+":){0,2}"+b+")?::(?:"+b+":){2}"+_,k="(?:(?:"+b+":){0,3}"+b+")?::"+b+":"+_,M="(?:(?:"+b+":){0,4}"+b+")?::"+_,j="(?:(?:"+b+":){0,5}"+b+")?::"+b,I="(?:(?:"+b+":){0,6}"+b+")?::";f.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",f.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",f.ipv6address="(?:"+A+"|"+P+"|"+T+"|"+E+"|"+N+"|"+k+"|"+M+"|"+j+"|"+I+")",f.ipvFuture="v"+u+"+\\.["+p+h+":]+",f.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",f.schemeRegex=new RegExp(f.scheme);const L="["+p+m+h+":]*",H="["+p+m+h+"]{1,255}",K="(?:\\[(?:"+f.ipv6address+"|"+f.ipvFuture+")\\]|"+f.ipv4address+"|"+H+")",V="(?:"+L+"@)?"+K+"(?::\\d*)?",U="(?:"+L+"@)?("+K+")(?::\\d*)?",Q=g+"*",te=g+"+",X="(?:\\/"+Q+")*",G="\\/(?:"+te+X+")?",Y=te+X,Z="["+p+m+h+"@]+"+X,he="(?:\\/\\/\\/"+Q+X+")";return f.hierPart="(?:(?:\\/\\/"+V+X+")|"+G+"|"+Y+"|"+he+")",f.hierPartCapture="(?:(?:\\/\\/"+U+X+")|"+G+"|"+Y+")",f.relativeRef="(?:(?:\\/\\/"+V+X+")|"+G+"|"+Z+"|)",f.relativeRefCapture="(?:(?:\\/\\/"+U+X+")|"+G+"|"+Z+"|)",f.query="["+y+"\\/\\?]*(?=#|$)",f.queryWithSquareBrackets="["+y+"\\[\\]\\/\\?]*(?=#|$)",f.fragment="["+y+"\\/\\?]*",f}};d.rfc3986=d.generate(),i.ip={v4Cidr:d.rfc3986.ipv4Cidr,v6Cidr:d.rfc3986.ipv6Cidr,ipv4:d.rfc3986.ipv4address,ipv6:d.rfc3986.ipv6address,ipvfuture:d.rfc3986.ipvFuture},d.createRegex=function(f){const l=d.rfc3986,u="(?:\\?"+(f.allowQuerySquareBrackets?l.queryWithSquareBrackets:l.query)+")?(?:#"+l.fragment+")?",p=f.domain?l.relativeRefCapture:l.relativeRef;if(f.relativeOnly)return d.wrap(p+u);let h="";if(f.scheme){a(f.scheme instanceof RegExp||typeof f.scheme=="string"||Array.isArray(f.scheme),"scheme must be a RegExp, String, or Array");const g=[].concat(f.scheme);a(g.length>=1,"scheme must have at least 1 scheme specified");const v=[];for(let b=0;b{const o={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};i.Parser=class{constructor(a,c={}){if(!c[o.settings]&&c.constants)for(const d in c.constants){const f=c.constants[d];if(f!==null&&!["boolean","number","string"].includes(typeof f))throw new Error(`Formula constant ${d} contains invalid ${typeof f} value type`)}this.settings=c[o.settings]?c:Object.assign({[o.settings]:!0,constants:{},functions:{}},c),this.single=null,this._parts=null,this._parse(a)}_parse(a){let c=[],d="",f=0,l=!1;const u=h=>{if(f)throw new Error("Formula missing closing parenthesis");const m=c.length?c[c.length-1]:null;if(l||d||h){if(m&&m.type==="reference"&&h===")")return m.type="function",m.value=this._subFormula(d,m.value),void(d="");if(h===")"){const y=new i.Parser(d,this.settings);c.push({type:"segment",value:y})}else if(l){if(l==="]")return c.push({type:"reference",value:d}),void(d="");c.push({type:"literal",value:d})}else if(o.operatorCharacters.includes(d))m&&m.type==="operator"&&o.operators.includes(m.value+d)?m.value+=d:c.push({type:"operator",value:d});else if(d.match(o.numberRx))c.push({type:"constant",value:parseFloat(d)});else if(this.settings.constants[d]!==void 0)c.push({type:"constant",value:this.settings.constants[d]});else{if(!d.match(o.tokenRx))throw new Error(`Formula contains invalid token: ${d}`);c.push({type:"reference",value:d})}d=""}};for(const h of a)l?h===l?(u(),l=!1):d+=h:f?h==="("?(d+=h,++f):h===")"?(--f,f?d+=h:u(h)):d+=h:h in o.literals?l=o.literals[h]:h==="("?(u(),++f):o.operatorCharacters.includes(h)?(u(),d=h,u()):h!==" "?d+=h:u();u(),c=c.map((h,m)=>h.type!=="operator"||h.value!=="-"||m&&c[m-1].type!=="operator"?h:{type:"operator",value:"n"});let p=!1;for(const h of c){if(h.type==="operator"){if(o.operatorsPrefix.includes(h.value))continue;if(!p)throw new Error("Formula contains an operator in invalid position");if(!o.operators.includes(h.value))throw new Error(`Formula contains an unknown operator ${h.value}`)}else if(p)throw new Error("Formula missing expected operator");p=!p}if(!p)throw new Error("Formula contains invalid trailing operator");c.length===1&&["reference","literal","constant"].includes(c[0].type)&&(this.single={type:c[0].type==="reference"?"reference":"value",value:c[0].value}),this._parts=c.map(h=>{if(h.type==="operator")return o.operatorsPrefix.includes(h.value)?h:h.value;if(h.type!=="reference")return h.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(h.value))throw new Error(`Formula contains invalid reference ${h.value}`);return this.settings.reference?this.settings.reference(h.value):o.reference(h.value)})}_subFormula(a,c){const d=this.settings.functions[c];if(typeof d!="function")throw new Error(`Formula contains unknown function ${c}`);let f=[];if(a){let l="",u=0,p=!1;const h=()=>{if(!l)throw new Error(`Formula contains function ${c} with invalid arguments ${a}`);f.push(l),l=""};for(let m=0;mnew i.Parser(l,this.settings)),function(l){const u=[];for(const p of f)u.push(p.evaluate(l));return d.call(l,...u)}}evaluate(a){const c=this._parts.slice();for(let d=c.length-2;d>=0;--d){const f=c[d];if(f&&f.type==="operator"){const l=c[d+1];c.splice(d+1,1);const u=o.evaluate(l,a);c[d]=o.single(f.value,u)}}return o.operatorsOrder.forEach(d=>{for(let f=1;f":return c>d;case">=":return c>=d;case"==":return c===d;case"!=":return c!==d;case"&&":return c&&d;case"||":return c||d}return null},o.exists=function(a){return a!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:s=>{s.exports=JSON.parse('{"version":"17.13.3"}')}},r={},function s(i){var o=r[i];if(o!==void 0)return o.exports;var a=r[i]={exports:{}};return n[i](a,a.exports,s),a.exports}(5107);var n,r})})(eJ);var iOe=eJ.exports;const Kt=Cu(iOe),oOe=t=>typeof t=="object"&&t!==null&&t.hasOwnProperty("total_items");class dn{constructor(e){Te(this,"_object");Te(this,"_error");Te(this,"isSuccess");Te(this,"isFailure");const{isSuccess:n,error:r,object:s}=e;if(n&&r)throw new Error("InvalidOperation: A result cannot be successful and contain an error");if(!n&&!r)throw new Error("InvalidOperation: A failing result needs to contain an error message");this.isSuccess=n,this.isFailure=!n,this._error=r,this._object=s,Object.freeze(this)}get object(){if(this.isFailure)throw new Error("Result is not successful");return this._object}get error(){if(this.isSuccess)throw new Error("Result is not error");return this._error}static ok(e){return new dn({isSuccess:!0,object:e})}static fail(e){return new dn({isSuccess:!1,error:e})}static combine(e){for(const n of e)if(n.isFailure)return n;return dn.ok()}}class bn{static validate(e,n,r={}){if(!Kt.isSchema(e))throw new aOe("Rule provided is not a valid Joi schema!");const s={abortEarly:!1,errors:{wrap:{label:"{}"}},...r},i=e.validate(n,s);return i.error?dn.fail(i.error):dn.ok(i.value)}static validateFnc(e){return(n,r)=>{const s=e(n);return s.isSuccess?n:r.message({custom:s.error.message})}}}Te(bn,"RULE_NOT_NULL_OR_UNDEFINED",Kt.any().required().invalid(null)),Te(bn,"RULE_ALLOW_NULL_OR_UNDEFINED",Kt.any().optional().valid(null)),Te(bn,"RULE_ALLOW_NULL",Kt.any().valid(null)),Te(bn,"RULE_ALLOW_EMPTY",Kt.any().optional().valid(null,"")),Te(bn,"RULE_IS_TYPE_STRING",Kt.string()),Te(bn,"RULE_IS_TYPE_NUMBER",Kt.number());class aOe extends Error{}class x$ extends Error{constructor(n,r,s={}){super(r);Te(this,"code");Te(this,"payload",{});this.name=this.constructor.name,this.code=n,this.payload=s,Object.setPrototypeOf(this,x$.prototype)}}const pA=class pA extends x${static create(e,n,r){return new pA(e,n,r)}};Te(pA,"INVALID_INPUT_DATA","INVALID_INPUT_DATA");let Ja=pA;function cf(t,e="",n){return Ja.create(t,e,n)}var tJ={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Object.prototype.hasOwnProperty;t.is=function(n,r){return n===r?n!==0||r!==0||1/n===1/r:n!==n&&r!==r},t.shallowEqual=function(n,r,s){if(n===r)return!0;if(typeof n!="object"||n===null||typeof r!="object"||r===null)return!1;var i=Object.keys(n),o=Object.keys(r);if(i.length!==o.length)return!1;for(var a=s&&typeof s.customEqual=="function"?s.customEqual:t.is,c=0;cthis.props===null)}}class rd extends H_{static validate(e,n){const r=bn.RULE_ALLOW_EMPTY.default(""),s=Kt.string().guid({version:["uuidv4"]}).label(n.label?n.label:"id"),i=Kt.alternatives(r,s);return bn.validate(i,e)}static sanitize(e){return e.trim()}static create(e,n={}){const r={label:"id",generateOnEmpty:!1,...n};if(!e&&!r.generateOnEmpty)return dn.fail(cf(Ja.INVALID_INPUT_DATA,"ID is null or empty"));if(e){const s=rd.validate(e,r);return s.isFailure?dn.fail(cf(Ja.INVALID_INPUT_DATA,s.error.message,r)):dn.ok(new rd(rd.sanitize(s.object)))}return r.generateOnEmpty?rd.generateNewID():dn.ok(new rd(null))}static generateNewID(){return dn.ok(new rd(fOe()))}get value(){return String(this.props)}toString(){return String(this.props)}toPrimitive(){return this.toString()}}class c6e extends Kt.ValidationError{}class u6e extends Kt.ValidationError{}class d6e extends Kt.ValidationError{}class f6e extends Kt.ValidationError{}class h6e extends Kt.ValidationError{}const jk={USD:{symbol:"$",name:"US Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"USD",name_plural:"US dollars"},CAD:{symbol:"CA$",name:"Canadian Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"CAD",name_plural:"Canadian dollars"},EUR:{symbol:"€",name:"Euro",symbol_native:"€",decimal_digits:2,rounding:0,code:"EUR",name_plural:"euros"},BTC:{symbol:"BTC",name:"Bitcoin",symbol_native:"฿",decimal_digits:8,rounding:0,code:"BTC",name_plural:"Bitcoins"},AED:{symbol:"AED",name:"United Arab Emirates Dirham",symbol_native:"د.إ.‏",decimal_digits:2,rounding:0,code:"AED",name_plural:"UAE dirhams"},AFN:{symbol:"Af",name:"Afghan Afghani",symbol_native:"؋",decimal_digits:2,rounding:0,code:"AFN",name_plural:"Afghan Afghanis"},ALL:{symbol:"ALL",name:"Albanian Lek",symbol_native:"Lek",decimal_digits:2,rounding:0,code:"ALL",name_plural:"Albanian lekë"},AMD:{symbol:"AMD",name:"Armenian Dram",symbol_native:"դր.",decimal_digits:2,rounding:0,code:"AMD",name_plural:"Armenian drams"},ARS:{symbol:"AR$",name:"Argentine Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"ARS",name_plural:"Argentine pesos"},AUD:{symbol:"AU$",name:"Australian Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"AUD",name_plural:"Australian dollars"},AZN:{symbol:"man.",name:"Azerbaijani Manat",symbol_native:"ман.",decimal_digits:2,rounding:0,code:"AZN",name_plural:"Azerbaijani manats"},BAM:{symbol:"KM",name:"Bosnia-Herzegovina Convertible Mark",symbol_native:"KM",decimal_digits:2,rounding:0,code:"BAM",name_plural:"Bosnia-Herzegovina convertible marks"},BDT:{symbol:"Tk",name:"Bangladeshi Taka",symbol_native:"৳",decimal_digits:2,rounding:0,code:"BDT",name_plural:"Bangladeshi takas"},BGN:{symbol:"BGN",name:"Bulgarian Lev",symbol_native:"лв.",decimal_digits:2,rounding:0,code:"BGN",name_plural:"Bulgarian leva"},BHD:{symbol:"BD",name:"Bahraini Dinar",symbol_native:"د.ب.‏",decimal_digits:3,rounding:0,code:"BHD",name_plural:"Bahraini dinars"},BIF:{symbol:"FBu",name:"Burundian Franc",symbol_native:"FBu",decimal_digits:0,rounding:0,code:"BIF",name_plural:"Burundian francs"},BND:{symbol:"BN$",name:"Brunei Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"BND",name_plural:"Brunei dollars"},BOB:{symbol:"Bs",name:"Bolivian Boliviano",symbol_native:"Bs",decimal_digits:2,rounding:0,code:"BOB",name_plural:"Bolivian bolivianos"},BRL:{symbol:"R$",name:"Brazilian Real",symbol_native:"R$",decimal_digits:2,rounding:0,code:"BRL",name_plural:"Brazilian reals"},BWP:{symbol:"BWP",name:"Botswanan Pula",symbol_native:"P",decimal_digits:2,rounding:0,code:"BWP",name_plural:"Botswanan pulas"},BYR:{symbol:"BYR",name:"Belarusian Ruble",symbol_native:"BYR",decimal_digits:0,rounding:0,code:"BYR",name_plural:"Belarusian rubles"},BZD:{symbol:"BZ$",name:"Belize Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"BZD",name_plural:"Belize dollars"},CDF:{symbol:"CDF",name:"Congolese Franc",symbol_native:"FrCD",decimal_digits:2,rounding:0,code:"CDF",name_plural:"Congolese francs"},CHF:{symbol:"CHF",name:"Swiss Franc",symbol_native:"CHF",decimal_digits:2,rounding:.05,code:"CHF",name_plural:"Swiss francs"},CLP:{symbol:"CL$",name:"Chilean Peso",symbol_native:"$",decimal_digits:0,rounding:0,code:"CLP",name_plural:"Chilean pesos"},CNY:{symbol:"CN¥",name:"Chinese Yuan",symbol_native:"CN¥",decimal_digits:2,rounding:0,code:"CNY",name_plural:"Chinese yuan"},COP:{symbol:"CO$",name:"Colombian Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"COP",name_plural:"Colombian pesos"},CRC:{symbol:"₡",name:"Costa Rican Colón",symbol_native:"₡",decimal_digits:2,rounding:0,code:"CRC",name_plural:"Costa Rican colóns"},CVE:{symbol:"CV$",name:"Cape Verdean Escudo",symbol_native:"CV$",decimal_digits:2,rounding:0,code:"CVE",name_plural:"Cape Verdean escudos"},CZK:{symbol:"Kč",name:"Czech Republic Koruna",symbol_native:"Kč",decimal_digits:2,rounding:0,code:"CZK",name_plural:"Czech Republic korunas"},DJF:{symbol:"Fdj",name:"Djiboutian Franc",symbol_native:"Fdj",decimal_digits:0,rounding:0,code:"DJF",name_plural:"Djiboutian francs"},DKK:{symbol:"Dkr",name:"Danish Krone",symbol_native:"kr",decimal_digits:2,rounding:0,code:"DKK",name_plural:"Danish kroner"},DOP:{symbol:"RD$",name:"Dominican Peso",symbol_native:"RD$",decimal_digits:2,rounding:0,code:"DOP",name_plural:"Dominican pesos"},DZD:{symbol:"DA",name:"Algerian Dinar",symbol_native:"د.ج.‏",decimal_digits:2,rounding:0,code:"DZD",name_plural:"Algerian dinars"},EEK:{symbol:"Ekr",name:"Estonian Kroon",symbol_native:"kr",decimal_digits:2,rounding:0,code:"EEK",name_plural:"Estonian kroons"},EGP:{symbol:"EGP",name:"Egyptian Pound",symbol_native:"ج.م.‏",decimal_digits:2,rounding:0,code:"EGP",name_plural:"Egyptian pounds"},ERN:{symbol:"Nfk",name:"Eritrean Nakfa",symbol_native:"Nfk",decimal_digits:2,rounding:0,code:"ERN",name_plural:"Eritrean nakfas"},ETB:{symbol:"Br",name:"Ethiopian Birr",symbol_native:"Br",decimal_digits:2,rounding:0,code:"ETB",name_plural:"Ethiopian birrs"},GBP:{symbol:"£",name:"British Pound Sterling",symbol_native:"£",decimal_digits:2,rounding:0,code:"GBP",name_plural:"British pounds sterling"},GEL:{symbol:"GEL",name:"Georgian Lari",symbol_native:"GEL",decimal_digits:2,rounding:0,code:"GEL",name_plural:"Georgian laris"},GHS:{symbol:"GH₵",name:"Ghanaian Cedi",symbol_native:"GH₵",decimal_digits:2,rounding:0,code:"GHS",name_plural:"Ghanaian cedis"},GNF:{symbol:"FG",name:"Guinean Franc",symbol_native:"FG",decimal_digits:0,rounding:0,code:"GNF",name_plural:"Guinean francs"},GTQ:{symbol:"GTQ",name:"Guatemalan Quetzal",symbol_native:"Q",decimal_digits:2,rounding:0,code:"GTQ",name_plural:"Guatemalan quetzals"},HKD:{symbol:"HK$",name:"Hong Kong Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"HKD",name_plural:"Hong Kong dollars"},HNL:{symbol:"HNL",name:"Honduran Lempira",symbol_native:"L",decimal_digits:2,rounding:0,code:"HNL",name_plural:"Honduran lempiras"},HRK:{symbol:"kn",name:"Croatian Kuna",symbol_native:"kn",decimal_digits:2,rounding:0,code:"HRK",name_plural:"Croatian kunas"},HUF:{symbol:"Ft",name:"Hungarian Forint",symbol_native:"Ft",decimal_digits:2,rounding:0,code:"HUF",name_plural:"Hungarian forints"},IDR:{symbol:"Rp",name:"Indonesian Rupiah",symbol_native:"Rp",decimal_digits:2,rounding:0,code:"IDR",name_plural:"Indonesian rupiahs"},ILS:{symbol:"₪",name:"Israeli New Sheqel",symbol_native:"₪",decimal_digits:2,rounding:0,code:"ILS",name_plural:"Israeli new sheqels"},INR:{symbol:"Rs",name:"Indian Rupee",symbol_native:"টকা",decimal_digits:2,rounding:0,code:"INR",name_plural:"Indian rupees"},IQD:{symbol:"IQD",name:"Iraqi Dinar",symbol_native:"د.ع.‏",decimal_digits:3,rounding:0,code:"IQD",name_plural:"Iraqi dinars"},IRR:{symbol:"IRR",name:"Iranian Rial",symbol_native:"﷼",decimal_digits:2,rounding:0,code:"IRR",name_plural:"Iranian rials"},ISK:{symbol:"Ikr",name:"Icelandic Króna",symbol_native:"kr",decimal_digits:0,rounding:0,code:"ISK",name_plural:"Icelandic krónur"},JMD:{symbol:"J$",name:"Jamaican Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"JMD",name_plural:"Jamaican dollars"},JOD:{symbol:"JD",name:"Jordanian Dinar",symbol_native:"د.أ.‏",decimal_digits:3,rounding:0,code:"JOD",name_plural:"Jordanian dinars"},JPY:{symbol:"¥",name:"Japanese Yen",symbol_native:"¥",decimal_digits:0,rounding:0,code:"JPY",name_plural:"Japanese yen"},KES:{symbol:"Ksh",name:"Kenyan Shilling",symbol_native:"Ksh",decimal_digits:2,rounding:0,code:"KES",name_plural:"Kenyan shillings"},KHR:{symbol:"KHR",name:"Cambodian Riel",symbol_native:"៛",decimal_digits:2,rounding:0,code:"KHR",name_plural:"Cambodian riels"},KMF:{symbol:"CF",name:"Comorian Franc",symbol_native:"FC",decimal_digits:0,rounding:0,code:"KMF",name_plural:"Comorian francs"},KRW:{symbol:"₩",name:"South Korean Won",symbol_native:"₩",decimal_digits:0,rounding:0,code:"KRW",name_plural:"South Korean won"},KWD:{symbol:"KD",name:"Kuwaiti Dinar",symbol_native:"د.ك.‏",decimal_digits:3,rounding:0,code:"KWD",name_plural:"Kuwaiti dinars"},KZT:{symbol:"KZT",name:"Kazakhstani Tenge",symbol_native:"тңг.",decimal_digits:2,rounding:0,code:"KZT",name_plural:"Kazakhstani tenges"},LAK:{symbol:"₭",name:"Lao kip",symbol_native:"ກີບ",decimal_digits:2,rounding:0,code:"LAK",name_plural:"Lao kips"},LBP:{symbol:"LB£",name:"Lebanese Pound",symbol_native:"ل.ل.‏",decimal_digits:2,rounding:0,code:"LBP",name_plural:"Lebanese pounds"},LKR:{symbol:"SLRs",name:"Sri Lankan Rupee",symbol_native:"SL Re",decimal_digits:2,rounding:0,code:"LKR",name_plural:"Sri Lankan rupees"},LTL:{symbol:"Lt",name:"Lithuanian Litas",symbol_native:"Lt",decimal_digits:2,rounding:0,code:"LTL",name_plural:"Lithuanian litai"},LVL:{symbol:"Ls",name:"Latvian Lats",symbol_native:"Ls",decimal_digits:2,rounding:0,code:"LVL",name_plural:"Latvian lati"},LYD:{symbol:"LD",name:"Libyan Dinar",symbol_native:"د.ل.‏",decimal_digits:3,rounding:0,code:"LYD",name_plural:"Libyan dinars"},MAD:{symbol:"MAD",name:"Moroccan Dirham",symbol_native:"د.م.‏",decimal_digits:2,rounding:0,code:"MAD",name_plural:"Moroccan dirhams"},MDL:{symbol:"MDL",name:"Moldovan Leu",symbol_native:"MDL",decimal_digits:2,rounding:0,code:"MDL",name_plural:"Moldovan lei"},MGA:{symbol:"MGA",name:"Malagasy Ariary",symbol_native:"MGA",decimal_digits:2,rounding:0,code:"MGA",name_plural:"Malagasy Ariaries"},MKD:{symbol:"MKD",name:"Macedonian Denar",symbol_native:"MKD",decimal_digits:2,rounding:0,code:"MKD",name_plural:"Macedonian denari"},MMK:{symbol:"MMK",name:"Myanma Kyat",symbol_native:"K",decimal_digits:2,rounding:0,code:"MMK",name_plural:"Myanma kyats"},MOP:{symbol:"MOP$",name:"Macanese Pataca",symbol_native:"MOP$",decimal_digits:2,rounding:0,code:"MOP",name_plural:"Macanese patacas"},MUR:{symbol:"MURs",name:"Mauritian Rupee",symbol_native:"MURs",decimal_digits:2,rounding:0,code:"MUR",name_plural:"Mauritian rupees"},MXN:{symbol:"MX$",name:"Mexican Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"MXN",name_plural:"Mexican pesos"},MYR:{symbol:"RM",name:"Malaysian Ringgit",symbol_native:"RM",decimal_digits:2,rounding:0,code:"MYR",name_plural:"Malaysian ringgits"},MZN:{symbol:"MTn",name:"Mozambican Metical",symbol_native:"MTn",decimal_digits:2,rounding:0,code:"MZN",name_plural:"Mozambican meticals"},NAD:{symbol:"N$",name:"Namibian Dollar",symbol_native:"N$",decimal_digits:2,rounding:0,code:"NAD",name_plural:"Namibian dollars"},NGN:{symbol:"₦",name:"Nigerian Naira",symbol_native:"₦",decimal_digits:2,rounding:0,code:"NGN",name_plural:"Nigerian nairas"},NIO:{symbol:"C$",name:"Nicaraguan Córdoba",symbol_native:"C$",decimal_digits:2,rounding:0,code:"NIO",name_plural:"Nicaraguan córdobas"},NOK:{symbol:"Nkr",name:"Norwegian Krone",symbol_native:"kr",decimal_digits:2,rounding:0,code:"NOK",name_plural:"Norwegian kroner"},NPR:{symbol:"NPRs",name:"Nepalese Rupee",symbol_native:"नेरू",decimal_digits:2,rounding:0,code:"NPR",name_plural:"Nepalese rupees"},NZD:{symbol:"NZ$",name:"New Zealand Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"NZD",name_plural:"New Zealand dollars"},OMR:{symbol:"OMR",name:"Omani Rial",symbol_native:"ر.ع.‏",decimal_digits:3,rounding:0,code:"OMR",name_plural:"Omani rials"},PAB:{symbol:"B/.",name:"Panamanian Balboa",symbol_native:"B/.",decimal_digits:2,rounding:0,code:"PAB",name_plural:"Panamanian balboas"},PEN:{symbol:"S/.",name:"Peruvian Nuevo Sol",symbol_native:"S/.",decimal_digits:2,rounding:0,code:"PEN",name_plural:"Peruvian nuevos soles"},PHP:{symbol:"₱",name:"Philippine Peso",symbol_native:"₱",decimal_digits:2,rounding:0,code:"PHP",name_plural:"Philippine pesos"},PKR:{symbol:"PKRs",name:"Pakistani Rupee",symbol_native:"₨",decimal_digits:2,rounding:0,code:"PKR",name_plural:"Pakistani rupees"},PLN:{symbol:"zł",name:"Polish Zloty",symbol_native:"zł",decimal_digits:2,rounding:0,code:"PLN",name_plural:"Polish zlotys"},PYG:{symbol:"₲",name:"Paraguayan Guarani",symbol_native:"₲",decimal_digits:0,rounding:0,code:"PYG",name_plural:"Paraguayan guaranis"},QAR:{symbol:"QR",name:"Qatari Rial",symbol_native:"ر.ق.‏",decimal_digits:2,rounding:0,code:"QAR",name_plural:"Qatari rials"},RON:{symbol:"RON",name:"Romanian Leu",symbol_native:"RON",decimal_digits:2,rounding:0,code:"RON",name_plural:"Romanian lei"},RSD:{symbol:"din.",name:"Serbian Dinar",symbol_native:"дин.",decimal_digits:2,rounding:0,code:"RSD",name_plural:"Serbian dinars"},RUB:{symbol:"RUB",name:"Russian Ruble",symbol_native:"₽",decimal_digits:2,rounding:0,code:"RUB",name_plural:"Russian rubles"},RWF:{symbol:"RWF",name:"Rwandan Franc",symbol_native:"FR",decimal_digits:0,rounding:0,code:"RWF",name_plural:"Rwandan francs"},SAR:{symbol:"SR",name:"Saudi Riyal",symbol_native:"ر.س.‏",decimal_digits:2,rounding:0,code:"SAR",name_plural:"Saudi riyals"},SDG:{symbol:"SDG",name:"Sudanese Pound",symbol_native:"SDG",decimal_digits:2,rounding:0,code:"SDG",name_plural:"Sudanese pounds"},SEK:{symbol:"Skr",name:"Swedish Krona",symbol_native:"kr",decimal_digits:2,rounding:0,code:"SEK",name_plural:"Swedish kronor"},SGD:{symbol:"S$",name:"Singapore Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"SGD",name_plural:"Singapore dollars"},SOS:{symbol:"Ssh",name:"Somali Shilling",symbol_native:"Ssh",decimal_digits:2,rounding:0,code:"SOS",name_plural:"Somali shillings"},SYP:{symbol:"SY£",name:"Syrian Pound",symbol_native:"ل.س.‏",decimal_digits:2,rounding:0,code:"SYP",name_plural:"Syrian pounds"},THB:{symbol:"฿",name:"Thai Baht",symbol_native:"฿",decimal_digits:2,rounding:0,code:"THB",name_plural:"Thai baht"},TND:{symbol:"DT",name:"Tunisian Dinar",symbol_native:"د.ت.‏",decimal_digits:3,rounding:0,code:"TND",name_plural:"Tunisian dinars"},TOP:{symbol:"T$",name:"Tongan Paʻanga",symbol_native:"T$",decimal_digits:2,rounding:0,code:"TOP",name_plural:"Tongan paʻanga"},TRY:{symbol:"TL",name:"Turkish Lira",symbol_native:"TL",decimal_digits:2,rounding:0,code:"TRY",name_plural:"Turkish Lira"},TTD:{symbol:"TT$",name:"Trinidad and Tobago Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"TTD",name_plural:"Trinidad and Tobago dollars"},TWD:{symbol:"NT$",name:"New Taiwan Dollar",symbol_native:"NT$",decimal_digits:2,rounding:0,code:"TWD",name_plural:"New Taiwan dollars"},TZS:{symbol:"TSh",name:"Tanzanian Shilling",symbol_native:"TSh",decimal_digits:2,rounding:0,code:"TZS",name_plural:"Tanzanian shillings"},UAH:{symbol:"₴",name:"Ukrainian Hryvnia",symbol_native:"₴",decimal_digits:2,rounding:0,code:"UAH",name_plural:"Ukrainian hryvnias"},UGX:{symbol:"USh",name:"Ugandan Shilling",symbol_native:"USh",decimal_digits:0,rounding:0,code:"UGX",name_plural:"Ugandan shillings"},UYU:{symbol:"$U",name:"Uruguayan Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"UYU",name_plural:"Uruguayan pesos"},UZS:{symbol:"UZS",name:"Uzbekistan Som",symbol_native:"UZS",decimal_digits:2,rounding:0,code:"UZS",name_plural:"Uzbekistan som"},VEF:{symbol:"Bs.F.",name:"Venezuelan Bolívar",symbol_native:"Bs.F.",decimal_digits:2,rounding:0,code:"VEF",name_plural:"Venezuelan bolívars"},VND:{symbol:"₫",name:"Vietnamese Dong",symbol_native:"₫",decimal_digits:0,rounding:0,code:"VND",name_plural:"Vietnamese dong"},XAF:{symbol:"FCFA",name:"CFA Franc BEAC",symbol_native:"FCFA",decimal_digits:0,rounding:0,code:"XAF",name_plural:"CFA francs BEAC"},XOF:{symbol:"CFA",name:"CFA Franc BCEAO",symbol_native:"CFA",decimal_digits:0,rounding:0,code:"XOF",name_plural:"CFA francs BCEAO"},YER:{symbol:"YR",name:"Yemeni Rial",symbol_native:"ر.ي.‏",decimal_digits:2,rounding:0,code:"YER",name_plural:"Yemeni rials"},ZAR:{symbol:"R",name:"South African Rand",symbol_native:"R",decimal_digits:2,rounding:0,code:"ZAR",name_plural:"South African rand"},ZMK:{symbol:"ZK",name:"Zambian Kwacha",symbol_native:"ZK",decimal_digits:0,rounding:0,code:"ZMK",name_plural:"Zambian kwachas"}},id=class id extends H_{constructor(){super(...arguments);Te(this,"toString",()=>this.code)}get symbol(){return this.props?String(this.props.symbol_native):""}get code(){return this.props?String(this.props.code):""}static validate(n,r){const s=Kt.alternatives(bn.RULE_ALLOW_EMPTY.default(""),Kt.string().uppercase().valid(...Object.keys(jk)).label(String(r.label)));return bn.validate(s,n)}static createFromCode(n,r={}){const s={...r,label:r.label?r.label:"current_code"},i=id.validate(n,s);return i.isFailure?dn.fail(cf(Ja.INVALID_INPUT_DATA,i.error.message,s)):dn.ok(new id(jk[i.object]))}static createDefaultCode(){return id.createFromCode(id.DEFAULT_CURRENCY_CODE)}isEmpty(){return this.isNull()||this.props===void 0}toPrimitive(){return this.toString()}};Te(id,"DEFAULT_CURRENCY_CODE","EUR"),Te(id,"CURRENCIES",jk);let cu=id;class p6e extends Kt.ValidationError{}const Ik={aa:{name:"Afar",nativeName:"Afaraf"},ab:{name:"Abkhaz",nativeName:"аҧсуа бызшәа"},ae:{name:"Avestan",nativeName:"avesta"},af:{name:"Afrikaans",nativeName:"Afrikaans"},ak:{name:"Akan",nativeName:"Akan"},am:{name:"Amharic",nativeName:"አማርኛ"},an:{name:"Aragonese",nativeName:"aragonés"},ar:{name:"Arabic",nativeName:"اَلْعَرَبِيَّةُ"},as:{name:"Assamese",nativeName:"অসমীয়া"},av:{name:"Avaric",nativeName:"авар мацӀ"},ay:{name:"Aymara",nativeName:"aymar aru"},az:{name:"Azerbaijani",nativeName:"azərbaycan dili"},ba:{name:"Bashkir",nativeName:"башҡорт теле"},be:{name:"Belarusian",nativeName:"беларуская мова"},bg:{name:"Bulgarian",nativeName:"български език"},bi:{name:"Bislama",nativeName:"Bislama"},bm:{name:"Bambara",nativeName:"bamanankan"},bn:{name:"Bengali",nativeName:"বাংলা"},bo:{name:"Tibetan",nativeName:"བོད་ཡིག"},br:{name:"Breton",nativeName:"brezhoneg"},bs:{name:"Bosnian",nativeName:"bosanski jezik"},ca:{name:"Catalan",nativeName:"Català"},ce:{name:"Chechen",nativeName:"нохчийн мотт"},ch:{name:"Chamorro",nativeName:"Chamoru"},co:{name:"Corsican",nativeName:"corsu"},cr:{name:"Cree",nativeName:"ᓀᐦᐃᔭᐍᐏᐣ"},cs:{name:"Czech",nativeName:"čeština"},cu:{name:"Old Church Slavonic",nativeName:"ѩзыкъ словѣньскъ"},cv:{name:"Chuvash",nativeName:"чӑваш чӗлхи"},cy:{name:"Welsh",nativeName:"Cymraeg"},da:{name:"Danish",nativeName:"dansk"},de:{name:"German",nativeName:"Deutsch"},dv:{name:"Divehi",nativeName:"ދިވެހި"},dz:{name:"Dzongkha",nativeName:"རྫོང་ཁ"},ee:{name:"Ewe",nativeName:"Eʋegbe"},el:{name:"Greek",nativeName:"Ελληνικά"},en:{name:"English",nativeName:"English"},eo:{name:"Esperanto",nativeName:"Esperanto"},es:{name:"Spanish",nativeName:"Español"},et:{name:"Estonian",nativeName:"eesti"},eu:{name:"Basque",nativeName:"euskara"},fa:{name:"Persian",nativeName:"فارسی"},ff:{name:"Fula",nativeName:"Fulfulde"},fi:{name:"Finnish",nativeName:"suomi"},fj:{name:"Fijian",nativeName:"vosa Vakaviti"},fo:{name:"Faroese",nativeName:"føroyskt"},fr:{name:"French",nativeName:"Français"},fy:{name:"Western Frisian",nativeName:"Frysk"},ga:{name:"Irish",nativeName:"Gaeilge"},gd:{name:"Scottish Gaelic",nativeName:"Gàidhlig"},gl:{name:"Galician",nativeName:"galego"},gn:{name:"Guaraní",nativeName:"Avañe'ẽ"},gu:{name:"Gujarati",nativeName:"ગુજરાતી"},gv:{name:"Manx",nativeName:"Gaelg"},ha:{name:"Hausa",nativeName:"هَوُسَ"},he:{name:"Hebrew",nativeName:"עברית"},hi:{name:"Hindi",nativeName:"हिन्दी"},ho:{name:"Hiri Motu",nativeName:"Hiri Motu"},hr:{name:"Croatian",nativeName:"Hrvatski"},ht:{name:"Haitian",nativeName:"Kreyòl ayisyen"},hu:{name:"Hungarian",nativeName:"magyar"},hy:{name:"Armenian",nativeName:"Հայերեն"},hz:{name:"Herero",nativeName:"Otjiherero"},ia:{name:"Interlingua",nativeName:"Interlingua"},id:{name:"Indonesian",nativeName:"Bahasa Indonesia"},ie:{name:"Interlingue",nativeName:"Interlingue"},ig:{name:"Igbo",nativeName:"Asụsụ Igbo"},ii:{name:"Nuosu",nativeName:"ꆈꌠ꒿ Nuosuhxop"},ik:{name:"Inupiaq",nativeName:"Iñupiaq"},io:{name:"Ido",nativeName:"Ido"},is:{name:"Icelandic",nativeName:"Íslenska"},it:{name:"Italian",nativeName:"Italiano"},iu:{name:"Inuktitut",nativeName:"ᐃᓄᒃᑎᑐᑦ"},ja:{name:"Japanese",nativeName:"日本語"},jv:{name:"Javanese",nativeName:"basa Jawa"},ka:{name:"Georgian",nativeName:"ქართული"},kg:{name:"Kongo",nativeName:"Kikongo"},ki:{name:"Kikuyu",nativeName:"Gĩkũyũ"},kj:{name:"Kwanyama",nativeName:"Kuanyama"},kk:{name:"Kazakh",nativeName:"қазақ тілі"},kl:{name:"Kalaallisut",nativeName:"kalaallisut"},km:{name:"Khmer",nativeName:"ខេមរភាសា"},kn:{name:"Kannada",nativeName:"ಕನ್ನಡ"},ko:{name:"Korean",nativeName:"한국어"},kr:{name:"Kanuri",nativeName:"Kanuri"},ks:{name:"Kashmiri",nativeName:"कश्मीरी"},ku:{name:"Kurdish",nativeName:"Kurdî"},kv:{name:"Komi",nativeName:"коми кыв"},kw:{name:"Cornish",nativeName:"Kernewek"},ky:{name:"Kyrgyz",nativeName:"Кыргызча"},la:{name:"Latin",nativeName:"latine"},lb:{name:"Luxembourgish",nativeName:"Lëtzebuergesch"},lg:{name:"Ganda",nativeName:"Luganda"},li:{name:"Limburgish",nativeName:"Limburgs"},ln:{name:"Lingala",nativeName:"Lingála"},lo:{name:"Lao",nativeName:"ພາສາລາວ"},lt:{name:"Lithuanian",nativeName:"lietuvių kalba"},lu:{name:"Luba-Katanga",nativeName:"Kiluba"},lv:{name:"Latvian",nativeName:"latviešu valoda"},mg:{name:"Malagasy",nativeName:"fiteny malagasy"},mh:{name:"Marshallese",nativeName:"Kajin M̧ajeļ"},mi:{name:"Māori",nativeName:"te reo Māori"},mk:{name:"Macedonian",nativeName:"македонски јазик"},ml:{name:"Malayalam",nativeName:"മലയാളം"},mn:{name:"Mongolian",nativeName:"Монгол хэл"},mr:{name:"Marathi",nativeName:"मराठी"},ms:{name:"Malay",nativeName:"Bahasa Melayu"},mt:{name:"Maltese",nativeName:"Malti"},my:{name:"Burmese",nativeName:"ဗမာစာ"},na:{name:"Nauru",nativeName:"Dorerin Naoero"},nb:{name:"Norwegian Bokmål",nativeName:"Norsk bokmål"},nd:{name:"Northern Ndebele",nativeName:"isiNdebele"},ne:{name:"Nepali",nativeName:"नेपाली"},ng:{name:"Ndonga",nativeName:"Owambo"},nl:{name:"Dutch",nativeName:"Nederlands"},nn:{name:"Norwegian Nynorsk",nativeName:"Norsk nynorsk"},no:{name:"Norwegian",nativeName:"Norsk"},nr:{name:"Southern Ndebele",nativeName:"isiNdebele"},nv:{name:"Navajo",nativeName:"Diné bizaad"},ny:{name:"Chichewa",nativeName:"chiCheŵa"},oc:{name:"Occitan",nativeName:"occitan"},oj:{name:"Ojibwe",nativeName:"ᐊᓂᔑᓈᐯᒧᐎᓐ"},om:{name:"Oromo",nativeName:"Afaan Oromoo"},or:{name:"Oriya",nativeName:"ଓଡ଼ିଆ"},os:{name:"Ossetian",nativeName:"ирон æвзаг"},pa:{name:"Panjabi",nativeName:"ਪੰਜਾਬੀ"},pi:{name:"Pāli",nativeName:"पाऴि"},pl:{name:"Polish",nativeName:"Polski"},ps:{name:"Pashto",nativeName:"پښتو"},pt:{name:"Portuguese",nativeName:"Português"},qu:{name:"Quechua",nativeName:"Runa Simi"},rm:{name:"Romansh",nativeName:"rumantsch grischun"},rn:{name:"Kirundi",nativeName:"Ikirundi"},ro:{name:"Romanian",nativeName:"Română"},ru:{name:"Russian",nativeName:"Русский"},rw:{name:"Kinyarwanda",nativeName:"Ikinyarwanda"},sa:{name:"Sanskrit",nativeName:"संस्कृतम्"},sc:{name:"Sardinian",nativeName:"sardu"},sd:{name:"Sindhi",nativeName:"सिन्धी"},se:{name:"Northern Sami",nativeName:"Davvisámegiella"},sg:{name:"Sango",nativeName:"yângâ tî sängö"},si:{name:"Sinhala",nativeName:"සිංහල"},sk:{name:"Slovak",nativeName:"slovenčina"},sl:{name:"Slovenian",nativeName:"slovenščina"},sm:{name:"Samoan",nativeName:"gagana fa'a Samoa"},sn:{name:"Shona",nativeName:"chiShona"},so:{name:"Somali",nativeName:"Soomaaliga"},sq:{name:"Albanian",nativeName:"Shqip"},sr:{name:"Serbian",nativeName:"српски језик"},ss:{name:"Swati",nativeName:"SiSwati"},st:{name:"Southern Sotho",nativeName:"Sesotho"},su:{name:"Sundanese",nativeName:"Basa Sunda"},sv:{name:"Swedish",nativeName:"Svenska"},sw:{name:"Swahili",nativeName:"Kiswahili"},ta:{name:"Tamil",nativeName:"தமிழ்"},te:{name:"Telugu",nativeName:"తెలుగు"},tg:{name:"Tajik",nativeName:"тоҷикӣ"},th:{name:"Thai",nativeName:"ไทย"},ti:{name:"Tigrinya",nativeName:"ትግርኛ"},tk:{name:"Turkmen",nativeName:"Türkmençe"},tl:{name:"Tagalog",nativeName:"Wikang Tagalog"},tn:{name:"Tswana",nativeName:"Setswana"},to:{name:"Tonga",nativeName:"faka Tonga"},tr:{name:"Turkish",nativeName:"Türkçe"},ts:{name:"Tsonga",nativeName:"Xitsonga"},tt:{name:"Tatar",nativeName:"татар теле"},tw:{name:"Twi",nativeName:"Twi"},ty:{name:"Tahitian",nativeName:"Reo Tahiti"},ug:{name:"Uyghur",nativeName:"ئۇيغۇرچە‎"},uk:{name:"Ukrainian",nativeName:"Українська"},ur:{name:"Urdu",nativeName:"اردو"},uz:{name:"Uzbek",nativeName:"Ўзбек"},ve:{name:"Venda",nativeName:"Tshivenḓa"},vi:{name:"Vietnamese",nativeName:"Tiếng Việt"},vo:{name:"Volapük",nativeName:"Volapük"},wa:{name:"Walloon",nativeName:"walon"},wo:{name:"Wolof",nativeName:"Wollof"},xh:{name:"Xhosa",nativeName:"isiXhosa"},yi:{name:"Yiddish",nativeName:"ייִדיש"},yo:{name:"Yoruba",nativeName:"Yorùbá"},za:{name:"Zhuang",nativeName:"Saɯ cueŋƅ"},zh:{name:"Chinese",nativeName:"中文"},zu:{name:"Zulu",nativeName:"isiZulu"}},od=class od extends H_{constructor(){super(...arguments);Te(this,"toString",()=>this.code)}static validate(n,r){const s=Kt.alternatives(bn.RULE_ALLOW_EMPTY.default(""),Kt.string().lowercase().valid(...Object.keys(Ik)).label(String(r.label)));return bn.validate(s,n)}static sanitize(n){return n?String(n).toLowerCase():void 0}static createFromCode(n,r={}){const s={...r,label:r.label?r.label:"lang_code"},i=od.validate(n,s);if(i.isFailure)return dn.fail(cf(Ja.INVALID_INPUT_DATA,i.error.message,s));const o=od.sanitize(i.object),a=o?{...Ik[i.object],code:o}:void 0;return dn.ok(new od(a))}static createDefaultCode(){return od.createFromCode(this.DEFAULT_LANGUAGE_CODE)}get name(){return this.props?String(this.props.name):""}get nativeName(){return this.props?String(this.props.nativeName):""}get code(){return this.props?String(this.props.code):""}isEmpty(){return this.isNull()||this.props===void 0}toPrimitive(){return this.toString()}};Te(od,"DEFAULT_LANGUAGE_CODE","es"),Te(od,"LANGUAGES",Ik);let R0=od;var hOe={defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},pOe={globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}};function P0(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?P0=function(e){return typeof e}:P0=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P0(t)}function pU(t){return mOe(t)||gOe(t)||vOe(t)||yOe()}function mOe(t){if(Array.isArray(t))return t}function gOe(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function vOe(t,e){if(t){if(typeof t=="string")return mU(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mU(t,e)}}function mU(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0}function wOe(t){return t.length>0&&t.every(function(e){return e>=0})&&t.some(function(e){return e>0})}function gU(t){return t%2===0}function vU(t){return nJ(t)&&!Number.isInteger(t)}function _Oe(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=t.toString();if(e.indexOf("e-")>0)return parseInt(e.split("e-")[1]);var n=e.split(".")[1];return n?n.length:0}function Tb(t){return Math.abs(t)%1===.5}function SOe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(n,r){var s=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){s.readyState===4&&(s.status>=200&&s.status<400?n(JSON.parse(s.responseText)):r(new Error(s.statusText)))},onerror:function(){r(new Error("Network error"))}});s.open("GET",t,!0),COe(s,e.headers),s.send()})}function COe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var n in e)t.setRequestHeader(n,e[n]);return t}function Yb(t){return typeof t>"u"}function rJ(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",n={};return Object.entries(t).forEach(function(r){if(P0(r[1])==="object"){var s=rJ(r[1]);Object.entries(s).forEach(function(i){n[r[0]+e+i[0]]=i[1]})}else n[r[0]]=r[1]}),n}function EOe(t){return!!t&&(P0(t)==="object"||typeof t=="function")&&typeof t.then=="function"}function sJ(){var t=function(r,s){var i=function(c){return Math.pow(10,_Oe(c))},o=Math.max(i(r),i(s));return Math.round(r*o)*Math.round(s*o)/(o*o)},e={HALF_ODD:function(r){var s=Math.round(r);return Tb(r)&&gU(s)?s-1:s},HALF_EVEN:function(r){var s=Math.round(r);return Tb(r)?gU(s)?s:s-1:s},HALF_UP:function(r){return Math.round(r)},HALF_DOWN:function(r){return Tb(r)?Math.floor(r):Math.round(r)},HALF_TOWARDS_ZERO:function(r){return Tb(r)?Math.sign(r)*Math.floor(Math.abs(r)):Math.round(r)},HALF_AWAY_FROM_ZERO:function(r){return Tb(r)?Math.sign(r)*Math.ceil(Math.abs(r)):Math.round(r)},DOWN:function(r){return Math.floor(r)}};return{add:function(r,s){return r+s},subtract:function(r,s){return r-s},multiply:function(r,s){return vU(r)||vU(s)?t(r,s):r*s},divide:function(r,s){return r/s},modulo:function(r,s){return r%s},round:function(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"HALF_EVEN";return e[s](r)}}}var AOe=sJ();function ROe(t){var e=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(t);return{getMatches:function(){return e!==null?e.slice(1).filter(function(r){return!Yb(r)}):[]},getMinimumFractionDigits:function(){var r=function(i){return i==="."};return Yb(this.getMatches().find(r))?0:this.getMatches()[AOe.add(this.getMatches().findIndex(r),1)].split("").length},getCurrencyDisplay:function(){var r={USD:"code",dollar:"name",$:"symbol"};return r[this.getMatches().find(function(s){return s==="USD"||s==="dollar"||s==="$"})]},getStyle:function(){return Yb(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!Yb(this.getMatches().find(function(r){return r===","}))}}}function POe(t){var e=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",i=arguments.length>1?arguments[1]:void 0;for(var o in i)s=s.replace("{{".concat(o,"}}"),i[o]);return s},n=function(s,i){return SOe(e(t.endpoint,{from:s,to:i}),{headers:t.headers})};return{getExchangeRate:function(s,i){return(EOe(t.endpoint)?t.endpoint:n(s,i)).then(function(o){return rJ(o)[e(t.propertyPath,{from:s,to:i})]})}}}function xx(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!t)throw new n(e)}function NOe(t){xx(xOe(t),"You must provide a numeric value between 0 and 100.",RangeError)}function TOe(t){xx(wOe(t),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function Lk(t){xx(Number.isInteger(t),"You must provide an integer.",TypeError)}var Vn=sJ(),kOe=function t(e){var n=Object.assign({},{amount:t.defaultAmount,currency:t.defaultCurrency,precision:t.defaultPrecision},e),r=n.amount,s=n.currency,i=n.precision;Lk(r),Lk(i);var o=t.globalLocale,a=t.globalFormat,c=t.globalRoundingMode,d=t.globalFormatRoundingMode,f=Object.assign({},t.globalExchangeRatesApi),l=function(h){var m=Object.assign({},Object.assign({},{amount:r,currency:s,precision:i},h),Object.assign({},{locale:this.locale},h));return Object.assign(t({amount:m.amount,currency:m.currency,precision:m.precision}),{locale:m.locale})},u=function(h){xx(this.hasSameCurrency(h),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return r},getCurrency:function(){return s},getLocale:function(){return this.locale||o},setLocale:function(h){return l.call(this,{locale:h})},getPrecision:function(){return i},convertPrecision:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d;Lk(h);var y=this.getPrecision(),g=h>y,v=g?Vn.multiply:Vn.divide,b=g?[h,y]:[y,h],_=Math.pow(10,Vn.subtract.apply(Vn,b));return l.call(this,{amount:Vn.round(v(this.getAmount(),_),m),precision:h})},add:function(h){u.call(this,h);var m=t.normalizePrecision([this,h]);return l.call(this,{amount:Vn.add(m[0].getAmount(),m[1].getAmount()),precision:m[0].getPrecision()})},subtract:function(h){u.call(this,h);var m=t.normalizePrecision([this,h]);return l.call(this,{amount:Vn.subtract(m[0].getAmount(),m[1].getAmount()),precision:m[0].getPrecision()})},multiply:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return l.call(this,{amount:Vn.round(Vn.multiply(this.getAmount(),h),m)})},divide:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return l.call(this,{amount:Vn.round(Vn.divide(this.getAmount(),h),m)})},percentage:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return NOe(h),this.multiply(Vn.divide(h,100),m)},allocate:function(h){var m=this;TOe(h);for(var y=h.reduce(function(_,A){return Vn.add(_,A)}),g=this.getAmount(),v=h.map(function(_){var A=Math.floor(Vn.divide(Vn.multiply(m.getAmount(),_),y));return g=Vn.subtract(g,A),l.call(m,{amount:A})}),b=0;g>0;)h[b]>0&&(v[b]=v[b].add(l.call(this,{amount:1})),g=Vn.subtract(g,1)),b+=1;return v},convert:function(h){var m=this,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g=y.endpoint,v=g===void 0?f.endpoint:g,b=y.propertyPath,_=b===void 0?f.propertyPath||"rates.{{to}}":b,A=y.headers,P=A===void 0?f.headers:A,T=y.roundingMode,E=T===void 0?c:T,N=Object.assign({},{endpoint:v,propertyPath:_,headers:P,roundingMode:E});return POe(N).getExchangeRate(this.getCurrency(),h).then(function(k){return xx(!Yb(k),'No rate was found for the destination currency "'.concat(h,'".'),TypeError),l.call(m,{amount:Vn.round(Vn.multiply(m.getAmount(),parseFloat(k)),N.roundingMode),currency:h})})},equalsTo:function(h){return this.hasSameAmount(h)&&this.hasSameCurrency(h)},lessThan:function(h){u.call(this,h);var m=t.normalizePrecision([this,h]);return m[0].getAmount()m[1].getAmount()},greaterThanOrEqual:function(h){u.call(this,h);var m=t.normalizePrecision([this,h]);return m[0].getAmount()>=m[1].getAmount()},isZero:function(){return this.getAmount()===0},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return Vn.modulo(this.getAmount(),Math.pow(10,i))!==0},hasCents:function(){return Vn.modulo(this.getAmount(),Math.pow(10,i))!==0},hasSameCurrency:function(h){return this.getCurrency()===h.getCurrency()},hasSameAmount:function(h){var m=t.normalizePrecision([this,h]);return m[0].getAmount()===m[1].getAmount()},toFormat:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:a,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d,y=ROe(h);return this.toRoundedUnit(y.getMinimumFractionDigits(),m).toLocaleString(this.getLocale(),{currencyDisplay:y.getCurrencyDisplay(),useGrouping:y.getUseGrouping(),minimumFractionDigits:y.getMinimumFractionDigits(),style:y.getStyle(),currency:this.getCurrency()})},toUnit:function(){return Vn.divide(this.getAmount(),Math.pow(10,i))},toRoundedUnit:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d,y=Math.pow(10,h);return Vn.divide(Vn.round(Vn.multiply(this.toUnit(),y),m),y)},toObject:function(){return{amount:r,currency:s,precision:i}},toJSON:function(){return this.toObject()}}},T1=Object.assign(kOe,hOe,pOe,bOe),GE={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */GE.exports;(function(t,e){(function(){var n,r="4.17.21",s=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",d=500,f="__lodash_placeholder__",l=1,u=2,p=4,h=1,m=2,y=1,g=2,v=4,b=8,_=16,A=32,P=64,T=128,E=256,N=512,k=30,M="...",j=800,I=16,L=1,H=2,K=3,V=1/0,U=9007199254740991,Q=17976931348623157e292,te=NaN,X=4294967295,G=X-1,Y=X>>>1,Z=[["ary",T],["bind",y],["bindKey",g],["curry",b],["curryRight",_],["flip",N],["partial",A],["partialRight",P],["rearg",E]],he="[object Arguments]",fe="[object Array]",ce="[object AsyncFunction]",xe="[object Boolean]",Pe="[object Date]",pe="[object DOMException]",Le="[object Error]",Me="[object Function]",Oe="[object GeneratorFunction]",Fe="[object Map]",ot="[object Number]",nt="[object Null]",At="[object Object]",ee="[object Promise]",de="[object Proxy]",me="[object RegExp]",Re="[object Set]",Ne="[object String]",Ee="[object Symbol]",Ve="[object Undefined]",tt="[object WeakMap]",qt="[object WeakSet]",gt="[object ArrayBuffer]",kt="[object DataView]",an="[object Float32Array]",gr="[object Float64Array]",_n="[object Int8Array]",di="[object Int16Array]",or="[object Int32Array]",fi="[object Uint8Array]",$e="[object Uint8ClampedArray]",Ye="[object Uint16Array]",ht="[object Uint32Array]",Ze=/\b__p \+= '';/g,yt=/\b(__p \+=) '' \+/g,Nt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,St=/&(?:amp|lt|gt|quot|#39);/g,Wt=/[&<>"']/g,Zt=RegExp(St.source),ar=RegExp(Wt.source),Nn=/<%-([\s\S]+?)%>/g,Cr=/<%([\s\S]+?)%>/g,Dr=/<%=([\s\S]+?)%>/g,Vi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Yr=/^\w*$/,sc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,pa=/[\\^$.*+?()[\]{}|]/g,re=RegExp(pa.source),ae=/^\s+/,ge=/\s/,_e=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ze=/\{\n\/\* \[wrapped with (.+)\] \*/,Ge=/,? & /,ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ie=/[()=,{}\[\]\/\s]/,xt=/\\(\\)?/g,rt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,st=/\w*$/,ln=/^[-+]0x[0-9a-f]+$/i,tn=/^0b[01]+$/i,hn=/^\[object .+?Constructor\]$/,Jt=/^0o[0-7]+$/i,Mr=/^(?:0|[1-9]\d*)$/,lr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,sl=/($^)/,il=/['\n\r\u2028\u2029\\]/g,ma="\\ud800-\\udfff",ku="\\u0300-\\u036f",Du="\\ufe20-\\ufe2f",No="\\u20d0-\\u20ff",Pf=ku+Du+No,Nf="\\u2700-\\u27bf",Tf="a-z\\xdf-\\xf6\\xf8-\\xff",Ct="\\xac\\xb1\\xd7\\xf7",Yn="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",zs="\\u2000-\\u206f",In=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",To="A-Z\\xc0-\\xd6\\xd8-\\xde",Gy="\\ufe0e\\ufe0f",sS=Ct+Yn+zs+In,JP="['’]",xre="["+ma+"]",dF="["+sS+"]",iS="["+Pf+"]",fF="\\d+",wre="["+Nf+"]",hF="["+Tf+"]",pF="[^"+ma+sS+fF+Nf+Tf+To+"]",eN="\\ud83c[\\udffb-\\udfff]",_re="(?:"+iS+"|"+eN+")",mF="[^"+ma+"]",tN="(?:\\ud83c[\\udde6-\\uddff]){2}",nN="[\\ud800-\\udbff][\\udc00-\\udfff]",tm="["+To+"]",gF="\\u200d",vF="(?:"+hF+"|"+pF+")",Sre="(?:"+tm+"|"+pF+")",yF="(?:"+JP+"(?:d|ll|m|re|s|t|ve))?",bF="(?:"+JP+"(?:D|LL|M|RE|S|T|VE))?",xF=_re+"?",wF="["+Gy+"]?",Cre="(?:"+gF+"(?:"+[mF,tN,nN].join("|")+")"+wF+xF+")*",Ere="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Are="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",_F=wF+xF+Cre,Rre="(?:"+[wre,tN,nN].join("|")+")"+_F,Pre="(?:"+[mF+iS+"?",iS,tN,nN,xre].join("|")+")",Nre=RegExp(JP,"g"),Tre=RegExp(iS,"g"),rN=RegExp(eN+"(?="+eN+")|"+Pre+_F,"g"),kre=RegExp([tm+"?"+hF+"+"+yF+"(?="+[dF,tm,"$"].join("|")+")",Sre+"+"+bF+"(?="+[dF,tm+vF,"$"].join("|")+")",tm+"?"+vF+"+"+yF,tm+"+"+bF,Are,Ere,fF,Rre].join("|"),"g"),Dre=RegExp("["+gF+ma+Pf+Gy+"]"),Mre=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ore=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],jre=-1,Un={};Un[an]=Un[gr]=Un[_n]=Un[di]=Un[or]=Un[fi]=Un[$e]=Un[Ye]=Un[ht]=!0,Un[he]=Un[fe]=Un[gt]=Un[xe]=Un[kt]=Un[Pe]=Un[Le]=Un[Me]=Un[Fe]=Un[ot]=Un[At]=Un[me]=Un[Re]=Un[Ne]=Un[tt]=!1;var Ln={};Ln[he]=Ln[fe]=Ln[gt]=Ln[kt]=Ln[xe]=Ln[Pe]=Ln[an]=Ln[gr]=Ln[_n]=Ln[di]=Ln[or]=Ln[Fe]=Ln[ot]=Ln[At]=Ln[me]=Ln[Re]=Ln[Ne]=Ln[Ee]=Ln[fi]=Ln[$e]=Ln[Ye]=Ln[ht]=!0,Ln[Le]=Ln[Me]=Ln[tt]=!1;var Ire={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Lre={"&":"&","<":"<",">":">",'"':""","'":"'"},$re={"&":"&","<":"<",">":">",""":'"',"'":"'"},Fre={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},zre=parseFloat,Bre=parseInt,SF=typeof pr=="object"&&pr&&pr.Object===Object&&pr,Ure=typeof self=="object"&&self&&self.Object===Object&&self,os=SF||Ure||Function("return this")(),sN=e&&!e.nodeType&&e,kf=sN&&!0&&t&&!t.nodeType&&t,CF=kf&&kf.exports===sN,iN=CF&&SF.process,ko=function(){try{var le=kf&&kf.require&&kf.require("util").types;return le||iN&&iN.binding&&iN.binding("util")}catch{}}(),EF=ko&&ko.isArrayBuffer,AF=ko&&ko.isDate,RF=ko&&ko.isMap,PF=ko&&ko.isRegExp,NF=ko&&ko.isSet,TF=ko&&ko.isTypedArray;function qi(le,we,ve){switch(ve.length){case 0:return le.call(we);case 1:return le.call(we,ve[0]);case 2:return le.call(we,ve[0],ve[1]);case 3:return le.call(we,ve[0],ve[1],ve[2])}return le.apply(we,ve)}function Hre(le,we,ve,qe){for(var bt=-1,nn=le==null?0:le.length;++bt-1}function oN(le,we,ve){for(var qe=-1,bt=le==null?0:le.length;++qe-1;);return ve}function $F(le,we){for(var ve=le.length;ve--&&nm(we,le[ve],0)>-1;);return ve}function Zre(le,we){for(var ve=le.length,qe=0;ve--;)le[ve]===we&&++qe;return qe}var Jre=uN(Ire),ese=uN(Lre);function tse(le){return"\\"+Fre[le]}function nse(le,we){return le==null?n:le[we]}function rm(le){return Dre.test(le)}function rse(le){return Mre.test(le)}function sse(le){for(var we,ve=[];!(we=le.next()).done;)ve.push(we.value);return ve}function pN(le){var we=-1,ve=Array(le.size);return le.forEach(function(qe,bt){ve[++we]=[bt,qe]}),ve}function FF(le,we){return function(ve){return le(we(ve))}}function ju(le,we){for(var ve=-1,qe=le.length,bt=0,nn=[];++ve-1}function qse(w,C){var D=this.__data__,O=SS(D,w);return O<0?(++this.size,D.push([w,C])):D[O][1]=C,this}ic.prototype.clear=Bse,ic.prototype.delete=Use,ic.prototype.get=Hse,ic.prototype.has=Vse,ic.prototype.set=qse;function oc(w){var C=-1,D=w==null?0:w.length;for(this.clear();++C=C?w:C)),w}function jo(w,C,D,O,F,W){var J,se=C&l,ue=C&u,Se=C&p;if(D&&(J=F?D(w,O,F,W):D(w)),J!==n)return J;if(!Zn(w))return w;var Ce=wt(w);if(Ce){if(J=Yie(w),!se)return hi(w,J)}else{var Ae=Ss(w),Be=Ae==Me||Ae==Oe;if(Bu(w))return w3(w,se);if(Ae==At||Ae==he||Be&&!F){if(J=ue||Be?{}:z3(w),!se)return ue?$ie(w,aie(J,w)):Lie(w,QF(J,w))}else{if(!Ln[Ae])return F?w:{};J=Xie(w,Ae,se)}}W||(W=new va);var Qe=W.get(w);if(Qe)return Qe;W.set(w,J),m4(w)?w.forEach(function(ft){J.add(jo(ft,C,D,ft,w,W))}):h4(w)&&w.forEach(function(ft,Lt){J.set(Lt,jo(ft,C,D,Lt,w,W))});var dt=Se?ue?zN:FN:ue?mi:Xr,Tt=Ce?n:dt(w);return Do(Tt||w,function(ft,Lt){Tt&&(Lt=ft,ft=w[Lt]),eb(J,Lt,jo(ft,C,D,Lt,w,W))}),J}function lie(w){var C=Xr(w);return function(D){return ZF(D,w,C)}}function ZF(w,C,D){var O=D.length;if(w==null)return!O;for(w=Tn(w);O--;){var F=D[O],W=C[F],J=w[F];if(J===n&&!(F in w)||!W(J))return!1}return!0}function JF(w,C,D){if(typeof w!="function")throw new Mo(o);return ab(function(){w.apply(n,D)},C)}function tb(w,C,D,O){var F=-1,W=oS,J=!0,se=w.length,ue=[],Se=C.length;if(!se)return ue;D&&(C=Xn(C,Wi(D))),O?(W=oN,J=!1):C.length>=s&&(W=Ky,J=!1,C=new Of(C));e:for(;++FF?0:F+D),O=O===n||O>F?F:Rt(O),O<0&&(O+=F),O=D>O?0:v4(O);D0&&D(se)?C>1?as(se,C-1,D,O,F):Ou(F,se):O||(F[F.length]=se)}return F}var wN=R3(),n3=R3(!0);function ol(w,C){return w&&wN(w,C,Xr)}function _N(w,C){return w&&n3(w,C,Xr)}function ES(w,C){return Mu(C,function(D){return dc(w[D])})}function If(w,C){C=Fu(C,w);for(var D=0,O=C.length;w!=null&&DC}function die(w,C){return w!=null&&pn.call(w,C)}function fie(w,C){return w!=null&&C in Tn(w)}function hie(w,C,D){return w>=_s(C,D)&&w=120&&Ce.length>=120)?new Of(J&&Ce):n}Ce=w[0];var Ae=-1,Be=se[0];e:for(;++Ae-1;)se!==w&&gS.call(se,ue,1),gS.call(w,ue,1);return w}function h3(w,C){for(var D=w?C.length:0,O=D-1;D--;){var F=C[D];if(D==O||F!==W){var W=F;uc(F)?gS.call(w,F,1):DN(w,F)}}return w}function NN(w,C){return w+bS(GF()*(C-w+1))}function Aie(w,C,D,O){for(var F=-1,W=jr(yS((C-w)/(D||1)),0),J=ve(W);W--;)J[O?W:++F]=w,w+=D;return J}function TN(w,C){var D="";if(!w||C<1||C>U)return D;do C%2&&(D+=w),C=bS(C/2),C&&(w+=w);while(C);return D}function Dt(w,C){return GN(H3(w,C,gi),w+"")}function Rie(w){return XF(pm(w))}function Pie(w,C){var D=pm(w);return IS(D,jf(C,0,D.length))}function sb(w,C,D,O){if(!Zn(w))return w;C=Fu(C,w);for(var F=-1,W=C.length,J=W-1,se=w;se!=null&&++FF?0:F+C),D=D>F?F:D,D<0&&(D+=F),F=C>D?0:D-C>>>0,C>>>=0;for(var W=ve(F);++O>>1,J=w[W];J!==null&&!Ki(J)&&(D?J<=C:J=s){var Se=C?null:Uie(w);if(Se)return lS(Se);J=!1,F=Ky,ue=new Of}else ue=C?[]:se;e:for(;++O=O?w:Io(w,C,D)}var x3=bse||function(w){return os.clearTimeout(w)};function w3(w,C){if(C)return w.slice();var D=w.length,O=UF?UF(D):new w.constructor(D);return w.copy(O),O}function IN(w){var C=new w.constructor(w.byteLength);return new pS(C).set(new pS(w)),C}function Mie(w,C){var D=C?IN(w.buffer):w.buffer;return new w.constructor(D,w.byteOffset,w.byteLength)}function Oie(w){var C=new w.constructor(w.source,st.exec(w));return C.lastIndex=w.lastIndex,C}function jie(w){return Jy?Tn(Jy.call(w)):{}}function _3(w,C){var D=C?IN(w.buffer):w.buffer;return new w.constructor(D,w.byteOffset,w.length)}function S3(w,C){if(w!==C){var D=w!==n,O=w===null,F=w===w,W=Ki(w),J=C!==n,se=C===null,ue=C===C,Se=Ki(C);if(!se&&!Se&&!W&&w>C||W&&J&&ue&&!se&&!Se||O&&J&&ue||!D&&ue||!F)return 1;if(!O&&!W&&!Se&&w=se)return ue;var Se=D[O];return ue*(Se=="desc"?-1:1)}}return w.index-C.index}function C3(w,C,D,O){for(var F=-1,W=w.length,J=D.length,se=-1,ue=C.length,Se=jr(W-J,0),Ce=ve(ue+Se),Ae=!O;++se1?D[F-1]:n,J=F>2?D[2]:n;for(W=w.length>3&&typeof W=="function"?(F--,W):n,J&&Us(D[0],D[1],J)&&(W=F<3?n:W,F=1),C=Tn(C);++O-1?F[W?C[J]:J]:n}}function T3(w){return cc(function(C){var D=C.length,O=D,F=Oo.prototype.thru;for(w&&C.reverse();O--;){var W=C[O];if(typeof W!="function")throw new Mo(o);if(F&&!J&&OS(W)=="wrapper")var J=new Oo([],!0)}for(O=J?O:D;++O1&&Ut.reverse(),Ce&&uese))return!1;var Se=W.get(w),Ce=W.get(C);if(Se&&Ce)return Se==C&&Ce==w;var Ae=-1,Be=!0,Qe=D&m?new Of:n;for(W.set(w,C),W.set(C,w);++Ae1?"& ":"")+C[O],C=C.join(D>2?", ":" "),w.replace(_e,`{ /* [wrapped with `+C+`] */ `)}function Zie(w){return wt(w)||Ff(w)||!!(qF&&w&&w[qF])}function uc(w,C){var D=typeof w;return C=C??U,!!C&&(D=="number"||D!="symbol"&&Mr.test(w))&&w>-1&&w%1==0&&w0){if(++C>=j)return arguments[0]}else C=0;return w.apply(n,arguments)}}function IS(w,C){var D=-1,O=w.length,F=O-1;for(C=C===n?O:C;++D1?w[C-1]:n;return D=typeof D=="function"?(w.pop(),D):n,t4(w,D)});function n4(w){var C=q(w);return C.__chain__=!0,C}function cae(w,C){return C(w),w}function LS(w,C){return C(w)}var uae=cc(function(w){var C=w.length,D=C?w[0]:0,O=this.__wrapped__,F=function(W){return xN(W,w)};return C>1||this.__actions__.length||!(O instanceof Bt)||!uc(D)?this.thru(F):(O=O.slice(D,+D+(C?1:0)),O.__actions__.push({func:LS,args:[F],thisArg:n}),new Oo(O,this.__chain__).thru(function(W){return C&&!W.length&&W.push(n),W}))});function dae(){return n4(this)}function fae(){return new Oo(this.value(),this.__chain__)}function hae(){this.__values__===n&&(this.__values__=g4(this.value()));var w=this.__index__>=this.__values__.length,C=w?n:this.__values__[this.__index__++];return{done:w,value:C}}function pae(){return this}function mae(w){for(var C,D=this;D instanceof _S;){var O=Y3(D);O.__index__=0,O.__values__=n,C?F.__wrapped__=O:C=O;var F=O;D=D.__wrapped__}return F.__wrapped__=w,C}function gae(){var w=this.__wrapped__;if(w instanceof Bt){var C=w;return this.__actions__.length&&(C=new Bt(this)),C=C.reverse(),C.__actions__.push({func:LS,args:[KN],thisArg:n}),new Oo(C,this.__chain__)}return this.thru(KN)}function vae(){return y3(this.__wrapped__,this.__actions__)}var yae=NS(function(w,C,D){pn.call(w,D)?++w[D]:ac(w,D,1)});function bae(w,C,D){var O=wt(w)?kF:cie;return D&&Us(w,C,D)&&(C=n),O(w,at(C,3))}function xae(w,C){var D=wt(w)?Mu:t3;return D(w,at(C,3))}var wae=N3(X3),_ae=N3(Q3);function Sae(w,C){return as($S(w,C),1)}function Cae(w,C){return as($S(w,C),V)}function Eae(w,C,D){return D=D===n?1:Rt(D),as($S(w,C),D)}function r4(w,C){var D=wt(w)?Do:Lu;return D(w,at(C,3))}function s4(w,C){var D=wt(w)?Vre:e3;return D(w,at(C,3))}var Aae=NS(function(w,C,D){pn.call(w,D)?w[D].push(C):ac(w,D,[C])});function Rae(w,C,D,O){w=pi(w)?w:pm(w),D=D&&!O?Rt(D):0;var F=w.length;return D<0&&(D=jr(F+D,0)),HS(w)?D<=F&&w.indexOf(C,D)>-1:!!F&&nm(w,C,D)>-1}var Pae=Dt(function(w,C,D){var O=-1,F=typeof C=="function",W=pi(w)?ve(w.length):[];return Lu(w,function(J){W[++O]=F?qi(C,J,D):nb(J,C,D)}),W}),Nae=NS(function(w,C,D){ac(w,D,C)});function $S(w,C){var D=wt(w)?Xn:a3;return D(w,at(C,3))}function Tae(w,C,D,O){return w==null?[]:(wt(C)||(C=C==null?[]:[C]),D=O?n:D,wt(D)||(D=D==null?[]:[D]),d3(w,C,D))}var kae=NS(function(w,C,D){w[D?0:1].push(C)},function(){return[[],[]]});function Dae(w,C,D){var O=wt(w)?aN:jF,F=arguments.length<3;return O(w,at(C,4),D,F,Lu)}function Mae(w,C,D){var O=wt(w)?qre:jF,F=arguments.length<3;return O(w,at(C,4),D,F,e3)}function Oae(w,C){var D=wt(w)?Mu:t3;return D(w,BS(at(C,3)))}function jae(w){var C=wt(w)?XF:Rie;return C(w)}function Iae(w,C,D){(D?Us(w,C,D):C===n)?C=1:C=Rt(C);var O=wt(w)?sie:Pie;return O(w,C)}function Lae(w){var C=wt(w)?iie:Tie;return C(w)}function $ae(w){if(w==null)return 0;if(pi(w))return HS(w)?sm(w):w.length;var C=Ss(w);return C==Fe||C==Re?w.size:AN(w).length}function Fae(w,C,D){var O=wt(w)?lN:kie;return D&&Us(w,C,D)&&(C=n),O(w,at(C,3))}var zae=Dt(function(w,C){if(w==null)return[];var D=C.length;return D>1&&Us(w,C[0],C[1])?C=[]:D>2&&Us(C[0],C[1],C[2])&&(C=[C[0]]),d3(w,as(C,1),[])}),FS=xse||function(){return os.Date.now()};function Bae(w,C){if(typeof C!="function")throw new Mo(o);return w=Rt(w),function(){if(--w<1)return C.apply(this,arguments)}}function i4(w,C,D){return C=D?n:C,C=w&&C==null?w.length:C,lc(w,T,n,n,n,n,C)}function o4(w,C){var D;if(typeof C!="function")throw new Mo(o);return w=Rt(w),function(){return--w>0&&(D=C.apply(this,arguments)),w<=1&&(C=n),D}}var XN=Dt(function(w,C,D){var O=y;if(D.length){var F=ju(D,fm(XN));O|=A}return lc(w,O,C,D,F)}),a4=Dt(function(w,C,D){var O=y|g;if(D.length){var F=ju(D,fm(a4));O|=A}return lc(C,O,w,D,F)});function l4(w,C,D){C=D?n:C;var O=lc(w,b,n,n,n,n,n,C);return O.placeholder=l4.placeholder,O}function c4(w,C,D){C=D?n:C;var O=lc(w,_,n,n,n,n,n,C);return O.placeholder=c4.placeholder,O}function u4(w,C,D){var O,F,W,J,se,ue,Se=0,Ce=!1,Ae=!1,Be=!0;if(typeof w!="function")throw new Mo(o);C=$o(C)||0,Zn(D)&&(Ce=!!D.leading,Ae="maxWait"in D,W=Ae?jr($o(D.maxWait)||0,C):W,Be="trailing"in D?!!D.trailing:Be);function Qe(yr){var ba=O,hc=F;return O=F=n,Se=yr,J=w.apply(hc,ba),J}function dt(yr){return Se=yr,se=ab(Lt,C),Ce?Qe(yr):J}function Tt(yr){var ba=yr-ue,hc=yr-Se,N4=C-ba;return Ae?_s(N4,W-hc):N4}function ft(yr){var ba=yr-ue,hc=yr-Se;return ue===n||ba>=C||ba<0||Ae&&hc>=W}function Lt(){var yr=FS();if(ft(yr))return Ut(yr);se=ab(Lt,Tt(yr))}function Ut(yr){return se=n,Be&&O?Qe(yr):(O=F=n,J)}function Yi(){se!==n&&x3(se),Se=0,O=ue=F=se=n}function Hs(){return se===n?J:Ut(FS())}function Xi(){var yr=FS(),ba=ft(yr);if(O=arguments,F=this,ue=yr,ba){if(se===n)return dt(ue);if(Ae)return x3(se),se=ab(Lt,C),Qe(ue)}return se===n&&(se=ab(Lt,C)),J}return Xi.cancel=Yi,Xi.flush=Hs,Xi}var Uae=Dt(function(w,C){return JF(w,1,C)}),Hae=Dt(function(w,C,D){return JF(w,$o(C)||0,D)});function Vae(w){return lc(w,N)}function zS(w,C){if(typeof w!="function"||C!=null&&typeof C!="function")throw new Mo(o);var D=function(){var O=arguments,F=C?C.apply(this,O):O[0],W=D.cache;if(W.has(F))return W.get(F);var J=w.apply(this,O);return D.cache=W.set(F,J)||W,J};return D.cache=new(zS.Cache||oc),D}zS.Cache=oc;function BS(w){if(typeof w!="function")throw new Mo(o);return function(){var C=arguments;switch(C.length){case 0:return!w.call(this);case 1:return!w.call(this,C[0]);case 2:return!w.call(this,C[0],C[1]);case 3:return!w.call(this,C[0],C[1],C[2])}return!w.apply(this,C)}}function qae(w){return o4(2,w)}var Wae=Die(function(w,C){C=C.length==1&&wt(C[0])?Xn(C[0],Wi(at())):Xn(as(C,1),Wi(at()));var D=C.length;return Dt(function(O){for(var F=-1,W=_s(O.length,D);++F=C}),Ff=s3(function(){return arguments}())?s3:function(w){return cr(w)&&pn.call(w,"callee")&&!VF.call(w,"callee")},wt=ve.isArray,ale=EF?Wi(EF):mie;function pi(w){return w!=null&&US(w.length)&&!dc(w)}function vr(w){return cr(w)&&pi(w)}function lle(w){return w===!0||w===!1||cr(w)&&Bs(w)==xe}var Bu=_se||lT,cle=AF?Wi(AF):gie;function ule(w){return cr(w)&&w.nodeType===1&&!lb(w)}function dle(w){if(w==null)return!0;if(pi(w)&&(wt(w)||typeof w=="string"||typeof w.splice=="function"||Bu(w)||hm(w)||Ff(w)))return!w.length;var C=Ss(w);if(C==Fe||C==Re)return!w.size;if(ob(w))return!AN(w).length;for(var D in w)if(pn.call(w,D))return!1;return!0}function fle(w,C){return rb(w,C)}function hle(w,C,D){D=typeof D=="function"?D:n;var O=D?D(w,C):n;return O===n?rb(w,C,n,D):!!O}function ZN(w){if(!cr(w))return!1;var C=Bs(w);return C==Le||C==pe||typeof w.message=="string"&&typeof w.name=="string"&&!lb(w)}function ple(w){return typeof w=="number"&&WF(w)}function dc(w){if(!Zn(w))return!1;var C=Bs(w);return C==Me||C==Oe||C==ce||C==de}function f4(w){return typeof w=="number"&&w==Rt(w)}function US(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=U}function Zn(w){var C=typeof w;return w!=null&&(C=="object"||C=="function")}function cr(w){return w!=null&&typeof w=="object"}var h4=RF?Wi(RF):yie;function mle(w,C){return w===C||EN(w,C,UN(C))}function gle(w,C,D){return D=typeof D=="function"?D:n,EN(w,C,UN(C),D)}function vle(w){return p4(w)&&w!=+w}function yle(w){if(toe(w))throw new bt(i);return i3(w)}function ble(w){return w===null}function xle(w){return w==null}function p4(w){return typeof w=="number"||cr(w)&&Bs(w)==ot}function lb(w){if(!cr(w)||Bs(w)!=At)return!1;var C=mS(w);if(C===null)return!0;var D=pn.call(C,"constructor")&&C.constructor;return typeof D=="function"&&D instanceof D&&dS.call(D)==gse}var JN=PF?Wi(PF):bie;function wle(w){return f4(w)&&w>=-U&&w<=U}var m4=NF?Wi(NF):xie;function HS(w){return typeof w=="string"||!wt(w)&&cr(w)&&Bs(w)==Ne}function Ki(w){return typeof w=="symbol"||cr(w)&&Bs(w)==Ee}var hm=TF?Wi(TF):wie;function _le(w){return w===n}function Sle(w){return cr(w)&&Ss(w)==tt}function Cle(w){return cr(w)&&Bs(w)==qt}var Ele=MS(RN),Ale=MS(function(w,C){return w<=C});function g4(w){if(!w)return[];if(pi(w))return HS(w)?ga(w):hi(w);if(Yy&&w[Yy])return sse(w[Yy]());var C=Ss(w),D=C==Fe?pN:C==Re?lS:pm;return D(w)}function fc(w){if(!w)return w===0?w:0;if(w=$o(w),w===V||w===-V){var C=w<0?-1:1;return C*Q}return w===w?w:0}function Rt(w){var C=fc(w),D=C%1;return C===C?D?C-D:C:0}function v4(w){return w?jf(Rt(w),0,X):0}function $o(w){if(typeof w=="number")return w;if(Ki(w))return te;if(Zn(w)){var C=typeof w.valueOf=="function"?w.valueOf():w;w=Zn(C)?C+"":C}if(typeof w!="string")return w===0?w:+w;w=IF(w);var D=tn.test(w);return D||Jt.test(w)?Bre(w.slice(2),D?2:8):ln.test(w)?te:+w}function y4(w){return al(w,mi(w))}function Rle(w){return w?jf(Rt(w),-U,U):w===0?w:0}function cn(w){return w==null?"":Gi(w)}var Ple=um(function(w,C){if(ob(C)||pi(C)){al(C,Xr(C),w);return}for(var D in C)pn.call(C,D)&&eb(w,D,C[D])}),b4=um(function(w,C){al(C,mi(C),w)}),VS=um(function(w,C,D,O){al(C,mi(C),w,O)}),Nle=um(function(w,C,D,O){al(C,Xr(C),w,O)}),Tle=cc(xN);function kle(w,C){var D=cm(w);return C==null?D:QF(D,C)}var Dle=Dt(function(w,C){w=Tn(w);var D=-1,O=C.length,F=O>2?C[2]:n;for(F&&Us(C[0],C[1],F)&&(O=1);++D1),W}),al(w,zN(w),D),O&&(D=jo(D,l|u|p,Hie));for(var F=C.length;F--;)DN(D,C[F]);return D});function Xle(w,C){return w4(w,BS(at(C)))}var Qle=cc(function(w,C){return w==null?{}:Cie(w,C)});function w4(w,C){if(w==null)return{};var D=Xn(zN(w),function(O){return[O]});return C=at(C),f3(w,D,function(O,F){return C(O,F[0])})}function Zle(w,C,D){C=Fu(C,w);var O=-1,F=C.length;for(F||(F=1,w=n);++OC){var O=w;w=C,C=O}if(D||w%1||C%1){var F=GF();return _s(w+F*(C-w+zre("1e-"+((F+"").length-1))),C)}return NN(w,C)}var cce=dm(function(w,C,D){return C=C.toLowerCase(),w+(D?C4(C):C)});function C4(w){return nT(cn(w).toLowerCase())}function E4(w){return w=cn(w),w&&w.replace(lr,Jre).replace(Tre,"")}function uce(w,C,D){w=cn(w),C=Gi(C);var O=w.length;D=D===n?O:jf(Rt(D),0,O);var F=D;return D-=C.length,D>=0&&w.slice(D,F)==C}function dce(w){return w=cn(w),w&&ar.test(w)?w.replace(Wt,ese):w}function fce(w){return w=cn(w),w&&re.test(w)?w.replace(pa,"\\$&"):w}var hce=dm(function(w,C,D){return w+(D?"-":"")+C.toLowerCase()}),pce=dm(function(w,C,D){return w+(D?" ":"")+C.toLowerCase()}),mce=P3("toLowerCase");function gce(w,C,D){w=cn(w),C=Rt(C);var O=C?sm(w):0;if(!C||O>=C)return w;var F=(C-O)/2;return DS(bS(F),D)+w+DS(yS(F),D)}function vce(w,C,D){w=cn(w),C=Rt(C);var O=C?sm(w):0;return C&&O>>0,D?(w=cn(w),w&&(typeof C=="string"||C!=null&&!JN(C))&&(C=Gi(C),!C&&rm(w))?zu(ga(w),0,D):w.split(C,D)):[]}var Cce=dm(function(w,C,D){return w+(D?" ":"")+nT(C)});function Ece(w,C,D){return w=cn(w),D=D==null?0:jf(Rt(D),0,w.length),C=Gi(C),w.slice(D,D+C.length)==C}function Ace(w,C,D){var O=q.templateSettings;D&&Us(w,C,D)&&(C=n),w=cn(w),C=VS({},C,O,j3);var F=VS({},C.imports,O.imports,j3),W=Xr(F),J=hN(F,W),se,ue,Se=0,Ce=C.interpolate||sl,Ae="__p += '",Be=mN((C.escape||sl).source+"|"+Ce.source+"|"+(Ce===Dr?rt:sl).source+"|"+(C.evaluate||sl).source+"|$","g"),Qe="//# sourceURL="+(pn.call(C,"sourceURL")?(C.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++jre+"]")+` `;w.replace(Be,function(ft,Lt,Ut,Yi,Hs,Xi){return Ut||(Ut=Yi),Ae+=w.slice(Se,Xi).replace(il,tse),Lt&&(se=!0,Ae+=`' + __e(`+Lt+`) + '`),Hs&&(ue=!0,Ae+=`'; `+Hs+`; __p += '`),Ut&&(Ae+=`' + ((__t = (`+Ut+`)) == null ? '' : __t) + '`),Se=Xi+ft.length,ft}),Ae+=`'; `;var dt=pn.call(C,"variable")&&C.variable;if(!dt)Ae=`with (obj) { `+Ae+` } `;else if(Ie.test(dt))throw new bt(a);Ae=(ue?Ae.replace(Ze,""):Ae).replace(yt,"$1").replace(Nt,"$1;"),Ae="function("+(dt||"obj")+`) { `+(dt?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(se?", __e = _.escape":"")+(ue?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+Ae+`return __p }`;var Tt=R4(function(){return nn(W,Qe+"return "+Ae).apply(n,J)});if(Tt.source=Ae,ZN(Tt))throw Tt;return Tt}function Rce(w){return cn(w).toLowerCase()}function Pce(w){return cn(w).toUpperCase()}function Nce(w,C,D){if(w=cn(w),w&&(D||C===n))return IF(w);if(!w||!(C=Gi(C)))return w;var O=ga(w),F=ga(C),W=LF(O,F),J=$F(O,F)+1;return zu(O,W,J).join("")}function Tce(w,C,D){if(w=cn(w),w&&(D||C===n))return w.slice(0,zF(w)+1);if(!w||!(C=Gi(C)))return w;var O=ga(w),F=$F(O,ga(C))+1;return zu(O,0,F).join("")}function kce(w,C,D){if(w=cn(w),w&&(D||C===n))return w.replace(ae,"");if(!w||!(C=Gi(C)))return w;var O=ga(w),F=LF(O,ga(C));return zu(O,F).join("")}function Dce(w,C){var D=k,O=M;if(Zn(C)){var F="separator"in C?C.separator:F;D="length"in C?Rt(C.length):D,O="omission"in C?Gi(C.omission):O}w=cn(w);var W=w.length;if(rm(w)){var J=ga(w);W=J.length}if(D>=W)return w;var se=D-sm(O);if(se<1)return O;var ue=J?zu(J,0,se).join(""):w.slice(0,se);if(F===n)return ue+O;if(J&&(se+=ue.length-se),JN(F)){if(w.slice(se).search(F)){var Se,Ce=ue;for(F.global||(F=mN(F.source,cn(st.exec(F))+"g")),F.lastIndex=0;Se=F.exec(Ce);)var Ae=Se.index;ue=ue.slice(0,Ae===n?se:Ae)}}else if(w.indexOf(Gi(F),se)!=se){var Be=ue.lastIndexOf(F);Be>-1&&(ue=ue.slice(0,Be))}return ue+O}function Mce(w){return w=cn(w),w&&Zt.test(w)?w.replace(St,lse):w}var Oce=dm(function(w,C,D){return w+(D?" ":"")+C.toUpperCase()}),nT=P3("toUpperCase");function A4(w,C,D){return w=cn(w),C=D?n:C,C===n?rse(w)?dse(w):Kre(w):w.match(C)||[]}var R4=Dt(function(w,C){try{return qi(w,n,C)}catch(D){return ZN(D)?D:new bt(D)}}),jce=cc(function(w,C){return Do(C,function(D){D=ll(D),ac(w,D,XN(w[D],w))}),w});function Ice(w){var C=w==null?0:w.length,D=at();return w=C?Xn(w,function(O){if(typeof O[1]!="function")throw new Mo(o);return[D(O[0]),O[1]]}):[],Dt(function(O){for(var F=-1;++FU)return[];var D=X,O=_s(w,X);C=at(C),w-=X;for(var F=fN(O,C);++D0||C<0)?new Bt(D):(w<0?D=D.takeRight(-w):w&&(D=D.drop(w)),C!==n&&(C=Rt(C),D=C<0?D.dropRight(-C):D.take(C-w)),D)},Bt.prototype.takeRightWhile=function(w){return this.reverse().takeWhile(w).reverse()},Bt.prototype.toArray=function(){return this.take(X)},ol(Bt.prototype,function(w,C){var D=/^(?:filter|find|map|reject)|While$/.test(C),O=/^(?:head|last)$/.test(C),F=q[O?"take"+(C=="last"?"Right":""):C],W=O||/^find/.test(C);F&&(q.prototype[C]=function(){var J=this.__wrapped__,se=O?[1]:arguments,ue=J instanceof Bt,Se=se[0],Ce=ue||wt(J),Ae=function(Lt){var Ut=F.apply(q,Ou([Lt],se));return O&&Be?Ut[0]:Ut};Ce&&D&&typeof Se=="function"&&Se.length!=1&&(ue=Ce=!1);var Be=this.__chain__,Qe=!!this.__actions__.length,dt=W&&!Be,Tt=ue&&!Qe;if(!W&&Ce){J=Tt?J:new Bt(this);var ft=w.apply(J,se);return ft.__actions__.push({func:LS,args:[Ae],thisArg:n}),new Oo(ft,Be)}return dt&&Tt?w.apply(this,se):(ft=this.thru(Ae),dt?O?ft.value()[0]:ft.value():ft)})}),Do(["pop","push","shift","sort","splice","unshift"],function(w){var C=cS[w],D=/^(?:push|sort|unshift)$/.test(w)?"tap":"thru",O=/^(?:pop|shift)$/.test(w);q.prototype[w]=function(){var F=arguments;if(O&&!this.__chain__){var W=this.value();return C.apply(wt(W)?W:[],F)}return this[D](function(J){return C.apply(wt(J)?J:[],F)})}}),ol(Bt.prototype,function(w,C){var D=q[C];if(D){var O=D.name+"";pn.call(lm,O)||(lm[O]=[]),lm[O].push({name:C,func:D})}}),lm[TS(n,g).name]=[{name:"wrapper",func:n}],Bt.prototype.clone=Mse,Bt.prototype.reverse=Ose,Bt.prototype.value=jse,q.prototype.at=uae,q.prototype.chain=dae,q.prototype.commit=fae,q.prototype.next=hae,q.prototype.plant=mae,q.prototype.reverse=gae,q.prototype.toJSON=q.prototype.valueOf=q.prototype.value=vae,q.prototype.first=q.prototype.head,Yy&&(q.prototype[Yy]=pae),q},im=fse();kf?((kf.exports=im)._=im,sN._=im):os._=im}).call(pr)})(GE,GE.exports);var dC=GE.exports;const wO=({amount:t,scale:e})=>{const n=10**e;return Number(t)/n},DOe=t=>{const e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${e}-${n}-${r}`},$k={locale:"es-ES"},Pm={amount:null,currencyCode:cu.DEFAULT_CURRENCY_CODE,scale:2},ur=class ur extends w${constructor(n,r,s){super(n);Te(this,"_isNull");Te(this,"_options");Te(this,"isEmpty",()=>this.isNull());Te(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(r),this._options=Object.freeze(s)}static validate(n,r){const s=Kt.any().optional().valid(null),i=Kt.number().label(r.label?r.label:"amount"),o=Kt.alternatives(s,i);return bn.validate(o,n)}static getMonetaryValueInfo(n){const[r,s]=n.split("."),i=s?s.length:0;return[(r+s).replace(/[^0-9]/g,""),i]}static create(n=Pm,r=$k){if(n===null)throw new Error("InvalidParams: props params is missing");const{amount:s=Pm.amount,currencyCode:i=Pm.currencyCode,scale:o=Pm.scale}=n||{},a=ur.validate(s,r);if(a.isFailure)return dn.fail(cf(Ja.INVALID_INPUT_DATA,a.error.message,r));const c=ur.sanitize(a.object),d=cu.createFromCode(i).object.code,f=T1({amount:Number(c),currency:d,precision:o}).setLocale(r.locale);return dn.ok(new this(f,dC.isNull(c),r))}static createFromFormattedValue(n,r,s={locale:$k.locale}){if(n===null||n==="")return ur.create({amount:null,scale:ur.DEFAULT_SCALE,currencyCode:r});const i=String(n),[o,a]=i.split(",");let c=o,d=2;return a===void 0?d=0:(a===""&&(c=o+a.padEnd(1,"0"),d=1),a.length===1?(c=o+a.padEnd(1,"0"),d=1):a.length===2?(c=o+a.padEnd(2,"0"),d=2):a.length===3?(c=o+a.padEnd(3,"0"),d=3):a.length===4&&(c=o+a.padEnd(4,"0"),d=4)),ur.create({amount:c,scale:d,currencyCode:r},s)}static sanitize(n){let r=null;return typeof n=="string"?r=parseFloat(n):r=n,r}static createFromDinero(n){return dn.ok(new ur(n,!1,$k))}static normalizeScale(n){return T1.normalizePrecision(n.map(r=>r.props)).map(r=>ur.createFromDinero(r).object)}static minimum(n){return ur.createFromDinero(T1.minimum(n.map(r=>r.props))).object}static maximum(n){return ur.createFromDinero(T1.maximum(n.map(r=>r.props))).object}static _toString(n,r,s){if(n===null)return"";new Intl.NumberFormat(s,{useGrouping:!0}).format(n===null?0:wO({amount:n,scale:r}));const i=Math.pow(10,r);return(Number(n)/i).toFixed(r)}toString(){return ur._toString(this.isNull()?null:this.getAmount(),this.getScale(),this._options.locale)}toJSON(){var n;return this._isNull?{}:(n=this.props)==null?void 0:n.toJSON()}toPrimitive(){var n;return this._isNull?null:Number((n=this.props)==null?void 0:n.getAmount())}toPrimitives(){return this.toObject()}getAmount(){return this.props.getAmount()}getScale(){return this.props.getPrecision()}convertScale(n,r="HALF_UP"){return this._isNull?ur.create({amount:null,scale:n,currencyCode:this.getCurrency().code}).object:ur.createFromDinero(this.props.convertPrecision(n,r)).object}getCurrency(){return cu.createFromCode(this.props.getCurrency()).object}getLocale(){return this.props.getLocale()}add(n){return ur.createFromDinero(this.props.add(n.props)).object}subtract(n){return ur.createFromDinero(this.props.subtract(n.props)).object}multiply(n,r){return ur.createFromDinero(this.props.multiply(n,r)).object}divide(n,r){return ur.createFromDinero(this.props.divide(n,r)).object}percentage(n,r){return ur.createFromDinero(this.props.percentage(n,r)).object}allocate(n){return this.props.allocate(n).map(r=>ur.createFromDinero(r).object)}equalsTo(n){return this.props.equalsTo(n.props)}lessThan(n){return this.props.lessThan(n.props)}lessThanOrEqual(n){return this.props.lessThanOrEqual(n.props)}greaterThan(n){return this.props.greaterThan(n.props)}greaterThanOrEqual(n){return this.props.greaterThanOrEqual(n.props)}isZero(){return this.props.isZero()}isPositive(){return this.props.isPositive()}isNegative(){return this.props.isNegative()}hasSameCurrency(n){return this.props.hasSameCurrency(n.props)}hasSameAmount(n){return this.props.hasSameAmount(n.props)}toFormat(n,r){return this._isNull?"":this.props.toFormat(n,r)}toUnit(){return this.props.toUnit()}toRoundedUnit(n,r){return this.props.toRoundedUnit(n,r)}toObject(){const n=this.props.toObject();return{amount:this._isNull?null:n.amount,scale:n.precision,currency_code:String(n.currency)}}toNumber(){return this.toUnit()}};Te(ur,"DEFAULT_SCALE",Pm.scale),Te(ur,"DEFAULT_CURRENCY_CODE",Pm.currencyCode);let ra=ur;class m6e extends Kt.ValidationError{}class iJ{constructor(e){Te(this,"_collection",[]);this._collection=e??[]}add(e){this._collection.push(e)}reset(){this._collection=[]}hasSomeFaultyResult(){return this._collection.some(e=>e.isFailure)}getFirstFaultyResult(){return this._collection.find(e=>e.isFailure)}getAllFaultyResults(){return this._collection.filter(e=>e.isFailure)}get objects(){return this._collection.filter(e=>e.isSuccess).map(e=>e.object)}get errors(){return this._collection.filter(e=>e.isFailure).map(e=>e.error)}}const oJ=2,Fk={amount:0,scale:oJ},mn=class mn extends H_{constructor(n,r,s){super(n);Te(this,"_isNull");Te(this,"_options");Te(this,"isEmpty",()=>this.isNull());Te(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(r),this._options=Object.freeze(s)}static validate(n,r,s){const i=bn.RULE_ALLOW_NULL_OR_UNDEFINED,o=bn.RULE_ALLOW_EMPTY,a=bn.RULE_IS_TYPE_NUMBER.label(s.label?s.label:"amount"),c=bn.RULE_IS_TYPE_STRING.regex(/^[-]?\d+$/).label(s.label?s.label:"amount"),d=Kt.number().min(mn.MIN_SCALE).max(mn.MAX_SCALE).label(s.label?s.label:"scale"),f=new iJ([bn.validate(Kt.alternatives(i,o,a,c),n),bn.validate(Kt.alternatives(bn.RULE_IS_TYPE_NUMBER.label(s.label?s.label:"scale"),d),r)]);if(f.hasSomeFaultyResult())return f.getFirstFaultyResult();let l=typeof n=="string"?parseInt(n,10):Number(n),u=dC.isNull(r)?mn.DEFAULT_SCALE:Number(r);const p=l/Math.pow(10,u);return pmn.MAX_VALUE?dn.fail(new Error(`Value with scale is out of range: ${p}`)):dn.ok()}static create(n=Fk,r={}){if(n===null)throw new Error("InvalidParams: props params is missing");const{amount:s=Fk.amount,scale:i=Fk.scale}=n,o={label:"percentage",...r},a=mn.validate(s,i,o);if(a.isFailure)return dn.fail(cf(Ja.INVALID_INPUT_DATA,a.error.message,o));let c=mn._sanitize(s);const d={amount:dC.isNull(c)?0:c,scale:i};return dn.ok(new this(d,dC.isNull(c),r))}static createFromFormattedValue(n,r={}){if(n===null||n==="")return mn.create({amount:null,scale:mn.DEFAULT_SCALE});const s=String(n),[i,o]=s.split(",");let a=i,c=2;return o===void 0?c=0:(o===""&&(a=i+o.padEnd(1,"0"),c=1),o.length===1?(a=i+o.padEnd(1,"0"),c=1):o.length===2&&(a=i+o.padEnd(2,"0"),c=2)),mn.create({amount:a,scale:c},r)}static _sanitize(n){let r=null;return typeof n=="string"?r=parseInt(n,10):r=n,r}static _toString(n,r){if(n===null)return"";const s=Math.pow(10,r);return(Number(n)/s).toFixed(r)}static _isWithinRange(n,r){const s=Number(mn._toString(n,r));return s>=mn.MIN_VALUE&&s<=mn.MAX_VALUE}get amount(){var n;return this.isNull()?null:Number((n=this.props)==null?void 0:n.amount)}get scale(){var n;return Number((n=this.props)==null?void 0:n.scale)}getAmount(){var n;return this.isNull()?null:Number((n=this.props)==null?void 0:n.amount)}getScale(){var n;return this.isNull()?0:Number((n=this.props)==null?void 0:n.scale)}toString(){return mn._toString(this.amount,this.scale)}toNumber(){return this.isNull()?0:Number(this.toString())}toFormat(){return this._isNull?"":Intl.NumberFormat("es-ES",{maximumFractionDigits:2}).format(this.toNumber())}toPrimitive(){return this.scale!==mn.DEFAULT_SCALE?this.convertScale(mn.DEFAULT_SCALE).toPrimitive():this.amount}toPrimitives(){return this.toObject()}toObject(){return{amount:this.amount,scale:this.scale}}convertScale(n){if(nmn.MAX_SCALE)throw new Error(`Scale out of range: ${n}`);if(this.isNull())return new mn({amount:null,scale:n},!0,this._options);const r=Math.pow(10,this.scale),s=Number(this.amount)/r,i=Math.pow(10,n),o=Math.round(s*i);if(!mn._isWithinRange(o,n))throw new Error(`Value out of range after conversion: ${o} ${n}`);return new mn({amount:o,scale:n},!1,this._options)}hasSameScale(n){return this.scale===n.scale}isWithinRange(){return mn._isWithinRange(this.amount,this.scale)}};Te(mn,"DEFAULT_SCALE",oJ),Te(mn,"MIN_VALUE",0),Te(mn,"MAX_VALUE",100),Te(mn,"MIN_SCALE",0),Te(mn,"MAX_SCALE",2);let uf=mn;class g6e extends Kt.ValidationError{}const aJ=2,zk={amount:0,scale:aJ},Sn=class Sn extends H_{constructor(n,r,s){super(n);Te(this,"_isNull");Te(this,"_options");Te(this,"isEmpty",()=>this.isNull());Te(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(r),this._options=Object.freeze(s)}static validate(n,r,s={}){const i=bn.RULE_ALLOW_NULL_OR_UNDEFINED,o=bn.RULE_ALLOW_EMPTY,a=bn.RULE_IS_TYPE_NUMBER.label(s.label?s.label:"amount"),c=bn.RULE_IS_TYPE_STRING.regex(/^[-]?\d+$/).label(s.label?s.label:"amount"),d=Kt.number().min(Sn.MIN_SCALE).max(Sn.MAX_SCALE).label(s.label?s.label:"scale"),f=new iJ([bn.validate(Kt.alternatives(i,o,a,c),n),bn.validate(Kt.alternatives(bn.RULE_IS_TYPE_NUMBER.label(s.label?s.label:"scale"),d),r)]);return f.hasSomeFaultyResult()?f.getFirstFaultyResult():dn.ok()}static create(n=zk,r={}){if(n===null)throw new Error("InvalidParams: props params is missing");const{amount:s=zk.amount,scale:i=zk.scale}=n,o={label:"quantity",...r},a=Sn.validate(s,i,o);if(a.isFailure)return dn.fail(cf(Ja.INVALID_INPUT_DATA,a.error.message,o));let c=Sn._sanitize(s);const d={amount:c===null?0:c,scale:i};return dn.ok(new Sn(d,c===null,r))}static createFromFormattedValue(n,r={}){if(n===null||n==="")return Sn.create({amount:null,scale:Sn.DEFAULT_SCALE});const s=String(n),[i,o]=s.split(",");let a=i,c=2;return o===void 0?c=0:(o===""&&(a=i+o.padEnd(1,"0"),c=1),o.length===1?(a=i+o.padEnd(1,"0"),c=1):o.length===2&&(a=i+o.padEnd(2,"0"),c=2)),Sn.create({amount:a,scale:c},r)}static _sanitize(n){let r=null;return typeof n=="string"?r=parseInt(n,10):r=n,r}static _toString(n,r){if(n===null)return"";const s=Math.pow(10,r);return(Number(n)/s).toFixed(r)}get amount(){var n;return this.isNull()?null:Number((n=this.props)==null?void 0:n.amount)}get scale(){var n;return Number((n=this.props)==null?void 0:n.scale)}getAmount(){var n;return this.isNull()?null:Number((n=this.props)==null?void 0:n.amount)}getScale(){var n;return this.isNull()?0:Number((n=this.props)==null?void 0:n.scale)}toString(){return Sn._toString(this.amount,this.scale)}toNumber(){return this.isNull()?0:Number(this.toString())}toFormat(){return this._isNull?"":Intl.NumberFormat("es-ES",{maximumFractionDigits:2}).format(this.toNumber())}toPrimitive(){return this.scale!==Sn.DEFAULT_SCALE?this.convertScale(Sn.DEFAULT_SCALE).toPrimitive():this.amount}toPrimitives(){return this.toObject()}toObject(){return{amount:this.amount,scale:this.scale}}convertScale(n){if(nSn.MAX_SCALE)throw new Error(`Scale out of range: ${n}`);if(this.isNull())return new Sn({amount:null,scale:n},!0,this._options);const r=Math.pow(10,this.scale),s=Number(this.amount)/r,i=Math.pow(10,n),o=Math.round(s*i);return new Sn({amount:o,scale:n},!1,this._options)}hasSameScale(n){return this.scale===n.scale}increment(n){return this.isNull()?n?Sn.create(n.toObject()):Sn.create():n?this.hasSameScale(n)?Sn.create({amount:Number(this.amount)+Number(n.amount),scale:this.scale},this._options):dn.fail(Error("No se pueden sumar cantidades con diferentes escalas.")):Sn.create({amount:Number(this.amount)+1,scale:this.scale},this._options)}decrement(n){return this.isNull()?n?Sn.create(n.toObject()):Sn.create():n?this.hasSameScale(n)?Sn.create({amount:Number(this.amount)-Number(n.amount),scale:this.scale},this._options):dn.fail(Error("No se pueden restar cantidades con diferentes escalas.")):Sn.create({amount:Number(this.amount)-1,scale:this.scale},this._options)}};Te(Sn,"DEFAULT_SCALE",aJ),Te(Sn,"MIN_SCALE",0),Te(Sn,"MAX_SCALE",2);let Dp=Sn;class yg extends w${constructor(){super(...arguments);Te(this,"isValid",()=>!isNaN(this.props.valueOf())&&this.props.valueOf()!==0);Te(this,"isEmpty",()=>!this.isValid());Te(this,"toISO8601",()=>this.isValid()?this.props.toISOString():"");Te(this,"toDateString",()=>this.isValid()?this.props.toDateString():"");Te(this,"toLocaleDateString",(n,r)=>this.isValid()?this.props.toLocaleDateString(n,r):"");Te(this,"toLocaleTimeString",()=>this.isValid()?this.props.toLocaleTimeString():"")}static validate(n,r){const s=bn.RULE_ALLOW_EMPTY.default(0),i=Kt.date().label(String(r.label)),o=Kt.alternatives(s,i);return bn.validate(o,n)}static createCurrentDate(){return dn.ok(new yg(new Date))}static create(n,r={}){const s={...r,dateFormat:r.dateFormat?r.dateFormat:"YYYY-MM-DD",label:r.label?r.label:"date"},i=yg.validate(n,s);return i.isFailure?dn.fail(cf(Ja.INVALID_INPUT_DATA,i.error.message,s)):dn.ok(new yg(new Date(i.object)))}toString(){if(!this.isEmpty()){const n=this.props.getFullYear(),r=String(this.props.getMonth()+1).padStart(2,"0"),s=String(this.props.getDate()).padStart(2,"0");return`${n}-${r}-${s}`}return""}toPrimitive(){return this.toISO8601()}}const bg=0,_$=10,_O=1,lJ=9999,MOe=({isPending:t,interval:e=1e3,onInterval:n})=>{const[r,s]=S.useState(void 0);return S.useEffect(()=>{let i;return t&&(i=setInterval(()=>{s(o=>o===void 0?e:o+e)},e)),()=>{clearInterval(i),s(void 0)}},[t,e]),S.useEffect(()=>{n&&r&&n(r)},[r]),{elapsedTime:r}},OOe=2*60*1e3,jOe=60*1e3,S$=({queryKey:t,queryFn:e,enabled:n,select:r,queryOptions:s={},overtimeOptions:i})=>{const[o,a]=S.useState(!1),c=ZA({queryKey:t,queryFn:e,placeholderData:w8,staleTime:jOe,refetchInterval:OOe,refetchOnWindowFocus:!0,enabled:n&&!!e,select:r,...s});S.useEffect(()=>{c.isSuccess&&oOe(c.data)&&a(c.data.total_items===0)},[c]);const{elapsedTime:d}=MOe({isPending:c.isFetching,interval:i==null?void 0:i.interval,onInterval:i==null?void 0:i.onInterval});return{...c,overtime:{elapsedTime:d},isEmpty:o}},cJ=t=>ZA({placeholderData:w8,...t});function IOe(t){return jl({...t})}const uJ=S.createContext(void 0),LOe=({dataSource:t,children:e})=>x.jsx(uJ.Provider,{value:t,children:e}),$Oe=[5,10,15,30,50,75,100],yP=(t=bg,e=_$)=>{const[n,r]=S.useState({pageIndex:t,pageSize:e});return[n,i=>{const o=i;return o.pageIndexlJ)&&(o.pageSize=_O),r(a=>({...a,pageIndex:i.pageIndex,pageSize:i.pageSize})),o}]},FOe=(t=bg,e=_$)=>{const[n,r]=Sme(),s=n.get("page_index"),i=n.get("page_size"),o=S.useMemo(()=>{const l=parseInt(s??"",10);let u=isNaN(l)?t:l;return u{const l=parseInt(i??"",10);let u=isNaN(l)?e:l;return(u<_O||u>lJ)&&(u=e),u},[i,e]),[c,d]=yP(o,a);return[c,l=>{const u=d(l);r({page_index:String(u.pageIndex),page_size:String(u.pageSize)})}]},zOe=({syncWithLocation:t=!0,initialPageIndex:e,initialPageSize:n})=>{const[r,s]=FOe(),[i,o]=yP(e,n);return t?[r,s]:[i,o]},dJ=S.createContext(null),Jv=({syncWithLocation:t=!0,initialGlobalFilter:e=void 0,initialPageIndex:n,initialPageSize:r,children:s})=>{const[i,o]=zOe({syncWithLocation:t,initialPageIndex:n,initialPageSize:r}),[a,c]=S.useState(e),[d,f]=S.useState([]),l=S.useMemo(()=>!!(a&&a.length),[a]),u=S.useCallback(()=>c(""),[]);return x.jsx(dJ.Provider,{value:{pagination:i,setPagination:o,sorting:d,setSorting:f,globalFilter:a,setGlobalFilter:c,resetGlobalFilter:u,isFiltered:l},children:s})};/** * table-core * * Copyright (c) TanStack * * 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 Wd(t,e){return typeof t=="function"?t(e):t}function Eo(t,e){return n=>{e.setState(r=>({...r,[t]:Wd(n,r[t])}))}}function bP(t){return t instanceof Function}function BOe(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}function UOe(t,e){const n=[],r=s=>{s.forEach(i=>{n.push(i);const o=e(i);o!=null&&o.length&&r(o)})};return r(t),n}function lt(t,e,n){let r=[],s;return i=>{let o;n.key&&n.debug&&(o=Date.now());const a=t(i);if(!(a.length!==r.length||a.some((f,l)=>r[l]!==f)))return s;r=a;let d;if(n.key&&n.debug&&(d=Date.now()),s=e(...a),n==null||n.onChange==null||n.onChange(s),n.key&&n.debug&&n!=null&&n.debug()){const f=Math.round((Date.now()-o)*100)/100,l=Math.round((Date.now()-d)*100)/100,u=l/16,p=(h,m)=>{for(h=String(h);h.length{var s;return(s=t==null?void 0:t.debugAll)!=null?s:t[e]},key:!1,onChange:r}}function HOe(t,e,n,r){const s=()=>{var o;return(o=i.getValue())!=null?o:t.options.renderFallbackValue},i={id:`${e.id}_${n.id}`,row:e,column:n,getValue:()=>e.getValue(r),renderValue:s,getContext:lt(()=>[t,n,e,i],(o,a,c,d)=>({table:o,column:a,row:c,cell:d,getValue:d.getValue,renderValue:d.renderValue}),ct(t.options,"debugCells"))};return t._features.forEach(o=>{o.createCell==null||o.createCell(i,n,e,t)},{}),i}function VOe(t,e,n,r){var s,i;const a={...t._getDefaultColumnDef(),...e},c=a.accessorKey;let d=(s=(i=a.id)!=null?i:c?typeof String.prototype.replaceAll=="function"?c.replaceAll(".","_"):c.replace(/\./g,"_"):void 0)!=null?s:typeof a.header=="string"?a.header:void 0,f;if(a.accessorFn?f=a.accessorFn:c&&(c.includes(".")?f=u=>{let p=u;for(const m of c.split(".")){var h;p=(h=p)==null?void 0:h[m]}return p}:f=u=>u[a.accessorKey]),!d)throw new Error;let l={id:`${String(d)}`,accessorFn:f,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:lt(()=>[!0],()=>{var u;return[l,...(u=l.columns)==null?void 0:u.flatMap(p=>p.getFlatColumns())]},ct(t.options,"debugColumns")),getLeafColumns:lt(()=>[t._getOrderColumnsFn()],u=>{var p;if((p=l.columns)!=null&&p.length){let h=l.columns.flatMap(m=>m.getLeafColumns());return u(h)}return[l]},ct(t.options,"debugColumns"))};for(const u of t._features)u.createColumn==null||u.createColumn(l,t);return l}const Rs="debugHeaders";function yU(t,e,n){var r;let i={id:(r=n.id)!=null?r:e.id,column:e,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const o=[],a=c=>{c.subHeaders&&c.subHeaders.length&&c.subHeaders.map(a),o.push(c)};return a(i),o},getContext:()=>({table:t,header:i,column:e})};return t._features.forEach(o=>{o.createHeader==null||o.createHeader(i,t)}),i}const qOe={createTable:t=>{t.getHeaderGroups=lt(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r,s)=>{var i,o;const a=(i=r==null?void 0:r.map(l=>n.find(u=>u.id===l)).filter(Boolean))!=null?i:[],c=(o=s==null?void 0:s.map(l=>n.find(u=>u.id===l)).filter(Boolean))!=null?o:[],d=n.filter(l=>!(r!=null&&r.includes(l.id))&&!(s!=null&&s.includes(l.id)));return k1(e,[...a,...d,...c],t)},ct(t.options,Rs)),t.getCenterHeaderGroups=lt(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r,s)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(s!=null&&s.includes(i.id))),k1(e,n,t,"center")),ct(t.options,Rs)),t.getLeftHeaderGroups=lt(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,n,r)=>{var s;const i=(s=r==null?void 0:r.map(o=>n.find(a=>a.id===o)).filter(Boolean))!=null?s:[];return k1(e,i,t,"left")},ct(t.options,Rs)),t.getRightHeaderGroups=lt(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,n,r)=>{var s;const i=(s=r==null?void 0:r.map(o=>n.find(a=>a.id===o)).filter(Boolean))!=null?s:[];return k1(e,i,t,"right")},ct(t.options,Rs)),t.getFooterGroups=lt(()=>[t.getHeaderGroups()],e=>[...e].reverse(),ct(t.options,Rs)),t.getLeftFooterGroups=lt(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),ct(t.options,Rs)),t.getCenterFooterGroups=lt(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),ct(t.options,Rs)),t.getRightFooterGroups=lt(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),ct(t.options,Rs)),t.getFlatHeaders=lt(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),ct(t.options,Rs)),t.getLeftFlatHeaders=lt(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),ct(t.options,Rs)),t.getCenterFlatHeaders=lt(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),ct(t.options,Rs)),t.getRightFlatHeaders=lt(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),ct(t.options,Rs)),t.getCenterLeafHeaders=lt(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ct(t.options,Rs)),t.getLeftLeafHeaders=lt(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ct(t.options,Rs)),t.getRightLeafHeaders=lt(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ct(t.options,Rs)),t.getLeafHeaders=lt(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,n,r)=>{var s,i,o,a,c,d;return[...(s=(i=e[0])==null?void 0:i.headers)!=null?s:[],...(o=(a=n[0])==null?void 0:a.headers)!=null?o:[],...(c=(d=r[0])==null?void 0:d.headers)!=null?c:[]].map(f=>f.getLeafHeaders()).flat()},ct(t.options,Rs))}};function k1(t,e,n,r){var s,i;let o=0;const a=function(u,p){p===void 0&&(p=1),o=Math.max(o,p),u.filter(h=>h.getIsVisible()).forEach(h=>{var m;(m=h.columns)!=null&&m.length&&a(h.columns,p+1)},0)};a(t);let c=[];const d=(u,p)=>{const h={depth:p,id:[r,`${p}`].filter(Boolean).join("_"),headers:[]},m=[];u.forEach(y=>{const g=[...m].reverse()[0],v=y.column.depth===h.depth;let b,_=!1;if(v&&y.column.parent?b=y.column.parent:(b=y.column,_=!0),g&&(g==null?void 0:g.column)===b)g.subHeaders.push(y);else{const A=yU(n,b,{id:[r,p,b.id,y==null?void 0:y.id].filter(Boolean).join("_"),isPlaceholder:_,placeholderId:_?`${m.filter(P=>P.column===b).length}`:void 0,depth:p,index:m.length});A.subHeaders.push(y),m.push(A)}h.headers.push(y),y.headerGroup=h}),c.push(h),p>0&&d(m,p-1)},f=e.map((u,p)=>yU(n,u,{depth:o,index:p}));d(f,o-1),c.reverse();const l=u=>u.filter(h=>h.column.getIsVisible()).map(h=>{let m=0,y=0,g=[0];h.subHeaders&&h.subHeaders.length?(g=[],l(h.subHeaders).forEach(b=>{let{colSpan:_,rowSpan:A}=b;m+=_,g.push(A)})):m=1;const v=Math.min(...g);return y=y+v,h.colSpan=m,h.rowSpan=y,{colSpan:m,rowSpan:y}});return l((s=(i=c[0])==null?void 0:i.headers)!=null?s:[]),c}const C$=(t,e,n,r,s,i,o)=>{let a={id:e,index:r,original:n,depth:s,parentId:o,_valuesCache:{},_uniqueValuesCache:{},getValue:c=>{if(a._valuesCache.hasOwnProperty(c))return a._valuesCache[c];const d=t.getColumn(c);if(d!=null&&d.accessorFn)return a._valuesCache[c]=d.accessorFn(a.original,r),a._valuesCache[c]},getUniqueValues:c=>{if(a._uniqueValuesCache.hasOwnProperty(c))return a._uniqueValuesCache[c];const d=t.getColumn(c);if(d!=null&&d.accessorFn)return d.columnDef.getUniqueValues?(a._uniqueValuesCache[c]=d.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[c]):(a._uniqueValuesCache[c]=[a.getValue(c)],a._uniqueValuesCache[c])},renderValue:c=>{var d;return(d=a.getValue(c))!=null?d:t.options.renderFallbackValue},subRows:[],getLeafRows:()=>UOe(a.subRows,c=>c.subRows),getParentRow:()=>a.parentId?t.getRow(a.parentId,!0):void 0,getParentRows:()=>{let c=[],d=a;for(;;){const f=d.getParentRow();if(!f)break;c.push(f),d=f}return c.reverse()},getAllCells:lt(()=>[t.getAllLeafColumns()],c=>c.map(d=>HOe(t,a,d,d.id)),ct(t.options,"debugRows")),_getAllCellsByColumnId:lt(()=>[a.getAllCells()],c=>c.reduce((d,f)=>(d[f.column.id]=f,d),{}),ct(t.options,"debugRows"))};for(let c=0;c{t._getFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,t.id),t.getFacetedRowModel=()=>t._getFacetedRowModel?t._getFacetedRowModel():e.getPreFilteredRowModel(),t._getFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,t.id),t.getFacetedUniqueValues=()=>t._getFacetedUniqueValues?t._getFacetedUniqueValues():new Map,t._getFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,t.id),t.getFacetedMinMaxValues=()=>{if(t._getFacetedMinMaxValues)return t._getFacetedMinMaxValues()}}},fJ=(t,e,n)=>{var r;const s=n.toLowerCase();return!!(!((r=t.getValue(e))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(s))};fJ.autoRemove=t=>Wa(t);const hJ=(t,e,n)=>{var r;return!!(!((r=t.getValue(e))==null||(r=r.toString())==null)&&r.includes(n))};hJ.autoRemove=t=>Wa(t);const pJ=(t,e,n)=>{var r;return((r=t.getValue(e))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};pJ.autoRemove=t=>Wa(t);const mJ=(t,e,n)=>{var r;return(r=t.getValue(e))==null?void 0:r.includes(n)};mJ.autoRemove=t=>Wa(t)||!(t!=null&&t.length);const gJ=(t,e,n)=>!n.some(r=>{var s;return!((s=t.getValue(e))!=null&&s.includes(r))});gJ.autoRemove=t=>Wa(t)||!(t!=null&&t.length);const vJ=(t,e,n)=>n.some(r=>{var s;return(s=t.getValue(e))==null?void 0:s.includes(r)});vJ.autoRemove=t=>Wa(t)||!(t!=null&&t.length);const yJ=(t,e,n)=>t.getValue(e)===n;yJ.autoRemove=t=>Wa(t);const bJ=(t,e,n)=>t.getValue(e)==n;bJ.autoRemove=t=>Wa(t);const E$=(t,e,n)=>{let[r,s]=n;const i=t.getValue(e);return i>=r&&i<=s};E$.resolveFilterValue=t=>{let[e,n]=t,r=typeof e!="number"?parseFloat(e):e,s=typeof n!="number"?parseFloat(n):n,i=e===null||Number.isNaN(r)?-1/0:r,o=n===null||Number.isNaN(s)?1/0:s;if(i>o){const a=i;i=o,o=a}return[i,o]};E$.autoRemove=t=>Wa(t)||Wa(t[0])&&Wa(t[1]);const Sc={includesString:fJ,includesStringSensitive:hJ,equalsString:pJ,arrIncludes:mJ,arrIncludesAll:gJ,arrIncludesSome:vJ,equals:yJ,weakEquals:bJ,inNumberRange:E$};function Wa(t){return t==null||t===""}const GOe={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],...t}),getDefaultOptions:t=>({onColumnFiltersChange:Eo("columnFilters",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(t,e)=>{t.getAutoFilterFn=()=>{const n=e.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(t.id);return typeof r=="string"?Sc.includesString:typeof r=="number"?Sc.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Sc.equals:Array.isArray(r)?Sc.arrIncludes:Sc.weakEquals},t.getFilterFn=()=>{var n,r;return bP(t.columnDef.filterFn)?t.columnDef.filterFn:t.columnDef.filterFn==="auto"?t.getAutoFilterFn():(n=(r=e.options.filterFns)==null?void 0:r[t.columnDef.filterFn])!=null?n:Sc[t.columnDef.filterFn]},t.getCanFilter=()=>{var n,r,s;return((n=t.columnDef.enableColumnFilter)!=null?n:!0)&&((r=e.options.enableColumnFilters)!=null?r:!0)&&((s=e.options.enableFilters)!=null?s:!0)&&!!t.accessorFn},t.getIsFiltered=()=>t.getFilterIndex()>-1,t.getFilterValue=()=>{var n;return(n=e.getState().columnFilters)==null||(n=n.find(r=>r.id===t.id))==null?void 0:n.value},t.getFilterIndex=()=>{var n,r;return(n=(r=e.getState().columnFilters)==null?void 0:r.findIndex(s=>s.id===t.id))!=null?n:-1},t.setFilterValue=n=>{e.setColumnFilters(r=>{const s=t.getFilterFn(),i=r==null?void 0:r.find(f=>f.id===t.id),o=Wd(n,i?i.value:void 0);if(bU(s,o,t)){var a;return(a=r==null?void 0:r.filter(f=>f.id!==t.id))!=null?a:[]}const c={id:t.id,value:o};if(i){var d;return(d=r==null?void 0:r.map(f=>f.id===t.id?c:f))!=null?d:[]}return r!=null&&r.length?[...r,c]:[c]})}},createRow:(t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},createTable:t=>{t.setColumnFilters=e=>{const n=t.getAllLeafColumns(),r=s=>{var i;return(i=Wd(e,s))==null?void 0:i.filter(o=>{const a=n.find(c=>c.id===o.id);if(a){const c=a.getFilterFn();if(bU(c,o.value,a))return!1}return!0})};t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(r)},t.resetColumnFilters=e=>{var n,r;t.setColumnFilters(e?[]:(n=(r=t.initialState)==null?void 0:r.columnFilters)!=null?n:[])},t.getPreFilteredRowModel=()=>t.getCoreRowModel(),t.getFilteredRowModel=()=>(!t._getFilteredRowModel&&t.options.getFilteredRowModel&&(t._getFilteredRowModel=t.options.getFilteredRowModel(t)),t.options.manualFiltering||!t._getFilteredRowModel?t.getPreFilteredRowModel():t._getFilteredRowModel())}};function bU(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const KOe=(t,e,n)=>n.reduce((r,s)=>{const i=s.getValue(t);return r+(typeof i=="number"?i:0)},0),YOe=(t,e,n)=>{let r;return n.forEach(s=>{const i=s.getValue(t);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},XOe=(t,e,n)=>{let r;return n.forEach(s=>{const i=s.getValue(t);i!=null&&(r=i)&&(r=i)}),r},QOe=(t,e,n)=>{let r,s;return n.forEach(i=>{const o=i.getValue(t);o!=null&&(r===void 0?o>=o&&(r=s=o):(r>o&&(r=o),s{let n=0,r=0;if(e.forEach(s=>{let i=s.getValue(t);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},JOe=(t,e)=>{if(!e.length)return;const n=e.map(i=>i.getValue(t));if(!BOe(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),s=n.sort((i,o)=>i-o);return n.length%2!==0?s[r]:(s[r-1]+s[r])/2},eje=(t,e)=>Array.from(new Set(e.map(n=>n.getValue(t))).values()),tje=(t,e)=>new Set(e.map(n=>n.getValue(t))).size,nje=(t,e)=>e.length,Bk={sum:KOe,min:YOe,max:XOe,extent:QOe,mean:ZOe,median:JOe,unique:eje,uniqueCount:tje,count:nje},rje={getDefaultColumnDef:()=>({aggregatedCell:t=>{var e,n;return(e=(n=t.getValue())==null||n.toString==null?void 0:n.toString())!=null?e:null},aggregationFn:"auto"}),getInitialState:t=>({grouping:[],...t}),getDefaultOptions:t=>({onGroupingChange:Eo("grouping",t),groupedColumnMode:"reorder"}),createColumn:(t,e)=>{t.toggleGrouping=()=>{e.setGrouping(n=>n!=null&&n.includes(t.id)?n.filter(r=>r!==t.id):[...n??[],t.id])},t.getCanGroup=()=>{var n,r;return((n=t.columnDef.enableGrouping)!=null?n:!0)&&((r=e.options.enableGrouping)!=null?r:!0)&&(!!t.accessorFn||!!t.columnDef.getGroupingValue)},t.getIsGrouped=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.includes(t.id)},t.getGroupedIndex=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.indexOf(t.id)},t.getToggleGroupingHandler=()=>{const n=t.getCanGroup();return()=>{n&&t.toggleGrouping()}},t.getAutoAggregationFn=()=>{const n=e.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(t.id);if(typeof r=="number")return Bk.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Bk.extent},t.getAggregationFn=()=>{var n,r;if(!t)throw new Error;return bP(t.columnDef.aggregationFn)?t.columnDef.aggregationFn:t.columnDef.aggregationFn==="auto"?t.getAutoAggregationFn():(n=(r=e.options.aggregationFns)==null?void 0:r[t.columnDef.aggregationFn])!=null?n:Bk[t.columnDef.aggregationFn]}},createTable:t=>{t.setGrouping=e=>t.options.onGroupingChange==null?void 0:t.options.onGroupingChange(e),t.resetGrouping=e=>{var n,r;t.setGrouping(e?[]:(n=(r=t.initialState)==null?void 0:r.grouping)!=null?n:[])},t.getPreGroupedRowModel=()=>t.getFilteredRowModel(),t.getGroupedRowModel=()=>(!t._getGroupedRowModel&&t.options.getGroupedRowModel&&(t._getGroupedRowModel=t.options.getGroupedRowModel(t)),t.options.manualGrouping||!t._getGroupedRowModel?t.getPreGroupedRowModel():t._getGroupedRowModel())},createRow:(t,e)=>{t.getIsGrouped=()=>!!t.groupingColumnId,t.getGroupingValue=n=>{if(t._groupingValuesCache.hasOwnProperty(n))return t._groupingValuesCache[n];const r=e.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(t._groupingValuesCache[n]=r.columnDef.getGroupingValue(t.original),t._groupingValuesCache[n]):t.getValue(n)},t._groupingValuesCache={}},createCell:(t,e,n,r)=>{t.getIsGrouped=()=>e.getIsGrouped()&&e.id===n.groupingColumnId,t.getIsPlaceholder=()=>!t.getIsGrouped()&&e.getIsGrouped(),t.getIsAggregated=()=>{var s;return!t.getIsGrouped()&&!t.getIsPlaceholder()&&!!((s=n.subRows)!=null&&s.length)}}};function sje(t,e,n){if(!(e!=null&&e.length)||!n)return t;const r=t.filter(i=>!e.includes(i.id));return n==="remove"?r:[...e.map(i=>t.find(o=>o.id===i)).filter(Boolean),...r]}const ije={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:Eo("columnOrder",t)}),createColumn:(t,e)=>{t.getIndex=lt(n=>[N0(e,n)],n=>n.findIndex(r=>r.id===t.id),ct(e.options,"debugColumns")),t.getIsFirstColumn=n=>{var r;return((r=N0(e,n)[0])==null?void 0:r.id)===t.id},t.getIsLastColumn=n=>{var r;const s=N0(e,n);return((r=s[s.length-1])==null?void 0:r.id)===t.id}},createTable:t=>{t.setColumnOrder=e=>t.options.onColumnOrderChange==null?void 0:t.options.onColumnOrderChange(e),t.resetColumnOrder=e=>{var n;t.setColumnOrder(e?[]:(n=t.initialState.columnOrder)!=null?n:[])},t._getOrderColumnsFn=lt(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,n,r)=>s=>{let i=[];if(!(e!=null&&e.length))i=s;else{const o=[...e],a=[...s];for(;a.length&&o.length;){const c=o.shift(),d=a.findIndex(f=>f.id===c);d>-1&&i.push(a.splice(d,1)[0])}i=[...i,...a]}return sje(i,n,r)},ct(t.options,"debugTable"))}},Uk=()=>({left:[],right:[]}),oje={getInitialState:t=>({columnPinning:Uk(),...t}),getDefaultOptions:t=>({onColumnPinningChange:Eo("columnPinning",t)}),createColumn:(t,e)=>{t.pin=n=>{const r=t.getLeafColumns().map(s=>s.id).filter(Boolean);e.setColumnPinning(s=>{var i,o;if(n==="right"){var a,c;return{left:((a=s==null?void 0:s.left)!=null?a:[]).filter(l=>!(r!=null&&r.includes(l))),right:[...((c=s==null?void 0:s.right)!=null?c:[]).filter(l=>!(r!=null&&r.includes(l))),...r]}}if(n==="left"){var d,f;return{left:[...((d=s==null?void 0:s.left)!=null?d:[]).filter(l=>!(r!=null&&r.includes(l))),...r],right:((f=s==null?void 0:s.right)!=null?f:[]).filter(l=>!(r!=null&&r.includes(l)))}}return{left:((i=s==null?void 0:s.left)!=null?i:[]).filter(l=>!(r!=null&&r.includes(l))),right:((o=s==null?void 0:s.right)!=null?o:[]).filter(l=>!(r!=null&&r.includes(l)))}})},t.getCanPin=()=>t.getLeafColumns().some(r=>{var s,i,o;return((s=r.columnDef.enablePinning)!=null?s:!0)&&((i=(o=e.options.enableColumnPinning)!=null?o:e.options.enablePinning)!=null?i:!0)}),t.getIsPinned=()=>{const n=t.getLeafColumns().map(a=>a.id),{left:r,right:s}=e.getState().columnPinning,i=n.some(a=>r==null?void 0:r.includes(a)),o=n.some(a=>s==null?void 0:s.includes(a));return i?"left":o?"right":!1},t.getPinnedIndex=()=>{var n,r;const s=t.getIsPinned();return s?(n=(r=e.getState().columnPinning)==null||(r=r[s])==null?void 0:r.indexOf(t.id))!=null?n:-1:0}},createRow:(t,e)=>{t.getCenterVisibleCells=lt(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,s)=>{const i=[...r??[],...s??[]];return n.filter(o=>!i.includes(o.column.id))},ct(e.options,"debugRows")),t.getLeftVisibleCells=lt(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(o=>o.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),ct(e.options,"debugRows")),t.getRightVisibleCells=lt(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(o=>o.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),ct(e.options,"debugRows"))},createTable:t=>{t.setColumnPinning=e=>t.options.onColumnPinningChange==null?void 0:t.options.onColumnPinningChange(e),t.resetColumnPinning=e=>{var n,r;return t.setColumnPinning(e?Uk():(n=(r=t.initialState)==null?void 0:r.columnPinning)!=null?n:Uk())},t.getIsSomeColumnsPinned=e=>{var n;const r=t.getState().columnPinning;if(!e){var s,i;return!!((s=r.left)!=null&&s.length||(i=r.right)!=null&&i.length)}return!!((n=r[e])!=null&&n.length)},t.getLeftLeafColumns=lt(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(r=>e.find(s=>s.id===r)).filter(Boolean),ct(t.options,"debugColumns")),t.getRightLeafColumns=lt(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(r=>e.find(s=>s.id===r)).filter(Boolean),ct(t.options,"debugColumns")),t.getCenterLeafColumns=lt(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r)=>{const s=[...n??[],...r??[]];return e.filter(i=>!s.includes(i.id))},ct(t.options,"debugColumns"))}},D1={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Hk=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),aje={getDefaultColumnDef:()=>D1,getInitialState:t=>({columnSizing:{},columnSizingInfo:Hk(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Eo("columnSizing",t),onColumnSizingInfoChange:Eo("columnSizingInfo",t)}),createColumn:(t,e)=>{t.getSize=()=>{var n,r,s;const i=e.getState().columnSizing[t.id];return Math.min(Math.max((n=t.columnDef.minSize)!=null?n:D1.minSize,(r=i??t.columnDef.size)!=null?r:D1.size),(s=t.columnDef.maxSize)!=null?s:D1.maxSize)},t.getStart=lt(n=>[n,N0(e,n),e.getState().columnSizing],(n,r)=>r.slice(0,t.getIndex(n)).reduce((s,i)=>s+i.getSize(),0),ct(e.options,"debugColumns")),t.getAfter=lt(n=>[n,N0(e,n),e.getState().columnSizing],(n,r)=>r.slice(t.getIndex(n)+1).reduce((s,i)=>s+i.getSize(),0),ct(e.options,"debugColumns")),t.resetSize=()=>{e.setColumnSizing(n=>{let{[t.id]:r,...s}=n;return s})},t.getCanResize=()=>{var n,r;return((n=t.columnDef.enableResizing)!=null?n:!0)&&((r=e.options.enableColumnResizing)!=null?r:!0)},t.getIsResizing=()=>e.getState().columnSizingInfo.isResizingColumn===t.id},createHeader:(t,e)=>{t.getSize=()=>{let n=0;const r=s=>{if(s.subHeaders.length)s.subHeaders.forEach(r);else{var i;n+=(i=s.column.getSize())!=null?i:0}};return r(t),n},t.getStart=()=>{if(t.index>0){const n=t.headerGroup.headers[t.index-1];return n.getStart()+n.getSize()}return 0},t.getResizeHandler=n=>{const r=e.getColumn(t.column.id),s=r==null?void 0:r.getCanResize();return i=>{if(!r||!s||(i.persist==null||i.persist(),Vk(i)&&i.touches&&i.touches.length>1))return;const o=t.getSize(),a=t?t.getLeafHeaders().map(g=>[g.column.id,g.column.getSize()]):[[r.id,r.getSize()]],c=Vk(i)?Math.round(i.touches[0].clientX):i.clientX,d={},f=(g,v)=>{typeof v=="number"&&(e.setColumnSizingInfo(b=>{var _,A;const P=e.options.columnResizeDirection==="rtl"?-1:1,T=(v-((_=b==null?void 0:b.startOffset)!=null?_:0))*P,E=Math.max(T/((A=b==null?void 0:b.startSize)!=null?A:0),-.999999);return b.columnSizingStart.forEach(N=>{let[k,M]=N;d[k]=Math.round(Math.max(M+M*E,0)*100)/100}),{...b,deltaOffset:T,deltaPercentage:E}}),(e.options.columnResizeMode==="onChange"||g==="end")&&e.setColumnSizing(b=>({...b,...d})))},l=g=>f("move",g),u=g=>{f("end",g),e.setColumnSizingInfo(v=>({...v,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=n||typeof document<"u"?document:null,h={moveHandler:g=>l(g.clientX),upHandler:g=>{p==null||p.removeEventListener("mousemove",h.moveHandler),p==null||p.removeEventListener("mouseup",h.upHandler),u(g.clientX)}},m={moveHandler:g=>(g.cancelable&&(g.preventDefault(),g.stopPropagation()),l(g.touches[0].clientX),!1),upHandler:g=>{var v;p==null||p.removeEventListener("touchmove",m.moveHandler),p==null||p.removeEventListener("touchend",m.upHandler),g.cancelable&&(g.preventDefault(),g.stopPropagation()),u((v=g.touches[0])==null?void 0:v.clientX)}},y=lje()?{passive:!1}:!1;Vk(i)?(p==null||p.addEventListener("touchmove",m.moveHandler,y),p==null||p.addEventListener("touchend",m.upHandler,y)):(p==null||p.addEventListener("mousemove",h.moveHandler,y),p==null||p.addEventListener("mouseup",h.upHandler,y)),e.setColumnSizingInfo(g=>({...g,startOffset:c,startSize:o,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:t=>{t.setColumnSizing=e=>t.options.onColumnSizingChange==null?void 0:t.options.onColumnSizingChange(e),t.setColumnSizingInfo=e=>t.options.onColumnSizingInfoChange==null?void 0:t.options.onColumnSizingInfoChange(e),t.resetColumnSizing=e=>{var n;t.setColumnSizing(e?{}:(n=t.initialState.columnSizing)!=null?n:{})},t.resetHeaderSizeInfo=e=>{var n;t.setColumnSizingInfo(e?Hk():(n=t.initialState.columnSizingInfo)!=null?n:Hk())},t.getTotalSize=()=>{var e,n;return(e=(n=t.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?e:0},t.getLeftTotalSize=()=>{var e,n;return(e=(n=t.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?e:0},t.getCenterTotalSize=()=>{var e,n;return(e=(n=t.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?e:0},t.getRightTotalSize=()=>{var e,n;return(e=(n=t.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?e:0}}};let M1=null;function lje(){if(typeof M1=="boolean")return M1;let t=!1;try{const e={get passive(){return t=!0,!1}},n=()=>{};window.addEventListener("test",n,e),window.removeEventListener("test",n)}catch{t=!1}return M1=t,M1}function Vk(t){return t.type==="touchstart"}const cje={getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:Eo("columnVisibility",t)}),createColumn:(t,e)=>{t.toggleVisibility=n=>{t.getCanHide()&&e.setColumnVisibility(r=>({...r,[t.id]:n??!t.getIsVisible()}))},t.getIsVisible=()=>{var n,r;const s=t.columns;return(n=s.length?s.some(i=>i.getIsVisible()):(r=e.getState().columnVisibility)==null?void 0:r[t.id])!=null?n:!0},t.getCanHide=()=>{var n,r;return((n=t.columnDef.enableHiding)!=null?n:!0)&&((r=e.options.enableHiding)!=null?r:!0)},t.getToggleVisibilityHandler=()=>n=>{t.toggleVisibility==null||t.toggleVisibility(n.target.checked)}},createRow:(t,e)=>{t._getAllVisibleCells=lt(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),ct(e.options,"debugRows")),t.getVisibleCells=lt(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,r,s)=>[...n,...r,...s],ct(e.options,"debugRows"))},createTable:t=>{const e=(n,r)=>lt(()=>[r(),r().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),ct(t.options,"debugColumns"));t.getVisibleFlatColumns=e("getVisibleFlatColumns",()=>t.getAllFlatColumns()),t.getVisibleLeafColumns=e("getVisibleLeafColumns",()=>t.getAllLeafColumns()),t.getLeftVisibleLeafColumns=e("getLeftVisibleLeafColumns",()=>t.getLeftLeafColumns()),t.getRightVisibleLeafColumns=e("getRightVisibleLeafColumns",()=>t.getRightLeafColumns()),t.getCenterVisibleLeafColumns=e("getCenterVisibleLeafColumns",()=>t.getCenterLeafColumns()),t.setColumnVisibility=n=>t.options.onColumnVisibilityChange==null?void 0:t.options.onColumnVisibilityChange(n),t.resetColumnVisibility=n=>{var r;t.setColumnVisibility(n?{}:(r=t.initialState.columnVisibility)!=null?r:{})},t.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!t.getIsAllColumnsVisible(),t.setColumnVisibility(t.getAllLeafColumns().reduce((s,i)=>({...s,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},t.getIsAllColumnsVisible=()=>!t.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),t.getIsSomeColumnsVisible=()=>t.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),t.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;t.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function N0(t,e){return e?e==="center"?t.getCenterVisibleLeafColumns():e==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns()}const uje={createTable:t=>{t._getGlobalFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,"__global__"),t.getGlobalFacetedRowModel=()=>t.options.manualFiltering||!t._getGlobalFacetedRowModel?t.getPreFilteredRowModel():t._getGlobalFacetedRowModel(),t._getGlobalFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,"__global__"),t.getGlobalFacetedUniqueValues=()=>t._getGlobalFacetedUniqueValues?t._getGlobalFacetedUniqueValues():new Map,t._getGlobalFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,"__global__"),t.getGlobalFacetedMinMaxValues=()=>{if(t._getGlobalFacetedMinMaxValues)return t._getGlobalFacetedMinMaxValues()}}},dje={getInitialState:t=>({globalFilter:void 0,...t}),getDefaultOptions:t=>({onGlobalFilterChange:Eo("globalFilter",t),globalFilterFn:"auto",getColumnCanGlobalFilter:e=>{var n;const r=(n=t.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[e.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(t,e)=>{t.getCanGlobalFilter=()=>{var n,r,s,i;return((n=t.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=e.options.enableGlobalFilter)!=null?r:!0)&&((s=e.options.enableFilters)!=null?s:!0)&&((i=e.options.getColumnCanGlobalFilter==null?void 0:e.options.getColumnCanGlobalFilter(t))!=null?i:!0)&&!!t.accessorFn}},createTable:t=>{t.getGlobalAutoFilterFn=()=>Sc.includesString,t.getGlobalFilterFn=()=>{var e,n;const{globalFilterFn:r}=t.options;return bP(r)?r:r==="auto"?t.getGlobalAutoFilterFn():(e=(n=t.options.filterFns)==null?void 0:n[r])!=null?e:Sc[r]},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)}}},fje={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:Eo("expanded",t),paginateExpandedRows:!0}),createTable:t=>{let e=!1,n=!1;t._autoResetExpanded=()=>{var r,s;if(!e){t._queue(()=>{e=!0});return}if((r=(s=t.options.autoResetAll)!=null?s:t.options.autoResetExpanded)!=null?r:!t.options.manualExpanding){if(n)return;n=!0,t._queue(()=>{t.resetExpanded(),n=!1})}},t.setExpanded=r=>t.options.onExpandedChange==null?void 0:t.options.onExpandedChange(r),t.toggleAllRowsExpanded=r=>{r??!t.getIsAllRowsExpanded()?t.setExpanded(!0):t.setExpanded({})},t.resetExpanded=r=>{var s,i;t.setExpanded(r?{}:(s=(i=t.initialState)==null?void 0:i.expanded)!=null?s:{})},t.getCanSomeRowsExpand=()=>t.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),t.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),t.toggleAllRowsExpanded()},t.getIsSomeRowsExpanded=()=>{const r=t.getState().expanded;return r===!0||Object.values(r).some(Boolean)},t.getIsAllRowsExpanded=()=>{const r=t.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||t.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},t.getExpandedDepth=()=>{let r=0;return(t.getState().expanded===!0?Object.keys(t.getRowModel().rowsById):Object.keys(t.getState().expanded)).forEach(i=>{const o=i.split(".");r=Math.max(r,o.length)}),r},t.getPreExpandedRowModel=()=>t.getSortedRowModel(),t.getExpandedRowModel=()=>(!t._getExpandedRowModel&&t.options.getExpandedRowModel&&(t._getExpandedRowModel=t.options.getExpandedRowModel(t)),t.options.manualExpanding||!t._getExpandedRowModel?t.getPreExpandedRowModel():t._getExpandedRowModel())},createRow:(t,e)=>{t.toggleExpanded=n=>{e.setExpanded(r=>{var s;const i=r===!0?!0:!!(r!=null&&r[t.id]);let o={};if(r===!0?Object.keys(e.getRowModel().rowsById).forEach(a=>{o[a]=!0}):o=r,n=(s=n)!=null?s:!i,!i&&n)return{...o,[t.id]:!0};if(i&&!n){const{[t.id]:a,...c}=o;return c}return r})},t.getIsExpanded=()=>{var n;const r=e.getState().expanded;return!!((n=e.options.getIsRowExpanded==null?void 0:e.options.getIsRowExpanded(t))!=null?n:r===!0||r!=null&&r[t.id])},t.getCanExpand=()=>{var n,r,s;return(n=e.options.getRowCanExpand==null?void 0:e.options.getRowCanExpand(t))!=null?n:((r=e.options.enableExpanding)!=null?r:!0)&&!!((s=t.subRows)!=null&&s.length)},t.getIsAllParentsExpanded=()=>{let n=!0,r=t;for(;n&&r.parentId;)r=e.getRow(r.parentId,!0),n=r.getIsExpanded();return n},t.getToggleExpandedHandler=()=>{const n=t.getCanExpand();return()=>{n&&t.toggleExpanded()}}}},SO=0,CO=10,qk=()=>({pageIndex:SO,pageSize:CO}),hje={getInitialState:t=>({...t,pagination:{...qk(),...t==null?void 0:t.pagination}}),getDefaultOptions:t=>({onPaginationChange:Eo("pagination",t)}),createTable:t=>{let e=!1,n=!1;t._autoResetPageIndex=()=>{var r,s;if(!e){t._queue(()=>{e=!0});return}if((r=(s=t.options.autoResetAll)!=null?s:t.options.autoResetPageIndex)!=null?r:!t.options.manualPagination){if(n)return;n=!0,t._queue(()=>{t.resetPageIndex(),n=!1})}},t.setPagination=r=>{const s=i=>Wd(r,i);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(s)},t.resetPagination=r=>{var s;t.setPagination(r?qk():(s=t.initialState.pagination)!=null?s:qk())},t.setPageIndex=r=>{t.setPagination(s=>{let i=Wd(r,s.pageIndex);const o=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return i=Math.max(0,Math.min(i,o)),{...s,pageIndex:i}})},t.resetPageIndex=r=>{var s,i;t.setPageIndex(r?SO:(s=(i=t.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?s:SO)},t.resetPageSize=r=>{var s,i;t.setPageSize(r?CO:(s=(i=t.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?s:CO)},t.setPageSize=r=>{t.setPagination(s=>{const i=Math.max(1,Wd(r,s.pageSize)),o=s.pageSize*s.pageIndex,a=Math.floor(o/i);return{...s,pageIndex:a,pageSize:i}})},t.setPageCount=r=>t.setPagination(s=>{var i;let o=Wd(r,(i=t.options.pageCount)!=null?i:-1);return typeof o=="number"&&(o=Math.max(-1,o)),{...s,pageCount:o}}),t.getPageOptions=lt(()=>[t.getPageCount()],r=>{let s=[];return r&&r>0&&(s=[...new Array(r)].fill(null).map((i,o)=>o)),s},ct(t.options,"debugTable")),t.getCanPreviousPage=()=>t.getState().pagination.pageIndex>0,t.getCanNextPage=()=>{const{pageIndex:r}=t.getState().pagination,s=t.getPageCount();return s===-1?!0:s===0?!1:rt.setPageIndex(r=>r-1),t.nextPage=()=>t.setPageIndex(r=>r+1),t.firstPage=()=>t.setPageIndex(0),t.lastPage=()=>t.setPageIndex(t.getPageCount()-1),t.getPrePaginationRowModel=()=>t.getExpandedRowModel(),t.getPaginationRowModel=()=>(!t._getPaginationRowModel&&t.options.getPaginationRowModel&&(t._getPaginationRowModel=t.options.getPaginationRowModel(t)),t.options.manualPagination||!t._getPaginationRowModel?t.getPrePaginationRowModel():t._getPaginationRowModel()),t.getPageCount=()=>{var r;return(r=t.options.pageCount)!=null?r:Math.ceil(t.getRowCount()/t.getState().pagination.pageSize)},t.getRowCount=()=>{var r;return(r=t.options.rowCount)!=null?r:t.getPrePaginationRowModel().rows.length}}},Wk=()=>({top:[],bottom:[]}),pje={getInitialState:t=>({rowPinning:Wk(),...t}),getDefaultOptions:t=>({onRowPinningChange:Eo("rowPinning",t)}),createRow:(t,e)=>{t.pin=(n,r,s)=>{const i=r?t.getLeafRows().map(c=>{let{id:d}=c;return d}):[],o=s?t.getParentRows().map(c=>{let{id:d}=c;return d}):[],a=new Set([...o,t.id,...i]);e.setRowPinning(c=>{var d,f;if(n==="bottom"){var l,u;return{top:((l=c==null?void 0:c.top)!=null?l:[]).filter(m=>!(a!=null&&a.has(m))),bottom:[...((u=c==null?void 0:c.bottom)!=null?u:[]).filter(m=>!(a!=null&&a.has(m))),...Array.from(a)]}}if(n==="top"){var p,h;return{top:[...((p=c==null?void 0:c.top)!=null?p:[]).filter(m=>!(a!=null&&a.has(m))),...Array.from(a)],bottom:((h=c==null?void 0:c.bottom)!=null?h:[]).filter(m=>!(a!=null&&a.has(m)))}}return{top:((d=c==null?void 0:c.top)!=null?d:[]).filter(m=>!(a!=null&&a.has(m))),bottom:((f=c==null?void 0:c.bottom)!=null?f:[]).filter(m=>!(a!=null&&a.has(m)))}})},t.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:s}=e.options;return typeof r=="function"?r(t):(n=r??s)!=null?n:!0},t.getIsPinned=()=>{const n=[t.id],{top:r,bottom:s}=e.getState().rowPinning,i=n.some(a=>r==null?void 0:r.includes(a)),o=n.some(a=>s==null?void 0:s.includes(a));return i?"top":o?"bottom":!1},t.getPinnedIndex=()=>{var n,r;const s=t.getIsPinned();if(!s)return-1;const i=(n=s==="top"?e.getTopRows():e.getBottomRows())==null?void 0:n.map(o=>{let{id:a}=o;return a});return(r=i==null?void 0:i.indexOf(t.id))!=null?r:-1}},createTable:t=>{t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var n,r;return t.setRowPinning(e?Wk():(n=(r=t.initialState)==null?void 0:r.rowPinning)!=null?n:Wk())},t.getIsSomeRowsPinned=e=>{var n;const r=t.getState().rowPinning;if(!e){var s,i;return!!((s=r.top)!=null&&s.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[e])!=null&&n.length)},t._getPinnedRows=(e,n,r)=>{var s;return((s=t.options.keepPinnedRows)==null||s?(n??[]).map(o=>{const a=t.getRow(o,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(o=>e.find(a=>a.id===o))).filter(Boolean).map(o=>({...o,position:r}))},t.getTopRows=lt(()=>[t.getRowModel().rows,t.getState().rowPinning.top],(e,n)=>t._getPinnedRows(e,n,"top"),ct(t.options,"debugRows")),t.getBottomRows=lt(()=>[t.getRowModel().rows,t.getState().rowPinning.bottom],(e,n)=>t._getPinnedRows(e,n,"bottom"),ct(t.options,"debugRows")),t.getCenterRows=lt(()=>[t.getRowModel().rows,t.getState().rowPinning.top,t.getState().rowPinning.bottom],(e,n,r)=>{const s=new Set([...n??[],...r??[]]);return e.filter(i=>!s.has(i.id))},ct(t.options,"debugRows"))}},mje={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:Eo("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:t=>{t.setRowSelection=e=>t.options.onRowSelectionChange==null?void 0:t.options.onRowSelectionChange(e),t.resetRowSelection=e=>{var n;return t.setRowSelection(e?{}:(n=t.initialState.rowSelection)!=null?n:{})},t.toggleAllRowsSelected=e=>{t.setRowSelection(n=>{e=typeof e<"u"?e:!t.getIsAllRowsSelected();const r={...n},s=t.getPreGroupedRowModel().flatRows;return e?s.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):s.forEach(i=>{delete r[i.id]}),r})},t.toggleAllPageRowsSelected=e=>t.setRowSelection(n=>{const r=typeof e<"u"?e:!t.getIsAllPageRowsSelected(),s={...n};return t.getRowModel().rows.forEach(i=>{EO(s,i.id,r,!0,t)}),s}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=lt(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?Gk(t,n):{rows:[],flatRows:[],rowsById:{}},ct(t.options,"debugTable")),t.getFilteredSelectedRowModel=lt(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?Gk(t,n):{rows:[],flatRows:[],rowsById:{}},ct(t.options,"debugTable")),t.getGroupedSelectedRowModel=lt(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?Gk(t,n):{rows:[],flatRows:[],rowsById:{}},ct(t.options,"debugTable")),t.getIsAllRowsSelected=()=>{const e=t.getFilteredRowModel().flatRows,{rowSelection:n}=t.getState();let r=!!(e.length&&Object.keys(n).length);return r&&e.some(s=>s.getCanSelect()&&!n[s.id])&&(r=!1),r},t.getIsAllPageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:n}=t.getState();let r=!!e.length;return r&&e.some(s=>!n[s.id])&&(r=!1),r},t.getIsSomeRowsSelected=()=>{var e;const n=Object.keys((e=t.getState().rowSelection)!=null?e:{}).length;return n>0&&n{const e=t.getPaginationRowModel().flatRows;return t.getIsAllPageRowsSelected()?!1:e.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},t.getToggleAllRowsSelectedHandler=()=>e=>{t.toggleAllRowsSelected(e.target.checked)},t.getToggleAllPageRowsSelectedHandler=()=>e=>{t.toggleAllPageRowsSelected(e.target.checked)}},createRow:(t,e)=>{t.toggleSelected=(n,r)=>{const s=t.getIsSelected();e.setRowSelection(i=>{var o;if(n=typeof n<"u"?n:!s,t.getCanSelect()&&s===n)return i;const a={...i};return EO(a,t.id,n,(o=r==null?void 0:r.selectChildren)!=null?o:!0,e),a})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return A$(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return AO(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return AO(t,n)==="all"},t.getCanSelect=()=>{var n;return typeof e.options.enableRowSelection=="function"?e.options.enableRowSelection(t):(n=e.options.enableRowSelection)!=null?n:!0},t.getCanSelectSubRows=()=>{var n;return typeof e.options.enableSubRowSelection=="function"?e.options.enableSubRowSelection(t):(n=e.options.enableSubRowSelection)!=null?n:!0},t.getCanMultiSelect=()=>{var n;return typeof e.options.enableMultiRowSelection=="function"?e.options.enableMultiRowSelection(t):(n=e.options.enableMultiRowSelection)!=null?n:!0},t.getToggleSelectedHandler=()=>{const n=t.getCanSelect();return r=>{var s;n&&t.toggleSelected((s=r.target)==null?void 0:s.checked)}}}},EO=(t,e,n,r,s)=>{var i;const o=s.getRow(e,!0);n?(o.getCanMultiSelect()||Object.keys(t).forEach(a=>delete t[a]),o.getCanSelect()&&(t[e]=!0)):delete t[e],r&&(i=o.subRows)!=null&&i.length&&o.getCanSelectSubRows()&&o.subRows.forEach(a=>EO(t,a.id,n,r,s))};function Gk(t,e){const n=t.getState().rowSelection,r=[],s={},i=function(o,a){return o.map(c=>{var d;const f=A$(c,n);if(f&&(r.push(c),s[c.id]=c),(d=c.subRows)!=null&&d.length&&(c={...c,subRows:i(c.subRows)}),f)return c}).filter(Boolean)};return{rows:i(e.rows),flatRows:r,rowsById:s}}function A$(t,e){var n;return(n=e[t.id])!=null?n:!1}function AO(t,e,n){var r;if(!((r=t.subRows)!=null&&r.length))return!1;let s=!0,i=!1;return t.subRows.forEach(o=>{if(!(i&&!s)&&(o.getCanSelect()&&(A$(o,e)?i=!0:s=!1),o.subRows&&o.subRows.length)){const a=AO(o,e);a==="all"?i=!0:(a==="some"&&(i=!0),s=!1)}}),s?"all":i?"some":!1}const RO=/([0-9]+)/gm,gje=(t,e,n)=>xJ(df(t.getValue(n)).toLowerCase(),df(e.getValue(n)).toLowerCase()),vje=(t,e,n)=>xJ(df(t.getValue(n)),df(e.getValue(n))),yje=(t,e,n)=>R$(df(t.getValue(n)).toLowerCase(),df(e.getValue(n)).toLowerCase()),bje=(t,e,n)=>R$(df(t.getValue(n)),df(e.getValue(n))),xje=(t,e,n)=>{const r=t.getValue(n),s=e.getValue(n);return r>s?1:rR$(t.getValue(n),e.getValue(n));function R$(t,e){return t===e?0:t>e?1:-1}function df(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function xJ(t,e){const n=t.split(RO).filter(Boolean),r=e.split(RO).filter(Boolean);for(;n.length&&r.length;){const s=n.shift(),i=r.shift(),o=parseInt(s,10),a=parseInt(i,10),c=[o,a].sort();if(isNaN(c[0])){if(s>i)return 1;if(i>s)return-1;continue}if(isNaN(c[1]))return isNaN(o)?-1:1;if(o>a)return 1;if(a>o)return-1}return n.length-r.length}const kb={alphanumeric:gje,alphanumericCaseSensitive:vje,text:yje,textCaseSensitive:bje,datetime:xje,basic:wje},_je={getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:Eo("sorting",t),isMultiSortEvent:e=>e.shiftKey}),createColumn:(t,e)=>{t.getAutoSortingFn=()=>{const n=e.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const s of n){const i=s==null?void 0:s.getValue(t.id);if(Object.prototype.toString.call(i)==="[object Date]")return kb.datetime;if(typeof i=="string"&&(r=!0,i.split(RO).length>1))return kb.alphanumeric}return r?kb.text:kb.basic},t.getAutoSortDir=()=>{const n=e.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(t.id))=="string"?"asc":"desc"},t.getSortingFn=()=>{var n,r;if(!t)throw new Error;return bP(t.columnDef.sortingFn)?t.columnDef.sortingFn:t.columnDef.sortingFn==="auto"?t.getAutoSortingFn():(n=(r=e.options.sortingFns)==null?void 0:r[t.columnDef.sortingFn])!=null?n:kb[t.columnDef.sortingFn]},t.toggleSorting=(n,r)=>{const s=t.getNextSortingOrder(),i=typeof n<"u"&&n!==null;e.setSorting(o=>{const a=o==null?void 0:o.find(p=>p.id===t.id),c=o==null?void 0:o.findIndex(p=>p.id===t.id);let d=[],f,l=i?n:s==="desc";if(o!=null&&o.length&&t.getCanMultiSort()&&r?a?f="toggle":f="add":o!=null&&o.length&&c!==o.length-1?f="replace":a?f="toggle":f="replace",f==="toggle"&&(i||s||(f="remove")),f==="add"){var u;d=[...o,{id:t.id,desc:l}],d.splice(0,d.length-((u=e.options.maxMultiSortColCount)!=null?u:Number.MAX_SAFE_INTEGER))}else f==="toggle"?d=o.map(p=>p.id===t.id?{...p,desc:l}:p):f==="remove"?d=o.filter(p=>p.id!==t.id):d=[{id:t.id,desc:l}];return d})},t.getFirstSortDir=()=>{var n,r;return((n=(r=t.columnDef.sortDescFirst)!=null?r:e.options.sortDescFirst)!=null?n:t.getAutoSortDir()==="desc")?"desc":"asc"},t.getNextSortingOrder=n=>{var r,s;const i=t.getFirstSortDir(),o=t.getIsSorted();return o?o!==i&&((r=e.options.enableSortingRemoval)==null||r)&&(!(n&&(s=e.options.enableMultiRemove)!=null)||s)?!1:o==="desc"?"asc":"desc":i},t.getCanSort=()=>{var n,r;return((n=t.columnDef.enableSorting)!=null?n:!0)&&((r=e.options.enableSorting)!=null?r:!0)&&!!t.accessorFn},t.getCanMultiSort=()=>{var n,r;return(n=(r=t.columnDef.enableMultiSort)!=null?r:e.options.enableMultiSort)!=null?n:!!t.accessorFn},t.getIsSorted=()=>{var n;const r=(n=e.getState().sorting)==null?void 0:n.find(s=>s.id===t.id);return r?r.desc?"desc":"asc":!1},t.getSortIndex=()=>{var n,r;return(n=(r=e.getState().sorting)==null?void 0:r.findIndex(s=>s.id===t.id))!=null?n:-1},t.clearSorting=()=>{e.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==t.id):[])},t.getToggleSortingHandler=()=>{const n=t.getCanSort();return r=>{n&&(r.persist==null||r.persist(),t.toggleSorting==null||t.toggleSorting(void 0,t.getCanMultiSort()?e.options.isMultiSortEvent==null?void 0:e.options.isMultiSortEvent(r):!1))}}},createTable:t=>{t.setSorting=e=>t.options.onSortingChange==null?void 0:t.options.onSortingChange(e),t.resetSorting=e=>{var n,r;t.setSorting(e?[]:(n=(r=t.initialState)==null?void 0:r.sorting)!=null?n:[])},t.getPreSortedRowModel=()=>t.getGroupedRowModel(),t.getSortedRowModel=()=>(!t._getSortedRowModel&&t.options.getSortedRowModel&&(t._getSortedRowModel=t.options.getSortedRowModel(t)),t.options.manualSorting||!t._getSortedRowModel?t.getPreSortedRowModel():t._getSortedRowModel())}},Sje=[qOe,cje,ije,oje,WOe,GOe,uje,dje,_je,rje,fje,hje,pje,mje,aje];function Cje(t){var e,n;const r=[...Sje,...(e=t._features)!=null?e:[]];let s={_features:r};const i=s._features.reduce((u,p)=>Object.assign(u,p.getDefaultOptions==null?void 0:p.getDefaultOptions(s)),{}),o=u=>s.options.mergeOptions?s.options.mergeOptions(i,u):{...i,...u};let c={...{},...(n=t.initialState)!=null?n:{}};s._features.forEach(u=>{var p;c=(p=u.getInitialState==null?void 0:u.getInitialState(c))!=null?p:c});const d=[];let f=!1;const l={_features:r,options:{...i,...t},initialState:c,_queue:u=>{d.push(u),f||(f=!0,Promise.resolve().then(()=>{for(;d.length;)d.shift()();f=!1}).catch(p=>setTimeout(()=>{throw p})))},reset:()=>{s.setState(s.initialState)},setOptions:u=>{const p=Wd(u,s.options);s.options=o(p)},getState:()=>s.options.state,setState:u=>{s.options.onStateChange==null||s.options.onStateChange(u)},_getRowId:(u,p,h)=>{var m;return(m=s.options.getRowId==null?void 0:s.options.getRowId(u,p,h))!=null?m:`${h?[h.id,p].join("."):p}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(u,p)=>{let h=(p?s.getPrePaginationRowModel():s.getRowModel()).rowsById[u];if(!h&&(h=s.getCoreRowModel().rowsById[u],!h))throw new Error;return h},_getDefaultColumnDef:lt(()=>[s.options.defaultColumn],u=>{var p;return u=(p=u)!=null?p:{},{header:h=>{const m=h.header.column.columnDef;return m.accessorKey?m.accessorKey:m.accessorFn?m.id:null},cell:h=>{var m,y;return(m=(y=h.renderValue())==null||y.toString==null?void 0:y.toString())!=null?m:null},...s._features.reduce((h,m)=>Object.assign(h,m.getDefaultColumnDef==null?void 0:m.getDefaultColumnDef()),{}),...u}},ct(t,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:lt(()=>[s._getColumnDefs()],u=>{const p=function(h,m,y){return y===void 0&&(y=0),h.map(g=>{const v=VOe(s,g,y,m),b=g;return v.columns=b.columns?p(b.columns,v,y+1):[],v})};return p(u)},ct(t,"debugColumns")),getAllFlatColumns:lt(()=>[s.getAllColumns()],u=>u.flatMap(p=>p.getFlatColumns()),ct(t,"debugColumns")),_getAllFlatColumnsById:lt(()=>[s.getAllFlatColumns()],u=>u.reduce((p,h)=>(p[h.id]=h,p),{}),ct(t,"debugColumns")),getAllLeafColumns:lt(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(u,p)=>{let h=u.flatMap(m=>m.getLeafColumns());return p(h)},ct(t,"debugColumns")),getColumn:u=>s._getAllFlatColumnsById()[u]};Object.assign(s,l);for(let u=0;ult(()=>[t.options.data],e=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(s,i,o){i===void 0&&(i=0);const a=[];for(let d=0;dt._autoResetPageIndex()))}function _J(t,e,n){return n.options.filterFromLeafRows?Eje(t,e,n):Aje(t,e,n)}function Eje(t,e,n){var r;const s=[],i={},o=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(c,d){d===void 0&&(d=0);const f=[];for(let u=0;ult(()=>[t.getPreFilteredRowModel(),t.getState().columnFilters,t.getState().globalFilter,t.getFilteredRowModel()],(n,r,s)=>{if(!n.rows.length||!(r!=null&&r.length)&&!s)return n;const i=[...r.map(a=>a.id).filter(a=>a!==e),s?"__global__":void 0].filter(Boolean),o=a=>{for(let c=0;clt(()=>{var n;return[(n=t.getColumn(e))==null?void 0:n.getFacetedRowModel()]},n=>{if(!n)return new Map;let r=new Map;for(let i=0;ilt(()=>[t.getPreFilteredRowModel(),t.getState().columnFilters,t.getState().globalFilter],(e,n,r)=>{if(!e.rows.length||!(n!=null&&n.length)&&!r){for(let u=0;u{var p;const h=t.getColumn(u.id);if(!h)return;const m=h.getFilterFn();m&&s.push({id:u.id,filterFn:m,resolvedValue:(p=m.resolveFilterValue==null?void 0:m.resolveFilterValue(u.value))!=null?p:u.value})});const o=(n??[]).map(u=>u.id),a=t.getGlobalFilterFn(),c=t.getAllLeafColumns().filter(u=>u.getCanGlobalFilter());r&&a&&c.length&&(o.push("__global__"),c.forEach(u=>{var p;i.push({id:u.id,filterFn:a,resolvedValue:(p=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?p:r})}));let d,f;for(let u=0;u{p.columnFiltersMeta[m]=y})}if(i.length){for(let h=0;h{p.columnFiltersMeta[m]=y})){p.columnFilters.__global__=!0;break}}p.columnFilters.__global__!==!0&&(p.columnFilters.__global__=!1)}}const l=u=>{for(let p=0;pt._autoResetPageIndex()))}function Tje(){return t=>lt(()=>[t.getState().sorting,t.getPreSortedRowModel()],(e,n)=>{if(!n.rows.length||!(e!=null&&e.length))return n;const r=t.getState().sorting,s=[],i=r.filter(c=>{var d;return(d=t.getColumn(c.id))==null?void 0:d.getCanSort()}),o={};i.forEach(c=>{const d=t.getColumn(c.id);d&&(o[c.id]={sortUndefined:d.columnDef.sortUndefined,invertSorting:d.columnDef.invertSorting,sortingFn:d.getSortingFn()})});const a=c=>{const d=c.map(f=>({...f}));return d.sort((f,l)=>{for(let p=0;p{var l;s.push(f),(l=f.subRows)!=null&&l.length&&(f.subRows=a(f.subRows))}),d};return{rows:a(n.rows),flatRows:s,rowsById:n.rowsById}},ct(t.options,"debugTable","getSortedRowModel",()=>t._autoResetPageIndex()))}/** * react-table * * Copyright (c) TanStack * * 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 fd(t,e){return t?kje(t)?S.createElement(t,e):t:null}function kje(t){return Dje(t)||typeof t=="function"||Mje(t)}function Dje(t){return typeof t=="function"&&(()=>{const e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}function Mje(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}function SJ(t){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[n]=S.useState(()=>({current:Cje(e)})),[r,s]=S.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...t,state:{...r,...t.state},onStateChange:o=>{s(o),t.onStateChange==null||t.onStateChange(o)}})),n.current}const ey=oe.forwardRef(({className:t,...e},n)=>x.jsx("div",{ref:n,className:ie("flex items-center gap-2",t),...e}));ey.displayName="ButtonGroup";const CJ=({label:t="Cancelar",...e})=>x.jsx(Xe,{type:"button",variant:"secondary",...e,children:t});CJ.displayName="CancelButton";const Oje=({buttonText:t,title:e="",content:n,className:r=""})=>x.jsx("div",{className:`flex items-baseline justify-center mr-4 font-medium ${r}`,children:x.jsxs(E_,{children:[x.jsx(e2,{asChild:!0,children:x.jsxs(Xe,{variant:"link",className:"inline-flex items-center font-medium group",children:[x.jsx("span",{className:"underline-offset-4 group-hover:underline",children:t}),x.jsx(bq,{className:"w-4 h-4 ml-1 text-muted-foreground"})]})}),x.jsxs(Cy,{className:"sm:max-w-[425px]",children:[x.jsx(Ey,{children:x.jsx(Ry,{children:e})}),x.jsxs(i$,{className:"grid gap-4 py-2",children:[n,x.jsx(Ay,{children:x.jsx(wE,{asChild:!0,children:x.jsx(Xe,{type:"button",children:ne("common.close")})})})]})]})]})}),jje=li("",{variants:{size:{default:"w-4 h-4",sm:"h-3.5 w-3.5",lg:"h-6 w-6",icon:"w-7 h-7"}},defaultVariants:{size:"default"}}),EJ=oe.forwardRef(({className:t,label:e,size:n,icon:r,children:s,...i},o)=>{const a=!!r;return x.jsxs(Xe,{ref:o,size:n,className:ie(a?"gap-1":"",t),...i,children:[a&&x.jsx(r,{className:ie(jje({size:n}))}),x.jsx(x.Fragment,{children:e||s})]})});EJ.displayName="CustomButton";const xP=({label:t="Enviar",...e})=>x.jsx(EJ,{type:"submit",label:t,variant:"default",...e});xP.displayName="SubmitButton";function Ije(t){let r=0;for(let f=0;f>f*8&255;s+=("00"+l.toString(16)).substr(-2)}const i=parseInt(s.substr(1,2),16),o=parseInt(s.substr(3,2),16),a=parseInt(s.substr(5,2),16),c=`#${(i*.7|0).toString(16).padStart(2,"0")}${(o*.7|0).toString(16).padStart(2,"0")}${(a*.7|0).toString(16).padStart(2,"0")}`,d=`#${Math.min(255,Math.floor(i+(255-i)*.7)).toString(16).padStart(2,"0")}${Math.min(255,Math.floor(o+(255-o)*.7)).toString(16).padStart(2,"0")}${Math.min(255,Math.floor(a+(255-a)*.7)).toString(16).padStart(2,"0")}`;return[c,d]}const AJ=({label:t,className:e})=>{const[n,r]=Ije(t);return x.jsx(kL,{className:e,style:e?{}:{backgroundColor:r,color:n},children:t})},Lje=li("p-6",{variants:{variant:{full:"w-full",boxed:"container max-w-3xl lg:max-w-5xl mx-auto"}},defaultVariants:{variant:"full"}}),RJ=({className:t,as:e="article",variant:n,...r})=>x.jsx(e,{className:ie(Lje({variant:n,className:t})),...r});RJ.displayName="Container";const P$=()=>{const t=Fs();return x.jsxs(Xe,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:()=>t(-1),children:[x.jsx(iR,{className:"w-4 h-4"}),x.jsx("span",{className:"sr-only",children:ne("common.back")})]})};function PJ({table:t,header:e,className:n}){return e.column.getCanSort()?x.jsx("div",{className:ie("flex items-center space-x-2",n),children:x.jsxs(O_,{children:[x.jsx(j_,{asChild:!0,children:x.jsxs(Xe,{"aria-label":e.column.getIsSorted()==="desc"?ne("common.sort_desc_description"):e.column.getIsSorted()==="asc"?ne("common.sort_asc_description"):ne("sort_none_description"),size:"sm",variant:"ghost",className:"-ml-3 h-8 data-[state=open]:bg-accent font-bold text-muted-foreground",children:[fd(e.column.columnDef.header,e.getContext()),e.column.getIsSorted()==="desc"?x.jsx(vB,{className:"w-4 h-4 ml-2","aria-hidden":"true"}):e.column.getIsSorted()==="asc"?x.jsx(yB,{className:"w-4 h-4 ml-2","aria-hidden":"true"}):x.jsx(dge,{className:"w-4 h-4 ml-2 text-muted-foreground/30","aria-hidden":"true"})]})}),x.jsxs(ky,{align:"start",children:[e.column.getCanSort()&&x.jsxs(x.Fragment,{children:[x.jsxs(tf,{onClick:()=>e.column.toggleSorting(!1),"aria-label":ne("common.sort_asc"),children:[x.jsx(yB,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),ne("common.sort_asc")]}),x.jsxs(tf,{onClick:()=>e.column.toggleSorting(!0),"aria-label":ne("common.sort_desc"),children:[x.jsx(vB,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),ne("common.sort_desc")]})]}),e.column.getCanSort()&&e.column.getCanHide()&&x.jsx(qv,{}),e.column.getCanHide()&&x.jsxs(tf,{onClick:()=>e.column.toggleVisibility(!1),"aria-label":ne("Hide"),children:[x.jsx(wq,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),ne("Hide")]})]})]})}):x.jsxs(x.Fragment,{children:[x.jsx("div",{className:ie("data-[state=open]:bg-accent tracking-wide text-ellipsis",n),children:e.isPlaceholder?null:fd(e.column.columnDef.header,e.getContext())}),!1]})}function $je({table:t,className:e,enablePageSizeSelector:n=!0,visible:r="auto"}){const s=S.useMemo(()=>r===!0,[r]),i=S.useMemo(()=>r==="auto",[r]);return!s||i&&t.getPageCount()<1?null:x.jsxs("div",{className:e,children:[x.jsx("div",{className:"flex-1 text-base text-muted-foreground",children:t.getSelectedRowModel().rows.length>0&&x.jsx(x.Fragment,{children:ne("common.rows_selected_of_total",{count:t.getFilteredSelectedRowModel().rows.length,total:t.getFilteredRowModel().rows.length})})}),x.jsxs("div",{className:"flex justify-between space-x-6 lg:space-x-8",children:[n&&x.jsxs("div",{className:"flex items-center space-x-2 grow",children:[x.jsx("p",{className:"text-sm font-medium",children:ne("common.rows_per_page")}),x.jsxs(a$,{value:`${t.getState().pagination.pageSize}`,onValueChange:o=>{t.setPageSize(Number(o))},children:[x.jsx(iP,{className:"h-8 w-[70px]",children:x.jsx(l$,{placeholder:t.getState().pagination.pageSize})}),x.jsx(oP,{side:"top",children:$Oe.map(o=>x.jsx(vg,{value:`${o}`,children:o},o))})]})]}),x.jsxs("div",{className:ie("flex space-x-2 flex-1",n?"justify-end":"justify-between"),children:[x.jsx("div",{className:"flex w-[150px] items-center justify-start",children:x.jsx("p",{className:"text-sm font-medium ",children:ne("common.num_page_of_total",{count:t.getState().pagination.pageIndex+1,total:t.getPageCount()})})}),x.jsxs("div",{className:"flex items-center space-x-2",children:[x.jsxs(Xe,{type:"button",variant:"outline",className:"hidden w-8 h-8 p-0 lg:flex",onClick:()=>t.setPageIndex(bg),disabled:!t.getCanPreviousPage(),children:[x.jsx("span",{className:"sr-only",children:ne("common.go_to_first_page")}),x.jsx(hge,{className:"w-4 h-4"})]}),x.jsxs(Xe,{type:"button",variant:"outline",className:"w-8 h-8 p-0",onClick:()=>t.previousPage(),disabled:!t.getCanPreviousPage(),children:[x.jsx("span",{className:"sr-only",children:ne("common.go_to_prev_page")}),x.jsx(iR,{className:"w-4 h-4"})]}),x.jsxs(Xe,{type:"button",variant:"outline",className:"w-8 h-8 p-0",onClick:()=>t.nextPage(),disabled:!t.getCanNextPage(),children:[x.jsx("span",{className:"sr-only",children:ne("common.go_to_next_page")}),x.jsx(dy,{className:"w-4 h-4"})]}),x.jsxs(Xe,{type:"button",variant:"outline",className:"hidden w-8 h-8 p-0 lg:flex",onClick:()=>t.setPageIndex(t.getPageCount()+1),disabled:!t.getCanNextPage(),children:[x.jsx("span",{className:"sr-only",children:ne("common.go_to_last_page")}),x.jsx(pge,{className:"w-4 h-4"})]})]})]})]})]})}function wP({table:t,title:e,description:n,caption:r,paginationOptions:s,headerOptions:i={visible:!0},children:o,className:a,contentClassName:c,footerClassName:d,rowClassName:f,cellClassName:l,onRowClick:u,activeRowIndex:p}){var m;const h=i==null?void 0:i.visible;return x.jsxs(xr,{className:a,children:[(e||n)&&x.jsxs(Ei,{className:"pb-0",children:[x.jsx(ns,{children:e}),x.jsx(vs,{children:n})]}),x.jsxs(wr,{className:ie("pt-6",c),children:[o&&x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"flex space-x-2",children:o}),x.jsx(lu,{className:"my-4"})]}),x.jsxs(ud,{children:[typeof r<"u"&&x.jsx(qQ,{children:r}),h&&t.getHeaderGroups().length&&x.jsx(lP,{children:t.getHeaderGroups().map(y=>x.jsx(Jo,{className:f,children:y.headers.map(g=>x.jsx(cP,{colSpan:g.colSpan,style:{width:g.getSize()===Number.MAX_SAFE_INTEGER?"auto":g.getSize()},children:x.jsx(PJ,{table:t,header:g})},g.id))},y.id))}),x.jsx(dd,{children:(m=t.getRowModel().rows)!=null&&m.length?t.getRowModel().rows.map(y=>x.jsx(Jo,{onClick:()=>{u&&u(y)},tabIndex:0,"data-state":y.getIsSelected()&&"selected",className:ie(y.getIsSelected()||p===y.index?"bg-accent cursor-pointer hover:bg-accent":"cursor-pointer",f),children:y.getVisibleCells().map(g=>x.jsx(nu,{className:l,style:{width:g.column.getSize()===Number.MAX_SAFE_INTEGER?"auto":g.column.getSize()},children:fd(g.column.columnDef.cell,g.getContext())},g.id))},y.id)):x.jsx(Jo,{className:f,children:x.jsx(nu,{className:ie("h-24 text-center",l),colSpan:t.getAllColumns.length,children:"No hay datos para mostrar"})})})]})]}),x.jsx(Ko,{className:d,children:x.jsx($je,{className:"flex-1",table:t,...s})})]})}function Fje({actions:t,rowContext:e}){return x.jsxs(O_,{children:[x.jsx(j_,{asChild:!0,children:x.jsxs(Xe,{size:"icon",variant:"outline",className:"w-8 h-8",children:[x.jsx(bge,{className:"h-3.5 w-3.5"}),x.jsx("span",{className:"sr-only",children:ne("common.open_menu")})]})}),x.jsxs(ky,{align:"end",children:[x.jsxs(WR,{children:[ne("common.actions")," "]}),t&&t(e).map((n,r)=>n.label==="-"?x.jsx(qv,{},r):x.jsxs(tf,{onClick:s=>n.onClick?n.onClick(e,s):null,children:[n.icon&&x.jsx(x.Fragment,{children:n.icon}),n.label,n.shortcut&&x.jsx(XK,{children:n.shortcut})]},r))]})]})}function zje(){for(var t=arguments.length,e=new Array(t),n=0;nr=>{e.forEach(s=>s(r))},e)}const _P=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function $y(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function N$(t){return"nodeType"in t}function ui(t){var e,n;return t?$y(t)?t:N$(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function T$(t){const{Document:e}=ui(t);return t instanceof e}function V_(t){return $y(t)?!1:t instanceof ui(t).HTMLElement}function NJ(t){return t instanceof ui(t).SVGElement}function Fy(t){return t?$y(t)?t.document:N$(t)?T$(t)?t:V_(t)||NJ(t)?t.ownerDocument:document:document:document}const ua=_P?S.useLayoutEffect:S.useEffect;function SP(t){const e=S.useRef(t);return ua(()=>{e.current=t}),S.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s{t.current=setInterval(r,s)},[]),n=S.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function wx(t,e){e===void 0&&(e=[t]);const n=S.useRef(t);return ua(()=>{n.current!==t&&(n.current=t)},e),n}function q_(t,e){const n=S.useRef();return S.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function KE(t){const e=SP(t),n=S.useRef(null),r=S.useCallback(s=>{s!==n.current&&(e==null||e(s,n.current)),n.current=s},[]);return[n,r]}function YE(t){const e=S.useRef();return S.useEffect(()=>{e.current=t},[t]),e.current}let Kk={};function W_(t,e){return S.useMemo(()=>{if(e)return e;const n=Kk[t]==null?0:Kk[t]+1;return Kk[t]=n,t+"-"+n},[t,e])}function TJ(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s{const a=Object.entries(o);for(const[c,d]of a){const f=i[c];f!=null&&(i[c]=f+t*d)}return i},{...e})}}const xg=TJ(1),XE=TJ(-1);function Uje(t){return"clientX"in t&&"clientY"in t}function CP(t){if(!t)return!1;const{KeyboardEvent:e}=ui(t.target);return e&&t instanceof e}function Hje(t){if(!t)return!1;const{TouchEvent:e}=ui(t.target);return e&&t instanceof e}function QE(t){if(Hje(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return Uje(t)?{x:t.clientX,y:t.clientY}:null}const Kl=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[Kl.Translate.toString(t),Kl.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),xU="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Vje(t){return t.matches(xU)?t:t.querySelector(xU)}const qje={display:"none"};function Wje(t){let{id:e,value:n}=t;return oe.createElement("div",{id:e,style:qje},n)}function Gje(t){let{id:e,announcement:n,ariaLiveType:r="assertive"}=t;const s={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return oe.createElement("div",{id:e,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function Kje(){const[t,e]=S.useState("");return{announce:S.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const kJ=S.createContext(null);function Yje(t){const e=S.useContext(kJ);S.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of ");return e(t)},[t,e])}function Xje(){const[t]=S.useState(()=>new Set),e=S.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[S.useCallback(r=>{let{type:s,event:i}=r;t.forEach(o=>{var a;return(a=o[s])==null?void 0:a.call(o,i)})},[t]),e]}const Qje={draggable:` To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel. `},Zje={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function Jje(t){let{announcements:e=Zje,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=Qje}=t;const{announce:i,announcement:o}=Kje(),a=W_("DndLiveRegion"),[c,d]=S.useState(!1);if(S.useEffect(()=>{d(!0)},[]),Yje(S.useMemo(()=>({onDragStart(l){let{active:u}=l;i(e.onDragStart({active:u}))},onDragMove(l){let{active:u,over:p}=l;e.onDragMove&&i(e.onDragMove({active:u,over:p}))},onDragOver(l){let{active:u,over:p}=l;i(e.onDragOver({active:u,over:p}))},onDragEnd(l){let{active:u,over:p}=l;i(e.onDragEnd({active:u,over:p}))},onDragCancel(l){let{active:u,over:p}=l;i(e.onDragCancel({active:u,over:p}))}}),[i,e])),!c)return null;const f=oe.createElement(oe.Fragment,null,oe.createElement(Wje,{id:r,value:s.draggable}),oe.createElement(Gje,{id:a,announcement:o}));return n?rs.createPortal(f,n):f}var Vr;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(Vr||(Vr={}));function ZE(){}function O1(t,e){return S.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function eIe(){for(var t=arguments.length,e=new Array(t),n=0;n[...e].filter(r=>r!=null),[...e])}const el=Object.freeze({x:0,y:0});function tIe(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function nIe(t,e){const n=QE(t);if(!n)return"0 0";const r={x:(n.x-e.left)/e.width*100,y:(n.y-e.top)/e.height*100};return r.x+"% "+r.y+"%"}function rIe(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function sIe(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function iIe(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function wU(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.top),{x:e+t.width*.5,y:n+t.height*.5}}const oIe=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=wU(e,e.left,e.top),i=[];for(const o of r){const{id:a}=o,c=n.get(a);if(c){const d=tIe(wU(c),s);i.push({id:a,data:{droppableContainer:o,value:d}})}}return i.sort(rIe)};function aIe(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),s=Math.min(e.left+e.width,t.left+t.width),i=Math.min(e.top+e.height,t.top+t.height),o=s-r,a=i-n;if(r{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=[];for(const i of r){const{id:o}=i,a=n.get(o);if(a){const c=aIe(a,e);c>0&&s.push({id:o,data:{droppableContainer:i,value:c}})}}return s.sort(sIe)};function cIe(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function DJ(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:el}function uIe(t){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i({...o,top:o.top+t*a.y,bottom:o.bottom+t*a.y,left:o.left+t*a.x,right:o.right+t*a.x}),{...n})}}const dIe=uIe(1);function MJ(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function fIe(t,e,n){const r=MJ(e);if(!r)return t;const{scaleX:s,scaleY:i,x:o,y:a}=r,c=t.left-o-(1-s)*parseFloat(n),d=t.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),f=s?t.width/s:t.width,l=i?t.height/i:t.height;return{width:f,height:l,top:d,right:c+f,bottom:d+l,left:c}}const hIe={ignoreTransform:!1};function zy(t,e){e===void 0&&(e=hIe);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:d,transformOrigin:f}=ui(t).getComputedStyle(t);d&&(n=fIe(n,d,f))}const{top:r,left:s,width:i,height:o,bottom:a,right:c}=n;return{top:r,left:s,width:i,height:o,bottom:a,right:c}}function _U(t){return zy(t,{ignoreTransform:!0})}function pIe(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function mIe(t,e){return e===void 0&&(e=ui(t).getComputedStyle(t)),e.position==="fixed"}function gIe(t,e){e===void 0&&(e=ui(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=e[s];return typeof i=="string"?n.test(i):!1})}function k$(t,e){const n=[];function r(s){if(e!=null&&n.length>=e||!s)return n;if(T$(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!V_(s)||NJ(s)||n.includes(s))return n;const i=ui(t).getComputedStyle(s);return s!==t&&gIe(s,i)&&n.push(s),mIe(s,i)?n:r(s.parentNode)}return t?r(t):n}function OJ(t){const[e]=k$(t,1);return e??null}function Yk(t){return!_P||!t?null:$y(t)?t:N$(t)?T$(t)||t===Fy(t).scrollingElement?window:V_(t)?t:null:null}function jJ(t){return $y(t)?t.scrollX:t.scrollLeft}function IJ(t){return $y(t)?t.scrollY:t.scrollTop}function PO(t){return{x:jJ(t),y:IJ(t)}}var ts;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(ts||(ts={}));function LJ(t){return!_P||!t?!1:t===document.scrollingElement}function $J(t){const e={x:0,y:0},n=LJ(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},s=t.scrollTop<=e.y,i=t.scrollLeft<=e.x,o=t.scrollTop>=r.y,a=t.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:o,isRight:a,maxScroll:r,minScroll:e}}const vIe={x:.2,y:.2};function yIe(t,e,n,r,s){let{top:i,left:o,right:a,bottom:c}=n;r===void 0&&(r=10),s===void 0&&(s=vIe);const{isTop:d,isBottom:f,isLeft:l,isRight:u}=$J(t),p={x:0,y:0},h={x:0,y:0},m={height:e.height*s.y,width:e.width*s.x};return!d&&i<=e.top+m.height?(p.y=ts.Backward,h.y=r*Math.abs((e.top+m.height-i)/m.height)):!f&&c>=e.bottom-m.height&&(p.y=ts.Forward,h.y=r*Math.abs((e.bottom-m.height-c)/m.height)),!u&&a>=e.right-m.width?(p.x=ts.Forward,h.x=r*Math.abs((e.right-m.width-a)/m.width)):!l&&o<=e.left+m.width&&(p.x=ts.Backward,h.x=r*Math.abs((e.left+m.width-o)/m.width)),{direction:p,speed:h}}function bIe(t){if(t===document.scrollingElement){const{innerWidth:i,innerHeight:o}=window;return{top:0,left:0,right:i,bottom:o,width:i,height:o}}const{top:e,left:n,right:r,bottom:s}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:s,width:t.clientWidth,height:t.clientHeight}}function FJ(t){return t.reduce((e,n)=>xg(e,PO(n)),el)}function xIe(t){return t.reduce((e,n)=>e+jJ(n),0)}function wIe(t){return t.reduce((e,n)=>e+IJ(n),0)}function zJ(t,e){if(e===void 0&&(e=zy),!t)return;const{top:n,left:r,bottom:s,right:i}=e(t);OJ(t)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const _Ie=[["x",["left","right"],xIe],["y",["top","bottom"],wIe]];class D${constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=k$(n),s=FJ(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,o,a]of _Ie)for(const c of o)Object.defineProperty(this,c,{get:()=>{const d=a(r),f=s[i]-d;return this.rect[c]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class T0{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=e}add(e,n,r){var s;(s=this.target)==null||s.addEventListener(e,n,r),this.listeners.push([e,n,r])}}function SIe(t){const{EventTarget:e}=ui(t);return t instanceof e?t:Fy(t)}function Xk(t,e){const n=Math.abs(t.x),r=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+r**2)>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var Yo;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Yo||(Yo={}));function SU(t){t.preventDefault()}function CIe(t){t.stopPropagation()}var un;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter"})(un||(un={}));const BJ={start:[un.Space,un.Enter],cancel:[un.Esc],end:[un.Space,un.Enter]},EIe=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case un.Right:return{...n,x:n.x+25};case un.Left:return{...n,x:n.x-25};case un.Down:return{...n,y:n.y+25};case un.Up:return{...n,y:n.y-25}}};class M${constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new T0(Fy(n)),this.windowListeners=new T0(ui(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Yo.Resize,this.handleCancel),this.windowListeners.add(Yo.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Yo.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&zJ(r),n(el)}handleKeyDown(e){if(CP(e)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=BJ,coordinateGetter:o=EIe,scrollBehavior:a="smooth"}=s,{code:c}=e;if(i.end.includes(c)){this.handleEnd(e);return}if(i.cancel.includes(c)){this.handleCancel(e);return}const{collisionRect:d}=r.current,f=d?{x:d.left,y:d.top}:el;this.referenceCoordinates||(this.referenceCoordinates=f);const l=o(e,{active:n,context:r.current,currentCoordinates:f});if(l){const u=XE(l,f),p={x:0,y:0},{scrollableAncestors:h}=r.current;for(const m of h){const y=e.code,{isTop:g,isRight:v,isLeft:b,isBottom:_,maxScroll:A,minScroll:P}=$J(m),T=bIe(m),E={x:Math.min(y===un.Right?T.right-T.width/2:T.right,Math.max(y===un.Right?T.left:T.left+T.width/2,l.x)),y:Math.min(y===un.Down?T.bottom-T.height/2:T.bottom,Math.max(y===un.Down?T.top:T.top+T.height/2,l.y))},N=y===un.Right&&!v||y===un.Left&&!b,k=y===un.Down&&!_||y===un.Up&&!g;if(N&&E.x!==l.x){const M=m.scrollLeft+u.x,j=y===un.Right&&M<=A.x||y===un.Left&&M>=P.x;if(j&&!u.y){m.scrollTo({left:M,behavior:a});return}j?p.x=m.scrollLeft-M:p.x=y===un.Right?m.scrollLeft-A.x:m.scrollLeft-P.x,p.x&&m.scrollBy({left:-p.x,behavior:a});break}else if(k&&E.y!==l.y){const M=m.scrollTop+u.y,j=y===un.Down&&M<=A.y||y===un.Up&&M>=P.y;if(j&&!u.x){m.scrollTo({top:M,behavior:a});return}j?p.y=m.scrollTop-M:p.y=y===un.Down?m.scrollTop-A.y:m.scrollTop-P.y,p.y&&m.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(e,xg(XE(l,this.referenceCoordinates),p))}}}handleMove(e,n){const{onMove:r}=this.props;e.preventDefault(),r(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}M$.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=BJ,onActivation:s}=e,{active:i}=n;const{code:o}=t.nativeEvent;if(r.start.includes(o)){const a=i.activatorNode.current;return a&&t.target!==a?!1:(t.preventDefault(),s==null||s({event:t.nativeEvent}),!0)}return!1}}];function CU(t){return!!(t&&"distance"in t)}function EU(t){return!!(t&&"delay"in t)}class O${constructor(e,n,r){var s;r===void 0&&(r=SIe(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:i}=e,{target:o}=i;this.props=e,this.events=n,this.document=Fy(o),this.documentListeners=new T0(this.document),this.listeners=new T0(r),this.windowListeners=new T0(ui(o)),this.initialCoordinates=(s=QE(i))!=null?s:el,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(Yo.Resize,this.handleCancel),this.windowListeners.add(Yo.DragStart,SU),this.windowListeners.add(Yo.VisibilityChange,this.handleCancel),this.windowListeners.add(Yo.ContextMenu,SU),this.documentListeners.add(Yo.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(EU(n)){this.timeoutId=setTimeout(this.handleStart,n.delay);return}if(CU(n))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(Yo.Click,CIe,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Yo.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:o,options:{activationConstraint:a}}=i;if(!s)return;const c=(n=QE(e))!=null?n:el,d=XE(s,c);if(!r&&a){if(CU(a)){if(a.tolerance!=null&&Xk(d,a.tolerance))return this.handleCancel();if(Xk(d,a.distance))return this.handleStart()}return EU(a)&&Xk(d,a.tolerance)?this.handleCancel():void 0}e.cancelable&&e.preventDefault(),o(c)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===un.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const AIe={move:{name:"pointermove"},end:{name:"pointerup"}};class j$ extends O${constructor(e){const{event:n}=e,r=Fy(n.target);super(e,AIe,r)}}j$.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const RIe={move:{name:"mousemove"},end:{name:"mouseup"}};var NO;(function(t){t[t.RightClick=2]="RightClick"})(NO||(NO={}));class UJ extends O${constructor(e){super(e,RIe,Fy(e.event.target))}}UJ.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===NO.RightClick?!1:(r==null||r({event:n}),!0)}}];const Qk={move:{name:"touchmove"},end:{name:"touchend"}};class HJ extends O${constructor(e){super(e,Qk)}static setup(){return window.addEventListener(Qk.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Qk.move.name,e)};function e(){}}}HJ.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;const{touches:s}=n;return s.length>1?!1:(r==null||r({event:n}),!0)}}];var k0;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(k0||(k0={}));var JE;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(JE||(JE={}));function PIe(t){let{acceleration:e,activator:n=k0.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:o=5,order:a=JE.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:f,delta:l,threshold:u}=t;const p=TIe({delta:l,disabled:!i}),[h,m]=Bje(),y=S.useRef({x:0,y:0}),g=S.useRef({x:0,y:0}),v=S.useMemo(()=>{switch(n){case k0.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case k0.DraggableRect:return s}},[n,s,c]),b=S.useRef(null),_=S.useCallback(()=>{const P=b.current;if(!P)return;const T=y.current.x*g.current.x,E=y.current.y*g.current.y;P.scrollBy(T,E)},[]),A=S.useMemo(()=>a===JE.TreeOrder?[...d].reverse():d,[a,d]);S.useEffect(()=>{if(!i||!d.length||!v){m();return}for(const P of A){if((r==null?void 0:r(P))===!1)continue;const T=d.indexOf(P),E=f[T];if(!E)continue;const{direction:N,speed:k}=yIe(P,E,v,e,u);for(const M of["x","y"])p[M][N[M]]||(k[M]=0,N[M]=0);if(k.x>0||k.y>0){m(),b.current=P,h(_,o),y.current=k,g.current=N;return}}y.current={x:0,y:0},g.current={x:0,y:0},m()},[e,_,r,m,i,o,JSON.stringify(v),JSON.stringify(p),h,d,A,f,JSON.stringify(u)])}const NIe={x:{[ts.Backward]:!1,[ts.Forward]:!1},y:{[ts.Backward]:!1,[ts.Forward]:!1}};function TIe(t){let{delta:e,disabled:n}=t;const r=YE(e);return q_(s=>{if(n||!r||!s)return NIe;const i={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[ts.Backward]:s.x[ts.Backward]||i.x===-1,[ts.Forward]:s.x[ts.Forward]||i.x===1},y:{[ts.Backward]:s.y[ts.Backward]||i.y===-1,[ts.Forward]:s.y[ts.Forward]||i.y===1}}},[n,e,r])}function kIe(t,e){const n=e!==null?t.get(e):void 0,r=n?n.node.current:null;return q_(s=>{var i;return e===null?null:(i=r??s)!=null?i:null},[r,e])}function DIe(t,e){return S.useMemo(()=>t.reduce((n,r)=>{const{sensor:s}=r,i=s.activators.map(o=>({eventName:o.eventName,handler:e(o.handler,r)}));return[...n,...i]},[]),[t,e])}var ty;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(ty||(ty={}));var TO;(function(t){t.Optimized="optimized"})(TO||(TO={}));const AU=new Map;function MIe(t,e){let{dragging:n,dependencies:r,config:s}=e;const[i,o]=S.useState(null),{frequency:a,measure:c,strategy:d}=s,f=S.useRef(t),l=y(),u=wx(l),p=S.useCallback(function(g){g===void 0&&(g=[]),!u.current&&o(v=>v===null?g:v.concat(g.filter(b=>!v.includes(b))))},[u]),h=S.useRef(null),m=q_(g=>{if(l&&!n)return AU;if(!g||g===AU||f.current!==t||i!=null){const v=new Map;for(let b of t){if(!b)continue;if(i&&i.length>0&&!i.includes(b.id)&&b.rect.current){v.set(b.id,b.rect.current);continue}const _=b.node.current,A=_?new D$(c(_),_):null;b.rect.current=A,A&&v.set(b.id,A)}return v}return g},[t,i,n,l,c]);return S.useEffect(()=>{f.current=t},[t]),S.useEffect(()=>{l||p()},[n,l]),S.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),S.useEffect(()=>{l||typeof a!="number"||h.current!==null||(h.current=setTimeout(()=>{p(),h.current=null},a))},[a,l,p,...r]),{droppableRects:m,measureDroppableContainers:p,measuringScheduled:i!=null};function y(){switch(d){case ty.Always:return!1;case ty.BeforeDragging:return n;default:return!n}}}function I$(t,e){return q_(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function OIe(t,e){return I$(t,e)}function jIe(t){let{callback:e,disabled:n}=t;const r=SP(e),s=S.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return S.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function EP(t){let{callback:e,disabled:n}=t;const r=SP(e),s=S.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return S.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function IIe(t){return new D$(zy(t),t)}function RU(t,e,n){e===void 0&&(e=IIe);const[r,s]=S.useReducer(a,null),i=jIe({callback(c){if(t)for(const d of c){const{type:f,target:l}=d;if(f==="childList"&&l instanceof HTMLElement&&l.contains(t)){s();break}}}}),o=EP({callback:s});return ua(()=>{s(),t?(o==null||o.observe(t),i==null||i.observe(document.body,{childList:!0,subtree:!0})):(o==null||o.disconnect(),i==null||i.disconnect())},[t]),r;function a(c){if(!t)return null;if(t.isConnected===!1){var d;return(d=c??n)!=null?d:null}const f=e(t);return JSON.stringify(c)===JSON.stringify(f)?c:f}}function LIe(t){const e=I$(t);return DJ(t,e)}const PU=[];function $Ie(t){const e=S.useRef(t),n=q_(r=>t?r&&r!==PU&&t&&e.current&&t.parentNode===e.current.parentNode?r:k$(t):PU,[t]);return S.useEffect(()=>{e.current=t},[t]),n}function FIe(t){const[e,n]=S.useState(null),r=S.useRef(t),s=S.useCallback(i=>{const o=Yk(i.target);o&&n(a=>a?(a.set(o,PO(o)),new Map(a)):null)},[]);return S.useEffect(()=>{const i=r.current;if(t!==i){o(i);const a=t.map(c=>{const d=Yk(c);return d?(d.addEventListener("scroll",s,{passive:!0}),[d,PO(d)]):null}).filter(c=>c!=null);n(a.length?new Map(a):null),r.current=t}return()=>{o(t),o(i)};function o(a){a.forEach(c=>{const d=Yk(c);d==null||d.removeEventListener("scroll",s)})}},[s,t]),S.useMemo(()=>t.length?e?Array.from(e.values()).reduce((i,o)=>xg(i,o),el):FJ(t):el,[t,e])}function NU(t,e){e===void 0&&(e=[]);const n=S.useRef(null);return S.useEffect(()=>{n.current=null},e),S.useEffect(()=>{const r=t!==el;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?XE(t,n.current):el}function zIe(t){S.useEffect(()=>{if(!_P)return;const e=t.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of e)n==null||n()}},t.map(e=>{let{sensor:n}=e;return n}))}function BIe(t,e){return S.useMemo(()=>t.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=o=>{i(o,e)},n},{}),[t,e])}function VJ(t){return S.useMemo(()=>t?pIe(t):null,[t])}const Zk=[];function UIe(t,e){e===void 0&&(e=zy);const[n]=t,r=VJ(n?ui(n):null),[s,i]=S.useReducer(a,Zk),o=EP({callback:i});return t.length>0&&s===Zk&&i(),ua(()=>{t.length?t.forEach(c=>o==null?void 0:o.observe(c)):(o==null||o.disconnect(),i())},[t]),s;function a(){return t.length?t.map(c=>LJ(c)?r:new D$(e(c),c)):Zk}}function qJ(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return V_(e)?e:t}function HIe(t){let{measure:e}=t;const[n,r]=S.useState(null),s=S.useCallback(d=>{for(const{target:f}of d)if(V_(f)){r(l=>{const u=e(f);return l?{...l,width:u.width,height:u.height}:u});break}},[e]),i=EP({callback:s}),o=S.useCallback(d=>{const f=qJ(d);i==null||i.disconnect(),f&&(i==null||i.observe(f)),r(f?e(f):null)},[e,i]),[a,c]=KE(o);return S.useMemo(()=>({nodeRef:a,rect:n,setRef:c}),[n,a,c])}const VIe=[{sensor:j$,options:{}},{sensor:M$,options:{}}],qIe={current:{}},fC={draggable:{measure:_U},droppable:{measure:_U,strategy:ty.WhileDragging,frequency:TO.Optimized},dragOverlay:{measure:zy}};class D0 extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,r;return(n=(r=this.get(e))==null?void 0:r.node.current)!=null?n:void 0}}const WIe={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new D0,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ZE},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:fC,measureDroppableContainers:ZE,windowRect:null,measuringScheduled:!1},WJ={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ZE,draggableNodes:new Map,over:null,measureDroppableContainers:ZE},G_=S.createContext(WJ),GJ=S.createContext(WIe);function GIe(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new D0}}}function KIe(t,e){switch(e.type){case Vr.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case Vr.DragMove:return t.draggable.active?{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}}:t;case Vr.DragEnd:case Vr.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Vr.RegisterDroppable:{const{element:n}=e,{id:r}=n,s=new D0(t.droppable.containers);return s.set(r,n),{...t,droppable:{...t.droppable,containers:s}}}case Vr.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=e,i=t.droppable.containers.get(n);if(!i||r!==i.key)return t;const o=new D0(t.droppable.containers);return o.set(n,{...i,disabled:s}),{...t,droppable:{...t.droppable,containers:o}}}case Vr.UnregisterDroppable:{const{id:n,key:r}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const i=new D0(t.droppable.containers);return i.delete(n),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function YIe(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:s}=S.useContext(G_),i=YE(r),o=YE(n==null?void 0:n.id);return S.useEffect(()=>{if(!e&&!r&&i&&o!=null){if(!CP(i)||document.activeElement===i.target)return;const a=s.get(o);if(!a)return;const{activatorNode:c,node:d}=a;if(!c.current&&!d.current)return;requestAnimationFrame(()=>{for(const f of[c.current,d.current]){if(!f)continue;const l=Vje(f);if(l){l.focus();break}}})}},[r,e,s,o,i]),null}function KJ(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((s,i)=>i({transform:s,...r}),n):n}function XIe(t){return S.useMemo(()=>({draggable:{...fC.draggable,...t==null?void 0:t.draggable},droppable:{...fC.droppable,...t==null?void 0:t.droppable},dragOverlay:{...fC.dragOverlay,...t==null?void 0:t.dragOverlay}}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function QIe(t){let{activeNode:e,measure:n,initialRect:r,config:s=!0}=t;const i=S.useRef(!1),{x:o,y:a}=typeof s=="boolean"?{x:s,y:s}:s;ua(()=>{if(!o&&!a||!e){i.current=!1;return}if(i.current||!r)return;const d=e==null?void 0:e.node.current;if(!d||d.isConnected===!1)return;const f=n(d),l=DJ(f,r);if(o||(l.x=0),a||(l.y=0),i.current=!0,Math.abs(l.x)>0||Math.abs(l.y)>0){const u=OJ(d);u&&u.scrollBy({top:l.y,left:l.x})}},[e,o,a,r,n])}const AP=S.createContext({...el,scaleX:1,scaleY:1});var sd;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(sd||(sd={}));const ZIe=S.memo(function(e){var n,r,s,i;let{id:o,accessibility:a,autoScroll:c=!0,children:d,sensors:f=VIe,collisionDetection:l=lIe,measuring:u,modifiers:p,...h}=e;const m=S.useReducer(KIe,void 0,GIe),[y,g]=m,[v,b]=Xje(),[_,A]=S.useState(sd.Uninitialized),P=_===sd.Initialized,{draggable:{active:T,nodes:E,translate:N},droppable:{containers:k}}=y,M=T?E.get(T):null,j=S.useRef({initial:null,translated:null}),I=S.useMemo(()=>{var St;return T!=null?{id:T,data:(St=M==null?void 0:M.data)!=null?St:qIe,rect:j}:null},[T,M]),L=S.useRef(null),[H,K]=S.useState(null),[V,U]=S.useState(null),Q=wx(h,Object.values(h)),te=W_("DndDescribedBy",o),X=S.useMemo(()=>k.getEnabled(),[k]),G=XIe(u),{droppableRects:Y,measureDroppableContainers:Z,measuringScheduled:he}=MIe(X,{dragging:P,dependencies:[N.x,N.y],config:G.droppable}),fe=kIe(E,T),ce=S.useMemo(()=>V?QE(V):null,[V]),xe=Nt(),Pe=OIe(fe,G.draggable.measure);QIe({activeNode:T?E.get(T):null,config:xe.layoutShiftCompensation,initialRect:Pe,measure:G.draggable.measure});const pe=RU(fe,G.draggable.measure,Pe),Le=RU(fe?fe.parentElement:null),Me=S.useRef({activatorEvent:null,active:null,activeNode:fe,collisionRect:null,collisions:null,droppableRects:Y,draggableNodes:E,draggingNode:null,draggingNodeRect:null,droppableContainers:k,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Oe=k.getNodeFor((n=Me.current.over)==null?void 0:n.id),Fe=HIe({measure:G.dragOverlay.measure}),ot=(r=Fe.nodeRef.current)!=null?r:fe,nt=P?(s=Fe.rect)!=null?s:pe:null,At=!!(Fe.nodeRef.current&&Fe.rect),ee=LIe(At?null:pe),de=VJ(ot?ui(ot):null),me=$Ie(P?Oe??fe:null),Re=UIe(me),Ne=KJ(p,{transform:{x:N.x-ee.x,y:N.y-ee.y,scaleX:1,scaleY:1},activatorEvent:V,active:I,activeNodeRect:pe,containerNodeRect:Le,draggingNodeRect:nt,over:Me.current.over,overlayNodeRect:Fe.rect,scrollableAncestors:me,scrollableAncestorRects:Re,windowRect:de}),Ee=ce?xg(ce,N):null,Ve=FIe(me),tt=NU(Ve),qt=NU(Ve,[pe]),gt=xg(Ne,tt),kt=nt?dIe(nt,Ne):null,an=I&&kt?l({active:I,collisionRect:kt,droppableRects:Y,droppableContainers:X,pointerCoordinates:Ee}):null,gr=iIe(an,"id"),[_n,di]=S.useState(null),or=At?Ne:xg(Ne,qt),fi=cIe(or,(i=_n==null?void 0:_n.rect)!=null?i:null,pe),$e=S.useCallback((St,Wt)=>{let{sensor:Zt,options:ar}=Wt;if(L.current==null)return;const Nn=E.get(L.current);if(!Nn)return;const Cr=St.nativeEvent,Dr=new Zt({active:L.current,activeNode:Nn,event:Cr,options:ar,context:Me,onStart(Yr){const sc=L.current;if(sc==null)return;const pa=E.get(sc);if(!pa)return;const{onDragStart:re}=Q.current,ae={active:{id:sc,data:pa.data,rect:j}};rs.unstable_batchedUpdates(()=>{re==null||re(ae),A(sd.Initializing),g({type:Vr.DragStart,initialCoordinates:Yr,active:sc}),v({type:"onDragStart",event:ae})})},onMove(Yr){g({type:Vr.DragMove,coordinates:Yr})},onEnd:Vi(Vr.DragEnd),onCancel:Vi(Vr.DragCancel)});rs.unstable_batchedUpdates(()=>{K(Dr),U(St.nativeEvent)});function Vi(Yr){return async function(){const{active:pa,collisions:re,over:ae,scrollAdjustedTranslate:ge}=Me.current;let _e=null;if(pa&&ge){const{cancelDrop:ze}=Q.current;_e={activatorEvent:Cr,active:pa,collisions:re,delta:ge,over:ae},Yr===Vr.DragEnd&&typeof ze=="function"&&await Promise.resolve(ze(_e))&&(Yr=Vr.DragCancel)}L.current=null,rs.unstable_batchedUpdates(()=>{g({type:Yr}),A(sd.Uninitialized),di(null),K(null),U(null);const ze=Yr===Vr.DragEnd?"onDragEnd":"onDragCancel";if(_e){const Ge=Q.current[ze];Ge==null||Ge(_e),v({type:ze,event:_e})}})}}},[E]),Ye=S.useCallback((St,Wt)=>(Zt,ar)=>{const Nn=Zt.nativeEvent,Cr=E.get(ar);if(L.current!==null||!Cr||Nn.dndKit||Nn.defaultPrevented)return;const Dr={active:Cr};St(Zt,Wt.options,Dr)===!0&&(Nn.dndKit={capturedBy:Wt.sensor},L.current=ar,$e(Zt,Wt))},[E,$e]),ht=DIe(f,Ye);zIe(f),ua(()=>{pe&&_===sd.Initializing&&A(sd.Initialized)},[pe,_]),S.useEffect(()=>{const{onDragMove:St}=Q.current,{active:Wt,activatorEvent:Zt,collisions:ar,over:Nn}=Me.current;if(!Wt||!Zt)return;const Cr={active:Wt,activatorEvent:Zt,collisions:ar,delta:{x:gt.x,y:gt.y},over:Nn};rs.unstable_batchedUpdates(()=>{St==null||St(Cr),v({type:"onDragMove",event:Cr})})},[gt.x,gt.y]),S.useEffect(()=>{const{active:St,activatorEvent:Wt,collisions:Zt,droppableContainers:ar,scrollAdjustedTranslate:Nn}=Me.current;if(!St||L.current==null||!Wt||!Nn)return;const{onDragOver:Cr}=Q.current,Dr=ar.get(gr),Vi=Dr&&Dr.rect.current?{id:Dr.id,rect:Dr.rect.current,data:Dr.data,disabled:Dr.disabled}:null,Yr={active:St,activatorEvent:Wt,collisions:Zt,delta:{x:Nn.x,y:Nn.y},over:Vi};rs.unstable_batchedUpdates(()=>{di(Vi),Cr==null||Cr(Yr),v({type:"onDragOver",event:Yr})})},[gr]),ua(()=>{Me.current={activatorEvent:V,active:I,activeNode:fe,collisionRect:kt,collisions:an,droppableRects:Y,draggableNodes:E,draggingNode:ot,draggingNodeRect:nt,droppableContainers:k,over:_n,scrollableAncestors:me,scrollAdjustedTranslate:gt},j.current={initial:nt,translated:kt}},[I,fe,an,kt,E,ot,nt,Y,k,_n,me,gt]),PIe({...xe,delta:N,draggingRect:kt,pointerCoordinates:Ee,scrollableAncestors:me,scrollableAncestorRects:Re});const Ze=S.useMemo(()=>({active:I,activeNode:fe,activeNodeRect:pe,activatorEvent:V,collisions:an,containerNodeRect:Le,dragOverlay:Fe,draggableNodes:E,droppableContainers:k,droppableRects:Y,over:_n,measureDroppableContainers:Z,scrollableAncestors:me,scrollableAncestorRects:Re,measuringConfiguration:G,measuringScheduled:he,windowRect:de}),[I,fe,pe,V,an,Le,Fe,E,k,Y,_n,Z,me,Re,G,he,de]),yt=S.useMemo(()=>({activatorEvent:V,activators:ht,active:I,activeNodeRect:pe,ariaDescribedById:{draggable:te},dispatch:g,draggableNodes:E,over:_n,measureDroppableContainers:Z}),[V,ht,I,pe,g,te,E,_n,Z]);return oe.createElement(kJ.Provider,{value:b},oe.createElement(G_.Provider,{value:yt},oe.createElement(GJ.Provider,{value:Ze},oe.createElement(AP.Provider,{value:fi},d)),oe.createElement(YIe,{disabled:(a==null?void 0:a.restoreFocus)===!1})),oe.createElement(Jje,{...a,hiddenTextDescribedById:te}));function Nt(){const St=(H==null?void 0:H.autoScrollEnabled)===!1,Wt=typeof c=="object"?c.enabled===!1:c===!1,Zt=P&&!St&&!Wt;return typeof c=="object"?{...c,enabled:Zt}:{enabled:Zt}}}),JIe=S.createContext(null),TU="button",eLe="Droppable";function tLe(t){let{id:e,data:n,disabled:r=!1,attributes:s}=t;const i=W_(eLe),{activators:o,activatorEvent:a,active:c,activeNodeRect:d,ariaDescribedById:f,draggableNodes:l,over:u}=S.useContext(G_),{role:p=TU,roleDescription:h="draggable",tabIndex:m=0}=s??{},y=(c==null?void 0:c.id)===e,g=S.useContext(y?AP:JIe),[v,b]=KE(),[_,A]=KE(),P=BIe(o,e),T=wx(n);ua(()=>(l.set(e,{id:e,key:i,node:v,activatorNode:_,data:T}),()=>{const N=l.get(e);N&&N.key===i&&l.delete(e)}),[l,e]);const E=S.useMemo(()=>({role:p,tabIndex:m,"aria-disabled":r,"aria-pressed":y&&p===TU?!0:void 0,"aria-roledescription":h,"aria-describedby":f.draggable}),[r,p,m,y,h,f.draggable]);return{active:c,activatorEvent:a,activeNodeRect:d,attributes:E,isDragging:y,listeners:r?void 0:P,node:v,over:u,setNodeRef:b,setActivatorNodeRef:A,transform:g}}function YJ(){return S.useContext(GJ)}const nLe="Droppable",rLe={timeout:25};function sLe(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:s}=t;const i=W_(nLe),{active:o,dispatch:a,over:c,measureDroppableContainers:d}=S.useContext(G_),f=S.useRef({disabled:n}),l=S.useRef(!1),u=S.useRef(null),p=S.useRef(null),{disabled:h,updateMeasurementsFor:m,timeout:y}={...rLe,...s},g=wx(m??r),v=S.useCallback(()=>{if(!l.current){l.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{d(Array.isArray(g.current)?g.current:[g.current]),p.current=null},y)},[y]),b=EP({callback:v,disabled:h||!o}),_=S.useCallback((E,N)=>{b&&(N&&(b.unobserve(N),l.current=!1),E&&b.observe(E))},[b]),[A,P]=KE(_),T=wx(e);return S.useEffect(()=>{!b||!A.current||(b.disconnect(),l.current=!1,b.observe(A.current))},[A,b]),ua(()=>(a({type:Vr.RegisterDroppable,element:{id:r,key:i,disabled:n,node:A,rect:u,data:T}}),()=>a({type:Vr.UnregisterDroppable,key:i,id:r})),[r]),S.useEffect(()=>{n!==f.current.disabled&&(a({type:Vr.SetDroppableDisabled,id:r,key:i,disabled:n}),f.current.disabled=n)},[r,i,n,a]),{active:o,rect:u,isOver:(c==null?void 0:c.id)===r,node:A,over:c,setNodeRef:P}}function iLe(t){let{animation:e,children:n}=t;const[r,s]=S.useState(null),[i,o]=S.useState(null),a=YE(n);return!n&&!r&&a&&s(a),ua(()=>{if(!i)return;const c=r==null?void 0:r.key,d=r==null?void 0:r.props.id;if(c==null||d==null){s(null);return}Promise.resolve(e(d,i)).then(()=>{s(null)})},[e,r,i]),oe.createElement(oe.Fragment,null,n,r?S.cloneElement(r,{ref:o}):null)}const oLe={x:0,y:0,scaleX:1,scaleY:1};function aLe(t){let{children:e}=t;return oe.createElement(G_.Provider,{value:WJ},oe.createElement(AP.Provider,{value:oLe},e))}const lLe={position:"fixed",touchAction:"none"},cLe=t=>CP(t)?"transform 250ms ease":void 0,uLe=S.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:s,children:i,className:o,rect:a,style:c,transform:d,transition:f=cLe}=t;if(!a)return null;const l=s?d:{...d,scaleX:1,scaleY:1},u={...lLe,width:a.width,height:a.height,top:a.top,left:a.left,transform:Kl.Transform.toString(l),transformOrigin:s&&r?nIe(r,a):void 0,transition:typeof f=="function"?f(r):f,...c};return oe.createElement(n,{className:o,style:u,ref:e},i)}),dLe=t=>e=>{let{active:n,dragOverlay:r}=e;const s={},{styles:i,className:o}=t;if(i!=null&&i.active)for(const[a,c]of Object.entries(i.active))c!==void 0&&(s[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,c));if(i!=null&&i.dragOverlay)for(const[a,c]of Object.entries(i.dragOverlay))c!==void 0&&r.node.style.setProperty(a,c);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(const[c,d]of Object.entries(s))n.node.style.setProperty(c,d);o!=null&&o.active&&n.node.classList.remove(o.active)}},fLe=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:Kl.Transform.toString(e)},{transform:Kl.Transform.toString(n)}]},kO={duration:250,easing:"ease",keyframes:fLe,sideEffects:dLe({styles:{active:{opacity:"0"}}})};function hLe(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:s}=t;return SP((i,o)=>{if(e===null)return;const a=n.get(i);if(!a)return;const c=a.node.current;if(!c)return;const d=qJ(o);if(!d)return;const{transform:f}=ui(o).getComputedStyle(o),l=MJ(f);if(!l)return;const u=typeof e=="function"?e:pLe(e);return zJ(c,s.draggable.measure),u({active:{id:i,data:a.data,node:c,rect:s.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:o,rect:s.dragOverlay.measure(d)},droppableContainers:r,measuringConfiguration:s,transform:l})})}function pLe(t){const{duration:e,easing:n,sideEffects:r,keyframes:s}={...kO,...t};return i=>{let{active:o,dragOverlay:a,transform:c,...d}=i;if(!e)return;const f={x:a.rect.left-o.rect.left,y:a.rect.top-o.rect.top},l={scaleX:c.scaleX!==1?o.rect.width*c.scaleX/a.rect.width:1,scaleY:c.scaleY!==1?o.rect.height*c.scaleY/a.rect.height:1},u={x:c.x-f.x,y:c.y-f.y,...l},p=s({...d,active:o,dragOverlay:a,transform:{initial:c,final:u}}),[h]=p,m=p[p.length-1];if(JSON.stringify(h)===JSON.stringify(m))return;const y=r==null?void 0:r({active:o,dragOverlay:a,...d}),g=a.node.animate(p,{duration:e,easing:n,fill:"forwards"});return new Promise(v=>{g.onfinish=()=>{y==null||y(),v()}})}}let kU=0;function mLe(t){return S.useMemo(()=>{if(t!=null)return kU++,kU},[t])}const gLe=oe.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:r,style:s,transition:i,modifiers:o,wrapperElement:a="div",className:c,zIndex:d=999}=t;const{activatorEvent:f,active:l,activeNodeRect:u,containerNodeRect:p,draggableNodes:h,droppableContainers:m,dragOverlay:y,over:g,measuringConfiguration:v,scrollableAncestors:b,scrollableAncestorRects:_,windowRect:A}=YJ(),P=S.useContext(AP),T=mLe(l==null?void 0:l.id),E=KJ(o,{activatorEvent:f,active:l,activeNodeRect:u,containerNodeRect:p,draggingNodeRect:y.rect,over:g,overlayNodeRect:y.rect,scrollableAncestors:b,scrollableAncestorRects:_,transform:P,windowRect:A}),N=I$(u),k=hLe({config:r,draggableNodes:h,droppableContainers:m,measuringConfiguration:v}),M=N?y.setRef:void 0;return oe.createElement(aLe,null,oe.createElement(iLe,{animation:k},l&&T?oe.createElement(uLe,{key:T,id:l.id,ref:M,as:a,activatorEvent:f,adjustScale:e,className:c,transition:i,rect:N,style:{zIndex:d,...s},transform:E},n):null))});function XJ(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function vLe(t,e){return t.reduce((n,r,s)=>{const i=e.get(r);return i&&(n[s]=i),n},Array(t.length))}function j1(t){return t!==null&&t>=0}function yLe(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n{let{rects:e,activeIndex:n,overIndex:r,index:s}=t;const i=XJ(e,r,n),o=e[s],a=i[s];return!a||!o?null:{x:a.left-o.left,y:a.top-o.top,scaleX:a.width/o.width,scaleY:a.height/o.height}},I1={scaleX:1,scaleY:1},xLe=t=>{var e;let{activeIndex:n,activeNodeRect:r,index:s,rects:i,overIndex:o}=t;const a=(e=i[n])!=null?e:r;if(!a)return null;if(s===n){const d=i[o];return d?{x:0,y:nn&&s<=o?{x:0,y:-a.height-c,...I1}:s=o?{x:0,y:a.height+c,...I1}:{x:0,y:0,...I1}};function wLe(t,e,n){const r=t[e],s=t[e-1],i=t[e+1];return r?nr.map(P=>typeof P=="object"&&"id"in P?P.id:P),[r]),h=o!=null,m=o?p.indexOf(o.id):-1,y=d?p.indexOf(d.id):-1,g=S.useRef(p),v=!yLe(p,g.current),b=y!==-1&&m===-1||v,_=bLe(i);ua(()=>{v&&h&&f(p)},[v,p,h,f]),S.useEffect(()=>{g.current=p},[p]);const A=S.useMemo(()=>({activeIndex:m,containerId:l,disabled:_,disableTransforms:b,items:p,overIndex:y,useDragOverlay:u,sortedRects:vLe(p,c),strategy:s}),[m,l,_.draggable,_.droppable,b,p,y,c,u,s]);return oe.createElement(JJ.Provider,{value:A},e)}const SLe=t=>{let{id:e,items:n,activeIndex:r,overIndex:s}=t;return XJ(n,r,s).indexOf(e)},eee=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:s,items:i,newIndex:o,previousItems:a,previousContainerId:c,transition:d}=t;return!d||!r||a!==i&&s===o?!1:n?!0:o!==s&&e===c},CLe={duration:200,easing:"ease"},tee="transform",ELe=Kl.Transition.toString({property:tee,duration:0,easing:"linear"}),ALe={roleDescription:"sortable"};function RLe(t){let{disabled:e,index:n,node:r,rect:s}=t;const[i,o]=S.useState(null),a=S.useRef(n);return ua(()=>{if(!e&&n!==a.current&&r.current){const c=s.current;if(c){const d=zy(r.current,{ignoreTransform:!0}),f={x:c.left-d.left,y:c.top-d.top,scaleX:c.width/d.width,scaleY:c.height/d.height};(f.x||f.y)&&o(f)}}n!==a.current&&(a.current=n)},[e,n,r,s]),S.useEffect(()=>{i&&o(null)},[i]),i}function nee(t){let{animateLayoutChanges:e=eee,attributes:n,disabled:r,data:s,getNewIndex:i=SLe,id:o,strategy:a,resizeObserverConfig:c,transition:d=CLe}=t;const{items:f,containerId:l,activeIndex:u,disabled:p,disableTransforms:h,sortedRects:m,overIndex:y,useDragOverlay:g,strategy:v}=S.useContext(JJ),b=PLe(r,p),_=f.indexOf(o),A=S.useMemo(()=>({sortable:{containerId:l,index:_,items:f},...s}),[l,s,_,f]),P=S.useMemo(()=>f.slice(f.indexOf(o)),[f,o]),{rect:T,node:E,isOver:N,setNodeRef:k}=sLe({id:o,data:A,disabled:b.droppable,resizeObserverConfig:{updateMeasurementsFor:P,...c}}),{active:M,activatorEvent:j,activeNodeRect:I,attributes:L,setNodeRef:H,listeners:K,isDragging:V,over:U,setActivatorNodeRef:Q,transform:te}=tLe({id:o,data:A,attributes:{...ALe,...n},disabled:b.draggable}),X=zje(k,H),G=!!M,Y=G&&!h&&j1(u)&&j1(y),Z=!g&&V,he=Z&&Y?te:null,ce=Y?he??(a??v)({rects:m,activeNodeRect:I,activeIndex:u,overIndex:y,index:_}):null,xe=j1(u)&&j1(y)?i({id:o,items:f,activeIndex:u,overIndex:y}):_,Pe=M==null?void 0:M.id,pe=S.useRef({activeId:Pe,items:f,newIndex:xe,containerId:l}),Le=f!==pe.current.items,Me=e({active:M,containerId:l,isDragging:V,isSorting:G,id:o,index:_,items:f,newIndex:pe.current.newIndex,previousItems:pe.current.items,previousContainerId:pe.current.containerId,transition:d,wasDragging:pe.current.activeId!=null}),Oe=RLe({disabled:!Me,index:_,node:E,rect:T});return S.useEffect(()=>{G&&pe.current.newIndex!==xe&&(pe.current.newIndex=xe),l!==pe.current.containerId&&(pe.current.containerId=l),f!==pe.current.items&&(pe.current.items=f)},[G,xe,l,f]),S.useEffect(()=>{if(Pe===pe.current.activeId)return;if(Pe&&!pe.current.activeId){pe.current.activeId=Pe;return}const ot=setTimeout(()=>{pe.current.activeId=Pe},50);return()=>clearTimeout(ot)},[Pe]),{active:M,activeIndex:u,attributes:L,data:A,rect:T,index:_,newIndex:xe,items:f,isOver:N,isSorting:G,isDragging:V,listeners:K,node:E,overIndex:y,over:U,setNodeRef:X,setActivatorNodeRef:Q,setDroppableNodeRef:k,setDraggableNodeRef:H,transform:Oe??ce,transition:Fe()};function Fe(){if(Oe||Le&&pe.current.newIndex===_)return ELe;if(!(Z&&!CP(j)||!d)&&(G||Me))return Kl.Transition.toString({...d,property:tee})}}function PLe(t,e){var n,r;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(n=t==null?void 0:t.draggable)!=null?n:e.draggable,droppable:(r=t==null?void 0:t.droppable)!=null?r:e.droppable}}un.Down,un.Right,un.Up,un.Left;const NLe=({rowId:t,className:e})=>{const{attributes:n,listeners:r,isDragging:s}=nee({id:t});return x.jsxs(Xe,{onClick:i=>{i.preventDefault()},size:"icon",variant:"link",className:ie(s?"cursor-grabbing":"cursor-grab","w-4 h-4 mt-2 text-ring hover:text-muted-foreground",e),...n,...r,children:[x.jsx(_q,{className:"w-4 h-4"}),x.jsx("span",{className:"sr-only",children:"Mover fila"})]})};function TLe(){return{id:"select",header:({table:t})=>x.jsx(lx,{id:"select-all",checked:t.getIsAllPageRowsSelected()||t.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:e=>t.toggleAllPageRowsSelected(!!e),"aria-label":"Seleccionar todo",className:"translate-y-[2px]"}),cell:({row:t})=>x.jsx(lx,{id:`select-row-${t.id}`,checked:t.getIsSelected(),onCheckedChange:e=>{t.toggleSelected(!!e)},"aria-label":"Seleccionar file",className:"translate-y-[2px]"}),enableSorting:!1,enableHiding:!1}}function RP({columnCount:t,rowCount:e=10,searchableColumnCount:n=0,filterableColumnCount:r=0,showViewOptions:s=!0,cellWidths:i=["auto"],withPagination:o=!0,shrinkZero:a=!1,className:c,...d}){return x.jsxs("div",{className:ie("w-full space-y-2.5 overflow-auto",c),...d,children:[x.jsxs("div",{className:"flex items-center justify-between w-full p-1 space-x-2 overflow-auto",children:[x.jsxs("div",{className:"flex items-center flex-1 space-x-2",children:[n>0?Array.from({length:n}).map((f,l)=>x.jsx(bi,{className:"w-40 h-7 lg:w-60"},l)):null,r>0?Array.from({length:r}).map((f,l)=>x.jsx(bi,{className:"h-7 w-[4.5rem] border-dashed"},l)):null]}),s?x.jsx(bi,{className:"ml-auto hidden h-7 w-[4.5rem] lg:flex"}):null]}),x.jsx("div",{className:"border rounded-md",children:x.jsxs(ud,{children:[x.jsx(lP,{children:Array.from({length:1}).map((f,l)=>x.jsx(Jo,{className:"hover:bg-transparent",children:Array.from({length:t}).map((u,p)=>x.jsx(cP,{style:{width:i[p],minWidth:a?i[p]:"auto"},children:x.jsx(bi,{className:"w-full h-6"})},p))},l))}),x.jsx(dd,{children:Array.from({length:e}).map((f,l)=>x.jsx(Jo,{className:"hover:bg-transparent",children:Array.from({length:t}).map((u,p)=>x.jsx(nu,{style:{width:i[p],minWidth:a?i[p]:"auto"},children:x.jsx(bi,{className:"w-full h-6"})},p))},l))})]})}),o?x.jsxs("div",{className:"flex items-center justify-between w-full gap-4 p-1 overflow-auto sm:gap-8",children:[x.jsx(bi,{className:"w-40 h-7 shrink-0"}),x.jsxs("div",{className:"flex items-center gap-4 sm:gap-6 lg:gap-8",children:[x.jsxs("div",{className:"flex items-center space-x-2",children:[x.jsx(bi,{className:"w-24 h-7"}),x.jsx(bi,{className:"h-7 w-[4.5rem]"})]}),x.jsx("div",{className:"flex items-center justify-center text-sm font-medium",children:x.jsx(bi,{className:"w-20 h-7"})}),x.jsxs("div",{className:"flex items-center space-x-2",children:[x.jsx(bi,{className:"hidden size-7 lg:block"}),x.jsx(bi,{className:"size-7"}),x.jsx(bi,{className:"size-7"}),x.jsx(bi,{className:"hidden size-7 lg:block"})]})]})]}):null]})}const PP=({title:t="Esto está muy vacío",subtitle:e="Empieza dando de alta un item",buttonText:n="Nuevo item",onButtonClick:r=()=>{},actions:s=void 0})=>x.jsxs("div",{className:"text-center",children:[x.jsx("svg",{className:"w-12 h-12 mx-auto text-slate-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:x.jsx("path",{vectorEffect:"non-scaling-stroke",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})}),x.jsx("h3",{className:"mt-2 text-lg font-semibold text-slate-900",children:t}),x.jsx("p",{className:"mt-1 text-base text-slate-500",children:e}),x.jsxs("div",{className:"items-center mt-6",children:[s&&x.jsx(x.Fragment,{children:s}),!s&&x.jsxs(Xe,{className:"my-4",onClick:r,children:[x.jsx(Cq,{}),n]})]})]}),Ef=({title:t="Se ha producido un error",subtitle:e=void 0,description:n=void 0,errorMessage:r=void 0})=>{const s=Fs();return x.jsx("div",{className:"grid h-screen place-items-center ",children:x.jsxs("div",{className:"text-center",children:[x.jsx("h2",{className:"mt-2 text-xl font-semibold text-center text-slate-900",children:t}),x.jsxs("p",{className:"mt-1 font-medium text-slate-500",children:[e||r,x.jsx("br",{}),n]}),x.jsxs("div",{className:"mt-6 space-x-8 md:ml-4",children:[x.jsx(P$,{}),x.jsxs(Xe,{onClick:()=>s("/"),children:[x.jsx(_ge,{className:"w-4 h-4 mr-2"})," Ir al inicio"]})]})]})})};Ef.displayName="ErrorOverlay";var En=function(){return En=Object.assign||function(e){for(var n,r=1,s=arguments.length;r1){if(n===0)return t.replace(e,"");if(t.includes(e)){var r=t.split(e),s=r[0],i=r[1];if(i.length===n)return t;if(i.length>n)return"".concat(s).concat(e).concat(i.slice(0,n))}var o=t.length>n?new RegExp("(\\d+)(\\d{".concat(n,"})")):new RegExp("(\\d)(\\d+)"),a=t.match(o);if(a){var s=a[1],i=a[2];return"".concat(s).concat(e).concat(i)}}return t},ree=function(t,e){var n=e.groupSeparator,r=n===void 0?",":n,s=e.decimalSeparator,i=s===void 0?".":s,o=new RegExp("\\d([^".concat(Yl(r)).concat(Yl(i),"0-9]+)")),a=t.match(o);return a?a[1]:void 0},Db=function(t){var e=t.value,n=t.decimalSeparator,r=t.intlConfig,s=t.decimalScale,i=t.prefix,o=i===void 0?"":i,a=t.suffix,c=a===void 0?"":a;if(e===""||e===void 0)return"";if(e==="-")return"-";var d=new RegExp("^\\d?-".concat(o?"".concat(Yl(o),"?"):"","\\d")).test(e),f=n!=="."?LLe(e,n,d):e;n&&n!=="-"&&f.startsWith(n)&&(f="0"+f);var l={minimumFractionDigits:s||0,maximumFractionDigits:20},u=r?new Intl.NumberFormat(r.locale,r.currency?En(En({},l),{style:"currency",currency:r.currency}):l):new Intl.NumberFormat(void 0,l),p=u.formatToParts(Number(f)),h=$Le(p,t),m=ree(h,En({},t)),y=e.slice(-1)===n?n:"",g=f.match(RegExp("\\d+\\.(\\d+)"))||[],v=g[1];return s===void 0&&v&&n&&(h.includes(n)?h=h.replace(RegExp("(\\d+)(".concat(Yl(n),")(\\d+)"),"g"),"$1$2".concat(v)):m&&!c?h=h.replace(m,"".concat(n).concat(v).concat(m)):h="".concat(h).concat(n).concat(v)),c&&y?"".concat(h).concat(y).concat(c):m&&y?h.replace(m,"".concat(y).concat(m)):m&&c?h.replace(m,"".concat(y).concat(c)):[h,y,c].join("")},LLe=function(t,e,n){var r=t;return e&&e!=="."&&(r=r.replace(RegExp(Yl(e),"g"),"."),n&&e==="-"&&(r="-".concat(r.slice(1)))),r},$Le=function(t,e){var n=e.prefix,r=e.groupSeparator,s=e.decimalSeparator,i=e.decimalScale,o=e.disableGroupSeparators,a=o===void 0?!1:o;return t.reduce(function(c,d,f){var l=d.type,u=d.value;return f===0&&n?l==="minusSign"?[u,n]:l==="currency"?Ji(Ji([],c,!0),[n],!1):[n,u]:l==="currency"?n?c:Ji(Ji([],c,!0),[u],!1):l==="group"?a?c:Ji(Ji([],c,!0),[r!==void 0?r:u],!1):l==="decimal"?i!==void 0&&i===0?c:Ji(Ji([],c,!0),[s!==void 0?s:u],!1):l==="fraction"?Ji(Ji([],c,!0),[i!==void 0?u.slice(0,i):u],!1):Ji(Ji([],c,!0),[u],!1)},[""]).join("")},FLe={currencySymbol:"",groupSeparator:"",decimalSeparator:"",prefix:"",suffix:""},zLe=function(t){var e=t||{},n=e.locale,r=e.currency,s=n?new Intl.NumberFormat(n,r?{currency:r,style:"currency"}:void 0):new Intl.NumberFormat;return s.formatToParts(1000.1).reduce(function(i,o,a){return o.type==="currency"?a===0?En(En({},i),{currencySymbol:o.value,prefix:o.value}):En(En({},i),{currencySymbol:o.value,suffix:o.value}):o.type==="group"?En(En({},i),{groupSeparator:o.value}):o.type==="decimal"?En(En({},i),{decimalSeparator:o.value}):i},FLe)},DU=function(t){return RegExp(/\d/,"gi").test(t)},BLe=function(t,e,n){if(e===void 0&&(e="."),n===void 0||t===""||t===void 0)return t;if(!t.match(/\d/g))return"";var r=t.split(e),s=r[0],i=r[1];if(n===0)return s;var o=i||"";if(o.lengthh)){if(Nt===""||Nt==="-"||Nt===fe){y&&y(void 0,a,{float:null,formatted:"",value:""}),Me(Nt),ee(1);return}var St=fe?Nt.replace(fe,"."):Nt,Wt=parseFloat(St),Zt=Db(En({value:Nt},xe));if(yt!=null){var ar=yt+(Zt.length-$e.length);ar=ar<=0?_?_.length:0:ar,ee(ar),Re(me+1)}if(Me(Zt),y){var Nn={float:Wt,formatted:Zt,value:Nt};y(Nt,a,Nn)}}},gt=function($e){var Ye=$e.target,ht=Ye.value,Ze=Ye.selectionStart;qt(ht,Ze),K&&K($e)},kt=function($e){return V&&V($e),Le?Le.length:0},an=function($e){var Ye=$e.target.value,ht=Jk(En({value:Ye},Pe));if(ht==="-"||ht===fe||!ht){Me(""),U&&U($e);return}var Ze=ILe(ht,fe,g),yt=BLe(Ze,fe,b!==void 0?b:g),Nt=parseFloat(yt.replace(fe,".")),St=Db(En(En({},xe),{value:yt}));y&&Y&&y(yt,a,{float:Nt,formatted:St,value:yt}),Me(St),U&&U($e)},gr=function($e){var Ye=$e.key;if(Ve(Ye),T&&(Ye==="ArrowUp"||Ye==="ArrowDown")){$e.preventDefault(),ee(Le.length);var ht=parseFloat(m!=null?String(m).replace(fe,"."):Jk(En({value:Le},Pe)))||0,Ze=Ye==="ArrowUp"?ht+T:ht-T;if(E!==void 0&&ZeNumber(N))return;var yt=String(T).includes(".")?Number(String(T).split(".")[1].length):void 0;qt(String(yt?Ze.toFixed(yt):Ze).replace(".",fe))}Q&&Q($e)},_n=function($e){var Ye=$e.key,ht=$e.currentTarget.selectionStart;if(Ye!=="ArrowUp"&&Ye!=="ArrowDown"&&Le!=="-"){var Ze=ree(Le,{groupSeparator:ce,decimalSeparator:fe});if(Ze&&ht&&ht>Le.length-Ze.length&&tt.current){var yt=Le.length-Ze.length;tt.current.setSelectionRange(yt,yt)}}te&&te($e)};S.useEffect(function(){m==null&&l==null&&Me("")},[l,m]),S.useEffect(function(){Fe&&Le!=="-"&&tt.current&&document.activeElement===tt.current&&tt.current.setSelectionRange(At,At)},[Le,At,tt,Fe,me]);var di=function(){return m!=null&&Le!=="-"&&(!fe||Le!==fe)?Db(En(En({},xe),{decimalScale:Fe?void 0:b,value:String(m)})):Le},or=En({type:"text",inputMode:"decimal",id:o,name:a,className:c,onChange:gt,onBlur:an,onFocus:kt,onKeyDown:gr,onKeyUp:_n,placeholder:v,disabled:p,value:di(),ref:tt},Z);if(d){var fi=d;return oe.createElement(fi,En({},or))}return oe.createElement("input",En({},or))});NP.displayName="CurrencyInput";const Xp=S.forwardRef(({children:t,...e},n)=>{var i;const{error:r}=My();let s=t;return r&&(r.message?s=String((r==null?void 0:r.message)||((i=r.root)==null?void 0:i.message)):r.type==="required"&&(s=ne("common.required_field"))),x.jsx(x9,{ref:n,...e,children:s})});Xp.displayName="FormErrorMessage";const Qp=oe.forwardRef(({label:t,hint:e,required:n,...r},s)=>{const{error:i}=My(),o=e||(n?ne("common.required"):void 0),a=i?"text-destructive font-semibold":"";return x.jsxs(b9,{ref:s,className:"flex justify-between text-sm",...r,children:[x.jsx("span",{className:`block font-semibold ${a}`,children:t}),o&&x.jsx("span",{className:`text-sm font-medium ${a} `,children:o})]})});Qp.displayName="FormLabel";const HLe=li("flex h-10 w-full rounded-md bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border border-input ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ",outline:"focus-visible:border focus-visible:border-input",ghost:"bg-transparent"}},defaultVariants:{variant:"default"}}),hC=S.forwardRef((t,e)=>{const{name:n,label:r,hint:s,description:i,placeholder:o,className:a,disabled:c,defaultValue:d,rules:f,readOnly:l,scale:u,currency:p,language:h,variant:m}=t,{control:y}=Ui(),[g,v]=S.useState(""),b={input:_=>{if(typeof _!="object")return _;const A=ra.create(_);if(A.isFailure)throw A.error;const P=A.object.toString();return g.endsWith(",")?P.replace(/.0$/,","):P},output:(_,A,P)=>{const{value:T}=P??{value:null};v(T??"");const E=ra.createFromFormattedValue(T,p.code);if(E.isFailure)throw E.error;return E.object.toObject()}};return x.jsx(Dy,{defaultValue:d,control:y,name:n,disabled:c,rules:f,render:({field:_})=>x.jsxs(Gp,{ref:e,className:ie(a,"space-y-3"),children:[r&&x.jsx(Qp,{label:r,hint:s,required:!!((f==null?void 0:f.required)??!1)}),x.jsx(Kp,{children:x.jsx(NP,{intlConfig:{locale:h.code},name:_.name,onBlur:_.onBlur,disabled:_.disabled,readOnly:l,className:ie(HLe({variant:m,className:a})),suffix:` ${p==null?void 0:p.symbol}`,groupSeparator:".",decimalSeparator:",",placeholder:o,decimalsLimit:u,decimalScale:u,step:1,value:b.input(_.value),onValueChange:(A,P,T)=>_.onChange(b.output(A,P,T))})}),i&&x.jsx(Yp,{children:i}),x.jsx(Xp,{})]})})});hC.displayName="FormCurrencyField";const see=S.forwardRef((t,e)=>{const{label:n,placeholder:r,hint:s,description:i,required:o,className:a,name:c}=t,{control:d}=Ui(),[f,l]=S.useState(!1);return x.jsx(Dy,{control:d,name:c,rules:{required:o},render:({field:u})=>x.jsxs(Gp,{ref:e,className:ie(a,"flex flex-col"),children:[n&&x.jsx(Qp,{label:n,hint:s,required:o}),x.jsxs(_Te,{open:f,onOpenChange:l,children:[x.jsx(STe,{asChild:!0,children:x.jsx(Kp,{children:x.jsxs(Xe,{variant:"secondary",className:ie("pl-3 text-left font-normal",!u.value&&"text-muted-foreground"),children:[u.value?new Date(u.value).toLocaleDateString():r||x.jsx("span",{children:ne("common.pick_date")}),x.jsx(fge,{className:"w-4 h-4 ml-auto text-"})]})})}),x.jsx($Y,{className:"w-auto p-0",align:"start",children:x.jsx(lG,{className:"bg-background",mode:"single",captionLayout:"buttons",defaultMonth:u.value,selected:new Date(u.value),onSelect:p=>{u.onChange(p),l(!1)},disabled:p=>p{const a=oe.useId(),c=S.useMemo(()=>e||n||r,[e,n,r]);return x.jsxs(xr,{id:a,className:ie(c?"":"pt-6",t),ref:o,children:[c&&x.jsxs(Ei,{className:"flex flex-row flex-wrap items-center justify-between sm:flex-nowrap",children:[x.jsxs("div",{children:[e&&x.jsx(ns,{className:"text-lg leading-normal",children:e}),n&&x.jsx(vs,{className:"leading-loose",children:n})]}),r&&x.jsx("div",{className:"flex-shrink-0",children:r})]}),x.jsx(wr,{className:"grid items-start gap-6",children:i}),s&&x.jsx(Ko,{className:"px-6 py-4 border-t",style:{borderStyle:"inherit"},children:s})]})});eA.displayName="FormGroup";const VLe=li("flex h-10 w-full rounded-md bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border border-input ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ",outline:"focus-visible:border focus-visible:border-input"}},defaultVariants:{variant:"default"}}),tA=S.forwardRef((t,e)=>{const{name:n,label:r,hint:s,description:i,placeholder:o,className:a,disabled:c,defaultValue:d,rules:f,readOnly:l,scale:u,variant:p}=t,{control:h}=Ui(),[m,y]=S.useState(""),g={input:v=>{if(typeof v!="object")return v;const b=uf.create(v);if(b.isFailure)throw b.error;const _=b.object.toString();return m.endsWith(",")?_.replace(/.0$/,","):_},output:(v,b,_)=>{const{value:A}=_??{value:null};y(A??"");const P=uf.createFromFormattedValue(A);if(P.isFailure)throw P.error;return P.object.toObject()}};return x.jsx(Dy,{defaultValue:d,control:h,name:n,disabled:c,rules:{max:100,min:0,...f},render:({field:v})=>x.jsxs(Gp,{ref:e,className:ie(a,"space-y-3"),children:[r&&x.jsx(Qp,{label:r,hint:s,required:!!((f==null?void 0:f.required)??!1)}),x.jsx(Kp,{children:x.jsx(NP,{name:v.name,onBlur:v.onBlur,disabled:v.disabled,readOnly:l,className:ie(VLe({variant:p,className:a})),groupSeparator:".",decimalSeparator:",",placeholder:o,allowDecimals:u!==0,decimalsLimit:u,decimalScale:u,step:1,value:g.input(v.value),onValueChange:(b,_,A)=>v.onChange(g.output(b,_,A))})}),i&&x.jsx(Yp,{children:i}),x.jsx(Xp,{})]})})}),qLe=li("flex h-10 w-full rounded-md bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border border-input ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ",outline:"focus-visible:border focus-visible:border-input"}},defaultVariants:{variant:"default"}}),WLe=S.forwardRef((t,e)=>{const{name:n,label:r,hint:s,description:i,placeholder:o,className:a,disabled:c,defaultValue:d,rules:f,readOnly:l,scale:u,variant:p}=t,{control:h}=Ui(),[m,y]=S.useState(""),g={input:v=>{if(typeof v!="object")return v;const b=Dp.create(v);if(b.isFailure)throw b.error;const _=b.object.toString();return m.endsWith(",")?_.replace(/.0$/,","):_},output:(v,b,_)=>{const{value:A}=_??{value:null};y(A??"");const P=Dp.createFromFormattedValue(A);if(P.isFailure)throw P.error;return P.object.toObject()}};return x.jsx(Dy,{defaultValue:d,control:h,name:n,disabled:c,rules:f,render:({field:v})=>x.jsxs(Gp,{ref:e,className:ie(a,"space-y-3"),children:[r&&x.jsx(Qp,{label:r,hint:s,required:!!((f==null?void 0:f.required)??!1)}),x.jsx(Kp,{children:x.jsx(NP,{name:v.name,onBlur:v.onBlur,disabled:v.disabled,readOnly:l,className:ie(qLe({variant:p,className:a})),groupSeparator:".",decimalSeparator:",",placeholder:o,allowDecimals:u!==0,decimalsLimit:u,decimalScale:u,step:1,value:g.input(v.value),onValueChange:(b,_,A)=>v.onChange(g.output(b,_,A))})}),i&&x.jsx(Yp,{children:i}),x.jsx(Xp,{})]})})}),MU=li("",{variants:{variant:{default:"",outline:"border-0 focus-visible:border focus-visible:border-input focus-visible:ring-0 focus-visible:ring-offset-0 "}},defaultVariants:{variant:"default"}}),Ua=S.forwardRef(({name:t,label:e,hint:n,placeholder:r,description:s,required:i,className:o,autoSize:a,variant:c,...d},f)=>{const{control:l}=Ui();return x.jsx(Dy,{control:l,name:t,rules:{required:i},render:({field:u,fieldState:p})=>x.jsxs(Gp,{ref:f,className:ie(o,"flex flex-col space-y-3"),children:[e&&x.jsx(Qp,{label:e,hint:n,required:i}),x.jsx(Kp,{className:"grow",children:a?x.jsx(MW,{placeholder:r,className:ie(p.error?"border-destructive focus-visible:ring-destructive":"","resize-y",MU({variant:c,className:o})),...d,...u}):x.jsx(iZ,{placeholder:r,className:ie(p.error?"border-destructive focus-visible:ring-destructive":"","resize-y",MU({variant:c,className:o})),...d,...u})}),s&&x.jsx(Yp,{children:s}),x.jsx(Xp,{})]})})}),GLe=li("",{variants:{variant:{default:"",ghost:"border-0 focus-visible:border focus-visible:border-input focus-visible:ring-0 focus-visible:ring-offset-0 "}},defaultVariants:{variant:"default"}}),ah=S.forwardRef((t,e)=>{const{name:n,label:r,hint:s,description:i,placeholder:o,className:a,disabled:c,defaultValue:d,rules:f,type:l,variant:u,required:p,button:h,leadIcon:m,trailIcon:y}=t,{control:g}=Ui();return x.jsx(Dy,{defaultValue:d,control:g,name:n,disabled:c,rules:{required:p,...f},render:({field:v,fieldState:b})=>x.jsxs(Gp,{ref:e,className:ie(a,"space-y-3"),children:[r&&x.jsx(Qp,{label:r,hint:s,required:!!((f==null?void 0:f.required)??p)}),x.jsxs("div",{className:ie(h?"flex":null),children:[x.jsxs("div",{className:ie(m?"relative flex items-stretch flex-grow focus-within:z-10":""),children:[m&&x.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:S.createElement(m,{className:"h-5 w-5 text-muted-foreground","aria-hidden":!0},null)}),x.jsx(Kp,{className:ie("block",m?"pl-10":"",y?"pr-10":""),children:x.jsx(KR,{type:l,placeholder:o,className:ie(b.error?"border-destructive focus-visible:ring-destructive":"",GLe({variant:u,className:a})),...v})}),y&&x.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pl-3 pointer-events-none",children:S.createElement(y,{className:"h-5 w-5 text-muted-foreground","aria-hidden":!0},null)})]}),h&&x.jsx(x.Fragment,{children:S.createElement(h)})]}),i&&x.jsx(Yp,{children:i}),x.jsx(Xp,{})]})})}),By=({className:t,children:e})=>x.jsx(Lne,{children:x.jsx("div",{className:ie("flex flex-col w-full min-h-screen",t),children:e})});By.displayName="Layout";const Uy=({className:t,children:e})=>x.jsxs(x.Fragment,{children:[x.jsx("main",{className:ie("flex min-h-[calc(100vh_-_theme(spacing.36))] flex-1 flex-col gap-4 bg-muted/40 p-4 md:gap-8 md:p-10",t),children:e}),x.jsx(TZ,{})]});Uy.displayName="LayoutContent";const OU=(t,e,n)=>{if(t&&"reportValidity"in t){const r=je(n,e);t.setCustomValidity(r&&r.message||""),t.reportValidity()}},iee=(t,e)=>{for(const n in e.fields){const r=e.fields[n];r&&r.ref&&"reportValidity"in r.ref?OU(r.ref,n,t):r.refs&&r.refs.forEach(s=>OU(s,n,t))}},KLe=(t,e)=>{e.shouldUseNativeValidation&&iee(t,e);const n={};for(const r in t){const s=je(e.fields,r),i=Object.assign(t[r]||{},{ref:s&&s.ref});if(YLe(e.names||Object.keys(t),r)){const o=Object.assign({},je(n,r));sn(o,"root",i),sn(n,r,o)}else sn(n,r,i)}return n},YLe=(t,e)=>t.some(n=>n.startsWith(e+"."));var L$=function(t,e,n){return e===void 0&&(e={abortEarly:!1}),n===void 0&&(n={}),function(r,s,i){try{var o=function(){return c.error?{values:{},errors:KLe((f=c.error,l=!i.shouldUseNativeValidation&&i.criteriaMode==="all",f.details.length?f.details.reduce(function(u,p){var h=p.path.join(".");if(u[h]||(u[h]={message:p.message,type:p.type}),l){var m=u[h].types,y=m&&m[p.type];u[h]=a9(h,l,u,p.type,y?[].concat(y,p.message):p.message)}return u},{}):{}),i)}:(i.shouldUseNativeValidation&&iee({},i),{errors:{},values:c.value});var f,l},a=Object.assign({},e,{context:s}),c={},d=function(){if(n.mode==="sync")c=t.validate(r,a);else{var f=function(l,u){try{var p=l()}catch(h){return u(h)}return p&&p.then?p.then(void 0,u):p}(function(){return Promise.resolve(t.validateAsync(r,a)).then(function(l){c.value=l})},function(l){c.error=l});if(f&&f.then)return f.then(function(){})}}();return Promise.resolve(d&&d.then?d.then(o):o())}catch(f){return Promise.reject(f)}}},oee={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(self,()=>{return n={7629:(s,i,o)=>{const a=o(375),c=o(8571),d=o(9474),f=o(1687),l=o(8652),u=o(8160),p=o(3292),h=o(6354),m=o(8901),y=o(9708),g=o(6914),v=o(2294),b=o(6133),_=o(1152),A=o(8863),P=o(2036),T={Base:class{constructor(E){this.type=E,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new v.Ids,this._preferences=null,this._refs=new b.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return a(typeof y.describe=="function","Manifest functionality disabled"),y.describe(this)}allow(...E){return u.verifyFlat(E,"allow"),this._values(E,"_valids")}alter(E){a(E&&typeof E=="object"&&!Array.isArray(E),"Invalid targets argument"),a(!this._inRuleset(),"Cannot set alterations inside a ruleset");const N=this.clone();N.$_terms.alterations=N.$_terms.alterations||[];for(const k in E){const M=E[k];a(typeof M=="function","Alteration adjuster for",k,"must be a function"),N.$_terms.alterations.push({target:k,adjuster:M})}return N.$_temp.ruleset=!1,N}artifact(E){return a(E!==void 0,"Artifact cannot be undefined"),a(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",E)}cast(E){return a(E===!1||typeof E=="string","Invalid to value"),a(E===!1||this._definition.cast[E],"Type",this.type,"does not support casting to",E),this.$_setFlag("cast",E===!1?void 0:E)}default(E,N){return this._default("default",E,N)}description(E){return a(E&&typeof E=="string","Description must be a non-empty string"),this.$_setFlag("description",E)}empty(E){const N=this.clone();return E!==void 0&&(E=N.$_compile(E,{override:!1})),N.$_setFlag("empty",E,{clone:!1})}error(E){return a(E,"Missing error"),a(E instanceof Error||typeof E=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",E)}example(E,N={}){return a(E!==void 0,"Missing example"),u.assertOptions(N,["override"]),this._inner("examples",E,{single:!0,override:N.override})}external(E,N){return typeof E=="object"&&(a(!N,"Cannot combine options with description"),N=E.description,E=E.method),a(typeof E=="function","Method must be a function"),a(N===void 0||N&&typeof N=="string","Description must be a non-empty string"),this._inner("externals",{method:E,description:N},{single:!0})}failover(E,N){return this._default("failover",E,N)}forbidden(){return this.presence("forbidden")}id(E){return E?(a(typeof E=="string","id must be a non-empty string"),a(/^[^\.]+$/.test(E),"id cannot contain period character"),this.$_setFlag("id",E)):this.$_setFlag("id",void 0)}invalid(...E){return this._values(E,"_invalids")}label(E){return a(E&&typeof E=="string","Label name must be a non-empty string"),this.$_setFlag("label",E)}meta(E){return a(E!==void 0,"Meta cannot be undefined"),this._inner("metas",E,{single:!0})}note(...E){a(E.length,"Missing notes");for(const N of E)a(N&&typeof N=="string","Notes must be non-empty strings");return this._inner("notes",E)}only(E=!0){return a(typeof E=="boolean","Invalid mode:",E),this.$_setFlag("only",E)}optional(){return this.presence("optional")}prefs(E){a(E,"Missing preferences"),a(E.context===void 0,"Cannot override context"),a(E.externals===void 0,"Cannot override externals"),a(E.warnings===void 0,"Cannot override warnings"),a(E.debug===void 0,"Cannot override debug"),u.checkPreferences(E);const N=this.clone();return N._preferences=u.preferences(N._preferences,E),N}presence(E){return a(["optional","required","forbidden"].includes(E),"Unknown presence mode",E),this.$_setFlag("presence",E)}raw(E=!0){return this.$_setFlag("result",E?"raw":void 0)}result(E){return a(["raw","strip"].includes(E),"Unknown result mode",E),this.$_setFlag("result",E)}required(){return this.presence("required")}strict(E){const N=this.clone(),k=E!==void 0&&!E;return N._preferences=u.preferences(N._preferences,{convert:k}),N}strip(E=!0){return this.$_setFlag("result",E?"strip":void 0)}tag(...E){a(E.length,"Missing tags");for(const N of E)a(N&&typeof N=="string","Tags must be non-empty strings");return this._inner("tags",E)}unit(E){return a(E&&typeof E=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",E)}valid(...E){u.verifyFlat(E,"valid");const N=this.allow(...E);return N.$_setFlag("only",!!N._valids,{clone:!1}),N}when(E,N){const k=this.clone();k.$_terms.whens||(k.$_terms.whens=[]);const M=p.when(k,E,N);if(!["any","link"].includes(k.type)){const j=M.is?[M]:M.switch;for(const I of j)a(!I.then||I.then.type==="any"||I.then.type===k.type,"Cannot combine",k.type,"with",I.then&&I.then.type),a(!I.otherwise||I.otherwise.type==="any"||I.otherwise.type===k.type,"Cannot combine",k.type,"with",I.otherwise&&I.otherwise.type)}return k.$_terms.whens.push(M),k.$_mutateRebuild()}cache(E){a(!this._inRuleset(),"Cannot set caching inside a ruleset"),a(!this._cache,"Cannot override schema cache"),a(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const N=this.clone();return N._cache=E||l.provider.provision(),N.$_temp.ruleset=!1,N}clone(){const E=Object.create(Object.getPrototypeOf(this));return this._assign(E)}concat(E){a(u.isSchema(E),"Invalid schema object"),a(this.type==="any"||E.type==="any"||E.type===this.type,"Cannot merge type",this.type,"with another type:",E.type),a(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),a(!E._inRuleset(),"Cannot concatenate a schema with open ruleset");let N=this.clone();if(this.type==="any"&&E.type!=="any"){const k=E.clone();for(const M of Object.keys(N))M!=="type"&&(k[M]=N[M]);N=k}N._ids.concat(E._ids),N._refs.register(E,b.toSibling),N._preferences=N._preferences?u.preferences(N._preferences,E._preferences):E._preferences,N._valids=P.merge(N._valids,E._valids,E._invalids),N._invalids=P.merge(N._invalids,E._invalids,E._valids);for(const k of E._singleRules.keys())N._singleRules.has(k)&&(N._rules=N._rules.filter(M=>M.keep||M.name!==k),N._singleRules.delete(k));for(const k of E._rules)E._definition.rules[k.method].multi||N._singleRules.set(k.name,k),N._rules.push(k);if(N._flags.empty&&E._flags.empty){N._flags.empty=N._flags.empty.concat(E._flags.empty);const k=Object.assign({},E._flags);delete k.empty,f(N._flags,k)}else if(E._flags.empty){N._flags.empty=E._flags.empty;const k=Object.assign({},E._flags);delete k.empty,f(N._flags,k)}else f(N._flags,E._flags);for(const k in E.$_terms){const M=E.$_terms[k];M?N.$_terms[k]?N.$_terms[k]=N.$_terms[k].concat(M):N.$_terms[k]=M.slice():N.$_terms[k]||(N.$_terms[k]=M)}return this.$_root._tracer&&this.$_root._tracer._combine(N,[this,E]),N.$_mutateRebuild()}extend(E){return a(!E.base,"Cannot extend type with another base"),m.type(this,E)}extract(E){return E=Array.isArray(E)?E:E.split("."),this._ids.reach(E)}fork(E,N){a(!this._inRuleset(),"Cannot fork inside a ruleset");let k=this;for(let M of[].concat(E))M=Array.isArray(M)?M:M.split("."),k=k._ids.fork(M,N,k);return k.$_temp.ruleset=!1,k}rule(E){const N=this._definition;u.assertOptions(E,Object.keys(N.modifiers)),a(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const k=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;a(k>=0&&kk.tailor(E),ref:!1}),N.$_temp.ruleset=!1,N.$_mutateRebuild()}tracer(){return _.location?_.location(this):this}validate(E,N){return A.entry(E,this,N)}validateAsync(E,N){return A.entryAsync(E,this,N)}$_addRule(E){typeof E=="string"&&(E={name:E}),a(E&&typeof E=="object","Invalid options"),a(E.name&&typeof E.name=="string","Invalid rule name");for(const I in E)a(I[0]!=="_","Cannot set private rule properties");const N=Object.assign({},E);N._resolve=[],N.method=N.method||N.name;const k=this._definition.rules[N.method],M=N.args;a(k,"Unknown rule",N.method);const j=this.clone();if(M){a(Object.keys(M).length===1||Object.keys(M).length===this._definition.rules[N.name].args.length,"Invalid rule definition for",this.type,N.name);for(const I in M){let L=M[I];if(k.argsByName){const H=k.argsByName.get(I);if(H.ref&&u.isResolvable(L))N._resolve.push(I),j.$_mutateRegister(L);else if(H.normalize&&(L=H.normalize(L),M[I]=L),H.assert){const K=u.validateArg(L,I,H);a(!K,K,"or reference")}}L!==void 0?M[I]=L:delete M[I]}}return k.multi||(j._ruleRemove(N.name,{clone:!1}),j._singleRules.set(N.name,N)),j.$_temp.ruleset===!1&&(j.$_temp.ruleset=null),k.priority?j._rules.unshift(N):j._rules.push(N),j}$_compile(E,N){return p.schema(this.$_root,E,N)}$_createError(E,N,k,M,j,I={}){const L=I.flags!==!1?this._flags:{},H=I.messages?g.merge(this._definition.messages,I.messages):this._definition.messages;return new h.Report(E,N,k,L,H,M,j)}$_getFlag(E){return this._flags[E]}$_getRule(E){return this._singleRules.get(E)}$_mapLabels(E){return E=Array.isArray(E)?E:E.split("."),this._ids.labels(E)}$_match(E,N,k,M){(k=Object.assign({},k)).abortEarly=!0,k._externals=!1,N.snapshot();const j=!A.validate(E,this,N,k,M).errors;return N.restore(),j}$_modify(E){return u.assertOptions(E,["each","once","ref","schema"]),v.schema(this,E)||this}$_mutateRebuild(){return a(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(E,{source:N,name:k,path:M,key:j})=>{const I=this._definition[N][k]&&this._definition[N][k].register;I!==!1&&this.$_mutateRegister(E,{family:I,key:j})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(E,{family:N,key:k}={}){this._refs.register(E,N),this._ids.register(E,{key:k})}$_property(E){return this._definition.properties[E]}$_reach(E){return this._ids.reach(E)}$_rootReferences(){return this._refs.roots()}$_setFlag(E,N,k={}){a(E[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const M=this._definition.flags[E]||{};if(d(N,M.default)&&(N=void 0),d(N,this._flags[E]))return this;const j=k.clone!==!1?this.clone():this;return N!==void 0?(j._flags[E]=N,j.$_mutateRegister(N)):delete j._flags[E],E[0]!=="_"&&(j.$_temp.ruleset=!1),j}$_parent(E,...N){return this[E][u.symbols.parent].call(this,...N)}$_validate(E,N,k){return A.validate(E,this,N,k)}_assign(E){E.type=this.type,E.$_root=this.$_root,E.$_temp=Object.assign({},this.$_temp),E.$_temp.whens={},E._ids=this._ids.clone(),E._preferences=this._preferences,E._valids=this._valids&&this._valids.clone(),E._invalids=this._invalids&&this._invalids.clone(),E._rules=this._rules.slice(),E._singleRules=c(this._singleRules,{shallow:!0}),E._refs=this._refs.clone(),E._flags=Object.assign({},this._flags),E._cache=null,E.$_terms={};for(const N in this.$_terms)E.$_terms[N]=this.$_terms[N]?this.$_terms[N].slice():null;E.$_super={};for(const N in this.$_super)E.$_super[N]=this._super[N].bind(E);return E}_bare(){const E=this.clone();E._reset();const N=E._definition.terms;for(const k in N){const M=N[k];E.$_terms[k]=M.init}return E.$_mutateRebuild()}_default(E,N,k={}){return u.assertOptions(k,"literal"),a(N!==void 0,"Missing",E,"value"),a(typeof N=="function"||!k.literal,"Only function value supports literal option"),typeof N=="function"&&k.literal&&(N={[u.symbols.literal]:!0,literal:N}),this.$_setFlag(E,N)}_generate(E,N,k){if(!this.$_terms.whens)return{schema:this};const M=[],j=[];for(let H=0;HQ)break}const I=j.join(", ");if(N.mainstay.tracer.debug(N,"rule","when",I),!I)return{schema:this};if(!N.mainstay.tracer.active&&this.$_temp.whens[I])return{schema:this.$_temp.whens[I],id:I};let L=this;this._definition.generate&&(L=this._definition.generate(this,E,N,k));for(const H of M)L=L.concat(H);return this.$_root._tracer&&this.$_root._tracer._combine(L,[this,...M]),this.$_temp.whens[I]=L,{schema:L,id:I}}_inner(E,N,k={}){a(!this._inRuleset(),`Cannot set ${E} inside a ruleset`);const M=this.clone();return M.$_terms[E]&&!k.override||(M.$_terms[E]=[]),k.single?M.$_terms[E].push(N):M.$_terms[E].push(...N),M.$_temp.ruleset=!1,M}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(E,N={}){if(!this._singleRules.has(E))return this;const k=N.clone!==!1?this.clone():this;k._singleRules.delete(E);const M=[];for(let j=0;j{const a=o(375),c=o(8571),d=o(8160),f={max:1e3,supported:new Set(["undefined","boolean","number","string"])};i.provider={provision:l=>new f.Cache(l)},f.Cache=class{constructor(l={}){d.assertOptions(l,["max"]),a(l.max===void 0||l.max&&l.max>0&&isFinite(l.max),"Invalid max cache size"),this._max=l.max||f.max,this._map=new Map,this._list=new f.List}get length(){return this._map.size}set(l,u){if(l!==null&&!f.supported.has(typeof l))return;let p=this._map.get(l);if(p)return p.value=u,void this._list.first(p);p=this._list.unshift({key:l,value:u}),this._map.set(l,p),this._compact()}get(l){const u=this._map.get(l);if(u)return this._list.first(u),c(u.value)}_compact(){if(this._map.size>this._max){const l=this._list.pop();this._map.delete(l.key)}}},f.List=class{constructor(){this.tail=null,this.head=null}unshift(l){return l.next=null,l.prev=this.head,this.head&&(this.head.next=l),this.head=l,this.tail||(this.tail=l),l}first(l){l!==this.head&&(this._remove(l),this.unshift(l))}pop(){return this._remove(this.tail)}_remove(l){const{next:u,prev:p}=l;return u.prev=p,p&&(p.next=u),l===this.tail&&(this.tail=u),l.prev=null,l.next=null,l}}},8160:(s,i,o)=>{const a=o(375),c=o(7916),d=o(5934);let f,l;const u={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};i.version=d.version,i.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1},i.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")},i.assertOptions=function(p,h,m="Options"){a(p&&typeof p=="object"&&!Array.isArray(p),"Options must be of type object");const y=Object.keys(p).filter(g=>!h.includes(g));a(y.length===0,`${m} contain unknown keys: ${y}`)},i.checkPreferences=function(p){l=l||o(3378);const h=l.preferences.validate(p);if(h.error)throw new c([h.error.details[0].message])},i.compare=function(p,h,m){switch(m){case"=":return p===h;case">":return p>h;case"<":return p=":return p>=h;case"<=":return p<=h}},i.default=function(p,h){return p===void 0?h:p},i.isIsoDate=function(p){return u.isoDate.test(p)},i.isNumber=function(p){return typeof p=="number"&&!isNaN(p)},i.isResolvable=function(p){return!!p&&(p[i.symbols.ref]||p[i.symbols.template])},i.isSchema=function(p,h={}){const m=p&&p[i.symbols.any];return!!m&&(a(h.legacy||m.version===i.version,"Cannot mix different versions of joi schemas"),!0)},i.isValues=function(p){return p[i.symbols.values]},i.limit=function(p){return Number.isSafeInteger(p)&&p>=0},i.preferences=function(p,h){f=f||o(6914),p=p||{},h=h||{};const m=Object.assign({},p,h);return h.errors&&p.errors&&(m.errors=Object.assign({},p.errors,h.errors),m.errors.wrap=Object.assign({},p.errors.wrap,h.errors.wrap)),h.messages&&(m.messages=f.compile(h.messages,p.messages)),delete m[i.symbols.prefs],m},i.tryWithPath=function(p,h,m={}){try{return p()}catch(y){throw y.path!==void 0?y.path=h+"."+y.path:y.path=h,m.append&&(y.message=`${y.message} (${y.path})`),y}},i.validateArg=function(p,h,{assert:m,message:y}){if(i.isSchema(m)){const g=m.validate(p);return g.error?g.error.message:void 0}if(!m(p))return h?`${h} ${y}`:y},i.verifyFlat=function(p,h){for(const m of p)a(!Array.isArray(m),"Method no longer accepts array arguments:",h)}},3292:(s,i,o)=>{const a=o(375),c=o(8160),d=o(6133),f={};i.schema=function(l,u,p={}){c.assertOptions(p,["appendPath","override"]);try{return f.schema(l,u,p)}catch(h){throw p.appendPath&&h.path!==void 0&&(h.message=`${h.message} (${h.path})`),h}},f.schema=function(l,u,p){a(u!==void 0,"Invalid undefined schema"),Array.isArray(u)&&(a(u.length,"Invalid empty array schema"),u.length===1&&(u=u[0]));const h=(m,...y)=>p.override!==!1?m.valid(l.override,...y):m.valid(...y);if(f.simple(u))return h(l,u);if(typeof u=="function")return l.custom(u);if(a(typeof u=="object","Invalid schema content:",typeof u),c.isResolvable(u))return h(l,u);if(c.isSchema(u))return u;if(Array.isArray(u)){for(const m of u)if(!f.simple(m))return l.alternatives().try(...u);return h(l,...u)}return u instanceof RegExp?l.string().regex(u):u instanceof Date?h(l.date(),u):(a(Object.getPrototypeOf(u)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),l.object().keys(u))},i.ref=function(l,u){return d.isRef(l)?l:d.create(l,u)},i.compile=function(l,u,p={}){c.assertOptions(p,["legacy"]);const h=u&&u[c.symbols.any];if(h)return a(p.legacy||h.version===c.version,"Cannot mix different versions of joi schemas:",h.version,c.version),u;if(typeof u!="object"||!p.legacy)return i.schema(l,u,{appendPath:!0});const m=f.walk(u);return m?m.compile(m.root,u):i.schema(l,u,{appendPath:!0})},f.walk=function(l){if(typeof l!="object")return null;if(Array.isArray(l)){for(const p of l){const h=f.walk(p);if(h)return h}return null}const u=l[c.symbols.any];if(u)return{root:l[u.root],compile:u.compile};a(Object.getPrototypeOf(l)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const p in l){const h=f.walk(l[p]);if(h)return h}return null},f.simple=function(l){return l===null||["boolean","string","number"].includes(typeof l)},i.when=function(l,u,p){if(p===void 0&&(a(u&&typeof u=="object","Missing options"),p=u,u=d.create(".")),Array.isArray(p)&&(p={switch:p}),c.assertOptions(p,["is","not","then","otherwise","switch","break"]),c.isSchema(u))return a(p.is===void 0,'"is" can not be used with a schema condition'),a(p.not===void 0,'"not" can not be used with a schema condition'),a(p.switch===void 0,'"switch" can not be used with a schema condition'),f.condition(l,{is:u,then:p.then,otherwise:p.otherwise,break:p.break});if(a(d.isRef(u)||typeof u=="string","Invalid condition:",u),a(p.not===void 0||p.is===void 0,'Cannot combine "is" with "not"'),p.switch===void 0){let m=p;p.not!==void 0&&(m={is:p.not,then:p.otherwise,otherwise:p.then,break:p.break});let y=m.is!==void 0?l.$_compile(m.is):l.$_root.invalid(null,!1,0,"").required();return a(m.then!==void 0||m.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),a(m.break===void 0||m.then===void 0||m.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),p.is===void 0||d.isRef(p.is)||c.isSchema(p.is)||(y=y.required()),f.condition(l,{ref:i.ref(u),is:y,then:m.then,otherwise:m.otherwise,break:m.break})}a(Array.isArray(p.switch),'"switch" must be an array'),a(p.is===void 0,'Cannot combine "switch" with "is"'),a(p.not===void 0,'Cannot combine "switch" with "not"'),a(p.then===void 0,'Cannot combine "switch" with "then"');const h={ref:i.ref(u),switch:[],break:p.break};for(let m=0;m{const a=o(5688),c=o(8160),d=o(3328);i.Report=class{constructor(f,l,u,p,h,m,y){if(this.code=f,this.flags=p,this.messages=h,this.path=m.path,this.prefs=y,this.state=m,this.value=l,this.message=null,this.template=null,this.local=u||{},this.local.label=i.label(this.flags,this.state,this.prefs,this.messages),this.value===void 0||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const g=this.path[this.path.length-1];typeof g!="object"&&(this.local.key=g)}}_setTemplate(f){if(this.template=f,!this.flags.label&&this.path.length===0){const l=this._template(this.template,"root");l&&(this.local.label=l)}}toString(){if(this.message)return this.message;const f=this.code;if(!this.prefs.errors.render)return this.code;const l=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return l===void 0?`Error code "${f}" is not defined, your custom type is missing the correct messages definition`:(this.message=l.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(f,l){return i.template(this.value,f,l||this.code,this.state,this.prefs)}},i.path=function(f){let l="";for(const u of f)typeof u!="object"&&(typeof u=="string"?(l&&(l+="."),l+=u):l+=`[${u}]`);return l},i.template=function(f,l,u,p,h){if(!l)return;if(d.isTemplate(l))return u!=="root"?l:null;let m=h.errors.language;if(c.isResolvable(m)&&(m=m.resolve(f,p,h)),m&&l[m]){if(l[m][u]!==void 0)return l[m][u];if(l[m]["*"]!==void 0)return l[m]["*"]}return l[u]?l[u]:l["*"]},i.label=function(f,l,u,p){if(!u.errors.label)return"";if(f.label)return f.label;let h=l.path;return u.errors.label==="key"&&l.path.length>1&&(h=l.path.slice(-1)),i.path(h)||i.template(null,u.messages,"root",l,u)||p&&i.template(null,p,"root",l,u)||"value"},i.process=function(f,l,u){if(!f)return null;const{override:p,message:h,details:m}=i.details(f);if(p)return p;if(u.errors.stack)return new i.ValidationError(h,m,l);const y=Error.stackTraceLimit;Error.stackTraceLimit=0;const g=new i.ValidationError(h,m,l);return Error.stackTraceLimit=y,g},i.details=function(f,l={}){let u=[];const p=[];for(const h of f){if(h instanceof Error){if(l.override!==!1)return{override:h};const y=h.toString();u.push(y),p.push({message:y,type:"override",context:{error:h}});continue}const m=h.toString();u.push(m),p.push({message:m,path:h.path.filter(y=>typeof y!="object"),type:h.code,context:h.local})}return u.length>1&&(u=[...new Set(u)]),{message:u.join(". "),details:p}},i.ValidationError=class extends Error{constructor(f,l,u){super(f),this._original=u,this.details=l}static isError(f){return f instanceof i.ValidationError}},i.ValidationError.prototype.isJoi=!0,i.ValidationError.prototype.name="ValidationError",i.ValidationError.prototype.annotate=a.error},8901:(s,i,o)=>{const a=o(375),c=o(8571),d=o(8160),f=o(6914),l={};i.type=function(u,p){const h=Object.getPrototypeOf(u),m=c(h),y=u._assign(Object.create(m)),g=Object.assign({},p);delete g.base,m._definition=g;const v=h._definition||{};g.messages=f.merge(v.messages,g.messages),g.properties=Object.assign({},v.properties,g.properties),y.type=g.type,g.flags=Object.assign({},v.flags,g.flags);const b=Object.assign({},v.terms);if(g.terms)for(const T in g.terms){const E=g.terms[T];a(y.$_terms[T]===void 0,"Invalid term override for",g.type,T),y.$_terms[T]=E.init,b[T]=E}g.terms=b,g.args||(g.args=v.args),g.prepare=l.prepare(g.prepare,v.prepare),g.coerce&&(typeof g.coerce=="function"&&(g.coerce={method:g.coerce}),g.coerce.from&&!Array.isArray(g.coerce.from)&&(g.coerce={method:g.coerce.method,from:[].concat(g.coerce.from)})),g.coerce=l.coerce(g.coerce,v.coerce),g.validate=l.validate(g.validate,v.validate);const _=Object.assign({},v.rules);if(g.rules)for(const T in g.rules){const E=g.rules[T];a(typeof E=="object","Invalid rule definition for",g.type,T);let N=E.method;if(N===void 0&&(N=function(){return this.$_addRule(T)}),N&&(a(!m[T],"Rule conflict in",g.type,T),m[T]=N),a(!_[T],"Rule conflict in",g.type,T),_[T]=E,E.alias){const k=[].concat(E.alias);for(const M of k)m[M]=E.method}E.args&&(E.argsByName=new Map,E.args=E.args.map(k=>(typeof k=="string"&&(k={name:k}),a(!E.argsByName.has(k.name),"Duplicated argument name",k.name),d.isSchema(k.assert)&&(k.assert=k.assert.strict().label(k.name)),E.argsByName.set(k.name,k),k)))}g.rules=_;const A=Object.assign({},v.modifiers);if(g.modifiers)for(const T in g.modifiers){a(!m[T],"Rule conflict in",g.type,T);const E=g.modifiers[T];a(typeof E=="function","Invalid modifier definition for",g.type,T);const N=function(k){return this.rule({[T]:k})};m[T]=N,A[T]=E}if(g.modifiers=A,g.overrides){m._super=h,y.$_super={};for(const T in g.overrides)a(h[T],"Cannot override missing",T),g.overrides[T][d.symbols.parent]=h[T],y.$_super[T]=h[T].bind(y);Object.assign(m,g.overrides)}g.cast=Object.assign({},v.cast,g.cast);const P=Object.assign({},v.manifest,g.manifest);return P.build=l.build(g.manifest&&g.manifest.build,v.manifest&&v.manifest.build),g.manifest=P,g.rebuild=l.rebuild(g.rebuild,v.rebuild),y},l.build=function(u,p){return u&&p?function(h,m){return p(u(h,m),m)}:u||p},l.coerce=function(u,p){return u&&p?{from:u.from&&p.from?[...new Set([...u.from,...p.from])]:null,method(h,m){let y;if((!p.from||p.from.includes(typeof h))&&(y=p.method(h,m),y)){if(y.errors||y.value===void 0)return y;h=y.value}if(!u.from||u.from.includes(typeof h)){const g=u.method(h,m);if(g)return g}return y}}:u||p},l.prepare=function(u,p){return u&&p?function(h,m){const y=u(h,m);if(y){if(y.errors||y.value===void 0)return y;h=y.value}return p(h,m)||y}:u||p},l.rebuild=function(u,p){return u&&p?function(h){p(h),u(h)}:u||p},l.validate=function(u,p){return u&&p?function(h,m){const y=p(h,m);if(y){if(y.errors&&(!Array.isArray(y.errors)||y.errors.length))return y;h=y.value}return u(h,m)||y}:u||p}},5107:(s,i,o)=>{const a=o(375),c=o(8571),d=o(8652),f=o(8160),l=o(3292),u=o(6354),p=o(8901),h=o(9708),m=o(6133),y=o(3328),g=o(1152);let v;const b={types:{alternatives:o(4946),any:o(8068),array:o(546),boolean:o(4937),date:o(7500),function:o(390),link:o(8785),number:o(3832),object:o(8966),string:o(7417),symbol:o(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const _={_types:new Set(Object.keys(b.types))};for(const A of _._types)_[A]=function(...P){return a(!P.length||["alternatives","link","object"].includes(A),"The",A,"type does not allow arguments"),b.generate(this,b.types[A],P)};for(const A of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])_[A]=function(...P){return this.any()[A](...P)};Object.assign(_,b.methods);for(const A in b.aliases){const P=b.aliases[A];_[A]=_[P]}return _.x=_.expression,g.setup&&g.setup(_),_}};b.methods={ValidationError:u.ValidationError,version:f.version,cache:d.provider,assert(_,A,...P){b.assert(_,A,!0,P)},attempt:(_,A,...P)=>b.assert(_,A,!1,P),build(_){return a(typeof h.build=="function","Manifest functionality disabled"),h.build(this,_)},checkPreferences(_){f.checkPreferences(_)},compile(_,A){return l.compile(this,_,A)},defaults(_){a(typeof _=="function","modifier must be a function");const A=Object.assign({},this);for(const P of A._types){const T=_(A[P]());a(f.isSchema(T),"modifier must return a valid schema object"),A[P]=function(...E){return b.generate(this,T,E)}}return A},expression:(..._)=>new y(..._),extend(..._){f.verifyFlat(_,"extend"),v=v||o(3378),a(_.length,"You need to provide at least one extension"),this.assert(_,v.extensions);const A=Object.assign({},this);A._types=new Set(A._types);for(let P of _){typeof P=="function"&&(P=P(A)),this.assert(P,v.extension);const T=b.expandExtension(P,A);for(const E of T){a(A[E.type]===void 0||A._types.has(E.type),"Cannot override name",E.type);const N=E.base||this.any(),k=p.type(N,E);A._types.add(E.type),A[E.type]=function(...M){return b.generate(this,k,M)}}}return A},isError:u.ValidationError.isError,isExpression:y.isTemplate,isRef:m.isRef,isSchema:f.isSchema,in:(..._)=>m.in(..._),override:f.symbols.override,ref:(..._)=>m.create(..._),types(){const _={};for(const A of this._types)_[A]=this[A]();for(const A in b.aliases)_[A]=this[A]();return _}},b.assert=function(_,A,P,T){const E=T[0]instanceof Error||typeof T[0]=="string"?T[0]:null,N=E!==null?T[1]:T[0],k=A.validate(_,f.preferences({errors:{stack:!0}},N||{}));let M=k.error;if(!M)return k.value;if(E instanceof Error)throw E;const j=P&&typeof M.annotate=="function"?M.annotate():M.message;throw M instanceof u.ValidationError==0&&(M=c(M)),M.message=E?`${E} ${j}`:j,M},b.generate=function(_,A,P){return a(_,"Must be invoked on a Joi instance."),A.$_root=_,A._definition.args&&P.length?A._definition.args(A,...P):A},b.expandExtension=function(_,A){if(typeof _.type=="string")return[_];const P=[];for(const T of A._types)if(_.type.test(T)){const E=Object.assign({},_);E.type=T,E.base=A[T](),P.push(E)}return P},s.exports=b.root()},6914:(s,i,o)=>{const a=o(375),c=o(8571),d=o(3328);i.compile=function(f,l){if(typeof f=="string")return a(!l,"Cannot set single message string"),new d(f);if(d.isTemplate(f))return a(!l,"Cannot set single message template"),f;a(typeof f=="object"&&!Array.isArray(f),"Invalid message options"),l=l?c(l):{};for(let u in f){const p=f[u];if(u==="root"||d.isTemplate(p)){l[u]=p;continue}if(typeof p=="string"){l[u]=new d(p);continue}a(typeof p=="object"&&!Array.isArray(p),"Invalid message for",u);const h=u;for(u in l[h]=l[h]||{},p){const m=p[u];u==="root"||d.isTemplate(m)?l[h][u]=m:(a(typeof m=="string","Invalid message for",u,"in",h),l[h][u]=new d(m))}}return l},i.decompile=function(f){const l={};for(let u in f){const p=f[u];if(u==="root"){l.root=p;continue}if(d.isTemplate(p)){l[u]=p.describe({compact:!0});continue}const h=u;for(u in l[h]={},p){const m=p[u];u!=="root"?l[h][u]=m.describe({compact:!0}):l[h].root=m}}return l},i.merge=function(f,l){if(!f)return i.compile(l);if(!l)return f;if(typeof l=="string")return new d(l);if(d.isTemplate(l))return l;const u=c(f);for(let p in l){const h=l[p];if(p==="root"||d.isTemplate(h)){u[p]=h;continue}if(typeof h=="string"){u[p]=new d(h);continue}a(typeof h=="object"&&!Array.isArray(h),"Invalid message for",p);const m=p;for(p in u[m]=u[m]||{},h){const y=h[p];p==="root"||d.isTemplate(y)?u[m][p]=y:(a(typeof y=="string","Invalid message for",p,"in",m),u[m][p]=new d(y))}}return u}},2294:(s,i,o)=>{const a=o(375),c=o(8160),d=o(6133),f={};i.Ids=f.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const l=new f.Ids;return l._byId=new Map(this._byId),l._byKey=new Map(this._byKey),l._schemaChain=this._schemaChain,l}concat(l){l._schemaChain&&(this._schemaChain=!0);for(const[u,p]of l._byId.entries())a(!this._byKey.has(u),"Schema id conflicts with existing key:",u),this._byId.set(u,p);for(const[u,p]of l._byKey.entries())a(!this._byId.has(u),"Schema key conflicts with existing id:",u),this._byKey.set(u,p)}fork(l,u,p){const h=this._collect(l);h.push({schema:p});const m=h.shift();let y={id:m.id,schema:u(m.schema)};a(c.isSchema(y.schema),"adjuster function failed to return a joi schema type");for(const g of h)y={id:g.id,schema:f.fork(g.schema,y.id,y.schema)};return y.schema}labels(l,u=[]){const p=l[0],h=this._get(p);if(!h)return[...u,...l].join(".");const m=l.slice(1);return u=[...u,h.schema._flags.label||p],m.length?h.schema._ids.labels(m,u):u.join(".")}reach(l,u=[]){const p=l[0],h=this._get(p);a(h,"Schema does not contain path",[...u,...l].join("."));const m=l.slice(1);return m.length?h.schema._ids.reach(m,[...u,p]):h.schema}register(l,{key:u}={}){if(!l||!c.isSchema(l))return;(l.$_property("schemaChain")||l._ids._schemaChain)&&(this._schemaChain=!0);const p=l._flags.id;if(p){const h=this._byId.get(p);a(!h||h.schema===l,"Cannot add different schemas with the same id:",p),a(!this._byKey.has(p),"Schema id conflicts with existing key:",p),this._byId.set(p,{schema:l,id:p})}u&&(a(!this._byKey.has(u),"Schema already contains key:",u),a(!this._byId.has(u),"Schema key conflicts with existing id:",u),this._byKey.set(u,{schema:l,id:u}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(l,u=[],p=[]){const h=l[0],m=this._get(h);a(m,"Schema does not contain path",[...u,...l].join(".")),p=[m,...p];const y=l.slice(1);return y.length?m.schema._ids._collect(y,[...u,h],p):p}_get(l){return this._byId.get(l)||this._byKey.get(l)}},f.fork=function(l,u,p){const h=i.schema(l,{each:(m,{key:y})=>{if(u===(m._flags.id||y))return p},ref:!1});return h?h.$_mutateRebuild():l},i.schema=function(l,u){let p;for(const h in l._flags){if(h[0]==="_")continue;const m=f.scan(l._flags[h],{source:"flags",name:h},u);m!==void 0&&(p=p||l.clone(),p._flags[h]=m)}for(let h=0;h{const a=o(375),c=o(8571),d=o(9621),f=o(8160);let l;const u={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};i.create=function(p,h={}){a(typeof p=="string","Invalid reference key:",p),f.assertOptions(h,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),a(!h.prefix||typeof h.prefix=="object","options.prefix must be of type object");const m=Object.assign({},u.defaults,h);delete m.prefix;const y=m.separator,g=u.context(p,y,h.prefix);if(m.type=g.type,p=g.key,m.type==="value")if(g.root&&(a(!y||p[0]!==y,"Cannot specify relative path with root prefix"),m.ancestor="root",p||(p=null)),y&&y===p)p=null,m.ancestor=0;else if(m.ancestor!==void 0)a(!y||!p||p[0]!==y,"Cannot combine prefix with ancestor option");else{const[v,b]=u.ancestor(p,y);b&&(p=p.slice(b))===""&&(p=null),m.ancestor=v}return m.path=y?p===null?[]:p.split(y):[p],new u.Ref(m)},i.in=function(p,h={}){return i.create(p,{...h,in:!0})},i.isRef=function(p){return!!p&&!!p[f.symbols.ref]},u.Ref=class{constructor(p){a(typeof p=="object","Invalid reference construction"),f.assertOptions(p,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),a([!1,void 0].includes(p.separator)||typeof p.separator=="string"&&p.separator.length===1,"Invalid separator"),a(!p.adjust||typeof p.adjust=="function","options.adjust must be a function"),a(!p.map||Array.isArray(p.map),"options.map must be an array"),a(!p.map||!p.adjust,"Cannot set both map and adjust options"),Object.assign(this,u.defaults,p),a(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(p,h,m,y,g={}){return a(!this.in||g.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(m.context,h,g):this.type==="local"?this._resolve(y,h,g):this.ancestor?this.ancestor==="root"?this._resolve(h.ancestors[h.ancestors.length-1],h,g):(a(this.ancestor<=h.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(h.ancestors[this.ancestor-1],h,g)):this._resolve(p,h,g)}_resolve(p,h,m){let y;if(this.type==="value"&&h.mainstay.shadow&&m.shadow!==!1&&(y=h.mainstay.shadow.get(this.absolute(h))),y===void 0&&(y=d(p,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(y=this.adjust(y)),this.map){const g=this.map.get(y);g!==void 0&&(y=g)}return h.mainstay&&h.mainstay.tracer.resolve(h,this,y),y}toString(){return this.display}absolute(p){return[...p.path.slice(0,-this.ancestor),...this.path]}clone(){return new u.Ref(this)}describe(){const p={path:this.path};this.type!=="value"&&(p.type=this.type),this.separator!=="."&&(p.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(p.ancestor=this.ancestor),this.map&&(p.map=[...this.map]);for(const h of["adjust","iterables","render"])this[h]!==null&&this[h]!==void 0&&(p[h]=this[h]);return this.in!==!1&&(p.in=!0),{ref:p}}updateDisplay(){const p=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${p}`);if(!this.separator)return void(this.display=`ref:${p}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${p}`);if(this.ancestor==="root")return void(this.display=`ref:root:${p}`);if(this.ancestor===1)return void(this.display=`ref:${p||".."}`);const h=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${h}${p||""}`}},u.Ref.prototype[f.symbols.ref]=!0,i.build=function(p){return(p=Object.assign({},u.defaults,p)).type==="value"&&p.ancestor===void 0&&(p.ancestor=1),new u.Ref(p)},u.context=function(p,h,m={}){if(p=p.trim(),m){const y=m.global===void 0?"$":m.global;if(y!==h&&p.startsWith(y))return{key:p.slice(y.length),type:"global"};const g=m.local===void 0?"#":m.local;if(g!==h&&p.startsWith(g))return{key:p.slice(g.length),type:"local"};const v=m.root===void 0?"/":m.root;if(v!==h&&p.startsWith(v))return{key:p.slice(v.length),type:"value",root:!0}}return{key:p,type:"value"}},u.ancestor=function(p,h){if(!h)return[1,0];if(p[0]!==h)return[1,0];if(p[1]!==h)return[0,1];let m=2;for(;p[m]===h;)++m;return[m-1,m]},i.toSibling=0,i.toParent=1,i.Manager=class{constructor(){this.refs=[]}register(p,h){if(p)if(h=h===void 0?i.toParent:h,Array.isArray(p))for(const m of p)this.register(m,h);else if(f.isSchema(p))for(const m of p._refs.refs)m.ancestor-h>=0&&this.refs.push({ancestor:m.ancestor-h,root:m.root});else i.isRef(p)&&p.type==="value"&&p.ancestor-h>=0&&this.refs.push({ancestor:p.ancestor-h,root:p.root}),l=l||o(3328),l.isTemplate(p)&&this.register(p.refs(),h)}get length(){return this.refs.length}clone(){const p=new i.Manager;return p.refs=c(this.refs),p}reset(){this.refs=[]}roots(){return this.refs.filter(p=>!p.ancestor).map(p=>p.root)}}},3378:(s,i,o)=>{const a=o(5107),c={};c.wrap=a.string().min(1).max(2).allow(!1),i.preferences=a.object({allowUnknown:a.boolean(),abortEarly:a.boolean(),artifacts:a.boolean(),cache:a.boolean(),context:a.object(),convert:a.boolean(),dateFormat:a.valid("date","iso","string","time","utc"),debug:a.boolean(),errors:{escapeHtml:a.boolean(),label:a.valid("path","key",!1),language:[a.string(),a.object().ref()],render:a.boolean(),stack:a.boolean(),wrap:{label:c.wrap,array:c.wrap,string:c.wrap}},externals:a.boolean(),messages:a.object(),noDefaults:a.boolean(),nonEnumerables:a.boolean(),presence:a.valid("required","optional","forbidden"),skipFunctions:a.boolean(),stripUnknown:a.object({arrays:a.boolean(),objects:a.boolean()}).or("arrays","objects").allow(!0,!1),warnings:a.boolean()}).strict(),c.nameRx=/^[a-zA-Z0-9]\w*$/,c.rule=a.object({alias:a.array().items(a.string().pattern(c.nameRx)).single(),args:a.array().items(a.string(),a.object({name:a.string().pattern(c.nameRx).required(),ref:a.boolean(),assert:a.alternatives([a.function(),a.object().schema()]).conditional("ref",{is:!0,then:a.required()}),normalize:a.function(),message:a.string().when("assert",{is:a.function(),then:a.required()})})),convert:a.boolean(),manifest:a.boolean(),method:a.function().allow(!1),multi:a.boolean(),validate:a.function()}),i.extension=a.object({type:a.alternatives([a.string(),a.object().regex()]).required(),args:a.function(),cast:a.object().pattern(c.nameRx,a.object({from:a.function().maxArity(1).required(),to:a.function().minArity(1).maxArity(2).required()})),base:a.object().schema().when("type",{is:a.object().regex(),then:a.forbidden()}),coerce:[a.function().maxArity(3),a.object({method:a.function().maxArity(3).required(),from:a.array().items(a.string()).single()})],flags:a.object().pattern(c.nameRx,a.object({setter:a.string(),default:a.any()})),manifest:{build:a.function().arity(2)},messages:[a.object(),a.string()],modifiers:a.object().pattern(c.nameRx,a.function().minArity(1).maxArity(2)),overrides:a.object().pattern(c.nameRx,a.function()),prepare:a.function().maxArity(3),rebuild:a.function().arity(1),rules:a.object().pattern(c.nameRx,c.rule),terms:a.object().pattern(c.nameRx,a.object({init:a.array().allow(null).required(),manifest:a.object().pattern(/.+/,[a.valid("schema","single"),a.object({mapped:a.object({from:a.string().required(),to:a.string().required()}).required()})])})),validate:a.function().maxArity(3)}).strict(),i.extensions=a.array().items(a.object(),a.function().arity(1)).strict(),c.desc={buffer:a.object({buffer:a.string()}),func:a.object({function:a.function().required(),options:{literal:!0}}),override:a.object({override:!0}),ref:a.object({ref:a.object({type:a.valid("value","global","local"),path:a.array().required(),separator:a.string().length(1).allow(!1),ancestor:a.number().min(0).integer().allow("root"),map:a.array().items(a.array().length(2)).min(1),adjust:a.function(),iterables:a.boolean(),in:a.boolean(),render:a.boolean()}).required()}),regex:a.object({regex:a.string().min(3)}),special:a.object({special:a.valid("deep").required()}),template:a.object({template:a.string().required(),options:a.object()}),value:a.object({value:a.alternatives([a.object(),a.array()]).required()})},c.desc.entity=a.alternatives([a.array().items(a.link("...")),a.boolean(),a.function(),a.number(),a.string(),c.desc.buffer,c.desc.func,c.desc.ref,c.desc.regex,c.desc.special,c.desc.template,c.desc.value,a.link("/")]),c.desc.values=a.array().items(null,a.boolean(),a.function(),a.number().allow(1/0,-1/0),a.string().allow(""),a.symbol(),c.desc.buffer,c.desc.func,c.desc.override,c.desc.ref,c.desc.regex,c.desc.template,c.desc.value),c.desc.messages=a.object().pattern(/.+/,[a.string(),c.desc.template,a.object().pattern(/.+/,[a.string(),c.desc.template])]),i.description=a.object({type:a.string().required(),flags:a.object({cast:a.string(),default:a.any(),description:a.string(),empty:a.link("/"),failover:c.desc.entity,id:a.string(),label:a.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:a.boolean(),unit:a.string()}).unknown(),preferences:{allowUnknown:a.boolean(),abortEarly:a.boolean(),artifacts:a.boolean(),cache:a.boolean(),convert:a.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:a.boolean(),label:["path","key"],language:[a.string(),c.desc.ref],wrap:{label:c.wrap,array:c.wrap}},externals:a.boolean(),messages:c.desc.messages,noDefaults:a.boolean(),nonEnumerables:a.boolean(),presence:["required","optional","forbidden"],skipFunctions:a.boolean(),stripUnknown:a.object({arrays:a.boolean(),objects:a.boolean()}).or("arrays","objects").allow(!0,!1),warnings:a.boolean()},allow:c.desc.values,invalid:c.desc.values,rules:a.array().min(1).items({name:a.string().required(),args:a.object().min(1),keep:a.boolean(),message:[a.string(),c.desc.messages],warn:a.boolean()}),keys:a.object().pattern(/.*/,a.link("/")),link:c.desc.ref}).pattern(/^[a-z]\w*$/,a.any())},493:(s,i,o)=>{const a=o(8571),c=o(9621),d=o(8160),f={value:Symbol("value")};s.exports=f.State=class{constructor(l,u,p){this.path=l,this.ancestors=u,this.mainstay=p.mainstay,this.schemas=p.schemas,this.debug=null}localize(l,u=null,p=null){const h=new f.State(l,u,this);return p&&h.schemas&&(h.schemas=[f.schemas(p),...h.schemas]),h}nest(l,u){const p=new f.State(this.path,this.ancestors,this);return p.schemas=p.schemas&&[f.schemas(l),...p.schemas],p.debug=u,p}shadow(l,u){this.mainstay.shadow=this.mainstay.shadow||new f.Shadow,this.mainstay.shadow.set(this.path,l,u)}snapshot(){this.mainstay.shadow&&(this._snapshot=a(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}},f.schemas=function(l){return d.isSchema(l)?{schema:l}:l},f.Shadow=class{constructor(){this._values=null}set(l,u,p){if(!l.length||p==="strip"&&typeof l[l.length-1]=="number")return;this._values=this._values||new Map;let h=this._values;for(let m=0;m{const a=o(375),c=o(8571),d=o(5277),f=o(1447),l=o(8160),u=o(6354),p=o(6133),h={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};s.exports=h.Template=class{constructor(m,y){if(a(typeof m=="string","Template source must be a string"),a(!m.includes("\0")&&!m.includes(""),"Template source cannot contain reserved control characters"),this.source=m,this.rendered=m,this._template=null,y){const{functions:g,...v}=y;this._settings=Object.keys(v).length?c(v):void 0,this._functions=g,this._functions&&(a(Object.keys(this._functions).every(b=>typeof b=="string"),"Functions keys must be strings"),a(Object.values(this._functions).every(b=>typeof b=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const m=h.encode(this.source),y=h.split(m);let g=!1;const v=[],b=y.shift();b&&v.push(b);for(const _ of y){const A=_[0]!=="{",P=A?"}":"}}",T=_.indexOf(P);if(T===-1||_[1]==="{"){v.push(`{${h.decode(_)}`);continue}let E=_.slice(A?0:1,T);const N=E[0]===":";N&&(E=E.slice(1));const k=this._ref(h.decode(E),{raw:A,wrapped:N});v.push(k),typeof k!="string"&&(g=!0);const M=_.slice(T+P.length);M&&v.push(h.decode(M))}g?this._template=v:this.rendered=v.join("")}static date(m,y){return h.dateFormat[y.dateFormat].call(m)}describe(m={}){if(!this._settings&&m.compact)return this.source;const y={template:this.source};return this._settings&&(y.options=this._settings),this._functions&&(y.functions=this._functions),y}static build(m){return new h.Template(m.template,m.options||m.functions?{...m.options,functions:m.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(m){return!!m&&!!m[l.symbols.template]}refs(){if(!this._template)return;const m=[];for(const y of this._template)typeof y!="string"&&m.push(...y.refs);return m}resolve(m,y,g,v){return this._template&&this._template.length===1?this._part(this._template[0],m,y,g,v,{}):this.render(m,y,g,v)}_part(m,...y){return m.ref?m.ref.resolve(...y):m.formula.evaluate(y)}render(m,y,g,v,b={}){if(!this.isDynamic())return this.rendered;const _=[];for(const A of this._template)if(typeof A=="string")_.push(A);else{const P=this._part(A,m,y,g,v,b),T=h.stringify(P,m,y,g,v,b);if(T!==void 0){const E=A.raw||(b.errors&&b.errors.escapeHtml)===!1?T:d(T);_.push(h.wrap(E,A.wrapped&&g.errors.wrap.label))}}return _.join("")}_ref(m,{raw:y,wrapped:g}){const v=[],b=A=>{const P=p.create(A,this._settings);return v.push(P),T=>{const E=P.resolve(...T);return E!==void 0?E:null}};try{const A=this._functions?{...h.functions,...this._functions}:h.functions;var _=new f.Parser(m,{reference:b,functions:A,constants:h.constants})}catch(A){throw A.message=`Invalid template variable "${m}" fails due to: ${A.message}`,A}if(_.single){if(_.single.type==="reference"){const A=v[0];return{ref:A,raw:y,refs:v,wrapped:g||A.type==="local"&&A.key==="label"}}return h.stringify(_.single.value)}return{formula:_,raw:y,refs:v}}toString(){return this.source}},h.Template.prototype[l.symbols.template]=!0,h.Template.prototype.isImmutable=!0,h.encode=function(m){return m.replace(/\\(\{+)/g,(y,g)=>h.opens.slice(0,g.length)).replace(/\\(\}+)/g,(y,g)=>h.closes.slice(0,g.length))},h.decode=function(m){return m.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},h.split=function(m){const y=[];let g="";for(let v=0;v ${M.toString()}`);m=N}if(!Array.isArray(m))return m.toString();const E=[];for(const N of m)E.push(h.stringify(N,y,g,v,b,{arrayItems:!0,..._}));return h.wrap(E.join(", "),!T&&P.array)},h.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},h.functions={if:(m,y,g)=>m?y:g,length:m=>typeof m=="string"?m.length:m&&typeof m=="object"?Array.isArray(m)?m.length:Object.keys(m).length:null,msg(m){const[y,g,v,b,_]=this,A=_.messages;if(!A)return"";const P=u.template(y,A[0],m,g,v)||u.template(y,A[1],m,g,v);return P?P.render(y,g,v,b,_):""},number:m=>typeof m=="number"?m:typeof m=="string"?parseFloat(m):typeof m=="boolean"?m?1:0:m instanceof Date?m.getTime():null}},4946:(s,i,o)=>{const a=o(375),c=o(1687),d=o(8068),f=o(8160),l=o(3292),u=o(6354),p=o(6133),h={};s.exports=d.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:p.toSibling}},args:(m,...y)=>y.length===1&&Array.isArray(y[0])?m.try(...y[0]):m.try(...y),validate(m,y){const{schema:g,error:v,state:b,prefs:_}=y;if(g._flags.match){const P=[],T=[];for(let N=0;Nu.details(N,{override:!1}))})};if(g._flags.match==="one")return P.length===1?{value:P[0]}:{errors:v("alternatives.one")};if(P.length!==g.$_terms.matches.length)return{errors:v("alternatives.all",{details:T.map(N=>u.details(N,{override:!1}))})};const E=N=>N.$_terms.matches.some(k=>k.schema.type==="object"||k.schema.type==="alternatives"&&E(k.schema));return E(g)?{value:P.reduce((N,k)=>c(N,k,{mergeArrays:!1}))}:{value:P[P.length-1]}}const A=[];for(let P=0;Pg.path[0]!=="is"&&typeof y._flags.label!="string"?y.label(m):void 0,ref:!1})}},rebuild(m){m.$_modify({each:y=>{f.isSchema(y)&&y.type==="array"&&m.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(m,y){if(y.matches)for(const g of y.matches){const{schema:v,ref:b,is:_,not:A,then:P,otherwise:T}=g;m=v?m.try(v):b?m.conditional(b,{is:_,then:P,not:A,otherwise:T,switch:g.switch}):m.conditional(_,{then:P,otherwise:T})}return m}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),h.errors=function(m,{error:y,state:g}){if(!m.length)return{errors:y("alternatives.any")};if(m.length===1)return{errors:m[0].reports};const v=new Set,b=[];for(const{reports:_,schema:A}of m){if(_.length>1)return h.unmatched(m,y);const P=_[0];if(P instanceof u.Report==0)return h.unmatched(m,y);if(P.state.path.length!==g.path.length){b.push({type:A.type,report:P});continue}if(P.code==="any.only"){for(const N of P.local.valids)v.add(N);continue}const[T,E]=P.code.split(".");E!=="base"?b.push({type:A.type,report:P}):P.code==="object.base"?v.add(P.local.type):v.add(T)}return b.length?b.length===1?{errors:b[0].report}:h.unmatched(m,y):{errors:y("alternatives.types",{types:[...v]})}},h.unmatched=function(m,y){const g=[];for(const v of m)g.push(...v.reports);return{errors:y("alternatives.match",u.details(g,{override:!1}))}}},8068:(s,i,o)=>{const a=o(375),c=o(7629),d=o(8160),f=o(6914);s.exports=c.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(l,u){return a(typeof l=="function","Method must be a function"),a(u===void 0||u&&typeof u=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:l,description:u}})},validate(l,u,{method:p}){try{return p(l,u)}catch(h){return u.error("any.custom",{error:h})}},args:["method","description"],multi:!0},messages:{method(l){return this.prefs({messages:l})}},shared:{method(l){a(d.isSchema(l)&&l._flags.id,"Schema must be a schema with an id");const u=this.clone();return u.$_terms.shared=u.$_terms.shared||[],u.$_terms.shared.push(l),u.$_mutateRegister(l),u}},warning:{method(l,u){return a(l&&typeof l=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:l,local:u},warn:!0})},validate:(l,u,{code:p,local:h})=>u.error(p,h),args:["code","local"],multi:!0}},modifiers:{keep(l,u=!0){l.keep=u},message(l,u){l.message=f.compile(u)},warn(l,u=!0){l.warn=u}},manifest:{build(l,u){for(const p in u){const h=u[p];if(["examples","externals","metas","notes","tags"].includes(p))for(const m of h)l=l[p.slice(0,-1)](m);else if(p!=="alterations")if(p!=="whens"){if(p==="shared")for(const m of h)l=l.shared(m)}else for(const m of h){const{ref:y,is:g,not:v,then:b,otherwise:_,concat:A}=m;l=A?l.concat(A):y?l.when(y,{is:g,not:v,then:b,otherwise:_,switch:m.switch,break:m.break}):l.when(g,{then:b,otherwise:_,break:m.break})}else{const m={};for(const{target:y,adjuster:g}of h)m[y]=g;l=l.alter(m)}}return l}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(s,i,o)=>{const a=o(375),c=o(9474),d=o(9621),f=o(8068),l=o(8160),u=o(3292),p={};s.exports=f.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(h,{schema:m,state:y,prefs:g}){if(!Array.isArray(h))return;const v=m.$_getRule("sort");return v?p.sort(m,h,v.args.options,y,g):void 0}},validate(h,{schema:m,error:y}){if(!Array.isArray(h)){if(m._flags.single){const g=[h];return g[l.symbols.arraySingle]=!0,{value:g}}return{errors:y("array.base")}}if(m.$_getRule("items")||m.$_terms.externals)return{value:h.slice()}},rules:{has:{method(h){h=this.$_compile(h,{appendPath:!0});const m=this.$_addRule({name:"has",args:{schema:h}});return m.$_mutateRegister(h),m},validate(h,{state:m,prefs:y,error:g},{schema:v}){const b=[h,...m.ancestors];for(let A=0;Athis.$_compile(h[y]),y,{append:!0});m.$_terms.items.push(g)}return m.$_mutateRebuild()},validate(h,{schema:m,error:y,state:g,prefs:v,errorsArray:b}){const _=m.$_terms._requireds.slice(),A=m.$_terms.ordered.slice(),P=[...m.$_terms._inclusions,..._],T=!h[l.symbols.arraySingle];delete h[l.symbols.arraySingle];const E=b();let N=h.length;for(let k=0;k="})}},ordered:{method(...h){l.verifyFlat(h,"ordered");const m=this.$_addRule("items");for(let y=0;ythis.$_compile(h[y]),y,{append:!0});p.validateSingle(g,m),m.$_mutateRegister(g),m.$_terms.ordered.push(g)}return m.$_mutateRebuild()}},single:{method(h){const m=h===void 0||!!h;return a(!m||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",m)}},sort:{method(h={}){l.assertOptions(h,["by","order"]);const m={order:h.order||"ascending"};return h.by&&(m.by=u.ref(h.by,{ancestor:0}),a(!m.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:m}})},validate(h,{error:m,state:y,prefs:g,schema:v},{options:b}){const{value:_,errors:A}=p.sort(v,h,b,y,g);if(A)return A;for(let P=0;Pnew Set(h)}},rebuild(h){h.$_terms._inclusions=[],h.$_terms._exclusions=[],h.$_terms._requireds=[];for(const m of h.$_terms.items)p.validateSingle(m,h),m._flags.presence==="required"?h.$_terms._requireds.push(m):m._flags.presence==="forbidden"?h.$_terms._exclusions.push(m):h.$_terms._inclusions.push(m);for(const m of h.$_terms.ordered)p.validateSingle(m,h)},manifest:{build:(h,m)=>(m.items&&(h=h.items(...m.items)),m.ordered&&(h=h.ordered(...m.ordered)),h)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),p.fillMissedErrors=function(h,m,y,g,v,b){const _=[];let A=0;for(const P of y){const T=P._flags.label;T?_.push(T):++A}_.length?A?m.push(h.$_createError("array.includesRequiredBoth",g,{knownMisses:_,unknownMisses:A},v,b)):m.push(h.$_createError("array.includesRequiredKnowns",g,{knownMisses:_},v,b)):m.push(h.$_createError("array.includesRequiredUnknowns",g,{unknownMisses:A},v,b))},p.fillOrderedErrors=function(h,m,y,g,v,b){const _=[];for(const A of y)A._flags.presence==="required"&&_.push(A);_.length&&p.fillMissedErrors(h,m,_,g,v,b)},p.fillDefault=function(h,m,y,g){const v=[];let b=!0;for(let _=h.length-1;_>=0;--_){const A=h[_],P=[m,...y.ancestors],T=A.$_validate(void 0,y.localize(y.path,P,A),g).value;if(b){if(T===void 0)continue;b=!1}v.unshift(T)}v.length&&m.push(...v)},p.fastSplice=function(h,m){let y=m;for(;y{let N=p.compare(T,E,_,A);if(N!==null||(y.by&&(T=y.by.resolve(T,g,v),E=y.by.resolve(E,g,v)),N=p.compare(T,E,_,A),N!==null))return N;const k=typeof T;if(k!==typeof E)throw h.$_createError("array.sort.mismatching",m,null,g,v);if(k!=="number"&&k!=="string")throw h.$_createError("array.sort.unsupported",m,{type:k},g,v);return k==="number"?(T-E)*b:T{const a=o(375),c=o(8068),d=o(8160),f=o(2036),l={isBool:function(u){return typeof u=="boolean"}};s.exports=c.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(u,{schema:p}){if(typeof u!="boolean"){if(typeof u=="string"){const h=p._flags.sensitive?u:u.toLowerCase();u=h==="true"||h!=="false"&&u}return typeof u!="boolean"&&(u=p.$_terms.truthy&&p.$_terms.truthy.has(u,null,null,!p._flags.sensitive)||(!p.$_terms.falsy||!p.$_terms.falsy.has(u,null,null,!p._flags.sensitive))&&u),{value:u}}},validate(u,{error:p}){if(typeof u!="boolean")return{value:u,errors:p("boolean.base")}},rules:{truthy:{method(...u){d.verifyFlat(u,"truthy");const p=this.clone();p.$_terms.truthy=p.$_terms.truthy||new f;for(let h=0;hu?1:0},string:{from:l.isBool,to:(u,p)=>u?"true":"false"}},manifest:{build:(u,p)=>(p.truthy&&(u=u.truthy(...p.truthy)),p.falsy&&(u=u.falsy(...p.falsy)),u)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(s,i,o)=>{const a=o(375),c=o(8068),d=o(8160),f=o(3328),l={isDate:function(u){return u instanceof Date}};s.exports=c.extend({type:"date",coerce:{from:["number","string"],method:(u,{schema:p})=>({value:l.parse(u,p._flags.format)||u})},validate(u,{schema:p,error:h,prefs:m}){if(u instanceof Date&&!isNaN(u.getTime()))return;const y=p._flags.format;return m.convert&&y&&typeof u=="string"?{value:u,errors:h("date.format",{format:y})}:{value:u,errors:h("date.base")}},rules:{compare:{method:!1,validate(u,p,{date:h},{name:m,operator:y,args:g}){const v=h==="now"?Date.now():h.getTime();return d.compare(u.getTime(),v,y)?u:p.error("date."+m,{limit:g.date,value:u})},args:[{name:"date",ref:!0,normalize:u=>u==="now"?u:l.parse(u),assert:u=>u!==null,message:"must have a valid date format"}]},format:{method(u){return a(["iso","javascript","unix"].includes(u),"Unknown date format",u),this.$_setFlag("format",u)}},greater:{method(u){return this.$_addRule({name:"greater",method:"compare",args:{date:u},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(u){return this.$_addRule({name:"less",method:"compare",args:{date:u},operator:"<"})}},max:{method(u){return this.$_addRule({name:"max",method:"compare",args:{date:u},operator:"<="})}},min:{method(u){return this.$_addRule({name:"min",method:"compare",args:{date:u},operator:">="})}},timestamp:{method(u="javascript"){return a(["javascript","unix"].includes(u),'"type" must be one of "javascript, unix"'),this.format(u)}}},cast:{number:{from:l.isDate,to:(u,p)=>u.getTime()},string:{from:l.isDate,to:(u,{prefs:p})=>f.date(u,p)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),l.parse=function(u,p){if(u instanceof Date)return u;if(typeof u!="string"&&(isNaN(u)||!isFinite(u))||/^\s*$/.test(u))return null;if(p==="iso")return d.isIsoDate(u)?l.date(u.toString()):null;const h=u;if(typeof u=="string"&&/^[+-]?\d+(\.\d+)?$/.test(u)&&(u=parseFloat(u)),p){if(p==="javascript")return l.date(1*u);if(p==="unix")return l.date(1e3*u);if(typeof h=="string")return null}return l.date(u)},l.date=function(u){const p=new Date(u);return isNaN(p.getTime())?null:p}},390:(s,i,o)=>{const a=o(375),c=o(7824);s.exports=c.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(d){return a(Number.isSafeInteger(d)&&d>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:d}})},validate:(d,f,{n:l})=>d.length===l?d:f.error("function.arity",{n:l})},class:{method(){return this.$_addRule("class")},validate:(d,f)=>/^\s*class\s/.test(d.toString())?d:f.error("function.class",{value:d})},minArity:{method(d){return a(Number.isSafeInteger(d)&&d>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:d}})},validate:(d,f,{n:l})=>d.length>=l?d:f.error("function.minArity",{n:l})},maxArity:{method(d){return a(Number.isSafeInteger(d)&&d>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:d}})},validate:(d,f,{n:l})=>d.length<=l?d:f.error("function.maxArity",{n:l})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(s,i,o)=>{const a=o(978),c=o(375),d=o(8571),f=o(3652),l=o(8068),u=o(8160),p=o(3292),h=o(6354),m=o(6133),y=o(3328),g={renameDefaults:{alias:!1,multiple:!1,override:!1}};s.exports=l.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:void 0}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(v,b)=>v.keys(b),validate(v,{schema:b,error:_,state:A,prefs:P}){if(!v||typeof v!==b.$_property("typeof")||Array.isArray(v))return{value:v,errors:_("object.base",{type:b.$_property("typeof")})};if(!(b.$_terms.renames||b.$_terms.dependencies||b.$_terms.keys||b.$_terms.patterns||b.$_terms.externals))return;v=g.clone(v,P);const T=[];if(b.$_terms.renames&&!g.rename(b,v,A,P,T))return{value:v,errors:T};if(!b.$_terms.keys&&!b.$_terms.patterns&&!b.$_terms.dependencies)return{value:v,errors:T};const E=new Set(Object.keys(v));if(b.$_terms.keys){const N=[v,...A.ancestors];for(const k of b.$_terms.keys){const M=k.key,j=v[M];E.delete(M);const I=A.localize([...A.path,M],N,k),L=k.schema.$_validate(j,I,P);if(L.errors){if(P.abortEarly)return{value:v,errors:L.errors};L.value!==void 0&&(v[M]=L.value),T.push(...L.errors)}else k.schema._flags.result==="strip"||L.value===void 0&&j!==void 0?delete v[M]:L.value!==void 0&&(v[M]=L.value)}}if(E.size||b._flags._hasPatternMatch){const N=g.unknown(b,v,E,T,A,P);if(N)return N}if(b.$_terms.dependencies)for(const N of b.$_terms.dependencies){if(N.key!==null&&g.isPresent(N.options)(N.key.resolve(v,A,P,null,{shadow:!1}))===!1)continue;const k=g.dependencies[N.rel](b,N,v,A,P);if(k){const M=b.$_createError(k.code,v,k.context,A,P);if(P.abortEarly)return{value:v,errors:M};T.push(M)}}return{value:v,errors:T}},rules:{and:{method(...v){return u.verifyFlat(v,"and"),g.dependency(this,"and",null,v)}},append:{method(v){return v==null||Object.keys(v).length===0?this:this.keys(v)}},assert:{method(v,b,_){y.isTemplate(v)||(v=p.ref(v)),c(_===void 0||typeof _=="string","Message must be a string"),b=this.$_compile(b,{appendPath:!0});const A=this.$_addRule({name:"assert",args:{subject:v,schema:b,message:_}});return A.$_mutateRegister(v),A.$_mutateRegister(b),A},validate(v,{error:b,prefs:_,state:A},{subject:P,schema:T,message:E}){const N=P.resolve(v,A,_),k=m.isRef(P)?P.absolute(A):[];return T.$_match(N,A.localize(k,[v,...A.ancestors],T),_)?v:b("object.assert",{subject:P,message:E})},args:["subject","schema","message"],multi:!0},instance:{method(v,b){return c(typeof v=="function","constructor must be a function"),b=b||v.name,this.$_addRule({name:"instance",args:{constructor:v,name:b}})},validate:(v,b,{constructor:_,name:A})=>v instanceof _?v:b.error("object.instance",{type:A,value:v}),args:["constructor","name"]},keys:{method(v){c(v===void 0||typeof v=="object","Object schema must be a valid object"),c(!u.isSchema(v),"Object schema cannot be a joi schema");const b=this.clone();if(v)if(Object.keys(v).length){b.$_terms.keys=b.$_terms.keys?b.$_terms.keys.filter(_=>!v.hasOwnProperty(_.key)):new g.Keys;for(const _ in v)u.tryWithPath(()=>b.$_terms.keys.push({key:_,schema:this.$_compile(v[_])}),_)}else b.$_terms.keys=new g.Keys;else b.$_terms.keys=null;return b.$_mutateRebuild()}},length:{method(v){return this.$_addRule({name:"length",args:{limit:v},operator:"="})},validate:(v,b,{limit:_},{name:A,operator:P,args:T})=>u.compare(Object.keys(v).length,_,P)?v:b.error("object."+A,{limit:T.limit,value:v}),args:[{name:"limit",ref:!0,assert:u.limit,message:"must be a positive integer"}]},max:{method(v){return this.$_addRule({name:"max",method:"length",args:{limit:v},operator:"<="})}},min:{method(v){return this.$_addRule({name:"min",method:"length",args:{limit:v},operator:">="})}},nand:{method(...v){return u.verifyFlat(v,"nand"),g.dependency(this,"nand",null,v)}},or:{method(...v){return u.verifyFlat(v,"or"),g.dependency(this,"or",null,v)}},oxor:{method(...v){return g.dependency(this,"oxor",null,v)}},pattern:{method(v,b,_={}){const A=v instanceof RegExp;A||(v=this.$_compile(v,{appendPath:!0})),c(b!==void 0,"Invalid rule"),u.assertOptions(_,["fallthrough","matches"]),A&&c(!v.flags.includes("g")&&!v.flags.includes("y"),"pattern should not use global or sticky mode"),b=this.$_compile(b,{appendPath:!0});const P=this.clone();P.$_terms.patterns=P.$_terms.patterns||[];const T={[A?"regex":"schema"]:v,rule:b};return _.matches&&(T.matches=this.$_compile(_.matches),T.matches.type!=="array"&&(T.matches=T.matches.$_root.array().items(T.matches)),P.$_mutateRegister(T.matches),P.$_setFlag("_hasPatternMatch",!0,{clone:!1})),_.fallthrough&&(T.fallthrough=!0),P.$_terms.patterns.push(T),P.$_mutateRegister(b),P}},ref:{method(){return this.$_addRule("ref")},validate:(v,b)=>m.isRef(v)?v:b.error("object.refType",{value:v})},regex:{method(){return this.$_addRule("regex")},validate:(v,b)=>v instanceof RegExp?v:b.error("object.regex",{value:v})},rename:{method(v,b,_={}){c(typeof v=="string"||v instanceof RegExp,"Rename missing the from argument"),c(typeof b=="string"||b instanceof y,"Invalid rename to argument"),c(b!==v,"Cannot rename key to same name:",v),u.assertOptions(_,["alias","ignoreUndefined","override","multiple"]);const A=this.clone();A.$_terms.renames=A.$_terms.renames||[];for(const P of A.$_terms.renames)c(P.from!==v,"Cannot rename the same key multiple times");return b instanceof y&&A.$_mutateRegister(b),A.$_terms.renames.push({from:v,to:b,options:a(g.renameDefaults,_)}),A}},schema:{method(v="any"){return this.$_addRule({name:"schema",args:{type:v}})},validate:(v,b,{type:_})=>!u.isSchema(v)||_!=="any"&&v.type!==_?b.error("object.schema",{type:_}):v},unknown:{method(v){return this.$_setFlag("unknown",v!==!1)}},with:{method(v,b,_={}){return g.dependency(this,"with",v,b,_)}},without:{method(v,b,_={}){return g.dependency(this,"without",v,b,_)}},xor:{method(...v){return u.verifyFlat(v,"xor"),g.dependency(this,"xor",null,v)}}},overrides:{default(v,b){return v===void 0&&(v=u.symbols.deepDefault),this.$_parent("default",v,b)}},rebuild(v){if(v.$_terms.keys){const b=new f.Sorter;for(const _ of v.$_terms.keys)u.tryWithPath(()=>b.add(_,{after:_.schema.$_rootReferences(),group:_.key}),_.key);v.$_terms.keys=new g.Keys(...b.nodes)}},manifest:{build(v,b){if(b.keys&&(v=v.keys(b.keys)),b.dependencies)for(const{rel:_,key:A=null,peers:P,options:T}of b.dependencies)v=g.dependency(v,_,A,P,T);if(b.patterns)for(const{regex:_,schema:A,rule:P,fallthrough:T,matches:E}of b.patterns)v=v.pattern(_||A,P,{fallthrough:T,matches:E});if(b.renames)for(const{from:_,to:A,options:P}of b.renames)v=v.rename(_,A,P);return v}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),g.clone=function(v,b){if(typeof v=="object"){if(b.nonEnumerables)return d(v,{shallow:!0});const A=Object.create(Object.getPrototypeOf(v));return Object.assign(A,v),A}const _=function(...A){return v.apply(this,A)};return _.prototype=d(v.prototype),Object.defineProperty(_,"name",{value:v.name,writable:!1}),Object.defineProperty(_,"length",{value:v.length,writable:!1}),Object.assign(_,v),_},g.dependency=function(v,b,_,A,P){c(_===null||typeof _=="string",b,"key must be a strings"),P||(P=A.length>1&&typeof A[A.length-1]=="object"?A.pop():{}),u.assertOptions(P,["separator","isPresent"]),A=[].concat(A);const T=u.default(P.separator,"."),E=[];for(const k of A)c(typeof k=="string",b,"peers must be strings"),E.push(p.ref(k,{separator:T,ancestor:0,prefix:!1}));_!==null&&(_=p.ref(_,{separator:T,ancestor:0,prefix:!1}));const N=v.clone();return N.$_terms.dependencies=N.$_terms.dependencies||[],N.$_terms.dependencies.push(new g.Dependency(b,_,E,A,P)),N},g.dependencies={and(v,b,_,A,P){const T=[],E=[],N=b.peers.length,k=g.isPresent(b.options);for(const M of b.peers)k(M.resolve(_,A,P,null,{shadow:!1}))===!1?T.push(M.key):E.push(M.key);if(T.length!==N&&E.length!==N)return{code:"object.and",context:{present:E,presentWithLabels:g.keysToLabels(v,E),missing:T,missingWithLabels:g.keysToLabels(v,T)}}},nand(v,b,_,A,P){const T=[],E=g.isPresent(b.options);for(const M of b.peers)E(M.resolve(_,A,P,null,{shadow:!1}))&&T.push(M.key);if(T.length!==b.peers.length)return;const N=b.paths[0],k=b.paths.slice(1);return{code:"object.nand",context:{main:N,mainWithLabel:g.keysToLabels(v,N),peers:k,peersWithLabels:g.keysToLabels(v,k)}}},or(v,b,_,A,P){const T=g.isPresent(b.options);for(const E of b.peers)if(T(E.resolve(_,A,P,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:b.paths,peersWithLabels:g.keysToLabels(v,b.paths)}}},oxor(v,b,_,A,P){const T=[],E=g.isPresent(b.options);for(const k of b.peers)E(k.resolve(_,A,P,null,{shadow:!1}))&&T.push(k.key);if(!T.length||T.length===1)return;const N={peers:b.paths,peersWithLabels:g.keysToLabels(v,b.paths)};return N.present=T,N.presentWithLabels=g.keysToLabels(v,T),{code:"object.oxor",context:N}},with(v,b,_,A,P){const T=g.isPresent(b.options);for(const E of b.peers)if(T(E.resolve(_,A,P,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:b.key.key,mainWithLabel:g.keysToLabels(v,b.key.key),peer:E.key,peerWithLabel:g.keysToLabels(v,E.key)}}},without(v,b,_,A,P){const T=g.isPresent(b.options);for(const E of b.peers)if(T(E.resolve(_,A,P,null,{shadow:!1})))return{code:"object.without",context:{main:b.key.key,mainWithLabel:g.keysToLabels(v,b.key.key),peer:E.key,peerWithLabel:g.keysToLabels(v,E.key)}}},xor(v,b,_,A,P){const T=[],E=g.isPresent(b.options);for(const k of b.peers)E(k.resolve(_,A,P,null,{shadow:!1}))&&T.push(k.key);if(T.length===1)return;const N={peers:b.paths,peersWithLabels:g.keysToLabels(v,b.paths)};return T.length===0?{code:"object.missing",context:N}:(N.present=T,N.presentWithLabels=g.keysToLabels(v,T),{code:"object.xor",context:N})}},g.keysToLabels=function(v,b){return Array.isArray(b)?b.map(_=>v.$_mapLabels(_)):v.$_mapLabels(b)},g.isPresent=function(v){return typeof v.isPresent=="function"?v.isPresent:b=>b!==void 0},g.rename=function(v,b,_,A,P){const T={};for(const E of v.$_terms.renames){const N=[],k=typeof E.from!="string";if(k)for(const M in b){if(b[M]===void 0&&E.options.ignoreUndefined||M===E.to)continue;const j=E.from.exec(M);j&&N.push({from:M,to:E.to,match:j})}else!Object.prototype.hasOwnProperty.call(b,E.from)||b[E.from]===void 0&&E.options.ignoreUndefined||N.push(E);for(const M of N){const j=M.from;let I=M.to;if(I instanceof y&&(I=I.render(b,_,A,M.match)),j!==I){if(!E.options.multiple&&T[I]&&(P.push(v.$_createError("object.rename.multiple",b,{from:j,to:I,pattern:k},_,A)),A.abortEarly)||Object.prototype.hasOwnProperty.call(b,I)&&!E.options.override&&!T[I]&&(P.push(v.$_createError("object.rename.override",b,{from:j,to:I,pattern:k},_,A)),A.abortEarly))return!1;b[j]===void 0?delete b[I]:b[I]=b[j],T[I]=!0,E.options.alias||delete b[j]}}}return!0},g.unknown=function(v,b,_,A,P,T){if(v.$_terms.patterns){let E=!1;const N=v.$_terms.patterns.map(M=>{if(M.matches)return E=!0,[]}),k=[b,...P.ancestors];for(const M of _){const j=b[M],I=[...P.path,M];for(let L=0;L{const a=o(375),c=o(8068),d=o(8160),f=o(3292),l=o(6354),u={};s.exports=c.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(p,h)=>p.ref(h),validate(p,{schema:h,state:m,prefs:y}){a(h.$_terms.link,"Uninitialized link schema");const g=u.generate(h,p,m,y),v=h.$_terms.link[0].ref;return g.$_validate(p,m.nest(g,`link:${v.display}:${g.type}`),y)},generate:(p,h,m,y)=>u.generate(p,h,m,y),rules:{ref:{method(p){a(!this.$_terms.link,"Cannot reinitialize schema"),p=f.ref(p),a(p.type==="value"||p.type==="local","Invalid reference type:",p.type),a(p.type==="local"||p.ancestor==="root"||p.ancestor>0,"Link cannot reference itself");const h=this.clone();return h.$_terms.link=[{ref:p}],h}},relative:{method(p=!0){return this.$_setFlag("relative",p)}}},overrides:{concat(p){a(this.$_terms.link,"Uninitialized link schema"),a(d.isSchema(p),"Invalid schema object"),a(p.type!=="link","Cannot merge type link with another link");const h=this.clone();return h.$_terms.whens||(h.$_terms.whens=[]),h.$_terms.whens.push({concat:p}),h.$_mutateRebuild()}},manifest:{build:(p,h)=>(a(h.link,"Invalid link description missing link"),p.ref(h.link))}}),u.generate=function(p,h,m,y){let g=m.mainstay.links.get(p);if(g)return g._generate(h,m,y).schema;const v=p.$_terms.link[0].ref,{perspective:b,path:_}=u.perspective(v,m);u.assert(b,"which is outside of schema boundaries",v,p,m,y);try{g=_.length?b.$_reach(_):b}catch{u.assert(!1,"to non-existing schema",v,p,m,y)}return u.assert(g.type!=="link","which is another link",v,p,m,y),p._flags.relative||m.mainstay.links.set(p,g),g._generate(h,m,y).schema},u.perspective=function(p,h){if(p.type==="local"){for(const{schema:m,key:y}of h.schemas){if((m._flags.id||y)===p.path[0])return{perspective:m,path:p.path.slice(1)};if(m.$_terms.shared){for(const g of m.$_terms.shared)if(g._flags.id===p.path[0])return{perspective:g,path:p.path.slice(1)}}}return{perspective:null,path:null}}return p.ancestor==="root"?{perspective:h.schemas[h.schemas.length-1].schema,path:p.path}:{perspective:h.schemas[p.ancestor]&&h.schemas[p.ancestor].schema,path:p.path}},u.assert=function(p,h,m,y,g,v){p||a(!1,`"${l.label(y._flags,g,v)}" contains link reference "${m.display}" ${h}`)}},3832:(s,i,o)=>{const a=o(375),c=o(8068),d=o(8160),f={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(l){const u=l.toString(),p=u.indexOf("."),h=u.indexOf("e");return(p<0?0:(h<0?u.length:h)-p-1)+(h<0?0:Math.max(0,-parseInt(u.slice(h+1))))}};s.exports=c.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(l,{schema:u,error:p}){if(!l.match(f.numberRx))return;l=l.trim();const h={value:parseFloat(l)};if(h.value===0&&(h.value=0),!u._flags.unsafe)if(l.match(/e/i)){if(f.extractSignificantDigits(l)!==f.extractSignificantDigits(String(h.value)))return h.errors=p("number.unsafe"),h}else{const m=h.value.toString();if(m.match(/e/i))return h;if(m!==f.normalizeDecimal(l))return h.errors=p("number.unsafe"),h}return h}},validate(l,{schema:u,error:p,prefs:h}){if(l===1/0||l===-1/0)return{value:l,errors:p("number.infinity")};if(!d.isNumber(l))return{value:l,errors:p("number.base")};const m={value:l};if(h.convert){const y=u.$_getRule("precision");if(y){const g=Math.pow(10,y.args.limit);m.value=Math.round(m.value*g)/g}}return m.value===0&&(m.value=0),!u._flags.unsafe&&(l>Number.MAX_SAFE_INTEGER||ld.compare(l,p,m)?l:u.error("number."+h,{limit:y.limit,value:l}),args:[{name:"limit",ref:!0,assert:d.isNumber,message:"must be a number"}]},greater:{method(l){return this.$_addRule({name:"greater",method:"compare",args:{limit:l},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(l,u)=>Math.trunc(l)-l==0?l:u.error("number.integer")},less:{method(l){return this.$_addRule({name:"less",method:"compare",args:{limit:l},operator:"<"})}},max:{method(l){return this.$_addRule({name:"max",method:"compare",args:{limit:l},operator:"<="})}},min:{method(l){return this.$_addRule({name:"min",method:"compare",args:{limit:l},operator:">="})}},multiple:{method(l){const u=typeof l=="number"?f.decimalPlaces(l):null,p=Math.pow(10,u);return this.$_addRule({name:"multiple",args:{base:l,baseDecimalPlace:u,pfactor:p}})},validate:(l,u,{base:p,baseDecimalPlace:h,pfactor:m},y)=>f.decimalPlaces(l)>h?u.error("number.multiple",{multiple:y.args.base,value:l}):Math.round(m*l)%Math.round(m*p)==0?l:u.error("number.multiple",{multiple:y.args.base,value:l}),args:[{name:"base",ref:!0,assert:l=>typeof l=="number"&&isFinite(l)&&l>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(l,u)=>Number.isSafeInteger(l)&&l>=0&&l<=65535?l:u.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(l){return a(Number.isSafeInteger(l),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:l}})},validate(l,u,{limit:p}){const h=l.toString().match(f.precisionRx);return Math.max((h[1]?h[1].length:0)-(h[2]?parseInt(h[2],10):0),0)<=p?l:u.error("number.precision",{limit:p,value:l})},convert:!0},sign:{method(l){return a(["negative","positive"].includes(l),"Invalid sign",l),this.$_addRule({name:"sign",args:{sign:l}})},validate:(l,u,{sign:p})=>p==="negative"&&l<0||p==="positive"&&l>0?l:u.error(`number.${p}`)},unsafe:{method(l=!0){return a(typeof l=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",l)}}},cast:{string:{from:l=>typeof l=="number",to:(l,u)=>l.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),f.extractSignificantDigits=function(l){return l.replace(f.exponentialPartRegex,"").replace(f.dotRegex,"").replace(f.trailingZerosRegex,"").replace(f.leadingSignAndZerosRegex,"")},f.normalizeDecimal=function(l){return(l=l.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&l.endsWith("0")&&(l=l.replace(/0+$/,"")),l==="-0"?"0":l}},8966:(s,i,o)=>{const a=o(7824);s.exports=a.extend({type:"object",cast:{map:{from:c=>c&&typeof c=="object",to:(c,d)=>new Map(Object.entries(c))}}})},7417:(s,i,o)=>{const a=o(375),c=o(5380),d=o(1745),f=o(9959),l=o(6064),u=o(9926),p=o(5752),h=o(8068),m=o(8160),y={tlds:u instanceof Set&&{tlds:{allow:u,deny:null}},base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:{withPrefix:/^0x[0-9a-f]+$/i,withOptionalPrefix:/^(?:0x)?[0-9a-f]+$/i,withoutPrefix:/^[0-9a-f]+$/i},ipRegex:f.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};s.exports=h.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(g,{schema:v,state:b,prefs:_}){const A=v.$_getRule("normalize");A&&(g=g.normalize(A.args.form));const P=v.$_getRule("case");P&&(g=P.args.direction==="upper"?g.toLocaleUpperCase():g.toLocaleLowerCase());const T=v.$_getRule("trim");if(T&&T.args.enabled&&(g=g.trim()),v.$_terms.replacements)for(const N of v.$_terms.replacements)g=g.replace(N.pattern,N.replacement);const E=v.$_getRule("hex");if(E&&E.args.options.byteAligned&&g.length%2!=0&&(g=`0${g}`),v.$_getRule("isoDate")){const N=y.isoDate(g);N&&(g=N)}if(v._flags.truncate){const N=v.$_getRule("max");if(N){let k=N.args.limit;if(m.isResolvable(k)&&(k=k.resolve(g,b,_),!m.limit(k)))return{value:g,errors:v.$_createError("any.ref",k,{ref:N.args.limit,arg:"limit",reason:"must be a positive integer"},b,_)};g=g.slice(0,k)}}return{value:g}}},validate(g,{schema:v,error:b}){if(typeof g!="string")return{value:g,errors:b("string.base")};if(g===""){const _=v.$_getRule("min");return _&&_.args.limit===0?void 0:{value:g,errors:b("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(g,v)=>/^[a-zA-Z0-9]+$/.test(g)?g:v.error("string.alphanum")},base64:{method(g={}){return m.assertOptions(g,["paddingRequired","urlSafe"]),g={urlSafe:!1,paddingRequired:!0,...g},a(typeof g.paddingRequired=="boolean","paddingRequired must be boolean"),a(typeof g.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:g}})},validate:(g,v,{options:b})=>y.base64Regex[b.paddingRequired][b.urlSafe].test(g)?g:v.error("string.base64")},case:{method(g){return a(["lower","upper"].includes(g),"Invalid case:",g),this.$_addRule({name:"case",args:{direction:g}})},validate:(g,v,{direction:b})=>b==="lower"&&g===g.toLocaleLowerCase()||b==="upper"&&g===g.toLocaleUpperCase()?g:v.error(`string.${b}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(g,v){let b=g.length,_=0,A=1;for(;b--;){const P=g.charAt(b)*A;_+=P-9*(P>9),A^=3}return _>0&&_%10==0?g:v.error("string.creditCard")}},dataUri:{method(g={}){return m.assertOptions(g,["paddingRequired"]),g={paddingRequired:!0,...g},a(typeof g.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:g}})},validate(g,v,{options:b}){const _=g.match(y.dataUriRegex);return _&&(!_[2]||_[2]!=="base64"||y.base64Regex[b.paddingRequired].false.test(_[3]))?g:v.error("string.dataUri")}},domain:{method(g){g&&m.assertOptions(g,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const v=y.addressOptions(g);return this.$_addRule({name:"domain",args:{options:g},address:v})},validate:(g,v,b,{address:_})=>c.isValid(g,_)?g:v.error("string.domain")},email:{method(g={}){m.assertOptions(g,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),a(g.multiple===void 0||typeof g.multiple=="boolean","multiple option must be an boolean");const v=y.addressOptions(g),b=new RegExp(`\\s*[${g.separator?l(g.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:g},regex:b,address:v})},validate(g,v,{options:b},{regex:_,address:A}){const P=b.multiple?g.split(_):[g],T=[];for(const E of P)d.isValid(E,A)||T.push(E);return T.length?v.error("string.email",{value:g,invalids:T}):g}},guid:{alias:"uuid",method(g={}){m.assertOptions(g,["version","separator"]);let v="";if(g.version){const A=[].concat(g.version);a(A.length>=1,"version must have at least 1 valid version specified");const P=new Set;for(let T=0;T(b.prefix==="optional"?y.hexRegex.withOptionalPrefix:b.prefix===!0?y.hexRegex.withPrefix:y.hexRegex.withoutPrefix).test(g)?b.byteAligned&&g.length%2!=0?v.error("string.hexAlign"):g:v.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(g,v)=>c.isValid(g,{minDomainSegments:1})||y.ipRegex.test(g)?g:v.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(g={}){m.assertOptions(g,["cidr","version"]);const{cidr:v,versions:b,regex:_}=f.regex(g),A=g.version?b:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:v,version:A}},regex:_})},validate:(g,v,{options:b},{regex:_})=>_.test(g)?g:b.version?v.error("string.ipVersion",{value:g,cidr:b.cidr,version:b.version}):v.error("string.ip",{value:g,cidr:b.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(g,{error:v})=>y.isoDate(g)?g:v("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(g,v)=>y.isoDurationRegex.test(g)?g:v.error("string.isoDuration")},length:{method(g,v){return y.length(this,"length",g,"=",v)},validate(g,v,{limit:b,encoding:_},{name:A,operator:P,args:T}){const E=!_&&g.length;return m.compare(E,b,P)?g:v.error("string."+A,{limit:T.limit,value:g,encoding:_})},args:[{name:"limit",ref:!0,assert:m.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(g,v){return y.length(this,"max",g,"<=",v)},args:["limit","encoding"]},min:{method(g,v){return y.length(this,"min",g,">=",v)},args:["limit","encoding"]},normalize:{method(g="NFC"){return a(y.normalizationForms.includes(g),"normalization form must be one of "+y.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:g}})},validate:(g,{error:v},{form:b})=>g===g.normalize(b)?g:v("string.normalize",{value:g,form:b}),convert:!0},pattern:{alias:"regex",method(g,v={}){a(g instanceof RegExp,"regex must be a RegExp"),a(!g.flags.includes("g")&&!g.flags.includes("y"),"regex should not use global or sticky mode"),typeof v=="string"&&(v={name:v}),m.assertOptions(v,["invert","name"]);const b=["string.pattern",v.invert?".invert":"",v.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:g,options:v},errorCode:b})},validate:(g,v,{regex:b,options:_},{errorCode:A})=>b.test(g)^_.invert?g:v.error(A,{name:_.name,regex:b,value:g}),args:["regex","options"],multi:!0},replace:{method(g,v){typeof g=="string"&&(g=new RegExp(l(g),"g")),a(g instanceof RegExp,"pattern must be a RegExp"),a(typeof v=="string","replacement must be a String");const b=this.clone();return b.$_terms.replacements||(b.$_terms.replacements=[]),b.$_terms.replacements.push({pattern:g,replacement:v}),b}},token:{method(){return this.$_addRule("token")},validate:(g,v)=>/^\w+$/.test(g)?g:v.error("string.token")},trim:{method(g=!0){return a(typeof g=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:g}})},validate:(g,v,{enabled:b})=>b&&g!==g.trim()?v.error("string.trim"):g,convert:!0},truncate:{method(g=!0){return a(typeof g=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",g)}},uppercase:{method(){return this.case("upper")}},uri:{method(g={}){m.assertOptions(g,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),g.domain&&m.assertOptions(g.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:v,scheme:b}=p.regex(g),_=g.domain?y.addressOptions(g.domain):null;return this.$_addRule({name:"uri",args:{options:g},regex:v,domain:_,scheme:b})},validate(g,v,{options:b},{regex:_,domain:A,scheme:P}){if(["http:/","https:/"].includes(g))return v.error("string.uri");let T=_.exec(g);if(!T&&v.prefs.convert&&b.encodeUri){const E=encodeURI(g);T=_.exec(E),T&&(g=E)}if(T){const E=T[1]||T[2];return!A||b.allowRelative&&!E||c.isValid(E,A)?g:v.error("string.domain",{value:E})}return b.relativeOnly?v.error("string.uriRelativeOnly"):b.scheme?v.error("string.uriCustomScheme",{scheme:P,value:g}):v.error("string.uri")}}},manifest:{build(g,v){if(v.replacements)for(const{pattern:b,replacement:_}of v.replacements)g=g.replace(b,_);return g}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),y.addressOptions=function(g){if(!g)return y.tlds||g;if(a(g.minDomainSegments===void 0||Number.isSafeInteger(g.minDomainSegments)&&g.minDomainSegments>0,"minDomainSegments must be a positive integer"),a(g.maxDomainSegments===void 0||Number.isSafeInteger(g.maxDomainSegments)&&g.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),g.tlds===!1)return g;if(g.tlds===!0||g.tlds===void 0)return a(y.tlds,"Built-in TLD list disabled"),Object.assign({},g,y.tlds);a(typeof g.tlds=="object","tlds must be true, false, or an object");const v=g.tlds.deny;if(v)return Array.isArray(v)&&(g=Object.assign({},g,{tlds:{deny:new Set(v)}})),a(g.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),a(!g.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),y.validateTlds(g.tlds.deny,"tlds.deny"),g;const b=g.tlds.allow;return b?b===!0?(a(y.tlds,"Built-in TLD list disabled"),Object.assign({},g,y.tlds)):(Array.isArray(b)&&(g=Object.assign({},g,{tlds:{allow:new Set(b)}})),a(g.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),y.validateTlds(g.tlds.allow,"tlds.allow"),g):g},y.validateTlds=function(g,v){for(const b of g)a(c.isValid(b,{minDomainSegments:1,maxDomainSegments:1}),`${v} must contain valid top level domain names`)},y.isoDate=function(g){if(!m.isIsoDate(g))return null;/.*T.*[+-]\d\d$/.test(g)&&(g+="00");const v=new Date(g);return isNaN(v.getTime())?null:v.toISOString()},y.length=function(g,v,b,_,A){return a(!A||!1,"Invalid encoding:",A),g.$_addRule({name:v,method:"length",args:{limit:b,encoding:A},operator:_})}},8826:(s,i,o)=>{const a=o(375),c=o(8068),d={};d.Map=class extends Map{slice(){return new d.Map(this)}},s.exports=c.extend({type:"symbol",terms:{map:{init:new d.Map}},coerce:{method(f,{schema:l,error:u}){const p=l.$_terms.map.get(f);return p&&(f=p),l._flags.only&&typeof f!="symbol"?{value:f,errors:u("symbol.map",{map:l.$_terms.map})}:{value:f}}},validate(f,{error:l}){if(typeof f!="symbol")return{value:f,errors:l("symbol.base")}},rules:{map:{method(f){f&&!f[Symbol.iterator]&&typeof f=="object"&&(f=Object.entries(f)),a(f&&f[Symbol.iterator],"Iterable must be an iterable or object");const l=this.clone(),u=[];for(const p of f){a(p&&p[Symbol.iterator],"Entry must be an iterable");const[h,m]=p;a(typeof h!="object"&&typeof h!="function"&&typeof h!="symbol","Key must not be of type object, function, or Symbol"),a(typeof m=="symbol","Value must be a Symbol"),l.$_terms.map.set(h,m),u.push(m)}return l.valid(...u)}}},manifest:{build:(f,l)=>(l.map&&(f=f.map(l.map)),f)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(s,i,o)=>{const a=o(375),c=o(8571),d=o(738),f=o(9621),l=o(8160),u=o(6354),p=o(493),h={result:Symbol("result")};i.entry=function(m,y,g){let v=l.defaults;g&&(a(g.warnings===void 0,"Cannot override warnings preference in synchronous validation"),a(g.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),v=l.preferences(l.defaults,g));const b=h.entry(m,y,v);a(!b.mainstay.externals.length,"Schema with external rules must use validateAsync()");const _={value:b.value};return b.error&&(_.error=b.error),b.mainstay.warnings.length&&(_.warning=u.details(b.mainstay.warnings)),b.mainstay.debug&&(_.debug=b.mainstay.debug),b.mainstay.artifacts&&(_.artifacts=b.mainstay.artifacts),_},i.entryAsync=async function(m,y,g){let v=l.defaults;g&&(v=l.preferences(l.defaults,g));const b=h.entry(m,y,v),_=b.mainstay;if(b.error)throw _.debug&&(b.error.debug=_.debug),b.error;if(_.externals.length){let P=b.value;const T=[];for(const E of _.externals){const N=E.state.path,k=E.schema.type==="link"?_.links.get(E.schema):null;let M,j,I=P;const L=N.length?[P]:[],H=N.length?f(m,N):m;if(N.length){M=N[N.length-1];let K=P;for(const V of N.slice(0,-1))K=K[V],L.unshift(K);j=L[0],I=j[M]}try{const K=(U,Q)=>(k||E.schema).$_createError(U,I,Q,E.state,v),V=await E.method(I,{schema:E.schema,linked:k,state:E.state,prefs:g,original:H,error:K,errorsArray:h.errorsArray,warn:(U,Q)=>_.warnings.push((k||E.schema).$_createError(U,I,Q,E.state,v)),message:(U,Q)=>(k||E.schema).$_createError("external",I,Q,E.state,v,{messages:U})});if(V===void 0||V===I)continue;if(V instanceof u.Report){if(_.tracer.log(E.schema,E.state,"rule","external","error"),T.push(V),v.abortEarly)break;continue}if(Array.isArray(V)&&V[l.symbols.errors]){if(_.tracer.log(E.schema,E.state,"rule","external","error"),T.push(...V),v.abortEarly)break;continue}j?(_.tracer.value(E.state,"rule",I,V,"external"),j[M]=V):(_.tracer.value(E.state,"rule",P,V,"external"),P=V)}catch(K){throw v.errors.label&&(K.message+=` (${E.label})`),K}}if(b.value=P,T.length)throw b.error=u.process(T,m,v),_.debug&&(b.error.debug=_.debug),b.error}if(!v.warnings&&!v.debug&&!v.artifacts)return b.value;const A={value:b.value};return _.warnings.length&&(A.warning=u.details(_.warnings)),_.debug&&(A.debug=_.debug),_.artifacts&&(A.artifacts=_.artifacts),A},h.Mainstay=class{constructor(m,y,g){this.externals=[],this.warnings=[],this.tracer=m,this.debug=y,this.links=g,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const m=this._snapshots.pop();this.externals=m.externals,this.warnings=m.warnings}commit(){this._snapshots.pop()}},h.entry=function(m,y,g){const{tracer:v,cleanup:b}=h.tracer(y,g),_=g.debug?[]:null,A=y._ids._schemaChain?new Map:null,P=new h.Mainstay(v,_,A),T=y._ids._schemaChain?[{schema:y}]:null,E=new p([],[],{mainstay:P,schemas:T}),N=i.validate(m,y,E,g);b&&y.$_root.untrace();const k=u.process(N.errors,m,g);return{value:N.value,error:k,mainstay:P}},h.tracer=function(m,y){return m.$_root._tracer?{tracer:m.$_root._tracer._register(m)}:y.debug?(a(m.$_root.trace,"Debug mode not supported"),{tracer:m.$_root.trace()._register(m),cleanup:!0}):{tracer:h.ignore}},i.validate=function(m,y,g,v,b={}){if(y.$_terms.whens&&(y=y._generate(m,g,v).schema),y._preferences&&(v=h.prefs(y,v)),y._cache&&v.cache){const k=y._cache.get(m);if(g.mainstay.tracer.debug(g,"validate","cached",!!k),k)return k}const _=(k,M,j)=>y.$_createError(k,m,M,j||g,v),A={original:m,prefs:v,schema:y,state:g,error:_,errorsArray:h.errorsArray,warn:(k,M,j)=>g.mainstay.warnings.push(_(k,M,j)),message:(k,M)=>y.$_createError("custom",m,M,g,v,{messages:k})};g.mainstay.tracer.entry(y,g);const P=y._definition;if(P.prepare&&m!==void 0&&v.convert){const k=P.prepare(m,A);if(k){if(g.mainstay.tracer.value(g,"prepare",m,k.value),k.errors)return h.finalize(k.value,[].concat(k.errors),A);m=k.value}}if(P.coerce&&m!==void 0&&v.convert&&(!P.coerce.from||P.coerce.from.includes(typeof m))){const k=P.coerce.method(m,A);if(k){if(g.mainstay.tracer.value(g,"coerced",m,k.value),k.errors)return h.finalize(k.value,[].concat(k.errors),A);m=k.value}}const T=y._flags.empty;T&&T.$_match(h.trim(m,y),g.nest(T),l.defaults)&&(g.mainstay.tracer.value(g,"empty",m,void 0),m=void 0);const E=b.presence||y._flags.presence||(y._flags._endedSwitch?null:v.presence);if(m===void 0){if(E==="forbidden")return h.finalize(m,null,A);if(E==="required")return h.finalize(m,[y.$_createError("any.required",m,null,g,v)],A);if(E==="optional"){if(y._flags.default!==l.symbols.deepDefault)return h.finalize(m,null,A);g.mainstay.tracer.value(g,"default",m,{}),m={}}}else if(E==="forbidden")return h.finalize(m,[y.$_createError("any.unknown",m,null,g,v)],A);const N=[];if(y._valids){const k=y._valids.get(m,g,v,y._flags.insensitive);if(k)return v.convert&&(g.mainstay.tracer.value(g,"valids",m,k.value),m=k.value),g.mainstay.tracer.filter(y,g,"valid",k),h.finalize(m,null,A);if(y._flags.only){const M=y.$_createError("any.only",m,{valids:y._valids.values({display:!0})},g,v);if(v.abortEarly)return h.finalize(m,[M],A);N.push(M)}}if(y._invalids){const k=y._invalids.get(m,g,v,y._flags.insensitive);if(k){g.mainstay.tracer.filter(y,g,"invalid",k);const M=y.$_createError("any.invalid",m,{invalids:y._invalids.values({display:!0})},g,v);if(v.abortEarly)return h.finalize(m,[M],A);N.push(M)}}if(P.validate){const k=P.validate(m,A);if(k&&(g.mainstay.tracer.value(g,"base",m,k.value),m=k.value,k.errors)){if(!Array.isArray(k.errors))return N.push(k.errors),h.finalize(m,N,A);if(k.errors.length)return N.push(...k.errors),h.finalize(m,N,A)}}return y._rules.length?h.rules(m,N,A):h.finalize(m,N,A)},h.rules=function(m,y,g){const{schema:v,state:b,prefs:_}=g;for(const A of v._rules){const P=v._definition.rules[A.method];if(P.convert&&_.convert){b.mainstay.tracer.log(v,b,"rule",A.name,"full");continue}let T,E=A.args;if(A._resolve.length){E=Object.assign({},E);for(const k of A._resolve){const M=P.argsByName.get(k),j=E[k].resolve(m,b,_),I=M.normalize?M.normalize(j):j,L=l.validateArg(I,null,M);if(L){T=v.$_createError("any.ref",j,{arg:k,ref:E[k],reason:L},b,_);break}E[k]=I}}T=T||P.validate(m,g,E,A);const N=h.rule(T,A);if(N.errors){if(b.mainstay.tracer.log(v,b,"rule",A.name,"error"),A.warn){b.mainstay.warnings.push(...N.errors);continue}if(_.abortEarly)return h.finalize(m,N.errors,g);y.push(...N.errors)}else b.mainstay.tracer.log(v,b,"rule",A.name,"pass"),b.mainstay.tracer.value(b,"rule",m,N.value,A.name),m=N.value}return h.finalize(m,y,g)},h.rule=function(m,y){return m instanceof u.Report?(h.error(m,y),{errors:[m],value:null}):Array.isArray(m)&&m[l.symbols.errors]?(m.forEach(g=>h.error(g,y)),{errors:m,value:null}):{errors:null,value:m}},h.error=function(m,y){return y.message&&m._setTemplate(y.message),m},h.finalize=function(m,y,g){y=y||[];const{schema:v,state:b,prefs:_}=g;if(y.length){const P=h.default("failover",void 0,y,g);P!==void 0&&(b.mainstay.tracer.value(b,"failover",m,P),m=P,y=[])}if(y.length&&v._flags.error)if(typeof v._flags.error=="function"){y=v._flags.error(y),Array.isArray(y)||(y=[y]);for(const P of y)a(P instanceof Error||P instanceof u.Report,"error() must return an Error object")}else y=[v._flags.error];if(m===void 0){const P=h.default("default",m,y,g);b.mainstay.tracer.value(b,"default",m,P),m=P}if(v._flags.cast&&m!==void 0){const P=v._definition.cast[v._flags.cast];if(P.from(m)){const T=P.to(m,g);b.mainstay.tracer.value(b,"cast",m,T,v._flags.cast),m=T}}if(v.$_terms.externals&&_.externals&&_._externals!==!1)for(const{method:P}of v.$_terms.externals)b.mainstay.externals.push({method:P,schema:v,state:b,label:u.label(v._flags,b,_)});const A={value:m,errors:y.length?y:null};return v._flags.result&&(A.value=v._flags.result==="strip"?void 0:g.original,b.mainstay.tracer.value(b,v._flags.result,m,A.value),b.shadow(m,v._flags.result)),v._cache&&_.cache!==!1&&!v._refs.length&&v._cache.set(g.original,A),m===void 0||A.errors||v._flags.artifact===void 0||(b.mainstay.artifacts=b.mainstay.artifacts||new Map,b.mainstay.artifacts.has(v._flags.artifact)||b.mainstay.artifacts.set(v._flags.artifact,[]),b.mainstay.artifacts.get(v._flags.artifact).push(b.path)),A},h.prefs=function(m,y){const g=y===l.defaults;return g&&m._preferences[l.symbols.prefs]?m._preferences[l.symbols.prefs]:(y=l.preferences(y,m._preferences),g&&(m._preferences[l.symbols.prefs]=y),y)},h.default=function(m,y,g,v){const{schema:b,state:_,prefs:A}=v,P=b._flags[m];if(A.noDefaults||P===void 0)return y;if(_.mainstay.tracer.log(b,_,"rule",m,"full"),!P)return P;if(typeof P=="function"){const T=P.length?[c(_.ancestors[0]),v]:[];try{return P(...T)}catch(E){return void g.push(b.$_createError(`any.${m}`,null,{error:E},_,A))}}return typeof P!="object"?P:P[l.symbols.literal]?P.literal:l.isResolvable(P)?P.resolve(y,_,A):c(P)},h.trim=function(m,y){if(typeof m!="string")return m;const g=y.$_getRule("trim");return g&&g.args.enabled?m.trim():m},h.ignore={active:!1,debug:d,entry:d,filter:d,log:d,resolve:d,value:d},h.errorsArray=function(){const m=[];return m[l.symbols.errors]=!0,m}},2036:(s,i,o)=>{const a=o(375),c=o(9474),d=o(8160),f={};s.exports=f.Values=class{constructor(l,u){this._values=new Set(l),this._refs=new Set(u),this._lowercase=f.lowercases(l),this._override=!1}get length(){return this._values.size+this._refs.size}add(l,u){d.isResolvable(l)?this._refs.has(l)||(this._refs.add(l),u&&u.register(l)):this.has(l,null,null,!1)||(this._values.add(l),typeof l=="string"&&this._lowercase.set(l.toLowerCase(),l))}static merge(l,u,p){if(l=l||new f.Values,u){if(u._override)return u.clone();for(const h of[...u._values,...u._refs])l.add(h)}if(p)for(const h of[...p._values,...p._refs])l.remove(h);return l.length?l:null}remove(l){d.isResolvable(l)?this._refs.delete(l):(this._values.delete(l),typeof l=="string"&&this._lowercase.delete(l.toLowerCase()))}has(l,u,p,h){return!!this.get(l,u,p,h)}get(l,u,p,h){if(!this.length)return!1;if(this._values.has(l))return{value:l};if(typeof l=="string"&&l&&h){const m=this._lowercase.get(l.toLowerCase());if(m)return{value:m}}if(!this._refs.size&&typeof l!="object")return!1;if(typeof l=="object"){for(const m of this._values)if(c(m,l))return{value:m}}if(u)for(const m of this._refs){const y=m.resolve(l,u,p,null,{in:!0});if(y===void 0)continue;const g=m.in&&typeof y=="object"?Array.isArray(y)?y:Object.keys(y):[y];for(const v of g)if(typeof v==typeof l){if(h&&l&&typeof l=="string"){if(v.toLowerCase()===l.toLowerCase())return{value:v,ref:m}}else if(c(v,l))return{value:v,ref:m}}}return!1}override(){this._override=!0}values(l){if(l&&l.display){const u=[];for(const p of[...this._values,...this._refs])p!==void 0&&u.push(p);return u}return Array.from([...this._values,...this._refs])}clone(){const l=new f.Values(this._values,this._refs);return l._override=this._override,l}concat(l){a(!l._override,"Cannot concat override set of values");const u=new f.Values([...this._values,...l._values],[...this._refs,...l._refs]);return u._override=this._override,u}describe(){const l=[];this._override&&l.push({override:!0});for(const u of this._values.values())l.push(u&&typeof u=="object"?{value:u}:u);for(const u of this._refs.values())l.push(u.describe());return l}},f.Values.prototype[d.symbols.values]=!0,f.Values.prototype.slice=f.Values.prototype.clone,f.lowercases=function(l){const u=new Map;if(l)for(const p of l)typeof p=="string"&&u.set(p.toLowerCase(),p);return u}},978:(s,i,o)=>{const a=o(375),c=o(8571),d=o(1687),f=o(9621),l={};s.exports=function(u,p,h={}){if(a(u&&typeof u=="object","Invalid defaults value: must be an object"),a(!p||p===!0||typeof p=="object","Invalid source value: must be true, falsy or an object"),a(typeof h=="object","Invalid options: must be an object"),!p)return null;if(h.shallow)return l.applyToDefaultsWithShallow(u,p,h);const m=c(u);if(p===!0)return m;const y=h.nullOverride!==void 0&&h.nullOverride;return d(m,p,{nullOverride:y,mergeArrays:!1})},l.applyToDefaultsWithShallow=function(u,p,h){const m=h.shallow;a(Array.isArray(m),"Invalid keys");const y=new Map,g=p===!0?null:new Set;for(let _ of m){_=Array.isArray(_)?_:_.split(".");const A=f(u,_);A&&typeof A=="object"?y.set(A,g&&f(p,_)||A):g&&g.add(_)}const v=c(u,{},y);if(!g)return v;for(const _ of g)l.reachCopy(v,p,_);const b=h.nullOverride!==void 0&&h.nullOverride;return d(v,p,{nullOverride:b,mergeArrays:!1})},l.reachCopy=function(u,p,h){for(const g of h){if(!(g in p))return;const v=p[g];if(typeof v!="object"||v===null)return;p=v}const m=p;let y=u;for(let g=0;g{const a=o(7916);s.exports=function(c,...d){if(!c)throw d.length===1&&d[0]instanceof Error?d[0]:new a(d)}},8571:(s,i,o)=>{const a=o(9621),c=o(4277),d=o(7043),f={needsProtoHack:new Set([c.set,c.map,c.weakSet,c.weakMap])};s.exports=f.clone=function(l,u={},p=null){if(typeof l!="object"||l===null)return l;let h=f.clone,m=p;if(u.shallow){if(u.shallow!==!0)return f.cloneWithShallow(l,u);h=b=>b}else if(m){const b=m.get(l);if(b)return b}else m=new Map;const y=c.getInternalProto(l);if(y===c.buffer)return!1;if(y===c.date)return new Date(l.getTime());if(y===c.regex)return new RegExp(l);const g=f.base(l,y,u);if(g===l)return l;if(m&&m.set(l,g),y===c.set)for(const b of l)g.add(h(b,u,m));else if(y===c.map)for(const[b,_]of l)g.set(b,h(_,u,m));const v=d.keys(l,u);for(const b of v){if(b==="__proto__")continue;if(y===c.array&&b==="length"){g.length=l.length;continue}const _=Object.getOwnPropertyDescriptor(l,b);_?_.get||_.set?Object.defineProperty(g,b,_):_.enumerable?g[b]=h(l[b],u,m):Object.defineProperty(g,b,{enumerable:!1,writable:!0,configurable:!0,value:h(l[b],u,m)}):Object.defineProperty(g,b,{enumerable:!0,writable:!0,configurable:!0,value:h(l[b],u,m)})}return g},f.cloneWithShallow=function(l,u){const p=u.shallow;(u=Object.assign({},u)).shallow=!1;const h=new Map;for(const m of p){const y=a(l,m);typeof y!="object"&&typeof y!="function"||h.set(y,y)}return f.clone(l,u,h)},f.base=function(l,u,p){if(p.prototype===!1)return f.needsProtoHack.has(u)?new u.constructor:u===c.array?[]:{};const h=Object.getPrototypeOf(l);if(h&&h.isImmutable)return l;if(u===c.array){const m=[];return h!==u&&Object.setPrototypeOf(m,h),m}if(f.needsProtoHack.has(u)){const m=new h.constructor;return h!==u&&Object.setPrototypeOf(m,h),m}return Object.create(h)}},9474:(s,i,o)=>{const a=o(4277),c={mismatched:null};s.exports=function(d,f,l){return l=Object.assign({prototype:!0},l),!!c.isDeepEqual(d,f,l,[])},c.isDeepEqual=function(d,f,l,u){if(d===f)return d!==0||1/d==1/f;const p=typeof d;if(p!==typeof f||d===null||f===null)return!1;if(p==="function"){if(!l.deepFunction||d.toString()!==f.toString())return!1}else if(p!=="object")return d!=d&&f!=f;const h=c.getSharedType(d,f,!!l.prototype);switch(h){case a.buffer:return!1;case a.promise:return d===f;case a.regex:return d.toString()===f.toString();case c.mismatched:return!1}for(let m=u.length-1;m>=0;--m)if(u[m].isSame(d,f))return!0;u.push(new c.SeenEntry(d,f));try{return!!c.isDeepEqualObj(h,d,f,l,u)}finally{u.pop()}},c.getSharedType=function(d,f,l){if(l)return Object.getPrototypeOf(d)!==Object.getPrototypeOf(f)?c.mismatched:a.getInternalProto(d);const u=a.getInternalProto(d);return u!==a.getInternalProto(f)?c.mismatched:u},c.valueOf=function(d){const f=d.valueOf;if(f===void 0)return d;try{return f.call(d)}catch(l){return l}},c.hasOwnEnumerableProperty=function(d,f){return Object.prototype.propertyIsEnumerable.call(d,f)},c.isSetSimpleEqual=function(d,f){for(const l of Set.prototype.values.call(d))if(!Set.prototype.has.call(f,l))return!1;return!0},c.isDeepEqualObj=function(d,f,l,u,p){const{isDeepEqual:h,valueOf:m,hasOwnEnumerableProperty:y}=c,{keys:g,getOwnPropertySymbols:v}=Object;if(d===a.array){if(!u.part){if(f.length!==l.length)return!1;for(let T=0;T{const a=o(8761);s.exports=class extends Error{constructor(c){super(c.filter(d=>d!=="").map(d=>typeof d=="string"?d:d instanceof Error?d.message:a(d)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,i.assert)}}},5277:s=>{const i={};s.exports=function(o){if(!o)return"";let a="";for(let c=0;c=256?"&#"+o+";":`&#x${o.toString(16).padStart(2,"0")};`)},i.isSafe=function(o){return i.safeCharCodes.has(o)},i.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),i.safeCharCodes=function(){const o=new Set;for(let a=32;a<123;++a)(a>=97||a>=65&&a<=90||a>=48&&a<=57||a===32||a===46||a===44||a===45||a===58||a===95)&&o.add(a);return o}()},6064:s=>{s.exports=function(i){return i.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:s=>{s.exports=function(){}},1687:(s,i,o)=>{const a=o(375),c=o(8571),d=o(7043),f={};s.exports=f.merge=function(l,u,p){if(a(l&&typeof l=="object","Invalid target value: must be an object"),a(u==null||typeof u=="object","Invalid source value: must be null, undefined, or an object"),!u)return l;if(p=Object.assign({nullOverride:!0,mergeArrays:!0},p),Array.isArray(u)){a(Array.isArray(l),"Cannot merge array onto an object"),p.mergeArrays||(l.length=0);for(let m=0;m{const a=o(375),c={};s.exports=function(d,f,l){if(f===!1||f==null)return d;typeof(l=l||{})=="string"&&(l={separator:l});const u=Array.isArray(f);a(!u||!l.separator,"Separator option is not valid for array-based chain");const p=u?f:f.split(l.separator||".");let h=d;for(let m=0;m{s.exports=function(...i){try{return JSON.stringify(...i)}catch(o){return"[Cannot display object: "+o.message+"]"}}},4277:(s,i)=>{const o={};i=s.exports={array:Array.prototype,buffer:!1,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},o.typeMap=new Map([["[object Error]",i.error],["[object Map]",i.map],["[object Promise]",i.promise],["[object Set]",i.set],["[object WeakMap]",i.weakMap],["[object WeakSet]",i.weakSet]]),i.getInternalProto=function(a){if(Array.isArray(a))return i.array;if(a instanceof Date)return i.date;if(a instanceof RegExp)return i.regex;if(a instanceof Error)return i.error;const c=Object.prototype.toString.call(a);return o.typeMap.get(c)||i.generic}},7043:(s,i)=>{i.keys=function(o,a={}){return a.symbols!==!1?Reflect.ownKeys(o):Object.getOwnPropertyNames(o)}},3652:(s,i,o)=>{const a=o(375),c={};i.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(d,f){const l=[].concat((f=f||{}).before||[]),u=[].concat(f.after||[]),p=f.group||"?",h=f.sort||0;a(!l.includes(p),`Item cannot come before itself: ${p}`),a(!l.includes("?"),"Item cannot come before unassociated items"),a(!u.includes(p),`Item cannot come after itself: ${p}`),a(!u.includes("?"),"Item cannot come after unassociated items"),Array.isArray(d)||(d=[d]);for(const m of d){const y={seq:this._items.length,sort:h,before:l,after:u,group:p,node:m};this._items.push(y)}if(!f.manual){const m=this._sort();a(m,"item",p!=="?"?`added into group ${p}`:"","created a dependencies error")}return this.nodes}merge(d){Array.isArray(d)||(d=[d]);for(const l of d)if(l)for(const u of l._items)this._items.push(Object.assign({},u));this._items.sort(c.mergeSort);for(let l=0;ld.sort===f.sort?0:d.sort{const a=o(443),c=o(2178),d={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:a.URL||URL};i.analyze=function(f,l={}){if(!f)return c.code("DOMAIN_NON_EMPTY_STRING");if(typeof f!="string")throw new Error("Invalid input: domain must be a string");if(f.length>256)return c.code("DOMAIN_TOO_LONG");if(d.nonAsciiRx.test(f)){if(l.allowUnicode===!1)return c.code("DOMAIN_INVALID_UNICODE_CHARS");f=f.normalize("NFC")}if(d.domainControlRx.test(f))return c.code("DOMAIN_INVALID_CHARS");f=d.punycode(f),l.allowFullyQualified&&f[f.length-1]==="."&&(f=f.slice(0,-1));const u=l.minDomainSegments||d.minDomainSegments,p=f.split(".");if(p.lengthl.maxDomainSegments)return c.code("DOMAIN_SEGMENTS_COUNT_MAX");const h=l.tlds;if(h){const m=p[p.length-1].toLowerCase();if(h.deny&&h.deny.has(m)||h.allow&&!h.allow.has(m))return c.code("DOMAIN_FORBIDDEN_TLDS")}for(let m=0;m63)return c.code("DOMAIN_LONG_SEGMENT");if(m{const a=o(9848),c=o(5380),d=o(2178),f={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(a.TextEncoder||TextEncoder)};i.analyze=function(l,u){return f.email(l,u)},i.isValid=function(l,u){return!f.email(l,u)},f.email=function(l,u={}){if(typeof l!="string")throw new Error("Invalid input: email must be a string");if(!l)return d.code("EMPTY_STRING");const p=!f.nonAsciiRx.test(l);if(!p){if(u.allowUnicode===!1)return d.code("FORBIDDEN_UNICODE");l=l.normalize("NFC")}const h=l.split("@");if(h.length!==2)return h.length>2?d.code("MULTIPLE_AT_CHAR"):d.code("MISSING_AT_CHAR");const[m,y]=h;if(!m)return d.code("EMPTY_LOCAL");if(!u.ignoreLength){if(l.length>254)return d.code("ADDRESS_TOO_LONG");if(f.encoder.encode(m).length>64)return d.code("LOCAL_TOO_LONG")}return f.local(m,p)||c.analyze(y,u)},f.local=function(l,u){const p=l.split(".");for(const h of p){if(!h.length)return d.code("EMPTY_LOCAL_SEGMENT");if(u){if(!f.atextRx.test(h))return d.code("INVALID_LOCAL_CHARS")}else for(const m of h){if(f.atextRx.test(m))continue;const y=f.binary(m);if(!f.atomRx.test(y))return d.code("INVALID_LOCAL_CHARS")}}},f.binary=function(l){return Array.from(f.encoder.encode(l)).map(u=>String.fromCharCode(u)).join("")},f.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,f.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))},2178:(s,i)=>{i.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"},i.code=function(o){return{code:o,error:i.codes[o]}}},9959:(s,i,o)=>{const a=o(375),c=o(5752);i.regex=function(d={}){a(d.cidr===void 0||typeof d.cidr=="string","options.cidr must be a string");const f=d.cidr?d.cidr.toLowerCase():"optional";a(["required","optional","forbidden"].includes(f),"options.cidr must be one of required, optional, forbidden"),a(d.version===void 0||typeof d.version=="string"||Array.isArray(d.version),"options.version must be a string or an array of string");let l=d.version||["ipv4","ipv6","ipvfuture"];Array.isArray(l)||(l=[l]),a(l.length>=1,"options.version must have at least 1 version specified");for(let h=0;h{if(f==="forbidden")return c.ip[h];const m=`\\/${h==="ipv4"?c.ip.v4Cidr:c.ip.v6Cidr}`;return f==="required"?`${c.ip[h]}${m}`:`${c.ip[h]}(?:${m})?`}).join("|")})`,p=new RegExp(`^${u}$`);return{cidr:f,versions:l,regex:p,raw:u}}},5752:(s,i,o)=>{const a=o(375),c=o(6064),d={generate:function(){const f={},l="\\dA-Fa-f",u="["+l+"]",p="\\w-\\.~",h="!\\$&'\\(\\)\\*\\+,;=",m="%"+l,y=p+m+h+":@",g="["+y+"]",v="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";f.ipv4address="(?:"+v+"\\.){3}"+v;const b=u+"{1,4}",_="(?:"+b+":"+b+"|"+f.ipv4address+")",A="(?:"+b+":){6}"+_,P="::(?:"+b+":){5}"+_,T="(?:"+b+")?::(?:"+b+":){4}"+_,E="(?:(?:"+b+":){0,1}"+b+")?::(?:"+b+":){3}"+_,N="(?:(?:"+b+":){0,2}"+b+")?::(?:"+b+":){2}"+_,k="(?:(?:"+b+":){0,3}"+b+")?::"+b+":"+_,M="(?:(?:"+b+":){0,4}"+b+")?::"+_,j="(?:(?:"+b+":){0,5}"+b+")?::"+b,I="(?:(?:"+b+":){0,6}"+b+")?::";f.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",f.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",f.ipv6address="(?:"+A+"|"+P+"|"+T+"|"+E+"|"+N+"|"+k+"|"+M+"|"+j+"|"+I+")",f.ipvFuture="v"+u+"+\\.["+p+h+":]+",f.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",f.schemeRegex=new RegExp(f.scheme);const L="["+p+m+h+":]*",H="["+p+m+h+"]{1,255}",K="(?:\\[(?:"+f.ipv6address+"|"+f.ipvFuture+")\\]|"+f.ipv4address+"|"+H+")",V="(?:"+L+"@)?"+K+"(?::\\d*)?",U="(?:"+L+"@)?("+K+")(?::\\d*)?",Q=g+"*",te=g+"+",X="(?:\\/"+Q+")*",G="\\/(?:"+te+X+")?",Y=te+X,Z="["+p+m+h+"@]+"+X,he="(?:\\/\\/\\/"+Q+X+")";return f.hierPart="(?:(?:\\/\\/"+V+X+")|"+G+"|"+Y+"|"+he+")",f.hierPartCapture="(?:(?:\\/\\/"+U+X+")|"+G+"|"+Y+")",f.relativeRef="(?:(?:\\/\\/"+V+X+")|"+G+"|"+Z+"|)",f.relativeRefCapture="(?:(?:\\/\\/"+U+X+")|"+G+"|"+Z+"|)",f.query="["+y+"\\/\\?]*(?=#|$)",f.queryWithSquareBrackets="["+y+"\\[\\]\\/\\?]*(?=#|$)",f.fragment="["+y+"\\/\\?]*",f}};d.rfc3986=d.generate(),i.ip={v4Cidr:d.rfc3986.ipv4Cidr,v6Cidr:d.rfc3986.ipv6Cidr,ipv4:d.rfc3986.ipv4address,ipv6:d.rfc3986.ipv6address,ipvfuture:d.rfc3986.ipvFuture},d.createRegex=function(f){const l=d.rfc3986,u="(?:\\?"+(f.allowQuerySquareBrackets?l.queryWithSquareBrackets:l.query)+")?(?:#"+l.fragment+")?",p=f.domain?l.relativeRefCapture:l.relativeRef;if(f.relativeOnly)return d.wrap(p+u);let h="";if(f.scheme){a(f.scheme instanceof RegExp||typeof f.scheme=="string"||Array.isArray(f.scheme),"scheme must be a RegExp, String, or Array");const g=[].concat(f.scheme);a(g.length>=1,"scheme must have at least 1 scheme specified");const v=[];for(let b=0;b{const o={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};i.Parser=class{constructor(a,c={}){if(!c[o.settings]&&c.constants)for(const d in c.constants){const f=c.constants[d];if(f!==null&&!["boolean","number","string"].includes(typeof f))throw new Error(`Formula constant ${d} contains invalid ${typeof f} value type`)}this.settings=c[o.settings]?c:Object.assign({[o.settings]:!0,constants:{},functions:{}},c),this.single=null,this._parts=null,this._parse(a)}_parse(a){let c=[],d="",f=0,l=!1;const u=h=>{if(f)throw new Error("Formula missing closing parenthesis");const m=c.length?c[c.length-1]:null;if(l||d||h){if(m&&m.type==="reference"&&h===")")return m.type="function",m.value=this._subFormula(d,m.value),void(d="");if(h===")"){const y=new i.Parser(d,this.settings);c.push({type:"segment",value:y})}else if(l){if(l==="]")return c.push({type:"reference",value:d}),void(d="");c.push({type:"literal",value:d})}else if(o.operatorCharacters.includes(d))m&&m.type==="operator"&&o.operators.includes(m.value+d)?m.value+=d:c.push({type:"operator",value:d});else if(d.match(o.numberRx))c.push({type:"constant",value:parseFloat(d)});else if(this.settings.constants[d]!==void 0)c.push({type:"constant",value:this.settings.constants[d]});else{if(!d.match(o.tokenRx))throw new Error(`Formula contains invalid token: ${d}`);c.push({type:"reference",value:d})}d=""}};for(const h of a)l?h===l?(u(),l=!1):d+=h:f?h==="("?(d+=h,++f):h===")"?(--f,f?d+=h:u(h)):d+=h:h in o.literals?l=o.literals[h]:h==="("?(u(),++f):o.operatorCharacters.includes(h)?(u(),d=h,u()):h!==" "?d+=h:u();u(),c=c.map((h,m)=>h.type!=="operator"||h.value!=="-"||m&&c[m-1].type!=="operator"?h:{type:"operator",value:"n"});let p=!1;for(const h of c){if(h.type==="operator"){if(o.operatorsPrefix.includes(h.value))continue;if(!p)throw new Error("Formula contains an operator in invalid position");if(!o.operators.includes(h.value))throw new Error(`Formula contains an unknown operator ${h.value}`)}else if(p)throw new Error("Formula missing expected operator");p=!p}if(!p)throw new Error("Formula contains invalid trailing operator");c.length===1&&["reference","literal","constant"].includes(c[0].type)&&(this.single={type:c[0].type==="reference"?"reference":"value",value:c[0].value}),this._parts=c.map(h=>{if(h.type==="operator")return o.operatorsPrefix.includes(h.value)?h:h.value;if(h.type!=="reference")return h.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(h.value))throw new Error(`Formula contains invalid reference ${h.value}`);return this.settings.reference?this.settings.reference(h.value):o.reference(h.value)})}_subFormula(a,c){const d=this.settings.functions[c];if(typeof d!="function")throw new Error(`Formula contains unknown function ${c}`);let f=[];if(a){let l="",u=0,p=!1;const h=()=>{if(!l)throw new Error(`Formula contains function ${c} with invalid arguments ${a}`);f.push(l),l=""};for(let m=0;mnew i.Parser(l,this.settings)),function(l){const u=[];for(const p of f)u.push(p.evaluate(l));return d.call(l,...u)}}evaluate(a){const c=this._parts.slice();for(let d=c.length-2;d>=0;--d){const f=c[d];if(f&&f.type==="operator"){const l=c[d+1];c.splice(d+1,1);const u=o.evaluate(l,a);c[d]=o.single(f.value,u)}}return o.operatorsOrder.forEach(d=>{for(let f=1;f":return c>d;case">=":return c>=d;case"==":return c===d;case"!=":return c!==d;case"&&":return c&&d;case"||":return c||d}return null},o.exists=function(a){return a!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:s=>{s.exports=JSON.parse('{"version":"17.13.3"}')}},r={},function s(i){var o=r[i];if(o!==void 0)return o.exports;var a=r[i]={exports:{}};return n[i](a,a.exports,s),a.exports}(5107);var n,r})})(oee);var XLe=oee.exports;const iu=Cu(XLe),ny=()=>{const t=S.useContext(uJ);if(t===void 0)throw new Error("useDataSource must be used within a DataSourceProvider");return t},QLe=()=>{const t=ny();return{useSubmitIncidence:e=>{const{mutateOptions:n={}}=e||{};return jl({mutationFn:r=>t.createOne({resource:"support",data:r}),...n})}}},ZLe=iu.object({incidence:iu.string().min(10).required().messages({"string.empty":"Debe escribir algo antes de enviar","string.min":"El texto es demasiado corto. Debe tener al menos 10 caracteres","string.max":"El texto es demasiado largo.","any.required":"La descripción es requerida"})});function JLe(){const[t,e]=S.useState(!1),[n,r]=S.useState(!1),{toast:s}=Jl(),{useSubmitIncidence:i}=QLe(),o=$_({mode:"onBlur",resolver:L$(ZLe),defaultValues:{incidence:""}}),{handleSubmit:a,watch:c,reset:d}=o,f=c("incidence"),{mutate:l}=i({mutateOptions:{onSuccess:()=>{s({title:"Incidencia enviada",description:"La incidencia se ha enviado correctamente",variant:"success"}),e(!1),d()},onError:()=>{s({title:"Error en el envío",description:"No se ha podido enviar la incidencia correctamente. Por favor, inténtalo de nuevo.",variant:"destructive"})}}}),u=async m=>{l(m)},p=()=>{console.log("handleClose",f.trim()),f.trim()?r(!0):(e(!1),d())},h=()=>{r(!1),e(!1),d()};return x.jsxs(x.Fragment,{children:[x.jsxs(E_,{open:t,onOpenChange:e,children:[x.jsx(e2,{asChild:!0,children:x.jsxs(Xe,{variant:"outline",size:"icon",className:"overflow-hidden rounded-full bg-primary text-primary-foreground",onClick:()=>e(!0),children:[x.jsx(bq,{className:"w-5 h-5"}),x.jsx("span",{className:"sr-only",children:"Abrir ventana de soporte"})]})}),x.jsxs(Cy,{className:"sm:max-w-xl",children:[x.jsxs(Ey,{className:"mb-2",children:[x.jsx(Ry,{children:ne("support.modal.title")}),x.jsx($R,{children:ne("support.modal.subtitle")})]}),x.jsx(F_,{...o,children:x.jsxs("form",{onSubmit:a(u),className:"space-y-4",children:[x.jsx(Ua,{name:"incidence",placeholder:"Describe la incidencia aquí...",className:"min-h-96"}),x.jsxs(Ay,{children:[x.jsx(Xe,{type:"button",variant:"outline",onClick:p,children:"Cancelar"}),x.jsx(Xe,{type:"submit",children:"Enviar incidencia"})]})]})})]})]}),x.jsx(NL,{open:n,onOpenChange:r,children:x.jsxs(hR,{children:[x.jsxs(pR,{children:[x.jsx(gR,{children:"¿Estás seguro de que quieres cancelar?"}),x.jsx(vR,{children:"Has escrito texto en el campo de descripción. Si cierras la ventana, perderás los cambios no guardados."})]}),x.jsxs(mR,{children:[x.jsx(bR,{onClick:()=>r(!1),children:"Volver al formulario"}),x.jsx(yR,{onClick:h,children:"Sí, cerrar"})]})]})})]})}var e2e={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};const t2e=Cu(e2e);var n2e=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function jU(t){var e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=t.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(e.name=n[1],(t2e[n[1]]||t.charAt(t.length-2)==="/")&&(e.voidElement=!0),e.name.startsWith("!--"))){var r=t.indexOf("-->");return{type:"comment",comment:r!==-1?t.slice(4,r):""}}for(var s=new RegExp(n2e),i=null;(i=s.exec(t))!==null;)if(i[0].trim())if(i[1]){var o=i[1].trim(),a=[o,""];o.indexOf("=")>-1&&(a=o.split("=")),e.attrs[a[0]]=a[1],s.lastIndex--}else i[2]&&(e.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return e}var r2e=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,s2e=/^\s*$/,i2e=Object.create(null);function aee(t,e){switch(e.type){case"text":return t+e.content;case"tag":return t+="<"+e.name+(e.attrs?function(n){var r=[];for(var s in n)r.push(s+'="'+n[s]+'"');return r.length?" "+r.join(" "):""}(e.attrs):"")+(e.voidElement?"/>":">"),e.voidElement?t:t+e.children.reduce(aee,"")+"";case"comment":return t+""}}var o2e={parse:function(t,e){e||(e={}),e.components||(e.components=i2e);var n,r=[],s=[],i=-1,o=!1;if(t.indexOf("<")!==0){var a=t.indexOf("<");r.push({type:"text",content:a===-1?t:t.substring(0,a)})}return t.replace(r2e,function(c,d){if(o){if(c!=="")return;o=!1}var f,l=c.charAt(1)!=="/",u=c.startsWith("