From 59a5bc946b0a7ce2b29bdcb93dbe8a8b7e711c91 Mon Sep 17 00:00:00 2001 From: David Arranz Date: Thu, 17 Apr 2025 23:28:43 +0200 Subject: [PATCH] 1.1.5 --- client/package.json | 2 +- client/src/App.tsx | 4 +- .../{index-BF64vagP.js => index-BlDPpDKA.js} | 44 +++++++++---------- .../{index-CCynU4SE.js => index-C-8NN2V_.js} | 4 +- dist/client/index.html | 2 +- package.json | 2 +- server/package.json | 2 +- shared/package.json | 2 +- 8 files changed, 32 insertions(+), 30 deletions(-) rename dist/client/assets/{index-BF64vagP.js => index-BlDPpDKA.js} (98%) rename dist/client/assets/{index-CCynU4SE.js => index-C-8NN2V_.js} (99%) diff --git a/client/package.json b/client/package.json index 7f2a62a..54ad77b 100644 --- a/client/package.json +++ b/client/package.json @@ -1,7 +1,7 @@ { "name": "@uecko-presupuestador/client", "private": true, - "version": "1.1.4", + "version": "1.1.5", "author": "Rodax Software ", "type": "module", "scripts": { diff --git a/client/src/App.tsx b/client/src/App.tsx index 7a7fb1b..f88bbfd 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -35,7 +35,9 @@ function App() { - + {import.meta.env.MODE === "development" && ( + + )} diff --git a/dist/client/assets/index-BF64vagP.js b/dist/client/assets/index-BlDPpDKA.js similarity index 98% rename from dist/client/assets/index-BF64vagP.js rename to dist/client/assets/index-BlDPpDKA.js index 02d0ff7..c6ad878 100644 --- a/dist/client/assets/index-BF64vagP.js +++ b/dist/client/assets/index-BlDPpDKA.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CCynU4SE.js","assets/index-DtTssDoC.css"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C-8NN2V_.js","assets/index-DtTssDoC.css"])))=>i.map(i=>d[i]); var Ole=Object.defineProperty;var Oj=t=>{throw TypeError(t)};var Mle=(t,e,n)=>e in t?Ole(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Le=(t,e,n)=>Mle(t,typeof e!="symbol"?e+"":e,n),TP=(t,e,n)=>e.has(t)||Oj("Cannot "+n);var C=(t,e,n)=>(TP(t,e,"read from private field"),n?n.call(t):e.get(t)),B=(t,e,n)=>e.has(t)?Oj("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),$=(t,e,n,r)=>(TP(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),z=(t,e,n)=>(TP(t,e,"access private method"),n);var _s=(t,e,n,r)=>({set _(s){$(t,e,s,n)},get _(){return C(t,e,r)}});function b5(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 a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).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 _r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Lle(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 w5={exports:{}},R1={},_5={exports:{}},Mt={};/** * @license React * react.production.min.js @@ -38,7 +38,7 @@ var Ole=Object.defineProperty;var Oj=t=>{throw TypeError(t)};var Mle=(t,e,n)=>e `+s[a].replace(" at new "," at ");return t.displayName&&c.includes("")&&(c=c.replace("",t.displayName)),c}while(1<=a&&0<=o);break}}}finally{DP=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Uy(t):""}function cce(t){switch(t.tag){case 5:return Uy(t.type);case 16:return Uy("Lazy");case 13:return Uy("Suspense");case 19:return Uy("SuspenseList");case 0:case 2:case 15:return t=OP(t.type,!1),t;case 11:return t=OP(t.type.render,!1),t;case 1:return t=OP(t.type,!0),t;default:return""}}function $k(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 gm:return"Fragment";case mm:return"Portal";case Mk:return"Profiler";case xM:return"StrictMode";case Lk:return"Suspense";case Ik:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case I5:return(t.displayName||"Context")+".Consumer";case L5:return(t._context.displayName||"Context")+".Provider";case SM:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case EM:return e=t.displayName||null,e!==null?e:$k(t.type)||"Memo";case Ru:e=t._payload,t=t._init;try{return $k(t(e))}catch{}}return null}function uce(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 $k(e);case 8:return e===xM?"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 Cd(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function F5(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function dce(t){var e=F5(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(a){r=""+a,i.call(this,a)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function zx(t){t._valueTracker||(t._valueTracker=dce(t))}function j5(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=F5(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function ME(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 Fk(t,e){var n=e.checked;return ar({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function Bj(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Cd(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 B5(t,e){e=e.checked,e!=null&&_M(t,"checked",e,!1)}function jk(t,e){B5(t,e);var n=Cd(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")?Bk(t,e.type,n):e.hasOwnProperty("defaultValue")&&Bk(t,e.type,Cd(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function zj(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 Bk(t,e,n){(e!=="number"||ME(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Hy=Array.isArray;function Dm(t,e,n,r){if(t=t.options,e){e={};for(var s=0;s"+e.valueOf().toString()+"",e=Ux.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Ib(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var mb={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},fce=["Webkit","ms","Moz","O"];Object.keys(mb).forEach(function(t){fce.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),mb[e]=mb[t]})});function V5(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||mb.hasOwnProperty(t)&&mb[t]?(""+e).trim():e+"px"}function W5(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=V5(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,s):t[n]=s}}var hce=ar({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 Hk(t,e){if(e){if(hce[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 Vk(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 Wk=null;function CM(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Gk=null,Om=null,Mm=null;function Vj(t){if(t=o_(t)){if(typeof Gk!="function")throw Error(ke(280));var e=t.stateNode;e&&(e=D1(e),Gk(t.stateNode,t.type,e))}}function G5(t){Om?Mm?Mm.push(t):Mm=[t]:Om=t}function q5(){if(Om){var t=Om,e=Mm;if(Mm=Om=null,Vj(t),e)for(t=0;t>>=0,t===0?32:31-(Ece(t)/Cce|0)|0}var Hx=64,Vx=4194304;function Vy(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 FE(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,s=t.suspendedLanes,i=t.pingedLanes,a=n&268435455;if(a!==0){var o=a&~s;o!==0?r=Vy(o):(i&=a,i!==0&&(r=Vy(i)))}else a=n&~s,a!==0?r=Vy(a):i!==0&&(r=Vy(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 s_(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-xa(e),t[e]=n}function Tce(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=vb),Jj=" ",e3=!1;function hH(t,e){switch(t){case"keyup":return rue.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pH(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var vm=!1;function iue(t,e){switch(t){case"compositionend":return pH(e);case"keypress":return e.which!==32?null:(e3=!0,Jj);case"textInput":return t=e.data,t===Jj&&e3?null:t;default:return null}}function oue(t,e){if(vm)return t==="compositionend"||!OM&&hH(t,e)?(t=dH(),FS=kM=fd=null,vm=!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=s3(n)}}function yH(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?yH(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function bH(){for(var t=window,e=ME();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=ME(t.document)}return e}function MM(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 mue(t){var e=bH(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&yH(n.ownerDocument.documentElement,n)){if(r!==null&&MM(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=i3(n,i);var a=i3(n,r);s&&a&&(t.rangeCount!==1||t.anchorNode!==s.node||t.anchorOffset!==s.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),t.removeAllRanges(),i>r?(t.addRange(e),t.extend(a.node,a.offset)):(e.setEnd(a.node,a.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,ym=null,Zk=null,bb=null,Jk=!1;function o3(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Jk||ym==null||ym!==ME(r)||(r=ym,"selectionStart"in r&&MM(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}),bb&&Ub(bb,r)||(bb=r,r=zE(Zk,"onSelect"),0_m||(t.current=iN[_m],iN[_m]=null,_m--)}function In(t,e){_m++,iN[_m]=t.current,t.current=e}var Ad={},Is=Id(Ad),Ci=Id(!1),$h=Ad;function av(t,e){var n=t.type.contextTypes;if(!n)return Ad;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 Ai(t){return t=t.childContextTypes,t!=null}function HE(){Vn(Ci),Vn(Is)}function h3(t,e,n){if(Is.current!==Ad)throw Error(ke(168));In(Is,e),In(Ci,n)}function PH(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,uce(t)||"Unknown",s));return ar({},n,r)}function VE(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Ad,$h=Is.current,In(Is,t),In(Ci,Ci.current),!0}function p3(t,e,n){var r=t.stateNode;if(!r)throw Error(ke(169));n?(t=PH(t,e,$h),r.__reactInternalMemoizedMergedChildContext=t,Vn(Ci),Vn(Is),In(Is,t)):Vn(Ci),In(Ci,n)}var tc=null,O1=!1,qP=!1;function TH(t){tc===null?tc=[t]:tc.push(t)}function Rue(t){O1=!0,TH(t)}function $d(){if(!qP&&tc!==null){qP=!0;var t=0,e=mn;try{var n=tc;for(mn=1;t>=a,s-=a,kc=1<<32-xa(e)+s|n<E?(k=R,R=null):k=R.sibling;var N=d(g,R,w[E],x);if(N===null){R===null&&(R=k);break}t&&R&&N.alternate===null&&e(g,R),v=i(N,v,E),T===null?A=N:T.sibling=N,T=N,R=k}if(E===w.length)return n(g,R),Xn&&uf(g,E),A;if(R===null){for(;EE?(k=R,R=null):k=R.sibling;var O=d(g,R,N.value,x);if(O===null){R===null&&(R=k);break}t&&R&&O.alternate===null&&e(g,R),v=i(O,v,E),T===null?A=O:T.sibling=O,T=O,R=k}if(N.done)return n(g,R),Xn&&uf(g,E),A;if(R===null){for(;!N.done;E++,N=w.next())N=l(g,N.value,x),N!==null&&(v=i(N,v,E),T===null?A=N:T.sibling=N,T=N);return Xn&&uf(g,E),A}for(R=r(g,R);!N.done;E++,N=w.next())N=m(R,g,E,N.value,x),N!==null&&(t&&N.alternate!==null&&R.delete(N.key===null?E:N.key),v=i(N,v,E),T===null?A=N:T.sibling=N,T=N);return t&&R.forEach(function(L){return e(g,L)}),Xn&&uf(g,E),A}function y(g,v,w,x){if(typeof w=="object"&&w!==null&&w.type===gm&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Bx:e:{for(var A=w.key,T=v;T!==null;){if(T.key===A){if(A=w.type,A===gm){if(T.tag===7){n(g,T.sibling),v=s(T,w.props.children),v.return=g,g=v;break e}}else if(T.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===Ru&&v3(A)===T.type){n(g,T.sibling),v=s(T,w.props),v.ref=by(g,T,w),v.return=g,g=v;break e}n(g,T);break}else e(g,T);T=T.sibling}w.type===gm?(v=Dh(w.props.children,g.mode,x,w.key),v.return=g,g=v):(x=GS(w.type,w.key,w.props,null,g.mode,x),x.ref=by(g,v,w),x.return=g,g=x)}return a(g);case mm:e:{for(T=w.key;v!==null;){if(v.key===T)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){n(g,v.sibling),v=s(v,w.children||[]),v.return=g,g=v;break e}else{n(g,v);break}else e(g,v);v=v.sibling}v=tT(w,g.mode,x),v.return=g,g=v}return a(g);case Ru:return T=w._init,y(g,v,T(w._payload),x)}if(Hy(w))return p(g,v,w,x);if(py(w))return h(g,v,w,x);Qx(g,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(n(g,v.sibling),v=s(v,w),v.return=g,g=v):(n(g,v),v=eT(w,g.mode,x),v.return=g,g=v),a(g)):n(g,v)}return y}var cv=OH(!0),MH=OH(!1),qE=Id(null),KE=null,Em=null,FM=null;function jM(){FM=Em=KE=null}function BM(t){var e=qE.current;Vn(qE),t._currentValue=e}function lN(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 Im(t,e){KE=t,FM=Em=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(wi=!0),t.firstContext=null)}function zo(t){var e=t._currentValue;if(FM!==t)if(t={context:t,memoizedValue:e,next:null},Em===null){if(KE===null)throw Error(ke(308));Em=t,KE.dependencies={lanes:0,firstContext:t}}else Em=Em.next=t;return e}var xf=null;function zM(t){xf===null?xf=[t]:xf.push(t)}function LH(t,e,n,r){var s=e.interleaved;return s===null?(n.next=n,zM(e)):(n.next=s.next,s.next=n),e.interleaved=n,Uc(t,r)}function Uc(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 Pu=!1;function UM(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function IH(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 Dc(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function bd(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,qt&2){var s=r.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),r.pending=e,Uc(t,n)}return s=r.interleaved,s===null?(e.next=e,zM(r)):(e.next=s.next,s.next=e),r.interleaved=e,Uc(t,n)}function BS(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,RM(t,n)}}function y3(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 a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=a:i=i.next=a,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 YE(t,e,n,r){var s=t.updateQueue;Pu=!1;var i=s.firstBaseUpdate,a=s.lastBaseUpdate,o=s.shared.pending;if(o!==null){s.shared.pending=null;var c=o,u=c.next;c.next=null,a===null?i=u:a.next=u,a=c;var f=t.alternate;f!==null&&(f=f.updateQueue,o=f.lastBaseUpdate,o!==a&&(o===null?f.firstBaseUpdate=u:o.next=u,f.lastBaseUpdate=c))}if(i!==null){var l=s.baseState;a=0,f=u=c=null,o=i;do{var d=o.lane,m=o.eventTime;if((r&d)===d){f!==null&&(f=f.next={eventTime:m,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var p=t,h=o;switch(d=e,m=n,h.tag){case 1:if(p=h.payload,typeof p=="function"){l=p.call(m,l,d);break e}l=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=h.payload,d=typeof p=="function"?p.call(m,l,d):p,d==null)break e;l=ar({},l,d);break e;case 2:Pu=!0}}o.callback!==null&&o.lane!==0&&(t.flags|=64,d=s.effects,d===null?s.effects=[o]:d.push(o))}else m={eventTime:m,lane:d,tag:o.tag,payload:o.payload,callback:o.callback,next:null},f===null?(u=f=m,c=l):f=f.next=m,a|=d;if(o=o.next,o===null){if(o=s.shared.pending,o===null)break;d=o,o=d.next,d.next=null,s.lastBaseUpdate=d,s.shared.pending=null}}while(!0);if(f===null&&(c=l),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=f,e=s.shared.interleaved,e!==null){s=e;do a|=s.lane,s=s.next;while(s!==e)}else i===null&&(s.shared.lanes=0);Bh|=a,t.lanes=a,t.memoizedState=l}}function b3(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=YP.transition;YP.transition={};try{t(!1),e()}finally{mn=n,YP.transition=r}}function JH(){return Uo().memoizedState}function Nue(t,e,n){var r=_d(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},eV(t))tV(e,n);else if(n=LH(t,e,n,r),n!==null){var s=Zs();Sa(n,t,r,s),nV(n,e,r)}}function Due(t,e,n){var r=_d(t),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(eV(t))tV(e,s);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var a=e.lastRenderedState,o=i(a,n);if(s.hasEagerState=!0,s.eagerState=o,Ca(o,a)){var c=e.interleaved;c===null?(s.next=s,zM(e)):(s.next=c.next,c.next=s),e.interleaved=s;return}}catch{}finally{}n=LH(t,e,s,r),n!==null&&(s=Zs(),Sa(n,t,r,s),nV(n,e,r))}}function eV(t){var e=t.alternate;return t===or||e!==null&&e===or}function tV(t,e){wb=QE=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function nV(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,RM(t,n)}}var ZE={readContext:zo,useCallback:xs,useContext:xs,useEffect:xs,useImperativeHandle:xs,useInsertionEffect:xs,useLayoutEffect:xs,useMemo:xs,useReducer:xs,useRef:xs,useState:xs,useDebugValue:xs,useDeferredValue:xs,useTransition:xs,useMutableSource:xs,useSyncExternalStore:xs,useId:xs,unstable_isNewReconciler:!1},Oue={readContext:zo,useCallback:function(t,e){return Wa().memoizedState=[t,e===void 0?null:e],t},useContext:zo,useEffect:_3,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,US(4194308,4,KH.bind(null,e,t),n)},useLayoutEffect:function(t,e){return US(4194308,4,t,e)},useInsertionEffect:function(t,e){return US(4,2,t,e)},useMemo:function(t,e){var n=Wa();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Wa();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=Nue.bind(null,or,t),[r.memoizedState,t]},useRef:function(t){var e=Wa();return t={current:t},e.memoizedState=t},useState:w3,useDebugValue:XM,useDeferredValue:function(t){return Wa().memoizedState=t},useTransition:function(){var t=w3(!1),e=t[0];return t=kue.bind(null,t[1]),Wa().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=or,s=Wa();if(Xn){if(n===void 0)throw Error(ke(407));n=n()}else{if(n=e(),ts===null)throw Error(ke(349));jh&30||BH(r,e,n)}s.memoizedState=n;var i={value:n,getSnapshot:e};return s.queue=i,_3(UH.bind(null,r,i,t),[t]),r.flags|=2048,Xb(9,zH.bind(null,r,i,n,e),void 0,null),n},useId:function(){var t=Wa(),e=ts.identifierPrefix;if(Xn){var n=Nc,r=kc;n=(r&~(1<<32-xa(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Kb++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=a.createElement(n,{is:r.is}):(t=a.createElement(n),n==="select"&&(a=t,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):t=a.createElementNS(t,n),t[fl]=e,t[Wb]=r,fV(t,e,!1,!1),e.stateNode=t;e:{switch(a=Vk(n,r),n){case"dialog":Un("cancel",t),Un("close",t),s=r;break;case"iframe":case"object":case"embed":Un("load",t),s=r;break;case"video":case"audio":for(s=0;sfv&&(e.flags|=128,r=!0,wy(i,!1),e.lanes=4194304)}else{if(!r)if(t=XE(a),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),wy(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!Xn)return Ss(e),null}else 2*wr()-i.renderingStartTime>fv&&n!==1073741824&&(e.flags|=128,r=!0,wy(i,!1),e.lanes=4194304);i.isBackwards?(a.sibling=e.child,e.child=a):(n=i.last,n!==null?n.sibling=a:e.child=a,i.last=a)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=wr(),e.sibling=null,n=rr.current,In(rr,r?n&1|2:n&1),e):(Ss(e),null);case 22:case 23:return nL(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Ji&1073741824&&(Ss(e),e.subtreeFlags&6&&(e.flags|=8192)):Ss(e),null;case 24:return null;case 25:return null}throw Error(ke(156,e.tag))}function zue(t,e){switch(IM(e),e.tag){case 1:return Ai(e.type)&&HE(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return uv(),Vn(Ci),Vn(Is),WM(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return VM(e),null;case 13:if(Vn(rr),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(ke(340));lv()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Vn(rr),null;case 4:return uv(),null;case 10:return BM(e.type._context),null;case 22:case 23:return nL(),null;case 24:return null;default:return null}}var Jx=!1,Ns=!1,Uue=typeof WeakSet=="function"?WeakSet:Set,Ge=null;function Cm(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){pr(t,e,r)}else n.current=null}function vN(t,e,n){try{n()}catch(r){pr(t,e,r)}}var D3=!1;function Hue(t,e){if(eN=jE,t=bH(),MM(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 a=0,o=-1,c=-1,u=0,f=0,l=t,d=null;t:for(;;){for(var m;l!==n||s!==0&&l.nodeType!==3||(o=a+s),l!==i||r!==0&&l.nodeType!==3||(c=a+r),l.nodeType===3&&(a+=l.nodeValue.length),(m=l.firstChild)!==null;)d=l,l=m;for(;;){if(l===t)break t;if(d===n&&++u===s&&(o=a),d===i&&++f===r&&(c=a),(m=l.nextSibling)!==null)break;l=d,d=l.parentNode}l=m}n=o===-1||c===-1?null:{start:o,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(tN={focusedElem:t,selectionRange:n},jE=!1,Ge=e;Ge!==null;)if(e=Ge,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ge=t;else for(;Ge!==null;){e=Ge;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var h=p.memoizedProps,y=p.memoizedState,g=e.stateNode,v=g.getSnapshotBeforeUpdate(e.elementType===e.type?h:ea(e.type,h),y);g.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=e.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ke(163))}}catch(x){pr(e,e.return,x)}if(t=e.sibling,t!==null){t.return=e.return,Ge=t;break}Ge=e.return}return p=D3,D3=!1,p}function _b(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&&vN(e,n,i)}s=s.next}while(s!==r)}}function I1(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 yN(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 mV(t){var e=t.alternate;e!==null&&(t.alternate=null,mV(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[fl],delete e[Wb],delete e[sN],delete e[Cue],delete e[Aue])),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 gV(t){return t.tag===5||t.tag===3||t.tag===4}function O3(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||gV(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 bN(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=UE));else if(r!==4&&(t=t.child,t!==null))for(bN(t,e,n),t=t.sibling;t!==null;)bN(t,e,n),t=t.sibling}function wN(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(wN(t,e,n),t=t.sibling;t!==null;)wN(t,e,n),t=t.sibling}var fs=null,va=!1;function pu(t,e,n){for(n=n.child;n!==null;)vV(t,e,n),n=n.sibling}function vV(t,e,n){if(vl&&typeof vl.onCommitFiberUnmount=="function")try{vl.onCommitFiberUnmount(P1,n)}catch{}switch(n.tag){case 5:Ns||Cm(n,e);case 6:var r=fs,s=va;fs=null,pu(t,e,n),fs=r,va=s,fs!==null&&(va?(t=fs,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):fs.removeChild(n.stateNode));break;case 18:fs!==null&&(va?(t=fs,n=n.stateNode,t.nodeType===8?GP(t.parentNode,n):t.nodeType===1&&GP(t,n),Bb(t)):GP(fs,n.stateNode));break;case 4:r=fs,s=va,fs=n.stateNode.containerInfo,va=!0,pu(t,e,n),fs=r,va=s;break;case 0:case 11:case 14:case 15:if(!Ns&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&vN(n,e,a),s=s.next}while(s!==r)}pu(t,e,n);break;case 1:if(!Ns&&(Cm(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){pr(n,e,o)}pu(t,e,n);break;case 21:pu(t,e,n);break;case 22:n.mode&1?(Ns=(r=Ns)||n.memoizedState!==null,pu(t,e,n),Ns=r):pu(t,e,n);break;default:pu(t,e,n)}}function M3(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new Uue),e.forEach(function(r){var s=Zue.bind(null,t,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Zo(t,e){var n=e.deletions;if(n!==null)for(var r=0;rs&&(s=a),r&=~i}if(r=s,r=wr()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Wue(r/1960))-r,10t?16:t,hd===null)var r=!1;else{if(t=hd,hd=null,tC=0,qt&6)throw Error(ke(331));var s=qt;for(qt|=4,Ge=t.current;Ge!==null;){var i=Ge,a=i.child;if(Ge.flags&16){var o=i.deletions;if(o!==null){for(var c=0;cwr()-eL?Nh(t,0):JM|=n),Ri(t,e)}function CV(t,e){e===0&&(t.mode&1?(e=Vx,Vx<<=1,!(Vx&130023424)&&(Vx=4194304)):e=1);var n=Zs();t=Uc(t,e),t!==null&&(s_(t,e,n),Ri(t,n))}function Que(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),CV(t,n)}function Zue(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),CV(t,n)}var AV;AV=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Ci.current)wi=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return wi=!1,jue(t,e,n);wi=!!(t.flags&131072)}else wi=!1,Xn&&e.flags&1048576&&kH(e,GE,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;HS(t,e),t=e.pendingProps;var s=av(e,Is.current);Im(e,n),s=qM(null,e,r,t,s,n);var i=KM();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,Ai(r)?(i=!0,VE(e)):i=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,UM(e),s.updater=L1,e.stateNode=s,s._reactInternals=e,uN(e,r,t,n),e=hN(null,e,r,!0,i,n)):(e.tag=0,Xn&&i&&LM(e),qs(null,e,s,n),e=e.child),e;case 16:r=e.elementType;e:{switch(HS(t,e),t=e.pendingProps,s=r._init,r=s(r._payload),e.type=r,s=e.tag=ede(r),t=ea(r,t),s){case 0:e=fN(null,e,r,t,n);break e;case 1:e=T3(null,e,r,t,n);break e;case 11:e=R3(null,e,r,t,n);break e;case 14:e=P3(null,e,r,ea(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:ea(r,s),fN(t,e,r,s,n);case 1:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:ea(r,s),T3(t,e,r,s,n);case 3:e:{if(cV(e),t===null)throw Error(ke(387));r=e.pendingProps,i=e.memoizedState,s=i.element,IH(t,e),YE(e,r,null,n);var a=e.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){s=dv(Error(ke(423)),e),e=k3(t,e,r,n,s);break e}else if(r!==s){s=dv(Error(ke(424)),e),e=k3(t,e,r,n,s);break e}else for(io=yd(e.stateNode.containerInfo.firstChild),oo=e,Xn=!0,ba=null,n=MH(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(lv(),r===s){e=Hc(t,e,n);break e}qs(t,e,r,n)}e=e.child}return e;case 5:return $H(e),t===null&&aN(e),r=e.type,s=e.pendingProps,i=t!==null?t.memoizedProps:null,a=s.children,nN(r,s)?a=null:i!==null&&nN(r,i)&&(e.flags|=32),lV(t,e),qs(t,e,a,n),e.child;case 6:return t===null&&aN(e),null;case 13:return uV(t,e,n);case 4:return HM(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=cv(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:ea(r,s),R3(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,a=s.value,In(qE,r._currentValue),r._currentValue=a,i!==null)if(Ca(i.value,a)){if(i.children===s.children&&!Ci.current){e=Hc(t,e,n);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){a=i.child;for(var c=o.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=Dc(-1,n&-n),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?c.next=c:(c.next=f.next,f.next=c),u.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),lN(i.return,n,e),o.lanes|=n;break}c=c.next}}else if(i.tag===10)a=i.type===e.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(ke(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),lN(a,n,e),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===e){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}qs(t,e,s.children,n),e=e.child}return e;case 9:return s=e.type,r=e.pendingProps.children,Im(e,n),s=zo(s),r=r(s),e.flags|=1,qs(t,e,r,n),e.child;case 14:return r=e.type,s=ea(r,e.pendingProps),s=ea(r.type,s),P3(t,e,r,s,n);case 15:return oV(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:ea(r,s),HS(t,e),e.tag=1,Ai(r)?(t=!0,VE(e)):t=!1,Im(e,n),rV(e,r,s),uN(e,r,s,n),hN(null,e,r,!0,t,n);case 19:return dV(t,e,n);case 22:return aV(t,e,n)}throw Error(ke(156,e.tag))};function RV(t,e){return eH(t,e)}function Jue(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 Fo(t,e,n,r){return new Jue(t,e,n,r)}function sL(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ede(t){if(typeof t=="function")return sL(t)?1:0;if(t!=null){if(t=t.$$typeof,t===SM)return 11;if(t===EM)return 14}return 2}function xd(t,e){var n=t.alternate;return n===null?(n=Fo(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 GS(t,e,n,r,s,i){var a=2;if(r=t,typeof t=="function")sL(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case gm:return Dh(n.children,s,i,e);case xM:a=8,s|=8;break;case Mk:return t=Fo(12,n,e,s|2),t.elementType=Mk,t.lanes=i,t;case Lk:return t=Fo(13,n,e,s),t.elementType=Lk,t.lanes=i,t;case Ik:return t=Fo(19,n,e,s),t.elementType=Ik,t.lanes=i,t;case $5:return F1(n,s,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case L5:a=10;break e;case I5:a=9;break e;case SM:a=11;break e;case EM:a=14;break e;case Ru:a=16,r=null;break e}throw Error(ke(130,t==null?t:typeof t,""))}return e=Fo(a,n,e,s),e.elementType=t,e.type=r,e.lanes=i,e}function Dh(t,e,n,r){return t=Fo(7,t,r,e),t.lanes=n,t}function F1(t,e,n,r){return t=Fo(22,t,r,e),t.elementType=$5,t.lanes=n,t.stateNode={isHidden:!1},t}function eT(t,e,n){return t=Fo(6,t,null,e),t.lanes=n,t}function tT(t,e,n){return e=Fo(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function tde(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=LP(0),this.expirationTimes=LP(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=LP(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function iL(t,e,n,r,s,i,a,o,c){return t=new tde(t,e,n,o,c),e===1?(e=1,i===!0&&(e|=8)):e=0,i=Fo(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},UM(i),t}function nde(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(NV)}catch(t){console.error(t)}}NV(),N5.exports=ho;var Ms=N5.exports;const l_=Yc(Ms),ade=b5({__proto__:null,default:l_},[Ms]);var U3=Ms;Dk.createRoot=U3.createRoot,Dk.hydrateRoot=U3.hydrateRoot;const DV=_.createContext({}),lde=({children:t,authActions:e})=>{const n=i=>{var a;try{return Promise.resolve((a=e.login)==null?void 0:a.call(e,i))}catch(o){return console.error(o),Promise.reject(o)}},r=i=>{var a;try{return Promise.resolve((a=e.logout)==null?void 0:a.call(e,i))}catch(o){return console.error(o),Promise.reject(o)}},s=async()=>{var i;try{return Promise.resolve((i=e.check)==null?void 0:i.call(e))}catch(a){return console.error(a),Promise.reject(a)}};return P.jsx(DV.Provider,{value:{...e,login:n,logout:r,check:s},children:t})},OV=()=>{const t=_.useContext(DV);if(t===null)throw new Error("useAuth must be used within a AuthProvider");return t};var Av=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(){}},Uh=typeof window>"u"||"Deno"in globalThis;function To(){}function cde(t,e){return typeof t=="function"?t(e):t}function CN(t){return typeof t=="number"&&t>=0&&t!==1/0}function MV(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Fm(t,e){return typeof t=="function"?t(e):t}function wa(t,e){return typeof t=="function"?t(e):t}function H3(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:o}=t;if(a){if(r){if(e.queryHash!==cL(a,e.options))return!1}else if(!Zb(e.queryKey,a))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof o=="boolean"&&e.isStale()!==o||s&&s!==e.state.fetchStatus||i&&!i(e))}function V3(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(Hh(e.options.mutationKey)!==Hh(i))return!1}else if(!Zb(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function cL(t,e){return((e==null?void 0:e.queryKeyHashFn)||Hh)(t)}function Hh(t){return JSON.stringify(t,(e,n)=>AN(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Zb(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Zb(t[n],e[n])):!1}function LV(t,e){if(t===e)return t;const n=W3(t)&&W3(e);if(n||AN(t)&&AN(e)){const r=n?t:Object.keys(t),s=r.length,i=n?e:Object.keys(e),a=i.length,o=n?[]:{};let c=0;for(let u=0;u{setTimeout(e,t)})}function RN(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?LV(t,e):e}function Z4e(t){return t}function dde(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function fde(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var uL=Symbol();function IV(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===uL?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var Pf,Iu,Zm,a5,hde=(a5=class extends Av{constructor(){super();B(this,Pf);B(this,Iu);B(this,Zm);$(this,Zm,e=>{if(!Uh&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){C(this,Iu)||this.setEventListener(C(this,Zm))}onUnsubscribe(){var e;this.hasListeners()||((e=C(this,Iu))==null||e.call(this),$(this,Iu,void 0))}setEventListener(e){var n;$(this,Zm,e),(n=C(this,Iu))==null||n.call(this),$(this,Iu,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){C(this,Pf)!==e&&($(this,Pf,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof C(this,Pf)=="boolean"?C(this,Pf):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Pf=new WeakMap,Iu=new WeakMap,Zm=new WeakMap,a5),dL=new hde,Jm,$u,eg,l5,pde=(l5=class extends Av{constructor(){super();B(this,Jm,!0);B(this,$u);B(this,eg);$(this,eg,e=>{if(!Uh&&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(){C(this,$u)||this.setEventListener(C(this,eg))}onUnsubscribe(){var e;this.hasListeners()||((e=C(this,$u))==null||e.call(this),$(this,$u,void 0))}setEventListener(e){var n;$(this,eg,e),(n=C(this,$u))==null||n.call(this),$(this,$u,e(this.setOnline.bind(this)))}setOnline(e){C(this,Jm)!==e&&($(this,Jm,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return C(this,Jm)}},Jm=new WeakMap,$u=new WeakMap,eg=new WeakMap,l5),iC=new pde;function PN(){let t,e;const n=new Promise((s,i)=>{t=s,e=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),t(s)},n.reject=s=>{r({status:"rejected",reason:s}),e(s)},n}function mde(t){return Math.min(1e3*2**t,3e4)}function $V(t){return(t??"online")==="online"?iC.isOnline():!0}var FV=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function nT(t){return t instanceof FV}function jV(t){let e=!1,n=0,r=!1,s;const i=PN(),a=h=>{var y;r||(d(new FV(h)),(y=t.abort)==null||y.call(t))},o=()=>{e=!0},c=()=>{e=!1},u=()=>dL.isFocused()&&(t.networkMode==="always"||iC.isOnline())&&t.canRun(),f=()=>$V(t.networkMode)&&t.canRun(),l=h=>{var y;r||(r=!0,(y=t.onSuccess)==null||y.call(t,h),s==null||s(),i.resolve(h))},d=h=>{var y;r||(r=!0,(y=t.onError)==null||y.call(t,h),s==null||s(),i.reject(h))},m=()=>new Promise(h=>{var y;s=g=>{(r||u())&&h(g)},(y=t.onPause)==null||y.call(t)}).then(()=>{var h;s=void 0,r||(h=t.onContinue)==null||h.call(t)}),p=()=>{if(r)return;let h;const y=n===0?t.initialPromise:void 0;try{h=y??t.fn()}catch(g){h=Promise.reject(g)}Promise.resolve(h).then(l).catch(g=>{var T;if(r)return;const v=t.retry??(Uh?0:3),w=t.retryDelay??mde,x=typeof w=="function"?w(n,g):w,A=v===!0||typeof v=="number"&&nu()?void 0:m()).then(()=>{e?d(g):p()})})};return{promise:i,cancel:a,continue:()=>(s==null||s(),i),cancelRetry:o,continueRetry:c,canStart:f,start:()=>(f()?p():m().then(p),i)}}var gde=t=>setTimeout(t,0);function vde(){let t=[],e=0,n=o=>{o()},r=o=>{o()},s=gde;const i=o=>{e?t.push(o):s(()=>{n(o)})},a=()=>{const o=t;t=[],o.length&&s(()=>{r(()=>{o.forEach(c=>{n(c)})})})};return{batch:o=>{let c;e++;try{c=o()}finally{e--,e||a()}return c},batchCalls:o=>(...c)=>{i(()=>{o(...c)})},schedule:i,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{s=o}}}var Vr=vde(),Tf,c5,BV=(c5=class{constructor(){B(this,Tf)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),CN(this.gcTime)&&$(this,Tf,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Uh?1/0:5*60*1e3))}clearGcTimeout(){C(this,Tf)&&(clearTimeout(C(this,Tf)),$(this,Tf,void 0))}},Tf=new WeakMap,c5),tg,ng,Eo,kf,Rs,w0,Nf,na,Kl,u5,yde=(u5=class extends BV{constructor(e){super();B(this,na);B(this,tg);B(this,ng);B(this,Eo);B(this,kf);B(this,Rs);B(this,w0);B(this,Nf);$(this,Nf,!1),$(this,w0,e.defaultOptions),this.setOptions(e.options),this.observers=[],$(this,kf,e.client),$(this,Eo,C(this,kf).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,$(this,tg,bde(this.options)),this.state=e.state??C(this,tg),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=C(this,Rs))==null?void 0:e.promise}setOptions(e){this.options={...C(this,w0),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&C(this,Eo).remove(this)}setData(e,n){const r=RN(this.state.data,e,this.options);return z(this,na,Kl).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,na,Kl).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,s;const n=(r=C(this,Rs))==null?void 0:r.promise;return(s=C(this,Rs))==null||s.cancel(e),n?n.then(To).catch(To):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(C(this,tg))}isActive(){return this.observers.some(e=>wa(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===uL||this.state.dataUpdateCount+this.state.errorUpdateCount===0}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||!MV(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=C(this,Rs))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=C(this,Rs))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),C(this,Eo).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(C(this,Rs)&&(C(this,Nf)?C(this,Rs).cancel({revert:!0}):C(this,Rs).cancelRetry()),this.scheduleGc()),C(this,Eo).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||z(this,na,Kl).call(this,{type:"invalidate"})}fetch(e,n){var c,u,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(C(this,Rs))return C(this,Rs).continueRetry(),C(this,Rs).promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(d=>d.options.queryFn);l&&this.setOptions(l.options)}const r=new AbortController,s=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>($(this,Nf,!0),r.signal)})},i=()=>{const l=IV(this.options,n),d={client:C(this,kf),queryKey:this.queryKey,meta:this.meta};return s(d),$(this,Nf,!1),this.options.persister?this.options.persister(l,d,this):l(d)},a={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:C(this,kf),state:this.state,fetchFn:i};s(a),(c=this.options.behavior)==null||c.onFetch(a,this),$(this,ng,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=a.fetchOptions)==null?void 0:u.meta))&&z(this,na,Kl).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta});const o=l=>{var d,m,p,h;nT(l)&&l.silent||z(this,na,Kl).call(this,{type:"error",error:l}),nT(l)||((m=(d=C(this,Eo).config).onError)==null||m.call(d,l,this),(h=(p=C(this,Eo).config).onSettled)==null||h.call(p,this.state.data,l,this)),this.scheduleGc()};return $(this,Rs,jV({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:l=>{var d,m,p,h;if(l===void 0){o(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(l)}catch(y){o(y);return}(m=(d=C(this,Eo).config).onSuccess)==null||m.call(d,l,this),(h=(p=C(this,Eo).config).onSettled)==null||h.call(p,l,this.state.error,this),this.scheduleGc()},onError:o,onFail:(l,d)=>{z(this,na,Kl).call(this,{type:"failed",failureCount:l,error:d})},onPause:()=>{z(this,na,Kl).call(this,{type:"pause"})},onContinue:()=>{z(this,na,Kl).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),C(this,Rs).start()}},tg=new WeakMap,ng=new WeakMap,Eo=new WeakMap,kf=new WeakMap,Rs=new WeakMap,w0=new WeakMap,Nf=new WeakMap,na=new WeakSet,Kl=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,...zV(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 nT(s)&&s.revert&&C(this,ng)?{...C(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),Vr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),C(this,Eo).notify({query:this,type:"updated",action:e})})},u5);function zV(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:$V(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function bde(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 Ga,d5,wde=(d5=class extends Av{constructor(e={}){super();B(this,Ga);this.config=e,$(this,Ga,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??cL(s,n);let a=this.get(i);return a||(a=new yde({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){C(this,Ga).has(e.queryHash)||(C(this,Ga).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=C(this,Ga).get(e.queryHash);n&&(e.destroy(),n===e&&C(this,Ga).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Vr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return C(this,Ga).get(e)}getAll(){return[...C(this,Ga).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>H3(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>H3(e,r)):n}notify(e){Vr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Vr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Vr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ga=new WeakMap,d5),qa,Hs,Df,Ka,bu,f5,_de=(f5=class extends BV{constructor(e){super();B(this,Ka);B(this,qa);B(this,Hs);B(this,Df);this.mutationId=e.mutationId,$(this,Hs,e.mutationCache),$(this,qa,[]),this.state=e.state||UV(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){C(this,qa).includes(e)||(C(this,qa).push(e),this.clearGcTimeout(),C(this,Hs).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){$(this,qa,C(this,qa).filter(n=>n!==e)),this.scheduleGc(),C(this,Hs).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){C(this,qa).length||(this.state.status==="pending"?this.scheduleGc():C(this,Hs).remove(this))}continue(){var e;return((e=C(this,Df))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var s,i,a,o,c,u,f,l,d,m,p,h,y,g,v,w,x,A,T,R;$(this,Df,jV({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(E,k)=>{z(this,Ka,bu).call(this,{type:"failed",failureCount:E,error:k})},onPause:()=>{z(this,Ka,bu).call(this,{type:"pause"})},onContinue:()=>{z(this,Ka,bu).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>C(this,Hs).canRun(this)}));const n=this.state.status==="pending",r=!C(this,Df).canStart();try{if(!n){z(this,Ka,bu).call(this,{type:"pending",variables:e,isPaused:r}),await((i=(s=C(this,Hs).config).onMutate)==null?void 0:i.call(s,e,this));const k=await((o=(a=this.options).onMutate)==null?void 0:o.call(a,e));k!==this.state.context&&z(this,Ka,bu).call(this,{type:"pending",context:k,variables:e,isPaused:r})}const E=await C(this,Df).start();return await((u=(c=C(this,Hs).config).onSuccess)==null?void 0:u.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((m=(d=C(this,Hs).config).onSettled)==null?void 0:m.call(d,E,null,this.state.variables,this.state.context,this)),await((h=(p=this.options).onSettled)==null?void 0:h.call(p,E,null,e,this.state.context)),z(this,Ka,bu).call(this,{type:"success",data:E}),E}catch(E){try{throw await((g=(y=C(this,Hs).config).onError)==null?void 0:g.call(y,E,e,this.state.context,this)),await((w=(v=this.options).onError)==null?void 0:w.call(v,E,e,this.state.context)),await((A=(x=C(this,Hs).config).onSettled)==null?void 0:A.call(x,void 0,E,this.state.variables,this.state.context,this)),await((R=(T=this.options).onSettled)==null?void 0:R.call(T,void 0,E,e,this.state.context)),E}finally{z(this,Ka,bu).call(this,{type:"error",error:E})}}finally{C(this,Hs).runNext(this)}}},qa=new WeakMap,Hs=new WeakMap,Df=new WeakMap,Ka=new WeakSet,bu=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),Vr.batch(()=>{C(this,qa).forEach(r=>{r.onMutationUpdate(e)}),C(this,Hs).notify({mutation:this,type:"updated",action:e})})},f5);function UV(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var rc,ra,_0,h5,xde=(h5=class extends Av{constructor(e={}){super();B(this,rc);B(this,ra);B(this,_0);this.config=e,$(this,rc,new Set),$(this,ra,new Map),$(this,_0,0)}build(e,n,r){const s=new _de({mutationCache:this,mutationId:++_s(this,_0)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){C(this,rc).add(e);const n=nS(e);if(typeof n=="string"){const r=C(this,ra).get(n);r?r.push(e):C(this,ra).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(C(this,rc).delete(e)){const n=nS(e);if(typeof n=="string"){const r=C(this,ra).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&C(this,ra).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=nS(e);if(typeof n=="string"){const r=C(this,ra).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r;const n=nS(e);if(typeof n=="string"){const s=(r=C(this,ra).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Vr.batch(()=>{C(this,rc).forEach(e=>{this.notify({type:"removed",mutation:e})}),C(this,rc).clear(),C(this,ra).clear()})}getAll(){return Array.from(C(this,rc))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>V3(n,r))}findAll(e={}){return this.getAll().filter(n=>V3(e,n))}notify(e){Vr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Vr.batch(()=>Promise.all(e.map(n=>n.continue().catch(To))))}},rc=new WeakMap,ra=new WeakMap,_0=new WeakMap,h5);function nS(t){var e;return(e=t.options.scope)==null?void 0:e.id}function q3(t){return{onFetch:(e,n)=>{var f,l,d,m,p;const r=e.options,s=(d=(l=(f=e.fetchOptions)==null?void 0:f.meta)==null?void 0:l.fetchMore)==null?void 0:d.direction,i=((m=e.state.data)==null?void 0:m.pages)||[],a=((p=e.state.data)==null?void 0:p.pageParams)||[];let o={pages:[],pageParams:[]},c=0;const u=async()=>{let h=!1;const y=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(e.signal.aborted?h=!0:e.signal.addEventListener("abort",()=>{h=!0}),e.signal)})},g=IV(e.options,e.fetchOptions),v=async(w,x,A)=>{if(h)return Promise.reject();if(x==null&&w.pages.length)return Promise.resolve(w);const T={client:e.client,queryKey:e.queryKey,pageParam:x,direction:A?"backward":"forward",meta:e.options.meta};y(T);const R=await g(T),{maxPages:E}=e.options,k=A?fde:dde;return{pages:k(w.pages,R,E),pageParams:k(w.pageParams,x,E)}};if(s&&i.length){const w=s==="backward",x=w?Sde:K3,A={pages:i,pageParams:a},T=x(r,A);o=await v(A,T,w)}else{const w=t??i.length;do{const x=c===0?a[0]??r.initialPageParam:K3(r,o);if(c>0&&x==null)break;o=await v(o,x),c++}while(c{var h,y;return(y=(h=e.options).persister)==null?void 0:y.call(h,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=u}}}function K3(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 Sde(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 fr,Fu,ju,rg,sg,Bu,ig,og,p5,Ede=(p5=class{constructor(t={}){B(this,fr);B(this,Fu);B(this,ju);B(this,rg);B(this,sg);B(this,Bu);B(this,ig);B(this,og);$(this,fr,t.queryCache||new wde),$(this,Fu,t.mutationCache||new xde),$(this,ju,t.defaultOptions||{}),$(this,rg,new Map),$(this,sg,new Map),$(this,Bu,0)}mount(){_s(this,Bu)._++,C(this,Bu)===1&&($(this,ig,dL.subscribe(async t=>{t&&(await this.resumePausedMutations(),C(this,fr).onFocus())})),$(this,og,iC.subscribe(async t=>{t&&(await this.resumePausedMutations(),C(this,fr).onOnline())})))}unmount(){var t,e;_s(this,Bu)._--,C(this,Bu)===0&&((t=C(this,ig))==null||t.call(this),$(this,ig,void 0),(e=C(this,og))==null||e.call(this),$(this,og,void 0))}isFetching(t){return C(this,fr).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return C(this,Fu).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=C(this,fr).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=C(this,fr).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Fm(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return C(this,fr).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=C(this,fr).get(r.queryHash),i=s==null?void 0:s.state.data,a=cde(e,i);if(a!==void 0)return C(this,fr).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return Vr.batch(()=>C(this,fr).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=C(this,fr).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=C(this,fr);Vr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=C(this,fr);return Vr.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Vr.batch(()=>C(this,fr).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(To).catch(To)}invalidateQueries(t,e={}){return Vr.batch(()=>(C(this,fr).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=Vr.batch(()=>C(this,fr).findAll(t).filter(s=>!s.isDisabled()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(To)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(To)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=C(this,fr).build(this,e);return n.isStaleByTime(Fm(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(To).catch(To)}fetchInfiniteQuery(t){return t.behavior=q3(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(To).catch(To)}ensureInfiniteQueryData(t){return t.behavior=q3(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return iC.isOnline()?C(this,Fu).resumePausedMutations():Promise.resolve()}getQueryCache(){return C(this,fr)}getMutationCache(){return C(this,Fu)}getDefaultOptions(){return C(this,ju)}setDefaultOptions(t){$(this,ju,t)}setQueryDefaults(t,e){C(this,rg).set(Hh(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...C(this,rg).values()],n={};return e.forEach(r=>{Zb(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){C(this,sg).set(Hh(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...C(this,sg).values()],n={};return e.forEach(r=>{Zb(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...C(this,ju).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=cL(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===uL&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...C(this,ju).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){C(this,fr).clear(),C(this,Fu).clear()}},fr=new WeakMap,Fu=new WeakMap,ju=new WeakMap,rg=new WeakMap,sg=new WeakMap,Bu=new WeakMap,ig=new WeakMap,og=new WeakMap,p5),fi,jt,x0,Vs,Of,ag,zu,Ya,S0,lg,cg,Mf,Lf,Uu,ug,sn,Gy,TN,kN,NN,DN,ON,MN,LN,HV,m5,Cde=(m5=class extends Av{constructor(e,n){super();B(this,sn);B(this,fi);B(this,jt);B(this,x0);B(this,Vs);B(this,Of);B(this,ag);B(this,zu);B(this,Ya);B(this,S0);B(this,lg);B(this,cg);B(this,Mf);B(this,Lf);B(this,Uu);B(this,ug,new Set);this.options=n,$(this,fi,e),$(this,Ya,null),$(this,zu,PN()),this.options.experimental_prefetchInRender||C(this,zu).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(C(this,jt).addObserver(this),Y3(C(this,jt),this.options)?z(this,sn,Gy).call(this):this.updateResult(),z(this,sn,DN).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return IN(C(this,jt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return IN(C(this,jt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,z(this,sn,ON).call(this),z(this,sn,MN).call(this),C(this,jt).removeObserver(this)}setOptions(e){const n=this.options,r=C(this,jt);if(this.options=C(this,fi).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof wa(this.options.enabled,C(this,jt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");z(this,sn,LN).call(this),C(this,jt).setOptions(this.options),n._defaulted&&!sC(this.options,n)&&C(this,fi).getQueryCache().notify({type:"observerOptionsUpdated",query:C(this,jt),observer:this});const s=this.hasListeners();s&&X3(C(this,jt),r,this.options,n)&&z(this,sn,Gy).call(this),this.updateResult(),s&&(C(this,jt)!==r||wa(this.options.enabled,C(this,jt))!==wa(n.enabled,C(this,jt))||Fm(this.options.staleTime,C(this,jt))!==Fm(n.staleTime,C(this,jt)))&&z(this,sn,TN).call(this);const i=z(this,sn,kN).call(this);s&&(C(this,jt)!==r||wa(this.options.enabled,C(this,jt))!==wa(n.enabled,C(this,jt))||i!==C(this,Uu))&&z(this,sn,NN).call(this,i)}getOptimisticResult(e){const n=C(this,fi).getQueryCache().build(C(this,fi),e),r=this.createResult(n,e);return Rde(this,r)&&($(this,Vs,r),$(this,ag,this.options),$(this,Of,C(this,jt).state)),r}getCurrentResult(){return C(this,Vs)}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){C(this,ug).add(e)}getCurrentQuery(){return C(this,jt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=C(this,fi).defaultQueryOptions(e),r=C(this,fi).getQueryCache().build(C(this,fi),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return z(this,sn,Gy).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),C(this,Vs)))}createResult(e,n){var E;const r=C(this,jt),s=this.options,i=C(this,Vs),a=C(this,Of),o=C(this,ag),u=e!==r?e.state:C(this,x0),{state:f}=e;let l={...f},d=!1,m;if(n._optimisticResults){const k=this.hasListeners(),N=!k&&Y3(e,n),O=k&&X3(e,r,n,s);(N||O)&&(l={...l,...zV(f.data,e.options)}),n._optimisticResults==="isRestoring"&&(l.fetchStatus="idle")}let{error:p,errorUpdatedAt:h,status:y}=l;if(n.select&&l.data!==void 0)if(i&&l.data===(a==null?void 0:a.data)&&n.select===C(this,S0))m=C(this,lg);else try{$(this,S0,n.select),m=n.select(l.data),m=RN(i==null?void 0:i.data,m,n),$(this,lg,m),$(this,Ya,null)}catch(k){$(this,Ya,k)}else m=l.data;if(n.placeholderData!==void 0&&m===void 0&&y==="pending"){let k;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData))k=i.data;else if(k=typeof n.placeholderData=="function"?n.placeholderData((E=C(this,cg))==null?void 0:E.state.data,C(this,cg)):n.placeholderData,n.select&&k!==void 0)try{k=n.select(k),$(this,Ya,null)}catch(N){$(this,Ya,N)}k!==void 0&&(y="success",m=RN(i==null?void 0:i.data,k,n),d=!0)}C(this,Ya)&&(p=C(this,Ya),m=C(this,lg),h=Date.now(),y="error");const g=l.fetchStatus==="fetching",v=y==="pending",w=y==="error",x=v&&g,A=m!==void 0,R={status:y,fetchStatus:l.fetchStatus,isPending:v,isSuccess:y==="success",isError:w,isInitialLoading:x,isLoading:x,data:m,dataUpdatedAt:l.dataUpdatedAt,error:p,errorUpdatedAt:h,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:l.dataUpdateCount>0||l.errorUpdateCount>0,isFetchedAfterMount:l.dataUpdateCount>u.dataUpdateCount||l.errorUpdateCount>u.errorUpdateCount,isFetching:g,isRefetching:g&&!v,isLoadingError:w&&!A,isPaused:l.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:w&&A,isStale:fL(e,n),refetch:this.refetch,promise:C(this,zu)};if(this.options.experimental_prefetchInRender){const k=L=>{R.status==="error"?L.reject(R.error):R.data!==void 0&&L.resolve(R.data)},N=()=>{const L=$(this,zu,R.promise=PN());k(L)},O=C(this,zu);switch(O.status){case"pending":e.queryHash===r.queryHash&&k(O);break;case"fulfilled":(R.status==="error"||R.data!==O.value)&&N();break;case"rejected":(R.status!=="error"||R.error!==O.reason)&&N();break}}return R}updateResult(){const e=C(this,Vs),n=this.createResult(C(this,jt),this.options);if($(this,Of,C(this,jt).state),$(this,ag,this.options),C(this,Of).data!==void 0&&$(this,cg,C(this,jt)),sC(n,e))return;$(this,Vs,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!C(this,ug).size)return!0;const a=new Set(i??C(this,ug));return this.options.throwOnError&&a.add("error"),Object.keys(C(this,Vs)).some(o=>{const c=o;return C(this,Vs)[c]!==e[c]&&a.has(c)})};z(this,sn,HV).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&z(this,sn,DN).call(this)}},fi=new WeakMap,jt=new WeakMap,x0=new WeakMap,Vs=new WeakMap,Of=new WeakMap,ag=new WeakMap,zu=new WeakMap,Ya=new WeakMap,S0=new WeakMap,lg=new WeakMap,cg=new WeakMap,Mf=new WeakMap,Lf=new WeakMap,Uu=new WeakMap,ug=new WeakMap,sn=new WeakSet,Gy=function(e){z(this,sn,LN).call(this);let n=C(this,jt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(To)),n},TN=function(){z(this,sn,ON).call(this);const e=Fm(this.options.staleTime,C(this,jt));if(Uh||C(this,Vs).isStale||!CN(e))return;const r=MV(C(this,Vs).dataUpdatedAt,e)+1;$(this,Mf,setTimeout(()=>{C(this,Vs).isStale||this.updateResult()},r))},kN=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(C(this,jt)):this.options.refetchInterval)??!1},NN=function(e){z(this,sn,MN).call(this),$(this,Uu,e),!(Uh||wa(this.options.enabled,C(this,jt))===!1||!CN(C(this,Uu))||C(this,Uu)===0)&&$(this,Lf,setInterval(()=>{(this.options.refetchIntervalInBackground||dL.isFocused())&&z(this,sn,Gy).call(this)},C(this,Uu)))},DN=function(){z(this,sn,TN).call(this),z(this,sn,NN).call(this,z(this,sn,kN).call(this))},ON=function(){C(this,Mf)&&(clearTimeout(C(this,Mf)),$(this,Mf,void 0))},MN=function(){C(this,Lf)&&(clearInterval(C(this,Lf)),$(this,Lf,void 0))},LN=function(){const e=C(this,fi).getQueryCache().build(C(this,fi),this.options);if(e===C(this,jt))return;const n=C(this,jt);$(this,jt,e),$(this,x0,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},HV=function(e){Vr.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(C(this,Vs))}),C(this,fi).getQueryCache().notify({query:C(this,jt),type:"observerResultsUpdated"})})},m5);function Ade(t,e){return wa(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Y3(t,e){return Ade(t,e)||t.state.data!==void 0&&IN(t,e,e.refetchOnMount)}function IN(t,e,n){if(wa(e.enabled,t)!==!1){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&fL(t,e)}return!1}function X3(t,e,n,r){return(t!==e||wa(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&fL(t,n)}function fL(t,e){return wa(e.enabled,t)!==!1&&t.isStaleByTime(Fm(e.staleTime,t))}function Rde(t,e){return!sC(t.getCurrentResult(),e)}var Hu,Vu,hi,sc,$c,qS,$N,g5,Pde=(g5=class extends Av{constructor(n,r){super();B(this,$c);B(this,Hu);B(this,Vu);B(this,hi);B(this,sc);$(this,Hu,n),this.setOptions(r),this.bindMethods(),z(this,$c,qS).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=C(this,Hu).defaultMutationOptions(n),sC(this.options,r)||C(this,Hu).getMutationCache().notify({type:"observerOptionsUpdated",mutation:C(this,hi),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Hh(r.mutationKey)!==Hh(this.options.mutationKey)?this.reset():((s=C(this,hi))==null?void 0:s.state.status)==="pending"&&C(this,hi).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=C(this,hi))==null||n.removeObserver(this)}onMutationUpdate(n){z(this,$c,qS).call(this),z(this,$c,$N).call(this,n)}getCurrentResult(){return C(this,Vu)}reset(){var n;(n=C(this,hi))==null||n.removeObserver(this),$(this,hi,void 0),z(this,$c,qS).call(this),z(this,$c,$N).call(this)}mutate(n,r){var s;return $(this,sc,r),(s=C(this,hi))==null||s.removeObserver(this),$(this,hi,C(this,Hu).getMutationCache().build(C(this,Hu),this.options)),C(this,hi).addObserver(this),C(this,hi).execute(n)}},Hu=new WeakMap,Vu=new WeakMap,hi=new WeakMap,sc=new WeakMap,$c=new WeakSet,qS=function(){var r;const n=((r=C(this,hi))==null?void 0:r.state)??UV();$(this,Vu,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},$N=function(n){Vr.batch(()=>{var r,s,i,a,o,c,u,f;if(C(this,sc)&&this.hasListeners()){const l=C(this,Vu).variables,d=C(this,Vu).context;(n==null?void 0:n.type)==="success"?((s=(r=C(this,sc)).onSuccess)==null||s.call(r,n.data,l,d),(a=(i=C(this,sc)).onSettled)==null||a.call(i,n.data,null,l,d)):(n==null?void 0:n.type)==="error"&&((c=(o=C(this,sc)).onError)==null||c.call(o,n.error,l,d),(f=(u=C(this,sc)).onSettled)==null||f.call(u,void 0,n.error,l,d))}this.listeners.forEach(l=>{l(C(this,Vu))})})},g5),VV=_.createContext(void 0),WV=t=>{const e=_.useContext(VV);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Tde=({client:t,children:e})=>(_.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),P.jsx(VV.Provider,{value:t,children:e})),GV=_.createContext(!1),kde=()=>_.useContext(GV);GV.Provider;function Nde(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Dde=_.createContext(Nde()),Ode=()=>_.useContext(Dde);function qV(t,e){return typeof t=="function"?t(...e):!!t}function FN(){}var Mde=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},Lde=t=>{_.useEffect(()=>{t.clearReset()},[t])},Ide=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||qV(n,[t.error,r])),$de=t=>{const e=t.staleTime;t.suspense&&(t.staleTime=typeof e=="function"?(...n)=>Math.max(e(...n),1e3):Math.max(e??1e3,1e3),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3)))},Fde=(t,e)=>t.isLoading&&t.isFetching&&!e,jde=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,Q3=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function Bde(t,e,n){var l,d,m,p,h;const r=WV(),s=kde(),i=Ode(),a=r.defaultQueryOptions(t);(d=(l=r.getDefaultOptions().queries)==null?void 0:l._experimental_beforeQuery)==null||d.call(l,a),a._optimisticResults=s?"isRestoring":"optimistic",$de(a),Mde(a,i),Lde(i);const o=!r.getQueryCache().get(a.queryHash),[c]=_.useState(()=>new e(r,a)),u=c.getOptimisticResult(a),f=!s&&t.subscribed!==!1;if(_.useSyncExternalStore(_.useCallback(y=>{const g=f?c.subscribe(Vr.batchCalls(y)):FN;return c.updateResult(),g},[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),_.useEffect(()=>{c.setOptions(a)},[a,c]),jde(a,u))throw Q3(a,c,i);if(Ide({result:u,errorResetBoundary:i,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw u.error;if((p=(m=r.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||p.call(m,a,u),a.experimental_prefetchInRender&&!Uh&&Fde(u,s)){const y=o?Q3(a,c,i):(h=r.getQueryCache().get(a.queryHash))==null?void 0:h.promise;y==null||y.catch(FN).finally(()=>{c.updateResult()})}return a.notifyOnChangeProps?u:c.trackResult(u)}function KV(t,e){return Bde(t,Cde)}function zde(t,e){const n=WV(),[r]=_.useState(()=>new Pde(n,t));_.useEffect(()=>{r.setOptions(t)},[r,t]);const s=_.useSyncExternalStore(_.useCallback(a=>r.subscribe(Vr.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=_.useCallback((a,o)=>{r.mutate(a,o).catch(FN)},[r]);if(s.error&&qV(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}class Ho{constructor(e=[]){Le(this,"segments",[]);this.segments=e}key(){return this.segments}get(){return this.segments}}class Fd extends Ho{params(e){return new Ho([...this.segments,e])}}class Ude extends Ho{id(e){return new Fd([...this.segments,e?String(e):void 0])}}class Hde extends Ho{ids(...e){return new Fd([...this.segments,...e.length?[e.map(n=>String(n))]:[]])}}class Vde extends Ho{action(e){if(["one","report"].includes(e))return new Ude([...this.segments,e]);if(e==="many")return new Hde([...this.segments,e]);if(["list","infinite"].includes(e))return new Fd([...this.segments,e]);throw new Error("Invalid action type")}}class Wde extends Ho{resource(e){return new Vde([...this.segments,e])}mutation(e){return new Fd([...e==="custom"?this.segments:[this.segments[0]],e])}}class Gde extends Ho{action(e){return new Fd([...this.segments,e])}}class qde extends Ho{action(e){return new Fd([...this.segments,e])}}class Kde extends Ho{resource(e){return new qde([...this.segments,e])}}class Yde extends Ho{action(e){return new Fd([...this.segments,e])}}class Xde extends Ho{resource(e){return new Yde([...this.segments,e])}action(e){return new Fd([...this.segments,e])}}class Qde extends Ho{data(e){return new Wde(["data",e||"default"])}auth(){return new Gde(["auth"])}access(){return new Kde(["access"])}audit(){return new Xde(["audit"])}}const Zde=()=>new Qde([]),YV=()=>Zde,XV=t=>{const e=YV(),{getProfile:n}=OV();return KV({queryKey:e().auth().action("profile").get(),queryFn:n,...t})},Jde=t=>{const e=YV(),{check:n}=OV();return KV({queryKey:e().auth().action("check").get(),queryFn:n,retry:!1,...t})};function efe(t,e){const n=_.createContext(e);function r(i){const{children:a,...o}=i,c=_.useMemo(()=>o,Object.values(o));return P.jsx(n.Provider,{value:c,children:a})}function s(i){const a=_.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return r.displayName=t+"Provider",[r,s]}function Nn(t,e=[]){let n=[];function r(i,a){const o=_.createContext(a),c=n.length;n=[...n,a];function u(l){const{scope:d,children:m,...p}=l,h=(d==null?void 0:d[t][c])||o,y=_.useMemo(()=>p,Object.values(p));return P.jsx(h.Provider,{value:y,children:m})}function f(l,d){const m=(d==null?void 0:d[t][c])||o,p=_.useContext(m);if(p)return p;if(a!==void 0)return a;throw new Error(`\`${l}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,f]}const s=()=>{const i=n.map(a=>_.createContext(a));return function(o){const c=(o==null?void 0:o[t])||i;return _.useMemo(()=>({[`__scope${t}`]:{...o,[t]:c}}),[o,c])}};return s.scopeName=t,[r,tfe(s,...e)]}function tfe(...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 a=r.reduce((o,{useScope:c,scopeName:u})=>{const l=c(i)[`__scope${u}`];return{...o,...l}},{});return _.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}function nfe(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function c_(...t){return e=>t.forEach(n=>nfe(n,e))}function tt(...t){return _.useCallback(c_(...t),t)}var Aa=_.forwardRef((t,e)=>{const{children:n,...r}=t,s=_.Children.toArray(n),i=s.find(rfe);if(i){const a=i.props.children,o=s.map(c=>c===i?_.Children.count(a)>1?_.Children.only(null):_.isValidElement(a)?a.props.children:null:c);return P.jsx(jN,{...r,ref:e,children:_.isValidElement(a)?_.cloneElement(a,void 0,o):null})}return P.jsx(jN,{...r,ref:e,children:n})});Aa.displayName="Slot";var jN=_.forwardRef((t,e)=>{const{children:n,...r}=t;if(_.isValidElement(n)){const s=ife(n);return _.cloneElement(n,{...sfe(r,n.props),ref:e?c_(e,s):s})}return _.Children.count(n)>1?_.Children.only(null):null});jN.displayName="SlotClone";var hL=({children:t})=>P.jsx(P.Fragment,{children:t});function rfe(t){return _.isValidElement(t)&&t.type===hL}function sfe(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]=(...o)=>{i(...o),s(...o)}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function ife(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 Qc(t){const e=t+"CollectionProvider",[n,r]=Nn(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=m=>{const{scope:p,children:h}=m,y=se.useRef(null),g=se.useRef(new Map).current;return P.jsx(s,{scope:p,itemMap:g,collectionRef:y,children:h})};a.displayName=e;const o=t+"CollectionSlot",c=se.forwardRef((m,p)=>{const{scope:h,children:y}=m,g=i(o,h),v=tt(p,g.collectionRef);return P.jsx(Aa,{ref:v,children:y})});c.displayName=o;const u=t+"CollectionItemSlot",f="data-radix-collection-item",l=se.forwardRef((m,p)=>{const{scope:h,children:y,...g}=m,v=se.useRef(null),w=tt(p,v),x=i(u,h);return se.useEffect(()=>(x.itemMap.set(v,{ref:v,...g}),()=>void x.itemMap.delete(v))),P.jsx(Aa,{[f]:"",ref:w,children:y})});l.displayName=u;function d(m){const p=i(t+"CollectionConsumer",m);return se.useCallback(()=>{const y=p.collectionRef.current;if(!y)return[];const g=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(p.itemMap.values()).sort((x,A)=>g.indexOf(x.ref.current)-g.indexOf(A.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:a,Slot:c,ItemSlot:l},d,r]}function me(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 zt(t){const e=_.useRef(t);return _.useEffect(()=>{e.current=t}),_.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function lr({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,s]=ofe({defaultProp:e,onChange:n}),i=t!==void 0,a=i?t:r,o=zt(n),c=_.useCallback(u=>{if(i){const l=typeof u=="function"?u(t):u;l!==t&&o(l)}else s(u)},[i,t,s,o]);return[a,c]}function ofe({defaultProp:t,onChange:e}){const n=_.useState(t),[r]=n,s=_.useRef(r),i=zt(e);return _.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}var afe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ne=afe.reduce((t,e)=>{const n=_.forwardRef((r,s)=>{const{asChild:i,...a}=r,o=i?Aa:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(o,{...a,ref:s})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function Jb(t,e){t&&Ms.flushSync(()=>t.dispatchEvent(e))}var $n=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{};function lfe(t,e){return _.useReducer((n,r)=>e[n][r]??n,t)}var Wn=t=>{const{present:e,children:n}=t,r=cfe(e),s=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),i=tt(r.ref,ufe(s));return typeof n=="function"||r.isPresent?_.cloneElement(s,{ref:i}):null};Wn.displayName="Presence";function cfe(t){const[e,n]=_.useState(),r=_.useRef({}),s=_.useRef(t),i=_.useRef("none"),a=t?"mounted":"unmounted",[o,c]=lfe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const u=rS(r.current);i.current=o==="mounted"?u:"none"},[o]),$n(()=>{const u=r.current,f=s.current;if(f!==t){const d=i.current,m=rS(u);t?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&d!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,c]),$n(()=>{if(e){const u=l=>{const m=rS(r.current).includes(l.animationName);l.target===e&&m&&Ms.flushSync(()=>c("ANIMATION_END"))},f=l=>{l.target===e&&(i.current=rS(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",u),e.addEventListener("animationend",u),()=>{e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",u),e.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:_.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function rS(t){return(t==null?void 0:t.animationName)||"none"}function ufe(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 dfe=r_.useId||(()=>{}),ffe=0;function qr(t){const[e,n]=_.useState(dfe());return $n(()=>{n(r=>r??String(ffe++))},[t]),e?`radix-${e}`:""}var pL="Collapsible",[hfe,QV]=Nn(pL),[pfe,mL]=hfe(pL),ZV=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:a,...o}=t,[c=!1,u]=lr({prop:r,defaultProp:s,onChange:a});return P.jsx(pfe,{scope:n,disabled:i,contentId:qr(),open:c,onOpenToggle:_.useCallback(()=>u(f=>!f),[u]),children:P.jsx(Ne.div,{"data-state":vL(c),"data-disabled":i?"":void 0,...o,ref:e})})});ZV.displayName=pL;var JV="CollapsibleTrigger",e6=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,s=mL(JV,n);return P.jsx(Ne.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":vL(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:e,onClick:me(t.onClick,s.onOpenToggle)})});e6.displayName=JV;var gL="CollapsibleContent",t6=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=mL(gL,t.__scopeCollapsible);return P.jsx(Wn,{present:n||s.open,children:({present:i})=>P.jsx(mfe,{...r,ref:e,present:i})})});t6.displayName=gL;var mfe=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=t,a=mL(gL,n),[o,c]=_.useState(r),u=_.useRef(null),f=tt(e,u),l=_.useRef(0),d=l.current,m=_.useRef(0),p=m.current,h=a.open||o,y=_.useRef(h),g=_.useRef();return _.useEffect(()=>{const v=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(v)},[]),$n(()=>{const v=u.current;if(v){g.current=g.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const w=v.getBoundingClientRect();l.current=w.height,m.current=w.width,y.current||(v.style.transitionDuration=g.current.transitionDuration,v.style.animationName=g.current.animationName),c(r)}},[a.open,r]),P.jsx(Ne.div,{"data-state":vL(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!h,...i,ref:f,style:{"--radix-collapsible-content-height":d?`${d}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...t.style},children:h&&s})});function vL(t){return t?"open":"closed"}var gfe=ZV,vfe=e6,yfe=t6,bfe=_.createContext(void 0);function Da(t){const e=_.useContext(bfe);return t||e||"ltr"}var Zc="Accordion",wfe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[yL,_fe,xfe]=Qc(Zc),[H1,eUe]=Nn(Zc,[xfe,QV]),bL=QV(),Sfe=se.forwardRef((t,e)=>{const{type:n,...r}=t,s=r,i=r;return P.jsx(yL.Provider,{scope:t.__scopeAccordion,children:n==="multiple"?P.jsx(Rfe,{...i,ref:e}):P.jsx(Afe,{...s,ref:e})})});Sfe.displayName=Zc;var[n6,Efe]=H1(Zc),[r6,Cfe]=H1(Zc,{collapsible:!1}),Afe=se.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:i=!1,...a}=t,[o,c]=lr({prop:n,defaultProp:r,onChange:s});return P.jsx(n6,{scope:t.__scopeAccordion,value:o?[o]:[],onItemOpen:c,onItemClose:se.useCallback(()=>i&&c(""),[i,c]),children:P.jsx(r6,{scope:t.__scopeAccordion,collapsible:i,children:P.jsx(s6,{...a,ref:e})})})}),Rfe=se.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=t,[a=[],o]=lr({prop:n,defaultProp:r,onChange:s}),c=se.useCallback(f=>o((l=[])=>[...l,f]),[o]),u=se.useCallback(f=>o((l=[])=>l.filter(d=>d!==f)),[o]);return P.jsx(n6,{scope:t.__scopeAccordion,value:a,onItemOpen:c,onItemClose:u,children:P.jsx(r6,{scope:t.__scopeAccordion,collapsible:!0,children:P.jsx(s6,{...i,ref:e})})})}),[Pfe,V1]=H1(Zc),s6=se.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:i="vertical",...a}=t,o=se.useRef(null),c=tt(o,e),u=_fe(n),l=Da(s)==="ltr",d=me(t.onKeyDown,m=>{var E;if(!wfe.includes(m.key))return;const p=m.target,h=u().filter(k=>{var N;return!((N=k.ref.current)!=null&&N.disabled)}),y=h.findIndex(k=>k.ref.current===p),g=h.length;if(y===-1)return;m.preventDefault();let v=y;const w=0,x=g-1,A=()=>{v=y+1,v>x&&(v=w)},T=()=>{v=y-1,v{const{__scopeAccordion:n,value:r,...s}=t,i=V1(oC,n),a=Efe(oC,n),o=bL(n),c=qr(),u=r&&a.value.includes(r)||!1,f=i.disabled||t.disabled;return P.jsx(Tfe,{scope:n,open:u,disabled:f,triggerId:c,children:P.jsx(gfe,{"data-orientation":i.orientation,"data-state":d6(u),...o,...s,ref:e,disabled:f,open:u,onOpenChange:l=>{l?a.onItemOpen(r):a.onItemClose(r)}})})});i6.displayName=oC;var o6="AccordionHeader",a6=se.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=V1(Zc,n),i=wL(o6,n);return P.jsx(Ne.h3,{"data-orientation":s.orientation,"data-state":d6(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:e})});a6.displayName=o6;var BN="AccordionTrigger",l6=se.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=V1(Zc,n),i=wL(BN,n),a=Cfe(BN,n),o=bL(n);return P.jsx(yL.ItemSlot,{scope:n,children:P.jsx(vfe,{"aria-disabled":i.open&&!a.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...o,...r,ref:e})})});l6.displayName=BN;var c6="AccordionContent",u6=se.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=V1(Zc,n),i=wL(c6,n),a=bL(n);return P.jsx(yfe,{role:"region","aria-labelledby":i.triggerId,"data-orientation":s.orientation,...a,...r,ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}})});u6.displayName=c6;function d6(t){return t?"open":"closed"}var kfe=i6,Nfe=a6,f6=l6,h6=u6;/** +`+i.stack}return{value:t,source:e,stack:s,digest:null}}function ZP(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function dN(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var Iue=typeof WeakMap=="function"?WeakMap:Map;function sV(t,e,n){n=Dc(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){eC||(eC=!0,_N=r),dN(t,e)},n}function iV(t,e,n){n=Dc(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var s=e.value;n.payload=function(){return r(s)},n.callback=function(){dN(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){dN(t,e),typeof r!="function"&&(wd===null?wd=new Set([this]):wd.add(this));var a=e.stack;this.componentDidCatch(e.value,{componentStack:a!==null?a:""})}),n}function E3(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new Iue;var s=new Set;r.set(e,s)}else s=r.get(e),s===void 0&&(s=new Set,r.set(e,s));s.has(n)||(s.add(n),t=Xue.bind(null,t,e,n),e.then(t,t))}function C3(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function A3(t,e,n,r,s){return t.mode&1?(t.flags|=65536,t.lanes=s,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=Dc(-1,1),e.tag=2,bd(n,e,1))),n.lanes|=1),t)}var $ue=Xc.ReactCurrentOwner,wi=!1;function qs(t,e,n,r){e.child=t===null?MH(e,null,n,r):cv(e,t.child,n,r)}function R3(t,e,n,r,s){n=n.render;var i=e.ref;return Im(e,s),r=qM(t,e,n,r,i,s),n=KM(),t!==null&&!wi?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,Hc(t,e,s)):(Xn&&n&&LM(e),e.flags|=1,qs(t,e,r,s),e.child)}function P3(t,e,n,r,s){if(t===null){var i=n.type;return typeof i=="function"&&!sL(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=i,oV(t,e,i,r,s)):(t=GS(n.type,null,r,e,e.mode,s),t.ref=e.ref,t.return=e,e.child=t)}if(i=t.child,!(t.lanes&s)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:Ub,n(a,r)&&t.ref===e.ref)return Hc(t,e,s)}return e.flags|=1,t=xd(i,r),t.ref=e.ref,t.return=e,e.child=t}function oV(t,e,n,r,s){if(t!==null){var i=t.memoizedProps;if(Ub(i,r)&&t.ref===e.ref)if(wi=!1,e.pendingProps=r=i,(t.lanes&s)!==0)t.flags&131072&&(wi=!0);else return e.lanes=t.lanes,Hc(t,e,s)}return fN(t,e,n,r,s)}function aV(t,e,n){var r=e.pendingProps,s=r.children,i=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},In(Am,Ji),Ji|=n;else{if(!(n&1073741824))return t=i!==null?i.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,In(Am,Ji),Ji|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,In(Am,Ji),Ji|=r}else i!==null?(r=i.baseLanes|n,e.memoizedState=null):r=n,In(Am,Ji),Ji|=r;return qs(t,e,s,n),e.child}function lV(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function fN(t,e,n,r,s){var i=Ai(n)?$h:Is.current;return i=av(e,i),Im(e,s),n=qM(t,e,n,r,i,s),r=KM(),t!==null&&!wi?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,Hc(t,e,s)):(Xn&&r&&LM(e),e.flags|=1,qs(t,e,n,s),e.child)}function T3(t,e,n,r,s){if(Ai(n)){var i=!0;VE(e)}else i=!1;if(Im(e,s),e.stateNode===null)HS(t,e),rV(e,n,r),uN(e,n,r,s),r=!0;else if(t===null){var a=e.stateNode,o=e.memoizedProps;a.props=o;var c=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=zo(u):(u=Ai(n)?$h:Is.current,u=av(e,u));var f=n.getDerivedStateFromProps,l=typeof f=="function"||typeof a.getSnapshotBeforeUpdate=="function";l||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==r||c!==u)&&S3(e,a,r,u),Pu=!1;var d=e.memoizedState;a.state=d,YE(e,r,a,s),c=e.memoizedState,o!==r||d!==c||Ci.current||Pu?(typeof f=="function"&&(cN(e,n,f,r),c=e.memoizedState),(o=Pu||x3(e,n,o,r,d,c,u))?(l||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(e.flags|=4194308)):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=c),a.props=r,a.state=c,a.context=u,r=o):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{a=e.stateNode,IH(t,e),o=e.memoizedProps,u=e.type===e.elementType?o:ea(e.type,o),a.props=u,l=e.pendingProps,d=a.context,c=n.contextType,typeof c=="object"&&c!==null?c=zo(c):(c=Ai(n)?$h:Is.current,c=av(e,c));var m=n.getDerivedStateFromProps;(f=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==l||d!==c)&&S3(e,a,r,c),Pu=!1,d=e.memoizedState,a.state=d,YE(e,r,a,s);var p=e.memoizedState;o!==l||d!==p||Ci.current||Pu?(typeof m=="function"&&(cN(e,n,m,r),p=e.memoizedState),(u=Pu||x3(e,n,u,r,d,p,c)||!1)?(f||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),r=!1)}return hN(t,e,n,r,i,s)}function hN(t,e,n,r,s,i){lV(t,e);var a=(e.flags&128)!==0;if(!r&&!a)return s&&p3(e,n,!1),Hc(t,e,i);r=e.stateNode,$ue.current=e;var o=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&a?(e.child=cv(e,t.child,null,i),e.child=cv(e,null,o,i)):qs(t,e,o,i),e.memoizedState=r.state,s&&p3(e,n,!0),e.child}function cV(t){var e=t.stateNode;e.pendingContext?h3(t,e.pendingContext,e.pendingContext!==e.context):e.context&&h3(t,e.context,!1),HM(t,e.containerInfo)}function k3(t,e,n,r,s){return lv(),$M(s),e.flags|=256,qs(t,e,n,r),e.child}var pN={dehydrated:null,treeContext:null,retryLane:0};function mN(t){return{baseLanes:t,cachePool:null,transitions:null}}function uV(t,e,n){var r=e.pendingProps,s=rr.current,i=!1,a=(e.flags&128)!==0,o;if((o=a)||(o=t!==null&&t.memoizedState===null?!1:(s&2)!==0),o?(i=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(s|=1),In(rr,s&1),t===null)return aN(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(a=r.children,t=r.fallback,i?(r=e.mode,i=e.child,a={mode:"hidden",children:a},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=a):i=F1(a,r,0,null),t=Dh(t,r,n,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=mN(n),e.memoizedState=pN,t):QM(e,a));if(s=t.memoizedState,s!==null&&(o=s.dehydrated,o!==null))return Fue(t,e,a,r,o,s,n);if(i){i=r.fallback,a=e.mode,s=t.child,o=s.sibling;var c={mode:"hidden",children:r.children};return!(a&1)&&e.child!==s?(r=e.child,r.childLanes=0,r.pendingProps=c,e.deletions=null):(r=xd(s,c),r.subtreeFlags=s.subtreeFlags&14680064),o!==null?i=xd(o,i):(i=Dh(i,a,n,null),i.flags|=2),i.return=e,r.return=e,r.sibling=i,e.child=r,r=i,i=e.child,a=t.child.memoizedState,a=a===null?mN(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=t.childLanes&~n,e.memoizedState=pN,r}return i=t.child,t=i.sibling,r=xd(i,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function QM(t,e){return e=F1({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Zx(t,e,n,r){return r!==null&&$M(r),cv(e,t.child,null,n),t=QM(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Fue(t,e,n,r,s,i,a){if(n)return e.flags&256?(e.flags&=-257,r=ZP(Error(ke(422))),Zx(t,e,a,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=r.fallback,s=e.mode,r=F1({mode:"visible",children:r.children},s,0,null),i=Dh(i,s,a,null),i.flags|=2,r.return=e,i.return=e,r.sibling=i,e.child=r,e.mode&1&&cv(e,t.child,null,a),e.child.memoizedState=mN(a),e.memoizedState=pN,i);if(!(e.mode&1))return Zx(t,e,a,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var o=r.dgst;return r=o,i=Error(ke(419)),r=ZP(i,r,void 0),Zx(t,e,a,r)}if(o=(a&t.childLanes)!==0,wi||o){if(r=ts,r!==null){switch(a&-a){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|a)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,Uc(t,s),Sa(r,t,s,-1))}return rL(),r=ZP(Error(ke(421))),Zx(t,e,a,r)}return s.data==="$?"?(e.flags|=128,e.child=t.child,e=Que.bind(null,t),s._reactRetry=e,null):(t=i.treeContext,io=yd(s.nextSibling),oo=e,Xn=!0,ba=null,t!==null&&(Oo[Mo++]=kc,Oo[Mo++]=Nc,Oo[Mo++]=Fh,kc=t.id,Nc=t.overflow,Fh=e),e=QM(e,r.children),e.flags|=4096,e)}function N3(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),lN(t.return,e,n)}function JP(t,e,n,r,s){var i=t.memoizedState;i===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function dV(t,e,n){var r=e.pendingProps,s=r.revealOrder,i=r.tail;if(qs(t,e,r.children,n),r=rr.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&N3(t,n,e);else if(t.tag===19)N3(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(In(rr,r),!(e.mode&1))e.memoizedState=null;else switch(s){case"forwards":for(n=e.child,s=null;n!==null;)t=n.alternate,t!==null&&XE(t)===null&&(s=n),n=n.sibling;n=s,n===null?(s=e.child,e.child=null):(s=n.sibling,n.sibling=null),JP(e,!1,s,n,i);break;case"backwards":for(n=null,s=e.child,e.child=null;s!==null;){if(t=s.alternate,t!==null&&XE(t)===null){e.child=s;break}t=s.sibling,s.sibling=n,n=s,s=t}JP(e,!0,n,null,i);break;case"together":JP(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function HS(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Hc(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Bh|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(ke(153));if(e.child!==null){for(t=e.child,n=xd(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=xd(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function jue(t,e,n){switch(e.tag){case 3:cV(e),lv();break;case 5:$H(e);break;case 1:Ai(e.type)&&VE(e);break;case 4:HM(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,s=e.memoizedProps.value;In(qE,r._currentValue),r._currentValue=s;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(In(rr,rr.current&1),e.flags|=128,null):n&e.child.childLanes?uV(t,e,n):(In(rr,rr.current&1),t=Hc(t,e,n),t!==null?t.sibling:null);In(rr,rr.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return dV(t,e,n);e.flags|=128}if(s=e.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),In(rr,rr.current),r)break;return null;case 22:case 23:return e.lanes=0,aV(t,e,n)}return Hc(t,e,n)}var fV,gN,hV,pV;fV=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};gN=function(){};hV=function(t,e,n,r){var s=t.memoizedProps;if(s!==r){t=e.stateNode,Sf(yl.current);var i=null;switch(n){case"input":s=Fk(t,s),r=Fk(t,r),i=[];break;case"select":s=ar({},s,{value:void 0}),r=ar({},r,{value:void 0}),i=[];break;case"textarea":s=zk(t,s),r=zk(t,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=UE)}Hk(n,r);var a;n=null;for(u in s)if(!r.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var o=s[u];for(a in o)o.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Lb.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var c=r[u];if(o=s!=null?s[u]:void 0,r.hasOwnProperty(u)&&c!==o&&(c!=null||o!=null))if(u==="style")if(o){for(a in o)!o.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&o[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(i||(i=[]),i.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,o=o?o.__html:void 0,c!=null&&o!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Lb.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&Un("scroll",t),i||o===c||(i=[])):(i=i||[]).push(u,c))}n&&(i=i||[]).push("style",n);var u=i;(e.updateQueue=u)&&(e.flags|=4)}};pV=function(t,e,n,r){n!==r&&(e.flags|=4)};function wy(t,e){if(!Xn)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Ss(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var s=t.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=t,s=s.sibling;else for(s=t.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=t,s=s.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function Bue(t,e,n){var r=e.pendingProps;switch(IM(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ss(e),null;case 1:return Ai(e.type)&&HE(),Ss(e),null;case 3:return r=e.stateNode,uv(),Vn(Ci),Vn(Is),WM(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Xx(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,ba!==null&&(EN(ba),ba=null))),gN(t,e),Ss(e),null;case 5:VM(e);var s=Sf(qb.current);if(n=e.type,t!==null&&e.stateNode!=null)hV(t,e,n,r,s),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(ke(166));return Ss(e),null}if(t=Sf(yl.current),Xx(e)){r=e.stateNode,n=e.type;var i=e.memoizedProps;switch(r[fl]=e,r[Wb]=i,t=(e.mode&1)!==0,n){case"dialog":Un("cancel",r),Un("close",r);break;case"iframe":case"object":case"embed":Un("load",r);break;case"video":case"audio":for(s=0;s<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=a.createElement(n,{is:r.is}):(t=a.createElement(n),n==="select"&&(a=t,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):t=a.createElementNS(t,n),t[fl]=e,t[Wb]=r,fV(t,e,!1,!1),e.stateNode=t;e:{switch(a=Vk(n,r),n){case"dialog":Un("cancel",t),Un("close",t),s=r;break;case"iframe":case"object":case"embed":Un("load",t),s=r;break;case"video":case"audio":for(s=0;sfv&&(e.flags|=128,r=!0,wy(i,!1),e.lanes=4194304)}else{if(!r)if(t=XE(a),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),wy(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!Xn)return Ss(e),null}else 2*wr()-i.renderingStartTime>fv&&n!==1073741824&&(e.flags|=128,r=!0,wy(i,!1),e.lanes=4194304);i.isBackwards?(a.sibling=e.child,e.child=a):(n=i.last,n!==null?n.sibling=a:e.child=a,i.last=a)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=wr(),e.sibling=null,n=rr.current,In(rr,r?n&1|2:n&1),e):(Ss(e),null);case 22:case 23:return nL(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Ji&1073741824&&(Ss(e),e.subtreeFlags&6&&(e.flags|=8192)):Ss(e),null;case 24:return null;case 25:return null}throw Error(ke(156,e.tag))}function zue(t,e){switch(IM(e),e.tag){case 1:return Ai(e.type)&&HE(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return uv(),Vn(Ci),Vn(Is),WM(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return VM(e),null;case 13:if(Vn(rr),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(ke(340));lv()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Vn(rr),null;case 4:return uv(),null;case 10:return BM(e.type._context),null;case 22:case 23:return nL(),null;case 24:return null;default:return null}}var Jx=!1,Ns=!1,Uue=typeof WeakSet=="function"?WeakSet:Set,Ge=null;function Cm(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){pr(t,e,r)}else n.current=null}function vN(t,e,n){try{n()}catch(r){pr(t,e,r)}}var D3=!1;function Hue(t,e){if(eN=jE,t=bH(),MM(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 a=0,o=-1,c=-1,u=0,f=0,l=t,d=null;t:for(;;){for(var m;l!==n||s!==0&&l.nodeType!==3||(o=a+s),l!==i||r!==0&&l.nodeType!==3||(c=a+r),l.nodeType===3&&(a+=l.nodeValue.length),(m=l.firstChild)!==null;)d=l,l=m;for(;;){if(l===t)break t;if(d===n&&++u===s&&(o=a),d===i&&++f===r&&(c=a),(m=l.nextSibling)!==null)break;l=d,d=l.parentNode}l=m}n=o===-1||c===-1?null:{start:o,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(tN={focusedElem:t,selectionRange:n},jE=!1,Ge=e;Ge!==null;)if(e=Ge,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ge=t;else for(;Ge!==null;){e=Ge;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var h=p.memoizedProps,y=p.memoizedState,g=e.stateNode,v=g.getSnapshotBeforeUpdate(e.elementType===e.type?h:ea(e.type,h),y);g.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=e.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ke(163))}}catch(x){pr(e,e.return,x)}if(t=e.sibling,t!==null){t.return=e.return,Ge=t;break}Ge=e.return}return p=D3,D3=!1,p}function _b(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&&vN(e,n,i)}s=s.next}while(s!==r)}}function I1(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 yN(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 mV(t){var e=t.alternate;e!==null&&(t.alternate=null,mV(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[fl],delete e[Wb],delete e[sN],delete e[Cue],delete e[Aue])),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 gV(t){return t.tag===5||t.tag===3||t.tag===4}function O3(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||gV(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 bN(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=UE));else if(r!==4&&(t=t.child,t!==null))for(bN(t,e,n),t=t.sibling;t!==null;)bN(t,e,n),t=t.sibling}function wN(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(wN(t,e,n),t=t.sibling;t!==null;)wN(t,e,n),t=t.sibling}var fs=null,va=!1;function pu(t,e,n){for(n=n.child;n!==null;)vV(t,e,n),n=n.sibling}function vV(t,e,n){if(vl&&typeof vl.onCommitFiberUnmount=="function")try{vl.onCommitFiberUnmount(P1,n)}catch{}switch(n.tag){case 5:Ns||Cm(n,e);case 6:var r=fs,s=va;fs=null,pu(t,e,n),fs=r,va=s,fs!==null&&(va?(t=fs,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):fs.removeChild(n.stateNode));break;case 18:fs!==null&&(va?(t=fs,n=n.stateNode,t.nodeType===8?GP(t.parentNode,n):t.nodeType===1&&GP(t,n),Bb(t)):GP(fs,n.stateNode));break;case 4:r=fs,s=va,fs=n.stateNode.containerInfo,va=!0,pu(t,e,n),fs=r,va=s;break;case 0:case 11:case 14:case 15:if(!Ns&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&vN(n,e,a),s=s.next}while(s!==r)}pu(t,e,n);break;case 1:if(!Ns&&(Cm(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){pr(n,e,o)}pu(t,e,n);break;case 21:pu(t,e,n);break;case 22:n.mode&1?(Ns=(r=Ns)||n.memoizedState!==null,pu(t,e,n),Ns=r):pu(t,e,n);break;default:pu(t,e,n)}}function M3(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new Uue),e.forEach(function(r){var s=Zue.bind(null,t,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Zo(t,e){var n=e.deletions;if(n!==null)for(var r=0;rs&&(s=a),r&=~i}if(r=s,r=wr()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Wue(r/1960))-r,10t?16:t,hd===null)var r=!1;else{if(t=hd,hd=null,tC=0,qt&6)throw Error(ke(331));var s=qt;for(qt|=4,Ge=t.current;Ge!==null;){var i=Ge,a=i.child;if(Ge.flags&16){var o=i.deletions;if(o!==null){for(var c=0;cwr()-eL?Nh(t,0):JM|=n),Ri(t,e)}function CV(t,e){e===0&&(t.mode&1?(e=Vx,Vx<<=1,!(Vx&130023424)&&(Vx=4194304)):e=1);var n=Zs();t=Uc(t,e),t!==null&&(s_(t,e,n),Ri(t,n))}function Que(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),CV(t,n)}function Zue(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),CV(t,n)}var AV;AV=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Ci.current)wi=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return wi=!1,jue(t,e,n);wi=!!(t.flags&131072)}else wi=!1,Xn&&e.flags&1048576&&kH(e,GE,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;HS(t,e),t=e.pendingProps;var s=av(e,Is.current);Im(e,n),s=qM(null,e,r,t,s,n);var i=KM();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,Ai(r)?(i=!0,VE(e)):i=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,UM(e),s.updater=L1,e.stateNode=s,s._reactInternals=e,uN(e,r,t,n),e=hN(null,e,r,!0,i,n)):(e.tag=0,Xn&&i&&LM(e),qs(null,e,s,n),e=e.child),e;case 16:r=e.elementType;e:{switch(HS(t,e),t=e.pendingProps,s=r._init,r=s(r._payload),e.type=r,s=e.tag=ede(r),t=ea(r,t),s){case 0:e=fN(null,e,r,t,n);break e;case 1:e=T3(null,e,r,t,n);break e;case 11:e=R3(null,e,r,t,n);break e;case 14:e=P3(null,e,r,ea(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:ea(r,s),fN(t,e,r,s,n);case 1:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:ea(r,s),T3(t,e,r,s,n);case 3:e:{if(cV(e),t===null)throw Error(ke(387));r=e.pendingProps,i=e.memoizedState,s=i.element,IH(t,e),YE(e,r,null,n);var a=e.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){s=dv(Error(ke(423)),e),e=k3(t,e,r,n,s);break e}else if(r!==s){s=dv(Error(ke(424)),e),e=k3(t,e,r,n,s);break e}else for(io=yd(e.stateNode.containerInfo.firstChild),oo=e,Xn=!0,ba=null,n=MH(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(lv(),r===s){e=Hc(t,e,n);break e}qs(t,e,r,n)}e=e.child}return e;case 5:return $H(e),t===null&&aN(e),r=e.type,s=e.pendingProps,i=t!==null?t.memoizedProps:null,a=s.children,nN(r,s)?a=null:i!==null&&nN(r,i)&&(e.flags|=32),lV(t,e),qs(t,e,a,n),e.child;case 6:return t===null&&aN(e),null;case 13:return uV(t,e,n);case 4:return HM(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=cv(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:ea(r,s),R3(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,a=s.value,In(qE,r._currentValue),r._currentValue=a,i!==null)if(Ca(i.value,a)){if(i.children===s.children&&!Ci.current){e=Hc(t,e,n);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){a=i.child;for(var c=o.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=Dc(-1,n&-n),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?c.next=c:(c.next=f.next,f.next=c),u.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),lN(i.return,n,e),o.lanes|=n;break}c=c.next}}else if(i.tag===10)a=i.type===e.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(ke(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),lN(a,n,e),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===e){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}qs(t,e,s.children,n),e=e.child}return e;case 9:return s=e.type,r=e.pendingProps.children,Im(e,n),s=zo(s),r=r(s),e.flags|=1,qs(t,e,r,n),e.child;case 14:return r=e.type,s=ea(r,e.pendingProps),s=ea(r.type,s),P3(t,e,r,s,n);case 15:return oV(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:ea(r,s),HS(t,e),e.tag=1,Ai(r)?(t=!0,VE(e)):t=!1,Im(e,n),rV(e,r,s),uN(e,r,s,n),hN(null,e,r,!0,t,n);case 19:return dV(t,e,n);case 22:return aV(t,e,n)}throw Error(ke(156,e.tag))};function RV(t,e){return eH(t,e)}function Jue(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 Fo(t,e,n,r){return new Jue(t,e,n,r)}function sL(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ede(t){if(typeof t=="function")return sL(t)?1:0;if(t!=null){if(t=t.$$typeof,t===SM)return 11;if(t===EM)return 14}return 2}function xd(t,e){var n=t.alternate;return n===null?(n=Fo(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 GS(t,e,n,r,s,i){var a=2;if(r=t,typeof t=="function")sL(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case gm:return Dh(n.children,s,i,e);case xM:a=8,s|=8;break;case Mk:return t=Fo(12,n,e,s|2),t.elementType=Mk,t.lanes=i,t;case Lk:return t=Fo(13,n,e,s),t.elementType=Lk,t.lanes=i,t;case Ik:return t=Fo(19,n,e,s),t.elementType=Ik,t.lanes=i,t;case $5:return F1(n,s,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case L5:a=10;break e;case I5:a=9;break e;case SM:a=11;break e;case EM:a=14;break e;case Ru:a=16,r=null;break e}throw Error(ke(130,t==null?t:typeof t,""))}return e=Fo(a,n,e,s),e.elementType=t,e.type=r,e.lanes=i,e}function Dh(t,e,n,r){return t=Fo(7,t,r,e),t.lanes=n,t}function F1(t,e,n,r){return t=Fo(22,t,r,e),t.elementType=$5,t.lanes=n,t.stateNode={isHidden:!1},t}function eT(t,e,n){return t=Fo(6,t,null,e),t.lanes=n,t}function tT(t,e,n){return e=Fo(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function tde(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=LP(0),this.expirationTimes=LP(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=LP(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function iL(t,e,n,r,s,i,a,o,c){return t=new tde(t,e,n,o,c),e===1?(e=1,i===!0&&(e|=8)):e=0,i=Fo(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},UM(i),t}function nde(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(NV)}catch(t){console.error(t)}}NV(),N5.exports=ho;var Ms=N5.exports;const l_=Yc(Ms),ade=b5({__proto__:null,default:l_},[Ms]);var U3=Ms;Dk.createRoot=U3.createRoot,Dk.hydrateRoot=U3.hydrateRoot;const DV=_.createContext({}),lde=({children:t,authActions:e})=>{const n=i=>{var a;try{return Promise.resolve((a=e.login)==null?void 0:a.call(e,i))}catch(o){return console.error(o),Promise.reject(o)}},r=i=>{var a;try{return Promise.resolve((a=e.logout)==null?void 0:a.call(e,i))}catch(o){return console.error(o),Promise.reject(o)}},s=async()=>{var i;try{return Promise.resolve((i=e.check)==null?void 0:i.call(e))}catch(a){return console.error(a),Promise.reject(a)}};return P.jsx(DV.Provider,{value:{...e,login:n,logout:r,check:s},children:t})},OV=()=>{const t=_.useContext(DV);if(t===null)throw new Error("useAuth must be used within a AuthProvider");return t};var Av=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(){}},Uh=typeof window>"u"||"Deno"in globalThis;function To(){}function cde(t,e){return typeof t=="function"?t(e):t}function CN(t){return typeof t=="number"&&t>=0&&t!==1/0}function MV(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Fm(t,e){return typeof t=="function"?t(e):t}function wa(t,e){return typeof t=="function"?t(e):t}function H3(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:o}=t;if(a){if(r){if(e.queryHash!==cL(a,e.options))return!1}else if(!Zb(e.queryKey,a))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof o=="boolean"&&e.isStale()!==o||s&&s!==e.state.fetchStatus||i&&!i(e))}function V3(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(Hh(e.options.mutationKey)!==Hh(i))return!1}else if(!Zb(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function cL(t,e){return((e==null?void 0:e.queryKeyHashFn)||Hh)(t)}function Hh(t){return JSON.stringify(t,(e,n)=>AN(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Zb(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Zb(t[n],e[n])):!1}function LV(t,e){if(t===e)return t;const n=W3(t)&&W3(e);if(n||AN(t)&&AN(e)){const r=n?t:Object.keys(t),s=r.length,i=n?e:Object.keys(e),a=i.length,o=n?[]:{};let c=0;for(let u=0;u{setTimeout(e,t)})}function RN(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?LV(t,e):e}function Q4e(t){return t}function dde(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function fde(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var uL=Symbol();function IV(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===uL?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var Pf,Iu,Zm,a5,hde=(a5=class extends Av{constructor(){super();B(this,Pf);B(this,Iu);B(this,Zm);$(this,Zm,e=>{if(!Uh&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){C(this,Iu)||this.setEventListener(C(this,Zm))}onUnsubscribe(){var e;this.hasListeners()||((e=C(this,Iu))==null||e.call(this),$(this,Iu,void 0))}setEventListener(e){var n;$(this,Zm,e),(n=C(this,Iu))==null||n.call(this),$(this,Iu,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){C(this,Pf)!==e&&($(this,Pf,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof C(this,Pf)=="boolean"?C(this,Pf):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Pf=new WeakMap,Iu=new WeakMap,Zm=new WeakMap,a5),dL=new hde,Jm,$u,eg,l5,pde=(l5=class extends Av{constructor(){super();B(this,Jm,!0);B(this,$u);B(this,eg);$(this,eg,e=>{if(!Uh&&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(){C(this,$u)||this.setEventListener(C(this,eg))}onUnsubscribe(){var e;this.hasListeners()||((e=C(this,$u))==null||e.call(this),$(this,$u,void 0))}setEventListener(e){var n;$(this,eg,e),(n=C(this,$u))==null||n.call(this),$(this,$u,e(this.setOnline.bind(this)))}setOnline(e){C(this,Jm)!==e&&($(this,Jm,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return C(this,Jm)}},Jm=new WeakMap,$u=new WeakMap,eg=new WeakMap,l5),iC=new pde;function PN(){let t,e;const n=new Promise((s,i)=>{t=s,e=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),t(s)},n.reject=s=>{r({status:"rejected",reason:s}),e(s)},n}function mde(t){return Math.min(1e3*2**t,3e4)}function $V(t){return(t??"online")==="online"?iC.isOnline():!0}var FV=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function nT(t){return t instanceof FV}function jV(t){let e=!1,n=0,r=!1,s;const i=PN(),a=h=>{var y;r||(d(new FV(h)),(y=t.abort)==null||y.call(t))},o=()=>{e=!0},c=()=>{e=!1},u=()=>dL.isFocused()&&(t.networkMode==="always"||iC.isOnline())&&t.canRun(),f=()=>$V(t.networkMode)&&t.canRun(),l=h=>{var y;r||(r=!0,(y=t.onSuccess)==null||y.call(t,h),s==null||s(),i.resolve(h))},d=h=>{var y;r||(r=!0,(y=t.onError)==null||y.call(t,h),s==null||s(),i.reject(h))},m=()=>new Promise(h=>{var y;s=g=>{(r||u())&&h(g)},(y=t.onPause)==null||y.call(t)}).then(()=>{var h;s=void 0,r||(h=t.onContinue)==null||h.call(t)}),p=()=>{if(r)return;let h;const y=n===0?t.initialPromise:void 0;try{h=y??t.fn()}catch(g){h=Promise.reject(g)}Promise.resolve(h).then(l).catch(g=>{var T;if(r)return;const v=t.retry??(Uh?0:3),w=t.retryDelay??mde,x=typeof w=="function"?w(n,g):w,A=v===!0||typeof v=="number"&&nu()?void 0:m()).then(()=>{e?d(g):p()})})};return{promise:i,cancel:a,continue:()=>(s==null||s(),i),cancelRetry:o,continueRetry:c,canStart:f,start:()=>(f()?p():m().then(p),i)}}var gde=t=>setTimeout(t,0);function vde(){let t=[],e=0,n=o=>{o()},r=o=>{o()},s=gde;const i=o=>{e?t.push(o):s(()=>{n(o)})},a=()=>{const o=t;t=[],o.length&&s(()=>{r(()=>{o.forEach(c=>{n(c)})})})};return{batch:o=>{let c;e++;try{c=o()}finally{e--,e||a()}return c},batchCalls:o=>(...c)=>{i(()=>{o(...c)})},schedule:i,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{s=o}}}var Vr=vde(),Tf,c5,BV=(c5=class{constructor(){B(this,Tf)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),CN(this.gcTime)&&$(this,Tf,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Uh?1/0:5*60*1e3))}clearGcTimeout(){C(this,Tf)&&(clearTimeout(C(this,Tf)),$(this,Tf,void 0))}},Tf=new WeakMap,c5),tg,ng,Eo,kf,Rs,w0,Nf,na,Kl,u5,yde=(u5=class extends BV{constructor(e){super();B(this,na);B(this,tg);B(this,ng);B(this,Eo);B(this,kf);B(this,Rs);B(this,w0);B(this,Nf);$(this,Nf,!1),$(this,w0,e.defaultOptions),this.setOptions(e.options),this.observers=[],$(this,kf,e.client),$(this,Eo,C(this,kf).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,$(this,tg,bde(this.options)),this.state=e.state??C(this,tg),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=C(this,Rs))==null?void 0:e.promise}setOptions(e){this.options={...C(this,w0),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&C(this,Eo).remove(this)}setData(e,n){const r=RN(this.state.data,e,this.options);return z(this,na,Kl).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,na,Kl).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,s;const n=(r=C(this,Rs))==null?void 0:r.promise;return(s=C(this,Rs))==null||s.cancel(e),n?n.then(To).catch(To):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(C(this,tg))}isActive(){return this.observers.some(e=>wa(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===uL||this.state.dataUpdateCount+this.state.errorUpdateCount===0}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||!MV(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=C(this,Rs))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=C(this,Rs))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),C(this,Eo).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(C(this,Rs)&&(C(this,Nf)?C(this,Rs).cancel({revert:!0}):C(this,Rs).cancelRetry()),this.scheduleGc()),C(this,Eo).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||z(this,na,Kl).call(this,{type:"invalidate"})}fetch(e,n){var c,u,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(C(this,Rs))return C(this,Rs).continueRetry(),C(this,Rs).promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(d=>d.options.queryFn);l&&this.setOptions(l.options)}const r=new AbortController,s=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>($(this,Nf,!0),r.signal)})},i=()=>{const l=IV(this.options,n),d={client:C(this,kf),queryKey:this.queryKey,meta:this.meta};return s(d),$(this,Nf,!1),this.options.persister?this.options.persister(l,d,this):l(d)},a={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:C(this,kf),state:this.state,fetchFn:i};s(a),(c=this.options.behavior)==null||c.onFetch(a,this),$(this,ng,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=a.fetchOptions)==null?void 0:u.meta))&&z(this,na,Kl).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta});const o=l=>{var d,m,p,h;nT(l)&&l.silent||z(this,na,Kl).call(this,{type:"error",error:l}),nT(l)||((m=(d=C(this,Eo).config).onError)==null||m.call(d,l,this),(h=(p=C(this,Eo).config).onSettled)==null||h.call(p,this.state.data,l,this)),this.scheduleGc()};return $(this,Rs,jV({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:l=>{var d,m,p,h;if(l===void 0){o(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(l)}catch(y){o(y);return}(m=(d=C(this,Eo).config).onSuccess)==null||m.call(d,l,this),(h=(p=C(this,Eo).config).onSettled)==null||h.call(p,l,this.state.error,this),this.scheduleGc()},onError:o,onFail:(l,d)=>{z(this,na,Kl).call(this,{type:"failed",failureCount:l,error:d})},onPause:()=>{z(this,na,Kl).call(this,{type:"pause"})},onContinue:()=>{z(this,na,Kl).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),C(this,Rs).start()}},tg=new WeakMap,ng=new WeakMap,Eo=new WeakMap,kf=new WeakMap,Rs=new WeakMap,w0=new WeakMap,Nf=new WeakMap,na=new WeakSet,Kl=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,...zV(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 nT(s)&&s.revert&&C(this,ng)?{...C(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),Vr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),C(this,Eo).notify({query:this,type:"updated",action:e})})},u5);function zV(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:$V(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function bde(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 Ga,d5,wde=(d5=class extends Av{constructor(e={}){super();B(this,Ga);this.config=e,$(this,Ga,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??cL(s,n);let a=this.get(i);return a||(a=new yde({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){C(this,Ga).has(e.queryHash)||(C(this,Ga).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=C(this,Ga).get(e.queryHash);n&&(e.destroy(),n===e&&C(this,Ga).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Vr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return C(this,Ga).get(e)}getAll(){return[...C(this,Ga).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>H3(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>H3(e,r)):n}notify(e){Vr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Vr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Vr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ga=new WeakMap,d5),qa,Hs,Df,Ka,bu,f5,_de=(f5=class extends BV{constructor(e){super();B(this,Ka);B(this,qa);B(this,Hs);B(this,Df);this.mutationId=e.mutationId,$(this,Hs,e.mutationCache),$(this,qa,[]),this.state=e.state||UV(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){C(this,qa).includes(e)||(C(this,qa).push(e),this.clearGcTimeout(),C(this,Hs).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){$(this,qa,C(this,qa).filter(n=>n!==e)),this.scheduleGc(),C(this,Hs).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){C(this,qa).length||(this.state.status==="pending"?this.scheduleGc():C(this,Hs).remove(this))}continue(){var e;return((e=C(this,Df))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var s,i,a,o,c,u,f,l,d,m,p,h,y,g,v,w,x,A,T,R;$(this,Df,jV({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(E,k)=>{z(this,Ka,bu).call(this,{type:"failed",failureCount:E,error:k})},onPause:()=>{z(this,Ka,bu).call(this,{type:"pause"})},onContinue:()=>{z(this,Ka,bu).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>C(this,Hs).canRun(this)}));const n=this.state.status==="pending",r=!C(this,Df).canStart();try{if(!n){z(this,Ka,bu).call(this,{type:"pending",variables:e,isPaused:r}),await((i=(s=C(this,Hs).config).onMutate)==null?void 0:i.call(s,e,this));const k=await((o=(a=this.options).onMutate)==null?void 0:o.call(a,e));k!==this.state.context&&z(this,Ka,bu).call(this,{type:"pending",context:k,variables:e,isPaused:r})}const E=await C(this,Df).start();return await((u=(c=C(this,Hs).config).onSuccess)==null?void 0:u.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((m=(d=C(this,Hs).config).onSettled)==null?void 0:m.call(d,E,null,this.state.variables,this.state.context,this)),await((h=(p=this.options).onSettled)==null?void 0:h.call(p,E,null,e,this.state.context)),z(this,Ka,bu).call(this,{type:"success",data:E}),E}catch(E){try{throw await((g=(y=C(this,Hs).config).onError)==null?void 0:g.call(y,E,e,this.state.context,this)),await((w=(v=this.options).onError)==null?void 0:w.call(v,E,e,this.state.context)),await((A=(x=C(this,Hs).config).onSettled)==null?void 0:A.call(x,void 0,E,this.state.variables,this.state.context,this)),await((R=(T=this.options).onSettled)==null?void 0:R.call(T,void 0,E,e,this.state.context)),E}finally{z(this,Ka,bu).call(this,{type:"error",error:E})}}finally{C(this,Hs).runNext(this)}}},qa=new WeakMap,Hs=new WeakMap,Df=new WeakMap,Ka=new WeakSet,bu=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),Vr.batch(()=>{C(this,qa).forEach(r=>{r.onMutationUpdate(e)}),C(this,Hs).notify({mutation:this,type:"updated",action:e})})},f5);function UV(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var rc,ra,_0,h5,xde=(h5=class extends Av{constructor(e={}){super();B(this,rc);B(this,ra);B(this,_0);this.config=e,$(this,rc,new Set),$(this,ra,new Map),$(this,_0,0)}build(e,n,r){const s=new _de({mutationCache:this,mutationId:++_s(this,_0)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){C(this,rc).add(e);const n=nS(e);if(typeof n=="string"){const r=C(this,ra).get(n);r?r.push(e):C(this,ra).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(C(this,rc).delete(e)){const n=nS(e);if(typeof n=="string"){const r=C(this,ra).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&C(this,ra).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=nS(e);if(typeof n=="string"){const r=C(this,ra).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r;const n=nS(e);if(typeof n=="string"){const s=(r=C(this,ra).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Vr.batch(()=>{C(this,rc).forEach(e=>{this.notify({type:"removed",mutation:e})}),C(this,rc).clear(),C(this,ra).clear()})}getAll(){return Array.from(C(this,rc))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>V3(n,r))}findAll(e={}){return this.getAll().filter(n=>V3(e,n))}notify(e){Vr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Vr.batch(()=>Promise.all(e.map(n=>n.continue().catch(To))))}},rc=new WeakMap,ra=new WeakMap,_0=new WeakMap,h5);function nS(t){var e;return(e=t.options.scope)==null?void 0:e.id}function q3(t){return{onFetch:(e,n)=>{var f,l,d,m,p;const r=e.options,s=(d=(l=(f=e.fetchOptions)==null?void 0:f.meta)==null?void 0:l.fetchMore)==null?void 0:d.direction,i=((m=e.state.data)==null?void 0:m.pages)||[],a=((p=e.state.data)==null?void 0:p.pageParams)||[];let o={pages:[],pageParams:[]},c=0;const u=async()=>{let h=!1;const y=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(e.signal.aborted?h=!0:e.signal.addEventListener("abort",()=>{h=!0}),e.signal)})},g=IV(e.options,e.fetchOptions),v=async(w,x,A)=>{if(h)return Promise.reject();if(x==null&&w.pages.length)return Promise.resolve(w);const T={client:e.client,queryKey:e.queryKey,pageParam:x,direction:A?"backward":"forward",meta:e.options.meta};y(T);const R=await g(T),{maxPages:E}=e.options,k=A?fde:dde;return{pages:k(w.pages,R,E),pageParams:k(w.pageParams,x,E)}};if(s&&i.length){const w=s==="backward",x=w?Sde:K3,A={pages:i,pageParams:a},T=x(r,A);o=await v(A,T,w)}else{const w=t??i.length;do{const x=c===0?a[0]??r.initialPageParam:K3(r,o);if(c>0&&x==null)break;o=await v(o,x),c++}while(c{var h,y;return(y=(h=e.options).persister)==null?void 0:y.call(h,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=u}}}function K3(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 Sde(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 fr,Fu,ju,rg,sg,Bu,ig,og,p5,Ede=(p5=class{constructor(t={}){B(this,fr);B(this,Fu);B(this,ju);B(this,rg);B(this,sg);B(this,Bu);B(this,ig);B(this,og);$(this,fr,t.queryCache||new wde),$(this,Fu,t.mutationCache||new xde),$(this,ju,t.defaultOptions||{}),$(this,rg,new Map),$(this,sg,new Map),$(this,Bu,0)}mount(){_s(this,Bu)._++,C(this,Bu)===1&&($(this,ig,dL.subscribe(async t=>{t&&(await this.resumePausedMutations(),C(this,fr).onFocus())})),$(this,og,iC.subscribe(async t=>{t&&(await this.resumePausedMutations(),C(this,fr).onOnline())})))}unmount(){var t,e;_s(this,Bu)._--,C(this,Bu)===0&&((t=C(this,ig))==null||t.call(this),$(this,ig,void 0),(e=C(this,og))==null||e.call(this),$(this,og,void 0))}isFetching(t){return C(this,fr).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return C(this,Fu).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=C(this,fr).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=C(this,fr).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Fm(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return C(this,fr).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=C(this,fr).get(r.queryHash),i=s==null?void 0:s.state.data,a=cde(e,i);if(a!==void 0)return C(this,fr).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return Vr.batch(()=>C(this,fr).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=C(this,fr).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=C(this,fr);Vr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=C(this,fr);return Vr.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Vr.batch(()=>C(this,fr).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(To).catch(To)}invalidateQueries(t,e={}){return Vr.batch(()=>(C(this,fr).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=Vr.batch(()=>C(this,fr).findAll(t).filter(s=>!s.isDisabled()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(To)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(To)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=C(this,fr).build(this,e);return n.isStaleByTime(Fm(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(To).catch(To)}fetchInfiniteQuery(t){return t.behavior=q3(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(To).catch(To)}ensureInfiniteQueryData(t){return t.behavior=q3(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return iC.isOnline()?C(this,Fu).resumePausedMutations():Promise.resolve()}getQueryCache(){return C(this,fr)}getMutationCache(){return C(this,Fu)}getDefaultOptions(){return C(this,ju)}setDefaultOptions(t){$(this,ju,t)}setQueryDefaults(t,e){C(this,rg).set(Hh(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...C(this,rg).values()],n={};return e.forEach(r=>{Zb(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){C(this,sg).set(Hh(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...C(this,sg).values()],n={};return e.forEach(r=>{Zb(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...C(this,ju).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=cL(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===uL&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...C(this,ju).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){C(this,fr).clear(),C(this,Fu).clear()}},fr=new WeakMap,Fu=new WeakMap,ju=new WeakMap,rg=new WeakMap,sg=new WeakMap,Bu=new WeakMap,ig=new WeakMap,og=new WeakMap,p5),fi,jt,x0,Vs,Of,ag,zu,Ya,S0,lg,cg,Mf,Lf,Uu,ug,sn,Gy,TN,kN,NN,DN,ON,MN,LN,HV,m5,Cde=(m5=class extends Av{constructor(e,n){super();B(this,sn);B(this,fi);B(this,jt);B(this,x0);B(this,Vs);B(this,Of);B(this,ag);B(this,zu);B(this,Ya);B(this,S0);B(this,lg);B(this,cg);B(this,Mf);B(this,Lf);B(this,Uu);B(this,ug,new Set);this.options=n,$(this,fi,e),$(this,Ya,null),$(this,zu,PN()),this.options.experimental_prefetchInRender||C(this,zu).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(C(this,jt).addObserver(this),Y3(C(this,jt),this.options)?z(this,sn,Gy).call(this):this.updateResult(),z(this,sn,DN).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return IN(C(this,jt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return IN(C(this,jt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,z(this,sn,ON).call(this),z(this,sn,MN).call(this),C(this,jt).removeObserver(this)}setOptions(e){const n=this.options,r=C(this,jt);if(this.options=C(this,fi).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof wa(this.options.enabled,C(this,jt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");z(this,sn,LN).call(this),C(this,jt).setOptions(this.options),n._defaulted&&!sC(this.options,n)&&C(this,fi).getQueryCache().notify({type:"observerOptionsUpdated",query:C(this,jt),observer:this});const s=this.hasListeners();s&&X3(C(this,jt),r,this.options,n)&&z(this,sn,Gy).call(this),this.updateResult(),s&&(C(this,jt)!==r||wa(this.options.enabled,C(this,jt))!==wa(n.enabled,C(this,jt))||Fm(this.options.staleTime,C(this,jt))!==Fm(n.staleTime,C(this,jt)))&&z(this,sn,TN).call(this);const i=z(this,sn,kN).call(this);s&&(C(this,jt)!==r||wa(this.options.enabled,C(this,jt))!==wa(n.enabled,C(this,jt))||i!==C(this,Uu))&&z(this,sn,NN).call(this,i)}getOptimisticResult(e){const n=C(this,fi).getQueryCache().build(C(this,fi),e),r=this.createResult(n,e);return Rde(this,r)&&($(this,Vs,r),$(this,ag,this.options),$(this,Of,C(this,jt).state)),r}getCurrentResult(){return C(this,Vs)}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){C(this,ug).add(e)}getCurrentQuery(){return C(this,jt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=C(this,fi).defaultQueryOptions(e),r=C(this,fi).getQueryCache().build(C(this,fi),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return z(this,sn,Gy).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),C(this,Vs)))}createResult(e,n){var E;const r=C(this,jt),s=this.options,i=C(this,Vs),a=C(this,Of),o=C(this,ag),u=e!==r?e.state:C(this,x0),{state:f}=e;let l={...f},d=!1,m;if(n._optimisticResults){const k=this.hasListeners(),N=!k&&Y3(e,n),O=k&&X3(e,r,n,s);(N||O)&&(l={...l,...zV(f.data,e.options)}),n._optimisticResults==="isRestoring"&&(l.fetchStatus="idle")}let{error:p,errorUpdatedAt:h,status:y}=l;if(n.select&&l.data!==void 0)if(i&&l.data===(a==null?void 0:a.data)&&n.select===C(this,S0))m=C(this,lg);else try{$(this,S0,n.select),m=n.select(l.data),m=RN(i==null?void 0:i.data,m,n),$(this,lg,m),$(this,Ya,null)}catch(k){$(this,Ya,k)}else m=l.data;if(n.placeholderData!==void 0&&m===void 0&&y==="pending"){let k;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData))k=i.data;else if(k=typeof n.placeholderData=="function"?n.placeholderData((E=C(this,cg))==null?void 0:E.state.data,C(this,cg)):n.placeholderData,n.select&&k!==void 0)try{k=n.select(k),$(this,Ya,null)}catch(N){$(this,Ya,N)}k!==void 0&&(y="success",m=RN(i==null?void 0:i.data,k,n),d=!0)}C(this,Ya)&&(p=C(this,Ya),m=C(this,lg),h=Date.now(),y="error");const g=l.fetchStatus==="fetching",v=y==="pending",w=y==="error",x=v&&g,A=m!==void 0,R={status:y,fetchStatus:l.fetchStatus,isPending:v,isSuccess:y==="success",isError:w,isInitialLoading:x,isLoading:x,data:m,dataUpdatedAt:l.dataUpdatedAt,error:p,errorUpdatedAt:h,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:l.dataUpdateCount>0||l.errorUpdateCount>0,isFetchedAfterMount:l.dataUpdateCount>u.dataUpdateCount||l.errorUpdateCount>u.errorUpdateCount,isFetching:g,isRefetching:g&&!v,isLoadingError:w&&!A,isPaused:l.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:w&&A,isStale:fL(e,n),refetch:this.refetch,promise:C(this,zu)};if(this.options.experimental_prefetchInRender){const k=L=>{R.status==="error"?L.reject(R.error):R.data!==void 0&&L.resolve(R.data)},N=()=>{const L=$(this,zu,R.promise=PN());k(L)},O=C(this,zu);switch(O.status){case"pending":e.queryHash===r.queryHash&&k(O);break;case"fulfilled":(R.status==="error"||R.data!==O.value)&&N();break;case"rejected":(R.status!=="error"||R.error!==O.reason)&&N();break}}return R}updateResult(){const e=C(this,Vs),n=this.createResult(C(this,jt),this.options);if($(this,Of,C(this,jt).state),$(this,ag,this.options),C(this,Of).data!==void 0&&$(this,cg,C(this,jt)),sC(n,e))return;$(this,Vs,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!C(this,ug).size)return!0;const a=new Set(i??C(this,ug));return this.options.throwOnError&&a.add("error"),Object.keys(C(this,Vs)).some(o=>{const c=o;return C(this,Vs)[c]!==e[c]&&a.has(c)})};z(this,sn,HV).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&z(this,sn,DN).call(this)}},fi=new WeakMap,jt=new WeakMap,x0=new WeakMap,Vs=new WeakMap,Of=new WeakMap,ag=new WeakMap,zu=new WeakMap,Ya=new WeakMap,S0=new WeakMap,lg=new WeakMap,cg=new WeakMap,Mf=new WeakMap,Lf=new WeakMap,Uu=new WeakMap,ug=new WeakMap,sn=new WeakSet,Gy=function(e){z(this,sn,LN).call(this);let n=C(this,jt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(To)),n},TN=function(){z(this,sn,ON).call(this);const e=Fm(this.options.staleTime,C(this,jt));if(Uh||C(this,Vs).isStale||!CN(e))return;const r=MV(C(this,Vs).dataUpdatedAt,e)+1;$(this,Mf,setTimeout(()=>{C(this,Vs).isStale||this.updateResult()},r))},kN=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(C(this,jt)):this.options.refetchInterval)??!1},NN=function(e){z(this,sn,MN).call(this),$(this,Uu,e),!(Uh||wa(this.options.enabled,C(this,jt))===!1||!CN(C(this,Uu))||C(this,Uu)===0)&&$(this,Lf,setInterval(()=>{(this.options.refetchIntervalInBackground||dL.isFocused())&&z(this,sn,Gy).call(this)},C(this,Uu)))},DN=function(){z(this,sn,TN).call(this),z(this,sn,NN).call(this,z(this,sn,kN).call(this))},ON=function(){C(this,Mf)&&(clearTimeout(C(this,Mf)),$(this,Mf,void 0))},MN=function(){C(this,Lf)&&(clearInterval(C(this,Lf)),$(this,Lf,void 0))},LN=function(){const e=C(this,fi).getQueryCache().build(C(this,fi),this.options);if(e===C(this,jt))return;const n=C(this,jt);$(this,jt,e),$(this,x0,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},HV=function(e){Vr.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(C(this,Vs))}),C(this,fi).getQueryCache().notify({query:C(this,jt),type:"observerResultsUpdated"})})},m5);function Ade(t,e){return wa(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Y3(t,e){return Ade(t,e)||t.state.data!==void 0&&IN(t,e,e.refetchOnMount)}function IN(t,e,n){if(wa(e.enabled,t)!==!1){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&fL(t,e)}return!1}function X3(t,e,n,r){return(t!==e||wa(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&fL(t,n)}function fL(t,e){return wa(e.enabled,t)!==!1&&t.isStaleByTime(Fm(e.staleTime,t))}function Rde(t,e){return!sC(t.getCurrentResult(),e)}var Hu,Vu,hi,sc,$c,qS,$N,g5,Pde=(g5=class extends Av{constructor(n,r){super();B(this,$c);B(this,Hu);B(this,Vu);B(this,hi);B(this,sc);$(this,Hu,n),this.setOptions(r),this.bindMethods(),z(this,$c,qS).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=C(this,Hu).defaultMutationOptions(n),sC(this.options,r)||C(this,Hu).getMutationCache().notify({type:"observerOptionsUpdated",mutation:C(this,hi),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Hh(r.mutationKey)!==Hh(this.options.mutationKey)?this.reset():((s=C(this,hi))==null?void 0:s.state.status)==="pending"&&C(this,hi).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=C(this,hi))==null||n.removeObserver(this)}onMutationUpdate(n){z(this,$c,qS).call(this),z(this,$c,$N).call(this,n)}getCurrentResult(){return C(this,Vu)}reset(){var n;(n=C(this,hi))==null||n.removeObserver(this),$(this,hi,void 0),z(this,$c,qS).call(this),z(this,$c,$N).call(this)}mutate(n,r){var s;return $(this,sc,r),(s=C(this,hi))==null||s.removeObserver(this),$(this,hi,C(this,Hu).getMutationCache().build(C(this,Hu),this.options)),C(this,hi).addObserver(this),C(this,hi).execute(n)}},Hu=new WeakMap,Vu=new WeakMap,hi=new WeakMap,sc=new WeakMap,$c=new WeakSet,qS=function(){var r;const n=((r=C(this,hi))==null?void 0:r.state)??UV();$(this,Vu,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},$N=function(n){Vr.batch(()=>{var r,s,i,a,o,c,u,f;if(C(this,sc)&&this.hasListeners()){const l=C(this,Vu).variables,d=C(this,Vu).context;(n==null?void 0:n.type)==="success"?((s=(r=C(this,sc)).onSuccess)==null||s.call(r,n.data,l,d),(a=(i=C(this,sc)).onSettled)==null||a.call(i,n.data,null,l,d)):(n==null?void 0:n.type)==="error"&&((c=(o=C(this,sc)).onError)==null||c.call(o,n.error,l,d),(f=(u=C(this,sc)).onSettled)==null||f.call(u,void 0,n.error,l,d))}this.listeners.forEach(l=>{l(C(this,Vu))})})},g5),VV=_.createContext(void 0),WV=t=>{const e=_.useContext(VV);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Tde=({client:t,children:e})=>(_.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),P.jsx(VV.Provider,{value:t,children:e})),GV=_.createContext(!1),kde=()=>_.useContext(GV);GV.Provider;function Nde(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Dde=_.createContext(Nde()),Ode=()=>_.useContext(Dde);function qV(t,e){return typeof t=="function"?t(...e):!!t}function FN(){}var Mde=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},Lde=t=>{_.useEffect(()=>{t.clearReset()},[t])},Ide=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||qV(n,[t.error,r])),$de=t=>{const e=t.staleTime;t.suspense&&(t.staleTime=typeof e=="function"?(...n)=>Math.max(e(...n),1e3):Math.max(e??1e3,1e3),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3)))},Fde=(t,e)=>t.isLoading&&t.isFetching&&!e,jde=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,Q3=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function Bde(t,e,n){var l,d,m,p,h;const r=WV(),s=kde(),i=Ode(),a=r.defaultQueryOptions(t);(d=(l=r.getDefaultOptions().queries)==null?void 0:l._experimental_beforeQuery)==null||d.call(l,a),a._optimisticResults=s?"isRestoring":"optimistic",$de(a),Mde(a,i),Lde(i);const o=!r.getQueryCache().get(a.queryHash),[c]=_.useState(()=>new e(r,a)),u=c.getOptimisticResult(a),f=!s&&t.subscribed!==!1;if(_.useSyncExternalStore(_.useCallback(y=>{const g=f?c.subscribe(Vr.batchCalls(y)):FN;return c.updateResult(),g},[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),_.useEffect(()=>{c.setOptions(a)},[a,c]),jde(a,u))throw Q3(a,c,i);if(Ide({result:u,errorResetBoundary:i,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw u.error;if((p=(m=r.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||p.call(m,a,u),a.experimental_prefetchInRender&&!Uh&&Fde(u,s)){const y=o?Q3(a,c,i):(h=r.getQueryCache().get(a.queryHash))==null?void 0:h.promise;y==null||y.catch(FN).finally(()=>{c.updateResult()})}return a.notifyOnChangeProps?u:c.trackResult(u)}function KV(t,e){return Bde(t,Cde)}function zde(t,e){const n=WV(),[r]=_.useState(()=>new Pde(n,t));_.useEffect(()=>{r.setOptions(t)},[r,t]);const s=_.useSyncExternalStore(_.useCallback(a=>r.subscribe(Vr.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=_.useCallback((a,o)=>{r.mutate(a,o).catch(FN)},[r]);if(s.error&&qV(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}class Ho{constructor(e=[]){Le(this,"segments",[]);this.segments=e}key(){return this.segments}get(){return this.segments}}class Fd extends Ho{params(e){return new Ho([...this.segments,e])}}class Ude extends Ho{id(e){return new Fd([...this.segments,e?String(e):void 0])}}class Hde extends Ho{ids(...e){return new Fd([...this.segments,...e.length?[e.map(n=>String(n))]:[]])}}class Vde extends Ho{action(e){if(["one","report"].includes(e))return new Ude([...this.segments,e]);if(e==="many")return new Hde([...this.segments,e]);if(["list","infinite"].includes(e))return new Fd([...this.segments,e]);throw new Error("Invalid action type")}}class Wde extends Ho{resource(e){return new Vde([...this.segments,e])}mutation(e){return new Fd([...e==="custom"?this.segments:[this.segments[0]],e])}}class Gde extends Ho{action(e){return new Fd([...this.segments,e])}}class qde extends Ho{action(e){return new Fd([...this.segments,e])}}class Kde extends Ho{resource(e){return new qde([...this.segments,e])}}class Yde extends Ho{action(e){return new Fd([...this.segments,e])}}class Xde extends Ho{resource(e){return new Yde([...this.segments,e])}action(e){return new Fd([...this.segments,e])}}class Qde extends Ho{data(e){return new Wde(["data",e||"default"])}auth(){return new Gde(["auth"])}access(){return new Kde(["access"])}audit(){return new Xde(["audit"])}}const Zde=()=>new Qde([]),YV=()=>Zde,XV=t=>{const e=YV(),{getProfile:n}=OV();return KV({queryKey:e().auth().action("profile").get(),queryFn:n,...t})},Jde=t=>{const e=YV(),{check:n}=OV();return KV({queryKey:e().auth().action("check").get(),queryFn:n,retry:!1,...t})};function efe(t,e){const n=_.createContext(e);function r(i){const{children:a,...o}=i,c=_.useMemo(()=>o,Object.values(o));return P.jsx(n.Provider,{value:c,children:a})}function s(i){const a=_.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return r.displayName=t+"Provider",[r,s]}function Nn(t,e=[]){let n=[];function r(i,a){const o=_.createContext(a),c=n.length;n=[...n,a];function u(l){const{scope:d,children:m,...p}=l,h=(d==null?void 0:d[t][c])||o,y=_.useMemo(()=>p,Object.values(p));return P.jsx(h.Provider,{value:y,children:m})}function f(l,d){const m=(d==null?void 0:d[t][c])||o,p=_.useContext(m);if(p)return p;if(a!==void 0)return a;throw new Error(`\`${l}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,f]}const s=()=>{const i=n.map(a=>_.createContext(a));return function(o){const c=(o==null?void 0:o[t])||i;return _.useMemo(()=>({[`__scope${t}`]:{...o,[t]:c}}),[o,c])}};return s.scopeName=t,[r,tfe(s,...e)]}function tfe(...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 a=r.reduce((o,{useScope:c,scopeName:u})=>{const l=c(i)[`__scope${u}`];return{...o,...l}},{});return _.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}function nfe(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function c_(...t){return e=>t.forEach(n=>nfe(n,e))}function tt(...t){return _.useCallback(c_(...t),t)}var Aa=_.forwardRef((t,e)=>{const{children:n,...r}=t,s=_.Children.toArray(n),i=s.find(rfe);if(i){const a=i.props.children,o=s.map(c=>c===i?_.Children.count(a)>1?_.Children.only(null):_.isValidElement(a)?a.props.children:null:c);return P.jsx(jN,{...r,ref:e,children:_.isValidElement(a)?_.cloneElement(a,void 0,o):null})}return P.jsx(jN,{...r,ref:e,children:n})});Aa.displayName="Slot";var jN=_.forwardRef((t,e)=>{const{children:n,...r}=t;if(_.isValidElement(n)){const s=ife(n);return _.cloneElement(n,{...sfe(r,n.props),ref:e?c_(e,s):s})}return _.Children.count(n)>1?_.Children.only(null):null});jN.displayName="SlotClone";var hL=({children:t})=>P.jsx(P.Fragment,{children:t});function rfe(t){return _.isValidElement(t)&&t.type===hL}function sfe(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]=(...o)=>{i(...o),s(...o)}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function ife(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 Qc(t){const e=t+"CollectionProvider",[n,r]=Nn(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=m=>{const{scope:p,children:h}=m,y=se.useRef(null),g=se.useRef(new Map).current;return P.jsx(s,{scope:p,itemMap:g,collectionRef:y,children:h})};a.displayName=e;const o=t+"CollectionSlot",c=se.forwardRef((m,p)=>{const{scope:h,children:y}=m,g=i(o,h),v=tt(p,g.collectionRef);return P.jsx(Aa,{ref:v,children:y})});c.displayName=o;const u=t+"CollectionItemSlot",f="data-radix-collection-item",l=se.forwardRef((m,p)=>{const{scope:h,children:y,...g}=m,v=se.useRef(null),w=tt(p,v),x=i(u,h);return se.useEffect(()=>(x.itemMap.set(v,{ref:v,...g}),()=>void x.itemMap.delete(v))),P.jsx(Aa,{[f]:"",ref:w,children:y})});l.displayName=u;function d(m){const p=i(t+"CollectionConsumer",m);return se.useCallback(()=>{const y=p.collectionRef.current;if(!y)return[];const g=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(p.itemMap.values()).sort((x,A)=>g.indexOf(x.ref.current)-g.indexOf(A.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:a,Slot:c,ItemSlot:l},d,r]}function me(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 zt(t){const e=_.useRef(t);return _.useEffect(()=>{e.current=t}),_.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function lr({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,s]=ofe({defaultProp:e,onChange:n}),i=t!==void 0,a=i?t:r,o=zt(n),c=_.useCallback(u=>{if(i){const l=typeof u=="function"?u(t):u;l!==t&&o(l)}else s(u)},[i,t,s,o]);return[a,c]}function ofe({defaultProp:t,onChange:e}){const n=_.useState(t),[r]=n,s=_.useRef(r),i=zt(e);return _.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}var afe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ne=afe.reduce((t,e)=>{const n=_.forwardRef((r,s)=>{const{asChild:i,...a}=r,o=i?Aa:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(o,{...a,ref:s})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function Jb(t,e){t&&Ms.flushSync(()=>t.dispatchEvent(e))}var $n=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{};function lfe(t,e){return _.useReducer((n,r)=>e[n][r]??n,t)}var Wn=t=>{const{present:e,children:n}=t,r=cfe(e),s=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),i=tt(r.ref,ufe(s));return typeof n=="function"||r.isPresent?_.cloneElement(s,{ref:i}):null};Wn.displayName="Presence";function cfe(t){const[e,n]=_.useState(),r=_.useRef({}),s=_.useRef(t),i=_.useRef("none"),a=t?"mounted":"unmounted",[o,c]=lfe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const u=rS(r.current);i.current=o==="mounted"?u:"none"},[o]),$n(()=>{const u=r.current,f=s.current;if(f!==t){const d=i.current,m=rS(u);t?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&d!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,c]),$n(()=>{if(e){const u=l=>{const m=rS(r.current).includes(l.animationName);l.target===e&&m&&Ms.flushSync(()=>c("ANIMATION_END"))},f=l=>{l.target===e&&(i.current=rS(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",u),e.addEventListener("animationend",u),()=>{e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",u),e.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:_.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function rS(t){return(t==null?void 0:t.animationName)||"none"}function ufe(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 dfe=r_.useId||(()=>{}),ffe=0;function qr(t){const[e,n]=_.useState(dfe());return $n(()=>{n(r=>r??String(ffe++))},[t]),e?`radix-${e}`:""}var pL="Collapsible",[hfe,QV]=Nn(pL),[pfe,mL]=hfe(pL),ZV=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:a,...o}=t,[c=!1,u]=lr({prop:r,defaultProp:s,onChange:a});return P.jsx(pfe,{scope:n,disabled:i,contentId:qr(),open:c,onOpenToggle:_.useCallback(()=>u(f=>!f),[u]),children:P.jsx(Ne.div,{"data-state":vL(c),"data-disabled":i?"":void 0,...o,ref:e})})});ZV.displayName=pL;var JV="CollapsibleTrigger",e6=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,s=mL(JV,n);return P.jsx(Ne.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":vL(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:e,onClick:me(t.onClick,s.onOpenToggle)})});e6.displayName=JV;var gL="CollapsibleContent",t6=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=mL(gL,t.__scopeCollapsible);return P.jsx(Wn,{present:n||s.open,children:({present:i})=>P.jsx(mfe,{...r,ref:e,present:i})})});t6.displayName=gL;var mfe=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=t,a=mL(gL,n),[o,c]=_.useState(r),u=_.useRef(null),f=tt(e,u),l=_.useRef(0),d=l.current,m=_.useRef(0),p=m.current,h=a.open||o,y=_.useRef(h),g=_.useRef();return _.useEffect(()=>{const v=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(v)},[]),$n(()=>{const v=u.current;if(v){g.current=g.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const w=v.getBoundingClientRect();l.current=w.height,m.current=w.width,y.current||(v.style.transitionDuration=g.current.transitionDuration,v.style.animationName=g.current.animationName),c(r)}},[a.open,r]),P.jsx(Ne.div,{"data-state":vL(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!h,...i,ref:f,style:{"--radix-collapsible-content-height":d?`${d}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...t.style},children:h&&s})});function vL(t){return t?"open":"closed"}var gfe=ZV,vfe=e6,yfe=t6,bfe=_.createContext(void 0);function Da(t){const e=_.useContext(bfe);return t||e||"ltr"}var Zc="Accordion",wfe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[yL,_fe,xfe]=Qc(Zc),[H1,J4e]=Nn(Zc,[xfe,QV]),bL=QV(),Sfe=se.forwardRef((t,e)=>{const{type:n,...r}=t,s=r,i=r;return P.jsx(yL.Provider,{scope:t.__scopeAccordion,children:n==="multiple"?P.jsx(Rfe,{...i,ref:e}):P.jsx(Afe,{...s,ref:e})})});Sfe.displayName=Zc;var[n6,Efe]=H1(Zc),[r6,Cfe]=H1(Zc,{collapsible:!1}),Afe=se.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:i=!1,...a}=t,[o,c]=lr({prop:n,defaultProp:r,onChange:s});return P.jsx(n6,{scope:t.__scopeAccordion,value:o?[o]:[],onItemOpen:c,onItemClose:se.useCallback(()=>i&&c(""),[i,c]),children:P.jsx(r6,{scope:t.__scopeAccordion,collapsible:i,children:P.jsx(s6,{...a,ref:e})})})}),Rfe=se.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=t,[a=[],o]=lr({prop:n,defaultProp:r,onChange:s}),c=se.useCallback(f=>o((l=[])=>[...l,f]),[o]),u=se.useCallback(f=>o((l=[])=>l.filter(d=>d!==f)),[o]);return P.jsx(n6,{scope:t.__scopeAccordion,value:a,onItemOpen:c,onItemClose:u,children:P.jsx(r6,{scope:t.__scopeAccordion,collapsible:!0,children:P.jsx(s6,{...i,ref:e})})})}),[Pfe,V1]=H1(Zc),s6=se.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:i="vertical",...a}=t,o=se.useRef(null),c=tt(o,e),u=_fe(n),l=Da(s)==="ltr",d=me(t.onKeyDown,m=>{var E;if(!wfe.includes(m.key))return;const p=m.target,h=u().filter(k=>{var N;return!((N=k.ref.current)!=null&&N.disabled)}),y=h.findIndex(k=>k.ref.current===p),g=h.length;if(y===-1)return;m.preventDefault();let v=y;const w=0,x=g-1,A=()=>{v=y+1,v>x&&(v=w)},T=()=>{v=y-1,v{const{__scopeAccordion:n,value:r,...s}=t,i=V1(oC,n),a=Efe(oC,n),o=bL(n),c=qr(),u=r&&a.value.includes(r)||!1,f=i.disabled||t.disabled;return P.jsx(Tfe,{scope:n,open:u,disabled:f,triggerId:c,children:P.jsx(gfe,{"data-orientation":i.orientation,"data-state":d6(u),...o,...s,ref:e,disabled:f,open:u,onOpenChange:l=>{l?a.onItemOpen(r):a.onItemClose(r)}})})});i6.displayName=oC;var o6="AccordionHeader",a6=se.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=V1(Zc,n),i=wL(o6,n);return P.jsx(Ne.h3,{"data-orientation":s.orientation,"data-state":d6(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:e})});a6.displayName=o6;var BN="AccordionTrigger",l6=se.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=V1(Zc,n),i=wL(BN,n),a=Cfe(BN,n),o=bL(n);return P.jsx(yL.ItemSlot,{scope:n,children:P.jsx(vfe,{"aria-disabled":i.open&&!a.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...o,...r,ref:e})})});l6.displayName=BN;var c6="AccordionContent",u6=se.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=V1(Zc,n),i=wL(c6,n),a=bL(n);return P.jsx(yfe,{role:"region","aria-labelledby":i.triggerId,"data-orientation":s.orientation,...a,...r,ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}})});u6.displayName=c6;function d6(t){return t?"open":"closed"}var kfe=i6,Nfe=a6,f6=l6,h6=u6;/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. @@ -192,13 +192,13 @@ Error generating stack: `+i.message+` 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 _.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},Lpe="DialogDescriptionWarning",Ipe=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${K6(Lpe).contentName}}.`;return _.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},OL=M6,ML=I6,LL=F6,p_=j6,m_=B6,g_=U6,v_=V6,y_=G6,Y6="AlertDialog",[$pe,tUe]=Nn(Y6,[O6]),eu=O6(),X6=t=>{const{__scopeAlertDialog:e,...n}=t,r=eu(e);return P.jsx(OL,{...r,...n,modal:!0})};X6.displayName=Y6;var Fpe="AlertDialogTrigger",Q6=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=eu(n);return P.jsx(ML,{...s,...r,ref:e})});Q6.displayName=Fpe;var jpe="AlertDialogPortal",Z6=t=>{const{__scopeAlertDialog:e,...n}=t,r=eu(e);return P.jsx(LL,{...r,...n})};Z6.displayName=jpe;var Bpe="AlertDialogOverlay",J6=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=eu(n);return P.jsx(p_,{...s,...r,ref:e})});J6.displayName=Bpe;var Hm="AlertDialogContent",[zpe,Upe]=$pe(Hm),eW=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...s}=t,i=eu(n),a=_.useRef(null),o=tt(e,a),c=_.useRef(null);return P.jsx(Ope,{contentName:Hm,titleName:tW,docsSlug:"alert-dialog",children:P.jsx(zpe,{scope:n,cancelRef:c,children:P.jsxs(m_,{role:"alertdialog",...i,...s,ref:o,onOpenAutoFocus:me(s.onOpenAutoFocus,u=>{var f;u.preventDefault(),(f=c.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[P.jsx(hL,{children:r}),P.jsx(Vpe,{contentRef:a})]})})})});eW.displayName=Hm;var tW="AlertDialogTitle",nW=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=eu(n);return P.jsx(g_,{...s,...r,ref:e})});nW.displayName=tW;var rW="AlertDialogDescription",sW=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=eu(n);return P.jsx(v_,{...s,...r,ref:e})});sW.displayName=rW;var Hpe="AlertDialogAction",iW=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=eu(n);return P.jsx(y_,{...s,...r,ref:e})});iW.displayName=Hpe;var oW="AlertDialogCancel",aW=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:s}=Upe(oW,n),i=eu(n),a=tt(e,s);return P.jsx(y_,{...i,...r,ref:a})});aW.displayName=oW;var Vpe=({contentRef:t})=>{const e=`\`${Hm}\` requires a description for the component to be accessible for screen reader users. +For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return _.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},Lpe="DialogDescriptionWarning",Ipe=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${K6(Lpe).contentName}}.`;return _.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},OL=M6,ML=I6,LL=F6,p_=j6,m_=B6,g_=U6,v_=V6,y_=G6,Y6="AlertDialog",[$pe,eUe]=Nn(Y6,[O6]),eu=O6(),X6=t=>{const{__scopeAlertDialog:e,...n}=t,r=eu(e);return P.jsx(OL,{...r,...n,modal:!0})};X6.displayName=Y6;var Fpe="AlertDialogTrigger",Q6=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=eu(n);return P.jsx(ML,{...s,...r,ref:e})});Q6.displayName=Fpe;var jpe="AlertDialogPortal",Z6=t=>{const{__scopeAlertDialog:e,...n}=t,r=eu(e);return P.jsx(LL,{...r,...n})};Z6.displayName=jpe;var Bpe="AlertDialogOverlay",J6=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=eu(n);return P.jsx(p_,{...s,...r,ref:e})});J6.displayName=Bpe;var Hm="AlertDialogContent",[zpe,Upe]=$pe(Hm),eW=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...s}=t,i=eu(n),a=_.useRef(null),o=tt(e,a),c=_.useRef(null);return P.jsx(Ope,{contentName:Hm,titleName:tW,docsSlug:"alert-dialog",children:P.jsx(zpe,{scope:n,cancelRef:c,children:P.jsxs(m_,{role:"alertdialog",...i,...s,ref:o,onOpenAutoFocus:me(s.onOpenAutoFocus,u=>{var f;u.preventDefault(),(f=c.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[P.jsx(hL,{children:r}),P.jsx(Vpe,{contentRef:a})]})})})});eW.displayName=Hm;var tW="AlertDialogTitle",nW=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=eu(n);return P.jsx(g_,{...s,...r,ref:e})});nW.displayName=tW;var rW="AlertDialogDescription",sW=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=eu(n);return P.jsx(v_,{...s,...r,ref:e})});sW.displayName=rW;var Hpe="AlertDialogAction",iW=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=eu(n);return P.jsx(y_,{...s,...r,ref:e})});iW.displayName=Hpe;var oW="AlertDialogCancel",aW=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:s}=Upe(oW,n),i=eu(n),a=tt(e,s);return P.jsx(y_,{...i,...r,ref:a})});aW.displayName=oW;var Vpe=({contentRef:t})=>{const e=`\`${Hm}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${Hm}\` by passing a \`${rW}\` 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 \`${Hm}\`. 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 _.useEffect(()=>{var r;document.getElementById((r=t.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},Wpe=X6,Gpe=Q6,qpe=Z6,lW=J6,cW=eW,uW=iW,dW=aW,fW=nW,hW=sW;const e0=ri("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"}}),ao=_.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...s},i)=>{const a=r?Aa:"button";return P.jsx(a,{className:le(e0({variant:e,size:n,className:t})),ref:i,...s})});ao.displayName="Button";const pW=Wpe,nUe=Gpe,Kpe=qpe,mW=_.forwardRef(({className:t,...e},n)=>P.jsx(lW,{className:le("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}));mW.displayName=lW.displayName;const IL=_.forwardRef(({className:t,...e},n)=>P.jsxs(Kpe,{children:[P.jsx(mW,{}),P.jsx(cW,{ref:n,className:le("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})]}));IL.displayName=cW.displayName;const $L=({className:t,...e})=>P.jsx("div",{className:le("flex flex-col space-y-2 text-center sm:text-left",t),...e});$L.displayName="AlertDialogHeader";const FL=({className:t,...e})=>P.jsx("div",{className:le("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});FL.displayName="AlertDialogFooter";const jL=_.forwardRef(({className:t,...e},n)=>P.jsx(fW,{ref:n,className:le("text-lg font-semibold",t),...e}));jL.displayName=fW.displayName;const BL=_.forwardRef(({className:t,...e},n)=>P.jsx(hW,{ref:n,className:le("text-sm text-muted-foreground",t),...e}));BL.displayName=hW.displayName;const zL=_.forwardRef(({className:t,...e},n)=>P.jsx(uW,{ref:n,className:le(e0(),t),...e}));zL.displayName=uW.displayName;const UL=_.forwardRef(({className:t,...e},n)=>P.jsx(dW,{ref:n,className:le(e0({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));UL.displayName=dW.displayName;const Ype=({textAreaRef:t,triggerAutoSize:e,maxHeight:n=Number.MAX_SAFE_INTEGER,minHeight:r=0})=>{const[s,i]=_.useState(!0);_.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 o=t.scrollHeight;o>n?t.style.height=`${n}px`:t.style.height=`${o+2}px`}},[t,e,s,n,r])},gW=_.forwardRef(({maxHeight:t=Number.MAX_SAFE_INTEGER,minHeight:e=52,className:n,onChange:r,value:s,...i},a)=>{const o=_.useRef(null),[c,u]=_.useState("");return Ype({textAreaRef:o.current,triggerAutoSize:c,maxHeight:t,minHeight:e}),_.useImperativeHandle(a,()=>({textArea:o.current,focus:()=>{var f;return(f=o.current)==null?void 0:f.focus()},maxHeight:t,minHeight:e})),_.useEffect(()=>{(s||i!=null&&i.defaultValue)&&u(s)},[s||(i==null?void 0:i.defaultValue)]),P.jsx("textarea",{...i,value:s,ref:o,className:le("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=>{u(f.target.value),r==null||r(f)}})});gW.displayName="AutosizeTextarea";var HL="Avatar",[Xpe,rUe]=Nn(HL),[Qpe,vW]=Xpe(HL),yW=_.forwardRef((t,e)=>{const{__scopeAvatar:n,...r}=t,[s,i]=_.useState("idle");return P.jsx(Qpe,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:i,children:P.jsx(Ne.span,{...r,ref:e})})});yW.displayName=HL;var bW="AvatarImage",wW=_.forwardRef((t,e)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s=()=>{},...i}=t,a=vW(bW,n),o=Zpe(r),c=zt(u=>{s(u),a.onImageLoadingStatusChange(u)});return $n(()=>{o!=="idle"&&c(o)},[o,c]),o==="loaded"?P.jsx(Ne.img,{...i,ref:e,src:r}):null});wW.displayName=bW;var _W="AvatarFallback",xW=_.forwardRef((t,e)=>{const{__scopeAvatar:n,delayMs:r,...s}=t,i=vW(_W,n),[a,o]=_.useState(r===void 0);return _.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>o(!0),r);return()=>window.clearTimeout(c)}},[r]),a&&i.imageLoadingStatus!=="loaded"?P.jsx(Ne.span,{...s,ref:e}):null});xW.displayName=_W;function Zpe(t){const[e,n]=_.useState("idle");return $n(()=>{if(!t){n("error");return}let r=!0;const s=new window.Image,i=a=>()=>{r&&n(a)};return n("loading"),s.onload=i("loaded"),s.onerror=i("error"),s.src=t,()=>{r=!1}},[t]),e}var SW=yW,EW=wW,CW=xW;const Jpe=_.forwardRef(({className:t,...e},n)=>P.jsx(SW,{ref:n,className:le("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...e}));Jpe.displayName=SW.displayName;const eme=_.forwardRef(({className:t,...e},n)=>P.jsx(EW,{ref:n,className:le("aspect-square h-full w-full",t),...e}));eme.displayName=EW.displayName;const tme=_.forwardRef(({className:t,...e},n)=>P.jsx(CW,{ref:n,className:le("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...e}));tme.displayName=CW.displayName;const nme=ri("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 rme({className:t,variant:e,...n}){return P.jsx("div",{className:le(nme({variant:e}),t),...n})}const sme=_.forwardRef(({...t},e)=>P.jsx("nav",{ref:e,"aria-label":"breadcrumb",...t}));sme.displayName="Breadcrumb";const ime=_.forwardRef(({className:t,...e},n)=>P.jsx("ol",{ref:n,className:le("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",t),...e}));ime.displayName="BreadcrumbList";const ome=_.forwardRef(({className:t,...e},n)=>P.jsx("li",{ref:n,className:le("inline-flex items-center gap-1.5",t),...e}));ome.displayName="BreadcrumbItem";const ame=_.forwardRef(({asChild:t,className:e,...n},r)=>{const s=t?Aa:"a";return P.jsx(s,{ref:r,className:le("transition-colors hover:text-foreground",e),...n})});ame.displayName="BreadcrumbLink";const lme=_.forwardRef(({className:t,...e},n)=>P.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:le("font-normal text-foreground",t),...e}));lme.displayName="BreadcrumbPage";function Kt(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 fo(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function Ks(t,e){const n=Kt(t);return isNaN(e)?fo(t,NaN):(e&&n.setDate(n.getDate()+e),n)}function Ra(t,e){const n=Kt(t);if(isNaN(e))return fo(t,NaN);if(!e)return n;const r=n.getDate(),s=fo(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 VL=6048e5,cme=864e5;let ume={};function b_(){return ume}function xl(t,e){var o,c,u,f;const n=b_(),r=(e==null?void 0:e.weekStartsOn)??((c=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((f=(u=n.locale)==null?void 0:u.options)==null?void 0:f.weekStartsOn)??0,s=Kt(t),i=s.getDay(),a=(i=s.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function hv(t){const e=Kt(t);return e.setHours(0,0,0,0),e}function lC(t){const e=Kt(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 hl(t,e){const n=hv(t),r=hv(e),s=+n-lC(n),i=+r-lC(r);return Math.round((s-i)/cme)}function dme(t){const e=AW(t),n=fo(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),Wh(n)}function VN(t,e){const n=e*7;return Ks(t,n)}function fme(t,e){return Ra(t,e*12)}function hme(t){let e;return t.forEach(function(n){const r=Kt(n);(e===void 0||e{const r=Kt(n);(!e||e>r||isNaN(+r))&&(e=r)}),e||new Date(NaN)}function _i(t,e){const n=hv(t),r=hv(e);return+n==+r}function WL(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function mme(t){if(!WL(t)&&typeof t!="number")return!1;const e=Kt(t);return!isNaN(Number(e))}function t0(t,e){const n=Kt(t),r=Kt(e),s=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return s*12+i}function gme(t,e,n){const r=xl(t,n),s=xl(e,n),i=+r-lC(r),a=+s-lC(s);return Math.round((i-a)/VL)}function GL(t){const e=Kt(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function Pi(t){const e=Kt(t);return e.setDate(1),e.setHours(0,0,0,0),e}function RW(t){const e=Kt(t),n=fo(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}function qL(t,e){var o,c,u,f;const n=b_(),r=(e==null?void 0:e.weekStartsOn)??((c=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((f=(u=n.locale)==null?void 0:u.options)==null?void 0:f.weekStartsOn)??0,s=Kt(t),i=s.getDay(),a=(i{let r;const s=vme[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 dT(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const bme={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},wme={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},_me={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},xme={date:dT({formats:bme,defaultWidth:"full"}),time:dT({formats:wme,defaultWidth:"full"}),dateTime:dT({formats:_me,defaultWidth:"full"})},Sme={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Eme=(t,e,n,r)=>Sme[t];function Ey(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,o=n!=null&&n.width?String(n.width):a;s=t.formattingValues[o]||t.formattingValues[a]}else{const a=t.defaultWidth,o=n!=null&&n.width?String(n.width):t.defaultWidth;s=t.values[o]||t.values[a]}const i=t.argumentCallback?t.argumentCallback(e):e;return s[i]}}const Cme={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ame={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Rme={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"]},Pme={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"]},Tme={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"}},kme={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"}},Nme=(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"},Dme={ordinalNumber:Nme,era:Ey({values:Cme,defaultWidth:"wide"}),quarter:Ey({values:Ame,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Ey({values:Rme,defaultWidth:"wide"}),day:Ey({values:Pme,defaultWidth:"wide"}),dayPeriod:Ey({values:Tme,defaultWidth:"wide",formattingValues:kme,defaultFormattingWidth:"wide"})};function Cy(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 a=i[0],o=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(o)?Mme(o,l=>l.test(a)):Ome(o,l=>l.test(a));let u;u=t.valueCallback?t.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const f=e.slice(a.length);return{value:u,rest:f}}}function Ome(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Mme(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 a=t.valueCallback?t.valueCallback(i[0]):i[0];a=n.valueCallback?n.valueCallback(a):a;const o=e.slice(s.length);return{value:a,rest:o}}}const Ime=/^(\d+)(th|st|nd|rd)?/i,$me=/\d+/i,Fme={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},jme={any:[/^b/i,/^(a|c)/i]},Bme={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},zme={any:[/1/i,/2/i,/3/i,/4/i]},Ume={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},Hme={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]},Vme={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},Wme={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]},Gme={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},qme={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}},Kme={ordinalNumber:Lme({matchPattern:Ime,parsePattern:$me,valueCallback:t=>parseInt(t,10)}),era:Cy({matchPatterns:Fme,defaultMatchWidth:"wide",parsePatterns:jme,defaultParseWidth:"any"}),quarter:Cy({matchPatterns:Bme,defaultMatchWidth:"wide",parsePatterns:zme,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Cy({matchPatterns:Ume,defaultMatchWidth:"wide",parsePatterns:Hme,defaultParseWidth:"any"}),day:Cy({matchPatterns:Vme,defaultMatchWidth:"wide",parsePatterns:Wme,defaultParseWidth:"any"}),dayPeriod:Cy({matchPatterns:Gme,defaultMatchWidth:"any",parsePatterns:qme,defaultParseWidth:"any"})},TW={code:"en-US",formatDistance:yme,formatLong:xme,formatRelative:Eme,localize:Dme,match:Kme,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Yme(t){const e=Kt(t);return hl(e,RW(e))+1}function kW(t){const e=Kt(t),n=+Wh(e)-+dme(e);return Math.round(n/VL)+1}function NW(t,e){var f,l,d,m;const n=Kt(t),r=n.getFullYear(),s=b_(),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??((m=(d=s.locale)==null?void 0:d.options)==null?void 0:m.firstWeekContainsDate)??1,a=fo(t,0);a.setFullYear(r+1,0,i),a.setHours(0,0,0,0);const o=xl(a,e),c=fo(t,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const u=xl(c,e);return n.getTime()>=o.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function Xme(t,e){var o,c,u,f;const n=b_(),r=(e==null?void 0:e.firstWeekContainsDate)??((c=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(u=n.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,s=NW(t,e),i=fo(t,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),xl(i,e)}function DW(t,e){const n=Kt(t),r=+xl(n,e)-+Xme(n,e);return Math.round(r/VL)+1}function fn(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const vu={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return fn(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):fn(n+1,2)},d(t,e){return fn(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 fn(t.getHours()%12||12,e.length)},H(t,e){return fn(t.getHours(),e.length)},m(t,e){return fn(t.getMinutes(),e.length)},s(t,e){return fn(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return fn(s,e.length)}},Vp={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},pB={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 vu.y(t,e)},Y:function(t,e,n,r){const s=NW(t,r),i=s>0?s:1-s;if(e==="YY"){const a=i%100;return fn(a,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):fn(i,e.length)},R:function(t,e){const n=AW(t);return fn(n,e.length)},u:function(t,e){const n=t.getFullYear();return fn(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 fn(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 fn(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 vu.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 fn(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=DW(t,r);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):fn(s,e.length)},I:function(t,e,n){const r=kW(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):fn(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):vu.d(t,e)},D:function(t,e,n){const r=Yme(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):fn(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 fn(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 fn(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 fn(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=Vp.noon:r===0?s=Vp.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=Vp.evening:r>=12?s=Vp.afternoon:r>=4?s=Vp.morning:s=Vp.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 vu.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):vu.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):fn(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):fn(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):vu.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):vu.s(t,e)},S:function(t,e){return vu.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return gB(r);case"XXXX":case"XX":return ff(r);case"XXXXX":case"XXX":default:return ff(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return gB(r);case"xxxx":case"xx":return ff(r);case"xxxxx":case"xxx":default:return ff(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+mB(r,":");case"OOOO":default:return"GMT"+ff(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+mB(r,":");case"zzzz":default:return"GMT"+ff(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return fn(r,e.length)},T:function(t,e,n){const r=t.getTime();return fn(r,e.length)}};function mB(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+fn(i,2)}function gB(t,e){return t%60===0?(t>0?"-":"+")+fn(Math.abs(t)/60,2):ff(t,e)}function ff(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=fn(Math.trunc(r/60),2),i=fn(r%60,2);return n+s+e+i}const vB=(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"})}},OW=(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"})}},Qme=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return vB(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}}",vB(r,e)).replace("{{time}}",OW(s,e))},Zme={p:OW,P:Qme},Jme=/^D+$/,ege=/^Y+$/,tge=["D","DD","YY","YYYY"];function nge(t){return Jme.test(t)}function rge(t){return ege.test(t)}function sge(t,e,n){const r=ige(t,e,n);if(console.warn(r),tge.includes(t))throw new RangeError(r)}function ige(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 oge=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,age=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,lge=/^'([^]*?)'?$/,cge=/''/g,uge=/[a-zA-Z]/;function hp(t,e,n){var f,l,d,m,p,h,y,g;const r=b_(),s=(n==null?void 0:n.locale)??r.locale??TW,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??((m=(d=r.locale)==null?void 0:d.options)==null?void 0:m.firstWeekContainsDate)??1,a=(n==null?void 0:n.weekStartsOn)??((h=(p=n==null?void 0:n.locale)==null?void 0:p.options)==null?void 0:h.weekStartsOn)??r.weekStartsOn??((g=(y=r.locale)==null?void 0:y.options)==null?void 0:g.weekStartsOn)??0,o=Kt(t);if(!mme(o))throw new RangeError("Invalid time value");let c=e.match(age).map(v=>{const w=v[0];if(w==="p"||w==="P"){const x=Zme[w];return x(v,s.formatLong)}return v}).join("").match(oge).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const w=v[0];if(w==="'")return{isToken:!1,value:dge(v)};if(pB[w])return{isToken:!0,value:v};if(w.match(uge))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:v}});s.localize.preprocessor&&(c=s.localize.preprocessor(o,c));const u={firstWeekContainsDate:i,weekStartsOn:a,locale:s};return c.map(v=>{if(!v.isToken)return v.value;const w=v.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&rge(w)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&nge(w))&&sge(w,e,String(t));const x=pB[w[0]];return x(o,w,s.localize,u)}).join("")}function dge(t){const e=t.match(lge);return e?e[1].replace(cge,"'"):t}function fge(t){const e=Kt(t),n=e.getFullYear(),r=e.getMonth(),s=fo(t,0);return s.setFullYear(n,r+1,0),s.setHours(0,0,0,0),s.getDate()}function hge(t){return Math.trunc(+Kt(t)/1e3)}function pge(t){const e=Kt(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(0,0,0,0),e}function mge(t,e){return gme(pge(t),Pi(t),e)+1}function WN(t,e){const n=Kt(t),r=Kt(e);return n.getTime()>r.getTime()}function MW(t,e){const n=Kt(t),r=Kt(e);return+n<+r}function KL(t,e){const n=Kt(t),r=Kt(e);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function gge(t,e){const n=Kt(t),r=Kt(e);return n.getFullYear()===r.getFullYear()}function fT(t,e){return Ks(t,-e)}function hT(t,e){const n=Kt(t),r=n.getFullYear(),s=n.getDate(),i=fo(t,0);i.setFullYear(r,e,15),i.setHours(0,0,0,0);const a=fge(i);return n.setMonth(e,Math.min(s,a)),n}function yB(t,e){const n=Kt(t);return isNaN(+n)?fo(t,NaN):(n.setFullYear(e),n)}var dt=function(){return dt=Object.assign||function(e){for(var n,r=1,s=arguments.length;r1&&(c||!u),l=e>1&&(u||!c),d=function(){r&&i(r)},m=function(){s&&i(s)};return P.jsx(Yge,{displayMonth:t.displayMonth,hideNext:f,hidePrevious:l,nextMonth:s,previousMonth:r,onPreviousClick:d,onNextClick:m})}function Xge(t){var e,n=Fn(),r=n.classNames,s=n.disableNavigation,i=n.styles,a=n.captionLayout,o=n.components,c=(e=o==null?void 0:o.CaptionLabel)!==null&&e!==void 0?e:$W,u;return s?u=P.jsx(c,{id:t.id,displayMonth:t.displayMonth}):a==="dropdown"?u=P.jsx(bB,{displayMonth:t.displayMonth,id:t.id}):a==="dropdown-buttons"?u=P.jsxs(P.Fragment,{children:[P.jsx(bB,{displayMonth:t.displayMonth,displayIndex:t.displayIndex,id:t.id}),P.jsx(wB,{displayMonth:t.displayMonth,displayIndex:t.displayIndex,id:t.id})]}):u=P.jsxs(P.Fragment,{children:[P.jsx(c,{id:t.id,displayMonth:t.displayMonth,displayIndex:t.displayIndex}),P.jsx(wB,{displayMonth:t.displayMonth,id:t.id})]}),P.jsx("div",{className:r.caption,style:i.caption,children:u})}function Qge(t){var e=Fn(),n=e.footer,r=e.styles,s=e.classNames.tfoot;return n?P.jsx("tfoot",{className:s,style:r.tfoot,children:P.jsx("tr",{children:P.jsx("td",{colSpan:8,children:n})})}):P.jsx(P.Fragment,{})}function Zge(t,e,n){for(var r=n?Wh(new Date):xl(new Date,{locale:t,weekStartsOn:e}),s=[],i=0;i<7;i++){var a=Ks(r,i);s.push(a)}return s}function Jge(){var t=Fn(),e=t.classNames,n=t.styles,r=t.showWeekNumber,s=t.locale,i=t.weekStartsOn,a=t.ISOWeek,o=t.formatters.formatWeekdayName,c=t.labels.labelWeekday,u=Zge(s,i,a);return P.jsxs("tr",{style:n.head_row,className:e.head_row,children:[r&&P.jsx("td",{style:n.head_cell,className:e.head_cell}),u.map(function(f,l){return P.jsx("th",{scope:"col",className:e.head_cell,style:n.head_cell,"aria-label":c(f,{locale:s}),children:o(f,{locale:s})},l)})]})}function eve(){var t,e=Fn(),n=e.classNames,r=e.styles,s=e.components,i=(t=s==null?void 0:s.HeadRow)!==null&&t!==void 0?t:Jge;return P.jsx("thead",{style:r.head,className:n.head,children:P.jsx(i,{})})}function tve(t){var e=Fn(),n=e.locale,r=e.formatters.formatDay;return P.jsx(P.Fragment,{children:r(t.date,{locale:n})})}var YL=_.createContext(void 0);function nve(t){if(!w_(t.initialProps)){var e={selected:void 0,modifiers:{disabled:[]}};return P.jsx(YL.Provider,{value:e,children:t.children})}return P.jsx(rve,{initialProps:t.initialProps,children:t.children})}function rve(t){var e=t.initialProps,n=t.children,r=e.selected,s=e.min,i=e.max,a=function(u,f,l){var d,m;(d=e.onDayClick)===null||d===void 0||d.call(e,u,f,l);var p=!!(f.selected&&s&&(r==null?void 0:r.length)===s);if(!p){var h=!!(!f.selected&&i&&(r==null?void 0:r.length)===i);if(!h){var y=r?LW([],r):[];if(f.selected){var g=y.findIndex(function(v){return _i(u,v)});y.splice(g,1)}else y.push(u);(m=e.onSelect)===null||m===void 0||m.call(e,y,u,f,l)}}},o={disabled:[]};r&&o.disabled.push(function(u){var f=i&&r.length>i-1,l=r.some(function(d){return _i(d,u)});return!!(f&&!l)});var c={selected:r,onDayClick:a,modifiers:o};return P.jsx(YL.Provider,{value:c,children:n})}function XL(){var t=_.useContext(YL);if(!t)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return t}function sve(t,e){var n=e||{},r=n.from,s=n.to;return r&&s?_i(s,t)&&_i(r,t)?void 0:_i(s,t)?{from:s,to:void 0}:_i(r,t)?void 0:WN(r,t)?{from:t,to:s}:{from:r,to:t}:s?WN(t,s)?{from:s,to:t}:{from:t,to:s}:r?MW(t,r)?{from:t,to:r}:{from:r,to:t}:{from:t,to:void 0}}var QL=_.createContext(void 0);function ive(t){if(!__(t.initialProps)){var e={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return P.jsx(QL.Provider,{value:e,children:t.children})}return P.jsx(ove,{initialProps:t.initialProps,children:t.children})}function ove(t){var e=t.initialProps,n=t.children,r=e.selected,s=r||{},i=s.from,a=s.to,o=e.min,c=e.max,u=function(m,p,h){var y,g;(y=e.onDayClick)===null||y===void 0||y.call(e,m,p,h);var v=sve(m,r);(g=e.onSelect)===null||g===void 0||g.call(e,v,m,p,h)},f={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(f.range_start=[i],a?(f.range_end=[a],_i(i,a)||(f.range_middle=[{after:i,before:a}])):f.range_end=[i]):a&&(f.range_start=[a],f.range_end=[a]),o&&(i&&!a&&f.disabled.push({after:fT(i,o-1),before:Ks(i,o-1)}),i&&a&&f.disabled.push({after:i,before:Ks(i,o-1)}),!i&&a&&f.disabled.push({after:fT(a,o-1),before:Ks(a,o-1)})),c){if(i&&!a&&(f.disabled.push({before:Ks(i,-c+1)}),f.disabled.push({after:Ks(i,c-1)})),i&&a){var l=hl(a,i)+1,d=c-l;f.disabled.push({before:fT(i,d)}),f.disabled.push({after:Ks(a,d)})}!i&&a&&(f.disabled.push({before:Ks(a,-c+1)}),f.disabled.push({after:Ks(a,c-1)}))}return P.jsx(QL.Provider,{value:{selected:r,onDayClick:u,modifiers:f},children:n})}function ZL(){var t=_.useContext(QL);if(!t)throw new Error("useSelectRange must be used within a SelectRangeProvider");return t}function KS(t){return Array.isArray(t)?LW([],t):t!==void 0?[t]:[]}function ave(t){var e={};return Object.entries(t).forEach(function(n){var r=n[0],s=n[1];e[r]=KS(s)}),e}var Pa;(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"})(Pa||(Pa={}));var lve=Pa.Selected,Vl=Pa.Disabled,cve=Pa.Hidden,uve=Pa.Today,pT=Pa.RangeEnd,mT=Pa.RangeMiddle,gT=Pa.RangeStart,dve=Pa.Outside;function fve(t,e,n){var r,s=(r={},r[lve]=KS(t.selected),r[Vl]=KS(t.disabled),r[cve]=KS(t.hidden),r[uve]=[t.today],r[pT]=[],r[mT]=[],r[gT]=[],r[dve]=[],r);return t.fromDate&&s[Vl].push({before:t.fromDate}),t.toDate&&s[Vl].push({after:t.toDate}),w_(t)?s[Vl]=s[Vl].concat(e.modifiers[Vl]):__(t)&&(s[Vl]=s[Vl].concat(n.modifiers[Vl]),s[gT]=n.modifiers[gT],s[mT]=n.modifiers[mT],s[pT]=n.modifiers[pT]),s}var BW=_.createContext(void 0);function hve(t){var e=Fn(),n=XL(),r=ZL(),s=fve(e,n,r),i=ave(e.modifiers),a=dt(dt({},s),i);return P.jsx(BW.Provider,{value:a,children:t.children})}function zW(){var t=_.useContext(BW);if(!t)throw new Error("useModifiers must be used within a ModifiersProvider");return t}function pve(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function mve(t){return!!(t&&typeof t=="object"&&"from"in t)}function gve(t){return!!(t&&typeof t=="object"&&"after"in t)}function vve(t){return!!(t&&typeof t=="object"&&"before"in t)}function yve(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function bve(t,e){var n,r=e.from,s=e.to;if(r&&s){var i=hl(s,r)<0;i&&(n=[s,r],r=n[0],s=n[1]);var a=hl(t,r)>=0&&hl(s,t)>=0;return a}return s?_i(s,t):r?_i(r,t):!1}function wve(t){return WL(t)}function _ve(t){return Array.isArray(t)&&t.every(WL)}function xve(t,e){return e.some(function(n){if(typeof n=="boolean")return n;if(wve(n))return _i(t,n);if(_ve(n))return n.includes(t);if(mve(n))return bve(t,n);if(yve(n))return n.dayOfWeek.includes(t.getDay());if(pve(n)){var r=hl(n.before,t),s=hl(n.after,t),i=r>0,a=s<0,o=WN(n.before,n.after);return o?a&&i:i||a}return gve(n)?hl(t,n.after)>0:vve(n)?hl(n.before,t)>0:typeof n=="function"?n(t):!1})}function JL(t,e,n){var r=Object.keys(e).reduce(function(i,a){var o=e[a];return xve(t,o)&&i.push(a),i},[]),s={};return r.forEach(function(i){return s[i]=!0}),n&&!KL(t,n)&&(s.outside=!0),s}function Sve(t,e){for(var n=Pi(t[0]),r=GL(t[t.length-1]),s,i,a=n;a<=r;){var o=JL(a,e),c=!o.disabled&&!o.hidden;if(!c){a=Ks(a,1);continue}if(o.selected)return a;o.today&&!i&&(i=a),s||(s=a),a=Ks(a,1)}return i||s}var Eve=365;function UW(t,e){var n=e.moveBy,r=e.direction,s=e.context,i=e.modifiers,a=e.retry,o=a===void 0?{count:0,lastFocused:t}:a,c=s.weekStartsOn,u=s.fromDate,f=s.toDate,l=s.locale,d={day:Ks,week:VN,month:Ra,year:fme,startOfWeek:function(y){return s.ISOWeek?Wh(y):xl(y,{locale:l,weekStartsOn:c})},endOfWeek:function(y){return s.ISOWeek?PW(y):qL(y,{locale:l,weekStartsOn:c})}},m=d[n](t,r==="after"?1:-1);r==="before"&&u?m=hme([u,m]):r==="after"&&f&&(m=pme([f,m]));var p=!0;if(i){var h=JL(m,i);p=!h.disabled&&!h.hidden}return p?m:o.count>Eve?o.lastFocused:UW(m,{moveBy:n,direction:r,context:s,modifiers:i,retry:dt(dt({},o),{count:o.count+1})})}var HW=_.createContext(void 0);function Cve(t){var e=x_(),n=zW(),r=_.useState(),s=r[0],i=r[1],a=_.useState(),o=a[0],c=a[1],u=Sve(e.displayMonths,n),f=s??(o&&e.isDateDisplayed(o))?o:u,l=function(){c(s),i(void 0)},d=function(y){i(y)},m=Fn(),p=function(y,g){if(s){var v=UW(s,{moveBy:y,direction:g,context:m,modifiers:n});_i(s,v)||(e.goToDate(v,s),d(v))}},h={focusedDay:s,focusTarget:f,blur:l,focus:d,focusDayAfter:function(){return p("day","after")},focusDayBefore:function(){return p("day","before")},focusWeekAfter:function(){return p("week","after")},focusWeekBefore:function(){return p("week","before")},focusMonthBefore:function(){return p("month","before")},focusMonthAfter:function(){return p("month","after")},focusYearBefore:function(){return p("year","before")},focusYearAfter:function(){return p("year","after")},focusStartOfWeek:function(){return p("startOfWeek","before")},focusEndOfWeek:function(){return p("endOfWeek","after")}};return P.jsx(HW.Provider,{value:h,children:t.children})}function eI(){var t=_.useContext(HW);if(!t)throw new Error("useFocusContext must be used within a FocusProvider");return t}function Ave(t,e){var n=zW(),r=JL(t,n,e);return r}var tI=_.createContext(void 0);function Rve(t){if(!Q1(t.initialProps)){var e={selected:void 0};return P.jsx(tI.Provider,{value:e,children:t.children})}return P.jsx(Pve,{initialProps:t.initialProps,children:t.children})}function Pve(t){var e=t.initialProps,n=t.children,r=function(i,a,o){var c,u,f;if((c=e.onDayClick)===null||c===void 0||c.call(e,i,a,o),a.selected&&!e.required){(u=e.onSelect)===null||u===void 0||u.call(e,void 0,i,a,o);return}(f=e.onSelect)===null||f===void 0||f.call(e,i,i,a,o)},s={selected:e.selected,onDayClick:r};return P.jsx(tI.Provider,{value:s,children:n})}function VW(){var t=_.useContext(tI);if(!t)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return t}function Tve(t,e){var n=Fn(),r=VW(),s=XL(),i=ZL(),a=eI(),o=a.focusDayAfter,c=a.focusDayBefore,u=a.focusWeekAfter,f=a.focusWeekBefore,l=a.blur,d=a.focus,m=a.focusMonthBefore,p=a.focusMonthAfter,h=a.focusYearBefore,y=a.focusYearAfter,g=a.focusStartOfWeek,v=a.focusEndOfWeek,w=function(V){var H,ee,re,X;Q1(n)?(H=r.onDayClick)===null||H===void 0||H.call(r,t,e,V):w_(n)?(ee=s.onDayClick)===null||ee===void 0||ee.call(s,t,e,V):__(n)?(re=i.onDayClick)===null||re===void 0||re.call(i,t,e,V):(X=n.onDayClick)===null||X===void 0||X.call(n,t,e,V)},x=function(V){var H;d(t),(H=n.onDayFocus)===null||H===void 0||H.call(n,t,e,V)},A=function(V){var H;l(),(H=n.onDayBlur)===null||H===void 0||H.call(n,t,e,V)},T=function(V){var H;(H=n.onDayMouseEnter)===null||H===void 0||H.call(n,t,e,V)},R=function(V){var H;(H=n.onDayMouseLeave)===null||H===void 0||H.call(n,t,e,V)},E=function(V){var H;(H=n.onDayPointerEnter)===null||H===void 0||H.call(n,t,e,V)},k=function(V){var H;(H=n.onDayPointerLeave)===null||H===void 0||H.call(n,t,e,V)},N=function(V){var H;(H=n.onDayTouchCancel)===null||H===void 0||H.call(n,t,e,V)},O=function(V){var H;(H=n.onDayTouchEnd)===null||H===void 0||H.call(n,t,e,V)},L=function(V){var H;(H=n.onDayTouchMove)===null||H===void 0||H.call(n,t,e,V)},I=function(V){var H;(H=n.onDayTouchStart)===null||H===void 0||H.call(n,t,e,V)},F=function(V){var H;(H=n.onDayKeyUp)===null||H===void 0||H.call(n,t,e,V)},U=function(V){var H;switch(V.key){case"ArrowLeft":V.preventDefault(),V.stopPropagation(),n.dir==="rtl"?o():c();break;case"ArrowRight":V.preventDefault(),V.stopPropagation(),n.dir==="rtl"?c():o();break;case"ArrowDown":V.preventDefault(),V.stopPropagation(),u();break;case"ArrowUp":V.preventDefault(),V.stopPropagation(),f();break;case"PageUp":V.preventDefault(),V.stopPropagation(),V.shiftKey?h():m();break;case"PageDown":V.preventDefault(),V.stopPropagation(),V.shiftKey?y():p();break;case"Home":V.preventDefault(),V.stopPropagation(),g();break;case"End":V.preventDefault(),V.stopPropagation(),v();break}(H=n.onDayKeyDown)===null||H===void 0||H.call(n,t,e,V)},Y={onClick:w,onFocus:x,onBlur:A,onKeyDown:U,onKeyUp:F,onMouseEnter:T,onMouseLeave:R,onPointerEnter:E,onPointerLeave:k,onTouchCancel:N,onTouchEnd:O,onTouchMove:L,onTouchStart:I};return Y}function kve(){var t=Fn(),e=VW(),n=XL(),r=ZL(),s=Q1(t)?e.selected:w_(t)?n.selected:__(t)?r.selected:void 0;return s}function Nve(t){return Object.values(Pa).includes(t)}function Dve(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(Nve(r)){var i=t.classNames["day_".concat(r)];i&&n.push(i)}}),n}function Ove(t,e){var n=dt({},t.styles.day);return Object.keys(e).forEach(function(r){var s;n=dt(dt({},n),(s=t.modifiersStyles)===null||s===void 0?void 0:s[r])}),n}function Mve(t,e,n){var r,s,i,a=Fn(),o=eI(),c=Ave(t,e),u=Tve(t,c),f=kve(),l=!!(a.onDayClick||a.mode!=="default");_.useEffect(function(){var T;c.outside||o.focusedDay&&l&&_i(o.focusedDay,t)&&((T=n.current)===null||T===void 0||T.focus())},[o.focusedDay,t,n,l,c.outside]);var d=Dve(a,c).join(" "),m=Ove(a,c),p=!!(c.outside&&!a.showOutsideDays||c.hidden),h=(i=(s=a.components)===null||s===void 0?void 0:s.DayContent)!==null&&i!==void 0?i:tve,y=P.jsx(h,{date:t,displayMonth:e,activeModifiers:c}),g={style:m,className:d,children:y,role:"gridcell"},v=o.focusTarget&&_i(o.focusTarget,t)&&!c.outside,w=o.focusedDay&&_i(o.focusedDay,t),x=dt(dt(dt({},g),(r={disabled:c.disabled,role:"gridcell"},r["aria-selected"]=c.selected,r.tabIndex=w||v?0:-1,r)),u),A={isButton:l,isHidden:p,activeModifiers:c,selectedDays:f,buttonProps:x,divProps:g};return A}function Lve(t){var e=_.useRef(null),n=Mve(t.date,t.displayMonth,e);return n.isHidden?P.jsx("div",{role:"gridcell"}):n.isButton?P.jsx(cC,dt({name:"day",ref:e},n.buttonProps)):P.jsx("div",dt({},n.divProps))}function Ive(t){var e=t.number,n=t.dates,r=Fn(),s=r.onWeekNumberClick,i=r.styles,a=r.classNames,o=r.locale,c=r.labels.labelWeekNumber,u=r.formatters.formatWeekNumber,f=u(Number(e),{locale:o});if(!s)return P.jsx("span",{className:a.weeknumber,style:i.weeknumber,children:f});var l=c(Number(e),{locale:o}),d=function(m){s(e,n,m)};return P.jsx(cC,{name:"week-number","aria-label":l,className:a.weeknumber,style:i.weeknumber,onClick:d,children:f})}function $ve(t){var e,n,r=Fn(),s=r.styles,i=r.classNames,a=r.showWeekNumber,o=r.components,c=(e=o==null?void 0:o.Day)!==null&&e!==void 0?e:Lve,u=(n=o==null?void 0:o.WeekNumber)!==null&&n!==void 0?n:Ive,f;return a&&(f=P.jsx("td",{className:i.cell,style:s.cell,children:P.jsx(u,{number:t.weekNumber,dates:t.dates})})),P.jsxs("tr",{className:i.row,style:s.row,children:[f,t.dates.map(function(l){return P.jsx("td",{className:i.cell,style:s.cell,role:"presentation",children:P.jsx(c,{displayMonth:t.displayMonth,date:l})},hge(l))})]})}function _B(t,e,n){for(var r=n!=null&&n.ISOWeek?PW(e):qL(e,n),s=n!=null&&n.ISOWeek?Wh(t):xl(t,n),i=hl(r,s),a=[],o=0;o<=i;o++)a.push(Ks(s,o));var c=a.reduce(function(u,f){var l=n!=null&&n.ISOWeek?kW(f):DW(f,n),d=u.find(function(m){return m.weekNumber===l});return d?(d.dates.push(f),u):(u.push({weekNumber:l,dates:[f]}),u)},[]);return c}function Fve(t,e){var n=_B(Pi(t),GL(t),e);if(e!=null&&e.useFixedWeeks){var r=mge(t,e);if(r<6){var s=n[n.length-1],i=s.dates[s.dates.length-1],a=VN(i,6-r),o=_B(VN(i,1),a,e);n.push.apply(n,o)}}return n}function jve(t){var e,n,r,s=Fn(),i=s.locale,a=s.classNames,o=s.styles,c=s.hideHead,u=s.fixedWeeks,f=s.components,l=s.weekStartsOn,d=s.firstWeekContainsDate,m=s.ISOWeek,p=Fve(t.displayMonth,{useFixedWeeks:!!u,ISOWeek:m,locale:i,weekStartsOn:l,firstWeekContainsDate:d}),h=(e=f==null?void 0:f.Head)!==null&&e!==void 0?e:eve,y=(n=f==null?void 0:f.Row)!==null&&n!==void 0?n:$ve,g=(r=f==null?void 0:f.Footer)!==null&&r!==void 0?r:Qge;return P.jsxs("table",{id:t.id,className:a.table,style:o.table,role:"grid","aria-labelledby":t["aria-labelledby"],children:[!c&&P.jsx(h,{}),P.jsx("tbody",{className:a.tbody,style:o.tbody,children:p.map(function(v){return P.jsx(y,{displayMonth:t.displayMonth,dates:v.dates,weekNumber:v.weekNumber},v.weekNumber)})}),P.jsx(g,{displayMonth:t.displayMonth})]})}function Bve(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var zve=Bve()?_.useLayoutEffect:_.useEffect,vT=!1,Uve=0;function xB(){return"react-day-picker-".concat(++Uve)}function Hve(t){var e,n=t??(vT?xB():null),r=_.useState(n),s=r[0],i=r[1];return zve(function(){s===null&&i(xB())},[]),_.useEffect(function(){vT===!1&&(vT=!0)},[]),(e=t??s)!==null&&e!==void 0?e:void 0}function Vve(t){var e,n,r=Fn(),s=r.dir,i=r.classNames,a=r.styles,o=r.components,c=x_().displayMonths,u=Hve(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],d=a.month,m=t.displayIndex===0,p=t.displayIndex===c.length-1,h=!m&&!p;s==="rtl"&&(e=[m,p],p=e[0],m=e[1]),m&&(l.push(i.caption_start),d=dt(dt({},d),a.caption_start)),p&&(l.push(i.caption_end),d=dt(dt({},d),a.caption_end)),h&&(l.push(i.caption_between),d=dt(dt({},d),a.caption_between));var y=(n=o==null?void 0:o.Caption)!==null&&n!==void 0?n:Xge;return P.jsxs("div",{className:l.join(" "),style:d,children:[P.jsx(y,{id:u,displayMonth:t.displayMonth,displayIndex:t.displayIndex}),P.jsx(jve,{id:f,"aria-labelledby":u,displayMonth:t.displayMonth})]},t.displayIndex)}function Wve(t){var e=Fn(),n=e.classNames,r=e.styles;return P.jsx("div",{className:n.months,style:r.months,children:t.children})}function Gve(t){var e,n,r=t.initialProps,s=Fn(),i=eI(),a=x_(),o=_.useState(!1),c=o[0],u=o[1];_.useEffect(function(){s.initialFocus&&i.focusTarget&&(c||(i.focus(i.focusTarget),u(!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=dt(dt({},s.styles.root),s.style),d=Object.keys(r).filter(function(p){return p.startsWith("data-")}).reduce(function(p,h){var y;return dt(dt({},p),(y={},y[h]=r[h],y))},{}),m=(n=(e=r.components)===null||e===void 0?void 0:e.Months)!==null&&n!==void 0?n:Wve;return P.jsx("div",dt({className:f.join(" "),style:l,dir:s.dir,id:s.id,nonce:r.nonce,title:r.title,lang:r.lang},d,{children:P.jsx(m,{children:a.displayMonths.map(function(p,h){return P.jsx(Vve,{displayIndex:h,displayMonth:p},h)})})}))}function qve(t){var e=t.children,n=vge(t,["children"]);return P.jsx(Ige,{initialProps:n,children:P.jsx(Gge,{children:P.jsx(Rve,{initialProps:n,children:P.jsx(nve,{initialProps:n,children:P.jsx(ive,{initialProps:n,children:P.jsx(hve,{children:P.jsx(Cve,{children:e})})})})})})})}function Kve(t){return P.jsx(qve,dt({},t,{children:P.jsx(Gve,{initialProps:t})}))}function WW({className:t,classNames:e,showOutsideDays:n=!0,...r}){return P.jsx(Kve,{showOutsideDays:n,className:le("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:le(e0({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:le(e0({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:()=>P.jsx(_L,{className:"w-4 h-4"}),IconRight:()=>P.jsx(d_,{className:"w-4 h-4"})},...r})}WW.displayName="Calendar";const GW=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:le("rounded-md border bg-card text-card-foreground shadow",t),...e}));GW.displayName="Card";const qW=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:le("flex flex-col space-y-1.5 p-6",t),...e}));qW.displayName="CardHeader";const KW=_.forwardRef(({className:t,...e},n)=>P.jsx("h3",{ref:n,className:le("font-semibold leading-none tracking-tight",t),...e}));KW.displayName="CardTitle";const YW=_.forwardRef(({className:t,...e},n)=>P.jsx("p",{ref:n,className:le("text-sm text-muted-foreground",t),...e}));YW.displayName="CardDescription";const XW=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:le("p-6 pt-0",t),...e}));XW.displayName="CardContent";const QW=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:le("flex items-center p-6 pt-0",t),...e}));QW.displayName="CardFooter";var Yve=Array.isArray,ZW=Yve,Xve=typeof _r=="object"&&_r&&_r.Object===Object&&_r,Qve=Xve,Zve=Qve,Jve=typeof self=="object"&&self&&self.Object===Object&&self,eye=Zve||Jve||Function("return this")(),Z1=eye,tye=Z1,nye=tye.Symbol,nI=nye,SB=nI,JW=Object.prototype,rye=JW.hasOwnProperty,sye=JW.toString,Ay=SB?SB.toStringTag:void 0;function iye(t){var e=rye.call(t,Ay),n=t[Ay];try{t[Ay]=void 0;var r=!0}catch{}var s=sye.call(t);return r&&(e?t[Ay]=n:delete t[Ay]),s}var oye=iye,aye=Object.prototype,lye=aye.toString;function cye(t){return lye.call(t)}var uye=cye,EB=nI,dye=oye,fye=uye,hye="[object Null]",pye="[object Undefined]",CB=EB?EB.toStringTag:void 0;function mye(t){return t==null?t===void 0?pye:hye:CB&&CB in Object(t)?dye(t):fye(t)}var rI=mye;function gye(t){return t!=null&&typeof t=="object"}var e8=gye,vye=rI,yye=e8,bye="[object Symbol]";function wye(t){return typeof t=="symbol"||yye(t)&&vye(t)==bye}var t8=wye;function _ye(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var kv=_ye;const sUe=Yc(kv);var xye=rI,Sye=kv,Eye="[object AsyncFunction]",Cye="[object Function]",Aye="[object GeneratorFunction]",Rye="[object Proxy]";function Pye(t){if(!Sye(t))return!1;var e=xye(t);return e==Cye||e==Aye||e==Eye||e==Rye}var Tye=Pye,kye=Z1,Nye=kye["__core-js_shared__"],Dye=Nye,yT=Dye,AB=function(){var t=/[^.]+$/.exec(yT&&yT.keys&&yT.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Oye(t){return!!AB&&AB in t}var Mye=Oye,Lye=Function.prototype,Iye=Lye.toString;function $ye(t){if(t!=null){try{return Iye.call(t)}catch{}try{return t+""}catch{}}return""}var Fye=$ye,jye=Tye,Bye=Mye,zye=kv,Uye=Fye,Hye=/[\\^$.*+?()[\]{}|]/g,Vye=/^\[object .+?Constructor\]$/,Wye=Function.prototype,Gye=Object.prototype,qye=Wye.toString,Kye=Gye.hasOwnProperty,Yye=RegExp("^"+qye.call(Kye).replace(Hye,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Xye(t){if(!zye(t)||Bye(t))return!1;var e=jye(t)?Yye:Vye;return e.test(Uye(t))}var Qye=Xye;function Zye(t,e){return t==null?void 0:t[e]}var Jye=Zye,ebe=Qye,tbe=Jye;function nbe(t,e){var n=tbe(t,e);return ebe(n)?n:void 0}var n8=nbe,rbe=n8,sbe=rbe(Object,"create"),J1=sbe,RB=J1;function ibe(){this.__data__=RB?RB(null):{},this.size=0}var obe=ibe;function abe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var lbe=abe,cbe=J1,ube="__lodash_hash_undefined__",dbe=Object.prototype,fbe=dbe.hasOwnProperty;function hbe(t){var e=this.__data__;if(cbe){var n=e[t];return n===ube?void 0:n}return fbe.call(e,t)?e[t]:void 0}var pbe=hbe,mbe=J1,gbe=Object.prototype,vbe=gbe.hasOwnProperty;function ybe(t){var e=this.__data__;return mbe?e[t]!==void 0:vbe.call(e,t)}var bbe=ybe,wbe=J1,_be="__lodash_hash_undefined__";function xbe(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=wbe&&e===void 0?_be:e,this}var Sbe=xbe,Ebe=obe,Cbe=lbe,Abe=pbe,Rbe=bbe,Pbe=Sbe;function Nv(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1}var Gbe=Wbe,qbe=eA;function Kbe(t,e){var n=this.__data__,r=qbe(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Ybe=Kbe,Xbe=Nbe,Qbe=Bbe,Zbe=Hbe,Jbe=Gbe,e0e=Ybe;function Dv(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e{var r;document.getElementById((r=t.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},Wpe=X6,Gpe=Q6,qpe=Z6,lW=J6,cW=eW,uW=iW,dW=aW,fW=nW,hW=sW;const e0=ri("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"}}),ao=_.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...s},i)=>{const a=r?Aa:"button";return P.jsx(a,{className:le(e0({variant:e,size:n,className:t})),ref:i,...s})});ao.displayName="Button";const pW=Wpe,tUe=Gpe,Kpe=qpe,mW=_.forwardRef(({className:t,...e},n)=>P.jsx(lW,{className:le("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}));mW.displayName=lW.displayName;const IL=_.forwardRef(({className:t,...e},n)=>P.jsxs(Kpe,{children:[P.jsx(mW,{}),P.jsx(cW,{ref:n,className:le("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})]}));IL.displayName=cW.displayName;const $L=({className:t,...e})=>P.jsx("div",{className:le("flex flex-col space-y-2 text-center sm:text-left",t),...e});$L.displayName="AlertDialogHeader";const FL=({className:t,...e})=>P.jsx("div",{className:le("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});FL.displayName="AlertDialogFooter";const jL=_.forwardRef(({className:t,...e},n)=>P.jsx(fW,{ref:n,className:le("text-lg font-semibold",t),...e}));jL.displayName=fW.displayName;const BL=_.forwardRef(({className:t,...e},n)=>P.jsx(hW,{ref:n,className:le("text-sm text-muted-foreground",t),...e}));BL.displayName=hW.displayName;const zL=_.forwardRef(({className:t,...e},n)=>P.jsx(uW,{ref:n,className:le(e0(),t),...e}));zL.displayName=uW.displayName;const UL=_.forwardRef(({className:t,...e},n)=>P.jsx(dW,{ref:n,className:le(e0({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));UL.displayName=dW.displayName;const Ype=({textAreaRef:t,triggerAutoSize:e,maxHeight:n=Number.MAX_SAFE_INTEGER,minHeight:r=0})=>{const[s,i]=_.useState(!0);_.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 o=t.scrollHeight;o>n?t.style.height=`${n}px`:t.style.height=`${o+2}px`}},[t,e,s,n,r])},gW=_.forwardRef(({maxHeight:t=Number.MAX_SAFE_INTEGER,minHeight:e=52,className:n,onChange:r,value:s,...i},a)=>{const o=_.useRef(null),[c,u]=_.useState("");return Ype({textAreaRef:o.current,triggerAutoSize:c,maxHeight:t,minHeight:e}),_.useImperativeHandle(a,()=>({textArea:o.current,focus:()=>{var f;return(f=o.current)==null?void 0:f.focus()},maxHeight:t,minHeight:e})),_.useEffect(()=>{(s||i!=null&&i.defaultValue)&&u(s)},[s||(i==null?void 0:i.defaultValue)]),P.jsx("textarea",{...i,value:s,ref:o,className:le("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=>{u(f.target.value),r==null||r(f)}})});gW.displayName="AutosizeTextarea";var HL="Avatar",[Xpe,nUe]=Nn(HL),[Qpe,vW]=Xpe(HL),yW=_.forwardRef((t,e)=>{const{__scopeAvatar:n,...r}=t,[s,i]=_.useState("idle");return P.jsx(Qpe,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:i,children:P.jsx(Ne.span,{...r,ref:e})})});yW.displayName=HL;var bW="AvatarImage",wW=_.forwardRef((t,e)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s=()=>{},...i}=t,a=vW(bW,n),o=Zpe(r),c=zt(u=>{s(u),a.onImageLoadingStatusChange(u)});return $n(()=>{o!=="idle"&&c(o)},[o,c]),o==="loaded"?P.jsx(Ne.img,{...i,ref:e,src:r}):null});wW.displayName=bW;var _W="AvatarFallback",xW=_.forwardRef((t,e)=>{const{__scopeAvatar:n,delayMs:r,...s}=t,i=vW(_W,n),[a,o]=_.useState(r===void 0);return _.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>o(!0),r);return()=>window.clearTimeout(c)}},[r]),a&&i.imageLoadingStatus!=="loaded"?P.jsx(Ne.span,{...s,ref:e}):null});xW.displayName=_W;function Zpe(t){const[e,n]=_.useState("idle");return $n(()=>{if(!t){n("error");return}let r=!0;const s=new window.Image,i=a=>()=>{r&&n(a)};return n("loading"),s.onload=i("loaded"),s.onerror=i("error"),s.src=t,()=>{r=!1}},[t]),e}var SW=yW,EW=wW,CW=xW;const Jpe=_.forwardRef(({className:t,...e},n)=>P.jsx(SW,{ref:n,className:le("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...e}));Jpe.displayName=SW.displayName;const eme=_.forwardRef(({className:t,...e},n)=>P.jsx(EW,{ref:n,className:le("aspect-square h-full w-full",t),...e}));eme.displayName=EW.displayName;const tme=_.forwardRef(({className:t,...e},n)=>P.jsx(CW,{ref:n,className:le("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...e}));tme.displayName=CW.displayName;const nme=ri("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 rme({className:t,variant:e,...n}){return P.jsx("div",{className:le(nme({variant:e}),t),...n})}const sme=_.forwardRef(({...t},e)=>P.jsx("nav",{ref:e,"aria-label":"breadcrumb",...t}));sme.displayName="Breadcrumb";const ime=_.forwardRef(({className:t,...e},n)=>P.jsx("ol",{ref:n,className:le("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",t),...e}));ime.displayName="BreadcrumbList";const ome=_.forwardRef(({className:t,...e},n)=>P.jsx("li",{ref:n,className:le("inline-flex items-center gap-1.5",t),...e}));ome.displayName="BreadcrumbItem";const ame=_.forwardRef(({asChild:t,className:e,...n},r)=>{const s=t?Aa:"a";return P.jsx(s,{ref:r,className:le("transition-colors hover:text-foreground",e),...n})});ame.displayName="BreadcrumbLink";const lme=_.forwardRef(({className:t,...e},n)=>P.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:le("font-normal text-foreground",t),...e}));lme.displayName="BreadcrumbPage";function Kt(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 fo(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function Ks(t,e){const n=Kt(t);return isNaN(e)?fo(t,NaN):(e&&n.setDate(n.getDate()+e),n)}function Ra(t,e){const n=Kt(t);if(isNaN(e))return fo(t,NaN);if(!e)return n;const r=n.getDate(),s=fo(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 VL=6048e5,cme=864e5;let ume={};function b_(){return ume}function xl(t,e){var o,c,u,f;const n=b_(),r=(e==null?void 0:e.weekStartsOn)??((c=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((f=(u=n.locale)==null?void 0:u.options)==null?void 0:f.weekStartsOn)??0,s=Kt(t),i=s.getDay(),a=(i=s.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function hv(t){const e=Kt(t);return e.setHours(0,0,0,0),e}function lC(t){const e=Kt(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 hl(t,e){const n=hv(t),r=hv(e),s=+n-lC(n),i=+r-lC(r);return Math.round((s-i)/cme)}function dme(t){const e=AW(t),n=fo(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),Wh(n)}function VN(t,e){const n=e*7;return Ks(t,n)}function fme(t,e){return Ra(t,e*12)}function hme(t){let e;return t.forEach(function(n){const r=Kt(n);(e===void 0||e{const r=Kt(n);(!e||e>r||isNaN(+r))&&(e=r)}),e||new Date(NaN)}function _i(t,e){const n=hv(t),r=hv(e);return+n==+r}function WL(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function mme(t){if(!WL(t)&&typeof t!="number")return!1;const e=Kt(t);return!isNaN(Number(e))}function t0(t,e){const n=Kt(t),r=Kt(e),s=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return s*12+i}function gme(t,e,n){const r=xl(t,n),s=xl(e,n),i=+r-lC(r),a=+s-lC(s);return Math.round((i-a)/VL)}function GL(t){const e=Kt(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function Pi(t){const e=Kt(t);return e.setDate(1),e.setHours(0,0,0,0),e}function RW(t){const e=Kt(t),n=fo(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}function qL(t,e){var o,c,u,f;const n=b_(),r=(e==null?void 0:e.weekStartsOn)??((c=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((f=(u=n.locale)==null?void 0:u.options)==null?void 0:f.weekStartsOn)??0,s=Kt(t),i=s.getDay(),a=(i{let r;const s=vme[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 dT(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const bme={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},wme={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},_me={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},xme={date:dT({formats:bme,defaultWidth:"full"}),time:dT({formats:wme,defaultWidth:"full"}),dateTime:dT({formats:_me,defaultWidth:"full"})},Sme={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Eme=(t,e,n,r)=>Sme[t];function Ey(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,o=n!=null&&n.width?String(n.width):a;s=t.formattingValues[o]||t.formattingValues[a]}else{const a=t.defaultWidth,o=n!=null&&n.width?String(n.width):t.defaultWidth;s=t.values[o]||t.values[a]}const i=t.argumentCallback?t.argumentCallback(e):e;return s[i]}}const Cme={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ame={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Rme={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"]},Pme={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"]},Tme={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"}},kme={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"}},Nme=(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"},Dme={ordinalNumber:Nme,era:Ey({values:Cme,defaultWidth:"wide"}),quarter:Ey({values:Ame,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Ey({values:Rme,defaultWidth:"wide"}),day:Ey({values:Pme,defaultWidth:"wide"}),dayPeriod:Ey({values:Tme,defaultWidth:"wide",formattingValues:kme,defaultFormattingWidth:"wide"})};function Cy(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 a=i[0],o=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(o)?Mme(o,l=>l.test(a)):Ome(o,l=>l.test(a));let u;u=t.valueCallback?t.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const f=e.slice(a.length);return{value:u,rest:f}}}function Ome(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Mme(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 a=t.valueCallback?t.valueCallback(i[0]):i[0];a=n.valueCallback?n.valueCallback(a):a;const o=e.slice(s.length);return{value:a,rest:o}}}const Ime=/^(\d+)(th|st|nd|rd)?/i,$me=/\d+/i,Fme={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},jme={any:[/^b/i,/^(a|c)/i]},Bme={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},zme={any:[/1/i,/2/i,/3/i,/4/i]},Ume={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},Hme={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]},Vme={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},Wme={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]},Gme={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},qme={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}},Kme={ordinalNumber:Lme({matchPattern:Ime,parsePattern:$me,valueCallback:t=>parseInt(t,10)}),era:Cy({matchPatterns:Fme,defaultMatchWidth:"wide",parsePatterns:jme,defaultParseWidth:"any"}),quarter:Cy({matchPatterns:Bme,defaultMatchWidth:"wide",parsePatterns:zme,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Cy({matchPatterns:Ume,defaultMatchWidth:"wide",parsePatterns:Hme,defaultParseWidth:"any"}),day:Cy({matchPatterns:Vme,defaultMatchWidth:"wide",parsePatterns:Wme,defaultParseWidth:"any"}),dayPeriod:Cy({matchPatterns:Gme,defaultMatchWidth:"any",parsePatterns:qme,defaultParseWidth:"any"})},TW={code:"en-US",formatDistance:yme,formatLong:xme,formatRelative:Eme,localize:Dme,match:Kme,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Yme(t){const e=Kt(t);return hl(e,RW(e))+1}function kW(t){const e=Kt(t),n=+Wh(e)-+dme(e);return Math.round(n/VL)+1}function NW(t,e){var f,l,d,m;const n=Kt(t),r=n.getFullYear(),s=b_(),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??((m=(d=s.locale)==null?void 0:d.options)==null?void 0:m.firstWeekContainsDate)??1,a=fo(t,0);a.setFullYear(r+1,0,i),a.setHours(0,0,0,0);const o=xl(a,e),c=fo(t,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const u=xl(c,e);return n.getTime()>=o.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function Xme(t,e){var o,c,u,f;const n=b_(),r=(e==null?void 0:e.firstWeekContainsDate)??((c=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(u=n.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,s=NW(t,e),i=fo(t,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),xl(i,e)}function DW(t,e){const n=Kt(t),r=+xl(n,e)-+Xme(n,e);return Math.round(r/VL)+1}function fn(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const vu={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return fn(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):fn(n+1,2)},d(t,e){return fn(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 fn(t.getHours()%12||12,e.length)},H(t,e){return fn(t.getHours(),e.length)},m(t,e){return fn(t.getMinutes(),e.length)},s(t,e){return fn(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return fn(s,e.length)}},Vp={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},pB={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 vu.y(t,e)},Y:function(t,e,n,r){const s=NW(t,r),i=s>0?s:1-s;if(e==="YY"){const a=i%100;return fn(a,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):fn(i,e.length)},R:function(t,e){const n=AW(t);return fn(n,e.length)},u:function(t,e){const n=t.getFullYear();return fn(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 fn(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 fn(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 vu.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 fn(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=DW(t,r);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):fn(s,e.length)},I:function(t,e,n){const r=kW(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):fn(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):vu.d(t,e)},D:function(t,e,n){const r=Yme(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):fn(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 fn(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 fn(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 fn(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=Vp.noon:r===0?s=Vp.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=Vp.evening:r>=12?s=Vp.afternoon:r>=4?s=Vp.morning:s=Vp.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 vu.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):vu.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):fn(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):fn(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):vu.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):vu.s(t,e)},S:function(t,e){return vu.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return gB(r);case"XXXX":case"XX":return ff(r);case"XXXXX":case"XXX":default:return ff(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return gB(r);case"xxxx":case"xx":return ff(r);case"xxxxx":case"xxx":default:return ff(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+mB(r,":");case"OOOO":default:return"GMT"+ff(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+mB(r,":");case"zzzz":default:return"GMT"+ff(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return fn(r,e.length)},T:function(t,e,n){const r=t.getTime();return fn(r,e.length)}};function mB(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+fn(i,2)}function gB(t,e){return t%60===0?(t>0?"-":"+")+fn(Math.abs(t)/60,2):ff(t,e)}function ff(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=fn(Math.trunc(r/60),2),i=fn(r%60,2);return n+s+e+i}const vB=(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"})}},OW=(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"})}},Qme=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return vB(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}}",vB(r,e)).replace("{{time}}",OW(s,e))},Zme={p:OW,P:Qme},Jme=/^D+$/,ege=/^Y+$/,tge=["D","DD","YY","YYYY"];function nge(t){return Jme.test(t)}function rge(t){return ege.test(t)}function sge(t,e,n){const r=ige(t,e,n);if(console.warn(r),tge.includes(t))throw new RangeError(r)}function ige(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 oge=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,age=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,lge=/^'([^]*?)'?$/,cge=/''/g,uge=/[a-zA-Z]/;function hp(t,e,n){var f,l,d,m,p,h,y,g;const r=b_(),s=(n==null?void 0:n.locale)??r.locale??TW,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??((m=(d=r.locale)==null?void 0:d.options)==null?void 0:m.firstWeekContainsDate)??1,a=(n==null?void 0:n.weekStartsOn)??((h=(p=n==null?void 0:n.locale)==null?void 0:p.options)==null?void 0:h.weekStartsOn)??r.weekStartsOn??((g=(y=r.locale)==null?void 0:y.options)==null?void 0:g.weekStartsOn)??0,o=Kt(t);if(!mme(o))throw new RangeError("Invalid time value");let c=e.match(age).map(v=>{const w=v[0];if(w==="p"||w==="P"){const x=Zme[w];return x(v,s.formatLong)}return v}).join("").match(oge).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const w=v[0];if(w==="'")return{isToken:!1,value:dge(v)};if(pB[w])return{isToken:!0,value:v};if(w.match(uge))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:v}});s.localize.preprocessor&&(c=s.localize.preprocessor(o,c));const u={firstWeekContainsDate:i,weekStartsOn:a,locale:s};return c.map(v=>{if(!v.isToken)return v.value;const w=v.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&rge(w)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&nge(w))&&sge(w,e,String(t));const x=pB[w[0]];return x(o,w,s.localize,u)}).join("")}function dge(t){const e=t.match(lge);return e?e[1].replace(cge,"'"):t}function fge(t){const e=Kt(t),n=e.getFullYear(),r=e.getMonth(),s=fo(t,0);return s.setFullYear(n,r+1,0),s.setHours(0,0,0,0),s.getDate()}function hge(t){return Math.trunc(+Kt(t)/1e3)}function pge(t){const e=Kt(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(0,0,0,0),e}function mge(t,e){return gme(pge(t),Pi(t),e)+1}function WN(t,e){const n=Kt(t),r=Kt(e);return n.getTime()>r.getTime()}function MW(t,e){const n=Kt(t),r=Kt(e);return+n<+r}function KL(t,e){const n=Kt(t),r=Kt(e);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function gge(t,e){const n=Kt(t),r=Kt(e);return n.getFullYear()===r.getFullYear()}function fT(t,e){return Ks(t,-e)}function hT(t,e){const n=Kt(t),r=n.getFullYear(),s=n.getDate(),i=fo(t,0);i.setFullYear(r,e,15),i.setHours(0,0,0,0);const a=fge(i);return n.setMonth(e,Math.min(s,a)),n}function yB(t,e){const n=Kt(t);return isNaN(+n)?fo(t,NaN):(n.setFullYear(e),n)}var dt=function(){return dt=Object.assign||function(e){for(var n,r=1,s=arguments.length;r1&&(c||!u),l=e>1&&(u||!c),d=function(){r&&i(r)},m=function(){s&&i(s)};return P.jsx(Yge,{displayMonth:t.displayMonth,hideNext:f,hidePrevious:l,nextMonth:s,previousMonth:r,onPreviousClick:d,onNextClick:m})}function Xge(t){var e,n=Fn(),r=n.classNames,s=n.disableNavigation,i=n.styles,a=n.captionLayout,o=n.components,c=(e=o==null?void 0:o.CaptionLabel)!==null&&e!==void 0?e:$W,u;return s?u=P.jsx(c,{id:t.id,displayMonth:t.displayMonth}):a==="dropdown"?u=P.jsx(bB,{displayMonth:t.displayMonth,id:t.id}):a==="dropdown-buttons"?u=P.jsxs(P.Fragment,{children:[P.jsx(bB,{displayMonth:t.displayMonth,displayIndex:t.displayIndex,id:t.id}),P.jsx(wB,{displayMonth:t.displayMonth,displayIndex:t.displayIndex,id:t.id})]}):u=P.jsxs(P.Fragment,{children:[P.jsx(c,{id:t.id,displayMonth:t.displayMonth,displayIndex:t.displayIndex}),P.jsx(wB,{displayMonth:t.displayMonth,id:t.id})]}),P.jsx("div",{className:r.caption,style:i.caption,children:u})}function Qge(t){var e=Fn(),n=e.footer,r=e.styles,s=e.classNames.tfoot;return n?P.jsx("tfoot",{className:s,style:r.tfoot,children:P.jsx("tr",{children:P.jsx("td",{colSpan:8,children:n})})}):P.jsx(P.Fragment,{})}function Zge(t,e,n){for(var r=n?Wh(new Date):xl(new Date,{locale:t,weekStartsOn:e}),s=[],i=0;i<7;i++){var a=Ks(r,i);s.push(a)}return s}function Jge(){var t=Fn(),e=t.classNames,n=t.styles,r=t.showWeekNumber,s=t.locale,i=t.weekStartsOn,a=t.ISOWeek,o=t.formatters.formatWeekdayName,c=t.labels.labelWeekday,u=Zge(s,i,a);return P.jsxs("tr",{style:n.head_row,className:e.head_row,children:[r&&P.jsx("td",{style:n.head_cell,className:e.head_cell}),u.map(function(f,l){return P.jsx("th",{scope:"col",className:e.head_cell,style:n.head_cell,"aria-label":c(f,{locale:s}),children:o(f,{locale:s})},l)})]})}function eve(){var t,e=Fn(),n=e.classNames,r=e.styles,s=e.components,i=(t=s==null?void 0:s.HeadRow)!==null&&t!==void 0?t:Jge;return P.jsx("thead",{style:r.head,className:n.head,children:P.jsx(i,{})})}function tve(t){var e=Fn(),n=e.locale,r=e.formatters.formatDay;return P.jsx(P.Fragment,{children:r(t.date,{locale:n})})}var YL=_.createContext(void 0);function nve(t){if(!w_(t.initialProps)){var e={selected:void 0,modifiers:{disabled:[]}};return P.jsx(YL.Provider,{value:e,children:t.children})}return P.jsx(rve,{initialProps:t.initialProps,children:t.children})}function rve(t){var e=t.initialProps,n=t.children,r=e.selected,s=e.min,i=e.max,a=function(u,f,l){var d,m;(d=e.onDayClick)===null||d===void 0||d.call(e,u,f,l);var p=!!(f.selected&&s&&(r==null?void 0:r.length)===s);if(!p){var h=!!(!f.selected&&i&&(r==null?void 0:r.length)===i);if(!h){var y=r?LW([],r):[];if(f.selected){var g=y.findIndex(function(v){return _i(u,v)});y.splice(g,1)}else y.push(u);(m=e.onSelect)===null||m===void 0||m.call(e,y,u,f,l)}}},o={disabled:[]};r&&o.disabled.push(function(u){var f=i&&r.length>i-1,l=r.some(function(d){return _i(d,u)});return!!(f&&!l)});var c={selected:r,onDayClick:a,modifiers:o};return P.jsx(YL.Provider,{value:c,children:n})}function XL(){var t=_.useContext(YL);if(!t)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return t}function sve(t,e){var n=e||{},r=n.from,s=n.to;return r&&s?_i(s,t)&&_i(r,t)?void 0:_i(s,t)?{from:s,to:void 0}:_i(r,t)?void 0:WN(r,t)?{from:t,to:s}:{from:r,to:t}:s?WN(t,s)?{from:s,to:t}:{from:t,to:s}:r?MW(t,r)?{from:t,to:r}:{from:r,to:t}:{from:t,to:void 0}}var QL=_.createContext(void 0);function ive(t){if(!__(t.initialProps)){var e={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return P.jsx(QL.Provider,{value:e,children:t.children})}return P.jsx(ove,{initialProps:t.initialProps,children:t.children})}function ove(t){var e=t.initialProps,n=t.children,r=e.selected,s=r||{},i=s.from,a=s.to,o=e.min,c=e.max,u=function(m,p,h){var y,g;(y=e.onDayClick)===null||y===void 0||y.call(e,m,p,h);var v=sve(m,r);(g=e.onSelect)===null||g===void 0||g.call(e,v,m,p,h)},f={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(f.range_start=[i],a?(f.range_end=[a],_i(i,a)||(f.range_middle=[{after:i,before:a}])):f.range_end=[i]):a&&(f.range_start=[a],f.range_end=[a]),o&&(i&&!a&&f.disabled.push({after:fT(i,o-1),before:Ks(i,o-1)}),i&&a&&f.disabled.push({after:i,before:Ks(i,o-1)}),!i&&a&&f.disabled.push({after:fT(a,o-1),before:Ks(a,o-1)})),c){if(i&&!a&&(f.disabled.push({before:Ks(i,-c+1)}),f.disabled.push({after:Ks(i,c-1)})),i&&a){var l=hl(a,i)+1,d=c-l;f.disabled.push({before:fT(i,d)}),f.disabled.push({after:Ks(a,d)})}!i&&a&&(f.disabled.push({before:Ks(a,-c+1)}),f.disabled.push({after:Ks(a,c-1)}))}return P.jsx(QL.Provider,{value:{selected:r,onDayClick:u,modifiers:f},children:n})}function ZL(){var t=_.useContext(QL);if(!t)throw new Error("useSelectRange must be used within a SelectRangeProvider");return t}function KS(t){return Array.isArray(t)?LW([],t):t!==void 0?[t]:[]}function ave(t){var e={};return Object.entries(t).forEach(function(n){var r=n[0],s=n[1];e[r]=KS(s)}),e}var Pa;(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"})(Pa||(Pa={}));var lve=Pa.Selected,Vl=Pa.Disabled,cve=Pa.Hidden,uve=Pa.Today,pT=Pa.RangeEnd,mT=Pa.RangeMiddle,gT=Pa.RangeStart,dve=Pa.Outside;function fve(t,e,n){var r,s=(r={},r[lve]=KS(t.selected),r[Vl]=KS(t.disabled),r[cve]=KS(t.hidden),r[uve]=[t.today],r[pT]=[],r[mT]=[],r[gT]=[],r[dve]=[],r);return t.fromDate&&s[Vl].push({before:t.fromDate}),t.toDate&&s[Vl].push({after:t.toDate}),w_(t)?s[Vl]=s[Vl].concat(e.modifiers[Vl]):__(t)&&(s[Vl]=s[Vl].concat(n.modifiers[Vl]),s[gT]=n.modifiers[gT],s[mT]=n.modifiers[mT],s[pT]=n.modifiers[pT]),s}var BW=_.createContext(void 0);function hve(t){var e=Fn(),n=XL(),r=ZL(),s=fve(e,n,r),i=ave(e.modifiers),a=dt(dt({},s),i);return P.jsx(BW.Provider,{value:a,children:t.children})}function zW(){var t=_.useContext(BW);if(!t)throw new Error("useModifiers must be used within a ModifiersProvider");return t}function pve(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function mve(t){return!!(t&&typeof t=="object"&&"from"in t)}function gve(t){return!!(t&&typeof t=="object"&&"after"in t)}function vve(t){return!!(t&&typeof t=="object"&&"before"in t)}function yve(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function bve(t,e){var n,r=e.from,s=e.to;if(r&&s){var i=hl(s,r)<0;i&&(n=[s,r],r=n[0],s=n[1]);var a=hl(t,r)>=0&&hl(s,t)>=0;return a}return s?_i(s,t):r?_i(r,t):!1}function wve(t){return WL(t)}function _ve(t){return Array.isArray(t)&&t.every(WL)}function xve(t,e){return e.some(function(n){if(typeof n=="boolean")return n;if(wve(n))return _i(t,n);if(_ve(n))return n.includes(t);if(mve(n))return bve(t,n);if(yve(n))return n.dayOfWeek.includes(t.getDay());if(pve(n)){var r=hl(n.before,t),s=hl(n.after,t),i=r>0,a=s<0,o=WN(n.before,n.after);return o?a&&i:i||a}return gve(n)?hl(t,n.after)>0:vve(n)?hl(n.before,t)>0:typeof n=="function"?n(t):!1})}function JL(t,e,n){var r=Object.keys(e).reduce(function(i,a){var o=e[a];return xve(t,o)&&i.push(a),i},[]),s={};return r.forEach(function(i){return s[i]=!0}),n&&!KL(t,n)&&(s.outside=!0),s}function Sve(t,e){for(var n=Pi(t[0]),r=GL(t[t.length-1]),s,i,a=n;a<=r;){var o=JL(a,e),c=!o.disabled&&!o.hidden;if(!c){a=Ks(a,1);continue}if(o.selected)return a;o.today&&!i&&(i=a),s||(s=a),a=Ks(a,1)}return i||s}var Eve=365;function UW(t,e){var n=e.moveBy,r=e.direction,s=e.context,i=e.modifiers,a=e.retry,o=a===void 0?{count:0,lastFocused:t}:a,c=s.weekStartsOn,u=s.fromDate,f=s.toDate,l=s.locale,d={day:Ks,week:VN,month:Ra,year:fme,startOfWeek:function(y){return s.ISOWeek?Wh(y):xl(y,{locale:l,weekStartsOn:c})},endOfWeek:function(y){return s.ISOWeek?PW(y):qL(y,{locale:l,weekStartsOn:c})}},m=d[n](t,r==="after"?1:-1);r==="before"&&u?m=hme([u,m]):r==="after"&&f&&(m=pme([f,m]));var p=!0;if(i){var h=JL(m,i);p=!h.disabled&&!h.hidden}return p?m:o.count>Eve?o.lastFocused:UW(m,{moveBy:n,direction:r,context:s,modifiers:i,retry:dt(dt({},o),{count:o.count+1})})}var HW=_.createContext(void 0);function Cve(t){var e=x_(),n=zW(),r=_.useState(),s=r[0],i=r[1],a=_.useState(),o=a[0],c=a[1],u=Sve(e.displayMonths,n),f=s??(o&&e.isDateDisplayed(o))?o:u,l=function(){c(s),i(void 0)},d=function(y){i(y)},m=Fn(),p=function(y,g){if(s){var v=UW(s,{moveBy:y,direction:g,context:m,modifiers:n});_i(s,v)||(e.goToDate(v,s),d(v))}},h={focusedDay:s,focusTarget:f,blur:l,focus:d,focusDayAfter:function(){return p("day","after")},focusDayBefore:function(){return p("day","before")},focusWeekAfter:function(){return p("week","after")},focusWeekBefore:function(){return p("week","before")},focusMonthBefore:function(){return p("month","before")},focusMonthAfter:function(){return p("month","after")},focusYearBefore:function(){return p("year","before")},focusYearAfter:function(){return p("year","after")},focusStartOfWeek:function(){return p("startOfWeek","before")},focusEndOfWeek:function(){return p("endOfWeek","after")}};return P.jsx(HW.Provider,{value:h,children:t.children})}function eI(){var t=_.useContext(HW);if(!t)throw new Error("useFocusContext must be used within a FocusProvider");return t}function Ave(t,e){var n=zW(),r=JL(t,n,e);return r}var tI=_.createContext(void 0);function Rve(t){if(!Q1(t.initialProps)){var e={selected:void 0};return P.jsx(tI.Provider,{value:e,children:t.children})}return P.jsx(Pve,{initialProps:t.initialProps,children:t.children})}function Pve(t){var e=t.initialProps,n=t.children,r=function(i,a,o){var c,u,f;if((c=e.onDayClick)===null||c===void 0||c.call(e,i,a,o),a.selected&&!e.required){(u=e.onSelect)===null||u===void 0||u.call(e,void 0,i,a,o);return}(f=e.onSelect)===null||f===void 0||f.call(e,i,i,a,o)},s={selected:e.selected,onDayClick:r};return P.jsx(tI.Provider,{value:s,children:n})}function VW(){var t=_.useContext(tI);if(!t)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return t}function Tve(t,e){var n=Fn(),r=VW(),s=XL(),i=ZL(),a=eI(),o=a.focusDayAfter,c=a.focusDayBefore,u=a.focusWeekAfter,f=a.focusWeekBefore,l=a.blur,d=a.focus,m=a.focusMonthBefore,p=a.focusMonthAfter,h=a.focusYearBefore,y=a.focusYearAfter,g=a.focusStartOfWeek,v=a.focusEndOfWeek,w=function(V){var H,ee,re,X;Q1(n)?(H=r.onDayClick)===null||H===void 0||H.call(r,t,e,V):w_(n)?(ee=s.onDayClick)===null||ee===void 0||ee.call(s,t,e,V):__(n)?(re=i.onDayClick)===null||re===void 0||re.call(i,t,e,V):(X=n.onDayClick)===null||X===void 0||X.call(n,t,e,V)},x=function(V){var H;d(t),(H=n.onDayFocus)===null||H===void 0||H.call(n,t,e,V)},A=function(V){var H;l(),(H=n.onDayBlur)===null||H===void 0||H.call(n,t,e,V)},T=function(V){var H;(H=n.onDayMouseEnter)===null||H===void 0||H.call(n,t,e,V)},R=function(V){var H;(H=n.onDayMouseLeave)===null||H===void 0||H.call(n,t,e,V)},E=function(V){var H;(H=n.onDayPointerEnter)===null||H===void 0||H.call(n,t,e,V)},k=function(V){var H;(H=n.onDayPointerLeave)===null||H===void 0||H.call(n,t,e,V)},N=function(V){var H;(H=n.onDayTouchCancel)===null||H===void 0||H.call(n,t,e,V)},O=function(V){var H;(H=n.onDayTouchEnd)===null||H===void 0||H.call(n,t,e,V)},L=function(V){var H;(H=n.onDayTouchMove)===null||H===void 0||H.call(n,t,e,V)},I=function(V){var H;(H=n.onDayTouchStart)===null||H===void 0||H.call(n,t,e,V)},F=function(V){var H;(H=n.onDayKeyUp)===null||H===void 0||H.call(n,t,e,V)},U=function(V){var H;switch(V.key){case"ArrowLeft":V.preventDefault(),V.stopPropagation(),n.dir==="rtl"?o():c();break;case"ArrowRight":V.preventDefault(),V.stopPropagation(),n.dir==="rtl"?c():o();break;case"ArrowDown":V.preventDefault(),V.stopPropagation(),u();break;case"ArrowUp":V.preventDefault(),V.stopPropagation(),f();break;case"PageUp":V.preventDefault(),V.stopPropagation(),V.shiftKey?h():m();break;case"PageDown":V.preventDefault(),V.stopPropagation(),V.shiftKey?y():p();break;case"Home":V.preventDefault(),V.stopPropagation(),g();break;case"End":V.preventDefault(),V.stopPropagation(),v();break}(H=n.onDayKeyDown)===null||H===void 0||H.call(n,t,e,V)},Y={onClick:w,onFocus:x,onBlur:A,onKeyDown:U,onKeyUp:F,onMouseEnter:T,onMouseLeave:R,onPointerEnter:E,onPointerLeave:k,onTouchCancel:N,onTouchEnd:O,onTouchMove:L,onTouchStart:I};return Y}function kve(){var t=Fn(),e=VW(),n=XL(),r=ZL(),s=Q1(t)?e.selected:w_(t)?n.selected:__(t)?r.selected:void 0;return s}function Nve(t){return Object.values(Pa).includes(t)}function Dve(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(Nve(r)){var i=t.classNames["day_".concat(r)];i&&n.push(i)}}),n}function Ove(t,e){var n=dt({},t.styles.day);return Object.keys(e).forEach(function(r){var s;n=dt(dt({},n),(s=t.modifiersStyles)===null||s===void 0?void 0:s[r])}),n}function Mve(t,e,n){var r,s,i,a=Fn(),o=eI(),c=Ave(t,e),u=Tve(t,c),f=kve(),l=!!(a.onDayClick||a.mode!=="default");_.useEffect(function(){var T;c.outside||o.focusedDay&&l&&_i(o.focusedDay,t)&&((T=n.current)===null||T===void 0||T.focus())},[o.focusedDay,t,n,l,c.outside]);var d=Dve(a,c).join(" "),m=Ove(a,c),p=!!(c.outside&&!a.showOutsideDays||c.hidden),h=(i=(s=a.components)===null||s===void 0?void 0:s.DayContent)!==null&&i!==void 0?i:tve,y=P.jsx(h,{date:t,displayMonth:e,activeModifiers:c}),g={style:m,className:d,children:y,role:"gridcell"},v=o.focusTarget&&_i(o.focusTarget,t)&&!c.outside,w=o.focusedDay&&_i(o.focusedDay,t),x=dt(dt(dt({},g),(r={disabled:c.disabled,role:"gridcell"},r["aria-selected"]=c.selected,r.tabIndex=w||v?0:-1,r)),u),A={isButton:l,isHidden:p,activeModifiers:c,selectedDays:f,buttonProps:x,divProps:g};return A}function Lve(t){var e=_.useRef(null),n=Mve(t.date,t.displayMonth,e);return n.isHidden?P.jsx("div",{role:"gridcell"}):n.isButton?P.jsx(cC,dt({name:"day",ref:e},n.buttonProps)):P.jsx("div",dt({},n.divProps))}function Ive(t){var e=t.number,n=t.dates,r=Fn(),s=r.onWeekNumberClick,i=r.styles,a=r.classNames,o=r.locale,c=r.labels.labelWeekNumber,u=r.formatters.formatWeekNumber,f=u(Number(e),{locale:o});if(!s)return P.jsx("span",{className:a.weeknumber,style:i.weeknumber,children:f});var l=c(Number(e),{locale:o}),d=function(m){s(e,n,m)};return P.jsx(cC,{name:"week-number","aria-label":l,className:a.weeknumber,style:i.weeknumber,onClick:d,children:f})}function $ve(t){var e,n,r=Fn(),s=r.styles,i=r.classNames,a=r.showWeekNumber,o=r.components,c=(e=o==null?void 0:o.Day)!==null&&e!==void 0?e:Lve,u=(n=o==null?void 0:o.WeekNumber)!==null&&n!==void 0?n:Ive,f;return a&&(f=P.jsx("td",{className:i.cell,style:s.cell,children:P.jsx(u,{number:t.weekNumber,dates:t.dates})})),P.jsxs("tr",{className:i.row,style:s.row,children:[f,t.dates.map(function(l){return P.jsx("td",{className:i.cell,style:s.cell,role:"presentation",children:P.jsx(c,{displayMonth:t.displayMonth,date:l})},hge(l))})]})}function _B(t,e,n){for(var r=n!=null&&n.ISOWeek?PW(e):qL(e,n),s=n!=null&&n.ISOWeek?Wh(t):xl(t,n),i=hl(r,s),a=[],o=0;o<=i;o++)a.push(Ks(s,o));var c=a.reduce(function(u,f){var l=n!=null&&n.ISOWeek?kW(f):DW(f,n),d=u.find(function(m){return m.weekNumber===l});return d?(d.dates.push(f),u):(u.push({weekNumber:l,dates:[f]}),u)},[]);return c}function Fve(t,e){var n=_B(Pi(t),GL(t),e);if(e!=null&&e.useFixedWeeks){var r=mge(t,e);if(r<6){var s=n[n.length-1],i=s.dates[s.dates.length-1],a=VN(i,6-r),o=_B(VN(i,1),a,e);n.push.apply(n,o)}}return n}function jve(t){var e,n,r,s=Fn(),i=s.locale,a=s.classNames,o=s.styles,c=s.hideHead,u=s.fixedWeeks,f=s.components,l=s.weekStartsOn,d=s.firstWeekContainsDate,m=s.ISOWeek,p=Fve(t.displayMonth,{useFixedWeeks:!!u,ISOWeek:m,locale:i,weekStartsOn:l,firstWeekContainsDate:d}),h=(e=f==null?void 0:f.Head)!==null&&e!==void 0?e:eve,y=(n=f==null?void 0:f.Row)!==null&&n!==void 0?n:$ve,g=(r=f==null?void 0:f.Footer)!==null&&r!==void 0?r:Qge;return P.jsxs("table",{id:t.id,className:a.table,style:o.table,role:"grid","aria-labelledby":t["aria-labelledby"],children:[!c&&P.jsx(h,{}),P.jsx("tbody",{className:a.tbody,style:o.tbody,children:p.map(function(v){return P.jsx(y,{displayMonth:t.displayMonth,dates:v.dates,weekNumber:v.weekNumber},v.weekNumber)})}),P.jsx(g,{displayMonth:t.displayMonth})]})}function Bve(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var zve=Bve()?_.useLayoutEffect:_.useEffect,vT=!1,Uve=0;function xB(){return"react-day-picker-".concat(++Uve)}function Hve(t){var e,n=t??(vT?xB():null),r=_.useState(n),s=r[0],i=r[1];return zve(function(){s===null&&i(xB())},[]),_.useEffect(function(){vT===!1&&(vT=!0)},[]),(e=t??s)!==null&&e!==void 0?e:void 0}function Vve(t){var e,n,r=Fn(),s=r.dir,i=r.classNames,a=r.styles,o=r.components,c=x_().displayMonths,u=Hve(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],d=a.month,m=t.displayIndex===0,p=t.displayIndex===c.length-1,h=!m&&!p;s==="rtl"&&(e=[m,p],p=e[0],m=e[1]),m&&(l.push(i.caption_start),d=dt(dt({},d),a.caption_start)),p&&(l.push(i.caption_end),d=dt(dt({},d),a.caption_end)),h&&(l.push(i.caption_between),d=dt(dt({},d),a.caption_between));var y=(n=o==null?void 0:o.Caption)!==null&&n!==void 0?n:Xge;return P.jsxs("div",{className:l.join(" "),style:d,children:[P.jsx(y,{id:u,displayMonth:t.displayMonth,displayIndex:t.displayIndex}),P.jsx(jve,{id:f,"aria-labelledby":u,displayMonth:t.displayMonth})]},t.displayIndex)}function Wve(t){var e=Fn(),n=e.classNames,r=e.styles;return P.jsx("div",{className:n.months,style:r.months,children:t.children})}function Gve(t){var e,n,r=t.initialProps,s=Fn(),i=eI(),a=x_(),o=_.useState(!1),c=o[0],u=o[1];_.useEffect(function(){s.initialFocus&&i.focusTarget&&(c||(i.focus(i.focusTarget),u(!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=dt(dt({},s.styles.root),s.style),d=Object.keys(r).filter(function(p){return p.startsWith("data-")}).reduce(function(p,h){var y;return dt(dt({},p),(y={},y[h]=r[h],y))},{}),m=(n=(e=r.components)===null||e===void 0?void 0:e.Months)!==null&&n!==void 0?n:Wve;return P.jsx("div",dt({className:f.join(" "),style:l,dir:s.dir,id:s.id,nonce:r.nonce,title:r.title,lang:r.lang},d,{children:P.jsx(m,{children:a.displayMonths.map(function(p,h){return P.jsx(Vve,{displayIndex:h,displayMonth:p},h)})})}))}function qve(t){var e=t.children,n=vge(t,["children"]);return P.jsx(Ige,{initialProps:n,children:P.jsx(Gge,{children:P.jsx(Rve,{initialProps:n,children:P.jsx(nve,{initialProps:n,children:P.jsx(ive,{initialProps:n,children:P.jsx(hve,{children:P.jsx(Cve,{children:e})})})})})})})}function Kve(t){return P.jsx(qve,dt({},t,{children:P.jsx(Gve,{initialProps:t})}))}function WW({className:t,classNames:e,showOutsideDays:n=!0,...r}){return P.jsx(Kve,{showOutsideDays:n,className:le("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:le(e0({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:le(e0({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:()=>P.jsx(_L,{className:"w-4 h-4"}),IconRight:()=>P.jsx(d_,{className:"w-4 h-4"})},...r})}WW.displayName="Calendar";const GW=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:le("rounded-md border bg-card text-card-foreground shadow",t),...e}));GW.displayName="Card";const qW=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:le("flex flex-col space-y-1.5 p-6",t),...e}));qW.displayName="CardHeader";const KW=_.forwardRef(({className:t,...e},n)=>P.jsx("h3",{ref:n,className:le("font-semibold leading-none tracking-tight",t),...e}));KW.displayName="CardTitle";const YW=_.forwardRef(({className:t,...e},n)=>P.jsx("p",{ref:n,className:le("text-sm text-muted-foreground",t),...e}));YW.displayName="CardDescription";const XW=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:le("p-6 pt-0",t),...e}));XW.displayName="CardContent";const QW=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:le("flex items-center p-6 pt-0",t),...e}));QW.displayName="CardFooter";var Yve=Array.isArray,ZW=Yve,Xve=typeof _r=="object"&&_r&&_r.Object===Object&&_r,Qve=Xve,Zve=Qve,Jve=typeof self=="object"&&self&&self.Object===Object&&self,eye=Zve||Jve||Function("return this")(),Z1=eye,tye=Z1,nye=tye.Symbol,nI=nye,SB=nI,JW=Object.prototype,rye=JW.hasOwnProperty,sye=JW.toString,Ay=SB?SB.toStringTag:void 0;function iye(t){var e=rye.call(t,Ay),n=t[Ay];try{t[Ay]=void 0;var r=!0}catch{}var s=sye.call(t);return r&&(e?t[Ay]=n:delete t[Ay]),s}var oye=iye,aye=Object.prototype,lye=aye.toString;function cye(t){return lye.call(t)}var uye=cye,EB=nI,dye=oye,fye=uye,hye="[object Null]",pye="[object Undefined]",CB=EB?EB.toStringTag:void 0;function mye(t){return t==null?t===void 0?pye:hye:CB&&CB in Object(t)?dye(t):fye(t)}var rI=mye;function gye(t){return t!=null&&typeof t=="object"}var e8=gye,vye=rI,yye=e8,bye="[object Symbol]";function wye(t){return typeof t=="symbol"||yye(t)&&vye(t)==bye}var t8=wye;function _ye(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var kv=_ye;const rUe=Yc(kv);var xye=rI,Sye=kv,Eye="[object AsyncFunction]",Cye="[object Function]",Aye="[object GeneratorFunction]",Rye="[object Proxy]";function Pye(t){if(!Sye(t))return!1;var e=xye(t);return e==Cye||e==Aye||e==Eye||e==Rye}var Tye=Pye,kye=Z1,Nye=kye["__core-js_shared__"],Dye=Nye,yT=Dye,AB=function(){var t=/[^.]+$/.exec(yT&&yT.keys&&yT.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Oye(t){return!!AB&&AB in t}var Mye=Oye,Lye=Function.prototype,Iye=Lye.toString;function $ye(t){if(t!=null){try{return Iye.call(t)}catch{}try{return t+""}catch{}}return""}var Fye=$ye,jye=Tye,Bye=Mye,zye=kv,Uye=Fye,Hye=/[\\^$.*+?()[\]{}|]/g,Vye=/^\[object .+?Constructor\]$/,Wye=Function.prototype,Gye=Object.prototype,qye=Wye.toString,Kye=Gye.hasOwnProperty,Yye=RegExp("^"+qye.call(Kye).replace(Hye,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Xye(t){if(!zye(t)||Bye(t))return!1;var e=jye(t)?Yye:Vye;return e.test(Uye(t))}var Qye=Xye;function Zye(t,e){return t==null?void 0:t[e]}var Jye=Zye,ebe=Qye,tbe=Jye;function nbe(t,e){var n=tbe(t,e);return ebe(n)?n:void 0}var n8=nbe,rbe=n8,sbe=rbe(Object,"create"),J1=sbe,RB=J1;function ibe(){this.__data__=RB?RB(null):{},this.size=0}var obe=ibe;function abe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var lbe=abe,cbe=J1,ube="__lodash_hash_undefined__",dbe=Object.prototype,fbe=dbe.hasOwnProperty;function hbe(t){var e=this.__data__;if(cbe){var n=e[t];return n===ube?void 0:n}return fbe.call(e,t)?e[t]:void 0}var pbe=hbe,mbe=J1,gbe=Object.prototype,vbe=gbe.hasOwnProperty;function ybe(t){var e=this.__data__;return mbe?e[t]!==void 0:vbe.call(e,t)}var bbe=ybe,wbe=J1,_be="__lodash_hash_undefined__";function xbe(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=wbe&&e===void 0?_be:e,this}var Sbe=xbe,Ebe=obe,Cbe=lbe,Abe=pbe,Rbe=bbe,Pbe=Sbe;function Nv(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1}var Gbe=Wbe,qbe=eA;function Kbe(t,e){var n=this.__data__,r=qbe(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Ybe=Kbe,Xbe=Nbe,Qbe=Bbe,Zbe=Hbe,Jbe=Gbe,e0e=Ybe;function Dv(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e{var c;const o=((c=a.theme)==null?void 0:c[r])||a.color;return `)} } `).join(` -`)}}):null},Gwe=_.forwardRef(({active:t,payload:e,className:n,indicator:r="dot",hideLabel:s=!1,hideIndicator:i=!1,label:a,labelFormatter:o,labelClassName:c,formatter:u,color:f,nameKey:l,labelKey:d},m)=>{const{config:p}=a8(),h=_.useMemo(()=>{var A;if(s||!(e!=null&&e.length))return null;const[g]=e,v=`${d||g.dataKey||g.name||"value"}`,w=GN(p,g,v),x=!d&&typeof a=="string"?((A=p[a])==null?void 0:A.label)||a:w==null?void 0:w.label;return o?P.jsx("div",{className:le("font-medium",c),children:o(x,e)}):x?P.jsx("div",{className:le("font-medium",c),children:x}):null},[a,o,e,s,c,p,d]);if(!t||!(e!=null&&e.length))return null;const y=e.length===1&&r!=="dot";return P.jsxs("div",{ref:m,className:le("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:h,P.jsx("div",{className:"grid gap-1.5",children:e.map((g,v)=>{const w=`${l||g.name||g.dataKey||"value"}`,x=GN(p,g,w),A=f||g.payload.fill||g.color;return P.jsx("div",{className:le("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:u&&(g==null?void 0:g.value)!==void 0&&g.name?u(g.value,g.name,g,v,g.payload):P.jsxs(P.Fragment,{children:[x!=null&&x.icon?P.jsx(x.icon,{}):!i&&P.jsx("div",{className:le("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}}),P.jsxs("div",{className:le("flex flex-1 justify-between leading-none",y?"items-end":"items-center"),children:[P.jsxs("div",{className:"grid gap-1.5",children:[y?h:null,P.jsx("span",{className:"text-muted-foreground",children:(x==null?void 0:x.label)||g.name})]}),g.value&&P.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:g.value.toLocaleString()})]})]})},g.dataKey)})})]})});Gwe.displayName="ChartTooltip";const qwe=_.forwardRef(({className:t,hideIcon:e=!1,payload:n,verticalAlign:r="bottom",nameKey:s},i)=>{const{config:a}=a8();return n!=null&&n.length?P.jsx("div",{ref:i,className:le("flex items-center justify-center gap-4",r==="top"?"pb-3":"pt-3",t),children:n.map(o=>{const c=`${s||o.dataKey||"value"}`,u=GN(a,o,c);return P.jsxs("div",{className:le("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[u!=null&&u.icon&&!e?P.jsx(u.icon,{}):P.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:o.color}}),u==null?void 0:u.label]},o.value)})}):null});qwe.displayName="ChartLegend";function GN(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 Mv(t){const e=_.useRef({value:t,previous:t});return _.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function S_(t){const[e,n]=_.useState(void 0);return $n(()=>{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 a,o;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;a=u.inlineSize,o=u.blockSize}else a=t.offsetWidth,o=t.offsetHeight;n({width:a,height:o})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var aI="Checkbox",[Kwe,aUe]=Nn(aI),[Ywe,Xwe]=Kwe(aI),l8=_.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:i,required:a,disabled:o,value:c="on",onCheckedChange:u,...f}=t,[l,d]=_.useState(null),m=tt(e,w=>d(w)),p=_.useRef(!1),h=l?!!l.closest("form"):!0,[y=!1,g]=lr({prop:s,defaultProp:i,onChange:u}),v=_.useRef(y);return _.useEffect(()=>{const w=l==null?void 0:l.form;if(w){const x=()=>g(v.current);return w.addEventListener("reset",x),()=>w.removeEventListener("reset",x)}},[l,g]),P.jsxs(Ywe,{scope:n,state:y,disabled:o,children:[P.jsx(Ne.button,{type:"button",role:"checkbox","aria-checked":Oh(y)?"mixed":y,"aria-required":a,"data-state":d8(y),"data-disabled":o?"":void 0,disabled:o,value:c,...f,ref:m,onKeyDown:me(t.onKeyDown,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:me(t.onClick,w=>{g(x=>Oh(x)?!0:!x),h&&(p.current=w.isPropagationStopped(),p.current||w.stopPropagation())})}),h&&P.jsx(Qwe,{control:l,bubbles:!p.current,name:r,value:c,checked:y,required:a,disabled:o,style:{transform:"translateX(-100%)"}})]})});l8.displayName=aI;var c8="CheckboxIndicator",u8=_.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...s}=t,i=Xwe(c8,n);return P.jsx(Wn,{present:r||Oh(i.state)||i.state===!0,children:P.jsx(Ne.span,{"data-state":d8(i.state),"data-disabled":i.disabled?"":void 0,...s,ref:e,style:{pointerEvents:"none",...t.style}})})});u8.displayName=c8;var Qwe=t=>{const{control:e,checked:n,bubbles:r=!0,...s}=t,i=_.useRef(null),a=Mv(n),o=S_(e);return _.useEffect(()=>{const c=i.current,u=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(u,"checked").set;if(a!==n&&l){const d=new Event("click",{bubbles:r});c.indeterminate=Oh(n),l.call(c,Oh(n)?!1:n),c.dispatchEvent(d)}},[a,n,r]),P.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:Oh(n)?!1:n,...s,tabIndex:-1,ref:i,style:{...t.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Oh(t){return t==="indeterminate"}function d8(t){return Oh(t)?"indeterminate":t?"checked":"unchecked"}var f8=l8,Zwe=u8;const Jwe=_.forwardRef(({className:t,...e},n)=>P.jsx(f8,{ref:n,className:le("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:P.jsx(Zwe,{className:le("flex items-center justify-center text-current"),children:P.jsx(u_,{className:"h-4 w-4"})})}));Jwe.displayName=f8.displayName;var $B=1,e_e=.9,t_e=.8,n_e=.17,_T=.1,xT=.999,r_e=.9999,s_e=.99,i_e=/[\\\/_+.#"@\[\(\{&]/,o_e=/[\\\/_+.#"@\[\(\{&]/g,a_e=/[\s-]/,h8=/[\s-]/g;function qN(t,e,n,r,s,i,a){if(i===e.length)return s===t.length?$B:s_e;var o=`${s},${i}`;if(a[o]!==void 0)return a[o];for(var c=r.charAt(i),u=n.indexOf(c,s),f=0,l,d,m,p;u>=0;)l=qN(t,e,n,r,u+1,i+1,a),l>f&&(u===s?l*=$B:i_e.test(t.charAt(u-1))?(l*=t_e,m=t.slice(s,u-1).match(o_e),m&&s>0&&(l*=Math.pow(xT,m.length))):a_e.test(t.charAt(u-1))?(l*=e_e,p=t.slice(s,u-1).match(h8),p&&s>0&&(l*=Math.pow(xT,p.length))):(l*=n_e,s>0&&(l*=Math.pow(xT,u-s))),t.charAt(u)!==e.charAt(i)&&(l*=r_e)),(l<_T&&n.charAt(u-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(u-1)!==r.charAt(i))&&(d=qN(t,e,n,r,u+1,i+2,a),d*_T>l&&(l=d*_T)),l>f&&(f=l),u=n.indexOf(c,u+1);return a[o]=f,f}function FB(t){return t.toLowerCase().replace(h8," ")}function l_e(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,qN(t,e,FB(t),FB(e),0,0,{})}function Sd(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 jB(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Gh(...t){return e=>{let n=!1;const r=t.map(s=>{const i=jB(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s{const{children:a,...o}=i,c=_.useMemo(()=>o,Object.values(o));return P.jsx(n.Provider,{value:c,children:a})};r.displayName=t+"Provider";function s(i){const a=_.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[r,s]}function u_e(t,e=[]){let n=[];function r(i,a){const o=_.createContext(a),c=n.length;n=[...n,a];const u=l=>{var g;const{scope:d,children:m,...p}=l,h=((g=d==null?void 0:d[t])==null?void 0:g[c])||o,y=_.useMemo(()=>p,Object.values(p));return P.jsx(h.Provider,{value:y,children:m})};u.displayName=i+"Provider";function f(l,d){var h;const m=((h=d==null?void 0:d[t])==null?void 0:h[c])||o,p=_.useContext(m);if(p)return p;if(a!==void 0)return a;throw new Error(`\`${l}\` must be used within \`${i}\``)}return[u,f]}const s=()=>{const i=n.map(a=>_.createContext(a));return function(o){const c=(o==null?void 0:o[t])||i;return _.useMemo(()=>({[`__scope${t}`]:{...o,[t]:c}}),[o,c])}};return s.scopeName=t,[r,d_e(s,...e)]}function d_e(...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 a=r.reduce((o,{useScope:c,scopeName:u})=>{const l=c(i)[`__scope${u}`];return{...o,...l}},{});return _.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}const uC=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{},f_e=r_.useId||(()=>{});let h_e=0;function Oc(t){const[e,n]=_.useState(f_e());return uC(()=>{n(r=>r??String(h_e++))},[t]),e?`radix-${e}`:""}function qh(t){const e=_.useRef(t);return _.useEffect(()=>{e.current=t}),_.useMemo(()=>(...n)=>{var r;return(r=e.current)===null||r===void 0?void 0:r.call(e,...n)},[])}function p_e({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,s]=m_e({defaultProp:e,onChange:n}),i=t!==void 0,a=i?t:r,o=qh(n),c=_.useCallback(u=>{if(i){const l=typeof u=="function"?u(t):u;l!==t&&o(l)}else s(u)},[i,t,s,o]);return[a,c]}function m_e({defaultProp:t,onChange:e}){const n=_.useState(t),[r]=n,s=_.useRef(r),i=qh(e);return _.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}var lI=_.forwardRef((t,e)=>{const{children:n,...r}=t,s=_.Children.toArray(n),i=s.find(v_e);if(i){const a=i.props.children,o=s.map(c=>c===i?_.Children.count(a)>1?_.Children.only(null):_.isValidElement(a)?a.props.children:null:c);return P.jsx(KN,{...r,ref:e,children:_.isValidElement(a)?_.cloneElement(a,void 0,o):null})}return P.jsx(KN,{...r,ref:e,children:n})});lI.displayName="Slot";var KN=_.forwardRef((t,e)=>{const{children:n,...r}=t;if(_.isValidElement(n)){const s=b_e(n),i=y_e(r,n.props);return n.type!==_.Fragment&&(i.ref=e?Gh(e,s):s),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});KN.displayName="SlotClone";var g_e=({children:t})=>P.jsx(P.Fragment,{children:t});function v_e(t){return _.isValidElement(t)&&t.type===g_e}function y_e(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]=(...o)=>{i(...o),s(...o)}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function b_e(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 w_e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],gs=w_e.reduce((t,e)=>{const n=_.forwardRef((r,s)=>{const{asChild:i,...a}=r,o=i?lI:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(o,{...a,ref:s})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function __e(t,e){t&&Ms.flushSync(()=>t.dispatchEvent(e))}function x_e(t,e=globalThis==null?void 0:globalThis.document){const n=qh(t);_.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",r),()=>e.removeEventListener("keydown",r)},[n,e])}var S_e="DismissableLayer",YN="dismissableLayer.update",E_e="dismissableLayer.pointerDownOutside",C_e="dismissableLayer.focusOutside",BB,p8=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),m8=_.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,onDismiss:o,...c}=t,u=_.useContext(p8),[f,l]=_.useState(null),d=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=_.useState({}),p=pp(e,R=>l(R)),h=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=h.indexOf(y),v=f?h.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,x=v>=g,A=P_e(R=>{const E=R.target,k=[...u.branches].some(N=>N.contains(E));!x||k||(s==null||s(R),a==null||a(R),R.defaultPrevented||o==null||o())},d),T=T_e(R=>{const E=R.target;[...u.branches].some(N=>N.contains(E))||(i==null||i(R),a==null||a(R),R.defaultPrevented||o==null||o())},d);return x_e(R=>{v===u.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&o&&(R.preventDefault(),o()))},d),_.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(BB=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),zB(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=BB)}},[f,d,n,u]),_.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),zB())},[f,u]),_.useEffect(()=>{const R=()=>m({});return document.addEventListener(YN,R),()=>document.removeEventListener(YN,R)},[]),P.jsx(gs.div,{...c,ref:p,style:{pointerEvents:w?x?"auto":"none":void 0,...t.style},onFocusCapture:Sd(t.onFocusCapture,T.onFocusCapture),onBlurCapture:Sd(t.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Sd(t.onPointerDownCapture,A.onPointerDownCapture)})});m8.displayName=S_e;var A_e="DismissableLayerBranch",R_e=_.forwardRef((t,e)=>{const n=_.useContext(p8),r=_.useRef(null),s=pp(e,r);return _.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),P.jsx(gs.div,{...t,ref:s})});R_e.displayName=A_e;function P_e(t,e=globalThis==null?void 0:globalThis.document){const n=qh(t),r=_.useRef(!1),s=_.useRef(()=>{});return _.useEffect(()=>{const i=o=>{if(o.target&&!r.current){let c=function(){g8(E_e,n,u,{discrete:!0})};const u={originalEvent:o};o.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},a=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function T_e(t,e=globalThis==null?void 0:globalThis.document){const n=qh(t),r=_.useRef(!1);return _.useEffect(()=>{const s=i=>{i.target&&!r.current&&g8(C_e,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 zB(){const t=new CustomEvent(YN);document.dispatchEvent(t)}function g8(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?__e(s,i):s.dispatchEvent(i)}var ST="focusScope.autoFocusOnMount",ET="focusScope.autoFocusOnUnmount",UB={bubbles:!1,cancelable:!0},k_e="FocusScope",v8=_.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=t,[o,c]=_.useState(null),u=qh(s),f=qh(i),l=_.useRef(null),d=pp(e,h=>c(h)),m=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let h=function(w){if(m.paused||!o)return;const x=w.target;o.contains(x)?l.current=x:_u(l.current,{select:!0})},y=function(w){if(m.paused||!o)return;const x=w.relatedTarget;x!==null&&(o.contains(x)||_u(l.current,{select:!0}))},g=function(w){if(document.activeElement===document.body)for(const A of w)A.removedNodes.length>0&&_u(o)};document.addEventListener("focusin",h),document.addEventListener("focusout",y);const v=new MutationObserver(g);return o&&v.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),v.disconnect()}}},[r,o,m.paused]),_.useEffect(()=>{if(o){VB.add(m);const h=document.activeElement;if(!o.contains(h)){const g=new CustomEvent(ST,UB);o.addEventListener(ST,u),o.dispatchEvent(g),g.defaultPrevented||(N_e(I_e(y8(o)),{select:!0}),document.activeElement===h&&_u(o))}return()=>{o.removeEventListener(ST,u),setTimeout(()=>{const g=new CustomEvent(ET,UB);o.addEventListener(ET,f),o.dispatchEvent(g),g.defaultPrevented||_u(h??document.body,{select:!0}),o.removeEventListener(ET,f),VB.remove(m)},0)}}},[o,u,f,m]);const p=_.useCallback(h=>{if(!n&&!r||m.paused)return;const y=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,g=document.activeElement;if(y&&g){const v=h.currentTarget,[w,x]=D_e(v);w&&x?!h.shiftKey&&g===x?(h.preventDefault(),n&&_u(w,{select:!0})):h.shiftKey&&g===w&&(h.preventDefault(),n&&_u(x,{select:!0})):g===v&&h.preventDefault()}},[n,r,m.paused]);return P.jsx(gs.div,{tabIndex:-1,...a,ref:d,onKeyDown:p})});v8.displayName=k_e;function N_e(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(_u(r,{select:e}),document.activeElement!==n)return}function D_e(t){const e=y8(t),n=HB(e,t),r=HB(e.reverse(),t);return[n,r]}function y8(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 HB(t,e){for(const n of t)if(!O_e(n,{upTo:e}))return n}function O_e(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 M_e(t){return t instanceof HTMLInputElement&&"select"in t}function _u(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&M_e(t)&&e&&t.select()}}var VB=L_e();function L_e(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=WB(t,e),t.unshift(e)},remove(e){var n;t=WB(t,e),(n=t[0])==null||n.resume()}}}function WB(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function I_e(t){return t.filter(e=>e.tagName!=="A")}var $_e="Portal",b8=_.forwardRef((t,e)=>{var o;const{container:n,...r}=t,[s,i]=_.useState(!1);uC(()=>i(!0),[]);const a=n||s&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?l_.createPortal(P.jsx(gs.div,{...r,ref:e}),a):null});b8.displayName=$_e;function F_e(t,e){return _.useReducer((n,r)=>e[n][r]??n,t)}var fA=t=>{const{present:e,children:n}=t,r=j_e(e),s=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),i=pp(r.ref,B_e(s));return typeof n=="function"||r.isPresent?_.cloneElement(s,{ref:i}):null};fA.displayName="Presence";function j_e(t){const[e,n]=_.useState(),r=_.useRef({}),s=_.useRef(t),i=_.useRef("none"),a=t?"mounted":"unmounted",[o,c]=F_e(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const u=uS(r.current);i.current=o==="mounted"?u:"none"},[o]),uC(()=>{const u=r.current,f=s.current;if(f!==t){const d=i.current,m=uS(u);t?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&d!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,c]),uC(()=>{if(e){let u;const f=e.ownerDocument.defaultView??window,l=m=>{const h=uS(r.current).includes(m.animationName);if(m.target===e&&h&&(c("ANIMATION_END"),!s.current)){const y=e.style.animationFillMode;e.style.animationFillMode="forwards",u=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=y)})}},d=m=>{m.target===e&&(i.current=uS(r.current))};return e.addEventListener("animationstart",d),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{f.clearTimeout(u),e.removeEventListener("animationstart",d),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:_.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function uS(t){return(t==null?void 0:t.animationName)||"none"}function B_e(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 CT=0;function z_e(){_.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??GB()),document.body.insertAdjacentElement("beforeend",t[1]??GB()),CT++,()=>{CT===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),CT--}},[])}function GB(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var w8=AL(),AT=function(){},hA=_.forwardRef(function(t,e){var n=_.useRef(null),r=_.useState({onScrollCapture:AT,onWheelCapture:AT,onTouchMoveCapture:AT}),s=r[0],i=r[1],a=t.forwardProps,o=t.children,c=t.className,u=t.removeScrollBar,f=t.enabled,l=t.shards,d=t.sideCar,m=t.noIsolation,p=t.inert,h=t.allowPinchZoom,y=t.as,g=y===void 0?"div":y,v=t.gapMode,w=K1(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=d,A=CL([n,e]),T=mr(mr({},w),s);return _.createElement(_.Fragment,null,f&&_.createElement(x,{sideCar:w8,removeScrollBar:u,shards:l,noIsolation:m,inert:p,setCallbacks:i,allowPinchZoom:!!h,lockRef:n,gapMode:v}),a?_.cloneElement(_.Children.only(o),mr(mr({},T),{ref:A})):_.createElement(g,mr({},T,{className:c,ref:A}),o))});hA.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};hA.classNames={fullWidth:zm,zeroRight:Bm};var XN=!1;if(typeof window<"u")try{var dS=Object.defineProperty({},"passive",{get:function(){return XN=!0,!0}});window.addEventListener("test",dS,dS),window.removeEventListener("test",dS,dS)}catch{XN=!1}var Wp=XN?{passive:!1}:!1,U_e=function(t){return t.tagName==="TEXTAREA"},_8=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!U_e(t)&&n[e]==="visible")},H_e=function(t){return _8(t,"overflowY")},V_e=function(t){return _8(t,"overflowX")},qB=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=x8(t,r);if(s){var i=S8(t,r),a=i[1],o=i[2];if(a>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},W_e=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},G_e=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},x8=function(t,e){return t==="v"?H_e(e):V_e(e)},S8=function(t,e){return t==="v"?W_e(e):G_e(e)},q_e=function(t,e){return t==="h"&&e==="rtl"?-1:1},K_e=function(t,e,n,r,s){var i=q_e(t,window.getComputedStyle(e).direction),a=i*r,o=n.target,c=e.contains(o),u=!1,f=a>0,l=0,d=0;do{var m=S8(t,o),p=m[0],h=m[1],y=m[2],g=h-y-i*p;(p||g)&&x8(t,o)&&(l+=g,d+=p),o instanceof ShadowRoot?o=o.host:o=o.parentNode}while(!c&&o!==document.body||c&&(e.contains(o)||e===o));return(f&&Math.abs(l)<1||!f&&Math.abs(d)<1)&&(u=!0),u},fS=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},KB=function(t){return[t.deltaX,t.deltaY]},YB=function(t){return t&&"current"in t?t.current:t},Y_e=function(t,e){return t[0]===e[0]&&t[1]===e[1]},X_e=function(t){return` +`)}}):null},Gwe=_.forwardRef(({active:t,payload:e,className:n,indicator:r="dot",hideLabel:s=!1,hideIndicator:i=!1,label:a,labelFormatter:o,labelClassName:c,formatter:u,color:f,nameKey:l,labelKey:d},m)=>{const{config:p}=a8(),h=_.useMemo(()=>{var A;if(s||!(e!=null&&e.length))return null;const[g]=e,v=`${d||g.dataKey||g.name||"value"}`,w=GN(p,g,v),x=!d&&typeof a=="string"?((A=p[a])==null?void 0:A.label)||a:w==null?void 0:w.label;return o?P.jsx("div",{className:le("font-medium",c),children:o(x,e)}):x?P.jsx("div",{className:le("font-medium",c),children:x}):null},[a,o,e,s,c,p,d]);if(!t||!(e!=null&&e.length))return null;const y=e.length===1&&r!=="dot";return P.jsxs("div",{ref:m,className:le("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:h,P.jsx("div",{className:"grid gap-1.5",children:e.map((g,v)=>{const w=`${l||g.name||g.dataKey||"value"}`,x=GN(p,g,w),A=f||g.payload.fill||g.color;return P.jsx("div",{className:le("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:u&&(g==null?void 0:g.value)!==void 0&&g.name?u(g.value,g.name,g,v,g.payload):P.jsxs(P.Fragment,{children:[x!=null&&x.icon?P.jsx(x.icon,{}):!i&&P.jsx("div",{className:le("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}}),P.jsxs("div",{className:le("flex flex-1 justify-between leading-none",y?"items-end":"items-center"),children:[P.jsxs("div",{className:"grid gap-1.5",children:[y?h:null,P.jsx("span",{className:"text-muted-foreground",children:(x==null?void 0:x.label)||g.name})]}),g.value&&P.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:g.value.toLocaleString()})]})]})},g.dataKey)})})]})});Gwe.displayName="ChartTooltip";const qwe=_.forwardRef(({className:t,hideIcon:e=!1,payload:n,verticalAlign:r="bottom",nameKey:s},i)=>{const{config:a}=a8();return n!=null&&n.length?P.jsx("div",{ref:i,className:le("flex items-center justify-center gap-4",r==="top"?"pb-3":"pt-3",t),children:n.map(o=>{const c=`${s||o.dataKey||"value"}`,u=GN(a,o,c);return P.jsxs("div",{className:le("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[u!=null&&u.icon&&!e?P.jsx(u.icon,{}):P.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:o.color}}),u==null?void 0:u.label]},o.value)})}):null});qwe.displayName="ChartLegend";function GN(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 Mv(t){const e=_.useRef({value:t,previous:t});return _.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function S_(t){const[e,n]=_.useState(void 0);return $n(()=>{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 a,o;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;a=u.inlineSize,o=u.blockSize}else a=t.offsetWidth,o=t.offsetHeight;n({width:a,height:o})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var aI="Checkbox",[Kwe,oUe]=Nn(aI),[Ywe,Xwe]=Kwe(aI),l8=_.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:i,required:a,disabled:o,value:c="on",onCheckedChange:u,...f}=t,[l,d]=_.useState(null),m=tt(e,w=>d(w)),p=_.useRef(!1),h=l?!!l.closest("form"):!0,[y=!1,g]=lr({prop:s,defaultProp:i,onChange:u}),v=_.useRef(y);return _.useEffect(()=>{const w=l==null?void 0:l.form;if(w){const x=()=>g(v.current);return w.addEventListener("reset",x),()=>w.removeEventListener("reset",x)}},[l,g]),P.jsxs(Ywe,{scope:n,state:y,disabled:o,children:[P.jsx(Ne.button,{type:"button",role:"checkbox","aria-checked":Oh(y)?"mixed":y,"aria-required":a,"data-state":d8(y),"data-disabled":o?"":void 0,disabled:o,value:c,...f,ref:m,onKeyDown:me(t.onKeyDown,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:me(t.onClick,w=>{g(x=>Oh(x)?!0:!x),h&&(p.current=w.isPropagationStopped(),p.current||w.stopPropagation())})}),h&&P.jsx(Qwe,{control:l,bubbles:!p.current,name:r,value:c,checked:y,required:a,disabled:o,style:{transform:"translateX(-100%)"}})]})});l8.displayName=aI;var c8="CheckboxIndicator",u8=_.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...s}=t,i=Xwe(c8,n);return P.jsx(Wn,{present:r||Oh(i.state)||i.state===!0,children:P.jsx(Ne.span,{"data-state":d8(i.state),"data-disabled":i.disabled?"":void 0,...s,ref:e,style:{pointerEvents:"none",...t.style}})})});u8.displayName=c8;var Qwe=t=>{const{control:e,checked:n,bubbles:r=!0,...s}=t,i=_.useRef(null),a=Mv(n),o=S_(e);return _.useEffect(()=>{const c=i.current,u=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(u,"checked").set;if(a!==n&&l){const d=new Event("click",{bubbles:r});c.indeterminate=Oh(n),l.call(c,Oh(n)?!1:n),c.dispatchEvent(d)}},[a,n,r]),P.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:Oh(n)?!1:n,...s,tabIndex:-1,ref:i,style:{...t.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Oh(t){return t==="indeterminate"}function d8(t){return Oh(t)?"indeterminate":t?"checked":"unchecked"}var f8=l8,Zwe=u8;const Jwe=_.forwardRef(({className:t,...e},n)=>P.jsx(f8,{ref:n,className:le("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:P.jsx(Zwe,{className:le("flex items-center justify-center text-current"),children:P.jsx(u_,{className:"h-4 w-4"})})}));Jwe.displayName=f8.displayName;var $B=1,e_e=.9,t_e=.8,n_e=.17,_T=.1,xT=.999,r_e=.9999,s_e=.99,i_e=/[\\\/_+.#"@\[\(\{&]/,o_e=/[\\\/_+.#"@\[\(\{&]/g,a_e=/[\s-]/,h8=/[\s-]/g;function qN(t,e,n,r,s,i,a){if(i===e.length)return s===t.length?$B:s_e;var o=`${s},${i}`;if(a[o]!==void 0)return a[o];for(var c=r.charAt(i),u=n.indexOf(c,s),f=0,l,d,m,p;u>=0;)l=qN(t,e,n,r,u+1,i+1,a),l>f&&(u===s?l*=$B:i_e.test(t.charAt(u-1))?(l*=t_e,m=t.slice(s,u-1).match(o_e),m&&s>0&&(l*=Math.pow(xT,m.length))):a_e.test(t.charAt(u-1))?(l*=e_e,p=t.slice(s,u-1).match(h8),p&&s>0&&(l*=Math.pow(xT,p.length))):(l*=n_e,s>0&&(l*=Math.pow(xT,u-s))),t.charAt(u)!==e.charAt(i)&&(l*=r_e)),(l<_T&&n.charAt(u-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(u-1)!==r.charAt(i))&&(d=qN(t,e,n,r,u+1,i+2,a),d*_T>l&&(l=d*_T)),l>f&&(f=l),u=n.indexOf(c,u+1);return a[o]=f,f}function FB(t){return t.toLowerCase().replace(h8," ")}function l_e(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,qN(t,e,FB(t),FB(e),0,0,{})}function Sd(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 jB(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Gh(...t){return e=>{let n=!1;const r=t.map(s=>{const i=jB(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s{const{children:a,...o}=i,c=_.useMemo(()=>o,Object.values(o));return P.jsx(n.Provider,{value:c,children:a})};r.displayName=t+"Provider";function s(i){const a=_.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[r,s]}function u_e(t,e=[]){let n=[];function r(i,a){const o=_.createContext(a),c=n.length;n=[...n,a];const u=l=>{var g;const{scope:d,children:m,...p}=l,h=((g=d==null?void 0:d[t])==null?void 0:g[c])||o,y=_.useMemo(()=>p,Object.values(p));return P.jsx(h.Provider,{value:y,children:m})};u.displayName=i+"Provider";function f(l,d){var h;const m=((h=d==null?void 0:d[t])==null?void 0:h[c])||o,p=_.useContext(m);if(p)return p;if(a!==void 0)return a;throw new Error(`\`${l}\` must be used within \`${i}\``)}return[u,f]}const s=()=>{const i=n.map(a=>_.createContext(a));return function(o){const c=(o==null?void 0:o[t])||i;return _.useMemo(()=>({[`__scope${t}`]:{...o,[t]:c}}),[o,c])}};return s.scopeName=t,[r,d_e(s,...e)]}function d_e(...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 a=r.reduce((o,{useScope:c,scopeName:u})=>{const l=c(i)[`__scope${u}`];return{...o,...l}},{});return _.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}const uC=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{},f_e=r_.useId||(()=>{});let h_e=0;function Oc(t){const[e,n]=_.useState(f_e());return uC(()=>{n(r=>r??String(h_e++))},[t]),e?`radix-${e}`:""}function qh(t){const e=_.useRef(t);return _.useEffect(()=>{e.current=t}),_.useMemo(()=>(...n)=>{var r;return(r=e.current)===null||r===void 0?void 0:r.call(e,...n)},[])}function p_e({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,s]=m_e({defaultProp:e,onChange:n}),i=t!==void 0,a=i?t:r,o=qh(n),c=_.useCallback(u=>{if(i){const l=typeof u=="function"?u(t):u;l!==t&&o(l)}else s(u)},[i,t,s,o]);return[a,c]}function m_e({defaultProp:t,onChange:e}){const n=_.useState(t),[r]=n,s=_.useRef(r),i=qh(e);return _.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}var lI=_.forwardRef((t,e)=>{const{children:n,...r}=t,s=_.Children.toArray(n),i=s.find(v_e);if(i){const a=i.props.children,o=s.map(c=>c===i?_.Children.count(a)>1?_.Children.only(null):_.isValidElement(a)?a.props.children:null:c);return P.jsx(KN,{...r,ref:e,children:_.isValidElement(a)?_.cloneElement(a,void 0,o):null})}return P.jsx(KN,{...r,ref:e,children:n})});lI.displayName="Slot";var KN=_.forwardRef((t,e)=>{const{children:n,...r}=t;if(_.isValidElement(n)){const s=b_e(n),i=y_e(r,n.props);return n.type!==_.Fragment&&(i.ref=e?Gh(e,s):s),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});KN.displayName="SlotClone";var g_e=({children:t})=>P.jsx(P.Fragment,{children:t});function v_e(t){return _.isValidElement(t)&&t.type===g_e}function y_e(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]=(...o)=>{i(...o),s(...o)}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function b_e(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 w_e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],gs=w_e.reduce((t,e)=>{const n=_.forwardRef((r,s)=>{const{asChild:i,...a}=r,o=i?lI:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(o,{...a,ref:s})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function __e(t,e){t&&Ms.flushSync(()=>t.dispatchEvent(e))}function x_e(t,e=globalThis==null?void 0:globalThis.document){const n=qh(t);_.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",r),()=>e.removeEventListener("keydown",r)},[n,e])}var S_e="DismissableLayer",YN="dismissableLayer.update",E_e="dismissableLayer.pointerDownOutside",C_e="dismissableLayer.focusOutside",BB,p8=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),m8=_.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,onDismiss:o,...c}=t,u=_.useContext(p8),[f,l]=_.useState(null),d=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=_.useState({}),p=pp(e,R=>l(R)),h=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=h.indexOf(y),v=f?h.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,x=v>=g,A=P_e(R=>{const E=R.target,k=[...u.branches].some(N=>N.contains(E));!x||k||(s==null||s(R),a==null||a(R),R.defaultPrevented||o==null||o())},d),T=T_e(R=>{const E=R.target;[...u.branches].some(N=>N.contains(E))||(i==null||i(R),a==null||a(R),R.defaultPrevented||o==null||o())},d);return x_e(R=>{v===u.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&o&&(R.preventDefault(),o()))},d),_.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(BB=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),zB(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=BB)}},[f,d,n,u]),_.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),zB())},[f,u]),_.useEffect(()=>{const R=()=>m({});return document.addEventListener(YN,R),()=>document.removeEventListener(YN,R)},[]),P.jsx(gs.div,{...c,ref:p,style:{pointerEvents:w?x?"auto":"none":void 0,...t.style},onFocusCapture:Sd(t.onFocusCapture,T.onFocusCapture),onBlurCapture:Sd(t.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Sd(t.onPointerDownCapture,A.onPointerDownCapture)})});m8.displayName=S_e;var A_e="DismissableLayerBranch",R_e=_.forwardRef((t,e)=>{const n=_.useContext(p8),r=_.useRef(null),s=pp(e,r);return _.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),P.jsx(gs.div,{...t,ref:s})});R_e.displayName=A_e;function P_e(t,e=globalThis==null?void 0:globalThis.document){const n=qh(t),r=_.useRef(!1),s=_.useRef(()=>{});return _.useEffect(()=>{const i=o=>{if(o.target&&!r.current){let c=function(){g8(E_e,n,u,{discrete:!0})};const u={originalEvent:o};o.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},a=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function T_e(t,e=globalThis==null?void 0:globalThis.document){const n=qh(t),r=_.useRef(!1);return _.useEffect(()=>{const s=i=>{i.target&&!r.current&&g8(C_e,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 zB(){const t=new CustomEvent(YN);document.dispatchEvent(t)}function g8(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?__e(s,i):s.dispatchEvent(i)}var ST="focusScope.autoFocusOnMount",ET="focusScope.autoFocusOnUnmount",UB={bubbles:!1,cancelable:!0},k_e="FocusScope",v8=_.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=t,[o,c]=_.useState(null),u=qh(s),f=qh(i),l=_.useRef(null),d=pp(e,h=>c(h)),m=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let h=function(w){if(m.paused||!o)return;const x=w.target;o.contains(x)?l.current=x:_u(l.current,{select:!0})},y=function(w){if(m.paused||!o)return;const x=w.relatedTarget;x!==null&&(o.contains(x)||_u(l.current,{select:!0}))},g=function(w){if(document.activeElement===document.body)for(const A of w)A.removedNodes.length>0&&_u(o)};document.addEventListener("focusin",h),document.addEventListener("focusout",y);const v=new MutationObserver(g);return o&&v.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),v.disconnect()}}},[r,o,m.paused]),_.useEffect(()=>{if(o){VB.add(m);const h=document.activeElement;if(!o.contains(h)){const g=new CustomEvent(ST,UB);o.addEventListener(ST,u),o.dispatchEvent(g),g.defaultPrevented||(N_e(I_e(y8(o)),{select:!0}),document.activeElement===h&&_u(o))}return()=>{o.removeEventListener(ST,u),setTimeout(()=>{const g=new CustomEvent(ET,UB);o.addEventListener(ET,f),o.dispatchEvent(g),g.defaultPrevented||_u(h??document.body,{select:!0}),o.removeEventListener(ET,f),VB.remove(m)},0)}}},[o,u,f,m]);const p=_.useCallback(h=>{if(!n&&!r||m.paused)return;const y=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,g=document.activeElement;if(y&&g){const v=h.currentTarget,[w,x]=D_e(v);w&&x?!h.shiftKey&&g===x?(h.preventDefault(),n&&_u(w,{select:!0})):h.shiftKey&&g===w&&(h.preventDefault(),n&&_u(x,{select:!0})):g===v&&h.preventDefault()}},[n,r,m.paused]);return P.jsx(gs.div,{tabIndex:-1,...a,ref:d,onKeyDown:p})});v8.displayName=k_e;function N_e(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(_u(r,{select:e}),document.activeElement!==n)return}function D_e(t){const e=y8(t),n=HB(e,t),r=HB(e.reverse(),t);return[n,r]}function y8(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 HB(t,e){for(const n of t)if(!O_e(n,{upTo:e}))return n}function O_e(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 M_e(t){return t instanceof HTMLInputElement&&"select"in t}function _u(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&M_e(t)&&e&&t.select()}}var VB=L_e();function L_e(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=WB(t,e),t.unshift(e)},remove(e){var n;t=WB(t,e),(n=t[0])==null||n.resume()}}}function WB(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function I_e(t){return t.filter(e=>e.tagName!=="A")}var $_e="Portal",b8=_.forwardRef((t,e)=>{var o;const{container:n,...r}=t,[s,i]=_.useState(!1);uC(()=>i(!0),[]);const a=n||s&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?l_.createPortal(P.jsx(gs.div,{...r,ref:e}),a):null});b8.displayName=$_e;function F_e(t,e){return _.useReducer((n,r)=>e[n][r]??n,t)}var fA=t=>{const{present:e,children:n}=t,r=j_e(e),s=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),i=pp(r.ref,B_e(s));return typeof n=="function"||r.isPresent?_.cloneElement(s,{ref:i}):null};fA.displayName="Presence";function j_e(t){const[e,n]=_.useState(),r=_.useRef({}),s=_.useRef(t),i=_.useRef("none"),a=t?"mounted":"unmounted",[o,c]=F_e(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const u=uS(r.current);i.current=o==="mounted"?u:"none"},[o]),uC(()=>{const u=r.current,f=s.current;if(f!==t){const d=i.current,m=uS(u);t?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&d!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,c]),uC(()=>{if(e){let u;const f=e.ownerDocument.defaultView??window,l=m=>{const h=uS(r.current).includes(m.animationName);if(m.target===e&&h&&(c("ANIMATION_END"),!s.current)){const y=e.style.animationFillMode;e.style.animationFillMode="forwards",u=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=y)})}},d=m=>{m.target===e&&(i.current=uS(r.current))};return e.addEventListener("animationstart",d),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{f.clearTimeout(u),e.removeEventListener("animationstart",d),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:_.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function uS(t){return(t==null?void 0:t.animationName)||"none"}function B_e(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 CT=0;function z_e(){_.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??GB()),document.body.insertAdjacentElement("beforeend",t[1]??GB()),CT++,()=>{CT===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),CT--}},[])}function GB(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var w8=AL(),AT=function(){},hA=_.forwardRef(function(t,e){var n=_.useRef(null),r=_.useState({onScrollCapture:AT,onWheelCapture:AT,onTouchMoveCapture:AT}),s=r[0],i=r[1],a=t.forwardProps,o=t.children,c=t.className,u=t.removeScrollBar,f=t.enabled,l=t.shards,d=t.sideCar,m=t.noIsolation,p=t.inert,h=t.allowPinchZoom,y=t.as,g=y===void 0?"div":y,v=t.gapMode,w=K1(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=d,A=CL([n,e]),T=mr(mr({},w),s);return _.createElement(_.Fragment,null,f&&_.createElement(x,{sideCar:w8,removeScrollBar:u,shards:l,noIsolation:m,inert:p,setCallbacks:i,allowPinchZoom:!!h,lockRef:n,gapMode:v}),a?_.cloneElement(_.Children.only(o),mr(mr({},T),{ref:A})):_.createElement(g,mr({},T,{className:c,ref:A}),o))});hA.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};hA.classNames={fullWidth:zm,zeroRight:Bm};var XN=!1;if(typeof window<"u")try{var dS=Object.defineProperty({},"passive",{get:function(){return XN=!0,!0}});window.addEventListener("test",dS,dS),window.removeEventListener("test",dS,dS)}catch{XN=!1}var Wp=XN?{passive:!1}:!1,U_e=function(t){return t.tagName==="TEXTAREA"},_8=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!U_e(t)&&n[e]==="visible")},H_e=function(t){return _8(t,"overflowY")},V_e=function(t){return _8(t,"overflowX")},qB=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=x8(t,r);if(s){var i=S8(t,r),a=i[1],o=i[2];if(a>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},W_e=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},G_e=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},x8=function(t,e){return t==="v"?H_e(e):V_e(e)},S8=function(t,e){return t==="v"?W_e(e):G_e(e)},q_e=function(t,e){return t==="h"&&e==="rtl"?-1:1},K_e=function(t,e,n,r,s){var i=q_e(t,window.getComputedStyle(e).direction),a=i*r,o=n.target,c=e.contains(o),u=!1,f=a>0,l=0,d=0;do{var m=S8(t,o),p=m[0],h=m[1],y=m[2],g=h-y-i*p;(p||g)&&x8(t,o)&&(l+=g,d+=p),o instanceof ShadowRoot?o=o.host:o=o.parentNode}while(!c&&o!==document.body||c&&(e.contains(o)||e===o));return(f&&Math.abs(l)<1||!f&&Math.abs(d)<1)&&(u=!0),u},fS=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},KB=function(t){return[t.deltaX,t.deltaY]},YB=function(t){return t&&"current"in t?t.current:t},Y_e=function(t,e){return t[0]===e[0]&&t[1]===e[1]},X_e=function(t){return` .block-interactivity-`.concat(t,` {pointer-events: none;} .allow-interactivity-`).concat(t,` {pointer-events: all;} -`)},Q_e=0,Gp=[];function Z_e(t){var e=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),s=_.useState(Q_e++)[0],i=_.useState(X1)[0],a=_.useRef(t);_.useEffect(function(){a.current=t},[t]),_.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var h=EL([t.lockRef.current],(t.shards||[]).map(YB),!0).filter(Boolean);return h.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),h.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var o=_.useCallback(function(h,y){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!a.current.allowPinchZoom;var g=fS(h),v=n.current,w="deltaX"in h?h.deltaX:v[0]-g[0],x="deltaY"in h?h.deltaY:v[1]-g[1],A,T=h.target,R=Math.abs(w)>Math.abs(x)?"h":"v";if("touches"in h&&R==="h"&&T.type==="range")return!1;var E=qB(R,T);if(!E)return!0;if(E?A=R:(A=R==="v"?"h":"v",E=qB(R,T)),!E)return!1;if(!r.current&&"changedTouches"in h&&(w||x)&&(r.current=A),!A)return!0;var k=r.current||A;return K_e(k,y,h,k==="h"?w:x)},[]),c=_.useCallback(function(h){var y=h;if(!(!Gp.length||Gp[Gp.length-1]!==i)){var g="deltaY"in y?KB(y):fS(y),v=e.current.filter(function(A){return A.name===y.type&&(A.target===y.target||y.target===A.shadowParent)&&Y_e(A.delta,g)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var w=(a.current.shards||[]).map(YB).filter(Boolean).filter(function(A){return A.contains(y.target)}),x=w.length>0?o(y,w[0]):!a.current.noIsolation;x&&y.cancelable&&y.preventDefault()}}},[]),u=_.useCallback(function(h,y,g,v){var w={name:h,delta:y,target:g,should:v,shadowParent:J_e(g)};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(x){return x!==w})},1)},[]),f=_.useCallback(function(h){n.current=fS(h),r.current=void 0},[]),l=_.useCallback(function(h){u(h.type,KB(h),h.target,o(h,t.lockRef.current))},[]),d=_.useCallback(function(h){u(h.type,fS(h),h.target,o(h,t.lockRef.current))},[]);_.useEffect(function(){return Gp.push(i),t.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:d}),document.addEventListener("wheel",c,Wp),document.addEventListener("touchmove",c,Wp),document.addEventListener("touchstart",f,Wp),function(){Gp=Gp.filter(function(h){return h!==i}),document.removeEventListener("wheel",c,Wp),document.removeEventListener("touchmove",c,Wp),document.removeEventListener("touchstart",f,Wp)}},[]);var m=t.removeScrollBar,p=t.inert;return _.createElement(_.Fragment,null,p?_.createElement(i,{styles:X_e(s)}):null,m?_.createElement(PL,{gapMode:t.gapMode}):null)}function J_e(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const exe=RL(w8,Z_e);var E8=_.forwardRef(function(t,e){return _.createElement(hA,mr({},t,{ref:e,sideCar:exe}))});E8.classNames=hA.classNames;var cI="Dialog",[C8,lUe]=u_e(cI),[txe,Ma]=C8(cI),A8=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,o=_.useRef(null),c=_.useRef(null),[u=!1,f]=p_e({prop:r,defaultProp:s,onChange:i});return P.jsx(txe,{scope:e,triggerRef:o,contentRef:c,contentId:Oc(),titleId:Oc(),descriptionId:Oc(),open:u,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(l=>!l),[f]),modal:a,children:n})};A8.displayName=cI;var R8="DialogTrigger",nxe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ma(R8,n),i=pp(e,s.triggerRef);return P.jsx(gs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":fI(s.open),...r,ref:i,onClick:Sd(t.onClick,s.onOpenToggle)})});nxe.displayName=R8;var uI="DialogPortal",[rxe,P8]=C8(uI,{forceMount:void 0}),T8=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=Ma(uI,e);return P.jsx(rxe,{scope:e,forceMount:n,children:_.Children.map(r,a=>P.jsx(fA,{present:n||i.open,children:P.jsx(b8,{asChild:!0,container:s,children:a})}))})};T8.displayName=uI;var dC="DialogOverlay",k8=_.forwardRef((t,e)=>{const n=P8(dC,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Ma(dC,t.__scopeDialog);return i.modal?P.jsx(fA,{present:r||i.open,children:P.jsx(sxe,{...s,ref:e})}):null});k8.displayName=dC;var sxe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ma(dC,n);return P.jsx(E8,{as:lI,allowPinchZoom:!0,shards:[s.contentRef],children:P.jsx(gs.div,{"data-state":fI(s.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Kh="DialogContent",N8=_.forwardRef((t,e)=>{const n=P8(Kh,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Ma(Kh,t.__scopeDialog);return P.jsx(fA,{present:r||i.open,children:i.modal?P.jsx(ixe,{...s,ref:e}):P.jsx(oxe,{...s,ref:e})})});N8.displayName=Kh;var ixe=_.forwardRef((t,e)=>{const n=Ma(Kh,t.__scopeDialog),r=_.useRef(null),s=pp(e,n.contentRef,r);return _.useEffect(()=>{const i=r.current;if(i)return Tv(i)},[]),P.jsx(D8,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Sd(t.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Sd(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&i.preventDefault()}),onFocusOutside:Sd(t.onFocusOutside,i=>i.preventDefault())})}),oxe=_.forwardRef((t,e)=>{const n=Ma(Kh,t.__scopeDialog),r=_.useRef(!1),s=_.useRef(!1);return P.jsx(D8,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,o;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),D8=_.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=t,o=Ma(Kh,n),c=_.useRef(null),u=pp(e,c);return z_e(),P.jsxs(P.Fragment,{children:[P.jsx(v8,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:P.jsx(m8,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":fI(o.open),...a,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),P.jsxs(P.Fragment,{children:[P.jsx(uxe,{titleId:o.titleId}),P.jsx(fxe,{contentRef:c,descriptionId:o.descriptionId})]})]})}),dI="DialogTitle",axe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ma(dI,n);return P.jsx(gs.h2,{id:s.titleId,...r,ref:e})});axe.displayName=dI;var O8="DialogDescription",lxe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ma(O8,n);return P.jsx(gs.p,{id:s.descriptionId,...r,ref:e})});lxe.displayName=O8;var M8="DialogClose",cxe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ma(M8,n);return P.jsx(gs.button,{type:"button",...r,ref:e,onClick:Sd(t.onClick,()=>s.onOpenChange(!1))})});cxe.displayName=M8;function fI(t){return t?"open":"closed"}var L8="DialogTitleWarning",[cUe,I8]=c_e(L8,{contentName:Kh,titleName:dI,docsSlug:"dialog"}),uxe=({titleId:t})=>{const e=I8(L8),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. +`)},Q_e=0,Gp=[];function Z_e(t){var e=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),s=_.useState(Q_e++)[0],i=_.useState(X1)[0],a=_.useRef(t);_.useEffect(function(){a.current=t},[t]),_.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var h=EL([t.lockRef.current],(t.shards||[]).map(YB),!0).filter(Boolean);return h.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),h.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var o=_.useCallback(function(h,y){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!a.current.allowPinchZoom;var g=fS(h),v=n.current,w="deltaX"in h?h.deltaX:v[0]-g[0],x="deltaY"in h?h.deltaY:v[1]-g[1],A,T=h.target,R=Math.abs(w)>Math.abs(x)?"h":"v";if("touches"in h&&R==="h"&&T.type==="range")return!1;var E=qB(R,T);if(!E)return!0;if(E?A=R:(A=R==="v"?"h":"v",E=qB(R,T)),!E)return!1;if(!r.current&&"changedTouches"in h&&(w||x)&&(r.current=A),!A)return!0;var k=r.current||A;return K_e(k,y,h,k==="h"?w:x)},[]),c=_.useCallback(function(h){var y=h;if(!(!Gp.length||Gp[Gp.length-1]!==i)){var g="deltaY"in y?KB(y):fS(y),v=e.current.filter(function(A){return A.name===y.type&&(A.target===y.target||y.target===A.shadowParent)&&Y_e(A.delta,g)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var w=(a.current.shards||[]).map(YB).filter(Boolean).filter(function(A){return A.contains(y.target)}),x=w.length>0?o(y,w[0]):!a.current.noIsolation;x&&y.cancelable&&y.preventDefault()}}},[]),u=_.useCallback(function(h,y,g,v){var w={name:h,delta:y,target:g,should:v,shadowParent:J_e(g)};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(x){return x!==w})},1)},[]),f=_.useCallback(function(h){n.current=fS(h),r.current=void 0},[]),l=_.useCallback(function(h){u(h.type,KB(h),h.target,o(h,t.lockRef.current))},[]),d=_.useCallback(function(h){u(h.type,fS(h),h.target,o(h,t.lockRef.current))},[]);_.useEffect(function(){return Gp.push(i),t.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:d}),document.addEventListener("wheel",c,Wp),document.addEventListener("touchmove",c,Wp),document.addEventListener("touchstart",f,Wp),function(){Gp=Gp.filter(function(h){return h!==i}),document.removeEventListener("wheel",c,Wp),document.removeEventListener("touchmove",c,Wp),document.removeEventListener("touchstart",f,Wp)}},[]);var m=t.removeScrollBar,p=t.inert;return _.createElement(_.Fragment,null,p?_.createElement(i,{styles:X_e(s)}):null,m?_.createElement(PL,{gapMode:t.gapMode}):null)}function J_e(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const exe=RL(w8,Z_e);var E8=_.forwardRef(function(t,e){return _.createElement(hA,mr({},t,{ref:e,sideCar:exe}))});E8.classNames=hA.classNames;var cI="Dialog",[C8,aUe]=u_e(cI),[txe,Ma]=C8(cI),A8=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,o=_.useRef(null),c=_.useRef(null),[u=!1,f]=p_e({prop:r,defaultProp:s,onChange:i});return P.jsx(txe,{scope:e,triggerRef:o,contentRef:c,contentId:Oc(),titleId:Oc(),descriptionId:Oc(),open:u,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(l=>!l),[f]),modal:a,children:n})};A8.displayName=cI;var R8="DialogTrigger",nxe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ma(R8,n),i=pp(e,s.triggerRef);return P.jsx(gs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":fI(s.open),...r,ref:i,onClick:Sd(t.onClick,s.onOpenToggle)})});nxe.displayName=R8;var uI="DialogPortal",[rxe,P8]=C8(uI,{forceMount:void 0}),T8=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=Ma(uI,e);return P.jsx(rxe,{scope:e,forceMount:n,children:_.Children.map(r,a=>P.jsx(fA,{present:n||i.open,children:P.jsx(b8,{asChild:!0,container:s,children:a})}))})};T8.displayName=uI;var dC="DialogOverlay",k8=_.forwardRef((t,e)=>{const n=P8(dC,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Ma(dC,t.__scopeDialog);return i.modal?P.jsx(fA,{present:r||i.open,children:P.jsx(sxe,{...s,ref:e})}):null});k8.displayName=dC;var sxe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ma(dC,n);return P.jsx(E8,{as:lI,allowPinchZoom:!0,shards:[s.contentRef],children:P.jsx(gs.div,{"data-state":fI(s.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Kh="DialogContent",N8=_.forwardRef((t,e)=>{const n=P8(Kh,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Ma(Kh,t.__scopeDialog);return P.jsx(fA,{present:r||i.open,children:i.modal?P.jsx(ixe,{...s,ref:e}):P.jsx(oxe,{...s,ref:e})})});N8.displayName=Kh;var ixe=_.forwardRef((t,e)=>{const n=Ma(Kh,t.__scopeDialog),r=_.useRef(null),s=pp(e,n.contentRef,r);return _.useEffect(()=>{const i=r.current;if(i)return Tv(i)},[]),P.jsx(D8,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Sd(t.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Sd(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&i.preventDefault()}),onFocusOutside:Sd(t.onFocusOutside,i=>i.preventDefault())})}),oxe=_.forwardRef((t,e)=>{const n=Ma(Kh,t.__scopeDialog),r=_.useRef(!1),s=_.useRef(!1);return P.jsx(D8,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,o;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),D8=_.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=t,o=Ma(Kh,n),c=_.useRef(null),u=pp(e,c);return z_e(),P.jsxs(P.Fragment,{children:[P.jsx(v8,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:P.jsx(m8,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":fI(o.open),...a,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),P.jsxs(P.Fragment,{children:[P.jsx(uxe,{titleId:o.titleId}),P.jsx(fxe,{contentRef:c,descriptionId:o.descriptionId})]})]})}),dI="DialogTitle",axe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ma(dI,n);return P.jsx(gs.h2,{id:s.titleId,...r,ref:e})});axe.displayName=dI;var O8="DialogDescription",lxe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ma(O8,n);return P.jsx(gs.p,{id:s.descriptionId,...r,ref:e})});lxe.displayName=O8;var M8="DialogClose",cxe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ma(M8,n);return P.jsx(gs.button,{type:"button",...r,ref:e,onClick:Sd(t.onClick,()=>s.onOpenChange(!1))})});cxe.displayName=M8;function fI(t){return t?"open":"closed"}var L8="DialogTitleWarning",[lUe,I8]=c_e(L8,{contentName:Kh,titleName:dI,docsSlug:"dialog"}),uxe=({titleId:t})=>{const e=I8(L8),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 _.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},dxe="DialogDescriptionWarning",fxe=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${I8(dxe).contentName}}.`;return _.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},hxe=A8,pxe=T8,mxe=k8,gxe=N8,Ry='[cmdk-group=""]',RT='[cmdk-group-items=""]',vxe='[cmdk-group-heading=""]',$8='[cmdk-item=""]',XB=`${$8}:not([aria-disabled="true"])`,QN="cmdk-item-select",im="data-value",yxe=(t,e,n)=>l_e(t,e,n),F8=_.createContext(void 0),E_=()=>_.useContext(F8),j8=_.createContext(void 0),hI=()=>_.useContext(j8),B8=_.createContext(void 0),z8=_.forwardRef((t,e)=>{let n=om(()=>{var q,K;return{search:"",value:(K=(q=t.value)!=null?q:t.defaultValue)!=null?K:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=om(()=>new Set),s=om(()=>new Map),i=om(()=>new Map),a=om(()=>new Set),o=U8(t),{label:c,children:u,value:f,onValueChange:l,filter:d,shouldFilter:m,loop:p,disablePointerSelection:h=!1,vimBindings:y=!0,...g}=t,v=Oc(),w=Oc(),x=Oc(),A=_.useRef(null),T=Txe();Yh(()=>{if(f!==void 0){let q=f.trim();n.current.value=q,R.emit()}},[f]),Yh(()=>{T(6,I)},[]);let R=_.useMemo(()=>({subscribe:q=>(a.current.add(q),()=>a.current.delete(q)),snapshot:()=>n.current,setState:(q,K,Z)=>{var ue,de,ie,be;if(!Object.is(n.current[q],K)){if(n.current[q]=K,q==="search")L(),N(),T(1,O);else if(q==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Ae=document.getElementById(x);Ae?Ae.focus():(ue=document.getElementById(v))==null||ue.focus()}if(T(7,()=>{var Ae;n.current.selectedItemId=(Ae=F())==null?void 0:Ae.id,R.emit()}),Z||T(5,I),((de=o.current)==null?void 0:de.value)!==void 0){let Ae=K??"";(be=(ie=o.current).onValueChange)==null||be.call(ie,Ae);return}}R.emit()}},emit:()=>{a.current.forEach(q=>q())}}),[]),E=_.useMemo(()=>({value:(q,K,Z)=>{var ue;K!==((ue=i.current.get(q))==null?void 0:ue.value)&&(i.current.set(q,{value:K,keywords:Z}),n.current.filtered.items.set(q,k(K,Z)),T(2,()=>{N(),R.emit()}))},item:(q,K)=>(r.current.add(q),K&&(s.current.has(K)?s.current.get(K).add(q):s.current.set(K,new Set([q]))),T(3,()=>{L(),N(),n.current.value||O(),R.emit()}),()=>{i.current.delete(q),r.current.delete(q),n.current.filtered.items.delete(q);let Z=F();T(4,()=>{L(),(Z==null?void 0:Z.getAttribute("id"))===q&&O(),R.emit()})}),group:q=>(s.current.has(q)||s.current.set(q,new Set),()=>{i.current.delete(q),s.current.delete(q)}),filter:()=>o.current.shouldFilter,label:c||t["aria-label"],getDisablePointerSelection:()=>o.current.disablePointerSelection,listId:v,inputId:x,labelId:w,listInnerRef:A}),[]);function k(q,K){var Z,ue;let de=(ue=(Z=o.current)==null?void 0:Z.filter)!=null?ue:yxe;return q?de(q,n.current.search,K):0}function N(){if(!n.current.search||o.current.shouldFilter===!1)return;let q=n.current.filtered.items,K=[];n.current.filtered.groups.forEach(ue=>{let de=s.current.get(ue),ie=0;de.forEach(be=>{let Ae=q.get(be);ie=Math.max(Ae,ie)}),K.push([ue,ie])});let Z=A.current;U().sort((ue,de)=>{var ie,be;let Ae=ue.getAttribute("id"),_e=de.getAttribute("id");return((ie=q.get(_e))!=null?ie:0)-((be=q.get(Ae))!=null?be:0)}).forEach(ue=>{let de=ue.closest(RT);de?de.appendChild(ue.parentElement===de?ue:ue.closest(`${RT} > *`)):Z.appendChild(ue.parentElement===Z?ue:ue.closest(`${RT} > *`))}),K.sort((ue,de)=>de[1]-ue[1]).forEach(ue=>{var de;let ie=(de=A.current)==null?void 0:de.querySelector(`${Ry}[${im}="${encodeURIComponent(ue[0])}"]`);ie==null||ie.parentElement.appendChild(ie)})}function O(){let q=U().find(Z=>Z.getAttribute("aria-disabled")!=="true"),K=q==null?void 0:q.getAttribute(im);R.setState("value",K||void 0)}function L(){var q,K,Z,ue;if(!n.current.search||o.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let de=0;for(let ie of r.current){let be=(K=(q=i.current.get(ie))==null?void 0:q.value)!=null?K:"",Ae=(ue=(Z=i.current.get(ie))==null?void 0:Z.keywords)!=null?ue:[],_e=k(be,Ae);n.current.filtered.items.set(ie,_e),_e>0&&de++}for(let[ie,be]of s.current)for(let Ae of be)if(n.current.filtered.items.get(Ae)>0){n.current.filtered.groups.add(ie);break}n.current.filtered.count=de}function I(){var q,K,Z;let ue=F();ue&&(((q=ue.parentElement)==null?void 0:q.firstChild)===ue&&((Z=(K=ue.closest(Ry))==null?void 0:K.querySelector(vxe))==null||Z.scrollIntoView({block:"nearest"})),ue.scrollIntoView({block:"nearest"}))}function F(){var q;return(q=A.current)==null?void 0:q.querySelector(`${$8}[aria-selected="true"]`)}function U(){var q;return Array.from(((q=A.current)==null?void 0:q.querySelectorAll(XB))||[])}function Y(q){let K=U()[q];K&&R.setState("value",K.getAttribute(im))}function V(q){var K;let Z=F(),ue=U(),de=ue.findIndex(be=>be===Z),ie=ue[de+q];(K=o.current)!=null&&K.loop&&(ie=de+q<0?ue[ue.length-1]:de+q===ue.length?ue[0]:ue[de+q]),ie&&R.setState("value",ie.getAttribute(im))}function H(q){let K=F(),Z=K==null?void 0:K.closest(Ry),ue;for(;Z&&!ue;)Z=q>0?Rxe(Z,Ry):Pxe(Z,Ry),ue=Z==null?void 0:Z.querySelector(XB);ue?R.setState("value",ue.getAttribute(im)):V(q)}let ee=()=>Y(U().length-1),re=q=>{q.preventDefault(),q.metaKey?ee():q.altKey?H(1):V(1)},X=q=>{q.preventDefault(),q.metaKey?Y(0):q.altKey?H(-1):V(-1)};return _.createElement(gs.div,{ref:e,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:q=>{var K;(K=g.onKeyDown)==null||K.call(g,q);let Z=q.nativeEvent.isComposing||q.keyCode===229;if(!(q.defaultPrevented||Z))switch(q.key){case"n":case"j":{y&&q.ctrlKey&&re(q);break}case"ArrowDown":{re(q);break}case"p":case"k":{y&&q.ctrlKey&&X(q);break}case"ArrowUp":{X(q);break}case"Home":{q.preventDefault(),Y(0);break}case"End":{q.preventDefault(),ee();break}case"Enter":{q.preventDefault();let ue=F();if(ue){let de=new Event(QN);ue.dispatchEvent(de)}}}}},_.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:Nxe},c),pA(t,q=>_.createElement(j8.Provider,{value:R},_.createElement(F8.Provider,{value:E},q))))}),bxe=_.forwardRef((t,e)=>{var n,r;let s=Oc(),i=_.useRef(null),a=_.useContext(B8),o=E_(),c=U8(t),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:a==null?void 0:a.forceMount;Yh(()=>{if(!u)return o.item(s,a==null?void 0:a.id)},[u]);let f=H8(s,i,[t.value,t.children,i],t.keywords),l=hI(),d=Rd(T=>T.value&&T.value===f.current),m=Rd(T=>u||o.filter()===!1?!0:T.search?T.filtered.items.get(s)>0:!0);_.useEffect(()=>{let T=i.current;if(!(!T||t.disabled))return T.addEventListener(QN,p),()=>T.removeEventListener(QN,p)},[m,t.onSelect,t.disabled]);function p(){var T,R;h(),(R=(T=c.current).onSelect)==null||R.call(T,f.current)}function h(){l.setState("value",f.current,!0)}if(!m)return null;let{disabled:y,value:g,onSelect:v,forceMount:w,keywords:x,...A}=t;return _.createElement(gs.div,{ref:Gh(i,e),...A,id:s,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!d,"data-disabled":!!y,"data-selected":!!d,onPointerMove:y||o.getDisablePointerSelection()?void 0:h,onClick:y?void 0:p},t.children)}),wxe=_.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:s,...i}=t,a=Oc(),o=_.useRef(null),c=_.useRef(null),u=Oc(),f=E_(),l=Rd(m=>s||f.filter()===!1?!0:m.search?m.filtered.groups.has(a):!0);Yh(()=>f.group(a),[]),H8(a,o,[t.value,t.heading,c]);let d=_.useMemo(()=>({id:a,forceMount:s}),[s]);return _.createElement(gs.div,{ref:Gh(o,e),...i,"cmdk-group":"",role:"presentation",hidden:l?void 0:!0},n&&_.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),pA(t,m=>_.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},_.createElement(B8.Provider,{value:d},m))))}),_xe=_.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,s=_.useRef(null),i=Rd(a=>!a.search);return!n&&!i?null:_.createElement(gs.div,{ref:Gh(s,e),...r,"cmdk-separator":"",role:"separator"})}),xxe=_.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,s=t.value!=null,i=hI(),a=Rd(u=>u.search),o=Rd(u=>u.selectedItemId),c=E_();return _.useEffect(()=>{t.value!=null&&i.setState("search",t.value)},[t.value]),_.createElement(gs.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":o,id:c.inputId,type:"text",value:s?t.value:a,onChange:u=>{s||i.setState("search",u.target.value),n==null||n(u.target.value)}})}),Sxe=_.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...s}=t,i=_.useRef(null),a=_.useRef(null),o=Rd(u=>u.selectedItemId),c=E_();return _.useEffect(()=>{if(a.current&&i.current){let u=a.current,f=i.current,l,d=new ResizeObserver(()=>{l=requestAnimationFrame(()=>{let m=u.offsetHeight;f.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return d.observe(u),()=>{cancelAnimationFrame(l),d.unobserve(u)}}},[]),_.createElement(gs.div,{ref:Gh(i,e),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":r,id:c.listId},pA(t,u=>_.createElement("div",{ref:Gh(a,c.listInnerRef),"cmdk-list-sizer":""},u)))}),Exe=_.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:a,...o}=t;return _.createElement(hxe,{open:n,onOpenChange:r},_.createElement(pxe,{container:a},_.createElement(mxe,{"cmdk-overlay":"",className:s}),_.createElement(gxe,{"aria-label":t.label,"cmdk-dialog":"",className:i},_.createElement(z8,{ref:e,...o}))))}),Cxe=_.forwardRef((t,e)=>Rd(n=>n.filtered.count===0)?_.createElement(gs.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),Axe=_.forwardRef((t,e)=>{let{progress:n,children:r,label:s="Loading...",...i}=t;return _.createElement(gs.div,{ref:e,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},pA(t,a=>_.createElement("div",{"aria-hidden":!0},a)))}),Ni=Object.assign(z8,{List:Sxe,Item:bxe,Input:xxe,Group:wxe,Separator:_xe,Dialog:Exe,Empty:Cxe,Loading:Axe});function Rxe(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function Pxe(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function U8(t){let e=_.useRef(t);return Yh(()=>{e.current=t}),e}var Yh=typeof window>"u"?_.useEffect:_.useLayoutEffect;function om(t){let e=_.useRef();return e.current===void 0&&(e.current=t()),e}function Rd(t){let e=hI(),n=()=>t(e.snapshot());return _.useSyncExternalStore(e.subscribe,n,n)}function H8(t,e,n,r=[]){let s=_.useRef(),i=E_();return Yh(()=>{var a;let o=(()=>{var u;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(u=f.current.textContent)==null?void 0:u.trim():s.current}})(),c=r.map(u=>u.trim());i.value(t,o,c),(a=e.current)==null||a.setAttribute(im,o),s.current=o}),s}var Txe=()=>{let[t,e]=_.useState(),n=om(()=>new Map);return Yh(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,s)=>{n.current.set(r,s),e({})}};function kxe(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function pA({asChild:t,children:e},n){return t&&_.isValidElement(e)?_.cloneElement(kxe(e),{ref:e.ref},n(e.props.children)):n(e)}var Nxe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Dxe=OL,Oxe=ML,Mxe=LL,uUe=y_,V8=_.forwardRef(({className:t,...e},n)=>P.jsx(p_,{ref:n,className:le("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}));V8.displayName=p_.displayName;const W8=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(Mxe,{children:[P.jsx(V8,{}),P.jsxs(m_,{ref:r,className:le("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,P.jsxs(y_,{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:[P.jsx(xL,{className:"h-4 w-4"}),P.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));W8.displayName=m_.displayName;const G8=({className:t,...e})=>P.jsx("div",{className:le("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});G8.displayName="DialogHeader";const q8=({className:t,...e})=>P.jsx("div",{className:le("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});q8.displayName="DialogFooter";const K8=_.forwardRef(({className:t,...e},n)=>P.jsx(g_,{ref:n,className:le("text-lg font-semibold leading-none tracking-tight",t),...e}));K8.displayName=g_.displayName;const Y8=_.forwardRef(({className:t,...e},n)=>P.jsx(v_,{ref:n,className:le("text-sm text-muted-foreground",t),...e}));Y8.displayName=v_.displayName;const Lxe=_.forwardRef(({className:t,...e},n)=>P.jsx(Ni,{ref:n,className:le("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));Lxe.displayName=Ni.displayName;const Ixe=_.forwardRef(({className:t,...e},n)=>P.jsxs("div",{className:"flex items-center px-3 border-b","cmdk-input-wrapper":"",children:[P.jsx(Wfe,{className:"w-4 h-4 mr-2 opacity-50 shrink-0"}),P.jsx(Ni.Input,{ref:n,className:le("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})]}));Ixe.displayName=Ni.Input.displayName;const $xe=_.forwardRef(({className:t,...e},n)=>P.jsx(Ni.List,{ref:n,className:le("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));$xe.displayName=Ni.List.displayName;const Fxe=_.forwardRef((t,e)=>P.jsx(Ni.Empty,{ref:e,className:"py-6 text-sm text-center",...t}));Fxe.displayName=Ni.Empty.displayName;const jxe=_.forwardRef(({className:t,...e},n)=>P.jsx(Ni.Group,{ref:n,className:le("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}));jxe.displayName=Ni.Group.displayName;const Bxe=_.forwardRef(({className:t,...e},n)=>P.jsx(Ni.Separator,{ref:n,className:le("-mx-1 h-px bg-border",t),...e}));Bxe.displayName=Ni.Separator.displayName;const zxe=_.forwardRef(({className:t,...e},n)=>P.jsx(Ni.Item,{ref:n,className:le("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}));zxe.displayName=Ni.Item.displayName;const Uxe=["top","right","bottom","left"],pl=Math.min,ro=Math.max,fC=Math.round,hS=Math.floor,Pd=t=>({x:t,y:t}),Hxe={left:"right",right:"left",bottom:"top",top:"bottom"},Vxe={start:"end",end:"start"};function ZN(t,e,n){return ro(t,pl(e,n))}function Vc(t,e){return typeof t=="function"?t(e):t}function Wc(t){return t.split("-")[0]}function Lv(t){return t.split("-")[1]}function pI(t){return t==="x"?"y":"x"}function mI(t){return t==="y"?"height":"width"}function Td(t){return["top","bottom"].includes(Wc(t))?"y":"x"}function gI(t){return pI(Td(t))}function Wxe(t,e,n){n===void 0&&(n=!1);const r=Lv(t),s=gI(t),i=mI(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=hC(a)),[a,hC(a)]}function Gxe(t){const e=hC(t);return[JN(t),e,JN(e)]}function JN(t){return t.replace(/start|end/g,e=>Vxe[e])}function qxe(t,e,n){const r=["left","right"],s=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?s:r:e?r:s;case"left":case"right":return e?i:a;default:return[]}}function Kxe(t,e,n,r){const s=Lv(t);let i=qxe(Wc(t),n==="start",r);return s&&(i=i.map(a=>a+"-"+s),e&&(i=i.concat(i.map(JN)))),i}function hC(t){return t.replace(/left|right|bottom|top/g,e=>Hxe[e])}function Yxe(t){return{top:0,right:0,bottom:0,left:0,...t}}function X8(t){return typeof t!="number"?Yxe(t):{top:t,right:t,bottom:t,left:t}}function pC(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 QB(t,e,n){let{reference:r,floating:s}=t;const i=Td(e),a=gI(e),o=mI(a),c=Wc(e),u=i==="y",f=r.x+r.width/2-s.width/2,l=r.y+r.height/2-s.height/2,d=r[o]/2-s[o]/2;let m;switch(c){case"top":m={x:f,y:r.y-s.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:l};break;case"left":m={x:r.x-s.width,y:l};break;default:m={x:r.x,y:r.y}}switch(Lv(e)){case"start":m[a]-=d*(n&&u?-1:1);break;case"end":m[a]+=d*(n&&u?-1:1);break}return m}const Xxe=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:a}=n,o=i.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(e));let u=await a.getElementRects({reference:t,floating:e,strategy:s}),{x:f,y:l}=QB(u,r,c),d=r,m={},p=0;for(let h=0;h({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:a,elements:o,middlewareData:c}=e,{element:u,padding:f=0}=Vc(t,e)||{};if(u==null)return{};const l=X8(f),d={x:n,y:r},m=gI(s),p=mI(m),h=await a.getDimensions(u),y=m==="y",g=y?"top":"left",v=y?"bottom":"right",w=y?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[m]-d[m]-i.floating[p],A=d[m]-i.reference[m],T=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let R=T?T[w]:0;(!R||!await(a.isElement==null?void 0:a.isElement(T)))&&(R=o.floating[w]||i.floating[p]);const E=x/2-A/2,k=R/2-h[p]/2-1,N=pl(l[g],k),O=pl(l[v],k),L=N,I=R-h[p]-O,F=R/2-h[p]/2+E,U=ZN(L,F,I),Y=!c.arrow&&Lv(s)!=null&&F!==U&&i.reference[p]/2-(FF<=0)){var O,L;const F=(((O=i.flip)==null?void 0:O.index)||0)+1,U=R[F];if(U)return{data:{index:F,overflows:N},reset:{placement:U}};let Y=(L=N.filter(V=>V.overflows[0]<=0).sort((V,H)=>V.overflows[1]-H.overflows[1])[0])==null?void 0:L.placement;if(!Y)switch(m){case"bestFit":{var I;const V=(I=N.filter(H=>{if(T){const ee=Td(H.placement);return ee===v||ee==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(ee=>ee>0).reduce((ee,re)=>ee+re,0)]).sort((H,ee)=>H[1]-ee[1])[0])==null?void 0:I[0];V&&(Y=V);break}case"initialPlacement":Y=o;break}if(s!==Y)return{reset:{placement:Y}}}return{}}}};function ZB(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function JB(t){return Uxe.some(e=>t[e]>=0)}const Jxe=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...s}=Vc(t,e);switch(r){case"referenceHidden":{const i=await r0(e,{...s,elementContext:"reference"}),a=ZB(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:JB(a)}}}case"escaped":{const i=await r0(e,{...s,altBoundary:!0}),a=ZB(i,n.floating);return{data:{escapedOffsets:a,escaped:JB(a)}}}default:return{}}}}};async function eSe(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=Wc(n),o=Lv(n),c=Td(n)==="y",u=["left","top"].includes(a)?-1:1,f=i&&c?-1:1,l=Vc(e,t);let{mainAxis:d,crossAxis:m,alignmentAxis:p}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...l};return o&&typeof p=="number"&&(m=o==="end"?p*-1:p),c?{x:m*f,y:d*u}:{x:d*u,y:m*f}}const tSe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:a,middlewareData:o}=e,c=await eSe(e,t);return a===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:a}}}}},nSe=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:a=!1,limiter:o={fn:y=>{let{x:g,y:v}=y;return{x:g,y:v}}},...c}=Vc(t,e),u={x:n,y:r},f=await r0(e,c),l=Td(Wc(s)),d=pI(l);let m=u[d],p=u[l];if(i){const y=d==="y"?"top":"left",g=d==="y"?"bottom":"right",v=m+f[y],w=m-f[g];m=ZN(v,m,w)}if(a){const y=l==="y"?"top":"left",g=l==="y"?"bottom":"right",v=p+f[y],w=p-f[g];p=ZN(v,p,w)}const h=o.fn({...e,[d]:m,[l]:p});return{...h,data:{x:h.x-n,y:h.y-r}}}}},rSe=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:s,rects:i,middlewareData:a}=e,{offset:o=0,mainAxis:c=!0,crossAxis:u=!0}=Vc(t,e),f={x:n,y:r},l=Td(s),d=pI(l);let m=f[d],p=f[l];const h=Vc(o,e),y=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const w=d==="y"?"height":"width",x=i.reference[d]-i.floating[w]+y.mainAxis,A=i.reference[d]+i.reference[w]-y.mainAxis;mA&&(m=A)}if(u){var g,v;const w=d==="y"?"width":"height",x=["top","left"].includes(Wc(s)),A=i.reference[l]-i.floating[w]+(x&&((g=a.offset)==null?void 0:g[l])||0)+(x?0:y.crossAxis),T=i.reference[l]+i.reference[w]+(x?0:((v=a.offset)==null?void 0:v[l])||0)-(x?y.crossAxis:0);pT&&(p=T)}return{[d]:m,[l]:p}}}},sSe=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:a=()=>{},...o}=Vc(t,e),c=await r0(e,o),u=Wc(n),f=Lv(n),l=Td(n)==="y",{width:d,height:m}=r.floating;let p,h;u==="top"||u==="bottom"?(p=u,h=f===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(h=u,p=f==="end"?"top":"bottom");const y=m-c.top-c.bottom,g=d-c.left-c.right,v=pl(m-c[p],y),w=pl(d-c[h],g),x=!e.middlewareData.shift;let A=v,T=w;if(l?T=f||x?pl(w,g):g:A=f||x?pl(v,y):y,x&&!f){const E=ro(c.left,0),k=ro(c.right,0),N=ro(c.top,0),O=ro(c.bottom,0);l?T=d-2*(E!==0||k!==0?E+k:ro(c.left,c.right)):A=m-2*(N!==0||O!==0?N+O:ro(c.top,c.bottom))}await a({...e,availableWidth:T,availableHeight:A});const R=await s.getDimensions(i.floating);return d!==R.width||m!==R.height?{reset:{rects:!0}}:{}}}};function Iv(t){return Q8(t)?(t.nodeName||"").toLowerCase():"#document"}function lo(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function tu(t){var e;return(e=(Q8(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Q8(t){return t instanceof Node||t instanceof lo(t).Node}function Sl(t){return t instanceof Element||t instanceof lo(t).Element}function El(t){return t instanceof HTMLElement||t instanceof lo(t).HTMLElement}function ez(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof lo(t).ShadowRoot}function C_(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=Ta(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(s)}function iSe(t){return["table","td","th"].includes(Iv(t))}function mA(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function vI(t){const e=yI(),n=Ta(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 oSe(t){let e=kd(t);for(;El(e)&&!pv(e);){if(mA(e))return null;if(vI(e))return e;e=kd(e)}return null}function yI(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function pv(t){return["html","body","#document"].includes(Iv(t))}function Ta(t){return lo(t).getComputedStyle(t)}function gA(t){return Sl(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function kd(t){if(Iv(t)==="html")return t;const e=t.assignedSlot||t.parentNode||ez(t)&&t.host||tu(t);return ez(e)?e.host:e}function Z8(t){const e=kd(t);return pv(e)?t.ownerDocument?t.ownerDocument.body:t.body:El(e)&&C_(e)?e:Z8(e)}function s0(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=Z8(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),a=lo(s);return i?e.concat(a,a.visualViewport||[],C_(s)?s:[],a.frameElement&&n?s0(a.frameElement):[]):e.concat(s,s0(s,[],n))}function J8(t){const e=Ta(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=El(t),i=s?t.offsetWidth:n,a=s?t.offsetHeight:r,o=fC(n)!==i||fC(r)!==a;return o&&(n=i,r=a),{width:n,height:r,$:o}}function bI(t){return Sl(t)?t:t.contextElement}function Vm(t){const e=bI(t);if(!El(e))return Pd(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=J8(e);let a=(i?fC(n.width):n.width)/r,o=(i?fC(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const aSe=Pd(0);function eG(t){const e=lo(t);return!yI()||!e.visualViewport?aSe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function lSe(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==lo(t)?!1:e}function Xh(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=bI(t);let a=Pd(1);e&&(r?Sl(r)&&(a=Vm(r)):a=Vm(t));const o=lSe(i,n,r)?eG(i):Pd(0);let c=(s.left+o.x)/a.x,u=(s.top+o.y)/a.y,f=s.width/a.x,l=s.height/a.y;if(i){const d=lo(i),m=r&&Sl(r)?lo(r):r;let p=d,h=p.frameElement;for(;h&&r&&m!==p;){const y=Vm(h),g=h.getBoundingClientRect(),v=Ta(h),w=g.left+(h.clientLeft+parseFloat(v.paddingLeft))*y.x,x=g.top+(h.clientTop+parseFloat(v.paddingTop))*y.y;c*=y.x,u*=y.y,f*=y.x,l*=y.y,c+=w,u+=x,p=lo(h),h=p.frameElement}}return pC({width:f,height:l,x:c,y:u})}function cSe(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",a=tu(r),o=e?mA(e.floating):!1;if(r===a||o&&i)return n;let c={scrollLeft:0,scrollTop:0},u=Pd(1);const f=Pd(0),l=El(r);if((l||!l&&!i)&&((Iv(r)!=="body"||C_(a))&&(c=gA(r)),El(r))){const d=Xh(r);u=Vm(r),f.x=d.x+r.clientLeft,f.y=d.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+f.x,y:n.y*u.y-c.scrollTop*u.y+f.y}}function uSe(t){return Array.from(t.getClientRects())}function tG(t){return Xh(tu(t)).left+gA(t).scrollLeft}function dSe(t){const e=tu(t),n=gA(t),r=t.ownerDocument.body,s=ro(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=ro(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+tG(t);const o=-n.scrollTop;return Ta(r).direction==="rtl"&&(a+=ro(e.clientWidth,r.clientWidth)-s),{width:s,height:i,x:a,y:o}}function fSe(t,e){const n=lo(t),r=tu(t),s=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,o=0,c=0;if(s){i=s.width,a=s.height;const u=yI();(!u||u&&e==="fixed")&&(o=s.offsetLeft,c=s.offsetTop)}return{width:i,height:a,x:o,y:c}}function hSe(t,e){const n=Xh(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=El(t)?Vm(t):Pd(1),a=t.clientWidth*i.x,o=t.clientHeight*i.y,c=s*i.x,u=r*i.y;return{width:a,height:o,x:c,y:u}}function tz(t,e,n){let r;if(e==="viewport")r=fSe(t,n);else if(e==="document")r=dSe(tu(t));else if(Sl(e))r=hSe(e,n);else{const s=eG(t);r={...e,x:e.x-s.x,y:e.y-s.y}}return pC(r)}function nG(t,e){const n=kd(t);return n===e||!Sl(n)||pv(n)?!1:Ta(n).position==="fixed"||nG(n,e)}function pSe(t,e){const n=e.get(t);if(n)return n;let r=s0(t,[],!1).filter(o=>Sl(o)&&Iv(o)!=="body"),s=null;const i=Ta(t).position==="fixed";let a=i?kd(t):t;for(;Sl(a)&&!pv(a);){const o=Ta(a),c=vI(a);!c&&o.position==="fixed"&&(s=null),(i?!c&&!s:!c&&o.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||C_(a)&&!c&&nG(t,a))?r=r.filter(f=>f!==a):s=o,a=kd(a)}return e.set(t,r),r}function mSe(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const a=[...n==="clippingAncestors"?mA(e)?[]:pSe(e,this._c):[].concat(n),r],o=a[0],c=a.reduce((u,f)=>{const l=tz(e,f,s);return u.top=ro(l.top,u.top),u.right=pl(l.right,u.right),u.bottom=pl(l.bottom,u.bottom),u.left=ro(l.left,u.left),u},tz(e,o,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function gSe(t){const{width:e,height:n}=J8(t);return{width:e,height:n}}function vSe(t,e,n){const r=El(e),s=tu(e),i=n==="fixed",a=Xh(t,!0,i,e);let o={scrollLeft:0,scrollTop:0};const c=Pd(0);if(r||!r&&!i)if((Iv(e)!=="body"||C_(s))&&(o=gA(e)),r){const l=Xh(e,!0,i,e);c.x=l.x+e.clientLeft,c.y=l.y+e.clientTop}else s&&(c.x=tG(s));const u=a.left+o.scrollLeft-c.x,f=a.top+o.scrollTop-c.y;return{x:u,y:f,width:a.width,height:a.height}}function PT(t){return Ta(t).position==="static"}function nz(t,e){return!El(t)||Ta(t).position==="fixed"?null:e?e(t):t.offsetParent}function rG(t,e){const n=lo(t);if(mA(t))return n;if(!El(t)){let s=kd(t);for(;s&&!pv(s);){if(Sl(s)&&!PT(s))return s;s=kd(s)}return n}let r=nz(t,e);for(;r&&iSe(r)&&PT(r);)r=nz(r,e);return r&&pv(r)&&PT(r)&&!vI(r)?n:r||oSe(t)||n}const ySe=async function(t){const e=this.getOffsetParent||rG,n=this.getDimensions,r=await n(t.floating);return{reference:vSe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function bSe(t){return Ta(t).direction==="rtl"}const wSe={convertOffsetParentRelativeRectToViewportRelativeRect:cSe,getDocumentElement:tu,getClippingRect:mSe,getOffsetParent:rG,getElementRects:ySe,getClientRects:uSe,getDimensions:gSe,getScale:Vm,isElement:Sl,isRTL:bSe};function _Se(t,e){let n=null,r;const s=tu(t);function i(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function a(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),i();const{left:u,top:f,width:l,height:d}=t.getBoundingClientRect();if(o||e(),!l||!d)return;const m=hS(f),p=hS(s.clientWidth-(u+l)),h=hS(s.clientHeight-(f+d)),y=hS(u),v={rootMargin:-m+"px "+-p+"px "+-h+"px "+-y+"px",threshold:ro(0,pl(1,c))||1};let w=!0;function x(A){const T=A[0].intersectionRatio;if(T!==c){if(!w)return a();T?a(!1,T):r=setTimeout(()=>{a(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(x,{...v,root:s.ownerDocument})}catch{n=new IntersectionObserver(x,v)}n.observe(t)}return a(!0),i}function xSe(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=bI(t),f=s||i?[...u?s0(u):[],...s0(e)]:[];f.forEach(g=>{s&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const l=u&&o?_Se(u,n):null;let d=-1,m=null;a&&(m=new ResizeObserver(g=>{let[v]=g;v&&v.target===u&&m&&(m.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(e)})),n()}),u&&!c&&m.observe(u),m.observe(e));let p,h=c?Xh(t):null;c&&y();function y(){const g=Xh(t);h&&(g.x!==h.x||g.y!==h.y||g.width!==h.width||g.height!==h.height)&&n(),h=g,p=requestAnimationFrame(y)}return n(),()=>{var g;f.forEach(v=>{s&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),l==null||l(),(g=m)==null||g.disconnect(),m=null,c&&cancelAnimationFrame(p)}}const SSe=tSe,ESe=nSe,CSe=Zxe,ASe=sSe,RSe=Jxe,rz=Qxe,PSe=rSe,TSe=(t,e,n)=>{const r=new Map,s={platform:wSe,...n},i={...s.platform,_c:r};return Xxe(t,e,{...s,platform:i})};var YS=typeof document<"u"?_.useLayoutEffect:_.useEffect;function mC(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(!mC(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)&&!mC(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function sG(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function sz(t,e){const n=sG(t);return Math.round(e*n)/n}function iz(t){const e=_.useRef(t);return YS(()=>{e.current=t}),e}function kSe(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:a}={},transform:o=!0,whileElementsMounted:c,open:u}=t,[f,l]=_.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[d,m]=_.useState(r);mC(d,r)||m(r);const[p,h]=_.useState(null),[y,g]=_.useState(null),v=_.useCallback(V=>{V!==T.current&&(T.current=V,h(V))},[]),w=_.useCallback(V=>{V!==R.current&&(R.current=V,g(V))},[]),x=i||p,A=a||y,T=_.useRef(null),R=_.useRef(null),E=_.useRef(f),k=c!=null,N=iz(c),O=iz(s),L=_.useCallback(()=>{if(!T.current||!R.current)return;const V={placement:e,strategy:n,middleware:d};O.current&&(V.platform=O.current),TSe(T.current,R.current,V).then(H=>{const ee={...H,isPositioned:!0};I.current&&!mC(E.current,ee)&&(E.current=ee,Ms.flushSync(()=>{l(ee)}))})},[d,e,n,O]);YS(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,l(V=>({...V,isPositioned:!1})))},[u]);const I=_.useRef(!1);YS(()=>(I.current=!0,()=>{I.current=!1}),[]),YS(()=>{if(x&&(T.current=x),A&&(R.current=A),x&&A){if(N.current)return N.current(x,A,L);L()}},[x,A,L,N,k]);const F=_.useMemo(()=>({reference:T,floating:R,setReference:v,setFloating:w}),[v,w]),U=_.useMemo(()=>({reference:x,floating:A}),[x,A]),Y=_.useMemo(()=>{const V={position:n,left:0,top:0};if(!U.floating)return V;const H=sz(U.floating,f.x),ee=sz(U.floating,f.y);return o?{...V,transform:"translate("+H+"px, "+ee+"px)",...sG(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:ee}},[n,o,U.floating,f.x,f.y]);return _.useMemo(()=>({...f,update:L,refs:F,elements:U,floatingStyles:Y}),[f,L,F,U,Y])}const NSe=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?rz({element:r.current,padding:s}).fn(n):{}:r?rz({element:r,padding:s}).fn(n):{}}}},DSe=(t,e)=>({...SSe(t),options:[t,e]}),OSe=(t,e)=>({...ESe(t),options:[t,e]}),MSe=(t,e)=>({...PSe(t),options:[t,e]}),LSe=(t,e)=>({...CSe(t),options:[t,e]}),ISe=(t,e)=>({...ASe(t),options:[t,e]}),$Se=(t,e)=>({...RSe(t),options:[t,e]}),FSe=(t,e)=>({...NSe(t),options:[t,e]});var jSe="Arrow",iG=_.forwardRef((t,e)=>{const{children:n,width:r=10,height:s=5,...i}=t;return P.jsx(Ne.svg,{...i,ref:e,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:P.jsx("polygon",{points:"0,0 30,0 15,10"})})});iG.displayName=jSe;var BSe=iG,wI="Popper",[oG,Rl]=Nn(wI),[zSe,aG]=oG(wI),lG=t=>{const{__scopePopper:e,children:n}=t,[r,s]=_.useState(null);return P.jsx(zSe,{scope:e,anchor:r,onAnchorChange:s,children:n})};lG.displayName=wI;var cG="PopperAnchor",uG=_.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...s}=t,i=aG(cG,n),a=_.useRef(null),o=tt(e,a);return _.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:P.jsx(Ne.div,{...s,ref:o})});uG.displayName=cG;var _I="PopperContent",[USe,HSe]=oG(_I),dG=_.forwardRef((t,e)=>{var ie,be,Ae,_e,Me,De;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:l="partial",hideWhenDetached:d=!1,updatePositionStrategy:m="optimized",onPlaced:p,...h}=t,y=aG(_I,n),[g,v]=_.useState(null),w=tt(e,ye=>v(ye)),[x,A]=_.useState(null),T=S_(x),R=(T==null?void 0:T.width)??0,E=(T==null?void 0:T.height)??0,k=r+(i!=="center"?"-"+i:""),N=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},O=Array.isArray(u)?u:[u],L=O.length>0,I={padding:N,boundary:O.filter(WSe),altBoundary:L},{refs:F,floatingStyles:U,placement:Y,isPositioned:V,middlewareData:H}=kSe({strategy:"fixed",placement:k,whileElementsMounted:(...ye)=>xSe(...ye,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[DSe({mainAxis:s+E,alignmentAxis:a}),c&&OSe({mainAxis:!0,crossAxis:!1,limiter:l==="partial"?MSe():void 0,...I}),c&&LSe({...I}),ISe({...I,apply:({elements:ye,rects:Fe,availableWidth:ut,availableHeight:Qe})=>{const{width:vt,height:An}=Fe.reference,Yt=ye.floating.style;Yt.setProperty("--radix-popper-available-width",`${ut}px`),Yt.setProperty("--radix-popper-available-height",`${Qe}px`),Yt.setProperty("--radix-popper-anchor-width",`${vt}px`),Yt.setProperty("--radix-popper-anchor-height",`${An}px`)}}),x&&FSe({element:x,padding:o}),GSe({arrowWidth:R,arrowHeight:E}),d&&$Se({strategy:"referenceHidden",...I})]}),[ee,re]=pG(Y),X=zt(p);$n(()=>{V&&(X==null||X())},[V,X]);const q=(ie=H.arrow)==null?void 0:ie.x,K=(be=H.arrow)==null?void 0:be.y,Z=((Ae=H.arrow)==null?void 0:Ae.centerOffset)!==0,[ue,de]=_.useState();return $n(()=>{g&&de(window.getComputedStyle(g).zIndex)},[g]),P.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:V?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[(_e=H.transformOrigin)==null?void 0:_e.x,(Me=H.transformOrigin)==null?void 0:Me.y].join(" "),...((De=H.hide)==null?void 0:De.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:P.jsx(USe,{scope:n,placedSide:ee,onArrowChange:A,arrowX:q,arrowY:K,shouldHideArrow:Z,children:P.jsx(Ne.div,{"data-side":ee,"data-align":re,...h,ref:w,style:{...h.style,animation:V?void 0:"none"}})})})});dG.displayName=_I;var fG="PopperArrow",VSe={top:"bottom",right:"left",bottom:"top",left:"right"},hG=_.forwardRef(function(e,n){const{__scopePopper:r,...s}=e,i=HSe(fG,r),a=VSe[i.placedSide];return P.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]: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:P.jsx(BSe,{...s,ref:n,style:{...s.style,display:"block"}})})});hG.displayName=fG;function WSe(t){return t!==null}var GSe=t=>({name:"transformOrigin",options:t,fn(e){var y,g,v;const{placement:n,rects:r,middlewareData:s}=e,a=((y=s.arrow)==null?void 0:y.centerOffset)!==0,o=a?0:t.arrowWidth,c=a?0:t.arrowHeight,[u,f]=pG(n),l={start:"0%",center:"50%",end:"100%"}[f],d=(((g=s.arrow)==null?void 0:g.x)??0)+o/2,m=(((v=s.arrow)==null?void 0:v.y)??0)+c/2;let p="",h="";return u==="bottom"?(p=a?l:`${d}px`,h=`${-c}px`):u==="top"?(p=a?l:`${d}px`,h=`${r.floating.height+c}px`):u==="right"?(p=`${-c}px`,h=a?l:`${m}px`):u==="left"&&(p=`${r.floating.width+c}px`,h=a?l:`${m}px`),{data:{x:p,y:h}}}});function pG(t){const[e,n="center"]=t.split("-");return[e,n]}var vA=lG,$v=uG,A_=dG,R_=hG,TT="rovingFocusGroup.onEntryFocus",qSe={bubbles:!1,cancelable:!0},yA="RovingFocusGroup",[eD,mG,KSe]=Qc(yA),[YSe,Pl]=Nn(yA,[KSe]),[XSe,QSe]=YSe(yA),gG=_.forwardRef((t,e)=>P.jsx(eD.Provider,{scope:t.__scopeRovingFocusGroup,children:P.jsx(eD.Slot,{scope:t.__scopeRovingFocusGroup,children:P.jsx(ZSe,{...t,ref:e})})}));gG.displayName=yA;var ZSe=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...l}=t,d=_.useRef(null),m=tt(e,d),p=Da(i),[h=null,y]=lr({prop:a,defaultProp:o,onChange:c}),[g,v]=_.useState(!1),w=zt(u),x=mG(n),A=_.useRef(!1),[T,R]=_.useState(0);return _.useEffect(()=>{const E=d.current;if(E)return E.addEventListener(TT,w),()=>E.removeEventListener(TT,w)},[w]),P.jsx(XSe,{scope:n,orientation:r,dir:p,loop:s,currentTabStopId:h,onItemFocus:_.useCallback(E=>y(E),[y]),onItemShiftTab:_.useCallback(()=>v(!0),[]),onFocusableItemAdd:_.useCallback(()=>R(E=>E+1),[]),onFocusableItemRemove:_.useCallback(()=>R(E=>E-1),[]),children:P.jsx(Ne.div,{tabIndex:g||T===0?-1:0,"data-orientation":r,...l,ref:m,style:{outline:"none",...t.style},onMouseDown:me(t.onMouseDown,()=>{A.current=!0}),onFocus:me(t.onFocus,E=>{const k=!A.current;if(E.target===E.currentTarget&&k&&!g){const N=new CustomEvent(TT,qSe);if(E.currentTarget.dispatchEvent(N),!N.defaultPrevented){const O=x().filter(Y=>Y.focusable),L=O.find(Y=>Y.active),I=O.find(Y=>Y.id===h),U=[L,I,...O].filter(Boolean).map(Y=>Y.ref.current);bG(U,f)}}A.current=!1}),onBlur:me(t.onBlur,()=>v(!1))})})}),vG="RovingFocusGroupItem",yG=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,...a}=t,o=qr(),c=i||o,u=QSe(vG,n),f=u.currentTabStopId===c,l=mG(n),{onFocusableItemAdd:d,onFocusableItemRemove:m}=u;return _.useEffect(()=>{if(r)return d(),()=>m()},[r,d,m]),P.jsx(eD.ItemSlot,{scope:n,id:c,focusable:r,active:s,children:P.jsx(Ne.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...a,ref:e,onMouseDown:me(t.onMouseDown,p=>{r?u.onItemFocus(c):p.preventDefault()}),onFocus:me(t.onFocus,()=>u.onItemFocus(c)),onKeyDown:me(t.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){u.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const h=tEe(p,u.orientation,u.dir);if(h!==void 0){if(p.metaKey||p.ctrlKey||p.altKey||p.shiftKey)return;p.preventDefault();let g=l().filter(v=>v.focusable).map(v=>v.ref.current);if(h==="last")g.reverse();else if(h==="prev"||h==="next"){h==="prev"&&g.reverse();const v=g.indexOf(p.currentTarget);g=u.loop?nEe(g,v+1):g.slice(v+1)}setTimeout(()=>bG(g))}})})})});yG.displayName=vG;var JSe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function eEe(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function tEe(t,e,n){const r=eEe(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return JSe[r]}function bG(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function nEe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var P_=gG,T_=yG,tD=["Enter"," "],rEe=["ArrowDown","PageUp","Home"],wG=["ArrowUp","PageDown","End"],sEe=[...rEe,...wG],iEe={ltr:[...tD,"ArrowRight"],rtl:[...tD,"ArrowLeft"]},oEe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},k_="Menu",[i0,aEe,lEe]=Qc(k_),[mp,N_]=Nn(k_,[lEe,Rl,Pl]),bA=Rl(),_G=Pl(),[cEe,gp]=mp(k_),[uEe,D_]=mp(k_),xG=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:s,onOpenChange:i,modal:a=!0}=t,o=bA(e),[c,u]=_.useState(null),f=_.useRef(!1),l=zt(i),d=Da(s);return _.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},p=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),P.jsx(vA,{...o,children:P.jsx(cEe,{scope:e,open:n,onOpenChange:l,content:c,onContentChange:u,children:P.jsx(uEe,{scope:e,onClose:_.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:f,dir:d,modal:a,children:r})})})};xG.displayName=k_;var dEe="MenuAnchor",xI=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=bA(n);return P.jsx($v,{...s,...r,ref:e})});xI.displayName=dEe;var SI="MenuPortal",[fEe,SG]=mp(SI,{forceMount:void 0}),EG=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:s}=t,i=gp(SI,e);return P.jsx(fEe,{scope:e,forceMount:n,children:P.jsx(Wn,{present:n||i.open,children:P.jsx(Pv,{asChild:!0,container:s,children:r})})})};EG.displayName=SI;var Bo="MenuContent",[hEe,EI]=mp(Bo),CG=_.forwardRef((t,e)=>{const n=SG(Bo,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=gp(Bo,t.__scopeMenu),a=D_(Bo,t.__scopeMenu);return P.jsx(i0.Provider,{scope:t.__scopeMenu,children:P.jsx(Wn,{present:r||i.open,children:P.jsx(i0.Slot,{scope:t.__scopeMenu,children:a.modal?P.jsx(pEe,{...s,ref:e}):P.jsx(mEe,{...s,ref:e})})})})}),pEe=_.forwardRef((t,e)=>{const n=gp(Bo,t.__scopeMenu),r=_.useRef(null),s=tt(e,r);return _.useEffect(()=>{const i=r.current;if(i)return Tv(i)},[]),P.jsx(CI,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:me(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),mEe=_.forwardRef((t,e)=>{const n=gp(Bo,t.__scopeMenu);return P.jsx(CI,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),CI=_.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:l,onInteractOutside:d,onDismiss:m,disableOutsideScroll:p,...h}=t,y=gp(Bo,n),g=D_(Bo,n),v=bA(n),w=_G(n),x=aEe(n),[A,T]=_.useState(null),R=_.useRef(null),E=tt(e,R,y.onContentChange),k=_.useRef(0),N=_.useRef(""),O=_.useRef(0),L=_.useRef(null),I=_.useRef("right"),F=_.useRef(0),U=p?h_:_.Fragment,Y=p?{as:Aa,allowPinchZoom:!0}:void 0,V=ee=>{var ie,be;const re=N.current+ee,X=x().filter(Ae=>!Ae.disabled),q=document.activeElement,K=(ie=X.find(Ae=>Ae.ref.current===q))==null?void 0:ie.textValue,Z=X.map(Ae=>Ae.textValue),ue=REe(Z,re,K),de=(be=X.find(Ae=>Ae.textValue===ue))==null?void 0:be.ref.current;(function Ae(_e){N.current=_e,window.clearTimeout(k.current),_e!==""&&(k.current=window.setTimeout(()=>Ae(""),1e3))})(re),de&&setTimeout(()=>de.focus())};_.useEffect(()=>()=>window.clearTimeout(k.current),[]),q1();const H=_.useCallback(ee=>{var X,q;return I.current===((X=L.current)==null?void 0:X.side)&&TEe(ee,(q=L.current)==null?void 0:q.area)},[]);return P.jsx(hEe,{scope:n,searchRef:N,onItemEnter:_.useCallback(ee=>{H(ee)&&ee.preventDefault()},[H]),onItemLeave:_.useCallback(ee=>{var re;H(ee)||((re=R.current)==null||re.focus(),T(null))},[H]),onTriggerLeave:_.useCallback(ee=>{H(ee)&&ee.preventDefault()},[H]),pointerGraceTimerRef:O,onPointerGraceIntentChange:_.useCallback(ee=>{L.current=ee},[]),children:P.jsx(U,{...Y,children:P.jsx(f_,{asChild:!0,trapped:s,onMountAutoFocus:me(i,ee=>{var re;ee.preventDefault(),(re=R.current)==null||re.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:P.jsx(Jc,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:l,onInteractOutside:d,onDismiss:m,children:P.jsx(P_,{asChild:!0,...w,dir:g.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:T,onEntryFocus:me(c,ee=>{g.isUsingKeyboardRef.current||ee.preventDefault()}),preventScrollOnEntryFocus:!0,children:P.jsx(A_,{role:"menu","aria-orientation":"vertical","data-state":zG(y.open),"data-radix-menu-content":"",dir:g.dir,...v,...h,ref:E,style:{outline:"none",...h.style},onKeyDown:me(h.onKeyDown,ee=>{const X=ee.target.closest("[data-radix-menu-content]")===ee.currentTarget,q=ee.ctrlKey||ee.altKey||ee.metaKey,K=ee.key.length===1;X&&(ee.key==="Tab"&&ee.preventDefault(),!q&&K&&V(ee.key));const Z=R.current;if(ee.target!==Z||!sEe.includes(ee.key))return;ee.preventDefault();const de=x().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);wG.includes(ee.key)&&de.reverse(),CEe(de)}),onBlur:me(t.onBlur,ee=>{ee.currentTarget.contains(ee.target)||(window.clearTimeout(k.current),N.current="")}),onPointerMove:me(t.onPointerMove,o0(ee=>{const re=ee.target,X=F.current!==ee.clientX;if(ee.currentTarget.contains(re)&&X){const q=ee.clientX>F.current?"right":"left";I.current=q,F.current=ee.clientX}}))})})})})})})});CG.displayName=Bo;var gEe="MenuGroup",AI=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return P.jsx(Ne.div,{role:"group",...r,ref:e})});AI.displayName=gEe;var vEe="MenuLabel",AG=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return P.jsx(Ne.div,{...r,ref:e})});AG.displayName=vEe;var gC="MenuItem",oz="menu.itemSelect",wA=_.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...s}=t,i=_.useRef(null),a=D_(gC,t.__scopeMenu),o=EI(gC,t.__scopeMenu),c=tt(e,i),u=_.useRef(!1),f=()=>{const l=i.current;if(!n&&l){const d=new CustomEvent(oz,{bubbles:!0,cancelable:!0});l.addEventListener(oz,m=>r==null?void 0:r(m),{once:!0}),Jb(l,d),d.defaultPrevented?u.current=!1:a.onClose()}};return P.jsx(RG,{...s,ref:c,disabled:n,onClick:me(t.onClick,f),onPointerDown:l=>{var d;(d=t.onPointerDown)==null||d.call(t,l),u.current=!0},onPointerUp:me(t.onPointerUp,l=>{var d;u.current||(d=l.currentTarget)==null||d.click()}),onKeyDown:me(t.onKeyDown,l=>{const d=o.searchRef.current!=="";n||d&&l.key===" "||tD.includes(l.key)&&(l.currentTarget.click(),l.preventDefault())})})});wA.displayName=gC;var RG=_.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=t,a=EI(gC,n),o=_G(n),c=_.useRef(null),u=tt(e,c),[f,l]=_.useState(!1),[d,m]=_.useState("");return _.useEffect(()=>{const p=c.current;p&&m((p.textContent??"").trim())},[i.children]),P.jsx(i0.ItemSlot,{scope:n,disabled:r,textValue:s??d,children:P.jsx(T_,{asChild:!0,...o,focusable:!r,children:P.jsx(Ne.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:u,onPointerMove:me(t.onPointerMove,o0(p=>{r?a.onItemLeave(p):(a.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:me(t.onPointerLeave,o0(p=>a.onItemLeave(p))),onFocus:me(t.onFocus,()=>l(!0)),onBlur:me(t.onBlur,()=>l(!1))})})})}),yEe="MenuCheckboxItem",PG=_.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...s}=t;return P.jsx(OG,{scope:t.__scopeMenu,checked:n,children:P.jsx(wA,{role:"menuitemcheckbox","aria-checked":vC(n)?"mixed":n,...s,ref:e,"data-state":PI(n),onSelect:me(s.onSelect,()=>r==null?void 0:r(vC(n)?!0:!n),{checkForDefaultPrevented:!1})})})});PG.displayName=yEe;var TG="MenuRadioGroup",[bEe,wEe]=mp(TG,{value:void 0,onValueChange:()=>{}}),kG=_.forwardRef((t,e)=>{const{value:n,onValueChange:r,...s}=t,i=zt(r);return P.jsx(bEe,{scope:t.__scopeMenu,value:n,onValueChange:i,children:P.jsx(AI,{...s,ref:e})})});kG.displayName=TG;var NG="MenuRadioItem",DG=_.forwardRef((t,e)=>{const{value:n,...r}=t,s=wEe(NG,t.__scopeMenu),i=n===s.value;return P.jsx(OG,{scope:t.__scopeMenu,checked:i,children:P.jsx(wA,{role:"menuitemradio","aria-checked":i,...r,ref:e,"data-state":PI(i),onSelect:me(r.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,n)},{checkForDefaultPrevented:!1})})})});DG.displayName=NG;var RI="MenuItemIndicator",[OG,_Ee]=mp(RI,{checked:!1}),MG=_.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...s}=t,i=_Ee(RI,n);return P.jsx(Wn,{present:r||vC(i.checked)||i.checked===!0,children:P.jsx(Ne.span,{...s,ref:e,"data-state":PI(i.checked)})})});MG.displayName=RI;var xEe="MenuSeparator",LG=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return P.jsx(Ne.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});LG.displayName=xEe;var SEe="MenuArrow",IG=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=bA(n);return P.jsx(R_,{...s,...r,ref:e})});IG.displayName=SEe;var EEe="MenuSub",[dUe,$G]=mp(EEe),qy="MenuSubTrigger",FG=_.forwardRef((t,e)=>{const n=gp(qy,t.__scopeMenu),r=D_(qy,t.__scopeMenu),s=$G(qy,t.__scopeMenu),i=EI(qy,t.__scopeMenu),a=_.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:c}=i,u={__scopeMenu:t.__scopeMenu},f=_.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return _.useEffect(()=>f,[f]),_.useEffect(()=>{const l=o.current;return()=>{window.clearTimeout(l),c(null)}},[o,c]),P.jsx(xI,{asChild:!0,...u,children:P.jsx(RG,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":zG(n.open),...t,ref:c_(e,s.onTriggerChange),onClick:l=>{var d;(d=t.onClick)==null||d.call(t,l),!(t.disabled||l.defaultPrevented)&&(l.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:me(t.onPointerMove,o0(l=>{i.onItemEnter(l),!l.defaultPrevented&&!t.disabled&&!n.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:me(t.onPointerLeave,o0(l=>{var m,p;f();const d=(m=n.content)==null?void 0:m.getBoundingClientRect();if(d){const h=(p=n.content)==null?void 0:p.dataset.side,y=h==="right",g=y?-5:5,v=d[y?"left":"right"],w=d[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:l.clientX+g,y:l.clientY},{x:v,y:d.top},{x:w,y:d.top},{x:w,y:d.bottom},{x:v,y:d.bottom}],side:h}),window.clearTimeout(o.current),o.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(l),l.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:me(t.onKeyDown,l=>{var m;const d=i.searchRef.current!=="";t.disabled||d&&l.key===" "||iEe[r.dir].includes(l.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),l.preventDefault())})})})});FG.displayName=qy;var jG="MenuSubContent",BG=_.forwardRef((t,e)=>{const n=SG(Bo,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=gp(Bo,t.__scopeMenu),a=D_(Bo,t.__scopeMenu),o=$G(jG,t.__scopeMenu),c=_.useRef(null),u=tt(e,c);return P.jsx(i0.Provider,{scope:t.__scopeMenu,children:P.jsx(Wn,{present:r||i.open,children:P.jsx(i0.Slot,{scope:t.__scopeMenu,children:P.jsx(CI,{id:o.contentId,"aria-labelledby":o.triggerId,...s,ref:u,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var l;a.isUsingKeyboardRef.current&&((l=c.current)==null||l.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:me(t.onFocusOutside,f=>{f.target!==o.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:me(t.onEscapeKeyDown,f=>{a.onClose(),f.preventDefault()}),onKeyDown:me(t.onKeyDown,f=>{var m;const l=f.currentTarget.contains(f.target),d=oEe[a.dir].includes(f.key);l&&d&&(i.onOpenChange(!1),(m=o.trigger)==null||m.focus(),f.preventDefault())})})})})})});BG.displayName=jG;function zG(t){return t?"open":"closed"}function vC(t){return t==="indeterminate"}function PI(t){return vC(t)?"indeterminate":t?"checked":"unchecked"}function CEe(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function AEe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function REe(t,e,n){const s=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let a=AEe(t,Math.max(i,0));s.length===1&&(a=a.filter(u=>u!==n));const c=a.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function PEe(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;ir!=f>r&&n<(u-o)*(r-c)/(f-c)+o&&(s=!s)}return s}function TEe(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return PEe(n,e)}function o0(t){return e=>e.pointerType==="mouse"?t(e):void 0}var kEe=xG,TI=xI,kI=EG,NI=CG,DI=AI,OI=AG,MI=wA,LI=PG,II=kG,$I=DG,FI=MG,jI=LG,BI=IG,zI=FG,UI=BG,UG="ContextMenu",[NEe,fUe]=Nn(UG,[N_]),Di=N_(),[hUe,HG]=NEe(UG),VG="ContextMenuTrigger",DEe=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=t,i=HG(VG,n),a=Di(n),o=_.useRef({x:0,y:0}),c=_.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...o.current})}),u=_.useRef(0),f=_.useCallback(()=>window.clearTimeout(u.current),[]),l=d=>{o.current={x:d.clientX,y:d.clientY},i.onOpenChange(!0)};return _.useEffect(()=>f,[f]),_.useEffect(()=>void(r&&f()),[r,f]),P.jsxs(P.Fragment,{children:[P.jsx(TI,{...a,virtualRef:c}),P.jsx(Ne.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:me(t.onContextMenu,d=>{f(),l(d),d.preventDefault()}),onPointerDown:r?t.onPointerDown:me(t.onPointerDown,pS(d=>{f(),u.current=window.setTimeout(()=>l(d),700)})),onPointerMove:r?t.onPointerMove:me(t.onPointerMove,pS(f)),onPointerCancel:r?t.onPointerCancel:me(t.onPointerCancel,pS(f)),onPointerUp:r?t.onPointerUp:me(t.onPointerUp,pS(f))})]})});DEe.displayName=VG;var OEe="ContextMenuPortal",WG=t=>{const{__scopeContextMenu:e,...n}=t,r=Di(e);return P.jsx(kI,{...r,...n})};WG.displayName=OEe;var GG="ContextMenuContent",qG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=HG(GG,n),i=Di(n),a=_.useRef(!1);return P.jsx(NI,{...i,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:o=>{var c;(c=t.onCloseAutoFocus)==null||c.call(t,o),!o.defaultPrevented&&a.current&&o.preventDefault(),a.current=!1},onInteractOutside:o=>{var c;(c=t.onInteractOutside)==null||c.call(t,o),!o.defaultPrevented&&!s.modal&&(a.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)"}})});qG.displayName=GG;var MEe="ContextMenuGroup",LEe=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Di(n);return P.jsx(DI,{...s,...r,ref:e})});LEe.displayName=MEe;var IEe="ContextMenuLabel",KG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Di(n);return P.jsx(OI,{...s,...r,ref:e})});KG.displayName=IEe;var $Ee="ContextMenuItem",YG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Di(n);return P.jsx(MI,{...s,...r,ref:e})});YG.displayName=$Ee;var FEe="ContextMenuCheckboxItem",XG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Di(n);return P.jsx(LI,{...s,...r,ref:e})});XG.displayName=FEe;var jEe="ContextMenuRadioGroup",BEe=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Di(n);return P.jsx(II,{...s,...r,ref:e})});BEe.displayName=jEe;var zEe="ContextMenuRadioItem",QG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Di(n);return P.jsx($I,{...s,...r,ref:e})});QG.displayName=zEe;var UEe="ContextMenuItemIndicator",ZG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Di(n);return P.jsx(FI,{...s,...r,ref:e})});ZG.displayName=UEe;var HEe="ContextMenuSeparator",JG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Di(n);return P.jsx(jI,{...s,...r,ref:e})});JG.displayName=HEe;var VEe="ContextMenuArrow",WEe=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Di(n);return P.jsx(BI,{...s,...r,ref:e})});WEe.displayName=VEe;var GEe="ContextMenuSubTrigger",eq=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Di(n);return P.jsx(zI,{...s,...r,ref:e})});eq.displayName=GEe;var qEe="ContextMenuSubContent",tq=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Di(n);return P.jsx(UI,{...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)"}})});tq.displayName=qEe;function pS(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var KEe=WG,nq=qG,rq=KG,sq=YG,iq=XG,oq=QG,aq=ZG,lq=JG,cq=eq,uq=tq;const YEe=_.forwardRef(({className:t,inset:e,children:n,...r},s)=>P.jsxs(cq,{ref:s,className:le("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,P.jsx(d_,{className:"ml-auto h-4 w-4"})]}));YEe.displayName=cq.displayName;const XEe=_.forwardRef(({className:t,...e},n)=>P.jsx(uq,{ref:n,className:le("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}));XEe.displayName=uq.displayName;const QEe=_.forwardRef(({className:t,...e},n)=>P.jsx(KEe,{children:P.jsx(nq,{ref:n,className:le("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})}));QEe.displayName=nq.displayName;const ZEe=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(sq,{ref:r,className:le("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}));ZEe.displayName=sq.displayName;const JEe=_.forwardRef(({className:t,children:e,checked:n,...r},s)=>P.jsxs(iq,{ref:s,className:le("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:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(aq,{children:P.jsx(u_,{className:"h-4 w-4"})})}),e]}));JEe.displayName=iq.displayName;const eCe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(oq,{ref:r,className:le("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:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(aq,{children:P.jsx(G1,{className:"h-2 w-2 fill-current"})})}),e]}));eCe.displayName=oq.displayName;const tCe=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(rq,{ref:r,className:le("px-2 py-1.5 text-sm font-semibold text-foreground",e&&"pl-8",t),...n}));tCe.displayName=rq.displayName;const nCe=_.forwardRef(({className:t,...e},n)=>P.jsx(lq,{ref:n,className:le("-mx-1 my-1 h-px bg-border",t),...e}));nCe.displayName=lq.displayName;function Ed(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 az(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function dq(...t){return e=>{let n=!1;const r=t.map(s=>{const i=az(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s{const{children:a,...o}=i,c=_.useMemo(()=>o,Object.values(o));return P.jsx(n.Provider,{value:c,children:a})};r.displayName=t+"Provider";function s(i){const a=_.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[r,s]}function sCe(t,e=[]){let n=[];function r(i,a){const o=_.createContext(a),c=n.length;n=[...n,a];const u=l=>{var g;const{scope:d,children:m,...p}=l,h=((g=d==null?void 0:d[t])==null?void 0:g[c])||o,y=_.useMemo(()=>p,Object.values(p));return P.jsx(h.Provider,{value:y,children:m})};u.displayName=i+"Provider";function f(l,d){var h;const m=((h=d==null?void 0:d[t])==null?void 0:h[c])||o,p=_.useContext(m);if(p)return p;if(a!==void 0)return a;throw new Error(`\`${l}\` must be used within \`${i}\``)}return[u,f]}const s=()=>{const i=n.map(a=>_.createContext(a));return function(o){const c=(o==null?void 0:o[t])||i;return _.useMemo(()=>({[`__scope${t}`]:{...o,[t]:c}}),[o,c])}};return s.scopeName=t,[r,iCe(s,...e)]}function iCe(...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 a=r.reduce((o,{useScope:c,scopeName:u})=>{const l=c(i)[`__scope${u}`];return{...o,...l}},{});return _.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var HI=_.forwardRef((t,e)=>{const{children:n,...r}=t,s=_.Children.toArray(n),i=s.find(aCe);if(i){const a=i.props.children,o=s.map(c=>c===i?_.Children.count(a)>1?_.Children.only(null):_.isValidElement(a)?a.props.children:null:c);return P.jsx(nD,{...r,ref:e,children:_.isValidElement(a)?_.cloneElement(a,void 0,o):null})}return P.jsx(nD,{...r,ref:e,children:n})});HI.displayName="Slot";var nD=_.forwardRef((t,e)=>{const{children:n,...r}=t;if(_.isValidElement(n)){const s=cCe(n),i=lCe(r,n.props);return n.type!==_.Fragment&&(i.ref=e?dq(e,s):s),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});nD.displayName="SlotClone";var oCe=({children:t})=>P.jsx(P.Fragment,{children:t});function aCe(t){return _.isValidElement(t)&&t.type===oCe}function lCe(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]=(...o)=>{i(...o),s(...o)}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function cCe(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 uCe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],nu=uCe.reduce((t,e)=>{const n=_.forwardRef((r,s)=>{const{asChild:i,...a}=r,o=i?HI:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(o,{...a,ref:s})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function dCe(t,e){t&&Ms.flushSync(()=>t.dispatchEvent(e))}var fCe="DismissableLayer",rD="dismissableLayer.update",hCe="dismissableLayer.pointerDownOutside",pCe="dismissableLayer.focusOutside",lz,fq=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),hq=_.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,onDismiss:o,...c}=t,u=_.useContext(fq),[f,l]=_.useState(null),d=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=_.useState({}),p=vp(e,R=>l(R)),h=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=h.indexOf(y),v=f?h.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,x=v>=g,A=vCe(R=>{const E=R.target,k=[...u.branches].some(N=>N.contains(E));!x||k||(s==null||s(R),a==null||a(R),R.defaultPrevented||o==null||o())},d),T=yCe(R=>{const E=R.target;[...u.branches].some(N=>N.contains(E))||(i==null||i(R),a==null||a(R),R.defaultPrevented||o==null||o())},d);return _6(R=>{v===u.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&o&&(R.preventDefault(),o()))},d),_.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(lz=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),cz(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=lz)}},[f,d,n,u]),_.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),cz())},[f,u]),_.useEffect(()=>{const R=()=>m({});return document.addEventListener(rD,R),()=>document.removeEventListener(rD,R)},[]),P.jsx(nu.div,{...c,ref:p,style:{pointerEvents:w?x?"auto":"none":void 0,...t.style},onFocusCapture:Ed(t.onFocusCapture,T.onFocusCapture),onBlurCapture:Ed(t.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Ed(t.onPointerDownCapture,A.onPointerDownCapture)})});hq.displayName=fCe;var mCe="DismissableLayerBranch",gCe=_.forwardRef((t,e)=>{const n=_.useContext(fq),r=_.useRef(null),s=vp(e,r);return _.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),P.jsx(nu.div,{...t,ref:s})});gCe.displayName=mCe;function vCe(t,e=globalThis==null?void 0:globalThis.document){const n=zt(t),r=_.useRef(!1),s=_.useRef(()=>{});return _.useEffect(()=>{const i=o=>{if(o.target&&!r.current){let c=function(){pq(hCe,n,u,{discrete:!0})};const u={originalEvent:o};o.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},a=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function yCe(t,e=globalThis==null?void 0:globalThis.document){const n=zt(t),r=_.useRef(!1);return _.useEffect(()=>{const s=i=>{i.target&&!r.current&&pq(pCe,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 cz(){const t=new CustomEvent(rD);document.dispatchEvent(t)}function pq(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?dCe(s,i):s.dispatchEvent(i)}var kT="focusScope.autoFocusOnMount",NT="focusScope.autoFocusOnUnmount",uz={bubbles:!1,cancelable:!0},bCe="FocusScope",mq=_.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=t,[o,c]=_.useState(null),u=zt(s),f=zt(i),l=_.useRef(null),d=vp(e,h=>c(h)),m=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let h=function(w){if(m.paused||!o)return;const x=w.target;o.contains(x)?l.current=x:xu(l.current,{select:!0})},y=function(w){if(m.paused||!o)return;const x=w.relatedTarget;x!==null&&(o.contains(x)||xu(l.current,{select:!0}))},g=function(w){if(document.activeElement===document.body)for(const A of w)A.removedNodes.length>0&&xu(o)};document.addEventListener("focusin",h),document.addEventListener("focusout",y);const v=new MutationObserver(g);return o&&v.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),v.disconnect()}}},[r,o,m.paused]),_.useEffect(()=>{if(o){fz.add(m);const h=document.activeElement;if(!o.contains(h)){const g=new CustomEvent(kT,uz);o.addEventListener(kT,u),o.dispatchEvent(g),g.defaultPrevented||(wCe(CCe(gq(o)),{select:!0}),document.activeElement===h&&xu(o))}return()=>{o.removeEventListener(kT,u),setTimeout(()=>{const g=new CustomEvent(NT,uz);o.addEventListener(NT,f),o.dispatchEvent(g),g.defaultPrevented||xu(h??document.body,{select:!0}),o.removeEventListener(NT,f),fz.remove(m)},0)}}},[o,u,f,m]);const p=_.useCallback(h=>{if(!n&&!r||m.paused)return;const y=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,g=document.activeElement;if(y&&g){const v=h.currentTarget,[w,x]=_Ce(v);w&&x?!h.shiftKey&&g===x?(h.preventDefault(),n&&xu(w,{select:!0})):h.shiftKey&&g===w&&(h.preventDefault(),n&&xu(x,{select:!0})):g===v&&h.preventDefault()}},[n,r,m.paused]);return P.jsx(nu.div,{tabIndex:-1,...a,ref:d,onKeyDown:p})});mq.displayName=bCe;function wCe(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(xu(r,{select:e}),document.activeElement!==n)return}function _Ce(t){const e=gq(t),n=dz(e,t),r=dz(e.reverse(),t);return[n,r]}function gq(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 dz(t,e){for(const n of t)if(!xCe(n,{upTo:e}))return n}function xCe(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 SCe(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&&SCe(t)&&e&&t.select()}}var fz=ECe();function ECe(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=hz(t,e),t.unshift(e)},remove(e){var n;t=hz(t,e),(n=t[0])==null||n.resume()}}}function hz(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function CCe(t){return t.filter(e=>e.tagName!=="A")}var ACe="Portal",vq=_.forwardRef((t,e)=>{var o;const{container:n,...r}=t,[s,i]=_.useState(!1);$n(()=>i(!0),[]);const a=n||s&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?l_.createPortal(P.jsx(nu.div,{...r,ref:e}),a):null});vq.displayName=ACe;function RCe(t,e){return _.useReducer((n,r)=>e[n][r]??n,t)}var _A=t=>{const{present:e,children:n}=t,r=PCe(e),s=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),i=vp(r.ref,TCe(s));return typeof n=="function"||r.isPresent?_.cloneElement(s,{ref:i}):null};_A.displayName="Presence";function PCe(t){const[e,n]=_.useState(),r=_.useRef({}),s=_.useRef(t),i=_.useRef("none"),a=t?"mounted":"unmounted",[o,c]=RCe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const u=mS(r.current);i.current=o==="mounted"?u:"none"},[o]),$n(()=>{const u=r.current,f=s.current;if(f!==t){const d=i.current,m=mS(u);t?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&d!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,c]),$n(()=>{if(e){let u;const f=e.ownerDocument.defaultView??window,l=m=>{const h=mS(r.current).includes(m.animationName);if(m.target===e&&h&&(c("ANIMATION_END"),!s.current)){const y=e.style.animationFillMode;e.style.animationFillMode="forwards",u=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=y)})}},d=m=>{m.target===e&&(i.current=mS(r.current))};return e.addEventListener("animationstart",d),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{f.clearTimeout(u),e.removeEventListener("animationstart",d),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:_.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function mS(t){return(t==null?void 0:t.animationName)||"none"}function TCe(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 DT=0;function kCe(){_.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??pz()),document.body.insertAdjacentElement("beforeend",t[1]??pz()),DT++,()=>{DT===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),DT--}},[])}function pz(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var yq=AL(),OT=function(){},xA=_.forwardRef(function(t,e){var n=_.useRef(null),r=_.useState({onScrollCapture:OT,onWheelCapture:OT,onTouchMoveCapture:OT}),s=r[0],i=r[1],a=t.forwardProps,o=t.children,c=t.className,u=t.removeScrollBar,f=t.enabled,l=t.shards,d=t.sideCar,m=t.noIsolation,p=t.inert,h=t.allowPinchZoom,y=t.as,g=y===void 0?"div":y,v=t.gapMode,w=K1(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=d,A=CL([n,e]),T=mr(mr({},w),s);return _.createElement(_.Fragment,null,f&&_.createElement(x,{sideCar:yq,removeScrollBar:u,shards:l,noIsolation:m,inert:p,setCallbacks:i,allowPinchZoom:!!h,lockRef:n,gapMode:v}),a?_.cloneElement(_.Children.only(o),mr(mr({},T),{ref:A})):_.createElement(g,mr({},T,{className:c,ref:A}),o))});xA.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};xA.classNames={fullWidth:zm,zeroRight:Bm};var sD=!1;if(typeof window<"u")try{var gS=Object.defineProperty({},"passive",{get:function(){return sD=!0,!0}});window.addEventListener("test",gS,gS),window.removeEventListener("test",gS,gS)}catch{sD=!1}var qp=sD?{passive:!1}:!1,NCe=function(t){return t.tagName==="TEXTAREA"},bq=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!NCe(t)&&n[e]==="visible")},DCe=function(t){return bq(t,"overflowY")},OCe=function(t){return bq(t,"overflowX")},mz=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=wq(t,r);if(s){var i=_q(t,r),a=i[1],o=i[2];if(a>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},MCe=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},LCe=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},wq=function(t,e){return t==="v"?DCe(e):OCe(e)},_q=function(t,e){return t==="v"?MCe(e):LCe(e)},ICe=function(t,e){return t==="h"&&e==="rtl"?-1:1},$Ce=function(t,e,n,r,s){var i=ICe(t,window.getComputedStyle(e).direction),a=i*r,o=n.target,c=e.contains(o),u=!1,f=a>0,l=0,d=0;do{var m=_q(t,o),p=m[0],h=m[1],y=m[2],g=h-y-i*p;(p||g)&&wq(t,o)&&(l+=g,d+=p),o instanceof ShadowRoot?o=o.host:o=o.parentNode}while(!c&&o!==document.body||c&&(e.contains(o)||e===o));return(f&&Math.abs(l)<1||!f&&Math.abs(d)<1)&&(u=!0),u},vS=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},gz=function(t){return[t.deltaX,t.deltaY]},vz=function(t){return t&&"current"in t?t.current:t},FCe=function(t,e){return t[0]===e[0]&&t[1]===e[1]},jCe=function(t){return` +For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return _.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},dxe="DialogDescriptionWarning",fxe=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${I8(dxe).contentName}}.`;return _.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},hxe=A8,pxe=T8,mxe=k8,gxe=N8,Ry='[cmdk-group=""]',RT='[cmdk-group-items=""]',vxe='[cmdk-group-heading=""]',$8='[cmdk-item=""]',XB=`${$8}:not([aria-disabled="true"])`,QN="cmdk-item-select",im="data-value",yxe=(t,e,n)=>l_e(t,e,n),F8=_.createContext(void 0),E_=()=>_.useContext(F8),j8=_.createContext(void 0),hI=()=>_.useContext(j8),B8=_.createContext(void 0),z8=_.forwardRef((t,e)=>{let n=om(()=>{var q,K;return{search:"",value:(K=(q=t.value)!=null?q:t.defaultValue)!=null?K:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=om(()=>new Set),s=om(()=>new Map),i=om(()=>new Map),a=om(()=>new Set),o=U8(t),{label:c,children:u,value:f,onValueChange:l,filter:d,shouldFilter:m,loop:p,disablePointerSelection:h=!1,vimBindings:y=!0,...g}=t,v=Oc(),w=Oc(),x=Oc(),A=_.useRef(null),T=Txe();Yh(()=>{if(f!==void 0){let q=f.trim();n.current.value=q,R.emit()}},[f]),Yh(()=>{T(6,I)},[]);let R=_.useMemo(()=>({subscribe:q=>(a.current.add(q),()=>a.current.delete(q)),snapshot:()=>n.current,setState:(q,K,Z)=>{var ue,de,ie,be;if(!Object.is(n.current[q],K)){if(n.current[q]=K,q==="search")L(),N(),T(1,O);else if(q==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Ae=document.getElementById(x);Ae?Ae.focus():(ue=document.getElementById(v))==null||ue.focus()}if(T(7,()=>{var Ae;n.current.selectedItemId=(Ae=F())==null?void 0:Ae.id,R.emit()}),Z||T(5,I),((de=o.current)==null?void 0:de.value)!==void 0){let Ae=K??"";(be=(ie=o.current).onValueChange)==null||be.call(ie,Ae);return}}R.emit()}},emit:()=>{a.current.forEach(q=>q())}}),[]),E=_.useMemo(()=>({value:(q,K,Z)=>{var ue;K!==((ue=i.current.get(q))==null?void 0:ue.value)&&(i.current.set(q,{value:K,keywords:Z}),n.current.filtered.items.set(q,k(K,Z)),T(2,()=>{N(),R.emit()}))},item:(q,K)=>(r.current.add(q),K&&(s.current.has(K)?s.current.get(K).add(q):s.current.set(K,new Set([q]))),T(3,()=>{L(),N(),n.current.value||O(),R.emit()}),()=>{i.current.delete(q),r.current.delete(q),n.current.filtered.items.delete(q);let Z=F();T(4,()=>{L(),(Z==null?void 0:Z.getAttribute("id"))===q&&O(),R.emit()})}),group:q=>(s.current.has(q)||s.current.set(q,new Set),()=>{i.current.delete(q),s.current.delete(q)}),filter:()=>o.current.shouldFilter,label:c||t["aria-label"],getDisablePointerSelection:()=>o.current.disablePointerSelection,listId:v,inputId:x,labelId:w,listInnerRef:A}),[]);function k(q,K){var Z,ue;let de=(ue=(Z=o.current)==null?void 0:Z.filter)!=null?ue:yxe;return q?de(q,n.current.search,K):0}function N(){if(!n.current.search||o.current.shouldFilter===!1)return;let q=n.current.filtered.items,K=[];n.current.filtered.groups.forEach(ue=>{let de=s.current.get(ue),ie=0;de.forEach(be=>{let Ae=q.get(be);ie=Math.max(Ae,ie)}),K.push([ue,ie])});let Z=A.current;U().sort((ue,de)=>{var ie,be;let Ae=ue.getAttribute("id"),_e=de.getAttribute("id");return((ie=q.get(_e))!=null?ie:0)-((be=q.get(Ae))!=null?be:0)}).forEach(ue=>{let de=ue.closest(RT);de?de.appendChild(ue.parentElement===de?ue:ue.closest(`${RT} > *`)):Z.appendChild(ue.parentElement===Z?ue:ue.closest(`${RT} > *`))}),K.sort((ue,de)=>de[1]-ue[1]).forEach(ue=>{var de;let ie=(de=A.current)==null?void 0:de.querySelector(`${Ry}[${im}="${encodeURIComponent(ue[0])}"]`);ie==null||ie.parentElement.appendChild(ie)})}function O(){let q=U().find(Z=>Z.getAttribute("aria-disabled")!=="true"),K=q==null?void 0:q.getAttribute(im);R.setState("value",K||void 0)}function L(){var q,K,Z,ue;if(!n.current.search||o.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let de=0;for(let ie of r.current){let be=(K=(q=i.current.get(ie))==null?void 0:q.value)!=null?K:"",Ae=(ue=(Z=i.current.get(ie))==null?void 0:Z.keywords)!=null?ue:[],_e=k(be,Ae);n.current.filtered.items.set(ie,_e),_e>0&&de++}for(let[ie,be]of s.current)for(let Ae of be)if(n.current.filtered.items.get(Ae)>0){n.current.filtered.groups.add(ie);break}n.current.filtered.count=de}function I(){var q,K,Z;let ue=F();ue&&(((q=ue.parentElement)==null?void 0:q.firstChild)===ue&&((Z=(K=ue.closest(Ry))==null?void 0:K.querySelector(vxe))==null||Z.scrollIntoView({block:"nearest"})),ue.scrollIntoView({block:"nearest"}))}function F(){var q;return(q=A.current)==null?void 0:q.querySelector(`${$8}[aria-selected="true"]`)}function U(){var q;return Array.from(((q=A.current)==null?void 0:q.querySelectorAll(XB))||[])}function Y(q){let K=U()[q];K&&R.setState("value",K.getAttribute(im))}function V(q){var K;let Z=F(),ue=U(),de=ue.findIndex(be=>be===Z),ie=ue[de+q];(K=o.current)!=null&&K.loop&&(ie=de+q<0?ue[ue.length-1]:de+q===ue.length?ue[0]:ue[de+q]),ie&&R.setState("value",ie.getAttribute(im))}function H(q){let K=F(),Z=K==null?void 0:K.closest(Ry),ue;for(;Z&&!ue;)Z=q>0?Rxe(Z,Ry):Pxe(Z,Ry),ue=Z==null?void 0:Z.querySelector(XB);ue?R.setState("value",ue.getAttribute(im)):V(q)}let ee=()=>Y(U().length-1),re=q=>{q.preventDefault(),q.metaKey?ee():q.altKey?H(1):V(1)},X=q=>{q.preventDefault(),q.metaKey?Y(0):q.altKey?H(-1):V(-1)};return _.createElement(gs.div,{ref:e,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:q=>{var K;(K=g.onKeyDown)==null||K.call(g,q);let Z=q.nativeEvent.isComposing||q.keyCode===229;if(!(q.defaultPrevented||Z))switch(q.key){case"n":case"j":{y&&q.ctrlKey&&re(q);break}case"ArrowDown":{re(q);break}case"p":case"k":{y&&q.ctrlKey&&X(q);break}case"ArrowUp":{X(q);break}case"Home":{q.preventDefault(),Y(0);break}case"End":{q.preventDefault(),ee();break}case"Enter":{q.preventDefault();let ue=F();if(ue){let de=new Event(QN);ue.dispatchEvent(de)}}}}},_.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:Nxe},c),pA(t,q=>_.createElement(j8.Provider,{value:R},_.createElement(F8.Provider,{value:E},q))))}),bxe=_.forwardRef((t,e)=>{var n,r;let s=Oc(),i=_.useRef(null),a=_.useContext(B8),o=E_(),c=U8(t),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:a==null?void 0:a.forceMount;Yh(()=>{if(!u)return o.item(s,a==null?void 0:a.id)},[u]);let f=H8(s,i,[t.value,t.children,i],t.keywords),l=hI(),d=Rd(T=>T.value&&T.value===f.current),m=Rd(T=>u||o.filter()===!1?!0:T.search?T.filtered.items.get(s)>0:!0);_.useEffect(()=>{let T=i.current;if(!(!T||t.disabled))return T.addEventListener(QN,p),()=>T.removeEventListener(QN,p)},[m,t.onSelect,t.disabled]);function p(){var T,R;h(),(R=(T=c.current).onSelect)==null||R.call(T,f.current)}function h(){l.setState("value",f.current,!0)}if(!m)return null;let{disabled:y,value:g,onSelect:v,forceMount:w,keywords:x,...A}=t;return _.createElement(gs.div,{ref:Gh(i,e),...A,id:s,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!d,"data-disabled":!!y,"data-selected":!!d,onPointerMove:y||o.getDisablePointerSelection()?void 0:h,onClick:y?void 0:p},t.children)}),wxe=_.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:s,...i}=t,a=Oc(),o=_.useRef(null),c=_.useRef(null),u=Oc(),f=E_(),l=Rd(m=>s||f.filter()===!1?!0:m.search?m.filtered.groups.has(a):!0);Yh(()=>f.group(a),[]),H8(a,o,[t.value,t.heading,c]);let d=_.useMemo(()=>({id:a,forceMount:s}),[s]);return _.createElement(gs.div,{ref:Gh(o,e),...i,"cmdk-group":"",role:"presentation",hidden:l?void 0:!0},n&&_.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),pA(t,m=>_.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},_.createElement(B8.Provider,{value:d},m))))}),_xe=_.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,s=_.useRef(null),i=Rd(a=>!a.search);return!n&&!i?null:_.createElement(gs.div,{ref:Gh(s,e),...r,"cmdk-separator":"",role:"separator"})}),xxe=_.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,s=t.value!=null,i=hI(),a=Rd(u=>u.search),o=Rd(u=>u.selectedItemId),c=E_();return _.useEffect(()=>{t.value!=null&&i.setState("search",t.value)},[t.value]),_.createElement(gs.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":o,id:c.inputId,type:"text",value:s?t.value:a,onChange:u=>{s||i.setState("search",u.target.value),n==null||n(u.target.value)}})}),Sxe=_.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...s}=t,i=_.useRef(null),a=_.useRef(null),o=Rd(u=>u.selectedItemId),c=E_();return _.useEffect(()=>{if(a.current&&i.current){let u=a.current,f=i.current,l,d=new ResizeObserver(()=>{l=requestAnimationFrame(()=>{let m=u.offsetHeight;f.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return d.observe(u),()=>{cancelAnimationFrame(l),d.unobserve(u)}}},[]),_.createElement(gs.div,{ref:Gh(i,e),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":r,id:c.listId},pA(t,u=>_.createElement("div",{ref:Gh(a,c.listInnerRef),"cmdk-list-sizer":""},u)))}),Exe=_.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:a,...o}=t;return _.createElement(hxe,{open:n,onOpenChange:r},_.createElement(pxe,{container:a},_.createElement(mxe,{"cmdk-overlay":"",className:s}),_.createElement(gxe,{"aria-label":t.label,"cmdk-dialog":"",className:i},_.createElement(z8,{ref:e,...o}))))}),Cxe=_.forwardRef((t,e)=>Rd(n=>n.filtered.count===0)?_.createElement(gs.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),Axe=_.forwardRef((t,e)=>{let{progress:n,children:r,label:s="Loading...",...i}=t;return _.createElement(gs.div,{ref:e,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},pA(t,a=>_.createElement("div",{"aria-hidden":!0},a)))}),Ni=Object.assign(z8,{List:Sxe,Item:bxe,Input:xxe,Group:wxe,Separator:_xe,Dialog:Exe,Empty:Cxe,Loading:Axe});function Rxe(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function Pxe(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function U8(t){let e=_.useRef(t);return Yh(()=>{e.current=t}),e}var Yh=typeof window>"u"?_.useEffect:_.useLayoutEffect;function om(t){let e=_.useRef();return e.current===void 0&&(e.current=t()),e}function Rd(t){let e=hI(),n=()=>t(e.snapshot());return _.useSyncExternalStore(e.subscribe,n,n)}function H8(t,e,n,r=[]){let s=_.useRef(),i=E_();return Yh(()=>{var a;let o=(()=>{var u;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(u=f.current.textContent)==null?void 0:u.trim():s.current}})(),c=r.map(u=>u.trim());i.value(t,o,c),(a=e.current)==null||a.setAttribute(im,o),s.current=o}),s}var Txe=()=>{let[t,e]=_.useState(),n=om(()=>new Map);return Yh(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,s)=>{n.current.set(r,s),e({})}};function kxe(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function pA({asChild:t,children:e},n){return t&&_.isValidElement(e)?_.cloneElement(kxe(e),{ref:e.ref},n(e.props.children)):n(e)}var Nxe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Dxe=OL,Oxe=ML,Mxe=LL,cUe=y_,V8=_.forwardRef(({className:t,...e},n)=>P.jsx(p_,{ref:n,className:le("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}));V8.displayName=p_.displayName;const W8=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(Mxe,{children:[P.jsx(V8,{}),P.jsxs(m_,{ref:r,className:le("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,P.jsxs(y_,{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:[P.jsx(xL,{className:"h-4 w-4"}),P.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));W8.displayName=m_.displayName;const G8=({className:t,...e})=>P.jsx("div",{className:le("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});G8.displayName="DialogHeader";const q8=({className:t,...e})=>P.jsx("div",{className:le("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});q8.displayName="DialogFooter";const K8=_.forwardRef(({className:t,...e},n)=>P.jsx(g_,{ref:n,className:le("text-lg font-semibold leading-none tracking-tight",t),...e}));K8.displayName=g_.displayName;const Y8=_.forwardRef(({className:t,...e},n)=>P.jsx(v_,{ref:n,className:le("text-sm text-muted-foreground",t),...e}));Y8.displayName=v_.displayName;const Lxe=_.forwardRef(({className:t,...e},n)=>P.jsx(Ni,{ref:n,className:le("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));Lxe.displayName=Ni.displayName;const Ixe=_.forwardRef(({className:t,...e},n)=>P.jsxs("div",{className:"flex items-center px-3 border-b","cmdk-input-wrapper":"",children:[P.jsx(Wfe,{className:"w-4 h-4 mr-2 opacity-50 shrink-0"}),P.jsx(Ni.Input,{ref:n,className:le("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})]}));Ixe.displayName=Ni.Input.displayName;const $xe=_.forwardRef(({className:t,...e},n)=>P.jsx(Ni.List,{ref:n,className:le("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));$xe.displayName=Ni.List.displayName;const Fxe=_.forwardRef((t,e)=>P.jsx(Ni.Empty,{ref:e,className:"py-6 text-sm text-center",...t}));Fxe.displayName=Ni.Empty.displayName;const jxe=_.forwardRef(({className:t,...e},n)=>P.jsx(Ni.Group,{ref:n,className:le("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}));jxe.displayName=Ni.Group.displayName;const Bxe=_.forwardRef(({className:t,...e},n)=>P.jsx(Ni.Separator,{ref:n,className:le("-mx-1 h-px bg-border",t),...e}));Bxe.displayName=Ni.Separator.displayName;const zxe=_.forwardRef(({className:t,...e},n)=>P.jsx(Ni.Item,{ref:n,className:le("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}));zxe.displayName=Ni.Item.displayName;const Uxe=["top","right","bottom","left"],pl=Math.min,ro=Math.max,fC=Math.round,hS=Math.floor,Pd=t=>({x:t,y:t}),Hxe={left:"right",right:"left",bottom:"top",top:"bottom"},Vxe={start:"end",end:"start"};function ZN(t,e,n){return ro(t,pl(e,n))}function Vc(t,e){return typeof t=="function"?t(e):t}function Wc(t){return t.split("-")[0]}function Lv(t){return t.split("-")[1]}function pI(t){return t==="x"?"y":"x"}function mI(t){return t==="y"?"height":"width"}function Td(t){return["top","bottom"].includes(Wc(t))?"y":"x"}function gI(t){return pI(Td(t))}function Wxe(t,e,n){n===void 0&&(n=!1);const r=Lv(t),s=gI(t),i=mI(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=hC(a)),[a,hC(a)]}function Gxe(t){const e=hC(t);return[JN(t),e,JN(e)]}function JN(t){return t.replace(/start|end/g,e=>Vxe[e])}function qxe(t,e,n){const r=["left","right"],s=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?s:r:e?r:s;case"left":case"right":return e?i:a;default:return[]}}function Kxe(t,e,n,r){const s=Lv(t);let i=qxe(Wc(t),n==="start",r);return s&&(i=i.map(a=>a+"-"+s),e&&(i=i.concat(i.map(JN)))),i}function hC(t){return t.replace(/left|right|bottom|top/g,e=>Hxe[e])}function Yxe(t){return{top:0,right:0,bottom:0,left:0,...t}}function X8(t){return typeof t!="number"?Yxe(t):{top:t,right:t,bottom:t,left:t}}function pC(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 QB(t,e,n){let{reference:r,floating:s}=t;const i=Td(e),a=gI(e),o=mI(a),c=Wc(e),u=i==="y",f=r.x+r.width/2-s.width/2,l=r.y+r.height/2-s.height/2,d=r[o]/2-s[o]/2;let m;switch(c){case"top":m={x:f,y:r.y-s.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:l};break;case"left":m={x:r.x-s.width,y:l};break;default:m={x:r.x,y:r.y}}switch(Lv(e)){case"start":m[a]-=d*(n&&u?-1:1);break;case"end":m[a]+=d*(n&&u?-1:1);break}return m}const Xxe=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:a}=n,o=i.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(e));let u=await a.getElementRects({reference:t,floating:e,strategy:s}),{x:f,y:l}=QB(u,r,c),d=r,m={},p=0;for(let h=0;h({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:a,elements:o,middlewareData:c}=e,{element:u,padding:f=0}=Vc(t,e)||{};if(u==null)return{};const l=X8(f),d={x:n,y:r},m=gI(s),p=mI(m),h=await a.getDimensions(u),y=m==="y",g=y?"top":"left",v=y?"bottom":"right",w=y?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[m]-d[m]-i.floating[p],A=d[m]-i.reference[m],T=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let R=T?T[w]:0;(!R||!await(a.isElement==null?void 0:a.isElement(T)))&&(R=o.floating[w]||i.floating[p]);const E=x/2-A/2,k=R/2-h[p]/2-1,N=pl(l[g],k),O=pl(l[v],k),L=N,I=R-h[p]-O,F=R/2-h[p]/2+E,U=ZN(L,F,I),Y=!c.arrow&&Lv(s)!=null&&F!==U&&i.reference[p]/2-(FF<=0)){var O,L;const F=(((O=i.flip)==null?void 0:O.index)||0)+1,U=R[F];if(U)return{data:{index:F,overflows:N},reset:{placement:U}};let Y=(L=N.filter(V=>V.overflows[0]<=0).sort((V,H)=>V.overflows[1]-H.overflows[1])[0])==null?void 0:L.placement;if(!Y)switch(m){case"bestFit":{var I;const V=(I=N.filter(H=>{if(T){const ee=Td(H.placement);return ee===v||ee==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(ee=>ee>0).reduce((ee,re)=>ee+re,0)]).sort((H,ee)=>H[1]-ee[1])[0])==null?void 0:I[0];V&&(Y=V);break}case"initialPlacement":Y=o;break}if(s!==Y)return{reset:{placement:Y}}}return{}}}};function ZB(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function JB(t){return Uxe.some(e=>t[e]>=0)}const Jxe=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...s}=Vc(t,e);switch(r){case"referenceHidden":{const i=await r0(e,{...s,elementContext:"reference"}),a=ZB(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:JB(a)}}}case"escaped":{const i=await r0(e,{...s,altBoundary:!0}),a=ZB(i,n.floating);return{data:{escapedOffsets:a,escaped:JB(a)}}}default:return{}}}}};async function eSe(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=Wc(n),o=Lv(n),c=Td(n)==="y",u=["left","top"].includes(a)?-1:1,f=i&&c?-1:1,l=Vc(e,t);let{mainAxis:d,crossAxis:m,alignmentAxis:p}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...l};return o&&typeof p=="number"&&(m=o==="end"?p*-1:p),c?{x:m*f,y:d*u}:{x:d*u,y:m*f}}const tSe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:a,middlewareData:o}=e,c=await eSe(e,t);return a===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:a}}}}},nSe=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:a=!1,limiter:o={fn:y=>{let{x:g,y:v}=y;return{x:g,y:v}}},...c}=Vc(t,e),u={x:n,y:r},f=await r0(e,c),l=Td(Wc(s)),d=pI(l);let m=u[d],p=u[l];if(i){const y=d==="y"?"top":"left",g=d==="y"?"bottom":"right",v=m+f[y],w=m-f[g];m=ZN(v,m,w)}if(a){const y=l==="y"?"top":"left",g=l==="y"?"bottom":"right",v=p+f[y],w=p-f[g];p=ZN(v,p,w)}const h=o.fn({...e,[d]:m,[l]:p});return{...h,data:{x:h.x-n,y:h.y-r}}}}},rSe=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:s,rects:i,middlewareData:a}=e,{offset:o=0,mainAxis:c=!0,crossAxis:u=!0}=Vc(t,e),f={x:n,y:r},l=Td(s),d=pI(l);let m=f[d],p=f[l];const h=Vc(o,e),y=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const w=d==="y"?"height":"width",x=i.reference[d]-i.floating[w]+y.mainAxis,A=i.reference[d]+i.reference[w]-y.mainAxis;mA&&(m=A)}if(u){var g,v;const w=d==="y"?"width":"height",x=["top","left"].includes(Wc(s)),A=i.reference[l]-i.floating[w]+(x&&((g=a.offset)==null?void 0:g[l])||0)+(x?0:y.crossAxis),T=i.reference[l]+i.reference[w]+(x?0:((v=a.offset)==null?void 0:v[l])||0)-(x?y.crossAxis:0);pT&&(p=T)}return{[d]:m,[l]:p}}}},sSe=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:a=()=>{},...o}=Vc(t,e),c=await r0(e,o),u=Wc(n),f=Lv(n),l=Td(n)==="y",{width:d,height:m}=r.floating;let p,h;u==="top"||u==="bottom"?(p=u,h=f===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(h=u,p=f==="end"?"top":"bottom");const y=m-c.top-c.bottom,g=d-c.left-c.right,v=pl(m-c[p],y),w=pl(d-c[h],g),x=!e.middlewareData.shift;let A=v,T=w;if(l?T=f||x?pl(w,g):g:A=f||x?pl(v,y):y,x&&!f){const E=ro(c.left,0),k=ro(c.right,0),N=ro(c.top,0),O=ro(c.bottom,0);l?T=d-2*(E!==0||k!==0?E+k:ro(c.left,c.right)):A=m-2*(N!==0||O!==0?N+O:ro(c.top,c.bottom))}await a({...e,availableWidth:T,availableHeight:A});const R=await s.getDimensions(i.floating);return d!==R.width||m!==R.height?{reset:{rects:!0}}:{}}}};function Iv(t){return Q8(t)?(t.nodeName||"").toLowerCase():"#document"}function lo(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function tu(t){var e;return(e=(Q8(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Q8(t){return t instanceof Node||t instanceof lo(t).Node}function Sl(t){return t instanceof Element||t instanceof lo(t).Element}function El(t){return t instanceof HTMLElement||t instanceof lo(t).HTMLElement}function ez(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof lo(t).ShadowRoot}function C_(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=Ta(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(s)}function iSe(t){return["table","td","th"].includes(Iv(t))}function mA(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function vI(t){const e=yI(),n=Ta(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 oSe(t){let e=kd(t);for(;El(e)&&!pv(e);){if(mA(e))return null;if(vI(e))return e;e=kd(e)}return null}function yI(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function pv(t){return["html","body","#document"].includes(Iv(t))}function Ta(t){return lo(t).getComputedStyle(t)}function gA(t){return Sl(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function kd(t){if(Iv(t)==="html")return t;const e=t.assignedSlot||t.parentNode||ez(t)&&t.host||tu(t);return ez(e)?e.host:e}function Z8(t){const e=kd(t);return pv(e)?t.ownerDocument?t.ownerDocument.body:t.body:El(e)&&C_(e)?e:Z8(e)}function s0(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=Z8(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),a=lo(s);return i?e.concat(a,a.visualViewport||[],C_(s)?s:[],a.frameElement&&n?s0(a.frameElement):[]):e.concat(s,s0(s,[],n))}function J8(t){const e=Ta(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=El(t),i=s?t.offsetWidth:n,a=s?t.offsetHeight:r,o=fC(n)!==i||fC(r)!==a;return o&&(n=i,r=a),{width:n,height:r,$:o}}function bI(t){return Sl(t)?t:t.contextElement}function Vm(t){const e=bI(t);if(!El(e))return Pd(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=J8(e);let a=(i?fC(n.width):n.width)/r,o=(i?fC(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const aSe=Pd(0);function eG(t){const e=lo(t);return!yI()||!e.visualViewport?aSe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function lSe(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==lo(t)?!1:e}function Xh(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=bI(t);let a=Pd(1);e&&(r?Sl(r)&&(a=Vm(r)):a=Vm(t));const o=lSe(i,n,r)?eG(i):Pd(0);let c=(s.left+o.x)/a.x,u=(s.top+o.y)/a.y,f=s.width/a.x,l=s.height/a.y;if(i){const d=lo(i),m=r&&Sl(r)?lo(r):r;let p=d,h=p.frameElement;for(;h&&r&&m!==p;){const y=Vm(h),g=h.getBoundingClientRect(),v=Ta(h),w=g.left+(h.clientLeft+parseFloat(v.paddingLeft))*y.x,x=g.top+(h.clientTop+parseFloat(v.paddingTop))*y.y;c*=y.x,u*=y.y,f*=y.x,l*=y.y,c+=w,u+=x,p=lo(h),h=p.frameElement}}return pC({width:f,height:l,x:c,y:u})}function cSe(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",a=tu(r),o=e?mA(e.floating):!1;if(r===a||o&&i)return n;let c={scrollLeft:0,scrollTop:0},u=Pd(1);const f=Pd(0),l=El(r);if((l||!l&&!i)&&((Iv(r)!=="body"||C_(a))&&(c=gA(r)),El(r))){const d=Xh(r);u=Vm(r),f.x=d.x+r.clientLeft,f.y=d.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+f.x,y:n.y*u.y-c.scrollTop*u.y+f.y}}function uSe(t){return Array.from(t.getClientRects())}function tG(t){return Xh(tu(t)).left+gA(t).scrollLeft}function dSe(t){const e=tu(t),n=gA(t),r=t.ownerDocument.body,s=ro(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=ro(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+tG(t);const o=-n.scrollTop;return Ta(r).direction==="rtl"&&(a+=ro(e.clientWidth,r.clientWidth)-s),{width:s,height:i,x:a,y:o}}function fSe(t,e){const n=lo(t),r=tu(t),s=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,o=0,c=0;if(s){i=s.width,a=s.height;const u=yI();(!u||u&&e==="fixed")&&(o=s.offsetLeft,c=s.offsetTop)}return{width:i,height:a,x:o,y:c}}function hSe(t,e){const n=Xh(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=El(t)?Vm(t):Pd(1),a=t.clientWidth*i.x,o=t.clientHeight*i.y,c=s*i.x,u=r*i.y;return{width:a,height:o,x:c,y:u}}function tz(t,e,n){let r;if(e==="viewport")r=fSe(t,n);else if(e==="document")r=dSe(tu(t));else if(Sl(e))r=hSe(e,n);else{const s=eG(t);r={...e,x:e.x-s.x,y:e.y-s.y}}return pC(r)}function nG(t,e){const n=kd(t);return n===e||!Sl(n)||pv(n)?!1:Ta(n).position==="fixed"||nG(n,e)}function pSe(t,e){const n=e.get(t);if(n)return n;let r=s0(t,[],!1).filter(o=>Sl(o)&&Iv(o)!=="body"),s=null;const i=Ta(t).position==="fixed";let a=i?kd(t):t;for(;Sl(a)&&!pv(a);){const o=Ta(a),c=vI(a);!c&&o.position==="fixed"&&(s=null),(i?!c&&!s:!c&&o.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||C_(a)&&!c&&nG(t,a))?r=r.filter(f=>f!==a):s=o,a=kd(a)}return e.set(t,r),r}function mSe(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const a=[...n==="clippingAncestors"?mA(e)?[]:pSe(e,this._c):[].concat(n),r],o=a[0],c=a.reduce((u,f)=>{const l=tz(e,f,s);return u.top=ro(l.top,u.top),u.right=pl(l.right,u.right),u.bottom=pl(l.bottom,u.bottom),u.left=ro(l.left,u.left),u},tz(e,o,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function gSe(t){const{width:e,height:n}=J8(t);return{width:e,height:n}}function vSe(t,e,n){const r=El(e),s=tu(e),i=n==="fixed",a=Xh(t,!0,i,e);let o={scrollLeft:0,scrollTop:0};const c=Pd(0);if(r||!r&&!i)if((Iv(e)!=="body"||C_(s))&&(o=gA(e)),r){const l=Xh(e,!0,i,e);c.x=l.x+e.clientLeft,c.y=l.y+e.clientTop}else s&&(c.x=tG(s));const u=a.left+o.scrollLeft-c.x,f=a.top+o.scrollTop-c.y;return{x:u,y:f,width:a.width,height:a.height}}function PT(t){return Ta(t).position==="static"}function nz(t,e){return!El(t)||Ta(t).position==="fixed"?null:e?e(t):t.offsetParent}function rG(t,e){const n=lo(t);if(mA(t))return n;if(!El(t)){let s=kd(t);for(;s&&!pv(s);){if(Sl(s)&&!PT(s))return s;s=kd(s)}return n}let r=nz(t,e);for(;r&&iSe(r)&&PT(r);)r=nz(r,e);return r&&pv(r)&&PT(r)&&!vI(r)?n:r||oSe(t)||n}const ySe=async function(t){const e=this.getOffsetParent||rG,n=this.getDimensions,r=await n(t.floating);return{reference:vSe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function bSe(t){return Ta(t).direction==="rtl"}const wSe={convertOffsetParentRelativeRectToViewportRelativeRect:cSe,getDocumentElement:tu,getClippingRect:mSe,getOffsetParent:rG,getElementRects:ySe,getClientRects:uSe,getDimensions:gSe,getScale:Vm,isElement:Sl,isRTL:bSe};function _Se(t,e){let n=null,r;const s=tu(t);function i(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function a(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),i();const{left:u,top:f,width:l,height:d}=t.getBoundingClientRect();if(o||e(),!l||!d)return;const m=hS(f),p=hS(s.clientWidth-(u+l)),h=hS(s.clientHeight-(f+d)),y=hS(u),v={rootMargin:-m+"px "+-p+"px "+-h+"px "+-y+"px",threshold:ro(0,pl(1,c))||1};let w=!0;function x(A){const T=A[0].intersectionRatio;if(T!==c){if(!w)return a();T?a(!1,T):r=setTimeout(()=>{a(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(x,{...v,root:s.ownerDocument})}catch{n=new IntersectionObserver(x,v)}n.observe(t)}return a(!0),i}function xSe(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=bI(t),f=s||i?[...u?s0(u):[],...s0(e)]:[];f.forEach(g=>{s&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const l=u&&o?_Se(u,n):null;let d=-1,m=null;a&&(m=new ResizeObserver(g=>{let[v]=g;v&&v.target===u&&m&&(m.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(e)})),n()}),u&&!c&&m.observe(u),m.observe(e));let p,h=c?Xh(t):null;c&&y();function y(){const g=Xh(t);h&&(g.x!==h.x||g.y!==h.y||g.width!==h.width||g.height!==h.height)&&n(),h=g,p=requestAnimationFrame(y)}return n(),()=>{var g;f.forEach(v=>{s&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),l==null||l(),(g=m)==null||g.disconnect(),m=null,c&&cancelAnimationFrame(p)}}const SSe=tSe,ESe=nSe,CSe=Zxe,ASe=sSe,RSe=Jxe,rz=Qxe,PSe=rSe,TSe=(t,e,n)=>{const r=new Map,s={platform:wSe,...n},i={...s.platform,_c:r};return Xxe(t,e,{...s,platform:i})};var YS=typeof document<"u"?_.useLayoutEffect:_.useEffect;function mC(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(!mC(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)&&!mC(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function sG(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function sz(t,e){const n=sG(t);return Math.round(e*n)/n}function iz(t){const e=_.useRef(t);return YS(()=>{e.current=t}),e}function kSe(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:a}={},transform:o=!0,whileElementsMounted:c,open:u}=t,[f,l]=_.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[d,m]=_.useState(r);mC(d,r)||m(r);const[p,h]=_.useState(null),[y,g]=_.useState(null),v=_.useCallback(V=>{V!==T.current&&(T.current=V,h(V))},[]),w=_.useCallback(V=>{V!==R.current&&(R.current=V,g(V))},[]),x=i||p,A=a||y,T=_.useRef(null),R=_.useRef(null),E=_.useRef(f),k=c!=null,N=iz(c),O=iz(s),L=_.useCallback(()=>{if(!T.current||!R.current)return;const V={placement:e,strategy:n,middleware:d};O.current&&(V.platform=O.current),TSe(T.current,R.current,V).then(H=>{const ee={...H,isPositioned:!0};I.current&&!mC(E.current,ee)&&(E.current=ee,Ms.flushSync(()=>{l(ee)}))})},[d,e,n,O]);YS(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,l(V=>({...V,isPositioned:!1})))},[u]);const I=_.useRef(!1);YS(()=>(I.current=!0,()=>{I.current=!1}),[]),YS(()=>{if(x&&(T.current=x),A&&(R.current=A),x&&A){if(N.current)return N.current(x,A,L);L()}},[x,A,L,N,k]);const F=_.useMemo(()=>({reference:T,floating:R,setReference:v,setFloating:w}),[v,w]),U=_.useMemo(()=>({reference:x,floating:A}),[x,A]),Y=_.useMemo(()=>{const V={position:n,left:0,top:0};if(!U.floating)return V;const H=sz(U.floating,f.x),ee=sz(U.floating,f.y);return o?{...V,transform:"translate("+H+"px, "+ee+"px)",...sG(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:ee}},[n,o,U.floating,f.x,f.y]);return _.useMemo(()=>({...f,update:L,refs:F,elements:U,floatingStyles:Y}),[f,L,F,U,Y])}const NSe=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?rz({element:r.current,padding:s}).fn(n):{}:r?rz({element:r,padding:s}).fn(n):{}}}},DSe=(t,e)=>({...SSe(t),options:[t,e]}),OSe=(t,e)=>({...ESe(t),options:[t,e]}),MSe=(t,e)=>({...PSe(t),options:[t,e]}),LSe=(t,e)=>({...CSe(t),options:[t,e]}),ISe=(t,e)=>({...ASe(t),options:[t,e]}),$Se=(t,e)=>({...RSe(t),options:[t,e]}),FSe=(t,e)=>({...NSe(t),options:[t,e]});var jSe="Arrow",iG=_.forwardRef((t,e)=>{const{children:n,width:r=10,height:s=5,...i}=t;return P.jsx(Ne.svg,{...i,ref:e,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:P.jsx("polygon",{points:"0,0 30,0 15,10"})})});iG.displayName=jSe;var BSe=iG,wI="Popper",[oG,Rl]=Nn(wI),[zSe,aG]=oG(wI),lG=t=>{const{__scopePopper:e,children:n}=t,[r,s]=_.useState(null);return P.jsx(zSe,{scope:e,anchor:r,onAnchorChange:s,children:n})};lG.displayName=wI;var cG="PopperAnchor",uG=_.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...s}=t,i=aG(cG,n),a=_.useRef(null),o=tt(e,a);return _.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:P.jsx(Ne.div,{...s,ref:o})});uG.displayName=cG;var _I="PopperContent",[USe,HSe]=oG(_I),dG=_.forwardRef((t,e)=>{var ie,be,Ae,_e,Me,De;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:l="partial",hideWhenDetached:d=!1,updatePositionStrategy:m="optimized",onPlaced:p,...h}=t,y=aG(_I,n),[g,v]=_.useState(null),w=tt(e,ye=>v(ye)),[x,A]=_.useState(null),T=S_(x),R=(T==null?void 0:T.width)??0,E=(T==null?void 0:T.height)??0,k=r+(i!=="center"?"-"+i:""),N=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},O=Array.isArray(u)?u:[u],L=O.length>0,I={padding:N,boundary:O.filter(WSe),altBoundary:L},{refs:F,floatingStyles:U,placement:Y,isPositioned:V,middlewareData:H}=kSe({strategy:"fixed",placement:k,whileElementsMounted:(...ye)=>xSe(...ye,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[DSe({mainAxis:s+E,alignmentAxis:a}),c&&OSe({mainAxis:!0,crossAxis:!1,limiter:l==="partial"?MSe():void 0,...I}),c&&LSe({...I}),ISe({...I,apply:({elements:ye,rects:Fe,availableWidth:ut,availableHeight:Qe})=>{const{width:vt,height:An}=Fe.reference,Yt=ye.floating.style;Yt.setProperty("--radix-popper-available-width",`${ut}px`),Yt.setProperty("--radix-popper-available-height",`${Qe}px`),Yt.setProperty("--radix-popper-anchor-width",`${vt}px`),Yt.setProperty("--radix-popper-anchor-height",`${An}px`)}}),x&&FSe({element:x,padding:o}),GSe({arrowWidth:R,arrowHeight:E}),d&&$Se({strategy:"referenceHidden",...I})]}),[ee,re]=pG(Y),X=zt(p);$n(()=>{V&&(X==null||X())},[V,X]);const q=(ie=H.arrow)==null?void 0:ie.x,K=(be=H.arrow)==null?void 0:be.y,Z=((Ae=H.arrow)==null?void 0:Ae.centerOffset)!==0,[ue,de]=_.useState();return $n(()=>{g&&de(window.getComputedStyle(g).zIndex)},[g]),P.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:V?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[(_e=H.transformOrigin)==null?void 0:_e.x,(Me=H.transformOrigin)==null?void 0:Me.y].join(" "),...((De=H.hide)==null?void 0:De.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:P.jsx(USe,{scope:n,placedSide:ee,onArrowChange:A,arrowX:q,arrowY:K,shouldHideArrow:Z,children:P.jsx(Ne.div,{"data-side":ee,"data-align":re,...h,ref:w,style:{...h.style,animation:V?void 0:"none"}})})})});dG.displayName=_I;var fG="PopperArrow",VSe={top:"bottom",right:"left",bottom:"top",left:"right"},hG=_.forwardRef(function(e,n){const{__scopePopper:r,...s}=e,i=HSe(fG,r),a=VSe[i.placedSide];return P.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]: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:P.jsx(BSe,{...s,ref:n,style:{...s.style,display:"block"}})})});hG.displayName=fG;function WSe(t){return t!==null}var GSe=t=>({name:"transformOrigin",options:t,fn(e){var y,g,v;const{placement:n,rects:r,middlewareData:s}=e,a=((y=s.arrow)==null?void 0:y.centerOffset)!==0,o=a?0:t.arrowWidth,c=a?0:t.arrowHeight,[u,f]=pG(n),l={start:"0%",center:"50%",end:"100%"}[f],d=(((g=s.arrow)==null?void 0:g.x)??0)+o/2,m=(((v=s.arrow)==null?void 0:v.y)??0)+c/2;let p="",h="";return u==="bottom"?(p=a?l:`${d}px`,h=`${-c}px`):u==="top"?(p=a?l:`${d}px`,h=`${r.floating.height+c}px`):u==="right"?(p=`${-c}px`,h=a?l:`${m}px`):u==="left"&&(p=`${r.floating.width+c}px`,h=a?l:`${m}px`),{data:{x:p,y:h}}}});function pG(t){const[e,n="center"]=t.split("-");return[e,n]}var vA=lG,$v=uG,A_=dG,R_=hG,TT="rovingFocusGroup.onEntryFocus",qSe={bubbles:!1,cancelable:!0},yA="RovingFocusGroup",[eD,mG,KSe]=Qc(yA),[YSe,Pl]=Nn(yA,[KSe]),[XSe,QSe]=YSe(yA),gG=_.forwardRef((t,e)=>P.jsx(eD.Provider,{scope:t.__scopeRovingFocusGroup,children:P.jsx(eD.Slot,{scope:t.__scopeRovingFocusGroup,children:P.jsx(ZSe,{...t,ref:e})})}));gG.displayName=yA;var ZSe=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...l}=t,d=_.useRef(null),m=tt(e,d),p=Da(i),[h=null,y]=lr({prop:a,defaultProp:o,onChange:c}),[g,v]=_.useState(!1),w=zt(u),x=mG(n),A=_.useRef(!1),[T,R]=_.useState(0);return _.useEffect(()=>{const E=d.current;if(E)return E.addEventListener(TT,w),()=>E.removeEventListener(TT,w)},[w]),P.jsx(XSe,{scope:n,orientation:r,dir:p,loop:s,currentTabStopId:h,onItemFocus:_.useCallback(E=>y(E),[y]),onItemShiftTab:_.useCallback(()=>v(!0),[]),onFocusableItemAdd:_.useCallback(()=>R(E=>E+1),[]),onFocusableItemRemove:_.useCallback(()=>R(E=>E-1),[]),children:P.jsx(Ne.div,{tabIndex:g||T===0?-1:0,"data-orientation":r,...l,ref:m,style:{outline:"none",...t.style},onMouseDown:me(t.onMouseDown,()=>{A.current=!0}),onFocus:me(t.onFocus,E=>{const k=!A.current;if(E.target===E.currentTarget&&k&&!g){const N=new CustomEvent(TT,qSe);if(E.currentTarget.dispatchEvent(N),!N.defaultPrevented){const O=x().filter(Y=>Y.focusable),L=O.find(Y=>Y.active),I=O.find(Y=>Y.id===h),U=[L,I,...O].filter(Boolean).map(Y=>Y.ref.current);bG(U,f)}}A.current=!1}),onBlur:me(t.onBlur,()=>v(!1))})})}),vG="RovingFocusGroupItem",yG=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,...a}=t,o=qr(),c=i||o,u=QSe(vG,n),f=u.currentTabStopId===c,l=mG(n),{onFocusableItemAdd:d,onFocusableItemRemove:m}=u;return _.useEffect(()=>{if(r)return d(),()=>m()},[r,d,m]),P.jsx(eD.ItemSlot,{scope:n,id:c,focusable:r,active:s,children:P.jsx(Ne.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...a,ref:e,onMouseDown:me(t.onMouseDown,p=>{r?u.onItemFocus(c):p.preventDefault()}),onFocus:me(t.onFocus,()=>u.onItemFocus(c)),onKeyDown:me(t.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){u.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const h=tEe(p,u.orientation,u.dir);if(h!==void 0){if(p.metaKey||p.ctrlKey||p.altKey||p.shiftKey)return;p.preventDefault();let g=l().filter(v=>v.focusable).map(v=>v.ref.current);if(h==="last")g.reverse();else if(h==="prev"||h==="next"){h==="prev"&&g.reverse();const v=g.indexOf(p.currentTarget);g=u.loop?nEe(g,v+1):g.slice(v+1)}setTimeout(()=>bG(g))}})})})});yG.displayName=vG;var JSe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function eEe(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function tEe(t,e,n){const r=eEe(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return JSe[r]}function bG(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function nEe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var P_=gG,T_=yG,tD=["Enter"," "],rEe=["ArrowDown","PageUp","Home"],wG=["ArrowUp","PageDown","End"],sEe=[...rEe,...wG],iEe={ltr:[...tD,"ArrowRight"],rtl:[...tD,"ArrowLeft"]},oEe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},k_="Menu",[i0,aEe,lEe]=Qc(k_),[mp,N_]=Nn(k_,[lEe,Rl,Pl]),bA=Rl(),_G=Pl(),[cEe,gp]=mp(k_),[uEe,D_]=mp(k_),xG=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:s,onOpenChange:i,modal:a=!0}=t,o=bA(e),[c,u]=_.useState(null),f=_.useRef(!1),l=zt(i),d=Da(s);return _.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},p=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),P.jsx(vA,{...o,children:P.jsx(cEe,{scope:e,open:n,onOpenChange:l,content:c,onContentChange:u,children:P.jsx(uEe,{scope:e,onClose:_.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:f,dir:d,modal:a,children:r})})})};xG.displayName=k_;var dEe="MenuAnchor",xI=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=bA(n);return P.jsx($v,{...s,...r,ref:e})});xI.displayName=dEe;var SI="MenuPortal",[fEe,SG]=mp(SI,{forceMount:void 0}),EG=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:s}=t,i=gp(SI,e);return P.jsx(fEe,{scope:e,forceMount:n,children:P.jsx(Wn,{present:n||i.open,children:P.jsx(Pv,{asChild:!0,container:s,children:r})})})};EG.displayName=SI;var Bo="MenuContent",[hEe,EI]=mp(Bo),CG=_.forwardRef((t,e)=>{const n=SG(Bo,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=gp(Bo,t.__scopeMenu),a=D_(Bo,t.__scopeMenu);return P.jsx(i0.Provider,{scope:t.__scopeMenu,children:P.jsx(Wn,{present:r||i.open,children:P.jsx(i0.Slot,{scope:t.__scopeMenu,children:a.modal?P.jsx(pEe,{...s,ref:e}):P.jsx(mEe,{...s,ref:e})})})})}),pEe=_.forwardRef((t,e)=>{const n=gp(Bo,t.__scopeMenu),r=_.useRef(null),s=tt(e,r);return _.useEffect(()=>{const i=r.current;if(i)return Tv(i)},[]),P.jsx(CI,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:me(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),mEe=_.forwardRef((t,e)=>{const n=gp(Bo,t.__scopeMenu);return P.jsx(CI,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),CI=_.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:l,onInteractOutside:d,onDismiss:m,disableOutsideScroll:p,...h}=t,y=gp(Bo,n),g=D_(Bo,n),v=bA(n),w=_G(n),x=aEe(n),[A,T]=_.useState(null),R=_.useRef(null),E=tt(e,R,y.onContentChange),k=_.useRef(0),N=_.useRef(""),O=_.useRef(0),L=_.useRef(null),I=_.useRef("right"),F=_.useRef(0),U=p?h_:_.Fragment,Y=p?{as:Aa,allowPinchZoom:!0}:void 0,V=ee=>{var ie,be;const re=N.current+ee,X=x().filter(Ae=>!Ae.disabled),q=document.activeElement,K=(ie=X.find(Ae=>Ae.ref.current===q))==null?void 0:ie.textValue,Z=X.map(Ae=>Ae.textValue),ue=REe(Z,re,K),de=(be=X.find(Ae=>Ae.textValue===ue))==null?void 0:be.ref.current;(function Ae(_e){N.current=_e,window.clearTimeout(k.current),_e!==""&&(k.current=window.setTimeout(()=>Ae(""),1e3))})(re),de&&setTimeout(()=>de.focus())};_.useEffect(()=>()=>window.clearTimeout(k.current),[]),q1();const H=_.useCallback(ee=>{var X,q;return I.current===((X=L.current)==null?void 0:X.side)&&TEe(ee,(q=L.current)==null?void 0:q.area)},[]);return P.jsx(hEe,{scope:n,searchRef:N,onItemEnter:_.useCallback(ee=>{H(ee)&&ee.preventDefault()},[H]),onItemLeave:_.useCallback(ee=>{var re;H(ee)||((re=R.current)==null||re.focus(),T(null))},[H]),onTriggerLeave:_.useCallback(ee=>{H(ee)&&ee.preventDefault()},[H]),pointerGraceTimerRef:O,onPointerGraceIntentChange:_.useCallback(ee=>{L.current=ee},[]),children:P.jsx(U,{...Y,children:P.jsx(f_,{asChild:!0,trapped:s,onMountAutoFocus:me(i,ee=>{var re;ee.preventDefault(),(re=R.current)==null||re.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:P.jsx(Jc,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:l,onInteractOutside:d,onDismiss:m,children:P.jsx(P_,{asChild:!0,...w,dir:g.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:T,onEntryFocus:me(c,ee=>{g.isUsingKeyboardRef.current||ee.preventDefault()}),preventScrollOnEntryFocus:!0,children:P.jsx(A_,{role:"menu","aria-orientation":"vertical","data-state":zG(y.open),"data-radix-menu-content":"",dir:g.dir,...v,...h,ref:E,style:{outline:"none",...h.style},onKeyDown:me(h.onKeyDown,ee=>{const X=ee.target.closest("[data-radix-menu-content]")===ee.currentTarget,q=ee.ctrlKey||ee.altKey||ee.metaKey,K=ee.key.length===1;X&&(ee.key==="Tab"&&ee.preventDefault(),!q&&K&&V(ee.key));const Z=R.current;if(ee.target!==Z||!sEe.includes(ee.key))return;ee.preventDefault();const de=x().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);wG.includes(ee.key)&&de.reverse(),CEe(de)}),onBlur:me(t.onBlur,ee=>{ee.currentTarget.contains(ee.target)||(window.clearTimeout(k.current),N.current="")}),onPointerMove:me(t.onPointerMove,o0(ee=>{const re=ee.target,X=F.current!==ee.clientX;if(ee.currentTarget.contains(re)&&X){const q=ee.clientX>F.current?"right":"left";I.current=q,F.current=ee.clientX}}))})})})})})})});CG.displayName=Bo;var gEe="MenuGroup",AI=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return P.jsx(Ne.div,{role:"group",...r,ref:e})});AI.displayName=gEe;var vEe="MenuLabel",AG=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return P.jsx(Ne.div,{...r,ref:e})});AG.displayName=vEe;var gC="MenuItem",oz="menu.itemSelect",wA=_.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...s}=t,i=_.useRef(null),a=D_(gC,t.__scopeMenu),o=EI(gC,t.__scopeMenu),c=tt(e,i),u=_.useRef(!1),f=()=>{const l=i.current;if(!n&&l){const d=new CustomEvent(oz,{bubbles:!0,cancelable:!0});l.addEventListener(oz,m=>r==null?void 0:r(m),{once:!0}),Jb(l,d),d.defaultPrevented?u.current=!1:a.onClose()}};return P.jsx(RG,{...s,ref:c,disabled:n,onClick:me(t.onClick,f),onPointerDown:l=>{var d;(d=t.onPointerDown)==null||d.call(t,l),u.current=!0},onPointerUp:me(t.onPointerUp,l=>{var d;u.current||(d=l.currentTarget)==null||d.click()}),onKeyDown:me(t.onKeyDown,l=>{const d=o.searchRef.current!=="";n||d&&l.key===" "||tD.includes(l.key)&&(l.currentTarget.click(),l.preventDefault())})})});wA.displayName=gC;var RG=_.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=t,a=EI(gC,n),o=_G(n),c=_.useRef(null),u=tt(e,c),[f,l]=_.useState(!1),[d,m]=_.useState("");return _.useEffect(()=>{const p=c.current;p&&m((p.textContent??"").trim())},[i.children]),P.jsx(i0.ItemSlot,{scope:n,disabled:r,textValue:s??d,children:P.jsx(T_,{asChild:!0,...o,focusable:!r,children:P.jsx(Ne.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:u,onPointerMove:me(t.onPointerMove,o0(p=>{r?a.onItemLeave(p):(a.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:me(t.onPointerLeave,o0(p=>a.onItemLeave(p))),onFocus:me(t.onFocus,()=>l(!0)),onBlur:me(t.onBlur,()=>l(!1))})})})}),yEe="MenuCheckboxItem",PG=_.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...s}=t;return P.jsx(OG,{scope:t.__scopeMenu,checked:n,children:P.jsx(wA,{role:"menuitemcheckbox","aria-checked":vC(n)?"mixed":n,...s,ref:e,"data-state":PI(n),onSelect:me(s.onSelect,()=>r==null?void 0:r(vC(n)?!0:!n),{checkForDefaultPrevented:!1})})})});PG.displayName=yEe;var TG="MenuRadioGroup",[bEe,wEe]=mp(TG,{value:void 0,onValueChange:()=>{}}),kG=_.forwardRef((t,e)=>{const{value:n,onValueChange:r,...s}=t,i=zt(r);return P.jsx(bEe,{scope:t.__scopeMenu,value:n,onValueChange:i,children:P.jsx(AI,{...s,ref:e})})});kG.displayName=TG;var NG="MenuRadioItem",DG=_.forwardRef((t,e)=>{const{value:n,...r}=t,s=wEe(NG,t.__scopeMenu),i=n===s.value;return P.jsx(OG,{scope:t.__scopeMenu,checked:i,children:P.jsx(wA,{role:"menuitemradio","aria-checked":i,...r,ref:e,"data-state":PI(i),onSelect:me(r.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,n)},{checkForDefaultPrevented:!1})})})});DG.displayName=NG;var RI="MenuItemIndicator",[OG,_Ee]=mp(RI,{checked:!1}),MG=_.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...s}=t,i=_Ee(RI,n);return P.jsx(Wn,{present:r||vC(i.checked)||i.checked===!0,children:P.jsx(Ne.span,{...s,ref:e,"data-state":PI(i.checked)})})});MG.displayName=RI;var xEe="MenuSeparator",LG=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return P.jsx(Ne.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});LG.displayName=xEe;var SEe="MenuArrow",IG=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=bA(n);return P.jsx(R_,{...s,...r,ref:e})});IG.displayName=SEe;var EEe="MenuSub",[uUe,$G]=mp(EEe),qy="MenuSubTrigger",FG=_.forwardRef((t,e)=>{const n=gp(qy,t.__scopeMenu),r=D_(qy,t.__scopeMenu),s=$G(qy,t.__scopeMenu),i=EI(qy,t.__scopeMenu),a=_.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:c}=i,u={__scopeMenu:t.__scopeMenu},f=_.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return _.useEffect(()=>f,[f]),_.useEffect(()=>{const l=o.current;return()=>{window.clearTimeout(l),c(null)}},[o,c]),P.jsx(xI,{asChild:!0,...u,children:P.jsx(RG,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":zG(n.open),...t,ref:c_(e,s.onTriggerChange),onClick:l=>{var d;(d=t.onClick)==null||d.call(t,l),!(t.disabled||l.defaultPrevented)&&(l.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:me(t.onPointerMove,o0(l=>{i.onItemEnter(l),!l.defaultPrevented&&!t.disabled&&!n.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:me(t.onPointerLeave,o0(l=>{var m,p;f();const d=(m=n.content)==null?void 0:m.getBoundingClientRect();if(d){const h=(p=n.content)==null?void 0:p.dataset.side,y=h==="right",g=y?-5:5,v=d[y?"left":"right"],w=d[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:l.clientX+g,y:l.clientY},{x:v,y:d.top},{x:w,y:d.top},{x:w,y:d.bottom},{x:v,y:d.bottom}],side:h}),window.clearTimeout(o.current),o.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(l),l.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:me(t.onKeyDown,l=>{var m;const d=i.searchRef.current!=="";t.disabled||d&&l.key===" "||iEe[r.dir].includes(l.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),l.preventDefault())})})})});FG.displayName=qy;var jG="MenuSubContent",BG=_.forwardRef((t,e)=>{const n=SG(Bo,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=gp(Bo,t.__scopeMenu),a=D_(Bo,t.__scopeMenu),o=$G(jG,t.__scopeMenu),c=_.useRef(null),u=tt(e,c);return P.jsx(i0.Provider,{scope:t.__scopeMenu,children:P.jsx(Wn,{present:r||i.open,children:P.jsx(i0.Slot,{scope:t.__scopeMenu,children:P.jsx(CI,{id:o.contentId,"aria-labelledby":o.triggerId,...s,ref:u,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var l;a.isUsingKeyboardRef.current&&((l=c.current)==null||l.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:me(t.onFocusOutside,f=>{f.target!==o.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:me(t.onEscapeKeyDown,f=>{a.onClose(),f.preventDefault()}),onKeyDown:me(t.onKeyDown,f=>{var m;const l=f.currentTarget.contains(f.target),d=oEe[a.dir].includes(f.key);l&&d&&(i.onOpenChange(!1),(m=o.trigger)==null||m.focus(),f.preventDefault())})})})})})});BG.displayName=jG;function zG(t){return t?"open":"closed"}function vC(t){return t==="indeterminate"}function PI(t){return vC(t)?"indeterminate":t?"checked":"unchecked"}function CEe(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function AEe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function REe(t,e,n){const s=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let a=AEe(t,Math.max(i,0));s.length===1&&(a=a.filter(u=>u!==n));const c=a.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function PEe(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;ir!=f>r&&n<(u-o)*(r-c)/(f-c)+o&&(s=!s)}return s}function TEe(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return PEe(n,e)}function o0(t){return e=>e.pointerType==="mouse"?t(e):void 0}var kEe=xG,TI=xI,kI=EG,NI=CG,DI=AI,OI=AG,MI=wA,LI=PG,II=kG,$I=DG,FI=MG,jI=LG,BI=IG,zI=FG,UI=BG,UG="ContextMenu",[NEe,dUe]=Nn(UG,[N_]),Di=N_(),[fUe,HG]=NEe(UG),VG="ContextMenuTrigger",DEe=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=t,i=HG(VG,n),a=Di(n),o=_.useRef({x:0,y:0}),c=_.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...o.current})}),u=_.useRef(0),f=_.useCallback(()=>window.clearTimeout(u.current),[]),l=d=>{o.current={x:d.clientX,y:d.clientY},i.onOpenChange(!0)};return _.useEffect(()=>f,[f]),_.useEffect(()=>void(r&&f()),[r,f]),P.jsxs(P.Fragment,{children:[P.jsx(TI,{...a,virtualRef:c}),P.jsx(Ne.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:me(t.onContextMenu,d=>{f(),l(d),d.preventDefault()}),onPointerDown:r?t.onPointerDown:me(t.onPointerDown,pS(d=>{f(),u.current=window.setTimeout(()=>l(d),700)})),onPointerMove:r?t.onPointerMove:me(t.onPointerMove,pS(f)),onPointerCancel:r?t.onPointerCancel:me(t.onPointerCancel,pS(f)),onPointerUp:r?t.onPointerUp:me(t.onPointerUp,pS(f))})]})});DEe.displayName=VG;var OEe="ContextMenuPortal",WG=t=>{const{__scopeContextMenu:e,...n}=t,r=Di(e);return P.jsx(kI,{...r,...n})};WG.displayName=OEe;var GG="ContextMenuContent",qG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=HG(GG,n),i=Di(n),a=_.useRef(!1);return P.jsx(NI,{...i,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:o=>{var c;(c=t.onCloseAutoFocus)==null||c.call(t,o),!o.defaultPrevented&&a.current&&o.preventDefault(),a.current=!1},onInteractOutside:o=>{var c;(c=t.onInteractOutside)==null||c.call(t,o),!o.defaultPrevented&&!s.modal&&(a.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)"}})});qG.displayName=GG;var MEe="ContextMenuGroup",LEe=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Di(n);return P.jsx(DI,{...s,...r,ref:e})});LEe.displayName=MEe;var IEe="ContextMenuLabel",KG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Di(n);return P.jsx(OI,{...s,...r,ref:e})});KG.displayName=IEe;var $Ee="ContextMenuItem",YG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Di(n);return P.jsx(MI,{...s,...r,ref:e})});YG.displayName=$Ee;var FEe="ContextMenuCheckboxItem",XG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Di(n);return P.jsx(LI,{...s,...r,ref:e})});XG.displayName=FEe;var jEe="ContextMenuRadioGroup",BEe=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Di(n);return P.jsx(II,{...s,...r,ref:e})});BEe.displayName=jEe;var zEe="ContextMenuRadioItem",QG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Di(n);return P.jsx($I,{...s,...r,ref:e})});QG.displayName=zEe;var UEe="ContextMenuItemIndicator",ZG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Di(n);return P.jsx(FI,{...s,...r,ref:e})});ZG.displayName=UEe;var HEe="ContextMenuSeparator",JG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Di(n);return P.jsx(jI,{...s,...r,ref:e})});JG.displayName=HEe;var VEe="ContextMenuArrow",WEe=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Di(n);return P.jsx(BI,{...s,...r,ref:e})});WEe.displayName=VEe;var GEe="ContextMenuSubTrigger",eq=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Di(n);return P.jsx(zI,{...s,...r,ref:e})});eq.displayName=GEe;var qEe="ContextMenuSubContent",tq=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Di(n);return P.jsx(UI,{...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)"}})});tq.displayName=qEe;function pS(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var KEe=WG,nq=qG,rq=KG,sq=YG,iq=XG,oq=QG,aq=ZG,lq=JG,cq=eq,uq=tq;const YEe=_.forwardRef(({className:t,inset:e,children:n,...r},s)=>P.jsxs(cq,{ref:s,className:le("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,P.jsx(d_,{className:"ml-auto h-4 w-4"})]}));YEe.displayName=cq.displayName;const XEe=_.forwardRef(({className:t,...e},n)=>P.jsx(uq,{ref:n,className:le("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}));XEe.displayName=uq.displayName;const QEe=_.forwardRef(({className:t,...e},n)=>P.jsx(KEe,{children:P.jsx(nq,{ref:n,className:le("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})}));QEe.displayName=nq.displayName;const ZEe=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(sq,{ref:r,className:le("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}));ZEe.displayName=sq.displayName;const JEe=_.forwardRef(({className:t,children:e,checked:n,...r},s)=>P.jsxs(iq,{ref:s,className:le("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:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(aq,{children:P.jsx(u_,{className:"h-4 w-4"})})}),e]}));JEe.displayName=iq.displayName;const eCe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(oq,{ref:r,className:le("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:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(aq,{children:P.jsx(G1,{className:"h-2 w-2 fill-current"})})}),e]}));eCe.displayName=oq.displayName;const tCe=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(rq,{ref:r,className:le("px-2 py-1.5 text-sm font-semibold text-foreground",e&&"pl-8",t),...n}));tCe.displayName=rq.displayName;const nCe=_.forwardRef(({className:t,...e},n)=>P.jsx(lq,{ref:n,className:le("-mx-1 my-1 h-px bg-border",t),...e}));nCe.displayName=lq.displayName;function Ed(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 az(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function dq(...t){return e=>{let n=!1;const r=t.map(s=>{const i=az(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s{const{children:a,...o}=i,c=_.useMemo(()=>o,Object.values(o));return P.jsx(n.Provider,{value:c,children:a})};r.displayName=t+"Provider";function s(i){const a=_.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[r,s]}function sCe(t,e=[]){let n=[];function r(i,a){const o=_.createContext(a),c=n.length;n=[...n,a];const u=l=>{var g;const{scope:d,children:m,...p}=l,h=((g=d==null?void 0:d[t])==null?void 0:g[c])||o,y=_.useMemo(()=>p,Object.values(p));return P.jsx(h.Provider,{value:y,children:m})};u.displayName=i+"Provider";function f(l,d){var h;const m=((h=d==null?void 0:d[t])==null?void 0:h[c])||o,p=_.useContext(m);if(p)return p;if(a!==void 0)return a;throw new Error(`\`${l}\` must be used within \`${i}\``)}return[u,f]}const s=()=>{const i=n.map(a=>_.createContext(a));return function(o){const c=(o==null?void 0:o[t])||i;return _.useMemo(()=>({[`__scope${t}`]:{...o,[t]:c}}),[o,c])}};return s.scopeName=t,[r,iCe(s,...e)]}function iCe(...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 a=r.reduce((o,{useScope:c,scopeName:u})=>{const l=c(i)[`__scope${u}`];return{...o,...l}},{});return _.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var HI=_.forwardRef((t,e)=>{const{children:n,...r}=t,s=_.Children.toArray(n),i=s.find(aCe);if(i){const a=i.props.children,o=s.map(c=>c===i?_.Children.count(a)>1?_.Children.only(null):_.isValidElement(a)?a.props.children:null:c);return P.jsx(nD,{...r,ref:e,children:_.isValidElement(a)?_.cloneElement(a,void 0,o):null})}return P.jsx(nD,{...r,ref:e,children:n})});HI.displayName="Slot";var nD=_.forwardRef((t,e)=>{const{children:n,...r}=t;if(_.isValidElement(n)){const s=cCe(n),i=lCe(r,n.props);return n.type!==_.Fragment&&(i.ref=e?dq(e,s):s),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});nD.displayName="SlotClone";var oCe=({children:t})=>P.jsx(P.Fragment,{children:t});function aCe(t){return _.isValidElement(t)&&t.type===oCe}function lCe(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]=(...o)=>{i(...o),s(...o)}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function cCe(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 uCe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],nu=uCe.reduce((t,e)=>{const n=_.forwardRef((r,s)=>{const{asChild:i,...a}=r,o=i?HI:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(o,{...a,ref:s})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function dCe(t,e){t&&Ms.flushSync(()=>t.dispatchEvent(e))}var fCe="DismissableLayer",rD="dismissableLayer.update",hCe="dismissableLayer.pointerDownOutside",pCe="dismissableLayer.focusOutside",lz,fq=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),hq=_.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,onDismiss:o,...c}=t,u=_.useContext(fq),[f,l]=_.useState(null),d=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=_.useState({}),p=vp(e,R=>l(R)),h=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=h.indexOf(y),v=f?h.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,x=v>=g,A=vCe(R=>{const E=R.target,k=[...u.branches].some(N=>N.contains(E));!x||k||(s==null||s(R),a==null||a(R),R.defaultPrevented||o==null||o())},d),T=yCe(R=>{const E=R.target;[...u.branches].some(N=>N.contains(E))||(i==null||i(R),a==null||a(R),R.defaultPrevented||o==null||o())},d);return _6(R=>{v===u.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&o&&(R.preventDefault(),o()))},d),_.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(lz=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),cz(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=lz)}},[f,d,n,u]),_.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),cz())},[f,u]),_.useEffect(()=>{const R=()=>m({});return document.addEventListener(rD,R),()=>document.removeEventListener(rD,R)},[]),P.jsx(nu.div,{...c,ref:p,style:{pointerEvents:w?x?"auto":"none":void 0,...t.style},onFocusCapture:Ed(t.onFocusCapture,T.onFocusCapture),onBlurCapture:Ed(t.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Ed(t.onPointerDownCapture,A.onPointerDownCapture)})});hq.displayName=fCe;var mCe="DismissableLayerBranch",gCe=_.forwardRef((t,e)=>{const n=_.useContext(fq),r=_.useRef(null),s=vp(e,r);return _.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),P.jsx(nu.div,{...t,ref:s})});gCe.displayName=mCe;function vCe(t,e=globalThis==null?void 0:globalThis.document){const n=zt(t),r=_.useRef(!1),s=_.useRef(()=>{});return _.useEffect(()=>{const i=o=>{if(o.target&&!r.current){let c=function(){pq(hCe,n,u,{discrete:!0})};const u={originalEvent:o};o.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},a=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function yCe(t,e=globalThis==null?void 0:globalThis.document){const n=zt(t),r=_.useRef(!1);return _.useEffect(()=>{const s=i=>{i.target&&!r.current&&pq(pCe,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 cz(){const t=new CustomEvent(rD);document.dispatchEvent(t)}function pq(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?dCe(s,i):s.dispatchEvent(i)}var kT="focusScope.autoFocusOnMount",NT="focusScope.autoFocusOnUnmount",uz={bubbles:!1,cancelable:!0},bCe="FocusScope",mq=_.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=t,[o,c]=_.useState(null),u=zt(s),f=zt(i),l=_.useRef(null),d=vp(e,h=>c(h)),m=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let h=function(w){if(m.paused||!o)return;const x=w.target;o.contains(x)?l.current=x:xu(l.current,{select:!0})},y=function(w){if(m.paused||!o)return;const x=w.relatedTarget;x!==null&&(o.contains(x)||xu(l.current,{select:!0}))},g=function(w){if(document.activeElement===document.body)for(const A of w)A.removedNodes.length>0&&xu(o)};document.addEventListener("focusin",h),document.addEventListener("focusout",y);const v=new MutationObserver(g);return o&&v.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),v.disconnect()}}},[r,o,m.paused]),_.useEffect(()=>{if(o){fz.add(m);const h=document.activeElement;if(!o.contains(h)){const g=new CustomEvent(kT,uz);o.addEventListener(kT,u),o.dispatchEvent(g),g.defaultPrevented||(wCe(CCe(gq(o)),{select:!0}),document.activeElement===h&&xu(o))}return()=>{o.removeEventListener(kT,u),setTimeout(()=>{const g=new CustomEvent(NT,uz);o.addEventListener(NT,f),o.dispatchEvent(g),g.defaultPrevented||xu(h??document.body,{select:!0}),o.removeEventListener(NT,f),fz.remove(m)},0)}}},[o,u,f,m]);const p=_.useCallback(h=>{if(!n&&!r||m.paused)return;const y=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,g=document.activeElement;if(y&&g){const v=h.currentTarget,[w,x]=_Ce(v);w&&x?!h.shiftKey&&g===x?(h.preventDefault(),n&&xu(w,{select:!0})):h.shiftKey&&g===w&&(h.preventDefault(),n&&xu(x,{select:!0})):g===v&&h.preventDefault()}},[n,r,m.paused]);return P.jsx(nu.div,{tabIndex:-1,...a,ref:d,onKeyDown:p})});mq.displayName=bCe;function wCe(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(xu(r,{select:e}),document.activeElement!==n)return}function _Ce(t){const e=gq(t),n=dz(e,t),r=dz(e.reverse(),t);return[n,r]}function gq(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 dz(t,e){for(const n of t)if(!xCe(n,{upTo:e}))return n}function xCe(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 SCe(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&&SCe(t)&&e&&t.select()}}var fz=ECe();function ECe(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=hz(t,e),t.unshift(e)},remove(e){var n;t=hz(t,e),(n=t[0])==null||n.resume()}}}function hz(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function CCe(t){return t.filter(e=>e.tagName!=="A")}var ACe="Portal",vq=_.forwardRef((t,e)=>{var o;const{container:n,...r}=t,[s,i]=_.useState(!1);$n(()=>i(!0),[]);const a=n||s&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?l_.createPortal(P.jsx(nu.div,{...r,ref:e}),a):null});vq.displayName=ACe;function RCe(t,e){return _.useReducer((n,r)=>e[n][r]??n,t)}var _A=t=>{const{present:e,children:n}=t,r=PCe(e),s=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),i=vp(r.ref,TCe(s));return typeof n=="function"||r.isPresent?_.cloneElement(s,{ref:i}):null};_A.displayName="Presence";function PCe(t){const[e,n]=_.useState(),r=_.useRef({}),s=_.useRef(t),i=_.useRef("none"),a=t?"mounted":"unmounted",[o,c]=RCe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const u=mS(r.current);i.current=o==="mounted"?u:"none"},[o]),$n(()=>{const u=r.current,f=s.current;if(f!==t){const d=i.current,m=mS(u);t?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&d!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,c]),$n(()=>{if(e){let u;const f=e.ownerDocument.defaultView??window,l=m=>{const h=mS(r.current).includes(m.animationName);if(m.target===e&&h&&(c("ANIMATION_END"),!s.current)){const y=e.style.animationFillMode;e.style.animationFillMode="forwards",u=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=y)})}},d=m=>{m.target===e&&(i.current=mS(r.current))};return e.addEventListener("animationstart",d),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{f.clearTimeout(u),e.removeEventListener("animationstart",d),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:_.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function mS(t){return(t==null?void 0:t.animationName)||"none"}function TCe(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 DT=0;function kCe(){_.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??pz()),document.body.insertAdjacentElement("beforeend",t[1]??pz()),DT++,()=>{DT===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),DT--}},[])}function pz(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var yq=AL(),OT=function(){},xA=_.forwardRef(function(t,e){var n=_.useRef(null),r=_.useState({onScrollCapture:OT,onWheelCapture:OT,onTouchMoveCapture:OT}),s=r[0],i=r[1],a=t.forwardProps,o=t.children,c=t.className,u=t.removeScrollBar,f=t.enabled,l=t.shards,d=t.sideCar,m=t.noIsolation,p=t.inert,h=t.allowPinchZoom,y=t.as,g=y===void 0?"div":y,v=t.gapMode,w=K1(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=d,A=CL([n,e]),T=mr(mr({},w),s);return _.createElement(_.Fragment,null,f&&_.createElement(x,{sideCar:yq,removeScrollBar:u,shards:l,noIsolation:m,inert:p,setCallbacks:i,allowPinchZoom:!!h,lockRef:n,gapMode:v}),a?_.cloneElement(_.Children.only(o),mr(mr({},T),{ref:A})):_.createElement(g,mr({},T,{className:c,ref:A}),o))});xA.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};xA.classNames={fullWidth:zm,zeroRight:Bm};var sD=!1;if(typeof window<"u")try{var gS=Object.defineProperty({},"passive",{get:function(){return sD=!0,!0}});window.addEventListener("test",gS,gS),window.removeEventListener("test",gS,gS)}catch{sD=!1}var qp=sD?{passive:!1}:!1,NCe=function(t){return t.tagName==="TEXTAREA"},bq=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!NCe(t)&&n[e]==="visible")},DCe=function(t){return bq(t,"overflowY")},OCe=function(t){return bq(t,"overflowX")},mz=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=wq(t,r);if(s){var i=_q(t,r),a=i[1],o=i[2];if(a>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},MCe=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},LCe=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},wq=function(t,e){return t==="v"?DCe(e):OCe(e)},_q=function(t,e){return t==="v"?MCe(e):LCe(e)},ICe=function(t,e){return t==="h"&&e==="rtl"?-1:1},$Ce=function(t,e,n,r,s){var i=ICe(t,window.getComputedStyle(e).direction),a=i*r,o=n.target,c=e.contains(o),u=!1,f=a>0,l=0,d=0;do{var m=_q(t,o),p=m[0],h=m[1],y=m[2],g=h-y-i*p;(p||g)&&wq(t,o)&&(l+=g,d+=p),o instanceof ShadowRoot?o=o.host:o=o.parentNode}while(!c&&o!==document.body||c&&(e.contains(o)||e===o));return(f&&Math.abs(l)<1||!f&&Math.abs(d)<1)&&(u=!0),u},vS=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},gz=function(t){return[t.deltaX,t.deltaY]},vz=function(t){return t&&"current"in t?t.current:t},FCe=function(t,e){return t[0]===e[0]&&t[1]===e[1]},jCe=function(t){return` .block-interactivity-`.concat(t,` {pointer-events: none;} .allow-interactivity-`).concat(t,` {pointer-events: all;} -`)},BCe=0,Kp=[];function zCe(t){var e=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),s=_.useState(BCe++)[0],i=_.useState(X1)[0],a=_.useRef(t);_.useEffect(function(){a.current=t},[t]),_.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var h=EL([t.lockRef.current],(t.shards||[]).map(vz),!0).filter(Boolean);return h.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),h.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var o=_.useCallback(function(h,y){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!a.current.allowPinchZoom;var g=vS(h),v=n.current,w="deltaX"in h?h.deltaX:v[0]-g[0],x="deltaY"in h?h.deltaY:v[1]-g[1],A,T=h.target,R=Math.abs(w)>Math.abs(x)?"h":"v";if("touches"in h&&R==="h"&&T.type==="range")return!1;var E=mz(R,T);if(!E)return!0;if(E?A=R:(A=R==="v"?"h":"v",E=mz(R,T)),!E)return!1;if(!r.current&&"changedTouches"in h&&(w||x)&&(r.current=A),!A)return!0;var k=r.current||A;return $Ce(k,y,h,k==="h"?w:x)},[]),c=_.useCallback(function(h){var y=h;if(!(!Kp.length||Kp[Kp.length-1]!==i)){var g="deltaY"in y?gz(y):vS(y),v=e.current.filter(function(A){return A.name===y.type&&(A.target===y.target||y.target===A.shadowParent)&&FCe(A.delta,g)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var w=(a.current.shards||[]).map(vz).filter(Boolean).filter(function(A){return A.contains(y.target)}),x=w.length>0?o(y,w[0]):!a.current.noIsolation;x&&y.cancelable&&y.preventDefault()}}},[]),u=_.useCallback(function(h,y,g,v){var w={name:h,delta:y,target:g,should:v,shadowParent:UCe(g)};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(x){return x!==w})},1)},[]),f=_.useCallback(function(h){n.current=vS(h),r.current=void 0},[]),l=_.useCallback(function(h){u(h.type,gz(h),h.target,o(h,t.lockRef.current))},[]),d=_.useCallback(function(h){u(h.type,vS(h),h.target,o(h,t.lockRef.current))},[]);_.useEffect(function(){return Kp.push(i),t.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:d}),document.addEventListener("wheel",c,qp),document.addEventListener("touchmove",c,qp),document.addEventListener("touchstart",f,qp),function(){Kp=Kp.filter(function(h){return h!==i}),document.removeEventListener("wheel",c,qp),document.removeEventListener("touchmove",c,qp),document.removeEventListener("touchstart",f,qp)}},[]);var m=t.removeScrollBar,p=t.inert;return _.createElement(_.Fragment,null,p?_.createElement(i,{styles:jCe(s)}):null,m?_.createElement(PL,{gapMode:t.gapMode}):null)}function UCe(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const HCe=RL(yq,zCe);var xq=_.forwardRef(function(t,e){return _.createElement(xA,mr({},t,{ref:e,sideCar:HCe}))});xq.classNames=xA.classNames;var VI="Dialog",[Sq,pUe]=sCe(VI),[VCe,La]=Sq(VI),Eq=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,o=_.useRef(null),c=_.useRef(null),[u=!1,f]=lr({prop:r,defaultProp:s,onChange:i});return P.jsx(VCe,{scope:e,triggerRef:o,contentRef:c,contentId:qr(),titleId:qr(),descriptionId:qr(),open:u,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(l=>!l),[f]),modal:a,children:n})};Eq.displayName=VI;var Cq="DialogTrigger",WCe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=La(Cq,n),i=vp(e,s.triggerRef);return P.jsx(nu.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":qI(s.open),...r,ref:i,onClick:Ed(t.onClick,s.onOpenToggle)})});WCe.displayName=Cq;var WI="DialogPortal",[GCe,Aq]=Sq(WI,{forceMount:void 0}),Rq=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=La(WI,e);return P.jsx(GCe,{scope:e,forceMount:n,children:_.Children.map(r,a=>P.jsx(_A,{present:n||i.open,children:P.jsx(vq,{asChild:!0,container:s,children:a})}))})};Rq.displayName=WI;var yC="DialogOverlay",Pq=_.forwardRef((t,e)=>{const n=Aq(yC,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=La(yC,t.__scopeDialog);return i.modal?P.jsx(_A,{present:r||i.open,children:P.jsx(qCe,{...s,ref:e})}):null});Pq.displayName=yC;var qCe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=La(yC,n);return P.jsx(xq,{as:HI,allowPinchZoom:!0,shards:[s.contentRef],children:P.jsx(nu.div,{"data-state":qI(s.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Qh="DialogContent",Tq=_.forwardRef((t,e)=>{const n=Aq(Qh,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=La(Qh,t.__scopeDialog);return P.jsx(_A,{present:r||i.open,children:i.modal?P.jsx(KCe,{...s,ref:e}):P.jsx(YCe,{...s,ref:e})})});Tq.displayName=Qh;var KCe=_.forwardRef((t,e)=>{const n=La(Qh,t.__scopeDialog),r=_.useRef(null),s=vp(e,n.contentRef,r);return _.useEffect(()=>{const i=r.current;if(i)return Tv(i)},[]),P.jsx(kq,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ed(t.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Ed(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&i.preventDefault()}),onFocusOutside:Ed(t.onFocusOutside,i=>i.preventDefault())})}),YCe=_.forwardRef((t,e)=>{const n=La(Qh,t.__scopeDialog),r=_.useRef(!1),s=_.useRef(!1);return P.jsx(kq,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,o;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),kq=_.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=t,o=La(Qh,n),c=_.useRef(null),u=vp(e,c);return kCe(),P.jsxs(P.Fragment,{children:[P.jsx(mq,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:P.jsx(hq,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":qI(o.open),...a,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),P.jsxs(P.Fragment,{children:[P.jsx(XCe,{titleId:o.titleId}),P.jsx(ZCe,{contentRef:c,descriptionId:o.descriptionId})]})]})}),GI="DialogTitle",Nq=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=La(GI,n);return P.jsx(nu.h2,{id:s.titleId,...r,ref:e})});Nq.displayName=GI;var Dq="DialogDescription",Oq=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=La(Dq,n);return P.jsx(nu.p,{id:s.descriptionId,...r,ref:e})});Oq.displayName=Dq;var Mq="DialogClose",Lq=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=La(Mq,n);return P.jsx(nu.button,{type:"button",...r,ref:e,onClick:Ed(t.onClick,()=>s.onOpenChange(!1))})});Lq.displayName=Mq;function qI(t){return t?"open":"closed"}var Iq="DialogTitleWarning",[mUe,$q]=rCe(Iq,{contentName:Qh,titleName:GI,docsSlug:"dialog"}),XCe=({titleId:t})=>{const e=$q(Iq),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. +`)},BCe=0,Kp=[];function zCe(t){var e=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),s=_.useState(BCe++)[0],i=_.useState(X1)[0],a=_.useRef(t);_.useEffect(function(){a.current=t},[t]),_.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var h=EL([t.lockRef.current],(t.shards||[]).map(vz),!0).filter(Boolean);return h.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),h.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var o=_.useCallback(function(h,y){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!a.current.allowPinchZoom;var g=vS(h),v=n.current,w="deltaX"in h?h.deltaX:v[0]-g[0],x="deltaY"in h?h.deltaY:v[1]-g[1],A,T=h.target,R=Math.abs(w)>Math.abs(x)?"h":"v";if("touches"in h&&R==="h"&&T.type==="range")return!1;var E=mz(R,T);if(!E)return!0;if(E?A=R:(A=R==="v"?"h":"v",E=mz(R,T)),!E)return!1;if(!r.current&&"changedTouches"in h&&(w||x)&&(r.current=A),!A)return!0;var k=r.current||A;return $Ce(k,y,h,k==="h"?w:x)},[]),c=_.useCallback(function(h){var y=h;if(!(!Kp.length||Kp[Kp.length-1]!==i)){var g="deltaY"in y?gz(y):vS(y),v=e.current.filter(function(A){return A.name===y.type&&(A.target===y.target||y.target===A.shadowParent)&&FCe(A.delta,g)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var w=(a.current.shards||[]).map(vz).filter(Boolean).filter(function(A){return A.contains(y.target)}),x=w.length>0?o(y,w[0]):!a.current.noIsolation;x&&y.cancelable&&y.preventDefault()}}},[]),u=_.useCallback(function(h,y,g,v){var w={name:h,delta:y,target:g,should:v,shadowParent:UCe(g)};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(x){return x!==w})},1)},[]),f=_.useCallback(function(h){n.current=vS(h),r.current=void 0},[]),l=_.useCallback(function(h){u(h.type,gz(h),h.target,o(h,t.lockRef.current))},[]),d=_.useCallback(function(h){u(h.type,vS(h),h.target,o(h,t.lockRef.current))},[]);_.useEffect(function(){return Kp.push(i),t.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:d}),document.addEventListener("wheel",c,qp),document.addEventListener("touchmove",c,qp),document.addEventListener("touchstart",f,qp),function(){Kp=Kp.filter(function(h){return h!==i}),document.removeEventListener("wheel",c,qp),document.removeEventListener("touchmove",c,qp),document.removeEventListener("touchstart",f,qp)}},[]);var m=t.removeScrollBar,p=t.inert;return _.createElement(_.Fragment,null,p?_.createElement(i,{styles:jCe(s)}):null,m?_.createElement(PL,{gapMode:t.gapMode}):null)}function UCe(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const HCe=RL(yq,zCe);var xq=_.forwardRef(function(t,e){return _.createElement(xA,mr({},t,{ref:e,sideCar:HCe}))});xq.classNames=xA.classNames;var VI="Dialog",[Sq,hUe]=sCe(VI),[VCe,La]=Sq(VI),Eq=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,o=_.useRef(null),c=_.useRef(null),[u=!1,f]=lr({prop:r,defaultProp:s,onChange:i});return P.jsx(VCe,{scope:e,triggerRef:o,contentRef:c,contentId:qr(),titleId:qr(),descriptionId:qr(),open:u,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(l=>!l),[f]),modal:a,children:n})};Eq.displayName=VI;var Cq="DialogTrigger",WCe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=La(Cq,n),i=vp(e,s.triggerRef);return P.jsx(nu.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":qI(s.open),...r,ref:i,onClick:Ed(t.onClick,s.onOpenToggle)})});WCe.displayName=Cq;var WI="DialogPortal",[GCe,Aq]=Sq(WI,{forceMount:void 0}),Rq=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=La(WI,e);return P.jsx(GCe,{scope:e,forceMount:n,children:_.Children.map(r,a=>P.jsx(_A,{present:n||i.open,children:P.jsx(vq,{asChild:!0,container:s,children:a})}))})};Rq.displayName=WI;var yC="DialogOverlay",Pq=_.forwardRef((t,e)=>{const n=Aq(yC,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=La(yC,t.__scopeDialog);return i.modal?P.jsx(_A,{present:r||i.open,children:P.jsx(qCe,{...s,ref:e})}):null});Pq.displayName=yC;var qCe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=La(yC,n);return P.jsx(xq,{as:HI,allowPinchZoom:!0,shards:[s.contentRef],children:P.jsx(nu.div,{"data-state":qI(s.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Qh="DialogContent",Tq=_.forwardRef((t,e)=>{const n=Aq(Qh,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=La(Qh,t.__scopeDialog);return P.jsx(_A,{present:r||i.open,children:i.modal?P.jsx(KCe,{...s,ref:e}):P.jsx(YCe,{...s,ref:e})})});Tq.displayName=Qh;var KCe=_.forwardRef((t,e)=>{const n=La(Qh,t.__scopeDialog),r=_.useRef(null),s=vp(e,n.contentRef,r);return _.useEffect(()=>{const i=r.current;if(i)return Tv(i)},[]),P.jsx(kq,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ed(t.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Ed(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&i.preventDefault()}),onFocusOutside:Ed(t.onFocusOutside,i=>i.preventDefault())})}),YCe=_.forwardRef((t,e)=>{const n=La(Qh,t.__scopeDialog),r=_.useRef(!1),s=_.useRef(!1);return P.jsx(kq,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,o;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),kq=_.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=t,o=La(Qh,n),c=_.useRef(null),u=vp(e,c);return kCe(),P.jsxs(P.Fragment,{children:[P.jsx(mq,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:P.jsx(hq,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":qI(o.open),...a,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),P.jsxs(P.Fragment,{children:[P.jsx(XCe,{titleId:o.titleId}),P.jsx(ZCe,{contentRef:c,descriptionId:o.descriptionId})]})]})}),GI="DialogTitle",Nq=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=La(GI,n);return P.jsx(nu.h2,{id:s.titleId,...r,ref:e})});Nq.displayName=GI;var Dq="DialogDescription",Oq=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=La(Dq,n);return P.jsx(nu.p,{id:s.descriptionId,...r,ref:e})});Oq.displayName=Dq;var Mq="DialogClose",Lq=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=La(Mq,n);return P.jsx(nu.button,{type:"button",...r,ref:e,onClick:Ed(t.onClick,()=>s.onOpenChange(!1))})});Lq.displayName=Mq;function qI(t){return t?"open":"closed"}var Iq="DialogTitleWarning",[pUe,$q]=rCe(Iq,{contentName:Qh,titleName:GI,docsSlug:"dialog"}),XCe=({titleId:t})=>{const e=$q(Iq),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 _.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},QCe="DialogDescriptionWarning",ZCe=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${$q(QCe).contentName}}.`;return _.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},JCe=Eq,e1e=Rq,t1e=Pq,n1e=Tq,r1e=Nq,s1e=Oq,i1e=Lq;function o1e(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 Fq=se.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),O_=()=>{const t=se.useContext(Fq);if(!t)throw new Error("useDrawerContext must be used within a Drawer.Root");return t};o1e(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,-100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(-100%,0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(100%,0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not( [data-state=closed] -){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-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}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,100%,0)}}@keyframes slideFromTop{from{transform:translate3d(0,-100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,-100%,0)}}@keyframes slideFromLeft{from{transform:translate3d(-100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(-100%,0,0)}}@keyframes slideFromRight{from{transform:translate3d(100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(100%,0,0)}}`);const a1e=24,l1e=typeof window<"u"?_.useLayoutEffect:_.useEffect;function yz(...t){return(...e)=>{for(let n of t)typeof n=="function"&&n(...e)}}function c1e(){return KI(/^Mac/)}function u1e(){return KI(/^iPhone/)}function bz(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function d1e(){return KI(/^iPad/)||c1e()&&navigator.maxTouchPoints>1}function jq(){return u1e()||d1e()}function KI(t){return typeof window<"u"&&window.navigator!=null?t.test(window.navigator.platform):void 0}const MT=typeof document<"u"&&window.visualViewport;function wz(t){let e=window.getComputedStyle(t);return/(auto|scroll)/.test(e.overflow+e.overflowX+e.overflowY)}function Bq(t){for(wz(t)&&(t=t.parentElement);t&&!wz(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}const f1e=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let yS=0,LT;function h1e(t={}){let{isDisabled:e}=t;l1e(()=>{if(!e)return yS++,yS===1&&jq()&&(LT=p1e()),()=>{yS--,yS===0&&(LT==null||LT())}},[e])}function p1e(){let t,e=0,n=l=>{t=Bq(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 d=l.changedTouches[0].pageY,m=t.scrollTop,p=t.scrollHeight-t.clientHeight;p!==0&&((m<=0&&d>e||m>=p&&d{let d=l.target;iD(d)&&d!==document.activeElement&&(l.preventDefault(),d.style.transform="translateY(-2000px)",d.focus(),requestAnimationFrame(()=>{d.style.transform=""}))},i=l=>{let d=l.target;iD(d)&&(d.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{d.style.transform="",MT&&(MT.height{_z(d)}):MT.addEventListener("resize",()=>_z(d),{once:!0}))}))},a=()=>{window.scrollTo(0,0)},o=window.pageXOffset,c=window.pageYOffset,u=yz(m1e(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let f=yz(Py(document,"touchstart",n,{passive:!1,capture:!0}),Py(document,"touchmove",r,{passive:!1,capture:!0}),Py(document,"touchend",s,{passive:!1,capture:!0}),Py(document,"focus",i,!0),Py(window,"scroll",a));return()=>{u(),f(),window.scrollTo(o,c)}}function m1e(t,e,n){let r=t.style[e];return t.style[e]=n,()=>{t.style[e]=r}}function Py(t,e,n,r){return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}}function _z(t){let e=document.scrollingElement||document.documentElement;for(;t&&t!==e;){let n=Bq(t);if(n!==document.documentElement&&n!==document.body&&n!==t){let r=n.getBoundingClientRect().top,s=t.getBoundingClientRect().top,i=t.getBoundingClientRect().bottom;const a=n.getBoundingClientRect().bottom+a1e;i>a&&(n.scrollTop+=s-r)}t=n.parentElement}}function iD(t){return t instanceof HTMLInputElement&&!f1e.has(t.type)||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable}function g1e(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function v1e(...t){return e=>t.forEach(n=>g1e(n,e))}function zq(...t){return _.useCallback(v1e(...t),t)}const Uq=new WeakMap;function jr(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&&Uq.set(t,r)}function y1e(t,e){if(!t||!(t instanceof HTMLElement))return;let n=Uq.get(t);n&&(t.style[e]=n[e])}const Br=t=>{switch(t){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return t}};function bS(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(", ")[Br(e)?13:12]):(s=r.match(/^matrix\((.+)\)$/),s?parseFloat(s[1].split(", ")[Br(e)?5:4]):null)}function b1e(t){return 8*(Math.log(t+1)-2)}function IT(t,e){if(!t)return()=>{};const n=t.style.cssText;return Object.assign(t.style,e),()=>{t.style.cssText=n}}function w1e(...t){return(...e)=>{for(const n of t)typeof n=="function"&&n(...e)}}const nr={DURATION:.5,EASE:[.32,.72,0,1]},Hq=.4,_1e=.25,x1e=100,Vq=8,wS=16,oD=26,$T="vaul-dragging";function Wq(t){const e=se.useRef(t);return se.useEffect(()=>{e.current=t}),se.useMemo(()=>(...n)=>e.current==null?void 0:e.current.call(e,...n),[])}function S1e({defaultProp:t,onChange:e}){const n=se.useState(t),[r]=n,s=se.useRef(r),i=Wq(e);return se.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}function Gq({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,s]=S1e({defaultProp:e,onChange:n}),i=t!==void 0,a=i?t:r,o=Wq(n),c=se.useCallback(u=>{if(i){const l=typeof u=="function"?u(t):u;l!==t&&o(l)}else s(u)},[i,t,s,o]);return[a,c]}function E1e({activeSnapPointProp:t,setActiveSnapPointProp:e,snapPoints:n,drawerRef:r,overlayRef:s,fadeFromIndex:i,onSnapPointChange:a,direction:o="bottom",container:c,snapToSequentialPoint:u}){const[f,l]=Gq({prop:t,defaultProp:n==null?void 0:n[0],onChange:e}),[d,m]=se.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);se.useEffect(()=>{function R(){m({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",R),()=>window.removeEventListener("resize",R)},[]);const p=se.useMemo(()=>f===(n==null?void 0:n[n.length-1])||null,[n,f]),h=se.useMemo(()=>n==null?void 0:n.findIndex(R=>R===f),[n,f]),y=n&&n.length>0&&(i||i===0)&&!Number.isNaN(i)&&n[i]===f||!n,g=se.useMemo(()=>{const R=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var E;return(E=n==null?void 0:n.map(k=>{const N=typeof k=="string";let O=0;if(N&&(O=parseInt(k,10)),Br(o)){const I=N?O:d?k*R.height:0;return d?o==="bottom"?R.height-I:-R.height+I:I}const L=N?O:d?k*R.width:0;return d?o==="right"?R.width-L:-R.width+L:L}))!=null?E:[]},[n,d,c]),v=se.useMemo(()=>h!==null?g==null?void 0:g[h]:null,[g,h]),w=se.useCallback(R=>{var E;const k=(E=g==null?void 0:g.findIndex(N=>N===R))!=null?E:null;a(k),jr(r.current,{transition:`transform ${nr.DURATION}s cubic-bezier(${nr.EASE.join(",")})`,transform:Br(o)?`translate3d(0, ${R}px, 0)`:`translate3d(${R}px, 0, 0)`}),g&&k!==g.length-1&&k!==i&&k{if(f||t){var R;const E=(R=n==null?void 0:n.findIndex(k=>k===t||k===f))!=null?R:-1;g&&E!==-1&&typeof g[E]=="number"&&w(g[E])}},[f,t,n,g,w]);function x({draggedDistance:R,closeDrawer:E,velocity:k,dismissible:N}){if(i===void 0)return;const O=o==="bottom"||o==="right"?(v??0)-R:(v??0)+R,L=h===i-1,I=h===0,F=R>0;if(L&&jr(s.current,{transition:`opacity ${nr.DURATION}s cubic-bezier(${nr.EASE.join(",")})`}),!u&&k>2&&!F){N?E():w(g[0]);return}if(!u&&k>2&&F&&g&&n){w(g[n.length-1]);return}const U=g==null?void 0:g.reduce((V,H)=>typeof V!="number"||typeof H!="number"?V:Math.abs(H-O)Hq&&Math.abs(R)0&&p){w(g[n.length-1]);return}if(I&&V<0&&N&&E(),h===null)return;w(g[h+V]);return}w(U)}function A({draggedDistance:R}){if(v===null)return;const E=o==="bottom"||o==="right"?v-R:v+R;(o==="bottom"||o==="right")&&Eg[g.length-1]||jr(r.current,{transform:Br(o)?`translate3d(0, ${E}px, 0)`:`translate3d(${E}px, 0, 0)`})}function T(R,E){if(!n||typeof h!="number"||!g||i===void 0)return null;const k=h===i-1;if(h>=i&&E)return 0;if(k&&!E)return 1;if(!y&&!k)return null;const O=k?h+1:h-1,L=k?g[O]-g[O-1]:g[O+1]-g[O],I=R/Math.abs(L);return k?1-I:I}return{isLastSnapPoint:p,activeSnapPoint:f,shouldFade:y,getPercentageDragged:T,setActiveSnapPoint:l,activeSnapPointIndex:h,onRelease:x,onDrag:A,snapPointsOffset:g}}const C1e=()=>()=>{};function A1e(){const{direction:t,isOpen:e,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:s}=O_(),i=se.useRef(null),a=_.useMemo(()=>document.body.style.backgroundColor,[]);function o(){return(window.innerWidth-oD)/window.innerWidth}se.useEffect(()=>{if(e&&n){i.current&&clearTimeout(i.current);const c=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!c)return;w1e(r&&!s?IT(document.body,{background:"black"}):C1e,IT(c,{transformOrigin:Br(t)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${nr.DURATION}s`,transitionTimingFunction:`cubic-bezier(${nr.EASE.join(",")})`}));const u=IT(c,{borderRadius:`${Vq}px`,overflow:"hidden",...Br(t)?{transform:`scale(${o()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${o()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{u(),i.current=window.setTimeout(()=>{a?document.body.style.background=a:document.body.style.removeProperty("background")},nr.DURATION*1e3)}}},[e,n,a])}let Ty=null;function R1e({isOpen:t,modal:e,nested:n,hasBeenOpened:r,preventScrollRestoration:s,noBodyStyles:i}){const[a,o]=se.useState(()=>typeof window<"u"?window.location.href:""),c=se.useRef(0),u=se.useCallback(()=>{if(bz()&&Ty===null&&t&&!i){Ty={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:d}=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 m=d-window.innerHeight;m&&c.current>=d&&(document.body.style.top=`${-(c.current+m)}px`)}),300)}},[t]),f=se.useCallback(()=>{if(bz()&&Ty!==null&&!i){const l=-parseInt(document.body.style.top,10),d=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Ty),window.requestAnimationFrame(()=>{if(s&&a!==window.location.href){o(window.location.href);return}window.scrollTo(d,l)}),Ty=null}},[a]);return se.useEffect(()=>{function l(){c.current=window.scrollY}return l(),window.addEventListener("scroll",l),()=>{window.removeEventListener("scroll",l)}},[]),se.useEffect(()=>{n||!r||(t?(!window.matchMedia("(display-mode: standalone)").matches&&u(),e||window.setTimeout(()=>{f()},500)):f())},[t,r,a,e,n,u,f]),{restorePositionSetting:f}}function P1e({open:t,onOpenChange:e,children:n,onDrag:r,onRelease:s,snapPoints:i,shouldScaleBackground:a=!1,setBackgroundColorOnScale:o=!0,closeThreshold:c=_1e,scrollLockTimeout:u=x1e,dismissible:f=!0,handleOnly:l=!1,fadeFromIndex:d=i&&i.length-1,activeSnapPoint:m,setActiveSnapPoint:p,fixed:h,modal:y=!0,onClose:g,nested:v,noBodyStyles:w,direction:x="bottom",defaultOpen:A=!1,disablePreventScroll:T=!0,snapToSequentialPoint:R=!1,preventScrollRestoration:E=!1,repositionInputs:k=!0,onAnimationEnd:N,container:O,autoFocus:L=!1}){var I,F;const[U=!1,Y]=Gq({defaultProp:A,prop:t,onChange:Ue=>{e==null||e(Ue),!Ue&&!v&&Oe(),setTimeout(()=>{N==null||N(Ue)},nr.DURATION*1e3),Ue&&!y&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),Ue||(document.body.style.pointerEvents="auto")}}),[V,H]=se.useState(!1),[ee,re]=se.useState(!1),[X,q]=se.useState(!1),K=se.useRef(null),Z=se.useRef(null),ue=se.useRef(null),de=se.useRef(null),ie=se.useRef(null),be=se.useRef(!1),Ae=se.useRef(null),_e=se.useRef(0),Me=se.useRef(!1),De=se.useRef(0),ye=se.useRef(null),Fe=se.useRef(((I=ye.current)==null?void 0:I.getBoundingClientRect().height)||0),ut=se.useRef(((F=ye.current)==null?void 0:F.getBoundingClientRect().width)||0),Qe=se.useRef(0),vt=se.useCallback(Ue=>{i&&Ue===J.length-1&&(Z.current=new Date)},[]),{activeSnapPoint:An,activeSnapPointIndex:Yt,setActiveSnapPoint:gn,onRelease:Xt,snapPointsOffset:J,onDrag:fe,shouldFade:ge,getPercentageDragged:Pe}=E1e({snapPoints:i,activeSnapPointProp:m,setActiveSnapPointProp:p,drawerRef:ye,fadeFromIndex:d,overlayRef:K,onSnapPointChange:vt,direction:x,container:O,snapToSequentialPoint:R});h1e({isDisabled:!U||ee||!y||X||!V||!k||!T});const{restorePositionSetting:Oe}=R1e({isOpen:U,modal:y,nested:v,hasBeenOpened:V,preventScrollRestoration:E,noBodyStyles:w});function xe(){return(window.innerWidth-oD)/window.innerWidth}function Te(Ue){var it,ot;!f&&!i||ye.current&&!ye.current.contains(Ue.target)||(Fe.current=((it=ye.current)==null?void 0:it.getBoundingClientRect().height)||0,ut.current=((ot=ye.current)==null?void 0:ot.getBoundingClientRect().width)||0,re(!0),ue.current=new Date,jq()&&window.addEventListener("touchend",()=>be.current=!1,{once:!0}),Ue.target.setPointerCapture(Ue.pointerId),_e.current=Br(x)?Ue.pageY:Ue.pageX)}function Ye(Ue,it){var ot,St;let nt=Ue;const Ht=(ot=window.getSelection())==null?void 0:ot.toString(),Ct=ye.current?bS(ye.current,x):null,yn=new Date;if(nt.hasAttribute("data-vaul-no-drag")||nt.closest("[data-vaul-no-drag]"))return!1;if(x==="right"||x==="left")return!0;if(Z.current&&yn.getTime()-Z.current.getTime()<500)return!1;if(Ct!==null&&(x==="bottom"?Ct>0:Ct<0))return!0;if(Ht&&Ht.length>0)return!1;if(yn.getTime()-((St=ie.current)==null?void 0:St.getTime())nt.clientHeight){if(nt.scrollTop!==0)return ie.current=new Date,!1;if(nt.getAttribute("role")==="dialog")return!0}nt=nt.parentNode}return!0}function Rt(Ue){if(ye.current&&ee){const it=x==="bottom"||x==="right"?1:-1,ot=(_e.current-(Br(x)?Ue.pageY:Ue.pageX))*it,St=ot>0,nt=i&&!f&&!St;if(nt&&Yt===0)return;const Ht=Math.abs(ot),Ct=document.querySelector("[data-vaul-drawer-wrapper]"),yn=x==="bottom"||x==="top"?Fe.current:ut.current;let an=Ht/yn;const ln=Pe(Ht,St);if(ln!==null&&(an=ln),nt&&an>=1||!be.current&&!Ye(Ue.target,St))return;if(ye.current.classList.add($T),be.current=!0,jr(ye.current,{transition:"none"}),jr(K.current,{transition:"none"}),i&&fe({draggedDistance:ot}),St&&!i){const gr=b1e(ot),On=Math.min(gr*-1,0)*it;jr(ye.current,{transform:Br(x)?`translate3d(0, ${On}px, 0)`:`translate3d(${On}px, 0, 0)`});return}const Dn=1-an;if((ge||d&&Yt===d-1)&&(r==null||r(Ue,an),jr(K.current,{opacity:`${Dn}`,transition:"none"},!0)),Ct&&K.current&&a){const gr=Math.min(xe()+an*(1-xe()),1),On=8-an*8,te=Math.max(0,14-an*14);jr(Ct,{borderRadius:`${On}px`,transform:Br(x)?`scale(${gr}) translate3d(0, ${te}px, 0)`:`scale(${gr}) translate3d(${te}px, 0, 0)`,transition:"none"},!0)}if(!i){const gr=Ht*it;jr(ye.current,{transform:Br(x)?`translate3d(0, ${gr}px, 0)`:`translate3d(${gr}px, 0, 0)`})}}}se.useEffect(()=>{var Ue;function it(){if(!ye.current||!k)return;const ot=document.activeElement;if(iD(ot)||Me.current){var St;const nt=((St=window.visualViewport)==null?void 0:St.height)||0,Ht=window.innerHeight;let Ct=Ht-nt;const yn=ye.current.getBoundingClientRect().height||0,an=yn>Ht*.8;Qe.current||(Qe.current=yn);const ln=ye.current.getBoundingClientRect().top;if(Math.abs(De.current-Ct)>60&&(Me.current=!Me.current),i&&i.length>0&&J&&Yt){const Dn=J[Yt]||0;Ct+=Dn}if(De.current=Ct,yn>nt||Me.current){const Dn=ye.current.getBoundingClientRect().height;let gr=Dn;Dn>nt&&(gr=nt-(an?ln:oD)),h?ye.current.style.height=`${Dn-Math.max(Ct,0)}px`:ye.current.style.height=`${Math.max(gr,nt-ln)}px`}else ye.current.style.height=`${Qe.current}px`;i&&i.length>0&&!Me.current?ye.current.style.bottom="0px":ye.current.style.bottom=`${Math.max(Ct,0)}px`}}return(Ue=window.visualViewport)==null||Ue.addEventListener("resize",it),()=>{var ot;return(ot=window.visualViewport)==null?void 0:ot.removeEventListener("resize",it)}},[Yt,i,J]);function bt(Ue){Qn(),g==null||g(),Ue||Y(!1),setTimeout(()=>{i&&gn(i[0])},nr.DURATION*1e3)}function $s(){if(!ye.current)return;const Ue=document.querySelector("[data-vaul-drawer-wrapper]"),it=bS(ye.current,x);jr(ye.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${nr.DURATION}s cubic-bezier(${nr.EASE.join(",")})`}),jr(K.current,{transition:`opacity ${nr.DURATION}s cubic-bezier(${nr.EASE.join(",")})`,opacity:"1"}),a&&it&&it>0&&U&&jr(Ue,{borderRadius:`${Vq}px`,overflow:"hidden",...Br(x)?{transform:`scale(${xe()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${xe()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${nr.DURATION}s`,transitionTimingFunction:`cubic-bezier(${nr.EASE.join(",")})`},!0)}function Qn(){!ee||!ye.current||(ye.current.classList.remove($T),be.current=!1,re(!1),de.current=new Date)}function ys(Ue){if(!ee||!ye.current)return;ye.current.classList.remove($T),be.current=!1,re(!1),de.current=new Date;const it=bS(ye.current,x);if(!Ye(Ue.target,!1)||!it||Number.isNaN(it)||ue.current===null)return;const ot=de.current.getTime()-ue.current.getTime(),St=_e.current-(Br(x)?Ue.pageY:Ue.pageX),nt=Math.abs(St)/ot;if(nt>.05&&(q(!0),setTimeout(()=>{q(!1)},200)),i){Xt({draggedDistance:St*(x==="bottom"||x==="right"?1:-1),closeDrawer:bt,velocity:nt,dismissible:f}),s==null||s(Ue,!0);return}if(x==="bottom"||x==="right"?St>0:St<0){$s(),s==null||s(Ue,!0);return}if(nt>Hq){bt(),s==null||s(Ue,!1);return}var Ht;const Ct=Math.min((Ht=ye.current.getBoundingClientRect().height)!=null?Ht:0,window.innerHeight);var yn;const an=Math.min((yn=ye.current.getBoundingClientRect().width)!=null?yn:0,window.innerWidth),ln=x==="left"||x==="right";if(Math.abs(it)>=(ln?an:Ct)*c){bt(),s==null||s(Ue,!1);return}s==null||s(Ue,!0),$s()}se.useEffect(()=>(U&&(jr(document.documentElement,{scrollBehavior:"auto"}),Z.current=new Date),()=>{y1e(document.documentElement,"scrollBehavior")}),[U]);function Ut(Ue){const it=Ue?(window.innerWidth-wS)/window.innerWidth:1,ot=Ue?-16:0;Ae.current&&window.clearTimeout(Ae.current),jr(ye.current,{transition:`transform ${nr.DURATION}s cubic-bezier(${nr.EASE.join(",")})`,transform:`scale(${it}) translate3d(0, ${ot}px, 0)`}),!Ue&&ye.current&&(Ae.current=setTimeout(()=>{const St=bS(ye.current,x);jr(ye.current,{transition:"none",transform:Br(x)?`translate3d(0, ${St}px, 0)`:`translate3d(${St}px, 0, 0)`})},500))}function on(Ue,it){if(it<0)return;const ot=(window.innerWidth-wS)/window.innerWidth,St=ot+it*(1-ot),nt=-16+it*wS;jr(ye.current,{transform:Br(x)?`scale(${St}) translate3d(0, ${nt}px, 0)`:`scale(${St}) translate3d(${nt}px, 0, 0)`,transition:"none"})}function vn(Ue,it){const ot=Br(x)?window.innerHeight:window.innerWidth,St=it?(ot-wS)/ot:1,nt=it?-16:0;it&&jr(ye.current,{transition:`transform ${nr.DURATION}s cubic-bezier(${nr.EASE.join(",")})`,transform:Br(x)?`scale(${St}) translate3d(0, ${nt}px, 0)`:`scale(${St}) translate3d(${nt}px, 0, 0)`})}return se.createElement(JCe,{defaultOpen:A,onOpenChange:Ue=>{!f&&!Ue||(Ue?H(!0):bt(!0),Y(Ue))},open:U},se.createElement(Fq.Provider,{value:{activeSnapPoint:An,snapPoints:i,setActiveSnapPoint:gn,drawerRef:ye,overlayRef:K,onOpenChange:e,onPress:Te,onRelease:ys,onDrag:Rt,dismissible:f,handleOnly:l,isOpen:U,isDragging:ee,shouldFade:ge,closeDrawer:bt,onNestedDrag:on,onNestedOpenChange:Ut,onNestedRelease:vn,keyboardIsOpen:Me,modal:y,snapPointsOffset:J,direction:x,shouldScaleBackground:a,setBackgroundColorOnScale:o,noBodyStyles:w,container:O,autoFocus:L}},n))}const qq=se.forwardRef(function({...t},e){const{overlayRef:n,snapPoints:r,onRelease:s,shouldFade:i,isOpen:a,modal:o}=O_(),c=zq(e,n),u=r&&r.length>0;return o?se.createElement(t1e,{onMouseUp:s,ref:c,"data-vaul-overlay":"","data-vaul-snap-points":a&&u?"true":"false","data-vaul-snap-points-overlay":a&&i?"true":"false",...t}):(typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),null)});qq.displayName="Drawer.Overlay";const Kq=se.forwardRef(function({onPointerDownOutside:t,style:e,onOpenAutoFocus:n,...r},s){const{drawerRef:i,onPress:a,onRelease:o,onDrag:c,keyboardIsOpen:u,snapPointsOffset:f,modal:l,isOpen:d,direction:m,snapPoints:p,container:h,handleOnly:y,autoFocus:g}=O_(),[v,w]=se.useState(!1),x=zq(s,i),A=se.useRef(null),T=se.useRef(null),R=se.useRef(!1),E=p&&p.length>0;A1e();const k=(O,L,I=0)=>{if(R.current)return!0;const F=Math.abs(O.y),U=Math.abs(O.x),Y=U>F,V=["bottom","right"].includes(L)?1:-1;if(L==="left"||L==="right"){if(!(O.x*V<0)&&U>=0&&U<=I)return Y}else if(!(O.y*V<0)&&F>=0&&F<=I)return!Y;return R.current=!0,!0};se.useEffect(()=>{E&&window.requestAnimationFrame(()=>{w(!0)})},[]);function N(O){A.current=null,R.current=!1,o(O)}return se.createElement(n1e,{"data-vaul-drawer-direction":m,"data-vaul-drawer":"","data-vaul-delayed-snap-points":v?"true":"false","data-vaul-snap-points":d&&E?"true":"false","data-vaul-custom-container":h?"true":"false",...r,ref:x,style:f&&f.length>0?{"--snap-point-height":`${f[0]}px`,...e}:e,onPointerDown:O=>{y||(r.onPointerDown==null||r.onPointerDown.call(r,O),A.current={x:O.pageX,y:O.pageY},a(O))},onOpenAutoFocus:O=>{n==null||n(O),g||O.preventDefault()},onPointerDownOutside:O=>{if(t==null||t(O),!l||O.defaultPrevented){O.preventDefault();return}u.current&&(u.current=!1)},onFocusOutside:O=>{if(!l){O.preventDefault();return}},onPointerMove:O=>{if(T.current=O,y||(r.onPointerMove==null||r.onPointerMove.call(r,O),!A.current))return;const L=O.pageY-A.current.y,I=O.pageX-A.current.x,F=O.pointerType==="touch"?10:2;k({x:I,y:L},m,F)?c(O):(Math.abs(I)>F||Math.abs(L)>F)&&(A.current=null)},onPointerUp:O=>{r.onPointerUp==null||r.onPointerUp.call(r,O),A.current=null,R.current=!1,o(O)},onPointerOut:O=>{r.onPointerOut==null||r.onPointerOut.call(r,O),N(T.current)},onContextMenu:O=>{r.onContextMenu==null||r.onContextMenu.call(r,O),N(T.current)}})});Kq.displayName="Drawer.Content";const T1e=250,k1e=120,N1e=se.forwardRef(function({preventCycle:t=!1,children:e,...n},r){const{closeDrawer:s,isDragging:i,snapPoints:a,activeSnapPoint:o,setActiveSnapPoint:c,dismissible:u,handleOnly:f,isOpen:l,onPress:d,onDrag:m}=O_(),p=se.useRef(null),h=se.useRef(!1);function y(){if(h.current){w();return}window.setTimeout(()=>{g()},k1e)}function g(){if(i||t||h.current){w();return}if(w(),(!a||a.length===0)&&u){s();return}if(o===a[a.length-1]&&u){s();return}const A=a.findIndex(R=>R===o);if(A===-1)return;const T=a[A+1];c(T)}function v(){p.current=window.setTimeout(()=>{h.current=!0},T1e)}function w(){window.clearTimeout(p.current),h.current=!1}return se.createElement("div",{onClick:y,onPointerCancel:w,onPointerDown:x=>{f&&d(x),v()},onPointerMove:x=>{f&&m(x)},ref:r,"data-vaul-drawer-visible":l?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},se.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},e))});N1e.displayName="Drawer.Handle";function D1e(t){const e=O_(),{container:n=e.container,...r}=t;return se.createElement(e1e,{container:n,...r})}const Tl={Root:P1e,Content:Kq,Overlay:qq,Portal:D1e,Close:i1e,Title:r1e,Description:s1e},O1e=({shouldScaleBackground:t=!0,...e})=>P.jsx(Tl.Root,{shouldScaleBackground:t,...e});O1e.displayName="Drawer";const M1e=Tl.Portal,gUe=Tl.Close,Yq=_.forwardRef(({className:t,...e},n)=>P.jsx(Tl.Overlay,{ref:n,className:le("fixed inset-0 z-50 bg-black/80",t),...e}));Yq.displayName=Tl.Overlay.displayName;const L1e=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(M1e,{children:[P.jsx(Yq,{}),P.jsxs(Tl.Content,{ref:r,className:le("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",t),...n,children:[P.jsx("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),e]})]}));L1e.displayName="DrawerContent";const I1e=({className:t,...e})=>P.jsx("div",{className:le("grid gap-1.5 p-4 text-center sm:text-left",t),...e});I1e.displayName="DrawerHeader";const $1e=({className:t,...e})=>P.jsx("div",{className:le("mt-auto flex flex-col gap-2 p-4",t),...e});$1e.displayName="DrawerFooter";const F1e=_.forwardRef(({className:t,...e},n)=>P.jsx(Tl.Title,{ref:n,className:le("text-lg font-semibold leading-none tracking-tight",t),...e}));F1e.displayName=Tl.Title.displayName;const j1e=_.forwardRef(({className:t,...e},n)=>P.jsx(Tl.Description,{ref:n,className:le("text-sm text-muted-foreground",t),...e}));j1e.displayName=Tl.Description.displayName;var YI="DropdownMenu",[B1e,vUe]=Nn(YI,[N_]),si=N_(),[z1e,Xq]=B1e(YI),Qq=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:a,modal:o=!0}=t,c=si(e),u=_.useRef(null),[f=!1,l]=lr({prop:s,defaultProp:i,onChange:a});return P.jsx(z1e,{scope:e,triggerId:qr(),triggerRef:u,contentId:qr(),open:f,onOpenChange:l,onOpenToggle:_.useCallback(()=>l(d=>!d),[l]),modal:o,children:P.jsx(kEe,{...c,open:f,onOpenChange:l,dir:r,modal:o,children:n})})};Qq.displayName=YI;var Zq="DropdownMenuTrigger",Jq=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=t,i=Xq(Zq,n),a=si(n);return P.jsx(TI,{asChild:!0,...a,children:P.jsx(Ne.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:c_(e,i.triggerRef),onPointerDown:me(t.onPointerDown,o=>{!r&&o.button===0&&o.ctrlKey===!1&&(i.onOpenToggle(),i.open||o.preventDefault())}),onKeyDown:me(t.onKeyDown,o=>{r||(["Enter"," "].includes(o.key)&&i.onOpenToggle(),o.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});Jq.displayName=Zq;var U1e="DropdownMenuPortal",eK=t=>{const{__scopeDropdownMenu:e,...n}=t,r=si(e);return P.jsx(kI,{...r,...n})};eK.displayName=U1e;var tK="DropdownMenuContent",nK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Xq(tK,n),i=si(n),a=_.useRef(!1);return P.jsx(NI,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:e,onCloseAutoFocus:me(t.onCloseAutoFocus,o=>{var c;a.current||(c=s.triggerRef.current)==null||c.focus(),a.current=!1,o.preventDefault()}),onInteractOutside:me(t.onInteractOutside,o=>{const c=o.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,f=c.button===2||u;(!s.modal||f)&&(a.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)"}})});nK.displayName=tK;var H1e="DropdownMenuGroup",rK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=si(n);return P.jsx(DI,{...s,...r,ref:e})});rK.displayName=H1e;var V1e="DropdownMenuLabel",sK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=si(n);return P.jsx(OI,{...s,...r,ref:e})});sK.displayName=V1e;var W1e="DropdownMenuItem",iK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=si(n);return P.jsx(MI,{...s,...r,ref:e})});iK.displayName=W1e;var G1e="DropdownMenuCheckboxItem",oK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=si(n);return P.jsx(LI,{...s,...r,ref:e})});oK.displayName=G1e;var q1e="DropdownMenuRadioGroup",K1e=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=si(n);return P.jsx(II,{...s,...r,ref:e})});K1e.displayName=q1e;var Y1e="DropdownMenuRadioItem",aK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=si(n);return P.jsx($I,{...s,...r,ref:e})});aK.displayName=Y1e;var X1e="DropdownMenuItemIndicator",lK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=si(n);return P.jsx(FI,{...s,...r,ref:e})});lK.displayName=X1e;var Q1e="DropdownMenuSeparator",cK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=si(n);return P.jsx(jI,{...s,...r,ref:e})});cK.displayName=Q1e;var Z1e="DropdownMenuArrow",J1e=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=si(n);return P.jsx(BI,{...s,...r,ref:e})});J1e.displayName=Z1e;var eAe="DropdownMenuSubTrigger",uK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=si(n);return P.jsx(zI,{...s,...r,ref:e})});uK.displayName=eAe;var tAe="DropdownMenuSubContent",dK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=si(n);return P.jsx(UI,{...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)"}})});dK.displayName=tAe;var nAe=Qq,rAe=Jq,sAe=eK,fK=nK,iAe=rK,hK=sK,pK=iK,mK=oK,gK=aK,vK=lK,yK=cK,bK=uK,wK=dK;const oAe=nAe,aAe=rAe,lAe=iAe,cAe=_.forwardRef(({className:t,inset:e,children:n,...r},s)=>P.jsxs(bK,{ref:s,className:le("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,P.jsx(d_,{className:"w-4 h-4 ml-auto"})]}));cAe.displayName=bK.displayName;const uAe=_.forwardRef(({className:t,...e},n)=>P.jsx(wK,{ref:n,className:le("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}));uAe.displayName=wK.displayName;const _K=_.forwardRef(({className:t,sideOffset:e=4,...n},r)=>P.jsx(sAe,{children:P.jsx(fK,{ref:r,sideOffset:e,className:le("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})}));_K.displayName=fK.displayName;const aD=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(pK,{ref:r,className:le("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}));aD.displayName=pK.displayName;const dAe=_.forwardRef(({className:t,children:e,checked:n,...r},s)=>P.jsxs(mK,{ref:s,className:le("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:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(vK,{children:P.jsx(u_,{className:"w-4 h-4"})})}),e]}));dAe.displayName=mK.displayName;const fAe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(gK,{ref:r,className:le("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:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(vK,{children:P.jsx(G1,{className:"w-2 h-2 fill-current"})})}),e]}));fAe.displayName=gK.displayName;const xK=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(hK,{ref:r,className:le("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));xK.displayName=hK.displayName;const lD=_.forwardRef(({className:t,...e},n)=>P.jsx(yK,{ref:n,className:le("-mx-1 my-1 h-px bg-muted",t),...e}));lD.displayName=yK.displayName;const hAe=({className:t,...e})=>P.jsx("span",{className:le("ml-auto text-xs tracking-widest opacity-60",t),...e});hAe.displayName="DropdownMenuShortcut";var M_=t=>t.type==="checkbox",Ef=t=>t instanceof Date,Ys=t=>t==null;const SK=t=>typeof t=="object";var xr=t=>!Ys(t)&&!Array.isArray(t)&&SK(t)&&!Ef(t),EK=t=>xr(t)&&t.target?M_(t.target)?t.target.checked:t.target.value:t,pAe=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,CK=(t,e)=>t.has(pAe(e)),mAe=t=>{const e=t.constructor&&t.constructor.prototype;return xr(e)&&e.hasOwnProperty("isPrototypeOf")},XI=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function tr(t){let e;const n=Array.isArray(t),r=typeof FileList<"u"?t instanceof FileList:!1;if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else if(!(XI&&(t instanceof Blob||r))&&(n||xr(t)))if(e=n?[]:{},!n&&!mAe(t))e=t;else for(const s in t)t.hasOwnProperty(s)&&(e[s]=tr(t[s]));else return t;return e}var L_=t=>Array.isArray(t)?t.filter(Boolean):[],Hn=t=>t===void 0,$e=(t,e,n)=>{if(!e||!xr(t))return n;const r=L_(e.split(/[,[\].]+?/)).reduce((s,i)=>Ys(s)?s:s[i],t);return Hn(r)||r===t?Hn(t[e])?n:t[e]:r},to=t=>typeof t=="boolean",QI=t=>/^\w*$/.test(t),AK=t=>L_(t.replace(/["|']|\]/g,"").split(/\.|\[/)),Qt=(t,e,n)=>{let r=-1;const s=QI(e)?[e]:AK(e),i=s.length,a=i-1;for(;++rse.useContext(RK),gAe=t=>{const{children:e,...n}=t;return se.createElement(RK.Provider,{value:n},e)};var PK=(t,e,n,r=!0)=>{const s={defaultValues:e._defaultValues};for(const i in t)Object.defineProperty(s,i,{get:()=>{const a=i;return e._proxyFormState[a]!==Lo.all&&(e._proxyFormState[a]=!r||Lo.all),n&&(n[a]=!0),t[a]}});return s};function vAe(t){const e=Ia(),{control:n=e.control,disabled:r,name:s,exact:i}=t||{},[a,o]=se.useState(n._formState),c=se.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=se.useRef(s);return u.current=s,se.useEffect(()=>n._subscribe({name:u.current,formState:c.current,exact:i,callback:f=>{!r&&o({...n._formState,...f})}}),[n,r,i]),se.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),se.useMemo(()=>PK(a,n,c.current,!1),[a,n])}var ml=t=>typeof t=="string",TK=(t,e,n,r,s)=>ml(t)?(r&&e.watch.add(t),$e(n,t,s)):Array.isArray(t)?t.map(i=>(r&&e.watch.add(i),$e(n,i))):(r&&(e.watchAll=!0),n);function yAe(t){const e=Ia(),{control:n=e.control,name:r,defaultValue:s,disabled:i,exact:a}=t||{},o=se.useRef(r),c=se.useRef(s);o.current=r,se.useEffect(()=>n._subscribe({name:o.current,formState:{values:!0},exact:a,callback:l=>!i&&f(TK(o.current,n._names,l.values||n._formValues,!1,c.current))}),[n,i,a]);const[u,f]=se.useState(n._getWatch(r,s));return se.useEffect(()=>n._removeUnmounted()),u}function bAe(t){const e=Ia(),{name:n,disabled:r,control:s=e.control,shouldUnregister:i}=t,a=CK(s._names.array,n),o=yAe({control:s,name:n,defaultValue:$e(s._formValues,n,$e(s._defaultValues,n,t.defaultValue)),exact:!0}),c=vAe({control:s,name:n,exact:!0}),u=se.useRef(t),f=se.useRef(s.register(n,{...t.rules,value:o,...to(t.disabled)?{disabled:t.disabled}:{}})),l=se.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!$e(c.errors,n)},isDirty:{enumerable:!0,get:()=>!!$e(c.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!$e(c.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!$e(c.validatingFields,n)},error:{enumerable:!0,get:()=>$e(c.errors,n)}}),[c,n]),d=se.useCallback(y=>f.current.onChange({target:{value:EK(y),name:n},type:bC.CHANGE}),[n]),m=se.useCallback(()=>f.current.onBlur({target:{value:$e(s._formValues,n),name:n},type:bC.BLUR}),[n,s._formValues]),p=se.useCallback(y=>{const g=$e(s._fields,n);g&&y&&(g._f.ref={focus:()=>y.focus(),select:()=>y.select(),setCustomValidity:v=>y.setCustomValidity(v),reportValidity:()=>y.reportValidity()})},[s._fields,n]),h=se.useMemo(()=>({name:n,value:o,...to(r)||c.disabled?{disabled:c.disabled||r}:{},onChange:d,onBlur:m,ref:p}),[n,r,c.disabled,d,m,p,o]);return se.useEffect(()=>{const y=s._options.shouldUnregister||i;s.register(n,{...u.current.rules,...to(u.current.disabled)?{disabled:u.current.disabled}:{}});const g=(v,w)=>{const x=$e(s._fields,v);x&&x._f&&(x._f.mount=w)};if(g(n,!0),y){const v=tr($e(s._options.defaultValues,n));Qt(s._defaultValues,n,v),Hn($e(s._formValues,n))&&Qt(s._formValues,n,v)}return!a&&s.register(n),()=>{(a?y&&!s._state.action:y)?s.unregister(n):g(n,!1)}},[n,s,a,i]),se.useEffect(()=>{s._setDisabledField({disabled:r,name:n})},[r,n,s]),se.useMemo(()=>({field:h,formState:c,fieldState:l}),[h,c,l])}const wAe=t=>t.render(bAe(t));var kK=(t,e,n,r,s)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:s||!0}}:{},xi=t=>Array.isArray(t)?t:[t],xz=()=>{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=[]}}},cD=t=>Ys(t)||!SK(t);function Ou(t,e){if(cD(t)||cD(e))return t===e;if(Ef(t)&&Ef(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 a=e[s];if(Ef(i)&&Ef(a)||xr(i)&&xr(a)||Array.isArray(i)&&Array.isArray(a)?!Ou(i,a):i!==a)return!1}}return!0}var ks=t=>xr(t)&&!Object.keys(t).length,ZI=t=>t.type==="file",_a=t=>typeof t=="function",wC=t=>{if(!XI)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},NK=t=>t.type==="select-multiple",JI=t=>t.type==="radio",_Ae=t=>JI(t)||M_(t),FT=t=>wC(t)&&t.isConnected;function xAe(t,e){const n=e.slice(0,-1).length;let r=0;for(;r{for(const e in t)if(_a(t[e]))return!0;return!1};function _C(t,e={}){const n=Array.isArray(t);if(xr(t)||n)for(const r in t)Array.isArray(t[r])||xr(t[r])&&!DK(t[r])?(e[r]=Array.isArray(t[r])?[]:{},_C(t[r],e[r])):Ys(t[r])||(e[r]=!0);return e}function OK(t,e,n){const r=Array.isArray(t);if(xr(t)||r)for(const s in t)Array.isArray(t[s])||xr(t[s])&&!DK(t[s])?Hn(e)||cD(n[s])?n[s]=Array.isArray(t[s])?_C(t[s],[]):{..._C(t[s])}:OK(t[s],Ys(e)?{}:e[s],n[s]):n[s]=!Ou(t[s],e[s]);return n}var ky=(t,e)=>OK(t,e,_C(e));const Sz={value:!1,isValid:!1},Ez={value:!0,isValid:!0};var MK=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&&!Hn(t[0].attributes.value)?Hn(t[0].value)||t[0].value===""?Ez:{value:t[0].value,isValid:!0}:Ez:Sz}return Sz},LK=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>Hn(t)?t:e?t===""?NaN:t&&+t:n&&ml(t)?new Date(t):r?r(t):t;const Cz={isValid:!1,value:null};var IK=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,Cz):Cz;function Az(t){const e=t.ref;return ZI(e)?e.files:JI(e)?IK(t.refs).value:NK(e)?[...e.selectedOptions].map(({value:n})=>n):M_(e)?MK(t.refs).value:LK(Hn(e.value)?t.ref.value:e.value,t)}var EAe=(t,e,n,r)=>{const s={};for(const i of t){const a=$e(e,i);a&&Qt(s,i,a._f)}return{criteriaMode:n,names:[...t],fields:s,shouldUseNativeValidation:r}},xC=t=>t instanceof RegExp,Ny=t=>Hn(t)?t:xC(t)?t.source:xr(t)?xC(t.value)?t.value.source:t.value:t,Rm=t=>({isOnSubmit:!t||t===Lo.onSubmit,isOnBlur:t===Lo.onBlur,isOnChange:t===Lo.onChange,isOnAll:t===Lo.all,isOnTouch:t===Lo.onTouched});const Rz="AsyncFunction";var CAe=t=>!!t&&!!t.validate&&!!(_a(t.validate)&&t.validate.constructor.name===Rz||xr(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===Rz)),AAe=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),uD=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const Wm=(t,e,n,r)=>{for(const s of n||Object.keys(t)){const i=$e(t,s);if(i){const{_f:a,...o}=i;if(a){if(a.refs&&a.refs[0]&&e(a.refs[0],s)&&!r)return!0;if(a.ref&&e(a.ref,a.name)&&!r)return!0;if(Wm(o,e))break}else if(xr(o)&&Wm(o,e))break}}};function Pz(t,e,n){const r=$e(t,n);if(r||QI(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const i=s.join("."),a=$e(e,i),o=$e(t,i);if(a&&!Array.isArray(a)&&n!==i)return{name:n};if(o&&o.type)return{name:i,error:o};s.pop()}return{name:n}}var RAe=(t,e,n,r)=>{n(t);const{name:s,...i}=t;return ks(i)||Object.keys(i).length>=Object.keys(e).length||Object.keys(i).find(a=>e[a]===(!r||Lo.all))},PAe=(t,e,n)=>!t||!e||t===e||xi(t).some(r=>r&&(n?r===e:r.startsWith(e)||e.startsWith(r))),TAe=(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,kAe=(t,e)=>!L_($e(t,e)).length&&Ar(t,e),$K=(t,e,n)=>{const r=xi($e(t,n));return Qt(r,"root",e[n]),Qt(t,n,r),t},XS=t=>ml(t);function Tz(t,e,n="validate"){if(XS(t)||Array.isArray(t)&&t.every(XS)||to(t)&&!t)return{type:n,message:XS(t)?t:"",ref:e}}var Yp=t=>xr(t)&&!xC(t)?t:{value:t,message:""},dD=async(t,e,n,r,s,i)=>{const{ref:a,refs:o,required:c,maxLength:u,minLength:f,min:l,max:d,pattern:m,validate:p,name:h,valueAsNumber:y,mount:g}=t._f,v=$e(n,h);if(!g||e.has(h))return{};const w=o?o[0]:a,x=L=>{s&&w.reportValidity&&(w.setCustomValidity(to(L)?"":L||""),w.reportValidity())},A={},T=JI(a),R=M_(a),E=T||R,k=(y||ZI(a))&&Hn(a.value)&&Hn(v)||wC(a)&&a.value===""||v===""||Array.isArray(v)&&!v.length,N=kK.bind(null,h,r,A),O=(L,I,F,U=Wl.maxLength,Y=Wl.minLength)=>{const V=L?I:F;A[h]={type:L?U:Y,message:V,ref:a,...N(L?U:Y,V)}};if(i?!Array.isArray(v)||!v.length:c&&(!E&&(k||Ys(v))||to(v)&&!v||R&&!MK(o).isValid||T&&!IK(o).isValid)){const{value:L,message:I}=XS(c)?{value:!!c,message:c}:Yp(c);if(L&&(A[h]={type:Wl.required,message:I,ref:w,...N(Wl.required,I)},!r))return x(I),A}if(!k&&(!Ys(l)||!Ys(d))){let L,I;const F=Yp(d),U=Yp(l);if(!Ys(v)&&!isNaN(v)){const Y=a.valueAsNumber||v&&+v;Ys(F.value)||(L=Y>F.value),Ys(U.value)||(I=Ynew Date(new Date().toDateString()+" "+re),H=a.type=="time",ee=a.type=="week";ml(F.value)&&v&&(L=H?V(v)>V(F.value):ee?v>F.value:Y>new Date(F.value)),ml(U.value)&&v&&(I=H?V(v)+L.value,U=!Ys(I.value)&&v.length<+I.value;if((F||U)&&(O(F,L.message,I.message),!r))return x(A[h].message),A}if(m&&!k&&ml(v)){const{value:L,message:I}=Yp(m);if(xC(L)&&!v.match(L)&&(A[h]={type:Wl.pattern,message:I,ref:a,...N(Wl.pattern,I)},!r))return x(I),A}if(p){if(_a(p)){const L=await p(v,n),I=Tz(L,w);if(I&&(A[h]={...I,...N(Wl.validate,I.message)},!r))return x(I.message),A}else if(xr(p)){let L={};for(const I in p){if(!ks(L)&&!r)break;const F=Tz(await p[I](v,n),w,I);F&&(L={...F,...N(I,F.message)},x(F.message),r&&(A[h]=L))}if(!ks(L)&&(A[h]={ref:w,...L},!r))return A}}return x(!0),A};const NAe={mode:Lo.onSubmit,reValidateMode:Lo.onChange,shouldFocusError:!0};function DAe(t={}){let e={...NAe,...t},n={submitCount:0,isDirty:!1,isLoading:_a(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1};const r={};let s=xr(e.defaultValues)||xr(e.values)?tr(e.values||e.defaultValues)||{}:{},i=e.shouldUnregister?{}:tr(s),a={action:!1,mount:!1,watch:!1},o={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let l={...f};const d={array:xz(),state:xz()},m=Rm(e.mode),p=Rm(e.reValidateMode),h=e.criteriaMode===Lo.all,y=J=>fe=>{clearTimeout(u),u=setTimeout(J,fe)},g=async J=>{if(!e.disabled&&(f.isValid||l.isValid||J)){const fe=e.resolver?ks((await k()).errors):await O(r,!0);fe!==n.isValid&&d.state.next({isValid:fe})}},v=(J,fe)=>{!e.disabled&&(f.isValidating||f.validatingFields||l.isValidating||l.validatingFields)&&((J||Array.from(o.mount)).forEach(ge=>{ge&&(fe?Qt(n.validatingFields,ge,fe):Ar(n.validatingFields,ge))}),d.state.next({validatingFields:n.validatingFields,isValidating:!ks(n.validatingFields)}))},w=(J,fe=[],ge,Pe,Oe=!0,xe=!0)=>{if(Pe&&ge&&!e.disabled){if(a.action=!0,xe&&Array.isArray($e(r,J))){const Te=ge($e(r,J),Pe.argA,Pe.argB);Oe&&Qt(r,J,Te)}if(xe&&Array.isArray($e(n.errors,J))){const Te=ge($e(n.errors,J),Pe.argA,Pe.argB);Oe&&Qt(n.errors,J,Te),kAe(n.errors,J)}if((f.touchedFields||l.touchedFields)&&xe&&Array.isArray($e(n.touchedFields,J))){const Te=ge($e(n.touchedFields,J),Pe.argA,Pe.argB);Oe&&Qt(n.touchedFields,J,Te)}(f.dirtyFields||l.dirtyFields)&&(n.dirtyFields=ky(s,i)),d.state.next({name:J,isDirty:I(J,fe),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Qt(i,J,fe)},x=(J,fe)=>{Qt(n.errors,J,fe),d.state.next({errors:n.errors})},A=J=>{n.errors=J,d.state.next({errors:n.errors,isValid:!1})},T=(J,fe,ge,Pe)=>{const Oe=$e(r,J);if(Oe){const xe=$e(i,J,Hn(ge)?$e(s,J):ge);Hn(xe)||Pe&&Pe.defaultChecked||fe?Qt(i,J,fe?xe:Az(Oe._f)):Y(J,xe),a.mount&&g()}},R=(J,fe,ge,Pe,Oe)=>{let xe=!1,Te=!1;const Ye={name:J};if(!e.disabled){if(!ge||Pe){(f.isDirty||l.isDirty)&&(Te=n.isDirty,n.isDirty=Ye.isDirty=I(),xe=Te!==Ye.isDirty);const Rt=Ou($e(s,J),fe);Te=!!$e(n.dirtyFields,J),Rt?Ar(n.dirtyFields,J):Qt(n.dirtyFields,J,!0),Ye.dirtyFields=n.dirtyFields,xe=xe||(f.dirtyFields||l.dirtyFields)&&Te!==!Rt}if(ge){const Rt=$e(n.touchedFields,J);Rt||(Qt(n.touchedFields,J,ge),Ye.touchedFields=n.touchedFields,xe=xe||(f.touchedFields||l.touchedFields)&&Rt!==ge)}xe&&Oe&&d.state.next(Ye)}return xe?Ye:{}},E=(J,fe,ge,Pe)=>{const Oe=$e(n.errors,J),xe=(f.isValid||l.isValid)&&to(fe)&&n.isValid!==fe;if(e.delayError&&ge?(c=y(()=>x(J,ge)),c(e.delayError)):(clearTimeout(u),c=null,ge?Qt(n.errors,J,ge):Ar(n.errors,J)),(ge?!Ou(Oe,ge):Oe)||!ks(Pe)||xe){const Te={...Pe,...xe&&to(fe)?{isValid:fe}:{},errors:n.errors,name:J};n={...n,...Te},d.state.next(Te)}},k=async J=>{v(J,!0);const fe=await e.resolver(i,e.context,EAe(J||o.mount,r,e.criteriaMode,e.shouldUseNativeValidation));return v(J),fe},N=async J=>{const{errors:fe}=await k(J);if(J)for(const ge of J){const Pe=$e(fe,ge);Pe?Qt(n.errors,ge,Pe):Ar(n.errors,ge)}else n.errors=fe;return fe},O=async(J,fe,ge={valid:!0})=>{for(const Pe in J){const Oe=J[Pe];if(Oe){const{_f:xe,...Te}=Oe;if(xe){const Ye=o.array.has(xe.name),Rt=Oe._f&&CAe(Oe._f);Rt&&f.validatingFields&&v([Pe],!0);const bt=await dD(Oe,o.disabled,i,h,e.shouldUseNativeValidation&&!fe,Ye);if(Rt&&f.validatingFields&&v([Pe]),bt[xe.name]&&(ge.valid=!1,fe))break;!fe&&($e(bt,xe.name)?Ye?$K(n.errors,bt,xe.name):Qt(n.errors,xe.name,bt[xe.name]):Ar(n.errors,xe.name))}!ks(Te)&&await O(Te,fe,ge)}}return ge.valid},L=()=>{for(const J of o.unMount){const fe=$e(r,J);fe&&(fe._f.refs?fe._f.refs.every(ge=>!FT(ge)):!FT(fe._f.ref))&&Ae(J)}o.unMount=new Set},I=(J,fe)=>!e.disabled&&(J&&fe&&Qt(i,J,fe),!Ou(q(),s)),F=(J,fe,ge)=>TK(J,o,{...a.mount?i:Hn(fe)?s:ml(J)?{[J]:fe}:fe},ge,fe),U=J=>L_($e(a.mount?i:s,J,e.shouldUnregister?$e(s,J,[]):[])),Y=(J,fe,ge={})=>{const Pe=$e(r,J);let Oe=fe;if(Pe){const xe=Pe._f;xe&&(!xe.disabled&&Qt(i,J,LK(fe,xe)),Oe=wC(xe.ref)&&Ys(fe)?"":fe,NK(xe.ref)?[...xe.ref.options].forEach(Te=>Te.selected=Oe.includes(Te.value)):xe.refs?M_(xe.ref)?xe.refs.length>1?xe.refs.forEach(Te=>(!Te.defaultChecked||!Te.disabled)&&(Te.checked=Array.isArray(Oe)?!!Oe.find(Ye=>Ye===Te.value):Oe===Te.value)):xe.refs[0]&&(xe.refs[0].checked=!!Oe):xe.refs.forEach(Te=>Te.checked=Te.value===Oe):ZI(xe.ref)?xe.ref.value="":(xe.ref.value=Oe,xe.ref.type||d.state.next({name:J,values:tr(i)})))}(ge.shouldDirty||ge.shouldTouch)&&R(J,Oe,ge.shouldTouch,ge.shouldDirty,!0),ge.shouldValidate&&X(J)},V=(J,fe,ge)=>{for(const Pe in fe){const Oe=fe[Pe],xe=`${J}.${Pe}`,Te=$e(r,xe);(o.array.has(J)||xr(Oe)||Te&&!Te._f)&&!Ef(Oe)?V(xe,Oe,ge):Y(xe,Oe,ge)}},H=(J,fe,ge={})=>{const Pe=$e(r,J),Oe=o.array.has(J),xe=tr(fe);Qt(i,J,xe),Oe?(d.array.next({name:J,values:tr(i)}),(f.isDirty||f.dirtyFields||l.isDirty||l.dirtyFields)&&ge.shouldDirty&&d.state.next({name:J,dirtyFields:ky(s,i),isDirty:I(J,xe)})):Pe&&!Pe._f&&!Ys(xe)?V(J,xe,ge):Y(J,xe,ge),uD(J,o)&&d.state.next({...n}),d.state.next({name:a.mount?J:void 0,values:tr(i)})},ee=async J=>{a.mount=!0;const fe=J.target;let ge=fe.name,Pe=!0;const Oe=$e(r,ge),xe=Te=>{Pe=Number.isNaN(Te)||Ef(Te)&&isNaN(Te.getTime())||Ou(Te,$e(i,ge,Te))};if(Oe){let Te,Ye;const Rt=fe.type?Az(Oe._f):EK(J),bt=J.type===bC.BLUR||J.type===bC.FOCUS_OUT,$s=!AAe(Oe._f)&&!e.resolver&&!$e(n.errors,ge)&&!Oe._f.deps||TAe(bt,$e(n.touchedFields,ge),n.isSubmitted,p,m),Qn=uD(ge,o,bt);Qt(i,ge,Rt),bt?(Oe._f.onBlur&&Oe._f.onBlur(J),c&&c(0)):Oe._f.onChange&&Oe._f.onChange(J);const ys=R(ge,Rt,bt),Ut=!ks(ys)||Qn;if(!bt&&d.state.next({name:ge,type:J.type,values:tr(i)}),$s)return(f.isValid||l.isValid)&&(e.mode==="onBlur"?bt&&g():bt||g()),Ut&&d.state.next({name:ge,...Qn?{}:ys});if(!bt&&Qn&&d.state.next({...n}),e.resolver){const{errors:on}=await k([ge]);if(xe(Rt),Pe){const vn=Pz(n.errors,r,ge),Ue=Pz(on,r,vn.name||ge);Te=Ue.error,ge=Ue.name,Ye=ks(on)}}else v([ge],!0),Te=(await dD(Oe,o.disabled,i,h,e.shouldUseNativeValidation))[ge],v([ge]),xe(Rt),Pe&&(Te?Ye=!1:(f.isValid||l.isValid)&&(Ye=await O(r,!0)));Pe&&(Oe._f.deps&&X(Oe._f.deps),E(ge,Ye,Te,ys))}},re=(J,fe)=>{if($e(n.errors,fe)&&J.focus)return J.focus(),1},X=async(J,fe={})=>{let ge,Pe;const Oe=xi(J);if(e.resolver){const xe=await N(Hn(J)?J:Oe);ge=ks(xe),Pe=J?!Oe.some(Te=>$e(xe,Te)):ge}else J?(Pe=(await Promise.all(Oe.map(async xe=>{const Te=$e(r,xe);return await O(Te&&Te._f?{[xe]:Te}:Te)}))).every(Boolean),!(!Pe&&!n.isValid)&&g()):Pe=ge=await O(r);return d.state.next({...!ml(J)||(f.isValid||l.isValid)&&ge!==n.isValid?{}:{name:J},...e.resolver||!J?{isValid:ge}:{},errors:n.errors}),fe.shouldFocus&&!Pe&&Wm(r,re,J?Oe:o.mount),Pe},q=J=>{const fe={...a.mount?i:s};return Hn(J)?fe:ml(J)?$e(fe,J):J.map(ge=>$e(fe,ge))},K=(J,fe)=>({invalid:!!$e((fe||n).errors,J),isDirty:!!$e((fe||n).dirtyFields,J),error:$e((fe||n).errors,J),isValidating:!!$e(n.validatingFields,J),isTouched:!!$e((fe||n).touchedFields,J)}),Z=J=>{J&&xi(J).forEach(fe=>Ar(n.errors,fe)),d.state.next({errors:J?n.errors:{}})},ue=(J,fe,ge)=>{const Pe=($e(r,J,{_f:{}})._f||{}).ref,Oe=$e(n.errors,J)||{},{ref:xe,message:Te,type:Ye,...Rt}=Oe;Qt(n.errors,J,{...Rt,...fe,ref:Pe}),d.state.next({name:J,errors:n.errors,isValid:!1}),ge&&ge.shouldFocus&&Pe&&Pe.focus&&Pe.focus()},de=(J,fe)=>_a(J)?d.state.subscribe({next:ge=>J(F(void 0,fe),ge)}):F(J,fe,!0),ie=J=>d.state.subscribe({next:fe=>{PAe(J.name,fe.name,J.exact)&&RAe(fe,J.formState||f,Yt,J.reRenderRoot)&&J.callback({values:{...i},...n,...fe})}}).unsubscribe,be=J=>(a.mount=!0,l={...l,...J.formState},ie({...J,formState:l})),Ae=(J,fe={})=>{for(const ge of J?xi(J):o.mount)o.mount.delete(ge),o.array.delete(ge),fe.keepValue||(Ar(r,ge),Ar(i,ge)),!fe.keepError&&Ar(n.errors,ge),!fe.keepDirty&&Ar(n.dirtyFields,ge),!fe.keepTouched&&Ar(n.touchedFields,ge),!fe.keepIsValidating&&Ar(n.validatingFields,ge),!e.shouldUnregister&&!fe.keepDefaultValue&&Ar(s,ge);d.state.next({values:tr(i)}),d.state.next({...n,...fe.keepDirty?{isDirty:I()}:{}}),!fe.keepIsValid&&g()},_e=({disabled:J,name:fe})=>{(to(J)&&a.mount||J||o.disabled.has(fe))&&(J?o.disabled.add(fe):o.disabled.delete(fe))},Me=(J,fe={})=>{let ge=$e(r,J);const Pe=to(fe.disabled)||to(e.disabled);return Qt(r,J,{...ge||{},_f:{...ge&&ge._f?ge._f:{ref:{name:J}},name:J,mount:!0,...fe}}),o.mount.add(J),ge?_e({disabled:to(fe.disabled)?fe.disabled:e.disabled,name:J}):T(J,!0,fe.value),{...Pe?{disabled:fe.disabled||e.disabled}:{},...e.progressive?{required:!!fe.required,min:Ny(fe.min),max:Ny(fe.max),minLength:Ny(fe.minLength),maxLength:Ny(fe.maxLength),pattern:Ny(fe.pattern)}:{},name:J,onChange:ee,onBlur:ee,ref:Oe=>{if(Oe){Me(J,fe),ge=$e(r,J);const xe=Hn(Oe.value)&&Oe.querySelectorAll&&Oe.querySelectorAll("input,select,textarea")[0]||Oe,Te=_Ae(xe),Ye=ge._f.refs||[];if(Te?Ye.find(Rt=>Rt===xe):xe===ge._f.ref)return;Qt(r,J,{_f:{...ge._f,...Te?{refs:[...Ye.filter(FT),xe,...Array.isArray($e(s,J))?[{}]:[]],ref:{type:xe.type,name:J}}:{ref:xe}}}),T(J,!1,void 0,xe)}else ge=$e(r,J,{}),ge._f&&(ge._f.mount=!1),(e.shouldUnregister||fe.shouldUnregister)&&!(CK(o.array,J)&&a.action)&&o.unMount.add(J)}}},De=()=>e.shouldFocusError&&Wm(r,re,o.mount),ye=J=>{to(J)&&(d.state.next({disabled:J}),Wm(r,(fe,ge)=>{const Pe=$e(r,ge);Pe&&(fe.disabled=Pe._f.disabled||J,Array.isArray(Pe._f.refs)&&Pe._f.refs.forEach(Oe=>{Oe.disabled=Pe._f.disabled||J}))},0,!1))},Fe=(J,fe)=>async ge=>{let Pe;ge&&(ge.preventDefault&&ge.preventDefault(),ge.persist&&ge.persist());let Oe=tr(i);if(d.state.next({isSubmitting:!0}),e.resolver){const{errors:xe,values:Te}=await k();n.errors=xe,Oe=Te}else await O(r);if(o.disabled.size)for(const xe of o.disabled)Qt(Oe,xe,void 0);if(Ar(n.errors,"root"),ks(n.errors)){d.state.next({errors:{}});try{await J(Oe,ge)}catch(xe){Pe=xe}}else fe&&await fe({...n.errors},ge),De(),setTimeout(De);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ks(n.errors)&&!Pe,submitCount:n.submitCount+1,errors:n.errors}),Pe)throw Pe},ut=(J,fe={})=>{$e(r,J)&&(Hn(fe.defaultValue)?H(J,tr($e(s,J))):(H(J,fe.defaultValue),Qt(s,J,tr(fe.defaultValue))),fe.keepTouched||Ar(n.touchedFields,J),fe.keepDirty||(Ar(n.dirtyFields,J),n.isDirty=fe.defaultValue?I(J,tr($e(s,J))):I()),fe.keepError||(Ar(n.errors,J),f.isValid&&g()),d.state.next({...n}))},Qe=(J,fe={})=>{const ge=J?tr(J):s,Pe=tr(ge),Oe=ks(J),xe=Oe?s:Pe;if(fe.keepDefaultValues||(s=ge),!fe.keepValues){if(fe.keepDirtyValues){const Te=new Set([...o.mount,...Object.keys(ky(s,i))]);for(const Ye of Array.from(Te))$e(n.dirtyFields,Ye)?Qt(xe,Ye,$e(i,Ye)):H(Ye,$e(xe,Ye))}else{if(XI&&Hn(J))for(const Te of o.mount){const Ye=$e(r,Te);if(Ye&&Ye._f){const Rt=Array.isArray(Ye._f.refs)?Ye._f.refs[0]:Ye._f.ref;if(wC(Rt)){const bt=Rt.closest("form");if(bt){bt.reset();break}}}}for(const Te of o.mount)H(Te,$e(xe,Te))}i=tr(xe),d.array.next({values:{...xe}}),d.state.next({values:{...xe}})}o={mount:fe.keepDirtyValues?o.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!f.isValid||!!fe.keepIsValid||!!fe.keepDirtyValues,a.watch=!!e.shouldUnregister,d.state.next({submitCount:fe.keepSubmitCount?n.submitCount:0,isDirty:Oe?!1:fe.keepDirty?n.isDirty:!!(fe.keepDefaultValues&&!Ou(J,s)),isSubmitted:fe.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Oe?{}:fe.keepDirtyValues?fe.keepDefaultValues&&i?ky(s,i):n.dirtyFields:fe.keepDefaultValues&&J?ky(s,J):fe.keepDirty?n.dirtyFields:{},touchedFields:fe.keepTouched?n.touchedFields:{},errors:fe.keepErrors?n.errors:{},isSubmitSuccessful:fe.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},vt=(J,fe)=>Qe(_a(J)?J(i):J,fe),An=(J,fe={})=>{const ge=$e(r,J),Pe=ge&&ge._f;if(Pe){const Oe=Pe.refs?Pe.refs[0]:Pe.ref;Oe.focus&&(Oe.focus(),fe.shouldSelect&&_a(Oe.select)&&Oe.select())}},Yt=J=>{n={...n,...J}},Xt={control:{register:Me,unregister:Ae,getFieldState:K,handleSubmit:Fe,setError:ue,_subscribe:ie,_runSchema:k,_getWatch:F,_getDirty:I,_setValid:g,_setFieldArray:w,_setDisabledField:_e,_setErrors:A,_getFieldArray:U,_reset:Qe,_resetDefaultValues:()=>_a(e.defaultValues)&&e.defaultValues().then(J=>{vt(J,e.resetOptions),d.state.next({isLoading:!1})}),_removeUnmounted:L,_disableForm:ye,_subjects:d,_proxyFormState:f,get _fields(){return r},get _formValues(){return i},get _state(){return a},set _state(J){a=J},get _defaultValues(){return s},get _names(){return o},set _names(J){o=J},get _formState(){return n},get _options(){return e},set _options(J){e={...e,...J}}},subscribe:be,trigger:X,register:Me,handleSubmit:Fe,watch:de,setValue:H,getValues:q,reset:vt,resetField:ut,clearErrors:Z,unregister:Ae,setError:ue,setFocus:An,getFieldState:K};return{...Xt,formControl:Xt}}var yu=()=>{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)})},jT=(t,e,n={})=>n.shouldFocus||Hn(n.shouldFocus)?n.focusName||`${t}.${Hn(n.focusIndex)?e:n.focusIndex}.`:"",BT=(t,e)=>[...t,...xi(e)],zT=t=>Array.isArray(t)?t.map(()=>{}):void 0;function UT(t,e,n){return[...t.slice(0,e),...xi(n),...t.slice(e)]}var HT=(t,e,n)=>Array.isArray(t)?(Hn(t[n])&&(t[n]=void 0),t.splice(n,0,t.splice(e,1)[0]),t):[],VT=(t,e)=>[...xi(e),...xi(t)];function OAe(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 WT=(t,e)=>Hn(e)?[]:OAe(t,xi(e).sort((n,r)=>n-r)),GT=(t,e,n)=>{[t[e],t[n]]=[t[n],t[e]]},kz=(t,e,n)=>(t[e]=n,t);function yUe(t){const e=Ia(),{control:n=e.control,name:r,keyName:s="id",shouldUnregister:i,rules:a}=t,[o,c]=se.useState(n._getFieldArray(r)),u=se.useRef(n._getFieldArray(r).map(yu)),f=se.useRef(o),l=se.useRef(r),d=se.useRef(!1);l.current=r,f.current=o,n._names.array.add(r),a&&n.register(r,a),se.useEffect(()=>n._subjects.array.subscribe({next:({values:T,name:R})=>{if(R===l.current||!R){const E=$e(T,l.current);Array.isArray(E)&&(c(E),u.current=E.map(yu))}}}).unsubscribe,[n]);const m=se.useCallback(T=>{d.current=!0,n._setFieldArray(r,T)},[n,r]),p=(T,R)=>{const E=xi(tr(T)),k=BT(n._getFieldArray(r),E);n._names.focus=jT(r,k.length-1,R),u.current=BT(u.current,E.map(yu)),m(k),c(k),n._setFieldArray(r,k,BT,{argA:zT(T)})},h=(T,R)=>{const E=xi(tr(T)),k=VT(n._getFieldArray(r),E);n._names.focus=jT(r,0,R),u.current=VT(u.current,E.map(yu)),m(k),c(k),n._setFieldArray(r,k,VT,{argA:zT(T)})},y=T=>{const R=WT(n._getFieldArray(r),T);u.current=WT(u.current,T),m(R),c(R),!Array.isArray($e(n._fields,r))&&Qt(n._fields,r,void 0),n._setFieldArray(r,R,WT,{argA:T})},g=(T,R,E)=>{const k=xi(tr(R)),N=UT(n._getFieldArray(r),T,k);n._names.focus=jT(r,T,E),u.current=UT(u.current,T,k.map(yu)),m(N),c(N),n._setFieldArray(r,N,UT,{argA:T,argB:zT(R)})},v=(T,R)=>{const E=n._getFieldArray(r);GT(E,T,R),GT(u.current,T,R),m(E),c(E),n._setFieldArray(r,E,GT,{argA:T,argB:R},!1)},w=(T,R)=>{const E=n._getFieldArray(r);HT(E,T,R),HT(u.current,T,R),m(E),c(E),n._setFieldArray(r,E,HT,{argA:T,argB:R},!1)},x=(T,R)=>{const E=tr(R),k=kz(n._getFieldArray(r),T,E);u.current=[...k].map((N,O)=>!N||O===T?yu():u.current[O]),m(k),c([...k]),n._setFieldArray(r,k,kz,{argA:T,argB:E},!0,!1)},A=T=>{const R=xi(tr(T));u.current=R.map(yu),m([...R]),c([...R]),n._setFieldArray(r,[...R],E=>E,{},!0,!1)};return se.useEffect(()=>{if(n._state.action=!1,uD(r,n._names)&&n._subjects.state.next({...n._formState}),d.current&&(!Rm(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!Rm(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([r]).then(T=>{const R=$e(T.errors,r),E=$e(n._formState.errors,r);(E?!R&&E.type||R&&(E.type!==R.type||E.message!==R.message):R&&R.type)&&(R?Qt(n._formState.errors,r,R):Ar(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const T=$e(n._fields,r);T&&T._f&&!(Rm(n._options.reValidateMode).isOnSubmit&&Rm(n._options.mode).isOnSubmit)&&dD(T,n._names.disabled,n._formValues,n._options.criteriaMode===Lo.all,n._options.shouldUseNativeValidation,!0).then(R=>!ks(R)&&n._subjects.state.next({errors:$K(n._formState.errors,R,r)}))}n._subjects.state.next({name:r,values:tr(n._formValues)}),n._names.focus&&Wm(n._fields,(T,R)=>{if(n._names.focus&&R.startsWith(n._names.focus)&&T.focus)return T.focus(),1}),n._names.focus="",n._setValid(),d.current=!1},[o,r,n]),se.useEffect(()=>(!$e(n._formValues,r)&&n._setFieldArray(r),()=>{const T=(R,E)=>{const k=$e(n._fields,R);k&&k._f&&(k._f.mount=E)};n._options.shouldUnregister||i?n.unregister(r):T(r,!1)}),[r,n,s,i]),{swap:se.useCallback(v,[m,r,n]),move:se.useCallback(w,[m,r,n]),prepend:se.useCallback(h,[m,r,n]),append:se.useCallback(p,[m,r,n]),remove:se.useCallback(y,[m,r,n]),insert:se.useCallback(g,[m,r,n]),update:se.useCallback(x,[m,r,n]),replace:se.useCallback(A,[m,r,n]),fields:se.useMemo(()=>o.map((T,R)=>({...T,[s]:u.current[R]||yu()})),[o,s])}}function MAe(t={}){const e=se.useRef(void 0),n=se.useRef(void 0),[r,s]=se.useState({isDirty:!1,isValidating:!1,isLoading:_a(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,defaultValues:_a(t.defaultValues)?void 0:t.defaultValues});e.current||(e.current={...t.formControl?t.formControl:DAe(t),formState:r},t.formControl&&t.defaultValues&&!_a(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions));const i=e.current.control;return i._options=t,se.useLayoutEffect(()=>i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState}),reRenderRoot:!0}),[i]),se.useEffect(()=>i._disableForm(t.disabled),[i,t.disabled]),se.useEffect(()=>{if(i._proxyFormState.isDirty){const a=i._getDirty();a!==r.isDirty&&i._subjects.state.next({isDirty:a})}},[i,r.isDirty]),se.useEffect(()=>{t.values&&!Ou(t.values,n.current)?(i._reset(t.values,i._options.resetOptions),n.current=t.values,s(a=>({...a}))):i._resetDefaultValues()},[t.values,i]),se.useEffect(()=>{t.errors&&!ks(t.errors)&&i._setErrors(t.errors)},[t.errors,i]),se.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),se.useEffect(()=>{t.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[t.shouldUnregister,i]),e.current.formState=PK(r,i),e.current}var LAe="Label",FK=_.forwardRef((t,e)=>P.jsx(Ne.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())}}));FK.displayName=LAe;var jK=FK;const IAe=ri("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),BK=_.forwardRef(({className:t,...e},n)=>P.jsx(jK,{ref:n,className:le(IAe(),t),...e}));BK.displayName=jK.displayName;const $Ae=gAe,zK=_.createContext({}),Fv=({...t})=>P.jsx(zK.Provider,{value:{name:t.name},children:P.jsx(wAe,{...t})}),jv=()=>{const t=_.useContext(zK),e=_.useContext(UK),{getFieldState:n,formState:r}=Ia(),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}},UK=_.createContext({}),yp=_.forwardRef(({className:t,...e},n)=>{const r=_.useId();return P.jsx(UK.Provider,{value:{id:r},children:P.jsx("div",{ref:n,className:le("space-y-2",t),...e})})});yp.displayName="FormItem";const HK=_.forwardRef(({className:t,...e},n)=>{const{error:r,formItemId:s}=jv();return P.jsx(BK,{ref:n,className:le(r&&"text-destructive",t),htmlFor:s,...e})});HK.displayName="FormLabel";const bp=_.forwardRef(({...t},e)=>{const{error:n,formItemId:r,formDescriptionId:s,formMessageId:i}=jv();return P.jsx(Aa,{ref:e,id:r,"aria-describedby":n?`${s} ${i}`:`${s}`,"aria-invalid":!!n,...t})});bp.displayName="FormControl";const wp=_.forwardRef(({className:t,...e},n)=>{const{formDescriptionId:r}=jv();return P.jsx("p",{ref:n,id:r,className:le("text-[0.8rem] text-muted-foreground",t),...e})});wp.displayName="FormDescription";const VK=_.forwardRef(({className:t,children:e,...n},r)=>{const{error:s,formMessageId:i}=jv(),a=s?String((s==null?void 0:s.message)??""):e;return a?P.jsx("p",{ref:r,id:i,className:le("text-[0.8rem] font-medium text-destructive",t),...n,children:a}):null});VK.displayName="FormMessage";var qT,WK="HoverCard",[GK,bUe]=Nn(WK,[Rl]),e$=Rl(),[wUe,t$]=GK(WK),qK="HoverCardTrigger",FAe=_.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,s=t$(qK,n),i=e$(n);return P.jsx($v,{asChild:!0,...i,children:P.jsx(Ne.a,{"data-state":s.open?"open":"closed",...r,ref:e,onPointerEnter:me(t.onPointerEnter,EC(s.onOpen)),onPointerLeave:me(t.onPointerLeave,EC(s.onClose)),onFocus:me(t.onFocus,s.onOpen),onBlur:me(t.onBlur,s.onClose),onTouchStart:me(t.onTouchStart,a=>a.preventDefault())})})});FAe.displayName=qK;var jAe="HoverCardPortal",[_Ue,BAe]=GK(jAe,{forceMount:void 0}),SC="HoverCardContent",KK=_.forwardRef((t,e)=>{const n=BAe(SC,t.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=t,i=t$(SC,t.__scopeHoverCard);return P.jsx(Wn,{present:r||i.open,children:P.jsx(zAe,{"data-state":i.open?"open":"closed",...s,onPointerEnter:me(t.onPointerEnter,EC(i.onOpen)),onPointerLeave:me(t.onPointerLeave,EC(i.onClose)),ref:e})})});KK.displayName=SC;var zAe=_.forwardRef((t,e)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,...o}=t,c=t$(SC,n),u=e$(n),f=_.useRef(null),l=tt(e,f),[d,m]=_.useState(!1);return _.useEffect(()=>{if(d){const p=document.body;return qT=p.style.userSelect||p.style.webkitUserSelect,p.style.userSelect="none",p.style.webkitUserSelect="none",()=>{p.style.userSelect=qT,p.style.webkitUserSelect=qT}}},[d]),_.useEffect(()=>{if(f.current){const p=()=>{m(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var y;((y=document.getSelection())==null?void 0:y.toString())!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",p),()=>{document.removeEventListener("pointerup",p),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),_.useEffect(()=>{f.current&&VAe(f.current).forEach(h=>h.setAttribute("tabindex","-1"))}),P.jsx(Jc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:a,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:me(i,p=>{p.preventDefault()}),onDismiss:c.onDismiss,children:P.jsx(A_,{...u,...o,onPointerDown:me(o.onPointerDown,p=>{p.currentTarget.contains(p.target)&&m(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:l,style:{...o.style,userSelect:d?"text":void 0,WebkitUserSelect:d?"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)"}})})}),UAe="HoverCardArrow",HAe=_.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,s=e$(n);return P.jsx(R_,{...s,...r,ref:e})});HAe.displayName=UAe;function EC(t){return e=>e.pointerType==="touch"?void 0:t()}function VAe(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 YK=KK;const WAe=_.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},s)=>P.jsx(YK,{ref:s,align:e,sideOffset:n,className:le("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}));WAe.displayName=YK.displayName;const XK=_.forwardRef(({className:t,type:e,...n},r)=>P.jsx("input",{type:e,className:le("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}));XK.displayName="Input";var SA="Menubar",[fD,GAe,qAe]=Qc(SA),[QK,xUe]=Nn(SA,[qAe,Pl]),Oi=N_(),ZK=Pl(),[KAe,JK]=QK(SA),e7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,value:r,onValueChange:s,defaultValue:i,loop:a=!0,dir:o,...c}=t,u=Da(o),f=ZK(n),[l="",d]=lr({prop:r,onChange:s,defaultProp:i}),[m,p]=_.useState(null);return P.jsx(KAe,{scope:n,value:l,onMenuOpen:_.useCallback(h=>{d(h),p(h)},[d]),onMenuClose:_.useCallback(()=>d(""),[d]),onMenuToggle:_.useCallback(h=>{d(y=>y?"":h),p(h)},[d]),dir:u,loop:a,children:P.jsx(fD.Provider,{scope:n,children:P.jsx(fD.Slot,{scope:n,children:P.jsx(P_,{asChild:!0,...f,orientation:"horizontal",loop:a,dir:u,currentTabStopId:m,onCurrentTabStopIdChange:p,children:P.jsx(Ne.div,{role:"menubar",...c,ref:e})})})})})});e7.displayName=SA;var YAe="MenubarMenu",[SUe,t7]=QK(YAe),hD="MenubarTrigger",n7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,disabled:r=!1,...s}=t,i=ZK(n),a=Oi(n),o=JK(hD,n),c=t7(hD,n),u=_.useRef(null),f=tt(e,u,c.triggerRef),[l,d]=_.useState(!1),m=o.value===c.value;return P.jsx(fD.ItemSlot,{scope:n,value:c.value,disabled:r,children:P.jsx(T_,{asChild:!0,...i,focusable:!r,tabStopId:c.value,children:P.jsx(TI,{asChild:!0,...a,children:P.jsx(Ne.button,{type:"button",role:"menuitem",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":m,"aria-controls":m?c.contentId:void 0,"data-highlighted":l?"":void 0,"data-state":m?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:f,onPointerDown:me(t.onPointerDown,p=>{!r&&p.button===0&&p.ctrlKey===!1&&(o.onMenuOpen(c.value),m||p.preventDefault())}),onPointerEnter:me(t.onPointerEnter,()=>{var h;!!o.value&&!m&&(o.onMenuOpen(c.value),(h=u.current)==null||h.focus())}),onKeyDown:me(t.onKeyDown,p=>{r||(["Enter"," "].includes(p.key)&&o.onMenuToggle(c.value),p.key==="ArrowDown"&&o.onMenuOpen(c.value),["Enter"," ","ArrowDown"].includes(p.key)&&(c.wasKeyboardTriggerOpenRef.current=!0,p.preventDefault()))}),onFocus:me(t.onFocus,()=>d(!0)),onBlur:me(t.onBlur,()=>d(!1))})})})})});n7.displayName=hD;var XAe="MenubarPortal",r7=t=>{const{__scopeMenubar:e,...n}=t,r=Oi(e);return P.jsx(kI,{...r,...n})};r7.displayName=XAe;var pD="MenubarContent",s7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,align:r="start",...s}=t,i=Oi(n),a=JK(pD,n),o=t7(pD,n),c=GAe(n),u=_.useRef(!1);return P.jsx(NI,{id:o.contentId,"aria-labelledby":o.triggerId,"data-radix-menubar-content":"",...i,...s,ref:e,align:r,onCloseAutoFocus:me(t.onCloseAutoFocus,f=>{var d;!!!a.value&&!u.current&&((d=o.triggerRef.current)==null||d.focus()),u.current=!1,f.preventDefault()}),onFocusOutside:me(t.onFocusOutside,f=>{const l=f.target;c().some(m=>{var p;return(p=m.ref.current)==null?void 0:p.contains(l)})&&f.preventDefault()}),onInteractOutside:me(t.onInteractOutside,()=>{u.current=!0}),onEntryFocus:f=>{o.wasKeyboardTriggerOpenRef.current||f.preventDefault()},onKeyDown:me(t.onKeyDown,f=>{if(["ArrowRight","ArrowLeft"].includes(f.key)){const l=f.target,d=l.hasAttribute("data-radix-menubar-subtrigger"),m=l.closest("[data-radix-menubar-content]")!==f.currentTarget,h=(a.dir==="rtl"?"ArrowRight":"ArrowLeft")===f.key;if(!h&&d||m&&h)return;let v=c().filter(A=>!A.disabled).map(A=>A.value);h&&v.reverse();const w=v.indexOf(o.value);v=a.loop?dRe(v,w+1):v.slice(w+1);const[x]=v;x&&a.onMenuOpen(x)}},{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)"}})});s7.displayName=pD;var QAe="MenubarGroup",ZAe=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Oi(n);return P.jsx(DI,{...s,...r,ref:e})});ZAe.displayName=QAe;var JAe="MenubarLabel",i7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Oi(n);return P.jsx(OI,{...s,...r,ref:e})});i7.displayName=JAe;var eRe="MenubarItem",o7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Oi(n);return P.jsx(MI,{...s,...r,ref:e})});o7.displayName=eRe;var tRe="MenubarCheckboxItem",a7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Oi(n);return P.jsx(LI,{...s,...r,ref:e})});a7.displayName=tRe;var nRe="MenubarRadioGroup",rRe=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Oi(n);return P.jsx(II,{...s,...r,ref:e})});rRe.displayName=nRe;var sRe="MenubarRadioItem",l7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Oi(n);return P.jsx($I,{...s,...r,ref:e})});l7.displayName=sRe;var iRe="MenubarItemIndicator",c7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Oi(n);return P.jsx(FI,{...s,...r,ref:e})});c7.displayName=iRe;var oRe="MenubarSeparator",u7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Oi(n);return P.jsx(jI,{...s,...r,ref:e})});u7.displayName=oRe;var aRe="MenubarArrow",lRe=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Oi(n);return P.jsx(BI,{...s,...r,ref:e})});lRe.displayName=aRe;var cRe="MenubarSubTrigger",d7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Oi(n);return P.jsx(zI,{"data-radix-menubar-subtrigger":"",...s,...r,ref:e})});d7.displayName=cRe;var uRe="MenubarSubContent",f7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Oi(n);return P.jsx(UI,{...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)"}})});f7.displayName=uRe;function dRe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var h7=e7,p7=n7,fRe=r7,m7=s7,g7=i7,v7=o7,y7=a7,b7=l7,w7=c7,_7=u7,x7=d7,S7=f7;const hRe=_.forwardRef(({className:t,...e},n)=>P.jsx(h7,{ref:n,className:le("flex h-10 items-center space-x-1 rounded-md border bg-background p-1",t),...e}));hRe.displayName=h7.displayName;const pRe=_.forwardRef(({className:t,...e},n)=>P.jsx(p7,{ref:n,className:le("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}));pRe.displayName=p7.displayName;const mRe=_.forwardRef(({className:t,inset:e,children:n,...r},s)=>P.jsxs(x7,{ref:s,className:le("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,P.jsx(d_,{className:"ml-auto h-4 w-4"})]}));mRe.displayName=x7.displayName;const gRe=_.forwardRef(({className:t,...e},n)=>P.jsx(S7,{ref:n,className:le("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}));gRe.displayName=S7.displayName;const vRe=_.forwardRef(({className:t,align:e="start",alignOffset:n=-4,sideOffset:r=8,...s},i)=>P.jsx(fRe,{children:P.jsx(m7,{ref:i,align:e,alignOffset:n,sideOffset:r,className:le("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})}));vRe.displayName=m7.displayName;const yRe=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(v7,{ref:r,className:le("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}));yRe.displayName=v7.displayName;const bRe=_.forwardRef(({className:t,children:e,checked:n,...r},s)=>P.jsxs(y7,{ref:s,className:le("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:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(w7,{children:P.jsx(u_,{className:"h-4 w-4"})})}),e]}));bRe.displayName=y7.displayName;const wRe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(b7,{ref:r,className:le("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:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(w7,{children:P.jsx(G1,{className:"h-2 w-2 fill-current"})})}),e]}));wRe.displayName=b7.displayName;const _Re=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(g7,{ref:r,className:le("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));_Re.displayName=g7.displayName;const xRe=_.forwardRef(({className:t,...e},n)=>P.jsx(_7,{ref:n,className:le("-mx-1 my-1 h-px bg-muted",t),...e}));xRe.displayName=_7.displayName;var SRe="VisuallyHidden",I_=_.forwardRef((t,e)=>P.jsx(Ne.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}}));I_.displayName=SRe;var E7=I_,Bv="NavigationMenu",[n$,C7,ERe]=Qc(Bv),[mD,CRe,ARe]=Qc(Bv),[r$,EUe]=Nn(Bv,[ERe,ARe]),[RRe,Wo]=r$(Bv),[PRe,TRe]=r$(Bv),A7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:s,defaultValue:i,delayDuration:a=200,skipDelayDuration:o=300,orientation:c="horizontal",dir:u,...f}=t,[l,d]=_.useState(null),m=tt(e,k=>d(k)),p=Da(u),h=_.useRef(0),y=_.useRef(0),g=_.useRef(0),[v,w]=_.useState(!0),[x="",A]=lr({prop:r,onChange:k=>{const N=k!=="",O=o>0;N?(window.clearTimeout(g.current),O&&w(!1)):(window.clearTimeout(g.current),g.current=window.setTimeout(()=>w(!0),o)),s==null||s(k)},defaultProp:i}),T=_.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>A(""),150)},[A]),R=_.useCallback(k=>{window.clearTimeout(y.current),A(k)},[A]),E=_.useCallback(k=>{x===k?window.clearTimeout(y.current):h.current=window.setTimeout(()=>{window.clearTimeout(y.current),A(k)},a)},[x,A,a]);return _.useEffect(()=>()=>{window.clearTimeout(h.current),window.clearTimeout(y.current),window.clearTimeout(g.current)},[]),P.jsx(P7,{scope:n,isRootMenu:!0,value:x,dir:p,orientation:c,rootNavigationMenu:l,onTriggerEnter:k=>{window.clearTimeout(h.current),v?E(k):R(k)},onTriggerLeave:()=>{window.clearTimeout(h.current),T()},onContentEnter:()=>window.clearTimeout(y.current),onContentLeave:T,onItemSelect:k=>{A(N=>N===k?"":k)},onItemDismiss:()=>A(""),children:P.jsx(Ne.nav,{"aria-label":"Main","data-orientation":c,dir:p,...f,ref:m})})});A7.displayName=Bv;var R7="NavigationMenuSub",kRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:s,defaultValue:i,orientation:a="horizontal",...o}=t,c=Wo(R7,n),[u="",f]=lr({prop:r,onChange:s,defaultProp:i});return P.jsx(P7,{scope:n,isRootMenu:!1,value:u,dir:c.dir,orientation:a,rootNavigationMenu:c.rootNavigationMenu,onTriggerEnter:l=>f(l),onItemSelect:l=>f(l),onItemDismiss:()=>f(""),children:P.jsx(Ne.div,{"data-orientation":a,...o,ref:e})})});kRe.displayName=R7;var P7=t=>{const{scope:e,isRootMenu:n,rootNavigationMenu:r,dir:s,orientation:i,children:a,value:o,onItemSelect:c,onItemDismiss:u,onTriggerEnter:f,onTriggerLeave:l,onContentEnter:d,onContentLeave:m}=t,[p,h]=_.useState(null),[y,g]=_.useState(new Map),[v,w]=_.useState(null);return P.jsx(RRe,{scope:e,isRootMenu:n,rootNavigationMenu:r,value:o,previousValue:Mv(o),baseId:qr(),dir:s,orientation:i,viewport:p,onViewportChange:h,indicatorTrack:v,onIndicatorTrackChange:w,onTriggerEnter:zt(f),onTriggerLeave:zt(l),onContentEnter:zt(d),onContentLeave:zt(m),onItemSelect:zt(c),onItemDismiss:zt(u),onViewportContentChange:_.useCallback((x,A)=>{g(T=>(T.set(x,A),new Map(T)))},[]),onViewportContentRemove:_.useCallback(x=>{g(A=>A.has(x)?(A.delete(x),new Map(A)):A)},[]),children:P.jsx(n$.Provider,{scope:e,children:P.jsx(PRe,{scope:e,items:y,children:a})})})},T7="NavigationMenuList",k7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=Wo(T7,n),i=P.jsx(Ne.ul,{"data-orientation":s.orientation,...r,ref:e});return P.jsx(Ne.div,{style:{position:"relative"},ref:s.onIndicatorTrackChange,children:P.jsx(n$.Slot,{scope:n,children:s.isRootMenu?P.jsx(F7,{asChild:!0,children:i}):i})})});k7.displayName=T7;var N7="NavigationMenuItem",[NRe,D7]=r$(N7),DRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,...s}=t,i=qr(),a=r||i||"LEGACY_REACT_AUTO_VALUE",o=_.useRef(null),c=_.useRef(null),u=_.useRef(null),f=_.useRef(()=>{}),l=_.useRef(!1),d=_.useCallback((p="start")=>{if(o.current){f.current();const h=vD(o.current);h.length&&o$(p==="start"?h:h.reverse())}},[]),m=_.useCallback(()=>{if(o.current){const p=vD(o.current);p.length&&(f.current=BRe(p))}},[]);return P.jsx(NRe,{scope:n,value:a,triggerRef:c,contentRef:o,focusProxyRef:u,wasEscapeCloseRef:l,onEntryKeyDown:d,onFocusProxyEnter:d,onRootContentClose:m,onContentFocusOutside:m,children:P.jsx(Ne.li,{...s,ref:e})})});DRe.displayName=N7;var gD="NavigationMenuTrigger",O7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,disabled:r,...s}=t,i=Wo(gD,t.__scopeNavigationMenu),a=D7(gD,t.__scopeNavigationMenu),o=_.useRef(null),c=tt(o,a.triggerRef,e),u=B7(i.baseId,a.value),f=z7(i.baseId,a.value),l=_.useRef(!1),d=_.useRef(!1),m=a.value===i.value;return P.jsxs(P.Fragment,{children:[P.jsx(n$.ItemSlot,{scope:n,value:a.value,children:P.jsx(j7,{asChild:!0,children:P.jsx(Ne.button,{id:u,disabled:r,"data-disabled":r?"":void 0,"data-state":a$(m),"aria-expanded":m,"aria-controls":f,...s,ref:c,onPointerEnter:me(t.onPointerEnter,()=>{d.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:me(t.onPointerMove,CC(()=>{r||d.current||a.wasEscapeCloseRef.current||l.current||(i.onTriggerEnter(a.value),l.current=!0)})),onPointerLeave:me(t.onPointerLeave,CC(()=>{r||(i.onTriggerLeave(),l.current=!1)})),onClick:me(t.onClick,()=>{i.onItemSelect(a.value),d.current=m}),onKeyDown:me(t.onKeyDown,p=>{const y={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];m&&p.key===y&&(a.onEntryKeyDown(),p.preventDefault())})})})}),m&&P.jsxs(P.Fragment,{children:[P.jsx(E7,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:p=>{const h=a.contentRef.current,y=p.relatedTarget,g=y===o.current,v=h==null?void 0:h.contains(y);(g||!v)&&a.onFocusProxyEnter(g?"start":"end")}}),i.viewport&&P.jsx("span",{"aria-owns":f})]})]})});O7.displayName=gD;var ORe="NavigationMenuLink",Nz="navigationMenu.linkSelect",MRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,active:r,onSelect:s,...i}=t;return P.jsx(j7,{asChild:!0,children:P.jsx(Ne.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...i,ref:e,onClick:me(t.onClick,a=>{const o=a.target,c=new CustomEvent(Nz,{bubbles:!0,cancelable:!0});if(o.addEventListener(Nz,u=>s==null?void 0:s(u),{once:!0}),Jb(o,c),!c.defaultPrevented&&!a.metaKey){const u=new CustomEvent(QS,{bubbles:!0,cancelable:!0});Jb(o,u)}},{checkForDefaultPrevented:!1})})})});MRe.displayName=ORe;var s$="NavigationMenuIndicator",M7=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Wo(s$,t.__scopeNavigationMenu),i=!!s.value;return s.indicatorTrack?l_.createPortal(P.jsx(Wn,{present:n||i,children:P.jsx(LRe,{...r,ref:e})}),s.indicatorTrack):null});M7.displayName=s$;var LRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=Wo(s$,n),i=C7(n),[a,o]=_.useState(null),[c,u]=_.useState(null),f=s.orientation==="horizontal",l=!!s.value;_.useEffect(()=>{var h;const p=(h=i().find(y=>y.value===s.value))==null?void 0:h.ref.current;p&&o(p)},[i,s.value]);const d=()=>{a&&u({size:f?a.offsetWidth:a.offsetHeight,offset:f?a.offsetLeft:a.offsetTop})};return yD(a,d),yD(s.indicatorTrack,d),c?P.jsx(Ne.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}),mv="NavigationMenuContent",L7=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Wo(mv,t.__scopeNavigationMenu),i=D7(mv,t.__scopeNavigationMenu),a=tt(i.contentRef,e),o=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?P.jsx(IRe,{forceMount:n,...c,ref:a}):P.jsx(Wn,{present:n||o,children:P.jsx(I7,{"data-state":a$(o),...c,ref:a,onPointerEnter:me(t.onPointerEnter,s.onContentEnter),onPointerLeave:me(t.onPointerLeave,CC(s.onContentLeave)),style:{pointerEvents:!o&&s.isRootMenu?"none":void 0,...c.style}})})});L7.displayName=mv;var IRe=_.forwardRef((t,e)=>{const n=Wo(mv,t.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:s}=n;return $n(()=>{r(t.value,{ref:e,...t})},[t,e,r]),$n(()=>()=>s(t.value),[t.value,s]),null}),QS="navigationMenu.rootContentDismiss",I7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:s,focusProxyRef:i,wasEscapeCloseRef:a,onRootContentClose:o,onContentFocusOutside:c,...u}=t,f=Wo(mv,n),l=_.useRef(null),d=tt(l,e),m=B7(f.baseId,r),p=z7(f.baseId,r),h=C7(n),y=_.useRef(null),{onItemDismiss:g}=f;_.useEffect(()=>{const w=l.current;if(f.isRootMenu&&w){const x=()=>{var A;g(),o(),w.contains(document.activeElement)&&((A=s.current)==null||A.focus())};return w.addEventListener(QS,x),()=>w.removeEventListener(QS,x)}},[f.isRootMenu,t.value,s,g,o]);const v=_.useMemo(()=>{const x=h().map(N=>N.value);f.dir==="rtl"&&x.reverse();const A=x.indexOf(f.value),T=x.indexOf(f.previousValue),R=r===f.value,E=T===x.indexOf(r);if(!R&&!E)return y.current;const k=(()=>{if(A!==T){if(R&&T!==-1)return A>T?"from-end":"from-start";if(E&&A!==-1)return A>T?"to-start":"to-end"}return null})();return y.current=k,k},[f.previousValue,f.value,f.dir,h,r]);return P.jsx(F7,{asChild:!0,children:P.jsx(Jc,{id:p,"aria-labelledby":m,"data-motion":v,"data-orientation":f.orientation,...u,ref:d,disableOutsidePointerEvents:!1,onDismiss:()=>{var x;const w=new Event(QS,{bubbles:!0,cancelable:!0});(x=l.current)==null||x.dispatchEvent(w)},onFocusOutside:me(t.onFocusOutside,w=>{var A;c();const x=w.target;(A=f.rootNavigationMenu)!=null&&A.contains(x)&&w.preventDefault()}),onPointerDownOutside:me(t.onPointerDownOutside,w=>{var R;const x=w.target,A=h().some(E=>{var k;return(k=E.ref.current)==null?void 0:k.contains(x)}),T=f.isRootMenu&&((R=f.viewport)==null?void 0:R.contains(x));(A||T||!f.isRootMenu)&&w.preventDefault()}),onKeyDown:me(t.onKeyDown,w=>{var T;const x=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!x){const R=vD(w.currentTarget),E=document.activeElement,k=R.findIndex(L=>L===E),O=w.shiftKey?R.slice(0,k).reverse():R.slice(k+1,R.length);o$(O)?w.preventDefault():(T=i.current)==null||T.focus()}}),onEscapeKeyDown:me(t.onEscapeKeyDown,w=>{a.current=!0})})})}),i$="NavigationMenuViewport",$7=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=!!Wo(i$,t.__scopeNavigationMenu).value;return P.jsx(Wn,{present:n||i,children:P.jsx($Re,{...r,ref:e})})});$7.displayName=i$;var $Re=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,children:r,...s}=t,i=Wo(i$,n),a=tt(e,i.onViewportChange),o=TRe(mv,t.__scopeNavigationMenu),[c,u]=_.useState(null),[f,l]=_.useState(null),d=c?(c==null?void 0:c.width)+"px":void 0,m=c?(c==null?void 0:c.height)+"px":void 0,p=!!i.value,h=p?i.value:i.previousValue;return yD(f,()=>{f&&u({width:f.offsetWidth,height:f.offsetHeight})}),P.jsx(Ne.div,{"data-state":a$(p),"data-orientation":i.orientation,...s,ref:a,style:{pointerEvents:!p&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":d,"--radix-navigation-menu-viewport-height":m,...s.style},onPointerEnter:me(t.onPointerEnter,i.onContentEnter),onPointerLeave:me(t.onPointerLeave,CC(i.onContentLeave)),children:Array.from(o.items).map(([g,{ref:v,forceMount:w,...x}])=>{const A=h===g;return P.jsx(Wn,{present:w||A,children:P.jsx(I7,{...x,ref:c_(v,T=>{A&&T&&l(T)})})},g)})})}),FRe="FocusGroup",F7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=Wo(FRe,n);return P.jsx(mD.Provider,{scope:n,children:P.jsx(mD.Slot,{scope:n,children:P.jsx(Ne.div,{dir:s.dir,...r,ref:e})})})}),Dz=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],jRe="FocusGroupItem",j7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=CRe(n),i=Wo(jRe,n);return P.jsx(mD.ItemSlot,{scope:n,children:P.jsx(Ne.button,{...r,ref:e,onKeyDown:me(t.onKeyDown,a=>{if(["Home","End",...Dz].includes(a.key)){let c=s().map(l=>l.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&c.reverse(),Dz.includes(a.key)){const l=c.indexOf(a.currentTarget);c=c.slice(l+1)}setTimeout(()=>o$(c)),a.preventDefault()}})})})});function vD(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 o$(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}function BRe(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 yD(t,e){const n=zt(e);$n(()=>{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 a$(t){return t?"open":"closed"}function B7(t,e){return`${t}-trigger-${e}`}function z7(t,e){return`${t}-content-${e}`}function CC(t){return e=>e.pointerType==="mouse"?t(e):void 0}var U7=A7,H7=k7,V7=O7,W7=M7,G7=L7,q7=$7;const zRe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(U7,{ref:r,className:le("relative z-10 flex max-w-max flex-1 items-center justify-center",t),...n,children:[e,P.jsx(K7,{})]}));zRe.displayName=U7.displayName;const URe=_.forwardRef(({className:t,...e},n)=>P.jsx(H7,{ref:n,className:le("group flex flex-1 list-none items-center justify-center space-x-1",t),...e}));URe.displayName=H7.displayName;const HRe=ri("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"),VRe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(V7,{ref:r,className:le(HRe(),"group",t),...n,children:[e," ",P.jsx(W1,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));VRe.displayName=V7.displayName;const WRe=_.forwardRef(({className:t,...e},n)=>P.jsx(G7,{ref:n,className:le("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}));WRe.displayName=G7.displayName;const K7=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{className:le("absolute left-0 top-full flex justify-center"),children:P.jsx(q7,{className:le("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})}));K7.displayName=q7.displayName;const GRe=_.forwardRef(({className:t,...e},n)=>P.jsx(W7,{ref:n,className:le("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:P.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));GRe.displayName=W7.displayName;var qRe=typeof window>"u",bD=qRe?se.useEffect:se.useLayoutEffect,KRe=0,Oz=()=>++KRe,Mz=!1;function YRe(){let[t,e]=se.useState(Mz?Oz:void 0);return bD(()=>{t===void 0&&e(Oz()),Mz=!0},[]),t===void 0?t:`rwb-${t.toString(32)}`}function XRe(){return se.useMemo(()=>"useId"in se?se.useId:YRe,[])()}var wD="__wrap_b",Eb="__wrap_n",Lz="__wrap_o",Y7=(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,a=r.clientHeight,o=i/2-.25,c=i+.5,u;if(i){for(s(o),o=Math.max(n.scrollWidth,o);o+1{self.__wrap_b(0,+n.dataset.brr,n)})).observe(r)},QRe=Y7.toString(),ZRe='(self.CSS&&CSS.supports("text-wrap","balance")?1:2)',JRe=(t,e,n="")=>(n&&(n=`self.${Eb}!=1&&${n}`),se.createElement("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:(t?"":`self.${Eb}=self.${Eb}||${ZRe};self.${wD}=${QRe};`)+n},nonce:e})),ePe=se.createContext({preferNative:!0,hasProvider:!1});se.forwardRef(({ratio:t=1,preferNative:e,nonce:n,children:r,as:s,...i},a)=>{let o=XRe(),c=se.useRef(),u=se.useContext(ePe),f=e??u.preferNative,l=s||"span";return se.useImperativeHandle(a,()=>c.current,[]),bD(()=>{f&&self[Eb]===1||c.current&&(self[wD]=Y7)(0,t,c.current)},[r,f,t]),bD(()=>{if(!(f&&self[Eb]===1))return()=>{if(!c.current)return;let d=c.current[Lz];d&&(d.disconnect(),delete c.current[Lz])}},[f]),se.createElement(se.Fragment,null,se.createElement(l,{...i,"data-br":o,"data-brr":t,ref:c,style:{display:"inline-block",verticalAlign:"top",textDecoration:"inherit",textWrap:f?"balance":"initial"},suppressHydrationWarning:!0},r),JRe(u.hasProvider,n,`self.${wD}("${o}",${t})`))});var tPe="Separator",Iz="horizontal",nPe=["horizontal","vertical"],X7=_.forwardRef((t,e)=>{const{decorative:n,orientation:r=Iz,...s}=t,i=rPe(r)?r:Iz,o=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return P.jsx(Ne.div,{"data-orientation":i,...o,...s,ref:e})});X7.displayName=tPe;function rPe(t){return nPe.includes(t)}var Q7=X7;const sPe=_.forwardRef(({className:t,orientation:e="horizontal",decorative:n=!0,...r},s)=>P.jsx(Q7,{ref:s,decorative:n,orientation:e,className:le("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));sPe.displayName=Q7.displayName;const iPe=_.forwardRef(({className:t,...e},n)=>P.jsx("ul",{ref:n,className:le("flex flex-row items-center gap-1",t),...e}));iPe.displayName="PaginationContent";const oPe=_.forwardRef(({className:t,...e},n)=>P.jsx("li",{ref:n,className:le("",t),...e}));oPe.displayName="PaginationItem";var l$="Popover",[Z7,CUe]=Nn(l$,[Rl]),$_=Rl(),[aPe,jd]=Z7(l$),J7=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!1}=t,o=$_(e),c=_.useRef(null),[u,f]=_.useState(!1),[l=!1,d]=lr({prop:r,defaultProp:s,onChange:i});return P.jsx(vA,{...o,children:P.jsx(aPe,{scope:e,contentId:qr(),triggerRef:c,open:l,onOpenChange:d,onOpenToggle:_.useCallback(()=>d(m=>!m),[d]),hasCustomAnchor:u,onCustomAnchorAdd:_.useCallback(()=>f(!0),[]),onCustomAnchorRemove:_.useCallback(()=>f(!1),[]),modal:a,children:n})})};J7.displayName=l$;var e9="PopoverAnchor",lPe=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=jd(e9,n),i=$_(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:o}=s;return _.useEffect(()=>(a(),()=>o()),[a,o]),P.jsx($v,{...i,...r,ref:e})});lPe.displayName=e9;var t9="PopoverTrigger",n9=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=jd(t9,n),i=$_(n),a=tt(e,s.triggerRef),o=P.jsx(Ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":a9(s.open),...r,ref:a,onClick:me(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?o:P.jsx($v,{asChild:!0,...i,children:o})});n9.displayName=t9;var c$="PopoverPortal",[cPe,uPe]=Z7(c$,{forceMount:void 0}),r9=t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=jd(c$,e);return P.jsx(cPe,{scope:e,forceMount:n,children:P.jsx(Wn,{present:n||i.open,children:P.jsx(Pv,{asChild:!0,container:s,children:r})})})};r9.displayName=c$;var gv="PopoverContent",s9=_.forwardRef((t,e)=>{const n=uPe(gv,t.__scopePopover),{forceMount:r=n.forceMount,...s}=t,i=jd(gv,t.__scopePopover);return P.jsx(Wn,{present:r||i.open,children:i.modal?P.jsx(dPe,{...s,ref:e}):P.jsx(fPe,{...s,ref:e})})});s9.displayName=gv;var dPe=_.forwardRef((t,e)=>{const n=jd(gv,t.__scopePopover),r=_.useRef(null),s=tt(e,r),i=_.useRef(!1);return _.useEffect(()=>{const a=r.current;if(a)return Tv(a)},[]),P.jsx(h_,{as:Aa,allowPinchZoom:!0,children:P.jsx(i9,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:me(t.onCloseAutoFocus,a=>{var o;a.preventDefault(),i.current||(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:me(t.onPointerDownOutside,a=>{const o=a.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0,u=o.button===2||c;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:me(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),fPe=_.forwardRef((t,e)=>{const n=jd(gv,t.__scopePopover),r=_.useRef(!1),s=_.useRef(!1);return P.jsx(i9,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,o;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),i9=_.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:f,...l}=t,d=jd(gv,n),m=$_(n);return q1(),P.jsx(f_,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:P.jsx(Jc,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>d.onOpenChange(!1),children:P.jsx(A_,{"data-state":a9(d.open),role:"dialog",id:d.contentId,...m,...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)"}})})})}),o9="PopoverClose",hPe=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=jd(o9,n);return P.jsx(Ne.button,{type:"button",...r,ref:e,onClick:me(t.onClick,()=>s.onOpenChange(!1))})});hPe.displayName=o9;var pPe="PopoverArrow",mPe=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=$_(n);return P.jsx(R_,{...s,...r,ref:e})});mPe.displayName=pPe;function a9(t){return t?"open":"closed"}var gPe=J7,vPe=n9,yPe=r9,l9=s9;const bPe=gPe,wPe=vPe,c9=_.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},s)=>P.jsx(yPe,{children:P.jsx(l9,{ref:s,align:e,sideOffset:n,className:le("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})}));c9.displayName=l9.displayName;var u$="Progress",d$=100,[_Pe,AUe]=Nn(u$),[xPe,SPe]=_Pe(u$),u9=_.forwardRef((t,e)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:i=EPe,...a}=t;(s||s===0)&&!$z(s)&&console.error(CPe(`${s}`,"Progress"));const o=$z(s)?s:d$;r!==null&&!Fz(r,o)&&console.error(APe(`${r}`,"Progress"));const c=Fz(r,o)?r:null,u=AC(c)?i(c,o):void 0;return P.jsx(xPe,{scope:n,value:c,max:o,children:P.jsx(Ne.div,{"aria-valuemax":o,"aria-valuemin":0,"aria-valuenow":AC(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":h9(c,o),"data-value":c??void 0,"data-max":o,...a,ref:e})})});u9.displayName=u$;var d9="ProgressIndicator",f9=_.forwardRef((t,e)=>{const{__scopeProgress:n,...r}=t,s=SPe(d9,n);return P.jsx(Ne.div,{"data-state":h9(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:e})});f9.displayName=d9;function EPe(t,e){return`${Math.round(t/e*100)}%`}function h9(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function AC(t){return typeof t=="number"}function $z(t){return AC(t)&&!isNaN(t)&&t>0}function Fz(t,e){return AC(t)&&!isNaN(t)&&t<=e&&t>=0}function CPe(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${d$}\`.`}function APe(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be: +){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-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}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,100%,0)}}@keyframes slideFromTop{from{transform:translate3d(0,-100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,-100%,0)}}@keyframes slideFromLeft{from{transform:translate3d(-100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(-100%,0,0)}}@keyframes slideFromRight{from{transform:translate3d(100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(100%,0,0)}}`);const a1e=24,l1e=typeof window<"u"?_.useLayoutEffect:_.useEffect;function yz(...t){return(...e)=>{for(let n of t)typeof n=="function"&&n(...e)}}function c1e(){return KI(/^Mac/)}function u1e(){return KI(/^iPhone/)}function bz(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function d1e(){return KI(/^iPad/)||c1e()&&navigator.maxTouchPoints>1}function jq(){return u1e()||d1e()}function KI(t){return typeof window<"u"&&window.navigator!=null?t.test(window.navigator.platform):void 0}const MT=typeof document<"u"&&window.visualViewport;function wz(t){let e=window.getComputedStyle(t);return/(auto|scroll)/.test(e.overflow+e.overflowX+e.overflowY)}function Bq(t){for(wz(t)&&(t=t.parentElement);t&&!wz(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}const f1e=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let yS=0,LT;function h1e(t={}){let{isDisabled:e}=t;l1e(()=>{if(!e)return yS++,yS===1&&jq()&&(LT=p1e()),()=>{yS--,yS===0&&(LT==null||LT())}},[e])}function p1e(){let t,e=0,n=l=>{t=Bq(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 d=l.changedTouches[0].pageY,m=t.scrollTop,p=t.scrollHeight-t.clientHeight;p!==0&&((m<=0&&d>e||m>=p&&d{let d=l.target;iD(d)&&d!==document.activeElement&&(l.preventDefault(),d.style.transform="translateY(-2000px)",d.focus(),requestAnimationFrame(()=>{d.style.transform=""}))},i=l=>{let d=l.target;iD(d)&&(d.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{d.style.transform="",MT&&(MT.height{_z(d)}):MT.addEventListener("resize",()=>_z(d),{once:!0}))}))},a=()=>{window.scrollTo(0,0)},o=window.pageXOffset,c=window.pageYOffset,u=yz(m1e(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let f=yz(Py(document,"touchstart",n,{passive:!1,capture:!0}),Py(document,"touchmove",r,{passive:!1,capture:!0}),Py(document,"touchend",s,{passive:!1,capture:!0}),Py(document,"focus",i,!0),Py(window,"scroll",a));return()=>{u(),f(),window.scrollTo(o,c)}}function m1e(t,e,n){let r=t.style[e];return t.style[e]=n,()=>{t.style[e]=r}}function Py(t,e,n,r){return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}}function _z(t){let e=document.scrollingElement||document.documentElement;for(;t&&t!==e;){let n=Bq(t);if(n!==document.documentElement&&n!==document.body&&n!==t){let r=n.getBoundingClientRect().top,s=t.getBoundingClientRect().top,i=t.getBoundingClientRect().bottom;const a=n.getBoundingClientRect().bottom+a1e;i>a&&(n.scrollTop+=s-r)}t=n.parentElement}}function iD(t){return t instanceof HTMLInputElement&&!f1e.has(t.type)||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable}function g1e(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function v1e(...t){return e=>t.forEach(n=>g1e(n,e))}function zq(...t){return _.useCallback(v1e(...t),t)}const Uq=new WeakMap;function jr(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&&Uq.set(t,r)}function y1e(t,e){if(!t||!(t instanceof HTMLElement))return;let n=Uq.get(t);n&&(t.style[e]=n[e])}const Br=t=>{switch(t){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return t}};function bS(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(", ")[Br(e)?13:12]):(s=r.match(/^matrix\((.+)\)$/),s?parseFloat(s[1].split(", ")[Br(e)?5:4]):null)}function b1e(t){return 8*(Math.log(t+1)-2)}function IT(t,e){if(!t)return()=>{};const n=t.style.cssText;return Object.assign(t.style,e),()=>{t.style.cssText=n}}function w1e(...t){return(...e)=>{for(const n of t)typeof n=="function"&&n(...e)}}const nr={DURATION:.5,EASE:[.32,.72,0,1]},Hq=.4,_1e=.25,x1e=100,Vq=8,wS=16,oD=26,$T="vaul-dragging";function Wq(t){const e=se.useRef(t);return se.useEffect(()=>{e.current=t}),se.useMemo(()=>(...n)=>e.current==null?void 0:e.current.call(e,...n),[])}function S1e({defaultProp:t,onChange:e}){const n=se.useState(t),[r]=n,s=se.useRef(r),i=Wq(e);return se.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}function Gq({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,s]=S1e({defaultProp:e,onChange:n}),i=t!==void 0,a=i?t:r,o=Wq(n),c=se.useCallback(u=>{if(i){const l=typeof u=="function"?u(t):u;l!==t&&o(l)}else s(u)},[i,t,s,o]);return[a,c]}function E1e({activeSnapPointProp:t,setActiveSnapPointProp:e,snapPoints:n,drawerRef:r,overlayRef:s,fadeFromIndex:i,onSnapPointChange:a,direction:o="bottom",container:c,snapToSequentialPoint:u}){const[f,l]=Gq({prop:t,defaultProp:n==null?void 0:n[0],onChange:e}),[d,m]=se.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);se.useEffect(()=>{function R(){m({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",R),()=>window.removeEventListener("resize",R)},[]);const p=se.useMemo(()=>f===(n==null?void 0:n[n.length-1])||null,[n,f]),h=se.useMemo(()=>n==null?void 0:n.findIndex(R=>R===f),[n,f]),y=n&&n.length>0&&(i||i===0)&&!Number.isNaN(i)&&n[i]===f||!n,g=se.useMemo(()=>{const R=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var E;return(E=n==null?void 0:n.map(k=>{const N=typeof k=="string";let O=0;if(N&&(O=parseInt(k,10)),Br(o)){const I=N?O:d?k*R.height:0;return d?o==="bottom"?R.height-I:-R.height+I:I}const L=N?O:d?k*R.width:0;return d?o==="right"?R.width-L:-R.width+L:L}))!=null?E:[]},[n,d,c]),v=se.useMemo(()=>h!==null?g==null?void 0:g[h]:null,[g,h]),w=se.useCallback(R=>{var E;const k=(E=g==null?void 0:g.findIndex(N=>N===R))!=null?E:null;a(k),jr(r.current,{transition:`transform ${nr.DURATION}s cubic-bezier(${nr.EASE.join(",")})`,transform:Br(o)?`translate3d(0, ${R}px, 0)`:`translate3d(${R}px, 0, 0)`}),g&&k!==g.length-1&&k!==i&&k{if(f||t){var R;const E=(R=n==null?void 0:n.findIndex(k=>k===t||k===f))!=null?R:-1;g&&E!==-1&&typeof g[E]=="number"&&w(g[E])}},[f,t,n,g,w]);function x({draggedDistance:R,closeDrawer:E,velocity:k,dismissible:N}){if(i===void 0)return;const O=o==="bottom"||o==="right"?(v??0)-R:(v??0)+R,L=h===i-1,I=h===0,F=R>0;if(L&&jr(s.current,{transition:`opacity ${nr.DURATION}s cubic-bezier(${nr.EASE.join(",")})`}),!u&&k>2&&!F){N?E():w(g[0]);return}if(!u&&k>2&&F&&g&&n){w(g[n.length-1]);return}const U=g==null?void 0:g.reduce((V,H)=>typeof V!="number"||typeof H!="number"?V:Math.abs(H-O)Hq&&Math.abs(R)0&&p){w(g[n.length-1]);return}if(I&&V<0&&N&&E(),h===null)return;w(g[h+V]);return}w(U)}function A({draggedDistance:R}){if(v===null)return;const E=o==="bottom"||o==="right"?v-R:v+R;(o==="bottom"||o==="right")&&Eg[g.length-1]||jr(r.current,{transform:Br(o)?`translate3d(0, ${E}px, 0)`:`translate3d(${E}px, 0, 0)`})}function T(R,E){if(!n||typeof h!="number"||!g||i===void 0)return null;const k=h===i-1;if(h>=i&&E)return 0;if(k&&!E)return 1;if(!y&&!k)return null;const O=k?h+1:h-1,L=k?g[O]-g[O-1]:g[O+1]-g[O],I=R/Math.abs(L);return k?1-I:I}return{isLastSnapPoint:p,activeSnapPoint:f,shouldFade:y,getPercentageDragged:T,setActiveSnapPoint:l,activeSnapPointIndex:h,onRelease:x,onDrag:A,snapPointsOffset:g}}const C1e=()=>()=>{};function A1e(){const{direction:t,isOpen:e,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:s}=O_(),i=se.useRef(null),a=_.useMemo(()=>document.body.style.backgroundColor,[]);function o(){return(window.innerWidth-oD)/window.innerWidth}se.useEffect(()=>{if(e&&n){i.current&&clearTimeout(i.current);const c=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!c)return;w1e(r&&!s?IT(document.body,{background:"black"}):C1e,IT(c,{transformOrigin:Br(t)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${nr.DURATION}s`,transitionTimingFunction:`cubic-bezier(${nr.EASE.join(",")})`}));const u=IT(c,{borderRadius:`${Vq}px`,overflow:"hidden",...Br(t)?{transform:`scale(${o()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${o()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{u(),i.current=window.setTimeout(()=>{a?document.body.style.background=a:document.body.style.removeProperty("background")},nr.DURATION*1e3)}}},[e,n,a])}let Ty=null;function R1e({isOpen:t,modal:e,nested:n,hasBeenOpened:r,preventScrollRestoration:s,noBodyStyles:i}){const[a,o]=se.useState(()=>typeof window<"u"?window.location.href:""),c=se.useRef(0),u=se.useCallback(()=>{if(bz()&&Ty===null&&t&&!i){Ty={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:d}=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 m=d-window.innerHeight;m&&c.current>=d&&(document.body.style.top=`${-(c.current+m)}px`)}),300)}},[t]),f=se.useCallback(()=>{if(bz()&&Ty!==null&&!i){const l=-parseInt(document.body.style.top,10),d=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Ty),window.requestAnimationFrame(()=>{if(s&&a!==window.location.href){o(window.location.href);return}window.scrollTo(d,l)}),Ty=null}},[a]);return se.useEffect(()=>{function l(){c.current=window.scrollY}return l(),window.addEventListener("scroll",l),()=>{window.removeEventListener("scroll",l)}},[]),se.useEffect(()=>{n||!r||(t?(!window.matchMedia("(display-mode: standalone)").matches&&u(),e||window.setTimeout(()=>{f()},500)):f())},[t,r,a,e,n,u,f]),{restorePositionSetting:f}}function P1e({open:t,onOpenChange:e,children:n,onDrag:r,onRelease:s,snapPoints:i,shouldScaleBackground:a=!1,setBackgroundColorOnScale:o=!0,closeThreshold:c=_1e,scrollLockTimeout:u=x1e,dismissible:f=!0,handleOnly:l=!1,fadeFromIndex:d=i&&i.length-1,activeSnapPoint:m,setActiveSnapPoint:p,fixed:h,modal:y=!0,onClose:g,nested:v,noBodyStyles:w,direction:x="bottom",defaultOpen:A=!1,disablePreventScroll:T=!0,snapToSequentialPoint:R=!1,preventScrollRestoration:E=!1,repositionInputs:k=!0,onAnimationEnd:N,container:O,autoFocus:L=!1}){var I,F;const[U=!1,Y]=Gq({defaultProp:A,prop:t,onChange:Ue=>{e==null||e(Ue),!Ue&&!v&&Oe(),setTimeout(()=>{N==null||N(Ue)},nr.DURATION*1e3),Ue&&!y&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),Ue||(document.body.style.pointerEvents="auto")}}),[V,H]=se.useState(!1),[ee,re]=se.useState(!1),[X,q]=se.useState(!1),K=se.useRef(null),Z=se.useRef(null),ue=se.useRef(null),de=se.useRef(null),ie=se.useRef(null),be=se.useRef(!1),Ae=se.useRef(null),_e=se.useRef(0),Me=se.useRef(!1),De=se.useRef(0),ye=se.useRef(null),Fe=se.useRef(((I=ye.current)==null?void 0:I.getBoundingClientRect().height)||0),ut=se.useRef(((F=ye.current)==null?void 0:F.getBoundingClientRect().width)||0),Qe=se.useRef(0),vt=se.useCallback(Ue=>{i&&Ue===J.length-1&&(Z.current=new Date)},[]),{activeSnapPoint:An,activeSnapPointIndex:Yt,setActiveSnapPoint:gn,onRelease:Xt,snapPointsOffset:J,onDrag:fe,shouldFade:ge,getPercentageDragged:Pe}=E1e({snapPoints:i,activeSnapPointProp:m,setActiveSnapPointProp:p,drawerRef:ye,fadeFromIndex:d,overlayRef:K,onSnapPointChange:vt,direction:x,container:O,snapToSequentialPoint:R});h1e({isDisabled:!U||ee||!y||X||!V||!k||!T});const{restorePositionSetting:Oe}=R1e({isOpen:U,modal:y,nested:v,hasBeenOpened:V,preventScrollRestoration:E,noBodyStyles:w});function xe(){return(window.innerWidth-oD)/window.innerWidth}function Te(Ue){var it,ot;!f&&!i||ye.current&&!ye.current.contains(Ue.target)||(Fe.current=((it=ye.current)==null?void 0:it.getBoundingClientRect().height)||0,ut.current=((ot=ye.current)==null?void 0:ot.getBoundingClientRect().width)||0,re(!0),ue.current=new Date,jq()&&window.addEventListener("touchend",()=>be.current=!1,{once:!0}),Ue.target.setPointerCapture(Ue.pointerId),_e.current=Br(x)?Ue.pageY:Ue.pageX)}function Ye(Ue,it){var ot,St;let nt=Ue;const Ht=(ot=window.getSelection())==null?void 0:ot.toString(),Ct=ye.current?bS(ye.current,x):null,yn=new Date;if(nt.hasAttribute("data-vaul-no-drag")||nt.closest("[data-vaul-no-drag]"))return!1;if(x==="right"||x==="left")return!0;if(Z.current&&yn.getTime()-Z.current.getTime()<500)return!1;if(Ct!==null&&(x==="bottom"?Ct>0:Ct<0))return!0;if(Ht&&Ht.length>0)return!1;if(yn.getTime()-((St=ie.current)==null?void 0:St.getTime())nt.clientHeight){if(nt.scrollTop!==0)return ie.current=new Date,!1;if(nt.getAttribute("role")==="dialog")return!0}nt=nt.parentNode}return!0}function Rt(Ue){if(ye.current&&ee){const it=x==="bottom"||x==="right"?1:-1,ot=(_e.current-(Br(x)?Ue.pageY:Ue.pageX))*it,St=ot>0,nt=i&&!f&&!St;if(nt&&Yt===0)return;const Ht=Math.abs(ot),Ct=document.querySelector("[data-vaul-drawer-wrapper]"),yn=x==="bottom"||x==="top"?Fe.current:ut.current;let an=Ht/yn;const ln=Pe(Ht,St);if(ln!==null&&(an=ln),nt&&an>=1||!be.current&&!Ye(Ue.target,St))return;if(ye.current.classList.add($T),be.current=!0,jr(ye.current,{transition:"none"}),jr(K.current,{transition:"none"}),i&&fe({draggedDistance:ot}),St&&!i){const gr=b1e(ot),On=Math.min(gr*-1,0)*it;jr(ye.current,{transform:Br(x)?`translate3d(0, ${On}px, 0)`:`translate3d(${On}px, 0, 0)`});return}const Dn=1-an;if((ge||d&&Yt===d-1)&&(r==null||r(Ue,an),jr(K.current,{opacity:`${Dn}`,transition:"none"},!0)),Ct&&K.current&&a){const gr=Math.min(xe()+an*(1-xe()),1),On=8-an*8,te=Math.max(0,14-an*14);jr(Ct,{borderRadius:`${On}px`,transform:Br(x)?`scale(${gr}) translate3d(0, ${te}px, 0)`:`scale(${gr}) translate3d(${te}px, 0, 0)`,transition:"none"},!0)}if(!i){const gr=Ht*it;jr(ye.current,{transform:Br(x)?`translate3d(0, ${gr}px, 0)`:`translate3d(${gr}px, 0, 0)`})}}}se.useEffect(()=>{var Ue;function it(){if(!ye.current||!k)return;const ot=document.activeElement;if(iD(ot)||Me.current){var St;const nt=((St=window.visualViewport)==null?void 0:St.height)||0,Ht=window.innerHeight;let Ct=Ht-nt;const yn=ye.current.getBoundingClientRect().height||0,an=yn>Ht*.8;Qe.current||(Qe.current=yn);const ln=ye.current.getBoundingClientRect().top;if(Math.abs(De.current-Ct)>60&&(Me.current=!Me.current),i&&i.length>0&&J&&Yt){const Dn=J[Yt]||0;Ct+=Dn}if(De.current=Ct,yn>nt||Me.current){const Dn=ye.current.getBoundingClientRect().height;let gr=Dn;Dn>nt&&(gr=nt-(an?ln:oD)),h?ye.current.style.height=`${Dn-Math.max(Ct,0)}px`:ye.current.style.height=`${Math.max(gr,nt-ln)}px`}else ye.current.style.height=`${Qe.current}px`;i&&i.length>0&&!Me.current?ye.current.style.bottom="0px":ye.current.style.bottom=`${Math.max(Ct,0)}px`}}return(Ue=window.visualViewport)==null||Ue.addEventListener("resize",it),()=>{var ot;return(ot=window.visualViewport)==null?void 0:ot.removeEventListener("resize",it)}},[Yt,i,J]);function bt(Ue){Qn(),g==null||g(),Ue||Y(!1),setTimeout(()=>{i&&gn(i[0])},nr.DURATION*1e3)}function $s(){if(!ye.current)return;const Ue=document.querySelector("[data-vaul-drawer-wrapper]"),it=bS(ye.current,x);jr(ye.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${nr.DURATION}s cubic-bezier(${nr.EASE.join(",")})`}),jr(K.current,{transition:`opacity ${nr.DURATION}s cubic-bezier(${nr.EASE.join(",")})`,opacity:"1"}),a&&it&&it>0&&U&&jr(Ue,{borderRadius:`${Vq}px`,overflow:"hidden",...Br(x)?{transform:`scale(${xe()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${xe()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${nr.DURATION}s`,transitionTimingFunction:`cubic-bezier(${nr.EASE.join(",")})`},!0)}function Qn(){!ee||!ye.current||(ye.current.classList.remove($T),be.current=!1,re(!1),de.current=new Date)}function ys(Ue){if(!ee||!ye.current)return;ye.current.classList.remove($T),be.current=!1,re(!1),de.current=new Date;const it=bS(ye.current,x);if(!Ye(Ue.target,!1)||!it||Number.isNaN(it)||ue.current===null)return;const ot=de.current.getTime()-ue.current.getTime(),St=_e.current-(Br(x)?Ue.pageY:Ue.pageX),nt=Math.abs(St)/ot;if(nt>.05&&(q(!0),setTimeout(()=>{q(!1)},200)),i){Xt({draggedDistance:St*(x==="bottom"||x==="right"?1:-1),closeDrawer:bt,velocity:nt,dismissible:f}),s==null||s(Ue,!0);return}if(x==="bottom"||x==="right"?St>0:St<0){$s(),s==null||s(Ue,!0);return}if(nt>Hq){bt(),s==null||s(Ue,!1);return}var Ht;const Ct=Math.min((Ht=ye.current.getBoundingClientRect().height)!=null?Ht:0,window.innerHeight);var yn;const an=Math.min((yn=ye.current.getBoundingClientRect().width)!=null?yn:0,window.innerWidth),ln=x==="left"||x==="right";if(Math.abs(it)>=(ln?an:Ct)*c){bt(),s==null||s(Ue,!1);return}s==null||s(Ue,!0),$s()}se.useEffect(()=>(U&&(jr(document.documentElement,{scrollBehavior:"auto"}),Z.current=new Date),()=>{y1e(document.documentElement,"scrollBehavior")}),[U]);function Ut(Ue){const it=Ue?(window.innerWidth-wS)/window.innerWidth:1,ot=Ue?-16:0;Ae.current&&window.clearTimeout(Ae.current),jr(ye.current,{transition:`transform ${nr.DURATION}s cubic-bezier(${nr.EASE.join(",")})`,transform:`scale(${it}) translate3d(0, ${ot}px, 0)`}),!Ue&&ye.current&&(Ae.current=setTimeout(()=>{const St=bS(ye.current,x);jr(ye.current,{transition:"none",transform:Br(x)?`translate3d(0, ${St}px, 0)`:`translate3d(${St}px, 0, 0)`})},500))}function on(Ue,it){if(it<0)return;const ot=(window.innerWidth-wS)/window.innerWidth,St=ot+it*(1-ot),nt=-16+it*wS;jr(ye.current,{transform:Br(x)?`scale(${St}) translate3d(0, ${nt}px, 0)`:`scale(${St}) translate3d(${nt}px, 0, 0)`,transition:"none"})}function vn(Ue,it){const ot=Br(x)?window.innerHeight:window.innerWidth,St=it?(ot-wS)/ot:1,nt=it?-16:0;it&&jr(ye.current,{transition:`transform ${nr.DURATION}s cubic-bezier(${nr.EASE.join(",")})`,transform:Br(x)?`scale(${St}) translate3d(0, ${nt}px, 0)`:`scale(${St}) translate3d(${nt}px, 0, 0)`})}return se.createElement(JCe,{defaultOpen:A,onOpenChange:Ue=>{!f&&!Ue||(Ue?H(!0):bt(!0),Y(Ue))},open:U},se.createElement(Fq.Provider,{value:{activeSnapPoint:An,snapPoints:i,setActiveSnapPoint:gn,drawerRef:ye,overlayRef:K,onOpenChange:e,onPress:Te,onRelease:ys,onDrag:Rt,dismissible:f,handleOnly:l,isOpen:U,isDragging:ee,shouldFade:ge,closeDrawer:bt,onNestedDrag:on,onNestedOpenChange:Ut,onNestedRelease:vn,keyboardIsOpen:Me,modal:y,snapPointsOffset:J,direction:x,shouldScaleBackground:a,setBackgroundColorOnScale:o,noBodyStyles:w,container:O,autoFocus:L}},n))}const qq=se.forwardRef(function({...t},e){const{overlayRef:n,snapPoints:r,onRelease:s,shouldFade:i,isOpen:a,modal:o}=O_(),c=zq(e,n),u=r&&r.length>0;return o?se.createElement(t1e,{onMouseUp:s,ref:c,"data-vaul-overlay":"","data-vaul-snap-points":a&&u?"true":"false","data-vaul-snap-points-overlay":a&&i?"true":"false",...t}):(typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),null)});qq.displayName="Drawer.Overlay";const Kq=se.forwardRef(function({onPointerDownOutside:t,style:e,onOpenAutoFocus:n,...r},s){const{drawerRef:i,onPress:a,onRelease:o,onDrag:c,keyboardIsOpen:u,snapPointsOffset:f,modal:l,isOpen:d,direction:m,snapPoints:p,container:h,handleOnly:y,autoFocus:g}=O_(),[v,w]=se.useState(!1),x=zq(s,i),A=se.useRef(null),T=se.useRef(null),R=se.useRef(!1),E=p&&p.length>0;A1e();const k=(O,L,I=0)=>{if(R.current)return!0;const F=Math.abs(O.y),U=Math.abs(O.x),Y=U>F,V=["bottom","right"].includes(L)?1:-1;if(L==="left"||L==="right"){if(!(O.x*V<0)&&U>=0&&U<=I)return Y}else if(!(O.y*V<0)&&F>=0&&F<=I)return!Y;return R.current=!0,!0};se.useEffect(()=>{E&&window.requestAnimationFrame(()=>{w(!0)})},[]);function N(O){A.current=null,R.current=!1,o(O)}return se.createElement(n1e,{"data-vaul-drawer-direction":m,"data-vaul-drawer":"","data-vaul-delayed-snap-points":v?"true":"false","data-vaul-snap-points":d&&E?"true":"false","data-vaul-custom-container":h?"true":"false",...r,ref:x,style:f&&f.length>0?{"--snap-point-height":`${f[0]}px`,...e}:e,onPointerDown:O=>{y||(r.onPointerDown==null||r.onPointerDown.call(r,O),A.current={x:O.pageX,y:O.pageY},a(O))},onOpenAutoFocus:O=>{n==null||n(O),g||O.preventDefault()},onPointerDownOutside:O=>{if(t==null||t(O),!l||O.defaultPrevented){O.preventDefault();return}u.current&&(u.current=!1)},onFocusOutside:O=>{if(!l){O.preventDefault();return}},onPointerMove:O=>{if(T.current=O,y||(r.onPointerMove==null||r.onPointerMove.call(r,O),!A.current))return;const L=O.pageY-A.current.y,I=O.pageX-A.current.x,F=O.pointerType==="touch"?10:2;k({x:I,y:L},m,F)?c(O):(Math.abs(I)>F||Math.abs(L)>F)&&(A.current=null)},onPointerUp:O=>{r.onPointerUp==null||r.onPointerUp.call(r,O),A.current=null,R.current=!1,o(O)},onPointerOut:O=>{r.onPointerOut==null||r.onPointerOut.call(r,O),N(T.current)},onContextMenu:O=>{r.onContextMenu==null||r.onContextMenu.call(r,O),N(T.current)}})});Kq.displayName="Drawer.Content";const T1e=250,k1e=120,N1e=se.forwardRef(function({preventCycle:t=!1,children:e,...n},r){const{closeDrawer:s,isDragging:i,snapPoints:a,activeSnapPoint:o,setActiveSnapPoint:c,dismissible:u,handleOnly:f,isOpen:l,onPress:d,onDrag:m}=O_(),p=se.useRef(null),h=se.useRef(!1);function y(){if(h.current){w();return}window.setTimeout(()=>{g()},k1e)}function g(){if(i||t||h.current){w();return}if(w(),(!a||a.length===0)&&u){s();return}if(o===a[a.length-1]&&u){s();return}const A=a.findIndex(R=>R===o);if(A===-1)return;const T=a[A+1];c(T)}function v(){p.current=window.setTimeout(()=>{h.current=!0},T1e)}function w(){window.clearTimeout(p.current),h.current=!1}return se.createElement("div",{onClick:y,onPointerCancel:w,onPointerDown:x=>{f&&d(x),v()},onPointerMove:x=>{f&&m(x)},ref:r,"data-vaul-drawer-visible":l?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},se.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},e))});N1e.displayName="Drawer.Handle";function D1e(t){const e=O_(),{container:n=e.container,...r}=t;return se.createElement(e1e,{container:n,...r})}const Tl={Root:P1e,Content:Kq,Overlay:qq,Portal:D1e,Close:i1e,Title:r1e,Description:s1e},O1e=({shouldScaleBackground:t=!0,...e})=>P.jsx(Tl.Root,{shouldScaleBackground:t,...e});O1e.displayName="Drawer";const M1e=Tl.Portal,mUe=Tl.Close,Yq=_.forwardRef(({className:t,...e},n)=>P.jsx(Tl.Overlay,{ref:n,className:le("fixed inset-0 z-50 bg-black/80",t),...e}));Yq.displayName=Tl.Overlay.displayName;const L1e=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(M1e,{children:[P.jsx(Yq,{}),P.jsxs(Tl.Content,{ref:r,className:le("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",t),...n,children:[P.jsx("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),e]})]}));L1e.displayName="DrawerContent";const I1e=({className:t,...e})=>P.jsx("div",{className:le("grid gap-1.5 p-4 text-center sm:text-left",t),...e});I1e.displayName="DrawerHeader";const $1e=({className:t,...e})=>P.jsx("div",{className:le("mt-auto flex flex-col gap-2 p-4",t),...e});$1e.displayName="DrawerFooter";const F1e=_.forwardRef(({className:t,...e},n)=>P.jsx(Tl.Title,{ref:n,className:le("text-lg font-semibold leading-none tracking-tight",t),...e}));F1e.displayName=Tl.Title.displayName;const j1e=_.forwardRef(({className:t,...e},n)=>P.jsx(Tl.Description,{ref:n,className:le("text-sm text-muted-foreground",t),...e}));j1e.displayName=Tl.Description.displayName;var YI="DropdownMenu",[B1e,gUe]=Nn(YI,[N_]),si=N_(),[z1e,Xq]=B1e(YI),Qq=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:a,modal:o=!0}=t,c=si(e),u=_.useRef(null),[f=!1,l]=lr({prop:s,defaultProp:i,onChange:a});return P.jsx(z1e,{scope:e,triggerId:qr(),triggerRef:u,contentId:qr(),open:f,onOpenChange:l,onOpenToggle:_.useCallback(()=>l(d=>!d),[l]),modal:o,children:P.jsx(kEe,{...c,open:f,onOpenChange:l,dir:r,modal:o,children:n})})};Qq.displayName=YI;var Zq="DropdownMenuTrigger",Jq=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=t,i=Xq(Zq,n),a=si(n);return P.jsx(TI,{asChild:!0,...a,children:P.jsx(Ne.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:c_(e,i.triggerRef),onPointerDown:me(t.onPointerDown,o=>{!r&&o.button===0&&o.ctrlKey===!1&&(i.onOpenToggle(),i.open||o.preventDefault())}),onKeyDown:me(t.onKeyDown,o=>{r||(["Enter"," "].includes(o.key)&&i.onOpenToggle(),o.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});Jq.displayName=Zq;var U1e="DropdownMenuPortal",eK=t=>{const{__scopeDropdownMenu:e,...n}=t,r=si(e);return P.jsx(kI,{...r,...n})};eK.displayName=U1e;var tK="DropdownMenuContent",nK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Xq(tK,n),i=si(n),a=_.useRef(!1);return P.jsx(NI,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:e,onCloseAutoFocus:me(t.onCloseAutoFocus,o=>{var c;a.current||(c=s.triggerRef.current)==null||c.focus(),a.current=!1,o.preventDefault()}),onInteractOutside:me(t.onInteractOutside,o=>{const c=o.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,f=c.button===2||u;(!s.modal||f)&&(a.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)"}})});nK.displayName=tK;var H1e="DropdownMenuGroup",rK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=si(n);return P.jsx(DI,{...s,...r,ref:e})});rK.displayName=H1e;var V1e="DropdownMenuLabel",sK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=si(n);return P.jsx(OI,{...s,...r,ref:e})});sK.displayName=V1e;var W1e="DropdownMenuItem",iK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=si(n);return P.jsx(MI,{...s,...r,ref:e})});iK.displayName=W1e;var G1e="DropdownMenuCheckboxItem",oK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=si(n);return P.jsx(LI,{...s,...r,ref:e})});oK.displayName=G1e;var q1e="DropdownMenuRadioGroup",K1e=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=si(n);return P.jsx(II,{...s,...r,ref:e})});K1e.displayName=q1e;var Y1e="DropdownMenuRadioItem",aK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=si(n);return P.jsx($I,{...s,...r,ref:e})});aK.displayName=Y1e;var X1e="DropdownMenuItemIndicator",lK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=si(n);return P.jsx(FI,{...s,...r,ref:e})});lK.displayName=X1e;var Q1e="DropdownMenuSeparator",cK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=si(n);return P.jsx(jI,{...s,...r,ref:e})});cK.displayName=Q1e;var Z1e="DropdownMenuArrow",J1e=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=si(n);return P.jsx(BI,{...s,...r,ref:e})});J1e.displayName=Z1e;var eAe="DropdownMenuSubTrigger",uK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=si(n);return P.jsx(zI,{...s,...r,ref:e})});uK.displayName=eAe;var tAe="DropdownMenuSubContent",dK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=si(n);return P.jsx(UI,{...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)"}})});dK.displayName=tAe;var nAe=Qq,rAe=Jq,sAe=eK,fK=nK,iAe=rK,hK=sK,pK=iK,mK=oK,gK=aK,vK=lK,yK=cK,bK=uK,wK=dK;const oAe=nAe,aAe=rAe,lAe=iAe,cAe=_.forwardRef(({className:t,inset:e,children:n,...r},s)=>P.jsxs(bK,{ref:s,className:le("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,P.jsx(d_,{className:"w-4 h-4 ml-auto"})]}));cAe.displayName=bK.displayName;const uAe=_.forwardRef(({className:t,...e},n)=>P.jsx(wK,{ref:n,className:le("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}));uAe.displayName=wK.displayName;const _K=_.forwardRef(({className:t,sideOffset:e=4,...n},r)=>P.jsx(sAe,{children:P.jsx(fK,{ref:r,sideOffset:e,className:le("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})}));_K.displayName=fK.displayName;const aD=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(pK,{ref:r,className:le("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}));aD.displayName=pK.displayName;const dAe=_.forwardRef(({className:t,children:e,checked:n,...r},s)=>P.jsxs(mK,{ref:s,className:le("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:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(vK,{children:P.jsx(u_,{className:"w-4 h-4"})})}),e]}));dAe.displayName=mK.displayName;const fAe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(gK,{ref:r,className:le("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:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(vK,{children:P.jsx(G1,{className:"w-2 h-2 fill-current"})})}),e]}));fAe.displayName=gK.displayName;const xK=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(hK,{ref:r,className:le("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));xK.displayName=hK.displayName;const lD=_.forwardRef(({className:t,...e},n)=>P.jsx(yK,{ref:n,className:le("-mx-1 my-1 h-px bg-muted",t),...e}));lD.displayName=yK.displayName;const hAe=({className:t,...e})=>P.jsx("span",{className:le("ml-auto text-xs tracking-widest opacity-60",t),...e});hAe.displayName="DropdownMenuShortcut";var M_=t=>t.type==="checkbox",Ef=t=>t instanceof Date,Ys=t=>t==null;const SK=t=>typeof t=="object";var xr=t=>!Ys(t)&&!Array.isArray(t)&&SK(t)&&!Ef(t),EK=t=>xr(t)&&t.target?M_(t.target)?t.target.checked:t.target.value:t,pAe=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,CK=(t,e)=>t.has(pAe(e)),mAe=t=>{const e=t.constructor&&t.constructor.prototype;return xr(e)&&e.hasOwnProperty("isPrototypeOf")},XI=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function tr(t){let e;const n=Array.isArray(t),r=typeof FileList<"u"?t instanceof FileList:!1;if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else if(!(XI&&(t instanceof Blob||r))&&(n||xr(t)))if(e=n?[]:{},!n&&!mAe(t))e=t;else for(const s in t)t.hasOwnProperty(s)&&(e[s]=tr(t[s]));else return t;return e}var L_=t=>Array.isArray(t)?t.filter(Boolean):[],Hn=t=>t===void 0,$e=(t,e,n)=>{if(!e||!xr(t))return n;const r=L_(e.split(/[,[\].]+?/)).reduce((s,i)=>Ys(s)?s:s[i],t);return Hn(r)||r===t?Hn(t[e])?n:t[e]:r},to=t=>typeof t=="boolean",QI=t=>/^\w*$/.test(t),AK=t=>L_(t.replace(/["|']|\]/g,"").split(/\.|\[/)),Qt=(t,e,n)=>{let r=-1;const s=QI(e)?[e]:AK(e),i=s.length,a=i-1;for(;++rse.useContext(RK),gAe=t=>{const{children:e,...n}=t;return se.createElement(RK.Provider,{value:n},e)};var PK=(t,e,n,r=!0)=>{const s={defaultValues:e._defaultValues};for(const i in t)Object.defineProperty(s,i,{get:()=>{const a=i;return e._proxyFormState[a]!==Lo.all&&(e._proxyFormState[a]=!r||Lo.all),n&&(n[a]=!0),t[a]}});return s};function vAe(t){const e=Ia(),{control:n=e.control,disabled:r,name:s,exact:i}=t||{},[a,o]=se.useState(n._formState),c=se.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=se.useRef(s);return u.current=s,se.useEffect(()=>n._subscribe({name:u.current,formState:c.current,exact:i,callback:f=>{!r&&o({...n._formState,...f})}}),[n,r,i]),se.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),se.useMemo(()=>PK(a,n,c.current,!1),[a,n])}var ml=t=>typeof t=="string",TK=(t,e,n,r,s)=>ml(t)?(r&&e.watch.add(t),$e(n,t,s)):Array.isArray(t)?t.map(i=>(r&&e.watch.add(i),$e(n,i))):(r&&(e.watchAll=!0),n);function yAe(t){const e=Ia(),{control:n=e.control,name:r,defaultValue:s,disabled:i,exact:a}=t||{},o=se.useRef(r),c=se.useRef(s);o.current=r,se.useEffect(()=>n._subscribe({name:o.current,formState:{values:!0},exact:a,callback:l=>!i&&f(TK(o.current,n._names,l.values||n._formValues,!1,c.current))}),[n,i,a]);const[u,f]=se.useState(n._getWatch(r,s));return se.useEffect(()=>n._removeUnmounted()),u}function bAe(t){const e=Ia(),{name:n,disabled:r,control:s=e.control,shouldUnregister:i}=t,a=CK(s._names.array,n),o=yAe({control:s,name:n,defaultValue:$e(s._formValues,n,$e(s._defaultValues,n,t.defaultValue)),exact:!0}),c=vAe({control:s,name:n,exact:!0}),u=se.useRef(t),f=se.useRef(s.register(n,{...t.rules,value:o,...to(t.disabled)?{disabled:t.disabled}:{}})),l=se.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!$e(c.errors,n)},isDirty:{enumerable:!0,get:()=>!!$e(c.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!$e(c.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!$e(c.validatingFields,n)},error:{enumerable:!0,get:()=>$e(c.errors,n)}}),[c,n]),d=se.useCallback(y=>f.current.onChange({target:{value:EK(y),name:n},type:bC.CHANGE}),[n]),m=se.useCallback(()=>f.current.onBlur({target:{value:$e(s._formValues,n),name:n},type:bC.BLUR}),[n,s._formValues]),p=se.useCallback(y=>{const g=$e(s._fields,n);g&&y&&(g._f.ref={focus:()=>y.focus(),select:()=>y.select(),setCustomValidity:v=>y.setCustomValidity(v),reportValidity:()=>y.reportValidity()})},[s._fields,n]),h=se.useMemo(()=>({name:n,value:o,...to(r)||c.disabled?{disabled:c.disabled||r}:{},onChange:d,onBlur:m,ref:p}),[n,r,c.disabled,d,m,p,o]);return se.useEffect(()=>{const y=s._options.shouldUnregister||i;s.register(n,{...u.current.rules,...to(u.current.disabled)?{disabled:u.current.disabled}:{}});const g=(v,w)=>{const x=$e(s._fields,v);x&&x._f&&(x._f.mount=w)};if(g(n,!0),y){const v=tr($e(s._options.defaultValues,n));Qt(s._defaultValues,n,v),Hn($e(s._formValues,n))&&Qt(s._formValues,n,v)}return!a&&s.register(n),()=>{(a?y&&!s._state.action:y)?s.unregister(n):g(n,!1)}},[n,s,a,i]),se.useEffect(()=>{s._setDisabledField({disabled:r,name:n})},[r,n,s]),se.useMemo(()=>({field:h,formState:c,fieldState:l}),[h,c,l])}const wAe=t=>t.render(bAe(t));var kK=(t,e,n,r,s)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:s||!0}}:{},xi=t=>Array.isArray(t)?t:[t],xz=()=>{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=[]}}},cD=t=>Ys(t)||!SK(t);function Ou(t,e){if(cD(t)||cD(e))return t===e;if(Ef(t)&&Ef(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 a=e[s];if(Ef(i)&&Ef(a)||xr(i)&&xr(a)||Array.isArray(i)&&Array.isArray(a)?!Ou(i,a):i!==a)return!1}}return!0}var ks=t=>xr(t)&&!Object.keys(t).length,ZI=t=>t.type==="file",_a=t=>typeof t=="function",wC=t=>{if(!XI)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},NK=t=>t.type==="select-multiple",JI=t=>t.type==="radio",_Ae=t=>JI(t)||M_(t),FT=t=>wC(t)&&t.isConnected;function xAe(t,e){const n=e.slice(0,-1).length;let r=0;for(;r{for(const e in t)if(_a(t[e]))return!0;return!1};function _C(t,e={}){const n=Array.isArray(t);if(xr(t)||n)for(const r in t)Array.isArray(t[r])||xr(t[r])&&!DK(t[r])?(e[r]=Array.isArray(t[r])?[]:{},_C(t[r],e[r])):Ys(t[r])||(e[r]=!0);return e}function OK(t,e,n){const r=Array.isArray(t);if(xr(t)||r)for(const s in t)Array.isArray(t[s])||xr(t[s])&&!DK(t[s])?Hn(e)||cD(n[s])?n[s]=Array.isArray(t[s])?_C(t[s],[]):{..._C(t[s])}:OK(t[s],Ys(e)?{}:e[s],n[s]):n[s]=!Ou(t[s],e[s]);return n}var ky=(t,e)=>OK(t,e,_C(e));const Sz={value:!1,isValid:!1},Ez={value:!0,isValid:!0};var MK=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&&!Hn(t[0].attributes.value)?Hn(t[0].value)||t[0].value===""?Ez:{value:t[0].value,isValid:!0}:Ez:Sz}return Sz},LK=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>Hn(t)?t:e?t===""?NaN:t&&+t:n&&ml(t)?new Date(t):r?r(t):t;const Cz={isValid:!1,value:null};var IK=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,Cz):Cz;function Az(t){const e=t.ref;return ZI(e)?e.files:JI(e)?IK(t.refs).value:NK(e)?[...e.selectedOptions].map(({value:n})=>n):M_(e)?MK(t.refs).value:LK(Hn(e.value)?t.ref.value:e.value,t)}var EAe=(t,e,n,r)=>{const s={};for(const i of t){const a=$e(e,i);a&&Qt(s,i,a._f)}return{criteriaMode:n,names:[...t],fields:s,shouldUseNativeValidation:r}},xC=t=>t instanceof RegExp,Ny=t=>Hn(t)?t:xC(t)?t.source:xr(t)?xC(t.value)?t.value.source:t.value:t,Rm=t=>({isOnSubmit:!t||t===Lo.onSubmit,isOnBlur:t===Lo.onBlur,isOnChange:t===Lo.onChange,isOnAll:t===Lo.all,isOnTouch:t===Lo.onTouched});const Rz="AsyncFunction";var CAe=t=>!!t&&!!t.validate&&!!(_a(t.validate)&&t.validate.constructor.name===Rz||xr(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===Rz)),AAe=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),uD=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const Wm=(t,e,n,r)=>{for(const s of n||Object.keys(t)){const i=$e(t,s);if(i){const{_f:a,...o}=i;if(a){if(a.refs&&a.refs[0]&&e(a.refs[0],s)&&!r)return!0;if(a.ref&&e(a.ref,a.name)&&!r)return!0;if(Wm(o,e))break}else if(xr(o)&&Wm(o,e))break}}};function Pz(t,e,n){const r=$e(t,n);if(r||QI(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const i=s.join("."),a=$e(e,i),o=$e(t,i);if(a&&!Array.isArray(a)&&n!==i)return{name:n};if(o&&o.type)return{name:i,error:o};s.pop()}return{name:n}}var RAe=(t,e,n,r)=>{n(t);const{name:s,...i}=t;return ks(i)||Object.keys(i).length>=Object.keys(e).length||Object.keys(i).find(a=>e[a]===(!r||Lo.all))},PAe=(t,e,n)=>!t||!e||t===e||xi(t).some(r=>r&&(n?r===e:r.startsWith(e)||e.startsWith(r))),TAe=(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,kAe=(t,e)=>!L_($e(t,e)).length&&Ar(t,e),$K=(t,e,n)=>{const r=xi($e(t,n));return Qt(r,"root",e[n]),Qt(t,n,r),t},XS=t=>ml(t);function Tz(t,e,n="validate"){if(XS(t)||Array.isArray(t)&&t.every(XS)||to(t)&&!t)return{type:n,message:XS(t)?t:"",ref:e}}var Yp=t=>xr(t)&&!xC(t)?t:{value:t,message:""},dD=async(t,e,n,r,s,i)=>{const{ref:a,refs:o,required:c,maxLength:u,minLength:f,min:l,max:d,pattern:m,validate:p,name:h,valueAsNumber:y,mount:g}=t._f,v=$e(n,h);if(!g||e.has(h))return{};const w=o?o[0]:a,x=L=>{s&&w.reportValidity&&(w.setCustomValidity(to(L)?"":L||""),w.reportValidity())},A={},T=JI(a),R=M_(a),E=T||R,k=(y||ZI(a))&&Hn(a.value)&&Hn(v)||wC(a)&&a.value===""||v===""||Array.isArray(v)&&!v.length,N=kK.bind(null,h,r,A),O=(L,I,F,U=Wl.maxLength,Y=Wl.minLength)=>{const V=L?I:F;A[h]={type:L?U:Y,message:V,ref:a,...N(L?U:Y,V)}};if(i?!Array.isArray(v)||!v.length:c&&(!E&&(k||Ys(v))||to(v)&&!v||R&&!MK(o).isValid||T&&!IK(o).isValid)){const{value:L,message:I}=XS(c)?{value:!!c,message:c}:Yp(c);if(L&&(A[h]={type:Wl.required,message:I,ref:w,...N(Wl.required,I)},!r))return x(I),A}if(!k&&(!Ys(l)||!Ys(d))){let L,I;const F=Yp(d),U=Yp(l);if(!Ys(v)&&!isNaN(v)){const Y=a.valueAsNumber||v&&+v;Ys(F.value)||(L=Y>F.value),Ys(U.value)||(I=Ynew Date(new Date().toDateString()+" "+re),H=a.type=="time",ee=a.type=="week";ml(F.value)&&v&&(L=H?V(v)>V(F.value):ee?v>F.value:Y>new Date(F.value)),ml(U.value)&&v&&(I=H?V(v)+L.value,U=!Ys(I.value)&&v.length<+I.value;if((F||U)&&(O(F,L.message,I.message),!r))return x(A[h].message),A}if(m&&!k&&ml(v)){const{value:L,message:I}=Yp(m);if(xC(L)&&!v.match(L)&&(A[h]={type:Wl.pattern,message:I,ref:a,...N(Wl.pattern,I)},!r))return x(I),A}if(p){if(_a(p)){const L=await p(v,n),I=Tz(L,w);if(I&&(A[h]={...I,...N(Wl.validate,I.message)},!r))return x(I.message),A}else if(xr(p)){let L={};for(const I in p){if(!ks(L)&&!r)break;const F=Tz(await p[I](v,n),w,I);F&&(L={...F,...N(I,F.message)},x(F.message),r&&(A[h]=L))}if(!ks(L)&&(A[h]={ref:w,...L},!r))return A}}return x(!0),A};const NAe={mode:Lo.onSubmit,reValidateMode:Lo.onChange,shouldFocusError:!0};function DAe(t={}){let e={...NAe,...t},n={submitCount:0,isDirty:!1,isLoading:_a(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1};const r={};let s=xr(e.defaultValues)||xr(e.values)?tr(e.values||e.defaultValues)||{}:{},i=e.shouldUnregister?{}:tr(s),a={action:!1,mount:!1,watch:!1},o={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let l={...f};const d={array:xz(),state:xz()},m=Rm(e.mode),p=Rm(e.reValidateMode),h=e.criteriaMode===Lo.all,y=J=>fe=>{clearTimeout(u),u=setTimeout(J,fe)},g=async J=>{if(!e.disabled&&(f.isValid||l.isValid||J)){const fe=e.resolver?ks((await k()).errors):await O(r,!0);fe!==n.isValid&&d.state.next({isValid:fe})}},v=(J,fe)=>{!e.disabled&&(f.isValidating||f.validatingFields||l.isValidating||l.validatingFields)&&((J||Array.from(o.mount)).forEach(ge=>{ge&&(fe?Qt(n.validatingFields,ge,fe):Ar(n.validatingFields,ge))}),d.state.next({validatingFields:n.validatingFields,isValidating:!ks(n.validatingFields)}))},w=(J,fe=[],ge,Pe,Oe=!0,xe=!0)=>{if(Pe&&ge&&!e.disabled){if(a.action=!0,xe&&Array.isArray($e(r,J))){const Te=ge($e(r,J),Pe.argA,Pe.argB);Oe&&Qt(r,J,Te)}if(xe&&Array.isArray($e(n.errors,J))){const Te=ge($e(n.errors,J),Pe.argA,Pe.argB);Oe&&Qt(n.errors,J,Te),kAe(n.errors,J)}if((f.touchedFields||l.touchedFields)&&xe&&Array.isArray($e(n.touchedFields,J))){const Te=ge($e(n.touchedFields,J),Pe.argA,Pe.argB);Oe&&Qt(n.touchedFields,J,Te)}(f.dirtyFields||l.dirtyFields)&&(n.dirtyFields=ky(s,i)),d.state.next({name:J,isDirty:I(J,fe),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Qt(i,J,fe)},x=(J,fe)=>{Qt(n.errors,J,fe),d.state.next({errors:n.errors})},A=J=>{n.errors=J,d.state.next({errors:n.errors,isValid:!1})},T=(J,fe,ge,Pe)=>{const Oe=$e(r,J);if(Oe){const xe=$e(i,J,Hn(ge)?$e(s,J):ge);Hn(xe)||Pe&&Pe.defaultChecked||fe?Qt(i,J,fe?xe:Az(Oe._f)):Y(J,xe),a.mount&&g()}},R=(J,fe,ge,Pe,Oe)=>{let xe=!1,Te=!1;const Ye={name:J};if(!e.disabled){if(!ge||Pe){(f.isDirty||l.isDirty)&&(Te=n.isDirty,n.isDirty=Ye.isDirty=I(),xe=Te!==Ye.isDirty);const Rt=Ou($e(s,J),fe);Te=!!$e(n.dirtyFields,J),Rt?Ar(n.dirtyFields,J):Qt(n.dirtyFields,J,!0),Ye.dirtyFields=n.dirtyFields,xe=xe||(f.dirtyFields||l.dirtyFields)&&Te!==!Rt}if(ge){const Rt=$e(n.touchedFields,J);Rt||(Qt(n.touchedFields,J,ge),Ye.touchedFields=n.touchedFields,xe=xe||(f.touchedFields||l.touchedFields)&&Rt!==ge)}xe&&Oe&&d.state.next(Ye)}return xe?Ye:{}},E=(J,fe,ge,Pe)=>{const Oe=$e(n.errors,J),xe=(f.isValid||l.isValid)&&to(fe)&&n.isValid!==fe;if(e.delayError&&ge?(c=y(()=>x(J,ge)),c(e.delayError)):(clearTimeout(u),c=null,ge?Qt(n.errors,J,ge):Ar(n.errors,J)),(ge?!Ou(Oe,ge):Oe)||!ks(Pe)||xe){const Te={...Pe,...xe&&to(fe)?{isValid:fe}:{},errors:n.errors,name:J};n={...n,...Te},d.state.next(Te)}},k=async J=>{v(J,!0);const fe=await e.resolver(i,e.context,EAe(J||o.mount,r,e.criteriaMode,e.shouldUseNativeValidation));return v(J),fe},N=async J=>{const{errors:fe}=await k(J);if(J)for(const ge of J){const Pe=$e(fe,ge);Pe?Qt(n.errors,ge,Pe):Ar(n.errors,ge)}else n.errors=fe;return fe},O=async(J,fe,ge={valid:!0})=>{for(const Pe in J){const Oe=J[Pe];if(Oe){const{_f:xe,...Te}=Oe;if(xe){const Ye=o.array.has(xe.name),Rt=Oe._f&&CAe(Oe._f);Rt&&f.validatingFields&&v([Pe],!0);const bt=await dD(Oe,o.disabled,i,h,e.shouldUseNativeValidation&&!fe,Ye);if(Rt&&f.validatingFields&&v([Pe]),bt[xe.name]&&(ge.valid=!1,fe))break;!fe&&($e(bt,xe.name)?Ye?$K(n.errors,bt,xe.name):Qt(n.errors,xe.name,bt[xe.name]):Ar(n.errors,xe.name))}!ks(Te)&&await O(Te,fe,ge)}}return ge.valid},L=()=>{for(const J of o.unMount){const fe=$e(r,J);fe&&(fe._f.refs?fe._f.refs.every(ge=>!FT(ge)):!FT(fe._f.ref))&&Ae(J)}o.unMount=new Set},I=(J,fe)=>!e.disabled&&(J&&fe&&Qt(i,J,fe),!Ou(q(),s)),F=(J,fe,ge)=>TK(J,o,{...a.mount?i:Hn(fe)?s:ml(J)?{[J]:fe}:fe},ge,fe),U=J=>L_($e(a.mount?i:s,J,e.shouldUnregister?$e(s,J,[]):[])),Y=(J,fe,ge={})=>{const Pe=$e(r,J);let Oe=fe;if(Pe){const xe=Pe._f;xe&&(!xe.disabled&&Qt(i,J,LK(fe,xe)),Oe=wC(xe.ref)&&Ys(fe)?"":fe,NK(xe.ref)?[...xe.ref.options].forEach(Te=>Te.selected=Oe.includes(Te.value)):xe.refs?M_(xe.ref)?xe.refs.length>1?xe.refs.forEach(Te=>(!Te.defaultChecked||!Te.disabled)&&(Te.checked=Array.isArray(Oe)?!!Oe.find(Ye=>Ye===Te.value):Oe===Te.value)):xe.refs[0]&&(xe.refs[0].checked=!!Oe):xe.refs.forEach(Te=>Te.checked=Te.value===Oe):ZI(xe.ref)?xe.ref.value="":(xe.ref.value=Oe,xe.ref.type||d.state.next({name:J,values:tr(i)})))}(ge.shouldDirty||ge.shouldTouch)&&R(J,Oe,ge.shouldTouch,ge.shouldDirty,!0),ge.shouldValidate&&X(J)},V=(J,fe,ge)=>{for(const Pe in fe){const Oe=fe[Pe],xe=`${J}.${Pe}`,Te=$e(r,xe);(o.array.has(J)||xr(Oe)||Te&&!Te._f)&&!Ef(Oe)?V(xe,Oe,ge):Y(xe,Oe,ge)}},H=(J,fe,ge={})=>{const Pe=$e(r,J),Oe=o.array.has(J),xe=tr(fe);Qt(i,J,xe),Oe?(d.array.next({name:J,values:tr(i)}),(f.isDirty||f.dirtyFields||l.isDirty||l.dirtyFields)&&ge.shouldDirty&&d.state.next({name:J,dirtyFields:ky(s,i),isDirty:I(J,xe)})):Pe&&!Pe._f&&!Ys(xe)?V(J,xe,ge):Y(J,xe,ge),uD(J,o)&&d.state.next({...n}),d.state.next({name:a.mount?J:void 0,values:tr(i)})},ee=async J=>{a.mount=!0;const fe=J.target;let ge=fe.name,Pe=!0;const Oe=$e(r,ge),xe=Te=>{Pe=Number.isNaN(Te)||Ef(Te)&&isNaN(Te.getTime())||Ou(Te,$e(i,ge,Te))};if(Oe){let Te,Ye;const Rt=fe.type?Az(Oe._f):EK(J),bt=J.type===bC.BLUR||J.type===bC.FOCUS_OUT,$s=!AAe(Oe._f)&&!e.resolver&&!$e(n.errors,ge)&&!Oe._f.deps||TAe(bt,$e(n.touchedFields,ge),n.isSubmitted,p,m),Qn=uD(ge,o,bt);Qt(i,ge,Rt),bt?(Oe._f.onBlur&&Oe._f.onBlur(J),c&&c(0)):Oe._f.onChange&&Oe._f.onChange(J);const ys=R(ge,Rt,bt),Ut=!ks(ys)||Qn;if(!bt&&d.state.next({name:ge,type:J.type,values:tr(i)}),$s)return(f.isValid||l.isValid)&&(e.mode==="onBlur"?bt&&g():bt||g()),Ut&&d.state.next({name:ge,...Qn?{}:ys});if(!bt&&Qn&&d.state.next({...n}),e.resolver){const{errors:on}=await k([ge]);if(xe(Rt),Pe){const vn=Pz(n.errors,r,ge),Ue=Pz(on,r,vn.name||ge);Te=Ue.error,ge=Ue.name,Ye=ks(on)}}else v([ge],!0),Te=(await dD(Oe,o.disabled,i,h,e.shouldUseNativeValidation))[ge],v([ge]),xe(Rt),Pe&&(Te?Ye=!1:(f.isValid||l.isValid)&&(Ye=await O(r,!0)));Pe&&(Oe._f.deps&&X(Oe._f.deps),E(ge,Ye,Te,ys))}},re=(J,fe)=>{if($e(n.errors,fe)&&J.focus)return J.focus(),1},X=async(J,fe={})=>{let ge,Pe;const Oe=xi(J);if(e.resolver){const xe=await N(Hn(J)?J:Oe);ge=ks(xe),Pe=J?!Oe.some(Te=>$e(xe,Te)):ge}else J?(Pe=(await Promise.all(Oe.map(async xe=>{const Te=$e(r,xe);return await O(Te&&Te._f?{[xe]:Te}:Te)}))).every(Boolean),!(!Pe&&!n.isValid)&&g()):Pe=ge=await O(r);return d.state.next({...!ml(J)||(f.isValid||l.isValid)&&ge!==n.isValid?{}:{name:J},...e.resolver||!J?{isValid:ge}:{},errors:n.errors}),fe.shouldFocus&&!Pe&&Wm(r,re,J?Oe:o.mount),Pe},q=J=>{const fe={...a.mount?i:s};return Hn(J)?fe:ml(J)?$e(fe,J):J.map(ge=>$e(fe,ge))},K=(J,fe)=>({invalid:!!$e((fe||n).errors,J),isDirty:!!$e((fe||n).dirtyFields,J),error:$e((fe||n).errors,J),isValidating:!!$e(n.validatingFields,J),isTouched:!!$e((fe||n).touchedFields,J)}),Z=J=>{J&&xi(J).forEach(fe=>Ar(n.errors,fe)),d.state.next({errors:J?n.errors:{}})},ue=(J,fe,ge)=>{const Pe=($e(r,J,{_f:{}})._f||{}).ref,Oe=$e(n.errors,J)||{},{ref:xe,message:Te,type:Ye,...Rt}=Oe;Qt(n.errors,J,{...Rt,...fe,ref:Pe}),d.state.next({name:J,errors:n.errors,isValid:!1}),ge&&ge.shouldFocus&&Pe&&Pe.focus&&Pe.focus()},de=(J,fe)=>_a(J)?d.state.subscribe({next:ge=>J(F(void 0,fe),ge)}):F(J,fe,!0),ie=J=>d.state.subscribe({next:fe=>{PAe(J.name,fe.name,J.exact)&&RAe(fe,J.formState||f,Yt,J.reRenderRoot)&&J.callback({values:{...i},...n,...fe})}}).unsubscribe,be=J=>(a.mount=!0,l={...l,...J.formState},ie({...J,formState:l})),Ae=(J,fe={})=>{for(const ge of J?xi(J):o.mount)o.mount.delete(ge),o.array.delete(ge),fe.keepValue||(Ar(r,ge),Ar(i,ge)),!fe.keepError&&Ar(n.errors,ge),!fe.keepDirty&&Ar(n.dirtyFields,ge),!fe.keepTouched&&Ar(n.touchedFields,ge),!fe.keepIsValidating&&Ar(n.validatingFields,ge),!e.shouldUnregister&&!fe.keepDefaultValue&&Ar(s,ge);d.state.next({values:tr(i)}),d.state.next({...n,...fe.keepDirty?{isDirty:I()}:{}}),!fe.keepIsValid&&g()},_e=({disabled:J,name:fe})=>{(to(J)&&a.mount||J||o.disabled.has(fe))&&(J?o.disabled.add(fe):o.disabled.delete(fe))},Me=(J,fe={})=>{let ge=$e(r,J);const Pe=to(fe.disabled)||to(e.disabled);return Qt(r,J,{...ge||{},_f:{...ge&&ge._f?ge._f:{ref:{name:J}},name:J,mount:!0,...fe}}),o.mount.add(J),ge?_e({disabled:to(fe.disabled)?fe.disabled:e.disabled,name:J}):T(J,!0,fe.value),{...Pe?{disabled:fe.disabled||e.disabled}:{},...e.progressive?{required:!!fe.required,min:Ny(fe.min),max:Ny(fe.max),minLength:Ny(fe.minLength),maxLength:Ny(fe.maxLength),pattern:Ny(fe.pattern)}:{},name:J,onChange:ee,onBlur:ee,ref:Oe=>{if(Oe){Me(J,fe),ge=$e(r,J);const xe=Hn(Oe.value)&&Oe.querySelectorAll&&Oe.querySelectorAll("input,select,textarea")[0]||Oe,Te=_Ae(xe),Ye=ge._f.refs||[];if(Te?Ye.find(Rt=>Rt===xe):xe===ge._f.ref)return;Qt(r,J,{_f:{...ge._f,...Te?{refs:[...Ye.filter(FT),xe,...Array.isArray($e(s,J))?[{}]:[]],ref:{type:xe.type,name:J}}:{ref:xe}}}),T(J,!1,void 0,xe)}else ge=$e(r,J,{}),ge._f&&(ge._f.mount=!1),(e.shouldUnregister||fe.shouldUnregister)&&!(CK(o.array,J)&&a.action)&&o.unMount.add(J)}}},De=()=>e.shouldFocusError&&Wm(r,re,o.mount),ye=J=>{to(J)&&(d.state.next({disabled:J}),Wm(r,(fe,ge)=>{const Pe=$e(r,ge);Pe&&(fe.disabled=Pe._f.disabled||J,Array.isArray(Pe._f.refs)&&Pe._f.refs.forEach(Oe=>{Oe.disabled=Pe._f.disabled||J}))},0,!1))},Fe=(J,fe)=>async ge=>{let Pe;ge&&(ge.preventDefault&&ge.preventDefault(),ge.persist&&ge.persist());let Oe=tr(i);if(d.state.next({isSubmitting:!0}),e.resolver){const{errors:xe,values:Te}=await k();n.errors=xe,Oe=Te}else await O(r);if(o.disabled.size)for(const xe of o.disabled)Qt(Oe,xe,void 0);if(Ar(n.errors,"root"),ks(n.errors)){d.state.next({errors:{}});try{await J(Oe,ge)}catch(xe){Pe=xe}}else fe&&await fe({...n.errors},ge),De(),setTimeout(De);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ks(n.errors)&&!Pe,submitCount:n.submitCount+1,errors:n.errors}),Pe)throw Pe},ut=(J,fe={})=>{$e(r,J)&&(Hn(fe.defaultValue)?H(J,tr($e(s,J))):(H(J,fe.defaultValue),Qt(s,J,tr(fe.defaultValue))),fe.keepTouched||Ar(n.touchedFields,J),fe.keepDirty||(Ar(n.dirtyFields,J),n.isDirty=fe.defaultValue?I(J,tr($e(s,J))):I()),fe.keepError||(Ar(n.errors,J),f.isValid&&g()),d.state.next({...n}))},Qe=(J,fe={})=>{const ge=J?tr(J):s,Pe=tr(ge),Oe=ks(J),xe=Oe?s:Pe;if(fe.keepDefaultValues||(s=ge),!fe.keepValues){if(fe.keepDirtyValues){const Te=new Set([...o.mount,...Object.keys(ky(s,i))]);for(const Ye of Array.from(Te))$e(n.dirtyFields,Ye)?Qt(xe,Ye,$e(i,Ye)):H(Ye,$e(xe,Ye))}else{if(XI&&Hn(J))for(const Te of o.mount){const Ye=$e(r,Te);if(Ye&&Ye._f){const Rt=Array.isArray(Ye._f.refs)?Ye._f.refs[0]:Ye._f.ref;if(wC(Rt)){const bt=Rt.closest("form");if(bt){bt.reset();break}}}}for(const Te of o.mount)H(Te,$e(xe,Te))}i=tr(xe),d.array.next({values:{...xe}}),d.state.next({values:{...xe}})}o={mount:fe.keepDirtyValues?o.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!f.isValid||!!fe.keepIsValid||!!fe.keepDirtyValues,a.watch=!!e.shouldUnregister,d.state.next({submitCount:fe.keepSubmitCount?n.submitCount:0,isDirty:Oe?!1:fe.keepDirty?n.isDirty:!!(fe.keepDefaultValues&&!Ou(J,s)),isSubmitted:fe.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Oe?{}:fe.keepDirtyValues?fe.keepDefaultValues&&i?ky(s,i):n.dirtyFields:fe.keepDefaultValues&&J?ky(s,J):fe.keepDirty?n.dirtyFields:{},touchedFields:fe.keepTouched?n.touchedFields:{},errors:fe.keepErrors?n.errors:{},isSubmitSuccessful:fe.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},vt=(J,fe)=>Qe(_a(J)?J(i):J,fe),An=(J,fe={})=>{const ge=$e(r,J),Pe=ge&&ge._f;if(Pe){const Oe=Pe.refs?Pe.refs[0]:Pe.ref;Oe.focus&&(Oe.focus(),fe.shouldSelect&&_a(Oe.select)&&Oe.select())}},Yt=J=>{n={...n,...J}},Xt={control:{register:Me,unregister:Ae,getFieldState:K,handleSubmit:Fe,setError:ue,_subscribe:ie,_runSchema:k,_getWatch:F,_getDirty:I,_setValid:g,_setFieldArray:w,_setDisabledField:_e,_setErrors:A,_getFieldArray:U,_reset:Qe,_resetDefaultValues:()=>_a(e.defaultValues)&&e.defaultValues().then(J=>{vt(J,e.resetOptions),d.state.next({isLoading:!1})}),_removeUnmounted:L,_disableForm:ye,_subjects:d,_proxyFormState:f,get _fields(){return r},get _formValues(){return i},get _state(){return a},set _state(J){a=J},get _defaultValues(){return s},get _names(){return o},set _names(J){o=J},get _formState(){return n},get _options(){return e},set _options(J){e={...e,...J}}},subscribe:be,trigger:X,register:Me,handleSubmit:Fe,watch:de,setValue:H,getValues:q,reset:vt,resetField:ut,clearErrors:Z,unregister:Ae,setError:ue,setFocus:An,getFieldState:K};return{...Xt,formControl:Xt}}var yu=()=>{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)})},jT=(t,e,n={})=>n.shouldFocus||Hn(n.shouldFocus)?n.focusName||`${t}.${Hn(n.focusIndex)?e:n.focusIndex}.`:"",BT=(t,e)=>[...t,...xi(e)],zT=t=>Array.isArray(t)?t.map(()=>{}):void 0;function UT(t,e,n){return[...t.slice(0,e),...xi(n),...t.slice(e)]}var HT=(t,e,n)=>Array.isArray(t)?(Hn(t[n])&&(t[n]=void 0),t.splice(n,0,t.splice(e,1)[0]),t):[],VT=(t,e)=>[...xi(e),...xi(t)];function OAe(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 WT=(t,e)=>Hn(e)?[]:OAe(t,xi(e).sort((n,r)=>n-r)),GT=(t,e,n)=>{[t[e],t[n]]=[t[n],t[e]]},kz=(t,e,n)=>(t[e]=n,t);function vUe(t){const e=Ia(),{control:n=e.control,name:r,keyName:s="id",shouldUnregister:i,rules:a}=t,[o,c]=se.useState(n._getFieldArray(r)),u=se.useRef(n._getFieldArray(r).map(yu)),f=se.useRef(o),l=se.useRef(r),d=se.useRef(!1);l.current=r,f.current=o,n._names.array.add(r),a&&n.register(r,a),se.useEffect(()=>n._subjects.array.subscribe({next:({values:T,name:R})=>{if(R===l.current||!R){const E=$e(T,l.current);Array.isArray(E)&&(c(E),u.current=E.map(yu))}}}).unsubscribe,[n]);const m=se.useCallback(T=>{d.current=!0,n._setFieldArray(r,T)},[n,r]),p=(T,R)=>{const E=xi(tr(T)),k=BT(n._getFieldArray(r),E);n._names.focus=jT(r,k.length-1,R),u.current=BT(u.current,E.map(yu)),m(k),c(k),n._setFieldArray(r,k,BT,{argA:zT(T)})},h=(T,R)=>{const E=xi(tr(T)),k=VT(n._getFieldArray(r),E);n._names.focus=jT(r,0,R),u.current=VT(u.current,E.map(yu)),m(k),c(k),n._setFieldArray(r,k,VT,{argA:zT(T)})},y=T=>{const R=WT(n._getFieldArray(r),T);u.current=WT(u.current,T),m(R),c(R),!Array.isArray($e(n._fields,r))&&Qt(n._fields,r,void 0),n._setFieldArray(r,R,WT,{argA:T})},g=(T,R,E)=>{const k=xi(tr(R)),N=UT(n._getFieldArray(r),T,k);n._names.focus=jT(r,T,E),u.current=UT(u.current,T,k.map(yu)),m(N),c(N),n._setFieldArray(r,N,UT,{argA:T,argB:zT(R)})},v=(T,R)=>{const E=n._getFieldArray(r);GT(E,T,R),GT(u.current,T,R),m(E),c(E),n._setFieldArray(r,E,GT,{argA:T,argB:R},!1)},w=(T,R)=>{const E=n._getFieldArray(r);HT(E,T,R),HT(u.current,T,R),m(E),c(E),n._setFieldArray(r,E,HT,{argA:T,argB:R},!1)},x=(T,R)=>{const E=tr(R),k=kz(n._getFieldArray(r),T,E);u.current=[...k].map((N,O)=>!N||O===T?yu():u.current[O]),m(k),c([...k]),n._setFieldArray(r,k,kz,{argA:T,argB:E},!0,!1)},A=T=>{const R=xi(tr(T));u.current=R.map(yu),m([...R]),c([...R]),n._setFieldArray(r,[...R],E=>E,{},!0,!1)};return se.useEffect(()=>{if(n._state.action=!1,uD(r,n._names)&&n._subjects.state.next({...n._formState}),d.current&&(!Rm(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!Rm(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([r]).then(T=>{const R=$e(T.errors,r),E=$e(n._formState.errors,r);(E?!R&&E.type||R&&(E.type!==R.type||E.message!==R.message):R&&R.type)&&(R?Qt(n._formState.errors,r,R):Ar(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const T=$e(n._fields,r);T&&T._f&&!(Rm(n._options.reValidateMode).isOnSubmit&&Rm(n._options.mode).isOnSubmit)&&dD(T,n._names.disabled,n._formValues,n._options.criteriaMode===Lo.all,n._options.shouldUseNativeValidation,!0).then(R=>!ks(R)&&n._subjects.state.next({errors:$K(n._formState.errors,R,r)}))}n._subjects.state.next({name:r,values:tr(n._formValues)}),n._names.focus&&Wm(n._fields,(T,R)=>{if(n._names.focus&&R.startsWith(n._names.focus)&&T.focus)return T.focus(),1}),n._names.focus="",n._setValid(),d.current=!1},[o,r,n]),se.useEffect(()=>(!$e(n._formValues,r)&&n._setFieldArray(r),()=>{const T=(R,E)=>{const k=$e(n._fields,R);k&&k._f&&(k._f.mount=E)};n._options.shouldUnregister||i?n.unregister(r):T(r,!1)}),[r,n,s,i]),{swap:se.useCallback(v,[m,r,n]),move:se.useCallback(w,[m,r,n]),prepend:se.useCallback(h,[m,r,n]),append:se.useCallback(p,[m,r,n]),remove:se.useCallback(y,[m,r,n]),insert:se.useCallback(g,[m,r,n]),update:se.useCallback(x,[m,r,n]),replace:se.useCallback(A,[m,r,n]),fields:se.useMemo(()=>o.map((T,R)=>({...T,[s]:u.current[R]||yu()})),[o,s])}}function MAe(t={}){const e=se.useRef(void 0),n=se.useRef(void 0),[r,s]=se.useState({isDirty:!1,isValidating:!1,isLoading:_a(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,defaultValues:_a(t.defaultValues)?void 0:t.defaultValues});e.current||(e.current={...t.formControl?t.formControl:DAe(t),formState:r},t.formControl&&t.defaultValues&&!_a(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions));const i=e.current.control;return i._options=t,se.useLayoutEffect(()=>i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState}),reRenderRoot:!0}),[i]),se.useEffect(()=>i._disableForm(t.disabled),[i,t.disabled]),se.useEffect(()=>{if(i._proxyFormState.isDirty){const a=i._getDirty();a!==r.isDirty&&i._subjects.state.next({isDirty:a})}},[i,r.isDirty]),se.useEffect(()=>{t.values&&!Ou(t.values,n.current)?(i._reset(t.values,i._options.resetOptions),n.current=t.values,s(a=>({...a}))):i._resetDefaultValues()},[t.values,i]),se.useEffect(()=>{t.errors&&!ks(t.errors)&&i._setErrors(t.errors)},[t.errors,i]),se.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),se.useEffect(()=>{t.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[t.shouldUnregister,i]),e.current.formState=PK(r,i),e.current}var LAe="Label",FK=_.forwardRef((t,e)=>P.jsx(Ne.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())}}));FK.displayName=LAe;var jK=FK;const IAe=ri("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),BK=_.forwardRef(({className:t,...e},n)=>P.jsx(jK,{ref:n,className:le(IAe(),t),...e}));BK.displayName=jK.displayName;const $Ae=gAe,zK=_.createContext({}),Fv=({...t})=>P.jsx(zK.Provider,{value:{name:t.name},children:P.jsx(wAe,{...t})}),jv=()=>{const t=_.useContext(zK),e=_.useContext(UK),{getFieldState:n,formState:r}=Ia(),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}},UK=_.createContext({}),yp=_.forwardRef(({className:t,...e},n)=>{const r=_.useId();return P.jsx(UK.Provider,{value:{id:r},children:P.jsx("div",{ref:n,className:le("space-y-2",t),...e})})});yp.displayName="FormItem";const HK=_.forwardRef(({className:t,...e},n)=>{const{error:r,formItemId:s}=jv();return P.jsx(BK,{ref:n,className:le(r&&"text-destructive",t),htmlFor:s,...e})});HK.displayName="FormLabel";const bp=_.forwardRef(({...t},e)=>{const{error:n,formItemId:r,formDescriptionId:s,formMessageId:i}=jv();return P.jsx(Aa,{ref:e,id:r,"aria-describedby":n?`${s} ${i}`:`${s}`,"aria-invalid":!!n,...t})});bp.displayName="FormControl";const wp=_.forwardRef(({className:t,...e},n)=>{const{formDescriptionId:r}=jv();return P.jsx("p",{ref:n,id:r,className:le("text-[0.8rem] text-muted-foreground",t),...e})});wp.displayName="FormDescription";const VK=_.forwardRef(({className:t,children:e,...n},r)=>{const{error:s,formMessageId:i}=jv(),a=s?String((s==null?void 0:s.message)??""):e;return a?P.jsx("p",{ref:r,id:i,className:le("text-[0.8rem] font-medium text-destructive",t),...n,children:a}):null});VK.displayName="FormMessage";var qT,WK="HoverCard",[GK,yUe]=Nn(WK,[Rl]),e$=Rl(),[bUe,t$]=GK(WK),qK="HoverCardTrigger",FAe=_.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,s=t$(qK,n),i=e$(n);return P.jsx($v,{asChild:!0,...i,children:P.jsx(Ne.a,{"data-state":s.open?"open":"closed",...r,ref:e,onPointerEnter:me(t.onPointerEnter,EC(s.onOpen)),onPointerLeave:me(t.onPointerLeave,EC(s.onClose)),onFocus:me(t.onFocus,s.onOpen),onBlur:me(t.onBlur,s.onClose),onTouchStart:me(t.onTouchStart,a=>a.preventDefault())})})});FAe.displayName=qK;var jAe="HoverCardPortal",[wUe,BAe]=GK(jAe,{forceMount:void 0}),SC="HoverCardContent",KK=_.forwardRef((t,e)=>{const n=BAe(SC,t.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=t,i=t$(SC,t.__scopeHoverCard);return P.jsx(Wn,{present:r||i.open,children:P.jsx(zAe,{"data-state":i.open?"open":"closed",...s,onPointerEnter:me(t.onPointerEnter,EC(i.onOpen)),onPointerLeave:me(t.onPointerLeave,EC(i.onClose)),ref:e})})});KK.displayName=SC;var zAe=_.forwardRef((t,e)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,...o}=t,c=t$(SC,n),u=e$(n),f=_.useRef(null),l=tt(e,f),[d,m]=_.useState(!1);return _.useEffect(()=>{if(d){const p=document.body;return qT=p.style.userSelect||p.style.webkitUserSelect,p.style.userSelect="none",p.style.webkitUserSelect="none",()=>{p.style.userSelect=qT,p.style.webkitUserSelect=qT}}},[d]),_.useEffect(()=>{if(f.current){const p=()=>{m(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var y;((y=document.getSelection())==null?void 0:y.toString())!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",p),()=>{document.removeEventListener("pointerup",p),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),_.useEffect(()=>{f.current&&VAe(f.current).forEach(h=>h.setAttribute("tabindex","-1"))}),P.jsx(Jc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:a,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:me(i,p=>{p.preventDefault()}),onDismiss:c.onDismiss,children:P.jsx(A_,{...u,...o,onPointerDown:me(o.onPointerDown,p=>{p.currentTarget.contains(p.target)&&m(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:l,style:{...o.style,userSelect:d?"text":void 0,WebkitUserSelect:d?"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)"}})})}),UAe="HoverCardArrow",HAe=_.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,s=e$(n);return P.jsx(R_,{...s,...r,ref:e})});HAe.displayName=UAe;function EC(t){return e=>e.pointerType==="touch"?void 0:t()}function VAe(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 YK=KK;const WAe=_.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},s)=>P.jsx(YK,{ref:s,align:e,sideOffset:n,className:le("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}));WAe.displayName=YK.displayName;const XK=_.forwardRef(({className:t,type:e,...n},r)=>P.jsx("input",{type:e,className:le("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}));XK.displayName="Input";var SA="Menubar",[fD,GAe,qAe]=Qc(SA),[QK,_Ue]=Nn(SA,[qAe,Pl]),Oi=N_(),ZK=Pl(),[KAe,JK]=QK(SA),e7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,value:r,onValueChange:s,defaultValue:i,loop:a=!0,dir:o,...c}=t,u=Da(o),f=ZK(n),[l="",d]=lr({prop:r,onChange:s,defaultProp:i}),[m,p]=_.useState(null);return P.jsx(KAe,{scope:n,value:l,onMenuOpen:_.useCallback(h=>{d(h),p(h)},[d]),onMenuClose:_.useCallback(()=>d(""),[d]),onMenuToggle:_.useCallback(h=>{d(y=>y?"":h),p(h)},[d]),dir:u,loop:a,children:P.jsx(fD.Provider,{scope:n,children:P.jsx(fD.Slot,{scope:n,children:P.jsx(P_,{asChild:!0,...f,orientation:"horizontal",loop:a,dir:u,currentTabStopId:m,onCurrentTabStopIdChange:p,children:P.jsx(Ne.div,{role:"menubar",...c,ref:e})})})})})});e7.displayName=SA;var YAe="MenubarMenu",[xUe,t7]=QK(YAe),hD="MenubarTrigger",n7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,disabled:r=!1,...s}=t,i=ZK(n),a=Oi(n),o=JK(hD,n),c=t7(hD,n),u=_.useRef(null),f=tt(e,u,c.triggerRef),[l,d]=_.useState(!1),m=o.value===c.value;return P.jsx(fD.ItemSlot,{scope:n,value:c.value,disabled:r,children:P.jsx(T_,{asChild:!0,...i,focusable:!r,tabStopId:c.value,children:P.jsx(TI,{asChild:!0,...a,children:P.jsx(Ne.button,{type:"button",role:"menuitem",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":m,"aria-controls":m?c.contentId:void 0,"data-highlighted":l?"":void 0,"data-state":m?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:f,onPointerDown:me(t.onPointerDown,p=>{!r&&p.button===0&&p.ctrlKey===!1&&(o.onMenuOpen(c.value),m||p.preventDefault())}),onPointerEnter:me(t.onPointerEnter,()=>{var h;!!o.value&&!m&&(o.onMenuOpen(c.value),(h=u.current)==null||h.focus())}),onKeyDown:me(t.onKeyDown,p=>{r||(["Enter"," "].includes(p.key)&&o.onMenuToggle(c.value),p.key==="ArrowDown"&&o.onMenuOpen(c.value),["Enter"," ","ArrowDown"].includes(p.key)&&(c.wasKeyboardTriggerOpenRef.current=!0,p.preventDefault()))}),onFocus:me(t.onFocus,()=>d(!0)),onBlur:me(t.onBlur,()=>d(!1))})})})})});n7.displayName=hD;var XAe="MenubarPortal",r7=t=>{const{__scopeMenubar:e,...n}=t,r=Oi(e);return P.jsx(kI,{...r,...n})};r7.displayName=XAe;var pD="MenubarContent",s7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,align:r="start",...s}=t,i=Oi(n),a=JK(pD,n),o=t7(pD,n),c=GAe(n),u=_.useRef(!1);return P.jsx(NI,{id:o.contentId,"aria-labelledby":o.triggerId,"data-radix-menubar-content":"",...i,...s,ref:e,align:r,onCloseAutoFocus:me(t.onCloseAutoFocus,f=>{var d;!!!a.value&&!u.current&&((d=o.triggerRef.current)==null||d.focus()),u.current=!1,f.preventDefault()}),onFocusOutside:me(t.onFocusOutside,f=>{const l=f.target;c().some(m=>{var p;return(p=m.ref.current)==null?void 0:p.contains(l)})&&f.preventDefault()}),onInteractOutside:me(t.onInteractOutside,()=>{u.current=!0}),onEntryFocus:f=>{o.wasKeyboardTriggerOpenRef.current||f.preventDefault()},onKeyDown:me(t.onKeyDown,f=>{if(["ArrowRight","ArrowLeft"].includes(f.key)){const l=f.target,d=l.hasAttribute("data-radix-menubar-subtrigger"),m=l.closest("[data-radix-menubar-content]")!==f.currentTarget,h=(a.dir==="rtl"?"ArrowRight":"ArrowLeft")===f.key;if(!h&&d||m&&h)return;let v=c().filter(A=>!A.disabled).map(A=>A.value);h&&v.reverse();const w=v.indexOf(o.value);v=a.loop?dRe(v,w+1):v.slice(w+1);const[x]=v;x&&a.onMenuOpen(x)}},{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)"}})});s7.displayName=pD;var QAe="MenubarGroup",ZAe=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Oi(n);return P.jsx(DI,{...s,...r,ref:e})});ZAe.displayName=QAe;var JAe="MenubarLabel",i7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Oi(n);return P.jsx(OI,{...s,...r,ref:e})});i7.displayName=JAe;var eRe="MenubarItem",o7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Oi(n);return P.jsx(MI,{...s,...r,ref:e})});o7.displayName=eRe;var tRe="MenubarCheckboxItem",a7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Oi(n);return P.jsx(LI,{...s,...r,ref:e})});a7.displayName=tRe;var nRe="MenubarRadioGroup",rRe=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Oi(n);return P.jsx(II,{...s,...r,ref:e})});rRe.displayName=nRe;var sRe="MenubarRadioItem",l7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Oi(n);return P.jsx($I,{...s,...r,ref:e})});l7.displayName=sRe;var iRe="MenubarItemIndicator",c7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Oi(n);return P.jsx(FI,{...s,...r,ref:e})});c7.displayName=iRe;var oRe="MenubarSeparator",u7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Oi(n);return P.jsx(jI,{...s,...r,ref:e})});u7.displayName=oRe;var aRe="MenubarArrow",lRe=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Oi(n);return P.jsx(BI,{...s,...r,ref:e})});lRe.displayName=aRe;var cRe="MenubarSubTrigger",d7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Oi(n);return P.jsx(zI,{"data-radix-menubar-subtrigger":"",...s,...r,ref:e})});d7.displayName=cRe;var uRe="MenubarSubContent",f7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Oi(n);return P.jsx(UI,{...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)"}})});f7.displayName=uRe;function dRe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var h7=e7,p7=n7,fRe=r7,m7=s7,g7=i7,v7=o7,y7=a7,b7=l7,w7=c7,_7=u7,x7=d7,S7=f7;const hRe=_.forwardRef(({className:t,...e},n)=>P.jsx(h7,{ref:n,className:le("flex h-10 items-center space-x-1 rounded-md border bg-background p-1",t),...e}));hRe.displayName=h7.displayName;const pRe=_.forwardRef(({className:t,...e},n)=>P.jsx(p7,{ref:n,className:le("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}));pRe.displayName=p7.displayName;const mRe=_.forwardRef(({className:t,inset:e,children:n,...r},s)=>P.jsxs(x7,{ref:s,className:le("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,P.jsx(d_,{className:"ml-auto h-4 w-4"})]}));mRe.displayName=x7.displayName;const gRe=_.forwardRef(({className:t,...e},n)=>P.jsx(S7,{ref:n,className:le("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}));gRe.displayName=S7.displayName;const vRe=_.forwardRef(({className:t,align:e="start",alignOffset:n=-4,sideOffset:r=8,...s},i)=>P.jsx(fRe,{children:P.jsx(m7,{ref:i,align:e,alignOffset:n,sideOffset:r,className:le("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})}));vRe.displayName=m7.displayName;const yRe=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(v7,{ref:r,className:le("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}));yRe.displayName=v7.displayName;const bRe=_.forwardRef(({className:t,children:e,checked:n,...r},s)=>P.jsxs(y7,{ref:s,className:le("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:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(w7,{children:P.jsx(u_,{className:"h-4 w-4"})})}),e]}));bRe.displayName=y7.displayName;const wRe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(b7,{ref:r,className:le("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:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(w7,{children:P.jsx(G1,{className:"h-2 w-2 fill-current"})})}),e]}));wRe.displayName=b7.displayName;const _Re=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(g7,{ref:r,className:le("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));_Re.displayName=g7.displayName;const xRe=_.forwardRef(({className:t,...e},n)=>P.jsx(_7,{ref:n,className:le("-mx-1 my-1 h-px bg-muted",t),...e}));xRe.displayName=_7.displayName;var SRe="VisuallyHidden",I_=_.forwardRef((t,e)=>P.jsx(Ne.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}}));I_.displayName=SRe;var E7=I_,Bv="NavigationMenu",[n$,C7,ERe]=Qc(Bv),[mD,CRe,ARe]=Qc(Bv),[r$,SUe]=Nn(Bv,[ERe,ARe]),[RRe,Wo]=r$(Bv),[PRe,TRe]=r$(Bv),A7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:s,defaultValue:i,delayDuration:a=200,skipDelayDuration:o=300,orientation:c="horizontal",dir:u,...f}=t,[l,d]=_.useState(null),m=tt(e,k=>d(k)),p=Da(u),h=_.useRef(0),y=_.useRef(0),g=_.useRef(0),[v,w]=_.useState(!0),[x="",A]=lr({prop:r,onChange:k=>{const N=k!=="",O=o>0;N?(window.clearTimeout(g.current),O&&w(!1)):(window.clearTimeout(g.current),g.current=window.setTimeout(()=>w(!0),o)),s==null||s(k)},defaultProp:i}),T=_.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>A(""),150)},[A]),R=_.useCallback(k=>{window.clearTimeout(y.current),A(k)},[A]),E=_.useCallback(k=>{x===k?window.clearTimeout(y.current):h.current=window.setTimeout(()=>{window.clearTimeout(y.current),A(k)},a)},[x,A,a]);return _.useEffect(()=>()=>{window.clearTimeout(h.current),window.clearTimeout(y.current),window.clearTimeout(g.current)},[]),P.jsx(P7,{scope:n,isRootMenu:!0,value:x,dir:p,orientation:c,rootNavigationMenu:l,onTriggerEnter:k=>{window.clearTimeout(h.current),v?E(k):R(k)},onTriggerLeave:()=>{window.clearTimeout(h.current),T()},onContentEnter:()=>window.clearTimeout(y.current),onContentLeave:T,onItemSelect:k=>{A(N=>N===k?"":k)},onItemDismiss:()=>A(""),children:P.jsx(Ne.nav,{"aria-label":"Main","data-orientation":c,dir:p,...f,ref:m})})});A7.displayName=Bv;var R7="NavigationMenuSub",kRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:s,defaultValue:i,orientation:a="horizontal",...o}=t,c=Wo(R7,n),[u="",f]=lr({prop:r,onChange:s,defaultProp:i});return P.jsx(P7,{scope:n,isRootMenu:!1,value:u,dir:c.dir,orientation:a,rootNavigationMenu:c.rootNavigationMenu,onTriggerEnter:l=>f(l),onItemSelect:l=>f(l),onItemDismiss:()=>f(""),children:P.jsx(Ne.div,{"data-orientation":a,...o,ref:e})})});kRe.displayName=R7;var P7=t=>{const{scope:e,isRootMenu:n,rootNavigationMenu:r,dir:s,orientation:i,children:a,value:o,onItemSelect:c,onItemDismiss:u,onTriggerEnter:f,onTriggerLeave:l,onContentEnter:d,onContentLeave:m}=t,[p,h]=_.useState(null),[y,g]=_.useState(new Map),[v,w]=_.useState(null);return P.jsx(RRe,{scope:e,isRootMenu:n,rootNavigationMenu:r,value:o,previousValue:Mv(o),baseId:qr(),dir:s,orientation:i,viewport:p,onViewportChange:h,indicatorTrack:v,onIndicatorTrackChange:w,onTriggerEnter:zt(f),onTriggerLeave:zt(l),onContentEnter:zt(d),onContentLeave:zt(m),onItemSelect:zt(c),onItemDismiss:zt(u),onViewportContentChange:_.useCallback((x,A)=>{g(T=>(T.set(x,A),new Map(T)))},[]),onViewportContentRemove:_.useCallback(x=>{g(A=>A.has(x)?(A.delete(x),new Map(A)):A)},[]),children:P.jsx(n$.Provider,{scope:e,children:P.jsx(PRe,{scope:e,items:y,children:a})})})},T7="NavigationMenuList",k7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=Wo(T7,n),i=P.jsx(Ne.ul,{"data-orientation":s.orientation,...r,ref:e});return P.jsx(Ne.div,{style:{position:"relative"},ref:s.onIndicatorTrackChange,children:P.jsx(n$.Slot,{scope:n,children:s.isRootMenu?P.jsx(F7,{asChild:!0,children:i}):i})})});k7.displayName=T7;var N7="NavigationMenuItem",[NRe,D7]=r$(N7),DRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,...s}=t,i=qr(),a=r||i||"LEGACY_REACT_AUTO_VALUE",o=_.useRef(null),c=_.useRef(null),u=_.useRef(null),f=_.useRef(()=>{}),l=_.useRef(!1),d=_.useCallback((p="start")=>{if(o.current){f.current();const h=vD(o.current);h.length&&o$(p==="start"?h:h.reverse())}},[]),m=_.useCallback(()=>{if(o.current){const p=vD(o.current);p.length&&(f.current=BRe(p))}},[]);return P.jsx(NRe,{scope:n,value:a,triggerRef:c,contentRef:o,focusProxyRef:u,wasEscapeCloseRef:l,onEntryKeyDown:d,onFocusProxyEnter:d,onRootContentClose:m,onContentFocusOutside:m,children:P.jsx(Ne.li,{...s,ref:e})})});DRe.displayName=N7;var gD="NavigationMenuTrigger",O7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,disabled:r,...s}=t,i=Wo(gD,t.__scopeNavigationMenu),a=D7(gD,t.__scopeNavigationMenu),o=_.useRef(null),c=tt(o,a.triggerRef,e),u=B7(i.baseId,a.value),f=z7(i.baseId,a.value),l=_.useRef(!1),d=_.useRef(!1),m=a.value===i.value;return P.jsxs(P.Fragment,{children:[P.jsx(n$.ItemSlot,{scope:n,value:a.value,children:P.jsx(j7,{asChild:!0,children:P.jsx(Ne.button,{id:u,disabled:r,"data-disabled":r?"":void 0,"data-state":a$(m),"aria-expanded":m,"aria-controls":f,...s,ref:c,onPointerEnter:me(t.onPointerEnter,()=>{d.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:me(t.onPointerMove,CC(()=>{r||d.current||a.wasEscapeCloseRef.current||l.current||(i.onTriggerEnter(a.value),l.current=!0)})),onPointerLeave:me(t.onPointerLeave,CC(()=>{r||(i.onTriggerLeave(),l.current=!1)})),onClick:me(t.onClick,()=>{i.onItemSelect(a.value),d.current=m}),onKeyDown:me(t.onKeyDown,p=>{const y={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];m&&p.key===y&&(a.onEntryKeyDown(),p.preventDefault())})})})}),m&&P.jsxs(P.Fragment,{children:[P.jsx(E7,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:p=>{const h=a.contentRef.current,y=p.relatedTarget,g=y===o.current,v=h==null?void 0:h.contains(y);(g||!v)&&a.onFocusProxyEnter(g?"start":"end")}}),i.viewport&&P.jsx("span",{"aria-owns":f})]})]})});O7.displayName=gD;var ORe="NavigationMenuLink",Nz="navigationMenu.linkSelect",MRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,active:r,onSelect:s,...i}=t;return P.jsx(j7,{asChild:!0,children:P.jsx(Ne.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...i,ref:e,onClick:me(t.onClick,a=>{const o=a.target,c=new CustomEvent(Nz,{bubbles:!0,cancelable:!0});if(o.addEventListener(Nz,u=>s==null?void 0:s(u),{once:!0}),Jb(o,c),!c.defaultPrevented&&!a.metaKey){const u=new CustomEvent(QS,{bubbles:!0,cancelable:!0});Jb(o,u)}},{checkForDefaultPrevented:!1})})})});MRe.displayName=ORe;var s$="NavigationMenuIndicator",M7=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Wo(s$,t.__scopeNavigationMenu),i=!!s.value;return s.indicatorTrack?l_.createPortal(P.jsx(Wn,{present:n||i,children:P.jsx(LRe,{...r,ref:e})}),s.indicatorTrack):null});M7.displayName=s$;var LRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=Wo(s$,n),i=C7(n),[a,o]=_.useState(null),[c,u]=_.useState(null),f=s.orientation==="horizontal",l=!!s.value;_.useEffect(()=>{var h;const p=(h=i().find(y=>y.value===s.value))==null?void 0:h.ref.current;p&&o(p)},[i,s.value]);const d=()=>{a&&u({size:f?a.offsetWidth:a.offsetHeight,offset:f?a.offsetLeft:a.offsetTop})};return yD(a,d),yD(s.indicatorTrack,d),c?P.jsx(Ne.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}),mv="NavigationMenuContent",L7=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Wo(mv,t.__scopeNavigationMenu),i=D7(mv,t.__scopeNavigationMenu),a=tt(i.contentRef,e),o=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?P.jsx(IRe,{forceMount:n,...c,ref:a}):P.jsx(Wn,{present:n||o,children:P.jsx(I7,{"data-state":a$(o),...c,ref:a,onPointerEnter:me(t.onPointerEnter,s.onContentEnter),onPointerLeave:me(t.onPointerLeave,CC(s.onContentLeave)),style:{pointerEvents:!o&&s.isRootMenu?"none":void 0,...c.style}})})});L7.displayName=mv;var IRe=_.forwardRef((t,e)=>{const n=Wo(mv,t.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:s}=n;return $n(()=>{r(t.value,{ref:e,...t})},[t,e,r]),$n(()=>()=>s(t.value),[t.value,s]),null}),QS="navigationMenu.rootContentDismiss",I7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:s,focusProxyRef:i,wasEscapeCloseRef:a,onRootContentClose:o,onContentFocusOutside:c,...u}=t,f=Wo(mv,n),l=_.useRef(null),d=tt(l,e),m=B7(f.baseId,r),p=z7(f.baseId,r),h=C7(n),y=_.useRef(null),{onItemDismiss:g}=f;_.useEffect(()=>{const w=l.current;if(f.isRootMenu&&w){const x=()=>{var A;g(),o(),w.contains(document.activeElement)&&((A=s.current)==null||A.focus())};return w.addEventListener(QS,x),()=>w.removeEventListener(QS,x)}},[f.isRootMenu,t.value,s,g,o]);const v=_.useMemo(()=>{const x=h().map(N=>N.value);f.dir==="rtl"&&x.reverse();const A=x.indexOf(f.value),T=x.indexOf(f.previousValue),R=r===f.value,E=T===x.indexOf(r);if(!R&&!E)return y.current;const k=(()=>{if(A!==T){if(R&&T!==-1)return A>T?"from-end":"from-start";if(E&&A!==-1)return A>T?"to-start":"to-end"}return null})();return y.current=k,k},[f.previousValue,f.value,f.dir,h,r]);return P.jsx(F7,{asChild:!0,children:P.jsx(Jc,{id:p,"aria-labelledby":m,"data-motion":v,"data-orientation":f.orientation,...u,ref:d,disableOutsidePointerEvents:!1,onDismiss:()=>{var x;const w=new Event(QS,{bubbles:!0,cancelable:!0});(x=l.current)==null||x.dispatchEvent(w)},onFocusOutside:me(t.onFocusOutside,w=>{var A;c();const x=w.target;(A=f.rootNavigationMenu)!=null&&A.contains(x)&&w.preventDefault()}),onPointerDownOutside:me(t.onPointerDownOutside,w=>{var R;const x=w.target,A=h().some(E=>{var k;return(k=E.ref.current)==null?void 0:k.contains(x)}),T=f.isRootMenu&&((R=f.viewport)==null?void 0:R.contains(x));(A||T||!f.isRootMenu)&&w.preventDefault()}),onKeyDown:me(t.onKeyDown,w=>{var T;const x=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!x){const R=vD(w.currentTarget),E=document.activeElement,k=R.findIndex(L=>L===E),O=w.shiftKey?R.slice(0,k).reverse():R.slice(k+1,R.length);o$(O)?w.preventDefault():(T=i.current)==null||T.focus()}}),onEscapeKeyDown:me(t.onEscapeKeyDown,w=>{a.current=!0})})})}),i$="NavigationMenuViewport",$7=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=!!Wo(i$,t.__scopeNavigationMenu).value;return P.jsx(Wn,{present:n||i,children:P.jsx($Re,{...r,ref:e})})});$7.displayName=i$;var $Re=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,children:r,...s}=t,i=Wo(i$,n),a=tt(e,i.onViewportChange),o=TRe(mv,t.__scopeNavigationMenu),[c,u]=_.useState(null),[f,l]=_.useState(null),d=c?(c==null?void 0:c.width)+"px":void 0,m=c?(c==null?void 0:c.height)+"px":void 0,p=!!i.value,h=p?i.value:i.previousValue;return yD(f,()=>{f&&u({width:f.offsetWidth,height:f.offsetHeight})}),P.jsx(Ne.div,{"data-state":a$(p),"data-orientation":i.orientation,...s,ref:a,style:{pointerEvents:!p&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":d,"--radix-navigation-menu-viewport-height":m,...s.style},onPointerEnter:me(t.onPointerEnter,i.onContentEnter),onPointerLeave:me(t.onPointerLeave,CC(i.onContentLeave)),children:Array.from(o.items).map(([g,{ref:v,forceMount:w,...x}])=>{const A=h===g;return P.jsx(Wn,{present:w||A,children:P.jsx(I7,{...x,ref:c_(v,T=>{A&&T&&l(T)})})},g)})})}),FRe="FocusGroup",F7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=Wo(FRe,n);return P.jsx(mD.Provider,{scope:n,children:P.jsx(mD.Slot,{scope:n,children:P.jsx(Ne.div,{dir:s.dir,...r,ref:e})})})}),Dz=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],jRe="FocusGroupItem",j7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=CRe(n),i=Wo(jRe,n);return P.jsx(mD.ItemSlot,{scope:n,children:P.jsx(Ne.button,{...r,ref:e,onKeyDown:me(t.onKeyDown,a=>{if(["Home","End",...Dz].includes(a.key)){let c=s().map(l=>l.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&c.reverse(),Dz.includes(a.key)){const l=c.indexOf(a.currentTarget);c=c.slice(l+1)}setTimeout(()=>o$(c)),a.preventDefault()}})})})});function vD(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 o$(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}function BRe(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 yD(t,e){const n=zt(e);$n(()=>{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 a$(t){return t?"open":"closed"}function B7(t,e){return`${t}-trigger-${e}`}function z7(t,e){return`${t}-content-${e}`}function CC(t){return e=>e.pointerType==="mouse"?t(e):void 0}var U7=A7,H7=k7,V7=O7,W7=M7,G7=L7,q7=$7;const zRe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(U7,{ref:r,className:le("relative z-10 flex max-w-max flex-1 items-center justify-center",t),...n,children:[e,P.jsx(K7,{})]}));zRe.displayName=U7.displayName;const URe=_.forwardRef(({className:t,...e},n)=>P.jsx(H7,{ref:n,className:le("group flex flex-1 list-none items-center justify-center space-x-1",t),...e}));URe.displayName=H7.displayName;const HRe=ri("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"),VRe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(V7,{ref:r,className:le(HRe(),"group",t),...n,children:[e," ",P.jsx(W1,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));VRe.displayName=V7.displayName;const WRe=_.forwardRef(({className:t,...e},n)=>P.jsx(G7,{ref:n,className:le("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}));WRe.displayName=G7.displayName;const K7=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{className:le("absolute left-0 top-full flex justify-center"),children:P.jsx(q7,{className:le("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})}));K7.displayName=q7.displayName;const GRe=_.forwardRef(({className:t,...e},n)=>P.jsx(W7,{ref:n,className:le("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:P.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));GRe.displayName=W7.displayName;var qRe=typeof window>"u",bD=qRe?se.useEffect:se.useLayoutEffect,KRe=0,Oz=()=>++KRe,Mz=!1;function YRe(){let[t,e]=se.useState(Mz?Oz:void 0);return bD(()=>{t===void 0&&e(Oz()),Mz=!0},[]),t===void 0?t:`rwb-${t.toString(32)}`}function XRe(){return se.useMemo(()=>"useId"in se?se.useId:YRe,[])()}var wD="__wrap_b",Eb="__wrap_n",Lz="__wrap_o",Y7=(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,a=r.clientHeight,o=i/2-.25,c=i+.5,u;if(i){for(s(o),o=Math.max(n.scrollWidth,o);o+1{self.__wrap_b(0,+n.dataset.brr,n)})).observe(r)},QRe=Y7.toString(),ZRe='(self.CSS&&CSS.supports("text-wrap","balance")?1:2)',JRe=(t,e,n="")=>(n&&(n=`self.${Eb}!=1&&${n}`),se.createElement("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:(t?"":`self.${Eb}=self.${Eb}||${ZRe};self.${wD}=${QRe};`)+n},nonce:e})),ePe=se.createContext({preferNative:!0,hasProvider:!1});se.forwardRef(({ratio:t=1,preferNative:e,nonce:n,children:r,as:s,...i},a)=>{let o=XRe(),c=se.useRef(),u=se.useContext(ePe),f=e??u.preferNative,l=s||"span";return se.useImperativeHandle(a,()=>c.current,[]),bD(()=>{f&&self[Eb]===1||c.current&&(self[wD]=Y7)(0,t,c.current)},[r,f,t]),bD(()=>{if(!(f&&self[Eb]===1))return()=>{if(!c.current)return;let d=c.current[Lz];d&&(d.disconnect(),delete c.current[Lz])}},[f]),se.createElement(se.Fragment,null,se.createElement(l,{...i,"data-br":o,"data-brr":t,ref:c,style:{display:"inline-block",verticalAlign:"top",textDecoration:"inherit",textWrap:f?"balance":"initial"},suppressHydrationWarning:!0},r),JRe(u.hasProvider,n,`self.${wD}("${o}",${t})`))});var tPe="Separator",Iz="horizontal",nPe=["horizontal","vertical"],X7=_.forwardRef((t,e)=>{const{decorative:n,orientation:r=Iz,...s}=t,i=rPe(r)?r:Iz,o=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return P.jsx(Ne.div,{"data-orientation":i,...o,...s,ref:e})});X7.displayName=tPe;function rPe(t){return nPe.includes(t)}var Q7=X7;const sPe=_.forwardRef(({className:t,orientation:e="horizontal",decorative:n=!0,...r},s)=>P.jsx(Q7,{ref:s,decorative:n,orientation:e,className:le("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));sPe.displayName=Q7.displayName;const iPe=_.forwardRef(({className:t,...e},n)=>P.jsx("ul",{ref:n,className:le("flex flex-row items-center gap-1",t),...e}));iPe.displayName="PaginationContent";const oPe=_.forwardRef(({className:t,...e},n)=>P.jsx("li",{ref:n,className:le("",t),...e}));oPe.displayName="PaginationItem";var l$="Popover",[Z7,EUe]=Nn(l$,[Rl]),$_=Rl(),[aPe,jd]=Z7(l$),J7=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!1}=t,o=$_(e),c=_.useRef(null),[u,f]=_.useState(!1),[l=!1,d]=lr({prop:r,defaultProp:s,onChange:i});return P.jsx(vA,{...o,children:P.jsx(aPe,{scope:e,contentId:qr(),triggerRef:c,open:l,onOpenChange:d,onOpenToggle:_.useCallback(()=>d(m=>!m),[d]),hasCustomAnchor:u,onCustomAnchorAdd:_.useCallback(()=>f(!0),[]),onCustomAnchorRemove:_.useCallback(()=>f(!1),[]),modal:a,children:n})})};J7.displayName=l$;var e9="PopoverAnchor",lPe=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=jd(e9,n),i=$_(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:o}=s;return _.useEffect(()=>(a(),()=>o()),[a,o]),P.jsx($v,{...i,...r,ref:e})});lPe.displayName=e9;var t9="PopoverTrigger",n9=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=jd(t9,n),i=$_(n),a=tt(e,s.triggerRef),o=P.jsx(Ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":a9(s.open),...r,ref:a,onClick:me(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?o:P.jsx($v,{asChild:!0,...i,children:o})});n9.displayName=t9;var c$="PopoverPortal",[cPe,uPe]=Z7(c$,{forceMount:void 0}),r9=t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=jd(c$,e);return P.jsx(cPe,{scope:e,forceMount:n,children:P.jsx(Wn,{present:n||i.open,children:P.jsx(Pv,{asChild:!0,container:s,children:r})})})};r9.displayName=c$;var gv="PopoverContent",s9=_.forwardRef((t,e)=>{const n=uPe(gv,t.__scopePopover),{forceMount:r=n.forceMount,...s}=t,i=jd(gv,t.__scopePopover);return P.jsx(Wn,{present:r||i.open,children:i.modal?P.jsx(dPe,{...s,ref:e}):P.jsx(fPe,{...s,ref:e})})});s9.displayName=gv;var dPe=_.forwardRef((t,e)=>{const n=jd(gv,t.__scopePopover),r=_.useRef(null),s=tt(e,r),i=_.useRef(!1);return _.useEffect(()=>{const a=r.current;if(a)return Tv(a)},[]),P.jsx(h_,{as:Aa,allowPinchZoom:!0,children:P.jsx(i9,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:me(t.onCloseAutoFocus,a=>{var o;a.preventDefault(),i.current||(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:me(t.onPointerDownOutside,a=>{const o=a.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0,u=o.button===2||c;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:me(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),fPe=_.forwardRef((t,e)=>{const n=jd(gv,t.__scopePopover),r=_.useRef(!1),s=_.useRef(!1);return P.jsx(i9,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,o;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),i9=_.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:f,...l}=t,d=jd(gv,n),m=$_(n);return q1(),P.jsx(f_,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:P.jsx(Jc,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>d.onOpenChange(!1),children:P.jsx(A_,{"data-state":a9(d.open),role:"dialog",id:d.contentId,...m,...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)"}})})})}),o9="PopoverClose",hPe=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=jd(o9,n);return P.jsx(Ne.button,{type:"button",...r,ref:e,onClick:me(t.onClick,()=>s.onOpenChange(!1))})});hPe.displayName=o9;var pPe="PopoverArrow",mPe=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=$_(n);return P.jsx(R_,{...s,...r,ref:e})});mPe.displayName=pPe;function a9(t){return t?"open":"closed"}var gPe=J7,vPe=n9,yPe=r9,l9=s9;const bPe=gPe,wPe=vPe,c9=_.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},s)=>P.jsx(yPe,{children:P.jsx(l9,{ref:s,align:e,sideOffset:n,className:le("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})}));c9.displayName=l9.displayName;var u$="Progress",d$=100,[_Pe,CUe]=Nn(u$),[xPe,SPe]=_Pe(u$),u9=_.forwardRef((t,e)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:i=EPe,...a}=t;(s||s===0)&&!$z(s)&&console.error(CPe(`${s}`,"Progress"));const o=$z(s)?s:d$;r!==null&&!Fz(r,o)&&console.error(APe(`${r}`,"Progress"));const c=Fz(r,o)?r:null,u=AC(c)?i(c,o):void 0;return P.jsx(xPe,{scope:n,value:c,max:o,children:P.jsx(Ne.div,{"aria-valuemax":o,"aria-valuemin":0,"aria-valuenow":AC(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":h9(c,o),"data-value":c??void 0,"data-max":o,...a,ref:e})})});u9.displayName=u$;var d9="ProgressIndicator",f9=_.forwardRef((t,e)=>{const{__scopeProgress:n,...r}=t,s=SPe(d9,n);return P.jsx(Ne.div,{"data-state":h9(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:e})});f9.displayName=d9;function EPe(t,e){return`${Math.round(t/e*100)}%`}function h9(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function AC(t){return typeof t=="number"}function $z(t){return AC(t)&&!isNaN(t)&&t>0}function Fz(t,e){return AC(t)&&!isNaN(t)&&t<=e&&t>=0}function CPe(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${d$}\`.`}function APe(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 ${d$} if no \`max\` prop is set) - \`null\` or \`undefined\` if the progress is indeterminate. -Defaulting to \`null\`.`}var p9=u9,RPe=f9;const PPe=_.forwardRef(({className:t,value:e,...n},r)=>P.jsx(p9,{ref:r,className:le("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...n,children:P.jsx(RPe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));PPe.displayName=p9.displayName;var f$="Radio",[TPe,m9]=Nn(f$),[kPe,NPe]=TPe(f$),g9=_.forwardRef((t,e)=>{const{__scopeRadio:n,name:r,checked:s=!1,required:i,disabled:a,value:o="on",onCheck:c,...u}=t,[f,l]=_.useState(null),d=tt(e,h=>l(h)),m=_.useRef(!1),p=f?!!f.closest("form"):!0;return P.jsxs(kPe,{scope:n,checked:s,disabled:a,children:[P.jsx(Ne.button,{type:"button",role:"radio","aria-checked":s,"data-state":b9(s),"data-disabled":a?"":void 0,disabled:a,value:o,...u,ref:d,onClick:me(t.onClick,h=>{s||c==null||c(),p&&(m.current=h.isPropagationStopped(),m.current||h.stopPropagation())})}),p&&P.jsx(DPe,{control:f,bubbles:!m.current,name:r,value:o,checked:s,required:i,disabled:a,style:{transform:"translateX(-100%)"}})]})});g9.displayName=f$;var v9="RadioIndicator",y9=_.forwardRef((t,e)=>{const{__scopeRadio:n,forceMount:r,...s}=t,i=NPe(v9,n);return P.jsx(Wn,{present:r||i.checked,children:P.jsx(Ne.span,{"data-state":b9(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:e})})});y9.displayName=v9;var DPe=t=>{const{control:e,checked:n,bubbles:r=!0,...s}=t,i=_.useRef(null),a=Mv(n),o=S_(e);return _.useEffect(()=>{const c=i.current,u=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(u,"checked").set;if(a!==n&&l){const d=new Event("click",{bubbles:r});l.call(c,n),c.dispatchEvent(d)}},[a,n,r]),P.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:i,style:{...t.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function b9(t){return t?"checked":"unchecked"}var OPe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],h$="RadioGroup",[MPe,RUe]=Nn(h$,[Pl,m9]),w9=Pl(),_9=m9(),[LPe,IPe]=MPe(h$),x9=_.forwardRef((t,e)=>{const{__scopeRadioGroup:n,name:r,defaultValue:s,value:i,required:a=!1,disabled:o=!1,orientation:c,dir:u,loop:f=!0,onValueChange:l,...d}=t,m=w9(n),p=Da(u),[h,y]=lr({prop:i,defaultProp:s,onChange:l});return P.jsx(LPe,{scope:n,name:r,required:a,disabled:o,value:h,onValueChange:y,children:P.jsx(P_,{asChild:!0,...m,orientation:c,dir:p,loop:f,children:P.jsx(Ne.div,{role:"radiogroup","aria-required":a,"aria-orientation":c,"data-disabled":o?"":void 0,dir:p,...d,ref:e})})})});x9.displayName=h$;var S9="RadioGroupItem",E9=_.forwardRef((t,e)=>{const{__scopeRadioGroup:n,disabled:r,...s}=t,i=IPe(S9,n),a=i.disabled||r,o=w9(n),c=_9(n),u=_.useRef(null),f=tt(e,u),l=i.value===s.value,d=_.useRef(!1);return _.useEffect(()=>{const m=h=>{OPe.includes(h.key)&&(d.current=!0)},p=()=>d.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",p),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",p)}},[]),P.jsx(T_,{asChild:!0,...o,focusable:!a,active:l,children:P.jsx(g9,{disabled:a,required:i.required,checked:l,...c,...s,name:i.name,ref:f,onCheck:()=>i.onValueChange(s.value),onKeyDown:me(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:me(s.onFocus,()=>{var m;d.current&&((m=u.current)==null||m.click())})})})});E9.displayName=S9;var $Pe="RadioGroupIndicator",C9=_.forwardRef((t,e)=>{const{__scopeRadioGroup:n,...r}=t,s=_9(n);return P.jsx(y9,{...s,...r,ref:e})});C9.displayName=$Pe;var A9=x9,R9=E9,FPe=C9;const jPe=_.forwardRef(({className:t,...e},n)=>P.jsx(A9,{className:le("grid gap-2",t),...e,ref:n}));jPe.displayName=A9.displayName;const BPe=_.forwardRef(({className:t,...e},n)=>P.jsx(R9,{ref:n,className:le("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:P.jsx(FPe,{className:"flex items-center justify-center",children:P.jsx(G1,{className:"h-2.5 w-2.5 fill-current text-current"})})}));BPe.displayName=R9.displayName;const{createElement:vv,createContext:zPe,forwardRef:P9,useCallback:di,useContext:T9,useEffect:Mh,useImperativeHandle:k9,useLayoutEffect:UPe,useMemo:HPe,useRef:yi,useState:Gm}=r_,jz=r_[`useId${Math.random()}`.slice(0,5)],VPe=UPe,EA=zPe(null);EA.displayName="PanelGroupContext";const Lh=VPe,WPe=typeof jz=="function"?jz:()=>null;let GPe=0;function p$(t=null){const e=WPe(),n=yi(t||e||null);return n.current===null&&(n.current=""+GPe++),t??n.current}function N9({children:t,className:e="",collapsedSize:n,collapsible:r,defaultSize:s,forwardedRef:i,id:a,maxSize:o,minSize:c,onCollapse:u,onExpand:f,onResize:l,order:d,style:m,tagName:p="div",...h}){const y=T9(EA);if(y===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:g,expandPanel:v,getPanelSize:w,getPanelStyle:x,groupId:A,isPanelCollapsed:T,reevaluatePanelConstraints:R,registerPanel:E,resizePanel:k,unregisterPanel:N}=y,O=p$(a),L=yi({callbacks:{onCollapse:u,onExpand:f,onResize:l},constraints:{collapsedSize:n,collapsible:r,defaultSize:s,maxSize:o,minSize:c},id:O,idIsFromProps:a!==void 0,order:d});yi({didLogMissingDefaultSizeWarning:!1}),Lh(()=>{const{callbacks:F,constraints:U}=L.current,Y={...U};L.current.id=O,L.current.idIsFromProps=a!==void 0,L.current.order=d,F.onCollapse=u,F.onExpand=f,F.onResize=l,U.collapsedSize=n,U.collapsible=r,U.defaultSize=s,U.maxSize=o,U.minSize=c,(Y.collapsedSize!==U.collapsedSize||Y.collapsible!==U.collapsible||Y.maxSize!==U.maxSize||Y.minSize!==U.minSize)&&R(L.current,Y)}),Lh(()=>{const F=L.current;return E(F),()=>{N(F)}},[d,O,E,N]),k9(i,()=>({collapse:()=>{g(L.current)},expand:F=>{v(L.current,F)},getId(){return O},getSize(){return w(L.current)},isCollapsed(){return T(L.current)},isExpanded(){return!T(L.current)},resize:F=>{k(L.current,F)}}),[g,v,w,T,O,k]);const I=x(L.current,s);return vv(p,{...h,children:t,className:e,id:a,style:{...I,...m},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":A,"data-panel-id":O,"data-panel-size":parseFloat(""+I.flexGrow).toFixed(1)})}const qPe=P9((t,e)=>vv(N9,{...t,forwardedRef:e}));N9.displayName="Panel";qPe.displayName="forwardRef(Panel)";let _D=null,Cf=null;function KPe(t,e){if(e){const n=(e&I9)!==0,r=(e&$9)!==0,s=(e&F9)!==0,i=(e&j9)!==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 YPe(){Cf!==null&&(document.head.removeChild(Cf),_D=null,Cf=null)}function KT(t,e){const n=KPe(t,e);_D!==n&&(_D=n,Cf===null&&(Cf=document.createElement("style"),document.head.appendChild(Cf)),Cf.innerHTML=`*{cursor: ${n}!important;}`)}function D9(t){return t.type==="keydown"}function O9(t){return t.type.startsWith("pointer")}function M9(t){return t.type.startsWith("mouse")}function CA(t){if(O9(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(M9(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function XPe(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function QPe(t,e,n){return t.xe.x&&t.ye.y}function ZPe(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:Uz(t),b:Uz(e)};let r;for(;n.a.at(-1)===n.b.at(-1);)t=n.a.pop(),e=n.b.pop(),r=t;Pt(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:zz(Bz(n.a)),b:zz(Bz(n.b))};if(s.a===s.b){const i=r.childNodes,a={a:n.a.at(-1),b:n.b.at(-1)};let o=i.length;for(;o--;){const c=i[o];if(c===a.a)return 1;if(c===a.b)return-1}}return Math.sign(s.a-s.b)}const JPe=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function eTe(t){var e;const n=getComputedStyle((e=L9(t))!==null&&e!==void 0?e:t).display;return n==="flex"||n==="inline-flex"}function tTe(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||eTe(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"||JPe.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function Bz(t){let e=t.length;for(;e--;){const n=t[e];if(Pt(n,"Missing node"),tTe(n))return n}return null}function zz(t){return t&&Number(getComputedStyle(t).zIndex)||0}function Uz(t){const e=[];for(;t;)e.push(t),t=L9(t);return e}function L9(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const I9=1,$9=2,F9=4,j9=8,nTe=XPe()==="coarse";let Ea=[],a0=!1,Mu=new Map,AA=new Map;const l0=new Set;function rTe(t,e,n,r,s){var i;const{ownerDocument:a}=e,o={direction:n,element:e,hitAreaMargins:r,setResizeHandlerState:s},c=(i=Mu.get(a))!==null&&i!==void 0?i:0;return Mu.set(a,c+1),l0.add(o),RC(),function(){var f;AA.delete(t),l0.delete(o);const l=(f=Mu.get(a))!==null&&f!==void 0?f:1;if(Mu.set(a,l-1),RC(),l===1&&Mu.delete(a),Ea.includes(o)){const d=Ea.indexOf(o);d>=0&&Ea.splice(d,1),g$()}}}function Hz(t){const{target:e}=t,{x:n,y:r}=CA(t);a0=!0,m$({target:e,x:n,y:r}),RC(),Ea.length>0&&(PC("down",t),t.preventDefault(),t.stopPropagation())}function Dy(t){const{x:e,y:n}=CA(t);if(t.buttons===0&&(a0=!1,PC("up",t)),!a0){const{target:r}=t;m$({target:r,x:e,y:n})}PC("move",t),g$(),Ea.length>0&&t.preventDefault()}function Xp(t){const{target:e}=t,{x:n,y:r}=CA(t);AA.clear(),a0=!1,Ea.length>0&&t.preventDefault(),PC("up",t),m$({target:e,x:n,y:r}),g$(),RC()}function m$({target:t,x:e,y:n}){Ea.splice(0);let r=null;t instanceof HTMLElement&&(r=t),l0.forEach(s=>{const{element:i,hitAreaMargins:a}=s,o=i.getBoundingClientRect(),{bottom:c,left:u,right:f,top:l}=o,d=nTe?a.coarse:a.fine;if(e>=u-d&&e<=f+d&&n>=l-d&&n<=c+d){if(r!==null&&i!==r&&!i.contains(r)&&!r.contains(i)&&ZPe(r,i)>0){let p=r,h=!1;for(;p&&!p.contains(i);){if(QPe(p.getBoundingClientRect(),o)){h=!0;break}p=p.parentElement}if(h)return}Ea.push(s)}})}function YT(t,e){AA.set(t,e)}function g$(){let t=!1,e=!1;Ea.forEach(r=>{const{direction:s}=r;s==="horizontal"?t=!0:e=!0});let n=0;AA.forEach(r=>{n|=r}),t&&e?KT("intersection",n):t?KT("horizontal",n):e?KT("vertical",n):YPe()}function RC(){Mu.forEach((t,e)=>{const{body:n}=e;n.removeEventListener("contextmenu",Xp),n.removeEventListener("pointerdown",Hz),n.removeEventListener("pointerleave",Dy),n.removeEventListener("pointermove",Dy)}),window.removeEventListener("pointerup",Xp),window.removeEventListener("pointercancel",Xp),l0.size>0&&(a0?(Ea.length>0&&Mu.forEach((t,e)=>{const{body:n}=e;t>0&&(n.addEventListener("contextmenu",Xp),n.addEventListener("pointerleave",Dy),n.addEventListener("pointermove",Dy))}),window.addEventListener("pointerup",Xp),window.addEventListener("pointercancel",Xp)):Mu.forEach((t,e)=>{const{body:n}=e;t>0&&(n.addEventListener("pointerdown",Hz,{capture:!0}),n.addEventListener("pointermove",Dy))}))}function PC(t,e){l0.forEach(n=>{const{setResizeHandlerState:r}=n,s=Ea.includes(n);r(t,s,e)})}function sTe(){const[t,e]=Gm(0);return di(()=>e(n=>n+1),[])}function Pt(t,e){if(!t)throw console.error(e),Error(e)}const v$=10;function Zh(t,e,n=v$){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function Tc(t,e,n=v$){return Zh(t,e,n)===0}function eo(t,e,n){return Zh(t,e,n)===0}function iTe(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?o:c,d=n[l];Pt(d,`No panel constraints found for index ${l}`);const{collapsedSize:m=0,collapsible:p,minSize:h=0}=d;if(p){const y=e[l];if(Pt(y!=null,`Previous layout not found for panel index ${l}`),eo(y,h)){const g=y-m;Zh(g,Math.abs(t))>0&&(t=t<0?0-g:g)}}}}{const l=t<0?1:-1;let d=t<0?c:o,m=0;for(;;){const h=e[d];Pt(h!=null,`Previous layout not found for panel index ${d}`);const g=Pm({panelConstraints:n,panelIndex:d,size:100})-h;if(m+=g,d+=l,d<0||d>=n.length)break}const p=Math.min(Math.abs(t),Math.abs(m));t=t<0?0-p:p}{let d=t<0?o:c;for(;d>=0&&d=0))break;t<0?d--:d++}}if(iTe(s,a))return s;{const l=t<0?c:o,d=e[l];Pt(d!=null,`Previous layout not found for panel index ${l}`);const m=d+u,p=Pm({panelConstraints:n,panelIndex:l,size:m});if(a[l]=p,!eo(p,m)){let h=m-p,g=t<0?c:o;for(;g>=0&&g0?g--:g++}}}const f=a.reduce((l,d)=>d+l,0);return eo(f,100)?a:s}function oTe({layout:t,panelsArray:e,pivotIndices:n}){let r=0,s=100,i=0,a=0;const o=n[0];Pt(o!=null,"No pivot index found"),e.forEach((l,d)=>{const{constraints:m}=l,{maxSize:p=100,minSize:h=0}=m;d===o?(r=h,s=p):(i+=h,a+=p)});const c=Math.min(s,100-i),u=Math.max(r,100-a),f=t[o];return{valueMax:c,valueMin:u,valueNow:f}}function c0(t,e=document){return Array.from(e.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${t}"]`))}function B9(t,e,n=document){const s=c0(t,n).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===e);return s??null}function z9(t,e,n){const r=B9(t,e,n);return r!=null?[r,r+1]:[-1,-1]}function U9(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 RA(t,e=document){const n=e.querySelector(`[data-panel-resize-handle-id="${t}"]`);return n||null}function aTe(t,e,n,r=document){var s,i,a,o;const c=RA(e,r),u=c0(t,r),f=c?u.indexOf(c):-1,l=(s=(i=n[f])===null||i===void 0?void 0:i.id)!==null&&s!==void 0?s:null,d=(a=(o=n[f+1])===null||o===void 0?void 0:o.id)!==null&&a!==void 0?a:null;return[l,d]}function lTe({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:r,panelDataArray:s,panelGroupElement:i,setLayout:a}){yi({didWarnAboutMissingResizeHandle:!1}),Lh(()=>{if(!i)return;const o=c0(n,i);for(let c=0;c{o.forEach((c,u)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[n,r,s,i]),Mh(()=>{if(!i)return;const o=e.current;Pt(o,"Eager values not found");const{panelDataArray:c}=o,u=U9(n,i);Pt(u!=null,`No group found for id "${n}"`);const f=c0(n,i);Pt(f,`No resize handles found for group id "${n}"`);const l=f.map(d=>{const m=d.getAttribute("data-panel-resize-handle-id");Pt(m,"Resize handle element has no handle id attribute");const[p,h]=aTe(n,m,c,i);if(p==null||h==null)return()=>{};const y=g=>{if(!g.defaultPrevented)switch(g.key){case"Enter":{g.preventDefault();const v=c.findIndex(w=>w.id===p);if(v>=0){const w=c[v];Pt(w,`No panel data found for index ${v}`);const x=r[v],{collapsedSize:A=0,collapsible:T,minSize:R=0}=w.constraints;if(x!=null&&T){const E=Ky({delta:eo(x,A)?R-A:A-x,initialLayout:r,panelConstraints:c.map(k=>k.constraints),pivotIndices:z9(n,m,i),prevLayout:r,trigger:"keyboard"});r!==E&&a(E)}}break}}};return d.addEventListener("keydown",y),()=>{d.removeEventListener("keydown",y)}});return()=>{l.forEach(d=>d())}},[i,t,e,n,r,s,a])}function Vz(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];Pt(i,`Panel data not found for index ${s}`);const{callbacks:a,constraints:o,id:c}=i,{collapsedSize:u=0,collapsible:f}=o,l=n[c];if(l==null||r!==l){n[c]=r;const{onCollapse:d,onExpand:m,onResize:p}=a;p&&p(r,l),f&&(d||m)&&(m&&(l==null||Tc(l,u))&&!Tc(r,u)&&m(),d&&(l==null||!Tc(l,u))&&Tc(r,u)&&d())}})}function _S(t,e){if(t.length!==e.length)return!1;for(let n=0;n{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...s)},e)}}function Wz(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 V9(t){return`react-resizable-panels:${t}`}function W9(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 G9(t,e){try{const n=V9(t),r=e.getItem(n);if(r){const s=JSON.parse(r);if(typeof s=="object"&&s!=null)return s}}catch{}return null}function pTe(t,e,n){var r,s;const i=(r=G9(t,n))!==null&&r!==void 0?r:{},a=W9(e);return(s=i[a])!==null&&s!==void 0?s:null}function mTe(t,e,n,r,s){var i;const a=V9(t),o=W9(e),c=(i=G9(t,s))!==null&&i!==void 0?i:{};c[o]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{s.setItem(a,JSON.stringify(c))}catch(u){console.error(u)}}function Gz({layout:t,panelConstraints:e}){const n=[...t],r=n.reduce((i,a)=>i+a,0);if(n.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!eo(r,100))for(let i=0;i(Wz(Yy),Yy.getItem(t)),setItem:(t,e)=>{Wz(Yy),Yy.setItem(t,e)}},qz={};function q9({autoSaveId:t=null,children:e,className:n="",direction:r,forwardedRef:s,id:i=null,onLayout:a=null,keyboardResizeBy:o=null,storage:c=Yy,style:u,tagName:f="div",...l}){const d=p$(i),m=yi(null),[p,h]=Gm(null),[y,g]=Gm([]),v=sTe(),w=yi({}),x=yi(new Map),A=yi(0),T=yi({autoSaveId:t,direction:r,dragState:p,id:d,keyboardResizeBy:o,onLayout:a,storage:c}),R=yi({layout:y,panelDataArray:[],panelDataArrayChanged:!1});yi({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),k9(s,()=>({getId:()=>T.current.id,getLayout:()=>{const{layout:K}=R.current;return K},setLayout:K=>{const{onLayout:Z}=T.current,{layout:ue,panelDataArray:de}=R.current,ie=Gz({layout:K,panelConstraints:de.map(be=>be.constraints)});Vz(ue,ie)||(g(ie),R.current.layout=ie,Z&&Z(ie),Qp(de,ie,w.current))}}),[]),Lh(()=>{T.current.autoSaveId=t,T.current.direction=r,T.current.dragState=p,T.current.id=d,T.current.onLayout=a,T.current.storage=c}),lTe({committedValuesRef:T,eagerValuesRef:R,groupId:d,layout:y,panelDataArray:R.current.panelDataArray,setLayout:g,panelGroupElement:m.current}),Mh(()=>{const{panelDataArray:K}=R.current;if(t){if(y.length===0||y.length!==K.length)return;let Z=qz[t];Z==null&&(Z=hTe(mTe,gTe),qz[t]=Z);const ue=[...K],de=new Map(x.current);Z(t,ue,de,y,c)}},[t,y,c]),Mh(()=>{});const E=di(K=>{const{onLayout:Z}=T.current,{layout:ue,panelDataArray:de}=R.current;if(K.constraints.collapsible){const ie=de.map(Me=>Me.constraints),{collapsedSize:be=0,panelSize:Ae,pivotIndices:_e}=af(de,K,ue);if(Pt(Ae!=null,`Panel size not found for panel "${K.id}"`),!Tc(Ae,be)){x.current.set(K.id,Ae);const De=am(de,K)===de.length-1?Ae-be:be-Ae,ye=Ky({delta:De,initialLayout:ue,panelConstraints:ie,pivotIndices:_e,prevLayout:ue,trigger:"imperative-api"});_S(ue,ye)||(g(ye),R.current.layout=ye,Z&&Z(ye),Qp(de,ye,w.current))}}},[]),k=di((K,Z)=>{const{onLayout:ue}=T.current,{layout:de,panelDataArray:ie}=R.current;if(K.constraints.collapsible){const be=ie.map(Fe=>Fe.constraints),{collapsedSize:Ae=0,panelSize:_e=0,minSize:Me=0,pivotIndices:De}=af(ie,K,de),ye=Z??Me;if(Tc(_e,Ae)){const Fe=x.current.get(K.id),ut=Fe!=null&&Fe>=ye?Fe:ye,vt=am(ie,K)===ie.length-1?_e-ut:ut-_e,An=Ky({delta:vt,initialLayout:de,panelConstraints:be,pivotIndices:De,prevLayout:de,trigger:"imperative-api"});_S(de,An)||(g(An),R.current.layout=An,ue&&ue(An),Qp(ie,An,w.current))}}},[]),N=di(K=>{const{layout:Z,panelDataArray:ue}=R.current,{panelSize:de}=af(ue,K,Z);return Pt(de!=null,`Panel size not found for panel "${K.id}"`),de},[]),O=di((K,Z)=>{const{panelDataArray:ue}=R.current,de=am(ue,K);return fTe({defaultSize:Z,dragState:p,layout:y,panelData:ue,panelIndex:de})},[p,y]),L=di(K=>{const{layout:Z,panelDataArray:ue}=R.current,{collapsedSize:de=0,collapsible:ie,panelSize:be}=af(ue,K,Z);return Pt(be!=null,`Panel size not found for panel "${K.id}"`),ie===!0&&Tc(be,de)},[]),I=di(K=>{const{layout:Z,panelDataArray:ue}=R.current,{collapsedSize:de=0,collapsible:ie,panelSize:be}=af(ue,K,Z);return Pt(be!=null,`Panel size not found for panel "${K.id}"`),!ie||Zh(be,de)>0},[]),F=di(K=>{const{panelDataArray:Z}=R.current;Z.push(K),Z.sort((ue,de)=>{const ie=ue.order,be=de.order;return ie==null&&be==null?0:ie==null?-1:be==null?1:ie-be}),R.current.panelDataArrayChanged=!0,v()},[v]);Lh(()=>{if(R.current.panelDataArrayChanged){R.current.panelDataArrayChanged=!1;const{autoSaveId:K,onLayout:Z,storage:ue}=T.current,{layout:de,panelDataArray:ie}=R.current;let be=null;if(K){const _e=pTe(K,ie,ue);_e&&(x.current=new Map(Object.entries(_e.expandToSizes)),be=_e.layout)}be==null&&(be=dTe({panelDataArray:ie}));const Ae=Gz({layout:be,panelConstraints:ie.map(_e=>_e.constraints)});Vz(de,Ae)||(g(Ae),R.current.layout=Ae,Z&&Z(Ae),Qp(ie,Ae,w.current))}}),Lh(()=>{const K=R.current;return()=>{K.layout=[]}},[]);const U=di(K=>function(ue){ue.preventDefault();const de=m.current;if(!de)return()=>null;const{direction:ie,dragState:be,id:Ae,keyboardResizeBy:_e,onLayout:Me}=T.current,{layout:De,panelDataArray:ye}=R.current,{initialLayout:Fe}=be??{},ut=z9(Ae,K,de);let Qe=uTe(ue,K,ie,be,_e,de);const vt=ie==="horizontal";document.dir==="rtl"&&vt&&(Qe=-Qe);const An=ye.map(Xt=>Xt.constraints),Yt=Ky({delta:Qe,initialLayout:Fe??De,panelConstraints:An,pivotIndices:ut,prevLayout:De,trigger:D9(ue)?"keyboard":"mouse-or-touch"}),gn=!_S(De,Yt);(O9(ue)||M9(ue))&&A.current!=Qe&&(A.current=Qe,gn?YT(K,0):vt?YT(K,Qe<0?I9:$9):YT(K,Qe<0?F9:j9)),gn&&(g(Yt),R.current.layout=Yt,Me&&Me(Yt),Qp(ye,Yt,w.current))},[]),Y=di((K,Z)=>{const{onLayout:ue}=T.current,{layout:de,panelDataArray:ie}=R.current,be=ie.map(Fe=>Fe.constraints),{panelSize:Ae,pivotIndices:_e}=af(ie,K,de);Pt(Ae!=null,`Panel size not found for panel "${K.id}"`);const De=am(ie,K)===ie.length-1?Ae-Z:Z-Ae,ye=Ky({delta:De,initialLayout:de,panelConstraints:be,pivotIndices:_e,prevLayout:de,trigger:"imperative-api"});_S(de,ye)||(g(ye),R.current.layout=ye,ue&&ue(ye),Qp(ie,ye,w.current))},[]),V=di((K,Z)=>{const{layout:ue,panelDataArray:de}=R.current,{collapsedSize:ie=0,collapsible:be}=Z,{collapsedSize:Ae=0,collapsible:_e,maxSize:Me=100,minSize:De=0}=K.constraints,{panelSize:ye}=af(de,K,ue);ye!=null&&(be&&_e&&Tc(ye,ie)?Tc(ie,Ae)||Y(K,Ae):yeMe&&Y(K,Me))},[Y]),H=di((K,Z)=>{const{direction:ue}=T.current,{layout:de}=R.current;if(!m.current)return;const ie=RA(K,m.current);Pt(ie,`Drag handle element not found for id "${K}"`);const be=H9(ue,Z);h({dragHandleId:K,dragHandleRect:ie.getBoundingClientRect(),initialCursorPosition:be,initialLayout:de})},[]),ee=di(()=>{h(null)},[]),re=di(K=>{const{panelDataArray:Z}=R.current,ue=am(Z,K);ue>=0&&(Z.splice(ue,1),delete w.current[K.id],R.current.panelDataArrayChanged=!0,v())},[v]),X=HPe(()=>({collapsePanel:E,direction:r,dragState:p,expandPanel:k,getPanelSize:N,getPanelStyle:O,groupId:d,isPanelCollapsed:L,isPanelExpanded:I,reevaluatePanelConstraints:V,registerPanel:F,registerResizeHandle:U,resizePanel:Y,startDragging:H,stopDragging:ee,unregisterPanel:re,panelGroupElement:m.current}),[E,p,r,k,N,O,d,L,I,V,F,U,Y,H,ee,re]),q={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return vv(EA.Provider,{value:X},vv(f,{...l,children:e,className:n,id:i,ref:m,style:{...q,...u},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":d}))}const vTe=P9((t,e)=>vv(q9,{...t,forwardedRef:e}));q9.displayName="PanelGroup";vTe.displayName="forwardRef(PanelGroup)";function am(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function af(t,e,n){const r=am(t,e),i=r===t.length-1?[r-1,r]:[r,r+1],a=n[r];return{...e.constraints,panelSize:a,pivotIndices:i}}function yTe({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:r}){Mh(()=>{if(t||n==null||r==null)return;const s=RA(e,r);if(s==null)return;const i=a=>{if(!a.defaultPrevented)switch(a.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{a.preventDefault(),n(a);break}case"F6":{a.preventDefault();const o=s.getAttribute("data-panel-group-id");Pt(o,`No group element found for id "${o}"`);const c=c0(o,r),u=B9(o,e,r);Pt(u!==null,`No resize element found for id "${e}"`);const f=a.shiftKey?u>0?u-1:c.length-1:u+1{s.removeEventListener("keydown",i)}},[r,t,e,n])}function bTe({children:t=null,className:e="",disabled:n=!1,hitAreaMargins:r,id:s,onBlur:i,onDragging:a,onFocus:o,style:c={},tabIndex:u=0,tagName:f="div",...l}){var d,m;const p=yi(null),h=yi({onDragging:a});Mh(()=>{h.current.onDragging=a});const y=T9(EA);if(y===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:g,groupId:v,registerResizeHandle:w,startDragging:x,stopDragging:A,panelGroupElement:T}=y,R=p$(s),[E,k]=Gm("inactive"),[N,O]=Gm(!1),[L,I]=Gm(null),F=yi({state:E});Lh(()=>{F.current.state=E}),Mh(()=>{if(n)I(null);else{const H=w(R);I(()=>H)}},[n,R,w]);const U=(d=r==null?void 0:r.coarse)!==null&&d!==void 0?d:15,Y=(m=r==null?void 0:r.fine)!==null&&m!==void 0?m:5;return Mh(()=>{if(n||L==null)return;const H=p.current;return Pt(H,"Element ref not attached"),rTe(R,H,g,{coarse:U,fine:Y},(re,X,q)=>{if(X)switch(re){case"down":{k("drag"),x(R,q);const{onDragging:K}=h.current;K&&K(!0);break}case"move":{const{state:K}=F.current;K!=="drag"&&k("hover"),L(q);break}case"up":{k("hover"),A();const{onDragging:K}=h.current;K&&K(!1);break}}else k("inactive")})},[U,g,n,Y,w,R,L,x,A]),yTe({disabled:n,handleId:R,resizeHandler:L,panelGroupElement:T}),vv(f,{...l,children:t,className:e,id:s,onBlur:()=>{O(!1),i==null||i()},onFocus:()=>{O(!0),o==null||o()},ref:p,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...c},tabIndex:u,"data-panel-group-direction":g,"data-panel-group-id":v,"data-resize-handle":"","data-resize-handle-active":E==="drag"?"pointer":N?"keyboard":void 0,"data-resize-handle-state":E,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":R})}bTe.displayName="PanelResizeHandle";function u0(t,[e,n]){return Math.min(n,Math.max(e,t))}function wTe(t,e){return _.useReducer((n,r)=>e[n][r]??n,t)}var y$="ScrollArea",[K9,PUe]=Nn(y$),[_Te,Go]=K9(y$),Y9=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:i=600,...a}=t,[o,c]=_.useState(null),[u,f]=_.useState(null),[l,d]=_.useState(null),[m,p]=_.useState(null),[h,y]=_.useState(null),[g,v]=_.useState(0),[w,x]=_.useState(0),[A,T]=_.useState(!1),[R,E]=_.useState(!1),k=tt(e,O=>c(O)),N=Da(s);return P.jsx(_Te,{scope:n,type:r,dir:N,scrollHideDelay:i,scrollArea:o,viewport:u,onViewportChange:f,content:l,onContentChange:d,scrollbarX:m,onScrollbarXChange:p,scrollbarXEnabled:A,onScrollbarXEnabledChange:T,scrollbarY:h,onScrollbarYChange:y,scrollbarYEnabled:R,onScrollbarYEnabledChange:E,onCornerWidthChange:v,onCornerHeightChange:x,children:P.jsx(Ne.div,{dir:N,...a,ref:k,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":w+"px",...t.style}})})});Y9.displayName=y$;var X9="ScrollAreaViewport",Q9=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,nonce:s,...i}=t,a=Go(X9,n),o=_.useRef(null),c=tt(e,o,a.onViewportChange);return P.jsxs(P.Fragment,{children:[P.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}),P.jsx(Ne.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...t.style},children:P.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Q9.displayName=X9;var kl="ScrollAreaScrollbar",b$=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Go(kl,t.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=s,o=t.orientation==="horizontal";return _.useEffect(()=>(o?i(!0):a(!0),()=>{o?i(!1):a(!1)}),[o,i,a]),s.type==="hover"?P.jsx(xTe,{...r,ref:e,forceMount:n}):s.type==="scroll"?P.jsx(STe,{...r,ref:e,forceMount:n}):s.type==="auto"?P.jsx(Z9,{...r,ref:e,forceMount:n}):s.type==="always"?P.jsx(w$,{...r,ref:e}):null});b$.displayName=kl;var xTe=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Go(kl,t.__scopeScrollArea),[i,a]=_.useState(!1);return _.useEffect(()=>{const o=s.scrollArea;let c=0;if(o){const u=()=>{window.clearTimeout(c),a(!0)},f=()=>{c=window.setTimeout(()=>a(!1),s.scrollHideDelay)};return o.addEventListener("pointerenter",u),o.addEventListener("pointerleave",f),()=>{window.clearTimeout(c),o.removeEventListener("pointerenter",u),o.removeEventListener("pointerleave",f)}}},[s.scrollArea,s.scrollHideDelay]),P.jsx(Wn,{present:n||i,children:P.jsx(Z9,{"data-state":i?"visible":"hidden",...r,ref:e})})}),STe=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Go(kl,t.__scopeScrollArea),i=t.orientation==="horizontal",a=TA(()=>c("SCROLL_END"),100),[o,c]=wTe("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return _.useEffect(()=>{if(o==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[o,s.scrollHideDelay,c]),_.useEffect(()=>{const u=s.viewport,f=i?"scrollLeft":"scrollTop";if(u){let l=u[f];const d=()=>{const m=u[f];l!==m&&(c("SCROLL"),a()),l=m};return u.addEventListener("scroll",d),()=>u.removeEventListener("scroll",d)}},[s.viewport,i,c,a]),P.jsx(Wn,{present:n||o!=="hidden",children:P.jsx(w$,{"data-state":o==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:me(t.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:me(t.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Z9=_.forwardRef((t,e)=>{const n=Go(kl,t.__scopeScrollArea),{forceMount:r,...s}=t,[i,a]=_.useState(!1),o=t.orientation==="horizontal",c=TA(()=>{if(n.viewport){const u=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=t,s=Go(kl,t.__scopeScrollArea),i=_.useRef(null),a=_.useRef(0),[o,c]=_.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=rY(o.viewport,o.content),f={...r,sizes:o,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:d=>i.current=d,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:d=>a.current=d};function l(d,m){return TTe(d,a.current,o,m)}return n==="horizontal"?P.jsx(ETe,{...f,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const d=s.viewport.scrollLeft,m=Kz(d,o,s.dir);i.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:d=>{s.viewport&&(s.viewport.scrollLeft=d)},onDragScroll:d=>{s.viewport&&(s.viewport.scrollLeft=l(d,s.dir))}}):n==="vertical"?P.jsx(CTe,{...f,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const d=s.viewport.scrollTop,m=Kz(d,o);i.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:d=>{s.viewport&&(s.viewport.scrollTop=d)},onDragScroll:d=>{s.viewport&&(s.viewport.scrollTop=l(d))}}):null}),ETe=_.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=Go(kl,t.__scopeScrollArea),[a,o]=_.useState(),c=_.useRef(null),u=tt(e,c,i.onScrollbarXChange);return _.useEffect(()=>{c.current&&o(getComputedStyle(c.current))},[c]),P.jsx(eY,{"data-orientation":"horizontal",...s,ref:u,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":PA(n)+"px",...t.style},onThumbPointerDown:f=>t.onThumbPointerDown(f.x),onDragScroll:f=>t.onDragScroll(f.x),onWheelScroll:(f,l)=>{if(i.viewport){const d=i.viewport.scrollLeft+f.deltaX;t.onWheelScroll(d),iY(d,l)&&f.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:kC(a.paddingLeft),paddingEnd:kC(a.paddingRight)}})}})}),CTe=_.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=Go(kl,t.__scopeScrollArea),[a,o]=_.useState(),c=_.useRef(null),u=tt(e,c,i.onScrollbarYChange);return _.useEffect(()=>{c.current&&o(getComputedStyle(c.current))},[c]),P.jsx(eY,{"data-orientation":"vertical",...s,ref:u,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":PA(n)+"px",...t.style},onThumbPointerDown:f=>t.onThumbPointerDown(f.y),onDragScroll:f=>t.onDragScroll(f.y),onWheelScroll:(f,l)=>{if(i.viewport){const d=i.viewport.scrollTop+f.deltaY;t.onWheelScroll(d),iY(d,l)&&f.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:kC(a.paddingTop),paddingEnd:kC(a.paddingBottom)}})}})}),[ATe,J9]=K9(kl),eY=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:o,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:f,onResize:l,...d}=t,m=Go(kl,n),[p,h]=_.useState(null),y=tt(e,k=>h(k)),g=_.useRef(null),v=_.useRef(""),w=m.viewport,x=r.content-r.viewport,A=zt(f),T=zt(c),R=TA(l,10);function E(k){if(g.current){const N=k.clientX-g.current.left,O=k.clientY-g.current.top;u({x:N,y:O})}}return _.useEffect(()=>{const k=N=>{const O=N.target;(p==null?void 0:p.contains(O))&&A(N,x)};return document.addEventListener("wheel",k,{passive:!1}),()=>document.removeEventListener("wheel",k,{passive:!1})},[w,p,x,A]),_.useEffect(T,[r,T]),yv(p,R),yv(m.content,R),P.jsx(ATe,{scope:n,scrollbar:p,hasThumb:s,onThumbChange:zt(i),onThumbPointerUp:zt(a),onThumbPositionChange:T,onThumbPointerDown:zt(o),children:P.jsx(Ne.div,{...d,ref:y,style:{position:"absolute",...d.style},onPointerDown:me(t.onPointerDown,k=>{k.button===0&&(k.target.setPointerCapture(k.pointerId),g.current=p.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),E(k))}),onPointerMove:me(t.onPointerMove,E),onPointerUp:me(t.onPointerUp,k=>{const N=k.target;N.hasPointerCapture(k.pointerId)&&N.releasePointerCapture(k.pointerId),document.body.style.webkitUserSelect=v.current,m.viewport&&(m.viewport.style.scrollBehavior=""),g.current=null})})})}),TC="ScrollAreaThumb",tY=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=J9(TC,t.__scopeScrollArea);return P.jsx(Wn,{present:n||s.hasThumb,children:P.jsx(RTe,{ref:e,...r})})}),RTe=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...s}=t,i=Go(TC,n),a=J9(TC,n),{onThumbPositionChange:o}=a,c=tt(e,l=>a.onThumbChange(l)),u=_.useRef(),f=TA(()=>{u.current&&(u.current(),u.current=void 0)},100);return _.useEffect(()=>{const l=i.viewport;if(l){const d=()=>{if(f(),!u.current){const m=kTe(l,o);u.current=m,o()}};return o(),l.addEventListener("scroll",d),()=>l.removeEventListener("scroll",d)}},[i.viewport,f,o]),P.jsx(Ne.div,{"data-state":a.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:me(t.onPointerDownCapture,l=>{const m=l.target.getBoundingClientRect(),p=l.clientX-m.left,h=l.clientY-m.top;a.onThumbPointerDown({x:p,y:h})}),onPointerUp:me(t.onPointerUp,a.onThumbPointerUp)})});tY.displayName=TC;var _$="ScrollAreaCorner",nY=_.forwardRef((t,e)=>{const n=Go(_$,t.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?P.jsx(PTe,{...t,ref:e}):null});nY.displayName=_$;var PTe=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,...r}=t,s=Go(_$,n),[i,a]=_.useState(0),[o,c]=_.useState(0),u=!!(i&&o);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),a(f)}),u?P.jsx(Ne.div,{...r,ref:e,style:{width:i,height:o,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function kC(t){return t?parseInt(t,10):0}function rY(t,e){const n=t/e;return isNaN(n)?0:n}function PA(t){const e=rY(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function TTe(t,e,n,r="ltr"){const s=PA(n),i=s/2,a=e||i,o=s-a,c=n.scrollbar.paddingStart+a,u=n.scrollbar.size-n.scrollbar.paddingEnd-o,f=n.content-n.viewport,l=r==="ltr"?[0,f]:[f*-1,0];return sY([c,u],l)(t)}function Kz(t,e,n="ltr"){const r=PA(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=e.scrollbar.size-s,a=e.content-e.viewport,o=i-r,c=n==="ltr"?[0,a]:[a*-1,0],u=u0(t,c);return sY([0,a],[0,o])(u)}function sY(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 iY(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},a=n.left!==i.left,o=n.top!==i.top;(a||o)&&e(),n=i,r=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(r)};function TA(t,e){const n=zt(t),r=_.useRef(0);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),_.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function yv(t,e){const n=zt(e);$n(()=>{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 oY=Y9,NTe=Q9,DTe=nY;const OTe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(oY,{ref:r,className:le("relative overflow-hidden",t),...n,children:[P.jsx(NTe,{className:"h-full w-full rounded-[inherit]",children:e}),P.jsx(aY,{}),P.jsx(DTe,{})]}));OTe.displayName=oY.displayName;const aY=_.forwardRef(({className:t,orientation:e="vertical",...n},r)=>P.jsx(b$,{ref:r,orientation:e,className:le("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:P.jsx(tY,{className:"relative flex-1 rounded-full bg-border"})}));aY.displayName=b$.displayName;var MTe=[" ","Enter","ArrowUp","ArrowDown"],LTe=[" ","Enter"],F_="Select",[kA,NA,ITe]=Qc(F_),[zv,TUe]=Nn(F_,[ITe,Rl]),DA=Rl(),[$Te,Bd]=zv(F_),[FTe,jTe]=zv(F_),lY=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:s,onOpenChange:i,value:a,defaultValue:o,onValueChange:c,dir:u,name:f,autoComplete:l,disabled:d,required:m}=t,p=DA(e),[h,y]=_.useState(null),[g,v]=_.useState(null),[w,x]=_.useState(!1),A=Da(u),[T=!1,R]=lr({prop:r,defaultProp:s,onChange:i}),[E,k]=lr({prop:a,defaultProp:o,onChange:c}),N=_.useRef(null),O=h?!!h.closest("form"):!0,[L,I]=_.useState(new Set),F=Array.from(L).map(U=>U.props.value).join(";");return P.jsx(vA,{...p,children:P.jsxs($Te,{required:m,scope:e,trigger:h,onTriggerChange:y,valueNode:g,onValueNodeChange:v,valueNodeHasChildren:w,onValueNodeHasChildrenChange:x,contentId:qr(),value:E,onValueChange:k,open:T,onOpenChange:R,dir:A,triggerPointerDownPosRef:N,disabled:d,children:[P.jsx(kA.Provider,{scope:e,children:P.jsx(FTe,{scope:t.__scopeSelect,onNativeOptionAdd:_.useCallback(U=>{I(Y=>new Set(Y).add(U))},[]),onNativeOptionRemove:_.useCallback(U=>{I(Y=>{const V=new Set(Y);return V.delete(U),V})},[]),children:n})}),O?P.jsxs(OY,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:l,value:E,onChange:U=>k(U.target.value),disabled:d,children:[E===void 0?P.jsx("option",{value:""}):null,Array.from(L)]},F):null]})})};lY.displayName=F_;var cY="SelectTrigger",uY=_.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...s}=t,i=DA(n),a=Bd(cY,n),o=a.disabled||r,c=tt(e,a.onTriggerChange),u=NA(n),[f,l,d]=MY(p=>{const h=u().filter(v=>!v.disabled),y=h.find(v=>v.value===a.value),g=LY(h,p,y);g!==void 0&&a.onValueChange(g.value)}),m=()=>{o||(a.onOpenChange(!0),d())};return P.jsx($v,{asChild:!0,...i,children:P.jsx(Ne.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":DY(a.value)?"":void 0,...s,ref:c,onClick:me(s.onClick,p=>{p.currentTarget.focus()}),onPointerDown:me(s.onPointerDown,p=>{const h=p.target;h.hasPointerCapture(p.pointerId)&&h.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&(m(),a.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)},p.preventDefault())}),onKeyDown:me(s.onKeyDown,p=>{const h=f.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&l(p.key),!(h&&p.key===" ")&&MTe.includes(p.key)&&(m(),p.preventDefault())})})})});uY.displayName=cY;var dY="SelectValue",fY=_.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:a="",...o}=t,c=Bd(dY,n),{onValueNodeHasChildrenChange:u}=c,f=i!==void 0,l=tt(e,c.onValueNodeChange);return $n(()=>{u(f)},[u,f]),P.jsx(Ne.span,{...o,ref:l,style:{pointerEvents:"none"},children:DY(c.value)?P.jsx(P.Fragment,{children:a}):i})});fY.displayName=dY;var BTe="SelectIcon",hY=_.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...s}=t;return P.jsx(Ne.span,{"aria-hidden":!0,...s,ref:e,children:r||"▼"})});hY.displayName=BTe;var zTe="SelectPortal",pY=t=>P.jsx(Pv,{asChild:!0,...t});pY.displayName=zTe;var Jh="SelectContent",mY=_.forwardRef((t,e)=>{const n=Bd(Jh,t.__scopeSelect),[r,s]=_.useState();if($n(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?Ms.createPortal(P.jsx(gY,{scope:t.__scopeSelect,children:P.jsx(kA.Slot,{scope:t.__scopeSelect,children:P.jsx("div",{children:t.children})})}),i):null}return P.jsx(vY,{...t,ref:e})});mY.displayName=Jh;var Ql=10,[gY,zd]=zv(Jh),UTe="SelectContentImpl",vY=_.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:a,side:o,sideOffset:c,align:u,alignOffset:f,arrowPadding:l,collisionBoundary:d,collisionPadding:m,sticky:p,hideWhenDetached:h,avoidCollisions:y,...g}=t,v=Bd(Jh,n),[w,x]=_.useState(null),[A,T]=_.useState(null),R=tt(e,ie=>x(ie)),[E,k]=_.useState(null),[N,O]=_.useState(null),L=NA(n),[I,F]=_.useState(!1),U=_.useRef(!1);_.useEffect(()=>{if(w)return Tv(w)},[w]),q1();const Y=_.useCallback(ie=>{const[be,...Ae]=L().map(De=>De.ref.current),[_e]=Ae.slice(-1),Me=document.activeElement;for(const De of ie)if(De===Me||(De==null||De.scrollIntoView({block:"nearest"}),De===be&&A&&(A.scrollTop=0),De===_e&&A&&(A.scrollTop=A.scrollHeight),De==null||De.focus(),document.activeElement!==Me))return},[L,A]),V=_.useCallback(()=>Y([E,w]),[Y,E,w]);_.useEffect(()=>{I&&V()},[I,V]);const{onOpenChange:H,triggerPointerDownPosRef:ee}=v;_.useEffect(()=>{if(w){let ie={x:0,y:0};const be=_e=>{var Me,De;ie={x:Math.abs(Math.round(_e.pageX)-(((Me=ee.current)==null?void 0:Me.x)??0)),y:Math.abs(Math.round(_e.pageY)-(((De=ee.current)==null?void 0:De.y)??0))}},Ae=_e=>{ie.x<=10&&ie.y<=10?_e.preventDefault():w.contains(_e.target)||H(!1),document.removeEventListener("pointermove",be),ee.current=null};return ee.current!==null&&(document.addEventListener("pointermove",be),document.addEventListener("pointerup",Ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",be),document.removeEventListener("pointerup",Ae,{capture:!0})}}},[w,H,ee]),_.useEffect(()=>{const ie=()=>H(!1);return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[H]);const[re,X]=MY(ie=>{const be=L().filter(Me=>!Me.disabled),Ae=be.find(Me=>Me.ref.current===document.activeElement),_e=LY(be,ie,Ae);_e&&setTimeout(()=>_e.ref.current.focus())}),q=_.useCallback((ie,be,Ae)=>{const _e=!U.current&&!Ae;(v.value!==void 0&&v.value===be||_e)&&(k(ie),_e&&(U.current=!0))},[v.value]),K=_.useCallback(()=>w==null?void 0:w.focus(),[w]),Z=_.useCallback((ie,be,Ae)=>{const _e=!U.current&&!Ae;(v.value!==void 0&&v.value===be||_e)&&O(ie)},[v.value]),ue=r==="popper"?xD:yY,de=ue===xD?{side:o,sideOffset:c,align:u,alignOffset:f,arrowPadding:l,collisionBoundary:d,collisionPadding:m,sticky:p,hideWhenDetached:h,avoidCollisions:y}:{};return P.jsx(gY,{scope:n,content:w,viewport:A,onViewportChange:T,itemRefCallback:q,selectedItem:E,onItemLeave:K,itemTextRefCallback:Z,focusSelectedItem:V,selectedItemText:N,position:r,isPositioned:I,searchRef:re,children:P.jsx(h_,{as:Aa,allowPinchZoom:!0,children:P.jsx(f_,{asChild:!0,trapped:v.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:me(s,ie=>{var be;(be=v.trigger)==null||be.focus({preventScroll:!0}),ie.preventDefault()}),children:P.jsx(Jc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:P.jsx(ue,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:ie=>ie.preventDefault(),...g,...de,onPlaced:()=>F(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:me(g.onKeyDown,ie=>{const be=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!be&&ie.key.length===1&&X(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let _e=L().filter(Me=>!Me.disabled).map(Me=>Me.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(_e=_e.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const Me=ie.target,De=_e.indexOf(Me);_e=_e.slice(De+1)}setTimeout(()=>Y(_e)),ie.preventDefault()}})})})})})})});vY.displayName=UTe;var HTe="SelectItemAlignedPosition",yY=_.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...s}=t,i=Bd(Jh,n),a=zd(Jh,n),[o,c]=_.useState(null),[u,f]=_.useState(null),l=tt(e,R=>f(R)),d=NA(n),m=_.useRef(!1),p=_.useRef(!0),{viewport:h,selectedItem:y,selectedItemText:g,focusSelectedItem:v}=a,w=_.useCallback(()=>{if(i.trigger&&i.valueNode&&o&&u&&h&&y&&g){const R=i.trigger.getBoundingClientRect(),E=u.getBoundingClientRect(),k=i.valueNode.getBoundingClientRect(),N=g.getBoundingClientRect();if(i.dir!=="rtl"){const Me=N.left-E.left,De=k.left-Me,ye=R.left-De,Fe=R.width+ye,ut=Math.max(Fe,E.width),Qe=window.innerWidth-Ql,vt=u0(De,[Ql,Qe-ut]);o.style.minWidth=Fe+"px",o.style.left=vt+"px"}else{const Me=E.right-N.right,De=window.innerWidth-k.right-Me,ye=window.innerWidth-R.right-De,Fe=R.width+ye,ut=Math.max(Fe,E.width),Qe=window.innerWidth-Ql,vt=u0(De,[Ql,Qe-ut]);o.style.minWidth=Fe+"px",o.style.right=vt+"px"}const O=d(),L=window.innerHeight-Ql*2,I=h.scrollHeight,F=window.getComputedStyle(u),U=parseInt(F.borderTopWidth,10),Y=parseInt(F.paddingTop,10),V=parseInt(F.borderBottomWidth,10),H=parseInt(F.paddingBottom,10),ee=U+Y+I+H+V,re=Math.min(y.offsetHeight*5,ee),X=window.getComputedStyle(h),q=parseInt(X.paddingTop,10),K=parseInt(X.paddingBottom,10),Z=R.top+R.height/2-Ql,ue=L-Z,de=y.offsetHeight/2,ie=y.offsetTop+de,be=U+Y+ie,Ae=ee-be;if(be<=Z){const Me=y===O[O.length-1].ref.current;o.style.bottom="0px";const De=u.clientHeight-h.offsetTop-h.offsetHeight,ye=Math.max(ue,de+(Me?K:0)+De+V),Fe=be+ye;o.style.height=Fe+"px"}else{const Me=y===O[0].ref.current;o.style.top="0px";const ye=Math.max(Z,U+h.offsetTop+(Me?q:0)+de)+Ae;o.style.height=ye+"px",h.scrollTop=be-Z+h.offsetTop}o.style.margin=`${Ql}px 0`,o.style.minHeight=re+"px",o.style.maxHeight=L+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[d,i.trigger,i.valueNode,o,u,h,y,g,i.dir,r]);$n(()=>w(),[w]);const[x,A]=_.useState();$n(()=>{u&&A(window.getComputedStyle(u).zIndex)},[u]);const T=_.useCallback(R=>{R&&p.current===!0&&(w(),v==null||v(),p.current=!1)},[w,v]);return P.jsx(WTe,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:m,onScrollButtonChange:T,children:P.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:x},children:P.jsx(Ne.div,{...s,ref:l,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});yY.displayName=HTe;var VTe="SelectPopperPosition",xD=_.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Ql,...i}=t,a=DA(n);return P.jsx(A_,{...a,...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)"}})});xD.displayName=VTe;var[WTe,x$]=zv(Jh,{}),SD="SelectViewport",bY=_.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...s}=t,i=zd(SD,n),a=x$(SD,n),o=tt(e,i.onViewportChange),c=_.useRef(0);return P.jsxs(P.Fragment,{children:[P.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}),P.jsx(kA.Slot,{scope:n,children:P.jsx(Ne.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:o,style:{position:"relative",flex:1,overflow:"auto",...s.style},onScroll:me(s.onScroll,u=>{const f=u.currentTarget,{contentWrapper:l,shouldExpandOnScrollRef:d}=a;if(d!=null&&d.current&&l){const m=Math.abs(c.current-f.scrollTop);if(m>0){const p=window.innerHeight-Ql*2,h=parseFloat(l.style.minHeight),y=parseFloat(l.style.height),g=Math.max(h,y);if(g0?x:0,l.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});bY.displayName=SD;var wY="SelectGroup",[GTe,qTe]=zv(wY),KTe=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=qr();return P.jsx(GTe,{scope:n,id:s,children:P.jsx(Ne.div,{role:"group","aria-labelledby":s,...r,ref:e})})});KTe.displayName=wY;var _Y="SelectLabel",xY=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=qTe(_Y,n);return P.jsx(Ne.div,{id:s.id,...r,ref:e})});xY.displayName=_Y;var NC="SelectItem",[YTe,SY]=zv(NC),EY=_.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...a}=t,o=Bd(NC,n),c=zd(NC,n),u=o.value===r,[f,l]=_.useState(i??""),[d,m]=_.useState(!1),p=tt(e,g=>{var v;return(v=c.itemRefCallback)==null?void 0:v.call(c,g,r,s)}),h=qr(),y=()=>{s||(o.onValueChange(r),o.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 P.jsx(YTe,{scope:n,value:r,disabled:s,textId:h,isSelected:u,onItemTextChange:_.useCallback(g=>{l(v=>v||((g==null?void 0:g.textContent)??"").trim())},[]),children:P.jsx(kA.ItemSlot,{scope:n,value:r,disabled:s,textValue:f,children:P.jsx(Ne.div,{role:"option","aria-labelledby":h,"data-highlighted":d?"":void 0,"aria-selected":u&&d,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:p,onFocus:me(a.onFocus,()=>m(!0)),onBlur:me(a.onBlur,()=>m(!1)),onPointerUp:me(a.onPointerUp,y),onPointerMove:me(a.onPointerMove,g=>{var v;s?(v=c.onItemLeave)==null||v.call(c):g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:me(a.onPointerLeave,g=>{var v;g.currentTarget===document.activeElement&&((v=c.onItemLeave)==null||v.call(c))}),onKeyDown:me(a.onKeyDown,g=>{var w;((w=c.searchRef)==null?void 0:w.current)!==""&&g.key===" "||(LTe.includes(g.key)&&y(),g.key===" "&&g.preventDefault())})})})})});EY.displayName=NC;var Xy="SelectItemText",CY=_.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:s,...i}=t,a=Bd(Xy,n),o=zd(Xy,n),c=SY(Xy,n),u=jTe(Xy,n),[f,l]=_.useState(null),d=tt(e,g=>l(g),c.onItemTextChange,g=>{var v;return(v=o.itemTextRefCallback)==null?void 0:v.call(o,g,c.value,c.disabled)}),m=f==null?void 0:f.textContent,p=_.useMemo(()=>P.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:h,onNativeOptionRemove:y}=u;return $n(()=>(h(p),()=>y(p)),[h,y,p]),P.jsxs(P.Fragment,{children:[P.jsx(Ne.span,{id:c.textId,...i,ref:d}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Ms.createPortal(i.children,a.valueNode):null]})});CY.displayName=Xy;var AY="SelectItemIndicator",RY=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return SY(AY,n).isSelected?P.jsx(Ne.span,{"aria-hidden":!0,...r,ref:e}):null});RY.displayName=AY;var ED="SelectScrollUpButton",PY=_.forwardRef((t,e)=>{const n=zd(ED,t.__scopeSelect),r=x$(ED,t.__scopeSelect),[s,i]=_.useState(!1),a=tt(e,r.onScrollButtonChange);return $n(()=>{if(n.viewport&&n.isPositioned){let o=function(){const u=c.scrollTop>0;i(u)};const c=n.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),s?P.jsx(kY,{...t,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop-c.offsetHeight)}}):null});PY.displayName=ED;var CD="SelectScrollDownButton",TY=_.forwardRef((t,e)=>{const n=zd(CD,t.__scopeSelect),r=x$(CD,t.__scopeSelect),[s,i]=_.useState(!1),a=tt(e,r.onScrollButtonChange);return $n(()=>{if(n.viewport&&n.isPositioned){let o=function(){const u=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)c.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),s?P.jsx(kY,{...t,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop+c.offsetHeight)}}):null});TY.displayName=CD;var kY=_.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=t,i=zd("SelectScrollButton",n),a=_.useRef(null),o=NA(n),c=_.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return _.useEffect(()=>()=>c(),[c]),$n(()=>{var f;const u=o().find(l=>l.ref.current===document.activeElement);(f=u==null?void 0:u.ref.current)==null||f.scrollIntoView({block:"nearest"})},[o]),P.jsx(Ne.div,{"aria-hidden":!0,...s,ref:e,style:{flexShrink:0,...s.style},onPointerDown:me(s.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:me(s.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:me(s.onPointerLeave,()=>{c()})})}),XTe="SelectSeparator",NY=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return P.jsx(Ne.div,{"aria-hidden":!0,...r,ref:e})});NY.displayName=XTe;var AD="SelectArrow",QTe=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=DA(n),i=Bd(AD,n),a=zd(AD,n);return i.open&&a.position==="popper"?P.jsx(R_,{...s,...r,ref:e}):null});QTe.displayName=AD;function DY(t){return t===""||t===void 0}var OY=_.forwardRef((t,e)=>{const{value:n,...r}=t,s=_.useRef(null),i=tt(e,s),a=Mv(n);return _.useEffect(()=>{const o=s.current,c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==n&&f){const l=new Event("change",{bubbles:!0});f.call(o,n),o.dispatchEvent(l)}},[a,n]),P.jsx(I_,{asChild:!0,children:P.jsx("select",{...r,ref:i,defaultValue:n})})});OY.displayName="BubbleSelect";function MY(t){const e=zt(t),n=_.useRef(""),r=_.useRef(0),s=_.useCallback(a=>{const o=n.current+a;e(o),function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(o)},[e]),i=_.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function LY(t,e,n){const s=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let a=ZTe(t,Math.max(i,0));s.length===1&&(a=a.filter(u=>u!==n));const c=a.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function ZTe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var JTe=lY,IY=uY,eke=fY,tke=hY,nke=pY,$Y=mY,rke=bY,FY=xY,jY=EY,ske=CY,ike=RY,BY=PY,zY=TY,UY=NY;const kUe=JTe,NUe=eke,oke=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(IY,{ref:r,className:le("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,P.jsx(tke,{asChild:!0,children:P.jsx(W1,{className:"h-4 w-4 opacity-50"})})]}));oke.displayName=IY.displayName;const HY=_.forwardRef(({className:t,...e},n)=>P.jsx(BY,{ref:n,className:le("flex cursor-default items-center justify-center py-1",t),...e,children:P.jsx(Ife,{className:"h-4 w-4"})}));HY.displayName=BY.displayName;const VY=_.forwardRef(({className:t,...e},n)=>P.jsx(zY,{ref:n,className:le("flex cursor-default items-center justify-center py-1",t),...e,children:P.jsx(W1,{className:"h-4 w-4"})}));VY.displayName=zY.displayName;const ake=_.forwardRef(({className:t,children:e,position:n="popper",...r},s)=>P.jsx(nke,{children:P.jsxs($Y,{ref:s,className:le("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:[P.jsx(HY,{}),P.jsx(rke,{className:le("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),P.jsx(VY,{})]})}));ake.displayName=$Y.displayName;const lke=_.forwardRef(({className:t,...e},n)=>P.jsx(FY,{ref:n,className:le("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));lke.displayName=FY.displayName;const cke=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(jY,{ref:r,className:le("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:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(ike,{children:P.jsx(u_,{className:"h-4 w-4"})})}),P.jsx(ske,{children:e})]}));cke.displayName=jY.displayName;const uke=_.forwardRef(({className:t,...e},n)=>P.jsx(UY,{ref:n,className:le("-mx-1 my-1 h-px bg-muted",t),...e}));uke.displayName=UY.displayName;const dke=OL,fke=ML,hke=LL,WY=_.forwardRef(({className:t,...e},n)=>P.jsx(p_,{className:le("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}));WY.displayName=p_.displayName;const pke=ri("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"}}),GY=_.forwardRef(({side:t="right",className:e,children:n,...r},s)=>P.jsxs(hke,{children:[P.jsx(WY,{}),P.jsxs(m_,{ref:s,className:le(pke({side:t}),e),...r,children:[n,P.jsxs(y_,{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:[P.jsx(xL,{className:"h-4 w-4"}),P.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));GY.displayName=m_.displayName;const mke=_.forwardRef(({className:t,...e},n)=>P.jsx(g_,{ref:n,className:le("text-lg font-semibold text-foreground",t),...e}));mke.displayName=g_.displayName;const gke=_.forwardRef(({className:t,...e},n)=>P.jsx(v_,{ref:n,className:le("text-sm text-muted-foreground",t),...e}));gke.displayName=v_.displayName;var qY=["PageUp","PageDown"],KY=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],YY={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Uv="Slider",[RD,vke,yke]=Qc(Uv),[XY,DUe]=Nn(Uv,[yke]),[bke,OA]=XY(Uv),QY=_.forwardRef((t,e)=>{const{name:n,min:r=0,max:s=100,step:i=1,orientation:a="horizontal",disabled:o=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[r],value:f,onValueChange:l=()=>{},onValueCommit:d=()=>{},inverted:m=!1,...p}=t,h=_.useRef(new Set),y=_.useRef(0),v=a==="horizontal"?wke:_ke,[w=[],x]=lr({prop:f,defaultProp:u,onChange:N=>{var L;(L=[...h.current][y.current])==null||L.focus(),l(N)}}),A=_.useRef(w);function T(N){const O=Ake(w,N);k(N,O)}function R(N){k(N,y.current)}function E(){const N=A.current[y.current];w[y.current]!==N&&d(w)}function k(N,O,{commit:L}={commit:!1}){const I=kke(i),F=Nke(Math.round((N-r)/i)*i+r,I),U=u0(F,[r,s]);x((Y=[])=>{const V=Eke(Y,U,O);if(Tke(V,c*i)){y.current=V.indexOf(U);const H=String(V)!==String(Y);return H&&L&&d(V),H?V:Y}else return Y})}return P.jsx(bke,{scope:t.__scopeSlider,name:n,disabled:o,min:r,max:s,valueIndexToChangeRef:y,thumbs:h.current,values:w,orientation:a,children:P.jsx(RD.Provider,{scope:t.__scopeSlider,children:P.jsx(RD.Slot,{scope:t.__scopeSlider,children:P.jsx(v,{"aria-disabled":o,"data-disabled":o?"":void 0,...p,ref:e,onPointerDown:me(p.onPointerDown,()=>{o||(A.current=w)}),min:r,max:s,inverted:m,onSlideStart:o?void 0:T,onSlideMove:o?void 0:R,onSlideEnd:o?void 0:E,onHomeKeyDown:()=>!o&&k(r,0,{commit:!0}),onEndKeyDown:()=>!o&&k(s,w.length-1,{commit:!0}),onStepKeyDown:({event:N,direction:O})=>{if(!o){const F=qY.includes(N.key)||N.shiftKey&&KY.includes(N.key)?10:1,U=y.current,Y=w[U],V=i*F*O;k(Y+V,U,{commit:!0})}}})})})})});QY.displayName=Uv;var[ZY,JY]=XY(Uv,{startEdge:"left",endEdge:"right",size:"width",direction:1}),wke=_.forwardRef((t,e)=>{const{min:n,max:r,dir:s,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:c,onStepKeyDown:u,...f}=t,[l,d]=_.useState(null),m=tt(e,w=>d(w)),p=_.useRef(),h=Da(s),y=h==="ltr",g=y&&!i||!y&&i;function v(w){const x=p.current||l.getBoundingClientRect(),A=[0,x.width],R=S$(A,g?[n,r]:[r,n]);return p.current=x,R(w-x.left)}return P.jsx(ZY,{scope:t.__scopeSlider,startEdge:g?"left":"right",endEdge:g?"right":"left",direction:g?1:-1,size:"width",children:P.jsx(eX,{dir:h,"data-orientation":"horizontal",...f,ref:m,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const x=v(w.clientX);a==null||a(x)},onSlideMove:w=>{const x=v(w.clientX);o==null||o(x)},onSlideEnd:()=>{p.current=void 0,c==null||c()},onStepKeyDown:w=>{const A=YY[g?"from-left":"from-right"].includes(w.key);u==null||u({event:w,direction:A?-1:1})}})})}),_ke=_.forwardRef((t,e)=>{const{min:n,max:r,inverted:s,onSlideStart:i,onSlideMove:a,onSlideEnd:o,onStepKeyDown:c,...u}=t,f=_.useRef(null),l=tt(e,f),d=_.useRef(),m=!s;function p(h){const y=d.current||f.current.getBoundingClientRect(),g=[0,y.height],w=S$(g,m?[r,n]:[n,r]);return d.current=y,w(h-y.top)}return P.jsx(ZY,{scope:t.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:P.jsx(eX,{"data-orientation":"vertical",...u,ref:l,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:h=>{const y=p(h.clientY);i==null||i(y)},onSlideMove:h=>{const y=p(h.clientY);a==null||a(y)},onSlideEnd:()=>{d.current=void 0,o==null||o()},onStepKeyDown:h=>{const g=YY[m?"from-bottom":"from-top"].includes(h.key);c==null||c({event:h,direction:g?-1:1})}})})}),eX=_.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:o,onStepKeyDown:c,...u}=t,f=OA(Uv,n);return P.jsx(Ne.span,{...u,ref:e,onKeyDown:me(t.onKeyDown,l=>{l.key==="Home"?(a(l),l.preventDefault()):l.key==="End"?(o(l),l.preventDefault()):qY.concat(KY).includes(l.key)&&(c(l),l.preventDefault())}),onPointerDown:me(t.onPointerDown,l=>{const d=l.target;d.setPointerCapture(l.pointerId),l.preventDefault(),f.thumbs.has(d)?d.focus():r(l)}),onPointerMove:me(t.onPointerMove,l=>{l.target.hasPointerCapture(l.pointerId)&&s(l)}),onPointerUp:me(t.onPointerUp,l=>{const d=l.target;d.hasPointerCapture(l.pointerId)&&(d.releasePointerCapture(l.pointerId),i(l))})})}),tX="SliderTrack",nX=_.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=OA(tX,n);return P.jsx(Ne.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:e})});nX.displayName=tX;var PD="SliderRange",rX=_.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=OA(PD,n),i=JY(PD,n),a=_.useRef(null),o=tt(e,a),c=s.values.length,u=s.values.map(d=>iX(d,s.min,s.max)),f=c>1?Math.min(...u):0,l=100-Math.max(...u);return P.jsx(Ne.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:o,style:{...t.style,[i.startEdge]:f+"%",[i.endEdge]:l+"%"}})});rX.displayName=PD;var TD="SliderThumb",sX=_.forwardRef((t,e)=>{const n=vke(t.__scopeSlider),[r,s]=_.useState(null),i=tt(e,o=>s(o)),a=_.useMemo(()=>r?n().findIndex(o=>o.ref.current===r):-1,[n,r]);return P.jsx(xke,{...t,ref:i,index:a})}),xke=_.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:s,...i}=t,a=OA(TD,n),o=JY(TD,n),[c,u]=_.useState(null),f=tt(e,v=>u(v)),l=c?!!c.closest("form"):!0,d=S_(c),m=a.values[r],p=m===void 0?0:iX(m,a.min,a.max),h=Cke(r,a.values.length),y=d==null?void 0:d[o.size],g=y?Rke(y,p,o.direction):0;return _.useEffect(()=>{if(c)return a.thumbs.add(c),()=>{a.thumbs.delete(c)}},[c,a.thumbs]),P.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[o.startEdge]:`calc(${p}% + ${g}px)`},children:[P.jsx(RD.ItemSlot,{scope:t.__scopeSlider,children:P.jsx(Ne.span,{role:"slider","aria-label":t["aria-label"]||h,"aria-valuemin":a.min,"aria-valuenow":m,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...i,ref:f,style:m===void 0?{display:"none"}:t.style,onFocus:me(t.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),l&&P.jsx(Ske,{name:s??(a.name?a.name+(a.values.length>1?"[]":""):void 0),value:m},r)]})});sX.displayName=TD;var Ske=t=>{const{value:e,...n}=t,r=_.useRef(null),s=Mv(e);return _.useEffect(()=>{const i=r.current,a=window.HTMLInputElement.prototype,c=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&c){const u=new Event("input",{bubbles:!0});c.call(i,e),i.dispatchEvent(u)}},[s,e]),P.jsx("input",{style:{display:"none"},...n,ref:r,defaultValue:e})};function Eke(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}function iX(t,e,n){const i=100/(n-e)*(t-e);return u0(i,[0,100])}function Cke(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function Ake(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 Rke(t,e,n){const r=t/2,i=S$([0,50],[0,r]);return(r-i(e)*n)*n}function Pke(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function Tke(t,e){if(e>0){const n=Pke(t);return Math.min(...n)>=e}return!0}function S$(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 kke(t){return(String(t).split(".")[1]||"").length}function Nke(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var oX=QY,Dke=nX,Oke=rX,Mke=sX;const Lke=_.forwardRef(({className:t,...e},n)=>P.jsxs(oX,{ref:n,className:le("relative flex w-full touch-none select-none items-center",t),...e,children:[P.jsx(Dke,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:P.jsx(Oke,{className:"absolute h-full bg-primary"})}),P.jsx(Mke,{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"})]}));Lke.displayName=oX.displayName;var E$="Switch",[Ike,OUe]=Nn(E$),[$ke,Fke]=Ike(E$),aX=_.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:a,disabled:o,value:c="on",onCheckedChange:u,...f}=t,[l,d]=_.useState(null),m=tt(e,v=>d(v)),p=_.useRef(!1),h=l?!!l.closest("form"):!0,[y=!1,g]=lr({prop:s,defaultProp:i,onChange:u});return P.jsxs($ke,{scope:n,checked:y,disabled:o,children:[P.jsx(Ne.button,{type:"button",role:"switch","aria-checked":y,"aria-required":a,"data-state":uX(y),"data-disabled":o?"":void 0,disabled:o,value:c,...f,ref:m,onClick:me(t.onClick,v=>{g(w=>!w),h&&(p.current=v.isPropagationStopped(),p.current||v.stopPropagation())})}),h&&P.jsx(jke,{control:l,bubbles:!p.current,name:r,value:c,checked:y,required:a,disabled:o,style:{transform:"translateX(-100%)"}})]})});aX.displayName=E$;var lX="SwitchThumb",cX=_.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,s=Fke(lX,n);return P.jsx(Ne.span,{"data-state":uX(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:e})});cX.displayName=lX;var jke=t=>{const{control:e,checked:n,bubbles:r=!0,...s}=t,i=_.useRef(null),a=Mv(n),o=S_(e);return _.useEffect(()=>{const c=i.current,u=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(u,"checked").set;if(a!==n&&l){const d=new Event("click",{bubbles:r});l.call(c,n),c.dispatchEvent(d)}},[a,n,r]),P.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:i,style:{...t.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function uX(t){return t?"checked":"unchecked"}var dX=aX,Bke=cX;const zke=_.forwardRef(({className:t,...e},n)=>P.jsx(dX,{className:le("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:P.jsx(Bke,{className:le("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")})}));zke.displayName=dX.displayName;const Uke=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{className:"relative w-full overflow-auto",children:P.jsx("table",{ref:n,className:le("w-full caption-bottom text-sm",t),...e})}));Uke.displayName="Table";const Hke=_.forwardRef(({className:t,...e},n)=>P.jsx("thead",{ref:n,className:le("[&_tr]:border-b",t),...e}));Hke.displayName="TableHeader";const Vke=_.forwardRef(({className:t,...e},n)=>P.jsx("tbody",{ref:n,className:le("[&_tr:last-child]:border-0",t),...e}));Vke.displayName="TableBody";const Wke=_.forwardRef(({className:t,...e},n)=>P.jsx("tfoot",{ref:n,className:le("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));Wke.displayName="TableFooter";const Gke=_.forwardRef(({className:t,...e},n)=>P.jsx("tr",{ref:n,className:le("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...e}));Gke.displayName="TableRow";const qke=_.forwardRef(({className:t,...e},n)=>P.jsx("th",{ref:n,className:le("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...e}));qke.displayName="TableHead";const Kke=_.forwardRef(({className:t,...e},n)=>P.jsx("td",{ref:n,className:le("py-2 px-4 align-middle [&:has([role=checkbox])]:pr-0",t),...e}));Kke.displayName="TableCell";const Yke=_.forwardRef(({className:t,...e},n)=>P.jsx("caption",{ref:n,className:le("mt-4 text-sm text-muted-foreground",t),...e}));Yke.displayName="TableCaption";var C$="Tabs",[Xke,MUe]=Nn(C$,[Pl]),fX=Pl(),[Qke,A$]=Xke(C$),hX=_.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:a="horizontal",dir:o,activationMode:c="automatic",...u}=t,f=Da(o),[l,d]=lr({prop:r,onChange:s,defaultProp:i});return P.jsx(Qke,{scope:n,baseId:qr(),value:l,onValueChange:d,orientation:a,dir:f,activationMode:c,children:P.jsx(Ne.div,{dir:f,"data-orientation":a,...u,ref:e})})});hX.displayName=C$;var pX="TabsList",mX=_.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...s}=t,i=A$(pX,n),a=fX(n);return P.jsx(P_,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:P.jsx(Ne.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:e})})});mX.displayName=pX;var gX="TabsTrigger",vX=_.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=t,a=A$(gX,n),o=fX(n),c=wX(a.baseId,r),u=_X(a.baseId,r),f=r===a.value;return P.jsx(T_,{asChild:!0,...o,focusable:!s,active:f,children:P.jsx(Ne.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":u,"data-state":f?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...i,ref:e,onMouseDown:me(t.onMouseDown,l=>{!s&&l.button===0&&l.ctrlKey===!1?a.onValueChange(r):l.preventDefault()}),onKeyDown:me(t.onKeyDown,l=>{[" ","Enter"].includes(l.key)&&a.onValueChange(r)}),onFocus:me(t.onFocus,()=>{const l=a.activationMode!=="manual";!f&&!s&&l&&a.onValueChange(r)})})})});vX.displayName=gX;var yX="TabsContent",bX=_.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...a}=t,o=A$(yX,n),c=wX(o.baseId,r),u=_X(o.baseId,r),f=r===o.value,l=_.useRef(f);return _.useEffect(()=>{const d=requestAnimationFrame(()=>l.current=!1);return()=>cancelAnimationFrame(d)},[]),P.jsx(Wn,{present:s||f,children:({present:d})=>P.jsx(Ne.div,{"data-state":f?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":c,hidden:!d,id:u,tabIndex:0,...a,ref:e,style:{...t.style,animationDuration:l.current?"0s":void 0},children:d&&i})})});bX.displayName=yX;function wX(t,e){return`${t}-trigger-${e}`}function _X(t,e){return`${t}-content-${e}`}var Zke=hX,xX=mX,SX=vX,EX=bX;const LUe=Zke,Jke=_.forwardRef(({className:t,...e},n)=>P.jsx(xX,{ref:n,className:le("inline-flex h-9 items-center justify-center rounded-lg bg-accent p-1 text-muted-foreground",t),...e}));Jke.displayName=xX.displayName;const eNe=_.forwardRef(({className:t,...e},n)=>P.jsx(SX,{ref:n,className:le("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}));eNe.displayName=SX.displayName;const tNe=_.forwardRef(({className:t,...e},n)=>P.jsx(EX,{ref:n,className:le("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));tNe.displayName=EX.displayName;const CX=_.forwardRef(({className:t,...e},n)=>P.jsx("textarea",{className:le("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}));CX.displayName="Textarea";var R$="ToastProvider",[P$,nNe,rNe]=Qc("Toast"),[AX,IUe]=Nn("Toast",[rNe]),[sNe,MA]=AX(R$),RX=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:a}=t,[o,c]=_.useState(null),[u,f]=_.useState(0),l=_.useRef(!1),d=_.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${R$}\`. Expected non-empty \`string\`.`),P.jsx(P$.Provider,{scope:e,children:P.jsx(sNe,{scope:e,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:u,viewport:o,onViewportChange:c,onToastAdd:_.useCallback(()=>f(m=>m+1),[]),onToastRemove:_.useCallback(()=>f(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:l,isClosePausedRef:d,children:a})})};RX.displayName=R$;var PX="ToastViewport",iNe=["F8"],kD="toast.viewportPause",ND="toast.viewportResume",TX=_.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=iNe,label:s="Notifications ({hotkey})",...i}=t,a=MA(PX,n),o=nNe(n),c=_.useRef(null),u=_.useRef(null),f=_.useRef(null),l=_.useRef(null),d=tt(e,l,a.onViewportChange),m=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),p=a.toastCount>0;_.useEffect(()=>{const y=g=>{var w;r.every(x=>g[x]||g.code===x)&&((w=l.current)==null||w.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),_.useEffect(()=>{const y=c.current,g=l.current;if(p&&y&&g){const v=()=>{if(!a.isClosePausedRef.current){const T=new CustomEvent(kD);g.dispatchEvent(T),a.isClosePausedRef.current=!0}},w=()=>{if(a.isClosePausedRef.current){const T=new CustomEvent(ND);g.dispatchEvent(T),a.isClosePausedRef.current=!1}},x=T=>{!y.contains(T.relatedTarget)&&w()},A=()=>{y.contains(document.activeElement)||w()};return y.addEventListener("focusin",v),y.addEventListener("focusout",x),y.addEventListener("pointermove",v),y.addEventListener("pointerleave",A),window.addEventListener("blur",v),window.addEventListener("focus",w),()=>{y.removeEventListener("focusin",v),y.removeEventListener("focusout",x),y.removeEventListener("pointermove",v),y.removeEventListener("pointerleave",A),window.removeEventListener("blur",v),window.removeEventListener("focus",w)}}},[p,a.isClosePausedRef]);const h=_.useCallback(({tabbingDirection:y})=>{const v=o().map(w=>{const x=w.ref.current,A=[x,...yNe(x)];return y==="forwards"?A:A.reverse()});return(y==="forwards"?v.reverse():v).flat()},[o]);return _.useEffect(()=>{const y=l.current;if(y){const g=v=>{var A,T,R;const w=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!w){const E=document.activeElement,k=v.shiftKey;if(v.target===y&&k){(A=u.current)==null||A.focus();return}const L=h({tabbingDirection:k?"backwards":"forwards"}),I=L.findIndex(F=>F===E);XT(L.slice(I+1))?v.preventDefault():k?(T=u.current)==null||T.focus():(R=f.current)==null||R.focus()}};return y.addEventListener("keydown",g),()=>y.removeEventListener("keydown",g)}},[o,h]),P.jsxs(jhe,{ref:c,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:p?void 0:"none"},children:[p&&P.jsx(DD,{ref:u,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"forwards"});XT(y)}}),P.jsx(P$.Slot,{scope:n,children:P.jsx(Ne.ol,{tabIndex:-1,...i,ref:d})}),p&&P.jsx(DD,{ref:f,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"backwards"});XT(y)}})]})});TX.displayName=PX;var kX="ToastFocusProxy",DD=_.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=t,i=MA(kX,n);return P.jsx(I_,{"aria-hidden":!0,tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:a=>{var u;const o=a.relatedTarget;!((u=i.viewport)!=null&&u.contains(o))&&r()}})});DD.displayName=kX;var LA="Toast",oNe="toast.swipeStart",aNe="toast.swipeMove",lNe="toast.swipeCancel",cNe="toast.swipeEnd",NX=_.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...a}=t,[o=!0,c]=lr({prop:r,defaultProp:s,onChange:i});return P.jsx(Wn,{present:n||o,children:P.jsx(fNe,{open:o,...a,ref:e,onClose:()=>c(!1),onPause:zt(t.onPause),onResume:zt(t.onResume),onSwipeStart:me(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:me(t.onSwipeMove,u=>{const{x:f,y:l}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${l}px`)}),onSwipeCancel:me(t.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:me(t.onSwipeEnd,u=>{const{x:f,y:l}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${l}px`),c(!1)})})})});NX.displayName=LA;var[uNe,dNe]=AX(LA,{onClose(){}}),fNe=_.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:a,onEscapeKeyDown:o,onPause:c,onResume:u,onSwipeStart:f,onSwipeMove:l,onSwipeCancel:d,onSwipeEnd:m,...p}=t,h=MA(LA,n),[y,g]=_.useState(null),v=tt(e,F=>g(F)),w=_.useRef(null),x=_.useRef(null),A=s||h.duration,T=_.useRef(0),R=_.useRef(A),E=_.useRef(0),{onToastAdd:k,onToastRemove:N}=h,O=zt(()=>{var U;(y==null?void 0:y.contains(document.activeElement))&&((U=h.viewport)==null||U.focus()),a()}),L=_.useCallback(F=>{!F||F===1/0||(window.clearTimeout(E.current),T.current=new Date().getTime(),E.current=window.setTimeout(O,F))},[O]);_.useEffect(()=>{const F=h.viewport;if(F){const U=()=>{L(R.current),u==null||u()},Y=()=>{const V=new Date().getTime()-T.current;R.current=R.current-V,window.clearTimeout(E.current),c==null||c()};return F.addEventListener(kD,Y),F.addEventListener(ND,U),()=>{F.removeEventListener(kD,Y),F.removeEventListener(ND,U)}}},[h.viewport,A,c,u,L]),_.useEffect(()=>{i&&!h.isClosePausedRef.current&&L(A)},[i,A,h.isClosePausedRef,L]),_.useEffect(()=>(k(),()=>N()),[k,N]);const I=_.useMemo(()=>y?FX(y):null,[y]);return h.viewport?P.jsxs(P.Fragment,{children:[I&&P.jsx(hNe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:I}),P.jsx(uNe,{scope:n,onClose:O,children:Ms.createPortal(P.jsx(P$.ItemSlot,{scope:n,children:P.jsx(Fhe,{asChild:!0,onEscapeKeyDown:me(o,()=>{h.isFocusedToastEscapeKeyDownRef.current||O(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:P.jsx(Ne.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":h.swipeDirection,...p,ref:v,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:me(t.onKeyDown,F=>{F.key==="Escape"&&(o==null||o(F.nativeEvent),F.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,O()))}),onPointerDown:me(t.onPointerDown,F=>{F.button===0&&(w.current={x:F.clientX,y:F.clientY})}),onPointerMove:me(t.onPointerMove,F=>{if(!w.current)return;const U=F.clientX-w.current.x,Y=F.clientY-w.current.y,V=!!x.current,H=["left","right"].includes(h.swipeDirection),ee=["left","up"].includes(h.swipeDirection)?Math.min:Math.max,re=H?ee(0,U):0,X=H?0:ee(0,Y),q=F.pointerType==="touch"?10:2,K={x:re,y:X},Z={originalEvent:F,delta:K};V?(x.current=K,xS(aNe,l,Z,{discrete:!1})):Yz(K,h.swipeDirection,q)?(x.current=K,xS(oNe,f,Z,{discrete:!1}),F.target.setPointerCapture(F.pointerId)):(Math.abs(U)>q||Math.abs(Y)>q)&&(w.current=null)}),onPointerUp:me(t.onPointerUp,F=>{const U=x.current,Y=F.target;if(Y.hasPointerCapture(F.pointerId)&&Y.releasePointerCapture(F.pointerId),x.current=null,w.current=null,U){const V=F.currentTarget,H={originalEvent:F,delta:U};Yz(U,h.swipeDirection,h.swipeThreshold)?xS(cNe,m,H,{discrete:!0}):xS(lNe,d,H,{discrete:!0}),V.addEventListener("click",ee=>ee.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),hNe=t=>{const{__scopeToast:e,children:n,...r}=t,s=MA(LA,e),[i,a]=_.useState(!1),[o,c]=_.useState(!1);return gNe(()=>a(!0)),_.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),o?null:P.jsx(Pv,{asChild:!0,children:P.jsx(I_,{...r,children:i&&P.jsxs(P.Fragment,{children:[s.label," ",n]})})})},pNe="ToastTitle",DX=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return P.jsx(Ne.div,{...r,ref:e})});DX.displayName=pNe;var mNe="ToastDescription",OX=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return P.jsx(Ne.div,{...r,ref:e})});OX.displayName=mNe;var MX="ToastAction",LX=_.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?P.jsx($X,{altText:n,asChild:!0,children:P.jsx(T$,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${MX}\`. Expected non-empty \`string\`.`),null)});LX.displayName=MX;var IX="ToastClose",T$=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,s=dNe(IX,n);return P.jsx($X,{asChild:!0,children:P.jsx(Ne.button,{type:"button",...r,ref:e,onClick:me(t.onClick,s.onClose)})})});T$.displayName=IX;var $X=_.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...s}=t;return P.jsx(Ne.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function FX(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),vNe(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const a=r.dataset.radixToastAnnounceAlt;a&&e.push(a)}else e.push(...FX(r))}}),e}function xS(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?Jb(s,i):s.dispatchEvent(i)}var Yz=(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 gNe(t=()=>{}){const e=zt(t);$n(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function vNe(t){return t.nodeType===t.ELEMENT_NODE}function yNe(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 XT(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var bNe=RX,jX=TX,BX=NX,zX=DX,UX=OX,HX=LX,VX=T$;const wNe=bNe,WX=_.forwardRef(({className:t,...e},n)=>P.jsx(jX,{ref:n,className:le("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}));WX.displayName=jX.displayName;const _Ne=ri("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"}}),GX=_.forwardRef(({className:t,variant:e,...n},r)=>P.jsx(BX,{ref:r,className:le(_Ne({variant:e}),t),...n}));GX.displayName=BX.displayName;const xNe=_.forwardRef(({className:t,...e},n)=>P.jsx(HX,{ref:n,className:le("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}));xNe.displayName=HX.displayName;const qX=_.forwardRef(({className:t,...e},n)=>P.jsx(VX,{ref:n,className:le("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:P.jsx(xL,{className:"w-4 h-4"})}));qX.displayName=VX.displayName;const KX=_.forwardRef(({className:t,...e},n)=>P.jsx(zX,{ref:n,className:le("text-sm font-semibold",t),...e}));KX.displayName=zX.displayName;const YX=_.forwardRef(({className:t,...e},n)=>P.jsx(UX,{ref:n,className:le("text-sm opacity-90",t),...e}));YX.displayName=UX.displayName;const SNe=3,ENe=1e6;let QT=0;function CNe(){return QT=(QT+1)%Number.MAX_SAFE_INTEGER,QT.toString()}const ZT=new Map,Xz=t=>{if(ZT.has(t))return;const e=setTimeout(()=>{ZT.delete(t),Cb({type:"REMOVE_TOAST",toastId:t})},ENe);ZT.set(t,e)},ANe=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,SNe)};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?Xz(n):t.toasts.forEach(r=>{Xz(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)}}},ZS=[];let JS={toasts:[]};function Cb(t){JS=ANe(JS,t),ZS.forEach(e=>{e(JS)})}function RNe({...t}){const e=CNe(),n=s=>Cb({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>Cb({type:"DISMISS_TOAST",toastId:e});return Cb({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:n}}function XX(){const[t,e]=_.useState(JS);return _.useEffect(()=>(ZS.push(e),()=>{const n=ZS.indexOf(e);n>-1&&ZS.splice(n,1)}),[t]),{...t,toast:RNe,dismiss:n=>Cb({type:"DISMISS_TOAST",toastId:n})}}function QX(){const{toasts:t}=XX();return P.jsxs(wNe,{swipeDirection:"down",children:[t.map(function({id:e,title:n,description:r,action:s,...i}){return P.jsxs(GX,{...i,children:[P.jsxs("div",{className:"grid gap-1",children:[n&&P.jsx(KX,{children:n}),r&&P.jsx(YX,{children:r})]}),s,P.jsx(qX,{})]},e)}),P.jsx(WX,{className:"bottom-0 w-auto mx-auto sm:bottom-0 sm:left-0 sm:right-0"})]})}var PNe="Toggle",k$=_.forwardRef((t,e)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:s,...i}=t,[a=!1,o]=lr({prop:n,onChange:s,defaultProp:r});return P.jsx(Ne.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":t.disabled?"":void 0,...i,ref:e,onClick:me(t.onClick,()=>{t.disabled||o(!a)})})});k$.displayName=PNe;var ZX=k$;const JX=ri("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"}}),TNe=_.forwardRef(({className:t,variant:e,size:n,...r},s)=>P.jsx(ZX,{ref:s,className:le(JX({variant:e,size:n,className:t})),...r}));TNe.displayName=ZX.displayName;var Hv="ToggleGroup",[eQ,$Ue]=Nn(Hv,[Pl]),tQ=Pl(),N$=se.forwardRef((t,e)=>{const{type:n,...r}=t;if(n==="single"){const s=r;return P.jsx(kNe,{...s,ref:e})}if(n==="multiple"){const s=r;return P.jsx(NNe,{...s,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${Hv}\``)});N$.displayName=Hv;var[nQ,rQ]=eQ(Hv),kNe=se.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=t,[a,o]=lr({prop:n,defaultProp:r,onChange:s});return P.jsx(nQ,{scope:t.__scopeToggleGroup,type:"single",value:a?[a]:[],onItemActivate:o,onItemDeactivate:se.useCallback(()=>o(""),[o]),children:P.jsx(sQ,{...i,ref:e})})}),NNe=se.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=t,[a=[],o]=lr({prop:n,defaultProp:r,onChange:s}),c=se.useCallback(f=>o((l=[])=>[...l,f]),[o]),u=se.useCallback(f=>o((l=[])=>l.filter(d=>d!==f)),[o]);return P.jsx(nQ,{scope:t.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:c,onItemDeactivate:u,children:P.jsx(sQ,{...i,ref:e})})});N$.displayName=Hv;var[DNe,ONe]=eQ(Hv),sQ=se.forwardRef((t,e)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:s=!0,orientation:i,dir:a,loop:o=!0,...c}=t,u=tQ(n),f=Da(a),l={role:"group",dir:f,...c};return P.jsx(DNe,{scope:n,rovingFocus:s,disabled:r,children:s?P.jsx(P_,{asChild:!0,...u,orientation:i,dir:f,loop:o,children:P.jsx(Ne.div,{...l,ref:e})}):P.jsx(Ne.div,{...l,ref:e})})}),DC="ToggleGroupItem",iQ=se.forwardRef((t,e)=>{const n=rQ(DC,t.__scopeToggleGroup),r=ONe(DC,t.__scopeToggleGroup),s=tQ(t.__scopeToggleGroup),i=n.value.includes(t.value),a=r.disabled||t.disabled,o={...t,pressed:i,disabled:a},c=se.useRef(null);return r.rovingFocus?P.jsx(T_,{asChild:!0,...s,focusable:!a,active:i,ref:c,children:P.jsx(Qz,{...o,ref:e})}):P.jsx(Qz,{...o,ref:e})});iQ.displayName=DC;var Qz=se.forwardRef((t,e)=>{const{__scopeToggleGroup:n,value:r,...s}=t,i=rQ(DC,n),a={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},o=i.type==="single"?a:void 0;return P.jsx(k$,{...o,...s,ref:e,onPressedChange:c=>{c?i.onItemActivate(r):i.onItemDeactivate(r)}})}),oQ=N$,aQ=iQ;const lQ=_.createContext({size:"default",variant:"default"}),MNe=_.forwardRef(({className:t,variant:e,size:n,children:r,...s},i)=>P.jsx(oQ,{ref:i,className:le("flex items-center justify-center gap-1",t),...s,children:P.jsx(lQ.Provider,{value:{variant:e,size:n},children:r})}));MNe.displayName=oQ.displayName;const LNe=_.forwardRef(({className:t,children:e,variant:n,size:r,...s},i)=>{const a=_.useContext(lQ);return P.jsx(aQ,{ref:i,className:le(JX({variant:a.variant||n,size:a.size||r}),t),...s,children:e})});LNe.displayName=aQ.displayName;var[IA,FUe]=Nn("Tooltip",[Rl]),$A=Rl(),cQ="TooltipProvider",INe=700,OD="tooltip.open",[$Ne,D$]=IA(cQ),uQ=t=>{const{__scopeTooltip:e,delayDuration:n=INe,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,[a,o]=_.useState(!0),c=_.useRef(!1),u=_.useRef(0);return _.useEffect(()=>{const f=u.current;return()=>window.clearTimeout(f)},[]),P.jsx($Ne,{scope:e,isOpenDelayed:a,delayDuration:n,onOpen:_.useCallback(()=>{window.clearTimeout(u.current),o(!1)},[]),onClose:_.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>o(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:_.useCallback(f=>{c.current=f},[]),disableHoverableContent:s,children:i})};uQ.displayName=cQ;var FA="Tooltip",[FNe,jA]=IA(FA),dQ=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s=!1,onOpenChange:i,disableHoverableContent:a,delayDuration:o}=t,c=D$(FA,t.__scopeTooltip),u=$A(e),[f,l]=_.useState(null),d=qr(),m=_.useRef(0),p=a??c.disableHoverableContent,h=o??c.delayDuration,y=_.useRef(!1),[g=!1,v]=lr({prop:r,defaultProp:s,onChange:R=>{R?(c.onOpen(),document.dispatchEvent(new CustomEvent(OD))):c.onClose(),i==null||i(R)}}),w=_.useMemo(()=>g?y.current?"delayed-open":"instant-open":"closed",[g]),x=_.useCallback(()=>{window.clearTimeout(m.current),y.current=!1,v(!0)},[v]),A=_.useCallback(()=>{window.clearTimeout(m.current),v(!1)},[v]),T=_.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,v(!0)},h)},[h,v]);return _.useEffect(()=>()=>window.clearTimeout(m.current),[]),P.jsx(vA,{...u,children:P.jsx(FNe,{scope:e,contentId:d,open:g,stateAttribute:w,trigger:f,onTriggerChange:l,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayed?T():x()},[c.isOpenDelayed,T,x]),onTriggerLeave:_.useCallback(()=>{p?A():window.clearTimeout(m.current)},[A,p]),onOpen:x,onClose:A,disableHoverableContent:p,children:n})})};dQ.displayName=FA;var MD="TooltipTrigger",fQ=_.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=jA(MD,n),i=D$(MD,n),a=$A(n),o=_.useRef(null),c=tt(e,o,s.onTriggerChange),u=_.useRef(!1),f=_.useRef(!1),l=_.useCallback(()=>u.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener("pointerup",l),[l]),P.jsx($v,{asChild:!0,...a,children:P.jsx(Ne.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:me(t.onPointerMove,d=>{d.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:me(t.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:me(t.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",l,{once:!0})}),onFocus:me(t.onFocus,()=>{u.current||s.onOpen()}),onBlur:me(t.onBlur,s.onClose),onClick:me(t.onClick,s.onClose)})})});fQ.displayName=MD;var jNe="TooltipPortal",[jUe,BNe]=IA(jNe,{forceMount:void 0}),bv="TooltipContent",hQ=_.forwardRef((t,e)=>{const n=BNe(bv,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,a=jA(bv,t.__scopeTooltip);return P.jsx(Wn,{present:r||a.open,children:a.disableHoverableContent?P.jsx(pQ,{side:s,...i,ref:e}):P.jsx(zNe,{side:s,...i,ref:e})})}),zNe=_.forwardRef((t,e)=>{const n=jA(bv,t.__scopeTooltip),r=D$(bv,t.__scopeTooltip),s=_.useRef(null),i=tt(e,s),[a,o]=_.useState(null),{trigger:c,onClose:u}=n,f=s.current,{onPointerInTransitChange:l}=r,d=_.useCallback(()=>{o(null),l(!1)},[l]),m=_.useCallback((p,h)=>{const y=p.currentTarget,g={x:p.clientX,y:p.clientY},v=WNe(g,y.getBoundingClientRect()),w=GNe(g,v),x=qNe(h.getBoundingClientRect()),A=YNe([...w,...x]);o(A),l(!0)},[l]);return _.useEffect(()=>()=>d(),[d]),_.useEffect(()=>{if(c&&f){const p=y=>m(y,f),h=y=>m(y,c);return c.addEventListener("pointerleave",p),f.addEventListener("pointerleave",h),()=>{c.removeEventListener("pointerleave",p),f.removeEventListener("pointerleave",h)}}},[c,f,m,d]),_.useEffect(()=>{if(a){const p=h=>{const y=h.target,g={x:h.clientX,y:h.clientY},v=(c==null?void 0:c.contains(y))||(f==null?void 0:f.contains(y)),w=!KNe(g,a);v?d():w&&(d(),u())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[c,f,a,u,d]),P.jsx(pQ,{...t,ref:i})}),[UNe,HNe]=IA(FA,{isInside:!1}),pQ=_.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:a,...o}=t,c=jA(bv,n),u=$A(n),{onClose:f}=c;return _.useEffect(()=>(document.addEventListener(OD,f),()=>document.removeEventListener(OD,f)),[f]),_.useEffect(()=>{if(c.trigger){const l=d=>{const m=d.target;m!=null&&m.contains(c.trigger)&&f()};return window.addEventListener("scroll",l,{capture:!0}),()=>window.removeEventListener("scroll",l,{capture:!0})}},[c.trigger,f]),P.jsx(Jc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:l=>l.preventDefault(),onDismiss:f,children:P.jsxs(A_,{"data-state":c.stateAttribute,...u,...o,ref:e,style:{...o.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[P.jsx(hL,{children:r}),P.jsx(UNe,{scope:n,isInside:!0,children:P.jsx(E7,{id:c.contentId,role:"tooltip",children:s||r})})]})})});hQ.displayName=bv;var mQ="TooltipArrow",VNe=_.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=$A(n);return HNe(mQ,n).isInside?null:P.jsx(R_,{...s,...r,ref:e})});VNe.displayName=mQ;function WNe(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 GNe(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 qNe(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 KNe(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;ir!=f>r&&n<(u-o)*(r-c)/(f-c)+o&&(s=!s)}return s}function YNe(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),XNe(e)}function XNe(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const i=e[e.length-1],a=e[e.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.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],a=n[n.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.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 QNe=uQ,ZNe=dQ,JNe=fQ,gQ=hQ;const eDe=QNe,BUe=ZNe,zUe=JNe,tDe=_.forwardRef(({className:t,sideOffset:e=4,...n},r)=>P.jsx(gQ,{ref:r,sideOffset:e,className:le("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}));tDe.displayName=gQ.displayName;/** +Defaulting to \`null\`.`}var p9=u9,RPe=f9;const PPe=_.forwardRef(({className:t,value:e,...n},r)=>P.jsx(p9,{ref:r,className:le("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...n,children:P.jsx(RPe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));PPe.displayName=p9.displayName;var f$="Radio",[TPe,m9]=Nn(f$),[kPe,NPe]=TPe(f$),g9=_.forwardRef((t,e)=>{const{__scopeRadio:n,name:r,checked:s=!1,required:i,disabled:a,value:o="on",onCheck:c,...u}=t,[f,l]=_.useState(null),d=tt(e,h=>l(h)),m=_.useRef(!1),p=f?!!f.closest("form"):!0;return P.jsxs(kPe,{scope:n,checked:s,disabled:a,children:[P.jsx(Ne.button,{type:"button",role:"radio","aria-checked":s,"data-state":b9(s),"data-disabled":a?"":void 0,disabled:a,value:o,...u,ref:d,onClick:me(t.onClick,h=>{s||c==null||c(),p&&(m.current=h.isPropagationStopped(),m.current||h.stopPropagation())})}),p&&P.jsx(DPe,{control:f,bubbles:!m.current,name:r,value:o,checked:s,required:i,disabled:a,style:{transform:"translateX(-100%)"}})]})});g9.displayName=f$;var v9="RadioIndicator",y9=_.forwardRef((t,e)=>{const{__scopeRadio:n,forceMount:r,...s}=t,i=NPe(v9,n);return P.jsx(Wn,{present:r||i.checked,children:P.jsx(Ne.span,{"data-state":b9(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:e})})});y9.displayName=v9;var DPe=t=>{const{control:e,checked:n,bubbles:r=!0,...s}=t,i=_.useRef(null),a=Mv(n),o=S_(e);return _.useEffect(()=>{const c=i.current,u=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(u,"checked").set;if(a!==n&&l){const d=new Event("click",{bubbles:r});l.call(c,n),c.dispatchEvent(d)}},[a,n,r]),P.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:i,style:{...t.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function b9(t){return t?"checked":"unchecked"}var OPe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],h$="RadioGroup",[MPe,AUe]=Nn(h$,[Pl,m9]),w9=Pl(),_9=m9(),[LPe,IPe]=MPe(h$),x9=_.forwardRef((t,e)=>{const{__scopeRadioGroup:n,name:r,defaultValue:s,value:i,required:a=!1,disabled:o=!1,orientation:c,dir:u,loop:f=!0,onValueChange:l,...d}=t,m=w9(n),p=Da(u),[h,y]=lr({prop:i,defaultProp:s,onChange:l});return P.jsx(LPe,{scope:n,name:r,required:a,disabled:o,value:h,onValueChange:y,children:P.jsx(P_,{asChild:!0,...m,orientation:c,dir:p,loop:f,children:P.jsx(Ne.div,{role:"radiogroup","aria-required":a,"aria-orientation":c,"data-disabled":o?"":void 0,dir:p,...d,ref:e})})})});x9.displayName=h$;var S9="RadioGroupItem",E9=_.forwardRef((t,e)=>{const{__scopeRadioGroup:n,disabled:r,...s}=t,i=IPe(S9,n),a=i.disabled||r,o=w9(n),c=_9(n),u=_.useRef(null),f=tt(e,u),l=i.value===s.value,d=_.useRef(!1);return _.useEffect(()=>{const m=h=>{OPe.includes(h.key)&&(d.current=!0)},p=()=>d.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",p),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",p)}},[]),P.jsx(T_,{asChild:!0,...o,focusable:!a,active:l,children:P.jsx(g9,{disabled:a,required:i.required,checked:l,...c,...s,name:i.name,ref:f,onCheck:()=>i.onValueChange(s.value),onKeyDown:me(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:me(s.onFocus,()=>{var m;d.current&&((m=u.current)==null||m.click())})})})});E9.displayName=S9;var $Pe="RadioGroupIndicator",C9=_.forwardRef((t,e)=>{const{__scopeRadioGroup:n,...r}=t,s=_9(n);return P.jsx(y9,{...s,...r,ref:e})});C9.displayName=$Pe;var A9=x9,R9=E9,FPe=C9;const jPe=_.forwardRef(({className:t,...e},n)=>P.jsx(A9,{className:le("grid gap-2",t),...e,ref:n}));jPe.displayName=A9.displayName;const BPe=_.forwardRef(({className:t,...e},n)=>P.jsx(R9,{ref:n,className:le("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:P.jsx(FPe,{className:"flex items-center justify-center",children:P.jsx(G1,{className:"h-2.5 w-2.5 fill-current text-current"})})}));BPe.displayName=R9.displayName;const{createElement:vv,createContext:zPe,forwardRef:P9,useCallback:di,useContext:T9,useEffect:Mh,useImperativeHandle:k9,useLayoutEffect:UPe,useMemo:HPe,useRef:yi,useState:Gm}=r_,jz=r_[`useId${Math.random()}`.slice(0,5)],VPe=UPe,EA=zPe(null);EA.displayName="PanelGroupContext";const Lh=VPe,WPe=typeof jz=="function"?jz:()=>null;let GPe=0;function p$(t=null){const e=WPe(),n=yi(t||e||null);return n.current===null&&(n.current=""+GPe++),t??n.current}function N9({children:t,className:e="",collapsedSize:n,collapsible:r,defaultSize:s,forwardedRef:i,id:a,maxSize:o,minSize:c,onCollapse:u,onExpand:f,onResize:l,order:d,style:m,tagName:p="div",...h}){const y=T9(EA);if(y===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:g,expandPanel:v,getPanelSize:w,getPanelStyle:x,groupId:A,isPanelCollapsed:T,reevaluatePanelConstraints:R,registerPanel:E,resizePanel:k,unregisterPanel:N}=y,O=p$(a),L=yi({callbacks:{onCollapse:u,onExpand:f,onResize:l},constraints:{collapsedSize:n,collapsible:r,defaultSize:s,maxSize:o,minSize:c},id:O,idIsFromProps:a!==void 0,order:d});yi({didLogMissingDefaultSizeWarning:!1}),Lh(()=>{const{callbacks:F,constraints:U}=L.current,Y={...U};L.current.id=O,L.current.idIsFromProps=a!==void 0,L.current.order=d,F.onCollapse=u,F.onExpand=f,F.onResize=l,U.collapsedSize=n,U.collapsible=r,U.defaultSize=s,U.maxSize=o,U.minSize=c,(Y.collapsedSize!==U.collapsedSize||Y.collapsible!==U.collapsible||Y.maxSize!==U.maxSize||Y.minSize!==U.minSize)&&R(L.current,Y)}),Lh(()=>{const F=L.current;return E(F),()=>{N(F)}},[d,O,E,N]),k9(i,()=>({collapse:()=>{g(L.current)},expand:F=>{v(L.current,F)},getId(){return O},getSize(){return w(L.current)},isCollapsed(){return T(L.current)},isExpanded(){return!T(L.current)},resize:F=>{k(L.current,F)}}),[g,v,w,T,O,k]);const I=x(L.current,s);return vv(p,{...h,children:t,className:e,id:a,style:{...I,...m},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":A,"data-panel-id":O,"data-panel-size":parseFloat(""+I.flexGrow).toFixed(1)})}const qPe=P9((t,e)=>vv(N9,{...t,forwardedRef:e}));N9.displayName="Panel";qPe.displayName="forwardRef(Panel)";let _D=null,Cf=null;function KPe(t,e){if(e){const n=(e&I9)!==0,r=(e&$9)!==0,s=(e&F9)!==0,i=(e&j9)!==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 YPe(){Cf!==null&&(document.head.removeChild(Cf),_D=null,Cf=null)}function KT(t,e){const n=KPe(t,e);_D!==n&&(_D=n,Cf===null&&(Cf=document.createElement("style"),document.head.appendChild(Cf)),Cf.innerHTML=`*{cursor: ${n}!important;}`)}function D9(t){return t.type==="keydown"}function O9(t){return t.type.startsWith("pointer")}function M9(t){return t.type.startsWith("mouse")}function CA(t){if(O9(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(M9(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function XPe(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function QPe(t,e,n){return t.xe.x&&t.ye.y}function ZPe(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:Uz(t),b:Uz(e)};let r;for(;n.a.at(-1)===n.b.at(-1);)t=n.a.pop(),e=n.b.pop(),r=t;Pt(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:zz(Bz(n.a)),b:zz(Bz(n.b))};if(s.a===s.b){const i=r.childNodes,a={a:n.a.at(-1),b:n.b.at(-1)};let o=i.length;for(;o--;){const c=i[o];if(c===a.a)return 1;if(c===a.b)return-1}}return Math.sign(s.a-s.b)}const JPe=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function eTe(t){var e;const n=getComputedStyle((e=L9(t))!==null&&e!==void 0?e:t).display;return n==="flex"||n==="inline-flex"}function tTe(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||eTe(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"||JPe.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function Bz(t){let e=t.length;for(;e--;){const n=t[e];if(Pt(n,"Missing node"),tTe(n))return n}return null}function zz(t){return t&&Number(getComputedStyle(t).zIndex)||0}function Uz(t){const e=[];for(;t;)e.push(t),t=L9(t);return e}function L9(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const I9=1,$9=2,F9=4,j9=8,nTe=XPe()==="coarse";let Ea=[],a0=!1,Mu=new Map,AA=new Map;const l0=new Set;function rTe(t,e,n,r,s){var i;const{ownerDocument:a}=e,o={direction:n,element:e,hitAreaMargins:r,setResizeHandlerState:s},c=(i=Mu.get(a))!==null&&i!==void 0?i:0;return Mu.set(a,c+1),l0.add(o),RC(),function(){var f;AA.delete(t),l0.delete(o);const l=(f=Mu.get(a))!==null&&f!==void 0?f:1;if(Mu.set(a,l-1),RC(),l===1&&Mu.delete(a),Ea.includes(o)){const d=Ea.indexOf(o);d>=0&&Ea.splice(d,1),g$()}}}function Hz(t){const{target:e}=t,{x:n,y:r}=CA(t);a0=!0,m$({target:e,x:n,y:r}),RC(),Ea.length>0&&(PC("down",t),t.preventDefault(),t.stopPropagation())}function Dy(t){const{x:e,y:n}=CA(t);if(t.buttons===0&&(a0=!1,PC("up",t)),!a0){const{target:r}=t;m$({target:r,x:e,y:n})}PC("move",t),g$(),Ea.length>0&&t.preventDefault()}function Xp(t){const{target:e}=t,{x:n,y:r}=CA(t);AA.clear(),a0=!1,Ea.length>0&&t.preventDefault(),PC("up",t),m$({target:e,x:n,y:r}),g$(),RC()}function m$({target:t,x:e,y:n}){Ea.splice(0);let r=null;t instanceof HTMLElement&&(r=t),l0.forEach(s=>{const{element:i,hitAreaMargins:a}=s,o=i.getBoundingClientRect(),{bottom:c,left:u,right:f,top:l}=o,d=nTe?a.coarse:a.fine;if(e>=u-d&&e<=f+d&&n>=l-d&&n<=c+d){if(r!==null&&i!==r&&!i.contains(r)&&!r.contains(i)&&ZPe(r,i)>0){let p=r,h=!1;for(;p&&!p.contains(i);){if(QPe(p.getBoundingClientRect(),o)){h=!0;break}p=p.parentElement}if(h)return}Ea.push(s)}})}function YT(t,e){AA.set(t,e)}function g$(){let t=!1,e=!1;Ea.forEach(r=>{const{direction:s}=r;s==="horizontal"?t=!0:e=!0});let n=0;AA.forEach(r=>{n|=r}),t&&e?KT("intersection",n):t?KT("horizontal",n):e?KT("vertical",n):YPe()}function RC(){Mu.forEach((t,e)=>{const{body:n}=e;n.removeEventListener("contextmenu",Xp),n.removeEventListener("pointerdown",Hz),n.removeEventListener("pointerleave",Dy),n.removeEventListener("pointermove",Dy)}),window.removeEventListener("pointerup",Xp),window.removeEventListener("pointercancel",Xp),l0.size>0&&(a0?(Ea.length>0&&Mu.forEach((t,e)=>{const{body:n}=e;t>0&&(n.addEventListener("contextmenu",Xp),n.addEventListener("pointerleave",Dy),n.addEventListener("pointermove",Dy))}),window.addEventListener("pointerup",Xp),window.addEventListener("pointercancel",Xp)):Mu.forEach((t,e)=>{const{body:n}=e;t>0&&(n.addEventListener("pointerdown",Hz,{capture:!0}),n.addEventListener("pointermove",Dy))}))}function PC(t,e){l0.forEach(n=>{const{setResizeHandlerState:r}=n,s=Ea.includes(n);r(t,s,e)})}function sTe(){const[t,e]=Gm(0);return di(()=>e(n=>n+1),[])}function Pt(t,e){if(!t)throw console.error(e),Error(e)}const v$=10;function Zh(t,e,n=v$){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function Tc(t,e,n=v$){return Zh(t,e,n)===0}function eo(t,e,n){return Zh(t,e,n)===0}function iTe(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?o:c,d=n[l];Pt(d,`No panel constraints found for index ${l}`);const{collapsedSize:m=0,collapsible:p,minSize:h=0}=d;if(p){const y=e[l];if(Pt(y!=null,`Previous layout not found for panel index ${l}`),eo(y,h)){const g=y-m;Zh(g,Math.abs(t))>0&&(t=t<0?0-g:g)}}}}{const l=t<0?1:-1;let d=t<0?c:o,m=0;for(;;){const h=e[d];Pt(h!=null,`Previous layout not found for panel index ${d}`);const g=Pm({panelConstraints:n,panelIndex:d,size:100})-h;if(m+=g,d+=l,d<0||d>=n.length)break}const p=Math.min(Math.abs(t),Math.abs(m));t=t<0?0-p:p}{let d=t<0?o:c;for(;d>=0&&d=0))break;t<0?d--:d++}}if(iTe(s,a))return s;{const l=t<0?c:o,d=e[l];Pt(d!=null,`Previous layout not found for panel index ${l}`);const m=d+u,p=Pm({panelConstraints:n,panelIndex:l,size:m});if(a[l]=p,!eo(p,m)){let h=m-p,g=t<0?c:o;for(;g>=0&&g0?g--:g++}}}const f=a.reduce((l,d)=>d+l,0);return eo(f,100)?a:s}function oTe({layout:t,panelsArray:e,pivotIndices:n}){let r=0,s=100,i=0,a=0;const o=n[0];Pt(o!=null,"No pivot index found"),e.forEach((l,d)=>{const{constraints:m}=l,{maxSize:p=100,minSize:h=0}=m;d===o?(r=h,s=p):(i+=h,a+=p)});const c=Math.min(s,100-i),u=Math.max(r,100-a),f=t[o];return{valueMax:c,valueMin:u,valueNow:f}}function c0(t,e=document){return Array.from(e.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${t}"]`))}function B9(t,e,n=document){const s=c0(t,n).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===e);return s??null}function z9(t,e,n){const r=B9(t,e,n);return r!=null?[r,r+1]:[-1,-1]}function U9(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 RA(t,e=document){const n=e.querySelector(`[data-panel-resize-handle-id="${t}"]`);return n||null}function aTe(t,e,n,r=document){var s,i,a,o;const c=RA(e,r),u=c0(t,r),f=c?u.indexOf(c):-1,l=(s=(i=n[f])===null||i===void 0?void 0:i.id)!==null&&s!==void 0?s:null,d=(a=(o=n[f+1])===null||o===void 0?void 0:o.id)!==null&&a!==void 0?a:null;return[l,d]}function lTe({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:r,panelDataArray:s,panelGroupElement:i,setLayout:a}){yi({didWarnAboutMissingResizeHandle:!1}),Lh(()=>{if(!i)return;const o=c0(n,i);for(let c=0;c{o.forEach((c,u)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[n,r,s,i]),Mh(()=>{if(!i)return;const o=e.current;Pt(o,"Eager values not found");const{panelDataArray:c}=o,u=U9(n,i);Pt(u!=null,`No group found for id "${n}"`);const f=c0(n,i);Pt(f,`No resize handles found for group id "${n}"`);const l=f.map(d=>{const m=d.getAttribute("data-panel-resize-handle-id");Pt(m,"Resize handle element has no handle id attribute");const[p,h]=aTe(n,m,c,i);if(p==null||h==null)return()=>{};const y=g=>{if(!g.defaultPrevented)switch(g.key){case"Enter":{g.preventDefault();const v=c.findIndex(w=>w.id===p);if(v>=0){const w=c[v];Pt(w,`No panel data found for index ${v}`);const x=r[v],{collapsedSize:A=0,collapsible:T,minSize:R=0}=w.constraints;if(x!=null&&T){const E=Ky({delta:eo(x,A)?R-A:A-x,initialLayout:r,panelConstraints:c.map(k=>k.constraints),pivotIndices:z9(n,m,i),prevLayout:r,trigger:"keyboard"});r!==E&&a(E)}}break}}};return d.addEventListener("keydown",y),()=>{d.removeEventListener("keydown",y)}});return()=>{l.forEach(d=>d())}},[i,t,e,n,r,s,a])}function Vz(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];Pt(i,`Panel data not found for index ${s}`);const{callbacks:a,constraints:o,id:c}=i,{collapsedSize:u=0,collapsible:f}=o,l=n[c];if(l==null||r!==l){n[c]=r;const{onCollapse:d,onExpand:m,onResize:p}=a;p&&p(r,l),f&&(d||m)&&(m&&(l==null||Tc(l,u))&&!Tc(r,u)&&m(),d&&(l==null||!Tc(l,u))&&Tc(r,u)&&d())}})}function _S(t,e){if(t.length!==e.length)return!1;for(let n=0;n{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...s)},e)}}function Wz(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 V9(t){return`react-resizable-panels:${t}`}function W9(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 G9(t,e){try{const n=V9(t),r=e.getItem(n);if(r){const s=JSON.parse(r);if(typeof s=="object"&&s!=null)return s}}catch{}return null}function pTe(t,e,n){var r,s;const i=(r=G9(t,n))!==null&&r!==void 0?r:{},a=W9(e);return(s=i[a])!==null&&s!==void 0?s:null}function mTe(t,e,n,r,s){var i;const a=V9(t),o=W9(e),c=(i=G9(t,s))!==null&&i!==void 0?i:{};c[o]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{s.setItem(a,JSON.stringify(c))}catch(u){console.error(u)}}function Gz({layout:t,panelConstraints:e}){const n=[...t],r=n.reduce((i,a)=>i+a,0);if(n.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!eo(r,100))for(let i=0;i(Wz(Yy),Yy.getItem(t)),setItem:(t,e)=>{Wz(Yy),Yy.setItem(t,e)}},qz={};function q9({autoSaveId:t=null,children:e,className:n="",direction:r,forwardedRef:s,id:i=null,onLayout:a=null,keyboardResizeBy:o=null,storage:c=Yy,style:u,tagName:f="div",...l}){const d=p$(i),m=yi(null),[p,h]=Gm(null),[y,g]=Gm([]),v=sTe(),w=yi({}),x=yi(new Map),A=yi(0),T=yi({autoSaveId:t,direction:r,dragState:p,id:d,keyboardResizeBy:o,onLayout:a,storage:c}),R=yi({layout:y,panelDataArray:[],panelDataArrayChanged:!1});yi({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),k9(s,()=>({getId:()=>T.current.id,getLayout:()=>{const{layout:K}=R.current;return K},setLayout:K=>{const{onLayout:Z}=T.current,{layout:ue,panelDataArray:de}=R.current,ie=Gz({layout:K,panelConstraints:de.map(be=>be.constraints)});Vz(ue,ie)||(g(ie),R.current.layout=ie,Z&&Z(ie),Qp(de,ie,w.current))}}),[]),Lh(()=>{T.current.autoSaveId=t,T.current.direction=r,T.current.dragState=p,T.current.id=d,T.current.onLayout=a,T.current.storage=c}),lTe({committedValuesRef:T,eagerValuesRef:R,groupId:d,layout:y,panelDataArray:R.current.panelDataArray,setLayout:g,panelGroupElement:m.current}),Mh(()=>{const{panelDataArray:K}=R.current;if(t){if(y.length===0||y.length!==K.length)return;let Z=qz[t];Z==null&&(Z=hTe(mTe,gTe),qz[t]=Z);const ue=[...K],de=new Map(x.current);Z(t,ue,de,y,c)}},[t,y,c]),Mh(()=>{});const E=di(K=>{const{onLayout:Z}=T.current,{layout:ue,panelDataArray:de}=R.current;if(K.constraints.collapsible){const ie=de.map(Me=>Me.constraints),{collapsedSize:be=0,panelSize:Ae,pivotIndices:_e}=af(de,K,ue);if(Pt(Ae!=null,`Panel size not found for panel "${K.id}"`),!Tc(Ae,be)){x.current.set(K.id,Ae);const De=am(de,K)===de.length-1?Ae-be:be-Ae,ye=Ky({delta:De,initialLayout:ue,panelConstraints:ie,pivotIndices:_e,prevLayout:ue,trigger:"imperative-api"});_S(ue,ye)||(g(ye),R.current.layout=ye,Z&&Z(ye),Qp(de,ye,w.current))}}},[]),k=di((K,Z)=>{const{onLayout:ue}=T.current,{layout:de,panelDataArray:ie}=R.current;if(K.constraints.collapsible){const be=ie.map(Fe=>Fe.constraints),{collapsedSize:Ae=0,panelSize:_e=0,minSize:Me=0,pivotIndices:De}=af(ie,K,de),ye=Z??Me;if(Tc(_e,Ae)){const Fe=x.current.get(K.id),ut=Fe!=null&&Fe>=ye?Fe:ye,vt=am(ie,K)===ie.length-1?_e-ut:ut-_e,An=Ky({delta:vt,initialLayout:de,panelConstraints:be,pivotIndices:De,prevLayout:de,trigger:"imperative-api"});_S(de,An)||(g(An),R.current.layout=An,ue&&ue(An),Qp(ie,An,w.current))}}},[]),N=di(K=>{const{layout:Z,panelDataArray:ue}=R.current,{panelSize:de}=af(ue,K,Z);return Pt(de!=null,`Panel size not found for panel "${K.id}"`),de},[]),O=di((K,Z)=>{const{panelDataArray:ue}=R.current,de=am(ue,K);return fTe({defaultSize:Z,dragState:p,layout:y,panelData:ue,panelIndex:de})},[p,y]),L=di(K=>{const{layout:Z,panelDataArray:ue}=R.current,{collapsedSize:de=0,collapsible:ie,panelSize:be}=af(ue,K,Z);return Pt(be!=null,`Panel size not found for panel "${K.id}"`),ie===!0&&Tc(be,de)},[]),I=di(K=>{const{layout:Z,panelDataArray:ue}=R.current,{collapsedSize:de=0,collapsible:ie,panelSize:be}=af(ue,K,Z);return Pt(be!=null,`Panel size not found for panel "${K.id}"`),!ie||Zh(be,de)>0},[]),F=di(K=>{const{panelDataArray:Z}=R.current;Z.push(K),Z.sort((ue,de)=>{const ie=ue.order,be=de.order;return ie==null&&be==null?0:ie==null?-1:be==null?1:ie-be}),R.current.panelDataArrayChanged=!0,v()},[v]);Lh(()=>{if(R.current.panelDataArrayChanged){R.current.panelDataArrayChanged=!1;const{autoSaveId:K,onLayout:Z,storage:ue}=T.current,{layout:de,panelDataArray:ie}=R.current;let be=null;if(K){const _e=pTe(K,ie,ue);_e&&(x.current=new Map(Object.entries(_e.expandToSizes)),be=_e.layout)}be==null&&(be=dTe({panelDataArray:ie}));const Ae=Gz({layout:be,panelConstraints:ie.map(_e=>_e.constraints)});Vz(de,Ae)||(g(Ae),R.current.layout=Ae,Z&&Z(Ae),Qp(ie,Ae,w.current))}}),Lh(()=>{const K=R.current;return()=>{K.layout=[]}},[]);const U=di(K=>function(ue){ue.preventDefault();const de=m.current;if(!de)return()=>null;const{direction:ie,dragState:be,id:Ae,keyboardResizeBy:_e,onLayout:Me}=T.current,{layout:De,panelDataArray:ye}=R.current,{initialLayout:Fe}=be??{},ut=z9(Ae,K,de);let Qe=uTe(ue,K,ie,be,_e,de);const vt=ie==="horizontal";document.dir==="rtl"&&vt&&(Qe=-Qe);const An=ye.map(Xt=>Xt.constraints),Yt=Ky({delta:Qe,initialLayout:Fe??De,panelConstraints:An,pivotIndices:ut,prevLayout:De,trigger:D9(ue)?"keyboard":"mouse-or-touch"}),gn=!_S(De,Yt);(O9(ue)||M9(ue))&&A.current!=Qe&&(A.current=Qe,gn?YT(K,0):vt?YT(K,Qe<0?I9:$9):YT(K,Qe<0?F9:j9)),gn&&(g(Yt),R.current.layout=Yt,Me&&Me(Yt),Qp(ye,Yt,w.current))},[]),Y=di((K,Z)=>{const{onLayout:ue}=T.current,{layout:de,panelDataArray:ie}=R.current,be=ie.map(Fe=>Fe.constraints),{panelSize:Ae,pivotIndices:_e}=af(ie,K,de);Pt(Ae!=null,`Panel size not found for panel "${K.id}"`);const De=am(ie,K)===ie.length-1?Ae-Z:Z-Ae,ye=Ky({delta:De,initialLayout:de,panelConstraints:be,pivotIndices:_e,prevLayout:de,trigger:"imperative-api"});_S(de,ye)||(g(ye),R.current.layout=ye,ue&&ue(ye),Qp(ie,ye,w.current))},[]),V=di((K,Z)=>{const{layout:ue,panelDataArray:de}=R.current,{collapsedSize:ie=0,collapsible:be}=Z,{collapsedSize:Ae=0,collapsible:_e,maxSize:Me=100,minSize:De=0}=K.constraints,{panelSize:ye}=af(de,K,ue);ye!=null&&(be&&_e&&Tc(ye,ie)?Tc(ie,Ae)||Y(K,Ae):yeMe&&Y(K,Me))},[Y]),H=di((K,Z)=>{const{direction:ue}=T.current,{layout:de}=R.current;if(!m.current)return;const ie=RA(K,m.current);Pt(ie,`Drag handle element not found for id "${K}"`);const be=H9(ue,Z);h({dragHandleId:K,dragHandleRect:ie.getBoundingClientRect(),initialCursorPosition:be,initialLayout:de})},[]),ee=di(()=>{h(null)},[]),re=di(K=>{const{panelDataArray:Z}=R.current,ue=am(Z,K);ue>=0&&(Z.splice(ue,1),delete w.current[K.id],R.current.panelDataArrayChanged=!0,v())},[v]),X=HPe(()=>({collapsePanel:E,direction:r,dragState:p,expandPanel:k,getPanelSize:N,getPanelStyle:O,groupId:d,isPanelCollapsed:L,isPanelExpanded:I,reevaluatePanelConstraints:V,registerPanel:F,registerResizeHandle:U,resizePanel:Y,startDragging:H,stopDragging:ee,unregisterPanel:re,panelGroupElement:m.current}),[E,p,r,k,N,O,d,L,I,V,F,U,Y,H,ee,re]),q={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return vv(EA.Provider,{value:X},vv(f,{...l,children:e,className:n,id:i,ref:m,style:{...q,...u},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":d}))}const vTe=P9((t,e)=>vv(q9,{...t,forwardedRef:e}));q9.displayName="PanelGroup";vTe.displayName="forwardRef(PanelGroup)";function am(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function af(t,e,n){const r=am(t,e),i=r===t.length-1?[r-1,r]:[r,r+1],a=n[r];return{...e.constraints,panelSize:a,pivotIndices:i}}function yTe({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:r}){Mh(()=>{if(t||n==null||r==null)return;const s=RA(e,r);if(s==null)return;const i=a=>{if(!a.defaultPrevented)switch(a.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{a.preventDefault(),n(a);break}case"F6":{a.preventDefault();const o=s.getAttribute("data-panel-group-id");Pt(o,`No group element found for id "${o}"`);const c=c0(o,r),u=B9(o,e,r);Pt(u!==null,`No resize element found for id "${e}"`);const f=a.shiftKey?u>0?u-1:c.length-1:u+1{s.removeEventListener("keydown",i)}},[r,t,e,n])}function bTe({children:t=null,className:e="",disabled:n=!1,hitAreaMargins:r,id:s,onBlur:i,onDragging:a,onFocus:o,style:c={},tabIndex:u=0,tagName:f="div",...l}){var d,m;const p=yi(null),h=yi({onDragging:a});Mh(()=>{h.current.onDragging=a});const y=T9(EA);if(y===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:g,groupId:v,registerResizeHandle:w,startDragging:x,stopDragging:A,panelGroupElement:T}=y,R=p$(s),[E,k]=Gm("inactive"),[N,O]=Gm(!1),[L,I]=Gm(null),F=yi({state:E});Lh(()=>{F.current.state=E}),Mh(()=>{if(n)I(null);else{const H=w(R);I(()=>H)}},[n,R,w]);const U=(d=r==null?void 0:r.coarse)!==null&&d!==void 0?d:15,Y=(m=r==null?void 0:r.fine)!==null&&m!==void 0?m:5;return Mh(()=>{if(n||L==null)return;const H=p.current;return Pt(H,"Element ref not attached"),rTe(R,H,g,{coarse:U,fine:Y},(re,X,q)=>{if(X)switch(re){case"down":{k("drag"),x(R,q);const{onDragging:K}=h.current;K&&K(!0);break}case"move":{const{state:K}=F.current;K!=="drag"&&k("hover"),L(q);break}case"up":{k("hover"),A();const{onDragging:K}=h.current;K&&K(!1);break}}else k("inactive")})},[U,g,n,Y,w,R,L,x,A]),yTe({disabled:n,handleId:R,resizeHandler:L,panelGroupElement:T}),vv(f,{...l,children:t,className:e,id:s,onBlur:()=>{O(!1),i==null||i()},onFocus:()=>{O(!0),o==null||o()},ref:p,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...c},tabIndex:u,"data-panel-group-direction":g,"data-panel-group-id":v,"data-resize-handle":"","data-resize-handle-active":E==="drag"?"pointer":N?"keyboard":void 0,"data-resize-handle-state":E,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":R})}bTe.displayName="PanelResizeHandle";function u0(t,[e,n]){return Math.min(n,Math.max(e,t))}function wTe(t,e){return _.useReducer((n,r)=>e[n][r]??n,t)}var y$="ScrollArea",[K9,RUe]=Nn(y$),[_Te,Go]=K9(y$),Y9=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:i=600,...a}=t,[o,c]=_.useState(null),[u,f]=_.useState(null),[l,d]=_.useState(null),[m,p]=_.useState(null),[h,y]=_.useState(null),[g,v]=_.useState(0),[w,x]=_.useState(0),[A,T]=_.useState(!1),[R,E]=_.useState(!1),k=tt(e,O=>c(O)),N=Da(s);return P.jsx(_Te,{scope:n,type:r,dir:N,scrollHideDelay:i,scrollArea:o,viewport:u,onViewportChange:f,content:l,onContentChange:d,scrollbarX:m,onScrollbarXChange:p,scrollbarXEnabled:A,onScrollbarXEnabledChange:T,scrollbarY:h,onScrollbarYChange:y,scrollbarYEnabled:R,onScrollbarYEnabledChange:E,onCornerWidthChange:v,onCornerHeightChange:x,children:P.jsx(Ne.div,{dir:N,...a,ref:k,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":w+"px",...t.style}})})});Y9.displayName=y$;var X9="ScrollAreaViewport",Q9=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,nonce:s,...i}=t,a=Go(X9,n),o=_.useRef(null),c=tt(e,o,a.onViewportChange);return P.jsxs(P.Fragment,{children:[P.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}),P.jsx(Ne.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...t.style},children:P.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Q9.displayName=X9;var kl="ScrollAreaScrollbar",b$=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Go(kl,t.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=s,o=t.orientation==="horizontal";return _.useEffect(()=>(o?i(!0):a(!0),()=>{o?i(!1):a(!1)}),[o,i,a]),s.type==="hover"?P.jsx(xTe,{...r,ref:e,forceMount:n}):s.type==="scroll"?P.jsx(STe,{...r,ref:e,forceMount:n}):s.type==="auto"?P.jsx(Z9,{...r,ref:e,forceMount:n}):s.type==="always"?P.jsx(w$,{...r,ref:e}):null});b$.displayName=kl;var xTe=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Go(kl,t.__scopeScrollArea),[i,a]=_.useState(!1);return _.useEffect(()=>{const o=s.scrollArea;let c=0;if(o){const u=()=>{window.clearTimeout(c),a(!0)},f=()=>{c=window.setTimeout(()=>a(!1),s.scrollHideDelay)};return o.addEventListener("pointerenter",u),o.addEventListener("pointerleave",f),()=>{window.clearTimeout(c),o.removeEventListener("pointerenter",u),o.removeEventListener("pointerleave",f)}}},[s.scrollArea,s.scrollHideDelay]),P.jsx(Wn,{present:n||i,children:P.jsx(Z9,{"data-state":i?"visible":"hidden",...r,ref:e})})}),STe=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Go(kl,t.__scopeScrollArea),i=t.orientation==="horizontal",a=TA(()=>c("SCROLL_END"),100),[o,c]=wTe("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return _.useEffect(()=>{if(o==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[o,s.scrollHideDelay,c]),_.useEffect(()=>{const u=s.viewport,f=i?"scrollLeft":"scrollTop";if(u){let l=u[f];const d=()=>{const m=u[f];l!==m&&(c("SCROLL"),a()),l=m};return u.addEventListener("scroll",d),()=>u.removeEventListener("scroll",d)}},[s.viewport,i,c,a]),P.jsx(Wn,{present:n||o!=="hidden",children:P.jsx(w$,{"data-state":o==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:me(t.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:me(t.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Z9=_.forwardRef((t,e)=>{const n=Go(kl,t.__scopeScrollArea),{forceMount:r,...s}=t,[i,a]=_.useState(!1),o=t.orientation==="horizontal",c=TA(()=>{if(n.viewport){const u=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=t,s=Go(kl,t.__scopeScrollArea),i=_.useRef(null),a=_.useRef(0),[o,c]=_.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=rY(o.viewport,o.content),f={...r,sizes:o,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:d=>i.current=d,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:d=>a.current=d};function l(d,m){return TTe(d,a.current,o,m)}return n==="horizontal"?P.jsx(ETe,{...f,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const d=s.viewport.scrollLeft,m=Kz(d,o,s.dir);i.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:d=>{s.viewport&&(s.viewport.scrollLeft=d)},onDragScroll:d=>{s.viewport&&(s.viewport.scrollLeft=l(d,s.dir))}}):n==="vertical"?P.jsx(CTe,{...f,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const d=s.viewport.scrollTop,m=Kz(d,o);i.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:d=>{s.viewport&&(s.viewport.scrollTop=d)},onDragScroll:d=>{s.viewport&&(s.viewport.scrollTop=l(d))}}):null}),ETe=_.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=Go(kl,t.__scopeScrollArea),[a,o]=_.useState(),c=_.useRef(null),u=tt(e,c,i.onScrollbarXChange);return _.useEffect(()=>{c.current&&o(getComputedStyle(c.current))},[c]),P.jsx(eY,{"data-orientation":"horizontal",...s,ref:u,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":PA(n)+"px",...t.style},onThumbPointerDown:f=>t.onThumbPointerDown(f.x),onDragScroll:f=>t.onDragScroll(f.x),onWheelScroll:(f,l)=>{if(i.viewport){const d=i.viewport.scrollLeft+f.deltaX;t.onWheelScroll(d),iY(d,l)&&f.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:kC(a.paddingLeft),paddingEnd:kC(a.paddingRight)}})}})}),CTe=_.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=Go(kl,t.__scopeScrollArea),[a,o]=_.useState(),c=_.useRef(null),u=tt(e,c,i.onScrollbarYChange);return _.useEffect(()=>{c.current&&o(getComputedStyle(c.current))},[c]),P.jsx(eY,{"data-orientation":"vertical",...s,ref:u,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":PA(n)+"px",...t.style},onThumbPointerDown:f=>t.onThumbPointerDown(f.y),onDragScroll:f=>t.onDragScroll(f.y),onWheelScroll:(f,l)=>{if(i.viewport){const d=i.viewport.scrollTop+f.deltaY;t.onWheelScroll(d),iY(d,l)&&f.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:kC(a.paddingTop),paddingEnd:kC(a.paddingBottom)}})}})}),[ATe,J9]=K9(kl),eY=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:o,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:f,onResize:l,...d}=t,m=Go(kl,n),[p,h]=_.useState(null),y=tt(e,k=>h(k)),g=_.useRef(null),v=_.useRef(""),w=m.viewport,x=r.content-r.viewport,A=zt(f),T=zt(c),R=TA(l,10);function E(k){if(g.current){const N=k.clientX-g.current.left,O=k.clientY-g.current.top;u({x:N,y:O})}}return _.useEffect(()=>{const k=N=>{const O=N.target;(p==null?void 0:p.contains(O))&&A(N,x)};return document.addEventListener("wheel",k,{passive:!1}),()=>document.removeEventListener("wheel",k,{passive:!1})},[w,p,x,A]),_.useEffect(T,[r,T]),yv(p,R),yv(m.content,R),P.jsx(ATe,{scope:n,scrollbar:p,hasThumb:s,onThumbChange:zt(i),onThumbPointerUp:zt(a),onThumbPositionChange:T,onThumbPointerDown:zt(o),children:P.jsx(Ne.div,{...d,ref:y,style:{position:"absolute",...d.style},onPointerDown:me(t.onPointerDown,k=>{k.button===0&&(k.target.setPointerCapture(k.pointerId),g.current=p.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),E(k))}),onPointerMove:me(t.onPointerMove,E),onPointerUp:me(t.onPointerUp,k=>{const N=k.target;N.hasPointerCapture(k.pointerId)&&N.releasePointerCapture(k.pointerId),document.body.style.webkitUserSelect=v.current,m.viewport&&(m.viewport.style.scrollBehavior=""),g.current=null})})})}),TC="ScrollAreaThumb",tY=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=J9(TC,t.__scopeScrollArea);return P.jsx(Wn,{present:n||s.hasThumb,children:P.jsx(RTe,{ref:e,...r})})}),RTe=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...s}=t,i=Go(TC,n),a=J9(TC,n),{onThumbPositionChange:o}=a,c=tt(e,l=>a.onThumbChange(l)),u=_.useRef(),f=TA(()=>{u.current&&(u.current(),u.current=void 0)},100);return _.useEffect(()=>{const l=i.viewport;if(l){const d=()=>{if(f(),!u.current){const m=kTe(l,o);u.current=m,o()}};return o(),l.addEventListener("scroll",d),()=>l.removeEventListener("scroll",d)}},[i.viewport,f,o]),P.jsx(Ne.div,{"data-state":a.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:me(t.onPointerDownCapture,l=>{const m=l.target.getBoundingClientRect(),p=l.clientX-m.left,h=l.clientY-m.top;a.onThumbPointerDown({x:p,y:h})}),onPointerUp:me(t.onPointerUp,a.onThumbPointerUp)})});tY.displayName=TC;var _$="ScrollAreaCorner",nY=_.forwardRef((t,e)=>{const n=Go(_$,t.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?P.jsx(PTe,{...t,ref:e}):null});nY.displayName=_$;var PTe=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,...r}=t,s=Go(_$,n),[i,a]=_.useState(0),[o,c]=_.useState(0),u=!!(i&&o);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),a(f)}),u?P.jsx(Ne.div,{...r,ref:e,style:{width:i,height:o,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function kC(t){return t?parseInt(t,10):0}function rY(t,e){const n=t/e;return isNaN(n)?0:n}function PA(t){const e=rY(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function TTe(t,e,n,r="ltr"){const s=PA(n),i=s/2,a=e||i,o=s-a,c=n.scrollbar.paddingStart+a,u=n.scrollbar.size-n.scrollbar.paddingEnd-o,f=n.content-n.viewport,l=r==="ltr"?[0,f]:[f*-1,0];return sY([c,u],l)(t)}function Kz(t,e,n="ltr"){const r=PA(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=e.scrollbar.size-s,a=e.content-e.viewport,o=i-r,c=n==="ltr"?[0,a]:[a*-1,0],u=u0(t,c);return sY([0,a],[0,o])(u)}function sY(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 iY(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},a=n.left!==i.left,o=n.top!==i.top;(a||o)&&e(),n=i,r=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(r)};function TA(t,e){const n=zt(t),r=_.useRef(0);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),_.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function yv(t,e){const n=zt(e);$n(()=>{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 oY=Y9,NTe=Q9,DTe=nY;const OTe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(oY,{ref:r,className:le("relative overflow-hidden",t),...n,children:[P.jsx(NTe,{className:"h-full w-full rounded-[inherit]",children:e}),P.jsx(aY,{}),P.jsx(DTe,{})]}));OTe.displayName=oY.displayName;const aY=_.forwardRef(({className:t,orientation:e="vertical",...n},r)=>P.jsx(b$,{ref:r,orientation:e,className:le("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:P.jsx(tY,{className:"relative flex-1 rounded-full bg-border"})}));aY.displayName=b$.displayName;var MTe=[" ","Enter","ArrowUp","ArrowDown"],LTe=[" ","Enter"],F_="Select",[kA,NA,ITe]=Qc(F_),[zv,PUe]=Nn(F_,[ITe,Rl]),DA=Rl(),[$Te,Bd]=zv(F_),[FTe,jTe]=zv(F_),lY=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:s,onOpenChange:i,value:a,defaultValue:o,onValueChange:c,dir:u,name:f,autoComplete:l,disabled:d,required:m}=t,p=DA(e),[h,y]=_.useState(null),[g,v]=_.useState(null),[w,x]=_.useState(!1),A=Da(u),[T=!1,R]=lr({prop:r,defaultProp:s,onChange:i}),[E,k]=lr({prop:a,defaultProp:o,onChange:c}),N=_.useRef(null),O=h?!!h.closest("form"):!0,[L,I]=_.useState(new Set),F=Array.from(L).map(U=>U.props.value).join(";");return P.jsx(vA,{...p,children:P.jsxs($Te,{required:m,scope:e,trigger:h,onTriggerChange:y,valueNode:g,onValueNodeChange:v,valueNodeHasChildren:w,onValueNodeHasChildrenChange:x,contentId:qr(),value:E,onValueChange:k,open:T,onOpenChange:R,dir:A,triggerPointerDownPosRef:N,disabled:d,children:[P.jsx(kA.Provider,{scope:e,children:P.jsx(FTe,{scope:t.__scopeSelect,onNativeOptionAdd:_.useCallback(U=>{I(Y=>new Set(Y).add(U))},[]),onNativeOptionRemove:_.useCallback(U=>{I(Y=>{const V=new Set(Y);return V.delete(U),V})},[]),children:n})}),O?P.jsxs(OY,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:l,value:E,onChange:U=>k(U.target.value),disabled:d,children:[E===void 0?P.jsx("option",{value:""}):null,Array.from(L)]},F):null]})})};lY.displayName=F_;var cY="SelectTrigger",uY=_.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...s}=t,i=DA(n),a=Bd(cY,n),o=a.disabled||r,c=tt(e,a.onTriggerChange),u=NA(n),[f,l,d]=MY(p=>{const h=u().filter(v=>!v.disabled),y=h.find(v=>v.value===a.value),g=LY(h,p,y);g!==void 0&&a.onValueChange(g.value)}),m=()=>{o||(a.onOpenChange(!0),d())};return P.jsx($v,{asChild:!0,...i,children:P.jsx(Ne.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":DY(a.value)?"":void 0,...s,ref:c,onClick:me(s.onClick,p=>{p.currentTarget.focus()}),onPointerDown:me(s.onPointerDown,p=>{const h=p.target;h.hasPointerCapture(p.pointerId)&&h.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&(m(),a.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)},p.preventDefault())}),onKeyDown:me(s.onKeyDown,p=>{const h=f.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&l(p.key),!(h&&p.key===" ")&&MTe.includes(p.key)&&(m(),p.preventDefault())})})})});uY.displayName=cY;var dY="SelectValue",fY=_.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:a="",...o}=t,c=Bd(dY,n),{onValueNodeHasChildrenChange:u}=c,f=i!==void 0,l=tt(e,c.onValueNodeChange);return $n(()=>{u(f)},[u,f]),P.jsx(Ne.span,{...o,ref:l,style:{pointerEvents:"none"},children:DY(c.value)?P.jsx(P.Fragment,{children:a}):i})});fY.displayName=dY;var BTe="SelectIcon",hY=_.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...s}=t;return P.jsx(Ne.span,{"aria-hidden":!0,...s,ref:e,children:r||"▼"})});hY.displayName=BTe;var zTe="SelectPortal",pY=t=>P.jsx(Pv,{asChild:!0,...t});pY.displayName=zTe;var Jh="SelectContent",mY=_.forwardRef((t,e)=>{const n=Bd(Jh,t.__scopeSelect),[r,s]=_.useState();if($n(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?Ms.createPortal(P.jsx(gY,{scope:t.__scopeSelect,children:P.jsx(kA.Slot,{scope:t.__scopeSelect,children:P.jsx("div",{children:t.children})})}),i):null}return P.jsx(vY,{...t,ref:e})});mY.displayName=Jh;var Ql=10,[gY,zd]=zv(Jh),UTe="SelectContentImpl",vY=_.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:a,side:o,sideOffset:c,align:u,alignOffset:f,arrowPadding:l,collisionBoundary:d,collisionPadding:m,sticky:p,hideWhenDetached:h,avoidCollisions:y,...g}=t,v=Bd(Jh,n),[w,x]=_.useState(null),[A,T]=_.useState(null),R=tt(e,ie=>x(ie)),[E,k]=_.useState(null),[N,O]=_.useState(null),L=NA(n),[I,F]=_.useState(!1),U=_.useRef(!1);_.useEffect(()=>{if(w)return Tv(w)},[w]),q1();const Y=_.useCallback(ie=>{const[be,...Ae]=L().map(De=>De.ref.current),[_e]=Ae.slice(-1),Me=document.activeElement;for(const De of ie)if(De===Me||(De==null||De.scrollIntoView({block:"nearest"}),De===be&&A&&(A.scrollTop=0),De===_e&&A&&(A.scrollTop=A.scrollHeight),De==null||De.focus(),document.activeElement!==Me))return},[L,A]),V=_.useCallback(()=>Y([E,w]),[Y,E,w]);_.useEffect(()=>{I&&V()},[I,V]);const{onOpenChange:H,triggerPointerDownPosRef:ee}=v;_.useEffect(()=>{if(w){let ie={x:0,y:0};const be=_e=>{var Me,De;ie={x:Math.abs(Math.round(_e.pageX)-(((Me=ee.current)==null?void 0:Me.x)??0)),y:Math.abs(Math.round(_e.pageY)-(((De=ee.current)==null?void 0:De.y)??0))}},Ae=_e=>{ie.x<=10&&ie.y<=10?_e.preventDefault():w.contains(_e.target)||H(!1),document.removeEventListener("pointermove",be),ee.current=null};return ee.current!==null&&(document.addEventListener("pointermove",be),document.addEventListener("pointerup",Ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",be),document.removeEventListener("pointerup",Ae,{capture:!0})}}},[w,H,ee]),_.useEffect(()=>{const ie=()=>H(!1);return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[H]);const[re,X]=MY(ie=>{const be=L().filter(Me=>!Me.disabled),Ae=be.find(Me=>Me.ref.current===document.activeElement),_e=LY(be,ie,Ae);_e&&setTimeout(()=>_e.ref.current.focus())}),q=_.useCallback((ie,be,Ae)=>{const _e=!U.current&&!Ae;(v.value!==void 0&&v.value===be||_e)&&(k(ie),_e&&(U.current=!0))},[v.value]),K=_.useCallback(()=>w==null?void 0:w.focus(),[w]),Z=_.useCallback((ie,be,Ae)=>{const _e=!U.current&&!Ae;(v.value!==void 0&&v.value===be||_e)&&O(ie)},[v.value]),ue=r==="popper"?xD:yY,de=ue===xD?{side:o,sideOffset:c,align:u,alignOffset:f,arrowPadding:l,collisionBoundary:d,collisionPadding:m,sticky:p,hideWhenDetached:h,avoidCollisions:y}:{};return P.jsx(gY,{scope:n,content:w,viewport:A,onViewportChange:T,itemRefCallback:q,selectedItem:E,onItemLeave:K,itemTextRefCallback:Z,focusSelectedItem:V,selectedItemText:N,position:r,isPositioned:I,searchRef:re,children:P.jsx(h_,{as:Aa,allowPinchZoom:!0,children:P.jsx(f_,{asChild:!0,trapped:v.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:me(s,ie=>{var be;(be=v.trigger)==null||be.focus({preventScroll:!0}),ie.preventDefault()}),children:P.jsx(Jc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:P.jsx(ue,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:ie=>ie.preventDefault(),...g,...de,onPlaced:()=>F(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:me(g.onKeyDown,ie=>{const be=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!be&&ie.key.length===1&&X(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let _e=L().filter(Me=>!Me.disabled).map(Me=>Me.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(_e=_e.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const Me=ie.target,De=_e.indexOf(Me);_e=_e.slice(De+1)}setTimeout(()=>Y(_e)),ie.preventDefault()}})})})})})})});vY.displayName=UTe;var HTe="SelectItemAlignedPosition",yY=_.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...s}=t,i=Bd(Jh,n),a=zd(Jh,n),[o,c]=_.useState(null),[u,f]=_.useState(null),l=tt(e,R=>f(R)),d=NA(n),m=_.useRef(!1),p=_.useRef(!0),{viewport:h,selectedItem:y,selectedItemText:g,focusSelectedItem:v}=a,w=_.useCallback(()=>{if(i.trigger&&i.valueNode&&o&&u&&h&&y&&g){const R=i.trigger.getBoundingClientRect(),E=u.getBoundingClientRect(),k=i.valueNode.getBoundingClientRect(),N=g.getBoundingClientRect();if(i.dir!=="rtl"){const Me=N.left-E.left,De=k.left-Me,ye=R.left-De,Fe=R.width+ye,ut=Math.max(Fe,E.width),Qe=window.innerWidth-Ql,vt=u0(De,[Ql,Qe-ut]);o.style.minWidth=Fe+"px",o.style.left=vt+"px"}else{const Me=E.right-N.right,De=window.innerWidth-k.right-Me,ye=window.innerWidth-R.right-De,Fe=R.width+ye,ut=Math.max(Fe,E.width),Qe=window.innerWidth-Ql,vt=u0(De,[Ql,Qe-ut]);o.style.minWidth=Fe+"px",o.style.right=vt+"px"}const O=d(),L=window.innerHeight-Ql*2,I=h.scrollHeight,F=window.getComputedStyle(u),U=parseInt(F.borderTopWidth,10),Y=parseInt(F.paddingTop,10),V=parseInt(F.borderBottomWidth,10),H=parseInt(F.paddingBottom,10),ee=U+Y+I+H+V,re=Math.min(y.offsetHeight*5,ee),X=window.getComputedStyle(h),q=parseInt(X.paddingTop,10),K=parseInt(X.paddingBottom,10),Z=R.top+R.height/2-Ql,ue=L-Z,de=y.offsetHeight/2,ie=y.offsetTop+de,be=U+Y+ie,Ae=ee-be;if(be<=Z){const Me=y===O[O.length-1].ref.current;o.style.bottom="0px";const De=u.clientHeight-h.offsetTop-h.offsetHeight,ye=Math.max(ue,de+(Me?K:0)+De+V),Fe=be+ye;o.style.height=Fe+"px"}else{const Me=y===O[0].ref.current;o.style.top="0px";const ye=Math.max(Z,U+h.offsetTop+(Me?q:0)+de)+Ae;o.style.height=ye+"px",h.scrollTop=be-Z+h.offsetTop}o.style.margin=`${Ql}px 0`,o.style.minHeight=re+"px",o.style.maxHeight=L+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[d,i.trigger,i.valueNode,o,u,h,y,g,i.dir,r]);$n(()=>w(),[w]);const[x,A]=_.useState();$n(()=>{u&&A(window.getComputedStyle(u).zIndex)},[u]);const T=_.useCallback(R=>{R&&p.current===!0&&(w(),v==null||v(),p.current=!1)},[w,v]);return P.jsx(WTe,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:m,onScrollButtonChange:T,children:P.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:x},children:P.jsx(Ne.div,{...s,ref:l,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});yY.displayName=HTe;var VTe="SelectPopperPosition",xD=_.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Ql,...i}=t,a=DA(n);return P.jsx(A_,{...a,...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)"}})});xD.displayName=VTe;var[WTe,x$]=zv(Jh,{}),SD="SelectViewport",bY=_.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...s}=t,i=zd(SD,n),a=x$(SD,n),o=tt(e,i.onViewportChange),c=_.useRef(0);return P.jsxs(P.Fragment,{children:[P.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}),P.jsx(kA.Slot,{scope:n,children:P.jsx(Ne.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:o,style:{position:"relative",flex:1,overflow:"auto",...s.style},onScroll:me(s.onScroll,u=>{const f=u.currentTarget,{contentWrapper:l,shouldExpandOnScrollRef:d}=a;if(d!=null&&d.current&&l){const m=Math.abs(c.current-f.scrollTop);if(m>0){const p=window.innerHeight-Ql*2,h=parseFloat(l.style.minHeight),y=parseFloat(l.style.height),g=Math.max(h,y);if(g0?x:0,l.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});bY.displayName=SD;var wY="SelectGroup",[GTe,qTe]=zv(wY),KTe=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=qr();return P.jsx(GTe,{scope:n,id:s,children:P.jsx(Ne.div,{role:"group","aria-labelledby":s,...r,ref:e})})});KTe.displayName=wY;var _Y="SelectLabel",xY=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=qTe(_Y,n);return P.jsx(Ne.div,{id:s.id,...r,ref:e})});xY.displayName=_Y;var NC="SelectItem",[YTe,SY]=zv(NC),EY=_.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...a}=t,o=Bd(NC,n),c=zd(NC,n),u=o.value===r,[f,l]=_.useState(i??""),[d,m]=_.useState(!1),p=tt(e,g=>{var v;return(v=c.itemRefCallback)==null?void 0:v.call(c,g,r,s)}),h=qr(),y=()=>{s||(o.onValueChange(r),o.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 P.jsx(YTe,{scope:n,value:r,disabled:s,textId:h,isSelected:u,onItemTextChange:_.useCallback(g=>{l(v=>v||((g==null?void 0:g.textContent)??"").trim())},[]),children:P.jsx(kA.ItemSlot,{scope:n,value:r,disabled:s,textValue:f,children:P.jsx(Ne.div,{role:"option","aria-labelledby":h,"data-highlighted":d?"":void 0,"aria-selected":u&&d,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:p,onFocus:me(a.onFocus,()=>m(!0)),onBlur:me(a.onBlur,()=>m(!1)),onPointerUp:me(a.onPointerUp,y),onPointerMove:me(a.onPointerMove,g=>{var v;s?(v=c.onItemLeave)==null||v.call(c):g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:me(a.onPointerLeave,g=>{var v;g.currentTarget===document.activeElement&&((v=c.onItemLeave)==null||v.call(c))}),onKeyDown:me(a.onKeyDown,g=>{var w;((w=c.searchRef)==null?void 0:w.current)!==""&&g.key===" "||(LTe.includes(g.key)&&y(),g.key===" "&&g.preventDefault())})})})})});EY.displayName=NC;var Xy="SelectItemText",CY=_.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:s,...i}=t,a=Bd(Xy,n),o=zd(Xy,n),c=SY(Xy,n),u=jTe(Xy,n),[f,l]=_.useState(null),d=tt(e,g=>l(g),c.onItemTextChange,g=>{var v;return(v=o.itemTextRefCallback)==null?void 0:v.call(o,g,c.value,c.disabled)}),m=f==null?void 0:f.textContent,p=_.useMemo(()=>P.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:h,onNativeOptionRemove:y}=u;return $n(()=>(h(p),()=>y(p)),[h,y,p]),P.jsxs(P.Fragment,{children:[P.jsx(Ne.span,{id:c.textId,...i,ref:d}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Ms.createPortal(i.children,a.valueNode):null]})});CY.displayName=Xy;var AY="SelectItemIndicator",RY=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return SY(AY,n).isSelected?P.jsx(Ne.span,{"aria-hidden":!0,...r,ref:e}):null});RY.displayName=AY;var ED="SelectScrollUpButton",PY=_.forwardRef((t,e)=>{const n=zd(ED,t.__scopeSelect),r=x$(ED,t.__scopeSelect),[s,i]=_.useState(!1),a=tt(e,r.onScrollButtonChange);return $n(()=>{if(n.viewport&&n.isPositioned){let o=function(){const u=c.scrollTop>0;i(u)};const c=n.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),s?P.jsx(kY,{...t,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop-c.offsetHeight)}}):null});PY.displayName=ED;var CD="SelectScrollDownButton",TY=_.forwardRef((t,e)=>{const n=zd(CD,t.__scopeSelect),r=x$(CD,t.__scopeSelect),[s,i]=_.useState(!1),a=tt(e,r.onScrollButtonChange);return $n(()=>{if(n.viewport&&n.isPositioned){let o=function(){const u=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)c.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),s?P.jsx(kY,{...t,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop+c.offsetHeight)}}):null});TY.displayName=CD;var kY=_.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=t,i=zd("SelectScrollButton",n),a=_.useRef(null),o=NA(n),c=_.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return _.useEffect(()=>()=>c(),[c]),$n(()=>{var f;const u=o().find(l=>l.ref.current===document.activeElement);(f=u==null?void 0:u.ref.current)==null||f.scrollIntoView({block:"nearest"})},[o]),P.jsx(Ne.div,{"aria-hidden":!0,...s,ref:e,style:{flexShrink:0,...s.style},onPointerDown:me(s.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:me(s.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:me(s.onPointerLeave,()=>{c()})})}),XTe="SelectSeparator",NY=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return P.jsx(Ne.div,{"aria-hidden":!0,...r,ref:e})});NY.displayName=XTe;var AD="SelectArrow",QTe=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=DA(n),i=Bd(AD,n),a=zd(AD,n);return i.open&&a.position==="popper"?P.jsx(R_,{...s,...r,ref:e}):null});QTe.displayName=AD;function DY(t){return t===""||t===void 0}var OY=_.forwardRef((t,e)=>{const{value:n,...r}=t,s=_.useRef(null),i=tt(e,s),a=Mv(n);return _.useEffect(()=>{const o=s.current,c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==n&&f){const l=new Event("change",{bubbles:!0});f.call(o,n),o.dispatchEvent(l)}},[a,n]),P.jsx(I_,{asChild:!0,children:P.jsx("select",{...r,ref:i,defaultValue:n})})});OY.displayName="BubbleSelect";function MY(t){const e=zt(t),n=_.useRef(""),r=_.useRef(0),s=_.useCallback(a=>{const o=n.current+a;e(o),function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(o)},[e]),i=_.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function LY(t,e,n){const s=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let a=ZTe(t,Math.max(i,0));s.length===1&&(a=a.filter(u=>u!==n));const c=a.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function ZTe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var JTe=lY,IY=uY,eke=fY,tke=hY,nke=pY,$Y=mY,rke=bY,FY=xY,jY=EY,ske=CY,ike=RY,BY=PY,zY=TY,UY=NY;const TUe=JTe,kUe=eke,oke=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(IY,{ref:r,className:le("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,P.jsx(tke,{asChild:!0,children:P.jsx(W1,{className:"h-4 w-4 opacity-50"})})]}));oke.displayName=IY.displayName;const HY=_.forwardRef(({className:t,...e},n)=>P.jsx(BY,{ref:n,className:le("flex cursor-default items-center justify-center py-1",t),...e,children:P.jsx(Ife,{className:"h-4 w-4"})}));HY.displayName=BY.displayName;const VY=_.forwardRef(({className:t,...e},n)=>P.jsx(zY,{ref:n,className:le("flex cursor-default items-center justify-center py-1",t),...e,children:P.jsx(W1,{className:"h-4 w-4"})}));VY.displayName=zY.displayName;const ake=_.forwardRef(({className:t,children:e,position:n="popper",...r},s)=>P.jsx(nke,{children:P.jsxs($Y,{ref:s,className:le("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:[P.jsx(HY,{}),P.jsx(rke,{className:le("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),P.jsx(VY,{})]})}));ake.displayName=$Y.displayName;const lke=_.forwardRef(({className:t,...e},n)=>P.jsx(FY,{ref:n,className:le("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));lke.displayName=FY.displayName;const cke=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(jY,{ref:r,className:le("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:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(ike,{children:P.jsx(u_,{className:"h-4 w-4"})})}),P.jsx(ske,{children:e})]}));cke.displayName=jY.displayName;const uke=_.forwardRef(({className:t,...e},n)=>P.jsx(UY,{ref:n,className:le("-mx-1 my-1 h-px bg-muted",t),...e}));uke.displayName=UY.displayName;const dke=OL,fke=ML,hke=LL,WY=_.forwardRef(({className:t,...e},n)=>P.jsx(p_,{className:le("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}));WY.displayName=p_.displayName;const pke=ri("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"}}),GY=_.forwardRef(({side:t="right",className:e,children:n,...r},s)=>P.jsxs(hke,{children:[P.jsx(WY,{}),P.jsxs(m_,{ref:s,className:le(pke({side:t}),e),...r,children:[n,P.jsxs(y_,{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:[P.jsx(xL,{className:"h-4 w-4"}),P.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));GY.displayName=m_.displayName;const mke=_.forwardRef(({className:t,...e},n)=>P.jsx(g_,{ref:n,className:le("text-lg font-semibold text-foreground",t),...e}));mke.displayName=g_.displayName;const gke=_.forwardRef(({className:t,...e},n)=>P.jsx(v_,{ref:n,className:le("text-sm text-muted-foreground",t),...e}));gke.displayName=v_.displayName;var qY=["PageUp","PageDown"],KY=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],YY={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Uv="Slider",[RD,vke,yke]=Qc(Uv),[XY,NUe]=Nn(Uv,[yke]),[bke,OA]=XY(Uv),QY=_.forwardRef((t,e)=>{const{name:n,min:r=0,max:s=100,step:i=1,orientation:a="horizontal",disabled:o=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[r],value:f,onValueChange:l=()=>{},onValueCommit:d=()=>{},inverted:m=!1,...p}=t,h=_.useRef(new Set),y=_.useRef(0),v=a==="horizontal"?wke:_ke,[w=[],x]=lr({prop:f,defaultProp:u,onChange:N=>{var L;(L=[...h.current][y.current])==null||L.focus(),l(N)}}),A=_.useRef(w);function T(N){const O=Ake(w,N);k(N,O)}function R(N){k(N,y.current)}function E(){const N=A.current[y.current];w[y.current]!==N&&d(w)}function k(N,O,{commit:L}={commit:!1}){const I=kke(i),F=Nke(Math.round((N-r)/i)*i+r,I),U=u0(F,[r,s]);x((Y=[])=>{const V=Eke(Y,U,O);if(Tke(V,c*i)){y.current=V.indexOf(U);const H=String(V)!==String(Y);return H&&L&&d(V),H?V:Y}else return Y})}return P.jsx(bke,{scope:t.__scopeSlider,name:n,disabled:o,min:r,max:s,valueIndexToChangeRef:y,thumbs:h.current,values:w,orientation:a,children:P.jsx(RD.Provider,{scope:t.__scopeSlider,children:P.jsx(RD.Slot,{scope:t.__scopeSlider,children:P.jsx(v,{"aria-disabled":o,"data-disabled":o?"":void 0,...p,ref:e,onPointerDown:me(p.onPointerDown,()=>{o||(A.current=w)}),min:r,max:s,inverted:m,onSlideStart:o?void 0:T,onSlideMove:o?void 0:R,onSlideEnd:o?void 0:E,onHomeKeyDown:()=>!o&&k(r,0,{commit:!0}),onEndKeyDown:()=>!o&&k(s,w.length-1,{commit:!0}),onStepKeyDown:({event:N,direction:O})=>{if(!o){const F=qY.includes(N.key)||N.shiftKey&&KY.includes(N.key)?10:1,U=y.current,Y=w[U],V=i*F*O;k(Y+V,U,{commit:!0})}}})})})})});QY.displayName=Uv;var[ZY,JY]=XY(Uv,{startEdge:"left",endEdge:"right",size:"width",direction:1}),wke=_.forwardRef((t,e)=>{const{min:n,max:r,dir:s,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:c,onStepKeyDown:u,...f}=t,[l,d]=_.useState(null),m=tt(e,w=>d(w)),p=_.useRef(),h=Da(s),y=h==="ltr",g=y&&!i||!y&&i;function v(w){const x=p.current||l.getBoundingClientRect(),A=[0,x.width],R=S$(A,g?[n,r]:[r,n]);return p.current=x,R(w-x.left)}return P.jsx(ZY,{scope:t.__scopeSlider,startEdge:g?"left":"right",endEdge:g?"right":"left",direction:g?1:-1,size:"width",children:P.jsx(eX,{dir:h,"data-orientation":"horizontal",...f,ref:m,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const x=v(w.clientX);a==null||a(x)},onSlideMove:w=>{const x=v(w.clientX);o==null||o(x)},onSlideEnd:()=>{p.current=void 0,c==null||c()},onStepKeyDown:w=>{const A=YY[g?"from-left":"from-right"].includes(w.key);u==null||u({event:w,direction:A?-1:1})}})})}),_ke=_.forwardRef((t,e)=>{const{min:n,max:r,inverted:s,onSlideStart:i,onSlideMove:a,onSlideEnd:o,onStepKeyDown:c,...u}=t,f=_.useRef(null),l=tt(e,f),d=_.useRef(),m=!s;function p(h){const y=d.current||f.current.getBoundingClientRect(),g=[0,y.height],w=S$(g,m?[r,n]:[n,r]);return d.current=y,w(h-y.top)}return P.jsx(ZY,{scope:t.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:P.jsx(eX,{"data-orientation":"vertical",...u,ref:l,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:h=>{const y=p(h.clientY);i==null||i(y)},onSlideMove:h=>{const y=p(h.clientY);a==null||a(y)},onSlideEnd:()=>{d.current=void 0,o==null||o()},onStepKeyDown:h=>{const g=YY[m?"from-bottom":"from-top"].includes(h.key);c==null||c({event:h,direction:g?-1:1})}})})}),eX=_.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:o,onStepKeyDown:c,...u}=t,f=OA(Uv,n);return P.jsx(Ne.span,{...u,ref:e,onKeyDown:me(t.onKeyDown,l=>{l.key==="Home"?(a(l),l.preventDefault()):l.key==="End"?(o(l),l.preventDefault()):qY.concat(KY).includes(l.key)&&(c(l),l.preventDefault())}),onPointerDown:me(t.onPointerDown,l=>{const d=l.target;d.setPointerCapture(l.pointerId),l.preventDefault(),f.thumbs.has(d)?d.focus():r(l)}),onPointerMove:me(t.onPointerMove,l=>{l.target.hasPointerCapture(l.pointerId)&&s(l)}),onPointerUp:me(t.onPointerUp,l=>{const d=l.target;d.hasPointerCapture(l.pointerId)&&(d.releasePointerCapture(l.pointerId),i(l))})})}),tX="SliderTrack",nX=_.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=OA(tX,n);return P.jsx(Ne.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:e})});nX.displayName=tX;var PD="SliderRange",rX=_.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=OA(PD,n),i=JY(PD,n),a=_.useRef(null),o=tt(e,a),c=s.values.length,u=s.values.map(d=>iX(d,s.min,s.max)),f=c>1?Math.min(...u):0,l=100-Math.max(...u);return P.jsx(Ne.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:o,style:{...t.style,[i.startEdge]:f+"%",[i.endEdge]:l+"%"}})});rX.displayName=PD;var TD="SliderThumb",sX=_.forwardRef((t,e)=>{const n=vke(t.__scopeSlider),[r,s]=_.useState(null),i=tt(e,o=>s(o)),a=_.useMemo(()=>r?n().findIndex(o=>o.ref.current===r):-1,[n,r]);return P.jsx(xke,{...t,ref:i,index:a})}),xke=_.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:s,...i}=t,a=OA(TD,n),o=JY(TD,n),[c,u]=_.useState(null),f=tt(e,v=>u(v)),l=c?!!c.closest("form"):!0,d=S_(c),m=a.values[r],p=m===void 0?0:iX(m,a.min,a.max),h=Cke(r,a.values.length),y=d==null?void 0:d[o.size],g=y?Rke(y,p,o.direction):0;return _.useEffect(()=>{if(c)return a.thumbs.add(c),()=>{a.thumbs.delete(c)}},[c,a.thumbs]),P.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[o.startEdge]:`calc(${p}% + ${g}px)`},children:[P.jsx(RD.ItemSlot,{scope:t.__scopeSlider,children:P.jsx(Ne.span,{role:"slider","aria-label":t["aria-label"]||h,"aria-valuemin":a.min,"aria-valuenow":m,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...i,ref:f,style:m===void 0?{display:"none"}:t.style,onFocus:me(t.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),l&&P.jsx(Ske,{name:s??(a.name?a.name+(a.values.length>1?"[]":""):void 0),value:m},r)]})});sX.displayName=TD;var Ske=t=>{const{value:e,...n}=t,r=_.useRef(null),s=Mv(e);return _.useEffect(()=>{const i=r.current,a=window.HTMLInputElement.prototype,c=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&c){const u=new Event("input",{bubbles:!0});c.call(i,e),i.dispatchEvent(u)}},[s,e]),P.jsx("input",{style:{display:"none"},...n,ref:r,defaultValue:e})};function Eke(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}function iX(t,e,n){const i=100/(n-e)*(t-e);return u0(i,[0,100])}function Cke(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function Ake(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 Rke(t,e,n){const r=t/2,i=S$([0,50],[0,r]);return(r-i(e)*n)*n}function Pke(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function Tke(t,e){if(e>0){const n=Pke(t);return Math.min(...n)>=e}return!0}function S$(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 kke(t){return(String(t).split(".")[1]||"").length}function Nke(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var oX=QY,Dke=nX,Oke=rX,Mke=sX;const Lke=_.forwardRef(({className:t,...e},n)=>P.jsxs(oX,{ref:n,className:le("relative flex w-full touch-none select-none items-center",t),...e,children:[P.jsx(Dke,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:P.jsx(Oke,{className:"absolute h-full bg-primary"})}),P.jsx(Mke,{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"})]}));Lke.displayName=oX.displayName;var E$="Switch",[Ike,DUe]=Nn(E$),[$ke,Fke]=Ike(E$),aX=_.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:a,disabled:o,value:c="on",onCheckedChange:u,...f}=t,[l,d]=_.useState(null),m=tt(e,v=>d(v)),p=_.useRef(!1),h=l?!!l.closest("form"):!0,[y=!1,g]=lr({prop:s,defaultProp:i,onChange:u});return P.jsxs($ke,{scope:n,checked:y,disabled:o,children:[P.jsx(Ne.button,{type:"button",role:"switch","aria-checked":y,"aria-required":a,"data-state":uX(y),"data-disabled":o?"":void 0,disabled:o,value:c,...f,ref:m,onClick:me(t.onClick,v=>{g(w=>!w),h&&(p.current=v.isPropagationStopped(),p.current||v.stopPropagation())})}),h&&P.jsx(jke,{control:l,bubbles:!p.current,name:r,value:c,checked:y,required:a,disabled:o,style:{transform:"translateX(-100%)"}})]})});aX.displayName=E$;var lX="SwitchThumb",cX=_.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,s=Fke(lX,n);return P.jsx(Ne.span,{"data-state":uX(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:e})});cX.displayName=lX;var jke=t=>{const{control:e,checked:n,bubbles:r=!0,...s}=t,i=_.useRef(null),a=Mv(n),o=S_(e);return _.useEffect(()=>{const c=i.current,u=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(u,"checked").set;if(a!==n&&l){const d=new Event("click",{bubbles:r});l.call(c,n),c.dispatchEvent(d)}},[a,n,r]),P.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:i,style:{...t.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function uX(t){return t?"checked":"unchecked"}var dX=aX,Bke=cX;const zke=_.forwardRef(({className:t,...e},n)=>P.jsx(dX,{className:le("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:P.jsx(Bke,{className:le("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")})}));zke.displayName=dX.displayName;const Uke=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{className:"relative w-full overflow-auto",children:P.jsx("table",{ref:n,className:le("w-full caption-bottom text-sm",t),...e})}));Uke.displayName="Table";const Hke=_.forwardRef(({className:t,...e},n)=>P.jsx("thead",{ref:n,className:le("[&_tr]:border-b",t),...e}));Hke.displayName="TableHeader";const Vke=_.forwardRef(({className:t,...e},n)=>P.jsx("tbody",{ref:n,className:le("[&_tr:last-child]:border-0",t),...e}));Vke.displayName="TableBody";const Wke=_.forwardRef(({className:t,...e},n)=>P.jsx("tfoot",{ref:n,className:le("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));Wke.displayName="TableFooter";const Gke=_.forwardRef(({className:t,...e},n)=>P.jsx("tr",{ref:n,className:le("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...e}));Gke.displayName="TableRow";const qke=_.forwardRef(({className:t,...e},n)=>P.jsx("th",{ref:n,className:le("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...e}));qke.displayName="TableHead";const Kke=_.forwardRef(({className:t,...e},n)=>P.jsx("td",{ref:n,className:le("py-2 px-4 align-middle [&:has([role=checkbox])]:pr-0",t),...e}));Kke.displayName="TableCell";const Yke=_.forwardRef(({className:t,...e},n)=>P.jsx("caption",{ref:n,className:le("mt-4 text-sm text-muted-foreground",t),...e}));Yke.displayName="TableCaption";var C$="Tabs",[Xke,OUe]=Nn(C$,[Pl]),fX=Pl(),[Qke,A$]=Xke(C$),hX=_.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:a="horizontal",dir:o,activationMode:c="automatic",...u}=t,f=Da(o),[l,d]=lr({prop:r,onChange:s,defaultProp:i});return P.jsx(Qke,{scope:n,baseId:qr(),value:l,onValueChange:d,orientation:a,dir:f,activationMode:c,children:P.jsx(Ne.div,{dir:f,"data-orientation":a,...u,ref:e})})});hX.displayName=C$;var pX="TabsList",mX=_.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...s}=t,i=A$(pX,n),a=fX(n);return P.jsx(P_,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:P.jsx(Ne.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:e})})});mX.displayName=pX;var gX="TabsTrigger",vX=_.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=t,a=A$(gX,n),o=fX(n),c=wX(a.baseId,r),u=_X(a.baseId,r),f=r===a.value;return P.jsx(T_,{asChild:!0,...o,focusable:!s,active:f,children:P.jsx(Ne.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":u,"data-state":f?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...i,ref:e,onMouseDown:me(t.onMouseDown,l=>{!s&&l.button===0&&l.ctrlKey===!1?a.onValueChange(r):l.preventDefault()}),onKeyDown:me(t.onKeyDown,l=>{[" ","Enter"].includes(l.key)&&a.onValueChange(r)}),onFocus:me(t.onFocus,()=>{const l=a.activationMode!=="manual";!f&&!s&&l&&a.onValueChange(r)})})})});vX.displayName=gX;var yX="TabsContent",bX=_.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...a}=t,o=A$(yX,n),c=wX(o.baseId,r),u=_X(o.baseId,r),f=r===o.value,l=_.useRef(f);return _.useEffect(()=>{const d=requestAnimationFrame(()=>l.current=!1);return()=>cancelAnimationFrame(d)},[]),P.jsx(Wn,{present:s||f,children:({present:d})=>P.jsx(Ne.div,{"data-state":f?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":c,hidden:!d,id:u,tabIndex:0,...a,ref:e,style:{...t.style,animationDuration:l.current?"0s":void 0},children:d&&i})})});bX.displayName=yX;function wX(t,e){return`${t}-trigger-${e}`}function _X(t,e){return`${t}-content-${e}`}var Zke=hX,xX=mX,SX=vX,EX=bX;const MUe=Zke,Jke=_.forwardRef(({className:t,...e},n)=>P.jsx(xX,{ref:n,className:le("inline-flex h-9 items-center justify-center rounded-lg bg-accent p-1 text-muted-foreground",t),...e}));Jke.displayName=xX.displayName;const eNe=_.forwardRef(({className:t,...e},n)=>P.jsx(SX,{ref:n,className:le("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}));eNe.displayName=SX.displayName;const tNe=_.forwardRef(({className:t,...e},n)=>P.jsx(EX,{ref:n,className:le("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));tNe.displayName=EX.displayName;const CX=_.forwardRef(({className:t,...e},n)=>P.jsx("textarea",{className:le("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}));CX.displayName="Textarea";var R$="ToastProvider",[P$,nNe,rNe]=Qc("Toast"),[AX,LUe]=Nn("Toast",[rNe]),[sNe,MA]=AX(R$),RX=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:a}=t,[o,c]=_.useState(null),[u,f]=_.useState(0),l=_.useRef(!1),d=_.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${R$}\`. Expected non-empty \`string\`.`),P.jsx(P$.Provider,{scope:e,children:P.jsx(sNe,{scope:e,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:u,viewport:o,onViewportChange:c,onToastAdd:_.useCallback(()=>f(m=>m+1),[]),onToastRemove:_.useCallback(()=>f(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:l,isClosePausedRef:d,children:a})})};RX.displayName=R$;var PX="ToastViewport",iNe=["F8"],kD="toast.viewportPause",ND="toast.viewportResume",TX=_.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=iNe,label:s="Notifications ({hotkey})",...i}=t,a=MA(PX,n),o=nNe(n),c=_.useRef(null),u=_.useRef(null),f=_.useRef(null),l=_.useRef(null),d=tt(e,l,a.onViewportChange),m=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),p=a.toastCount>0;_.useEffect(()=>{const y=g=>{var w;r.every(x=>g[x]||g.code===x)&&((w=l.current)==null||w.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),_.useEffect(()=>{const y=c.current,g=l.current;if(p&&y&&g){const v=()=>{if(!a.isClosePausedRef.current){const T=new CustomEvent(kD);g.dispatchEvent(T),a.isClosePausedRef.current=!0}},w=()=>{if(a.isClosePausedRef.current){const T=new CustomEvent(ND);g.dispatchEvent(T),a.isClosePausedRef.current=!1}},x=T=>{!y.contains(T.relatedTarget)&&w()},A=()=>{y.contains(document.activeElement)||w()};return y.addEventListener("focusin",v),y.addEventListener("focusout",x),y.addEventListener("pointermove",v),y.addEventListener("pointerleave",A),window.addEventListener("blur",v),window.addEventListener("focus",w),()=>{y.removeEventListener("focusin",v),y.removeEventListener("focusout",x),y.removeEventListener("pointermove",v),y.removeEventListener("pointerleave",A),window.removeEventListener("blur",v),window.removeEventListener("focus",w)}}},[p,a.isClosePausedRef]);const h=_.useCallback(({tabbingDirection:y})=>{const v=o().map(w=>{const x=w.ref.current,A=[x,...yNe(x)];return y==="forwards"?A:A.reverse()});return(y==="forwards"?v.reverse():v).flat()},[o]);return _.useEffect(()=>{const y=l.current;if(y){const g=v=>{var A,T,R;const w=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!w){const E=document.activeElement,k=v.shiftKey;if(v.target===y&&k){(A=u.current)==null||A.focus();return}const L=h({tabbingDirection:k?"backwards":"forwards"}),I=L.findIndex(F=>F===E);XT(L.slice(I+1))?v.preventDefault():k?(T=u.current)==null||T.focus():(R=f.current)==null||R.focus()}};return y.addEventListener("keydown",g),()=>y.removeEventListener("keydown",g)}},[o,h]),P.jsxs(jhe,{ref:c,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:p?void 0:"none"},children:[p&&P.jsx(DD,{ref:u,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"forwards"});XT(y)}}),P.jsx(P$.Slot,{scope:n,children:P.jsx(Ne.ol,{tabIndex:-1,...i,ref:d})}),p&&P.jsx(DD,{ref:f,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"backwards"});XT(y)}})]})});TX.displayName=PX;var kX="ToastFocusProxy",DD=_.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=t,i=MA(kX,n);return P.jsx(I_,{"aria-hidden":!0,tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:a=>{var u;const o=a.relatedTarget;!((u=i.viewport)!=null&&u.contains(o))&&r()}})});DD.displayName=kX;var LA="Toast",oNe="toast.swipeStart",aNe="toast.swipeMove",lNe="toast.swipeCancel",cNe="toast.swipeEnd",NX=_.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...a}=t,[o=!0,c]=lr({prop:r,defaultProp:s,onChange:i});return P.jsx(Wn,{present:n||o,children:P.jsx(fNe,{open:o,...a,ref:e,onClose:()=>c(!1),onPause:zt(t.onPause),onResume:zt(t.onResume),onSwipeStart:me(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:me(t.onSwipeMove,u=>{const{x:f,y:l}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${l}px`)}),onSwipeCancel:me(t.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:me(t.onSwipeEnd,u=>{const{x:f,y:l}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${l}px`),c(!1)})})})});NX.displayName=LA;var[uNe,dNe]=AX(LA,{onClose(){}}),fNe=_.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:a,onEscapeKeyDown:o,onPause:c,onResume:u,onSwipeStart:f,onSwipeMove:l,onSwipeCancel:d,onSwipeEnd:m,...p}=t,h=MA(LA,n),[y,g]=_.useState(null),v=tt(e,F=>g(F)),w=_.useRef(null),x=_.useRef(null),A=s||h.duration,T=_.useRef(0),R=_.useRef(A),E=_.useRef(0),{onToastAdd:k,onToastRemove:N}=h,O=zt(()=>{var U;(y==null?void 0:y.contains(document.activeElement))&&((U=h.viewport)==null||U.focus()),a()}),L=_.useCallback(F=>{!F||F===1/0||(window.clearTimeout(E.current),T.current=new Date().getTime(),E.current=window.setTimeout(O,F))},[O]);_.useEffect(()=>{const F=h.viewport;if(F){const U=()=>{L(R.current),u==null||u()},Y=()=>{const V=new Date().getTime()-T.current;R.current=R.current-V,window.clearTimeout(E.current),c==null||c()};return F.addEventListener(kD,Y),F.addEventListener(ND,U),()=>{F.removeEventListener(kD,Y),F.removeEventListener(ND,U)}}},[h.viewport,A,c,u,L]),_.useEffect(()=>{i&&!h.isClosePausedRef.current&&L(A)},[i,A,h.isClosePausedRef,L]),_.useEffect(()=>(k(),()=>N()),[k,N]);const I=_.useMemo(()=>y?FX(y):null,[y]);return h.viewport?P.jsxs(P.Fragment,{children:[I&&P.jsx(hNe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:I}),P.jsx(uNe,{scope:n,onClose:O,children:Ms.createPortal(P.jsx(P$.ItemSlot,{scope:n,children:P.jsx(Fhe,{asChild:!0,onEscapeKeyDown:me(o,()=>{h.isFocusedToastEscapeKeyDownRef.current||O(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:P.jsx(Ne.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":h.swipeDirection,...p,ref:v,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:me(t.onKeyDown,F=>{F.key==="Escape"&&(o==null||o(F.nativeEvent),F.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,O()))}),onPointerDown:me(t.onPointerDown,F=>{F.button===0&&(w.current={x:F.clientX,y:F.clientY})}),onPointerMove:me(t.onPointerMove,F=>{if(!w.current)return;const U=F.clientX-w.current.x,Y=F.clientY-w.current.y,V=!!x.current,H=["left","right"].includes(h.swipeDirection),ee=["left","up"].includes(h.swipeDirection)?Math.min:Math.max,re=H?ee(0,U):0,X=H?0:ee(0,Y),q=F.pointerType==="touch"?10:2,K={x:re,y:X},Z={originalEvent:F,delta:K};V?(x.current=K,xS(aNe,l,Z,{discrete:!1})):Yz(K,h.swipeDirection,q)?(x.current=K,xS(oNe,f,Z,{discrete:!1}),F.target.setPointerCapture(F.pointerId)):(Math.abs(U)>q||Math.abs(Y)>q)&&(w.current=null)}),onPointerUp:me(t.onPointerUp,F=>{const U=x.current,Y=F.target;if(Y.hasPointerCapture(F.pointerId)&&Y.releasePointerCapture(F.pointerId),x.current=null,w.current=null,U){const V=F.currentTarget,H={originalEvent:F,delta:U};Yz(U,h.swipeDirection,h.swipeThreshold)?xS(cNe,m,H,{discrete:!0}):xS(lNe,d,H,{discrete:!0}),V.addEventListener("click",ee=>ee.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),hNe=t=>{const{__scopeToast:e,children:n,...r}=t,s=MA(LA,e),[i,a]=_.useState(!1),[o,c]=_.useState(!1);return gNe(()=>a(!0)),_.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),o?null:P.jsx(Pv,{asChild:!0,children:P.jsx(I_,{...r,children:i&&P.jsxs(P.Fragment,{children:[s.label," ",n]})})})},pNe="ToastTitle",DX=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return P.jsx(Ne.div,{...r,ref:e})});DX.displayName=pNe;var mNe="ToastDescription",OX=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return P.jsx(Ne.div,{...r,ref:e})});OX.displayName=mNe;var MX="ToastAction",LX=_.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?P.jsx($X,{altText:n,asChild:!0,children:P.jsx(T$,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${MX}\`. Expected non-empty \`string\`.`),null)});LX.displayName=MX;var IX="ToastClose",T$=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,s=dNe(IX,n);return P.jsx($X,{asChild:!0,children:P.jsx(Ne.button,{type:"button",...r,ref:e,onClick:me(t.onClick,s.onClose)})})});T$.displayName=IX;var $X=_.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...s}=t;return P.jsx(Ne.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function FX(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),vNe(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const a=r.dataset.radixToastAnnounceAlt;a&&e.push(a)}else e.push(...FX(r))}}),e}function xS(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?Jb(s,i):s.dispatchEvent(i)}var Yz=(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 gNe(t=()=>{}){const e=zt(t);$n(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function vNe(t){return t.nodeType===t.ELEMENT_NODE}function yNe(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 XT(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var bNe=RX,jX=TX,BX=NX,zX=DX,UX=OX,HX=LX,VX=T$;const wNe=bNe,WX=_.forwardRef(({className:t,...e},n)=>P.jsx(jX,{ref:n,className:le("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}));WX.displayName=jX.displayName;const _Ne=ri("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"}}),GX=_.forwardRef(({className:t,variant:e,...n},r)=>P.jsx(BX,{ref:r,className:le(_Ne({variant:e}),t),...n}));GX.displayName=BX.displayName;const xNe=_.forwardRef(({className:t,...e},n)=>P.jsx(HX,{ref:n,className:le("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}));xNe.displayName=HX.displayName;const qX=_.forwardRef(({className:t,...e},n)=>P.jsx(VX,{ref:n,className:le("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:P.jsx(xL,{className:"w-4 h-4"})}));qX.displayName=VX.displayName;const KX=_.forwardRef(({className:t,...e},n)=>P.jsx(zX,{ref:n,className:le("text-sm font-semibold",t),...e}));KX.displayName=zX.displayName;const YX=_.forwardRef(({className:t,...e},n)=>P.jsx(UX,{ref:n,className:le("text-sm opacity-90",t),...e}));YX.displayName=UX.displayName;const SNe=3,ENe=1e6;let QT=0;function CNe(){return QT=(QT+1)%Number.MAX_SAFE_INTEGER,QT.toString()}const ZT=new Map,Xz=t=>{if(ZT.has(t))return;const e=setTimeout(()=>{ZT.delete(t),Cb({type:"REMOVE_TOAST",toastId:t})},ENe);ZT.set(t,e)},ANe=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,SNe)};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?Xz(n):t.toasts.forEach(r=>{Xz(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)}}},ZS=[];let JS={toasts:[]};function Cb(t){JS=ANe(JS,t),ZS.forEach(e=>{e(JS)})}function RNe({...t}){const e=CNe(),n=s=>Cb({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>Cb({type:"DISMISS_TOAST",toastId:e});return Cb({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:n}}function XX(){const[t,e]=_.useState(JS);return _.useEffect(()=>(ZS.push(e),()=>{const n=ZS.indexOf(e);n>-1&&ZS.splice(n,1)}),[t]),{...t,toast:RNe,dismiss:n=>Cb({type:"DISMISS_TOAST",toastId:n})}}function QX(){const{toasts:t}=XX();return P.jsxs(wNe,{swipeDirection:"down",children:[t.map(function({id:e,title:n,description:r,action:s,...i}){return P.jsxs(GX,{...i,children:[P.jsxs("div",{className:"grid gap-1",children:[n&&P.jsx(KX,{children:n}),r&&P.jsx(YX,{children:r})]}),s,P.jsx(qX,{})]},e)}),P.jsx(WX,{className:"bottom-0 w-auto mx-auto sm:bottom-0 sm:left-0 sm:right-0"})]})}var PNe="Toggle",k$=_.forwardRef((t,e)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:s,...i}=t,[a=!1,o]=lr({prop:n,onChange:s,defaultProp:r});return P.jsx(Ne.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":t.disabled?"":void 0,...i,ref:e,onClick:me(t.onClick,()=>{t.disabled||o(!a)})})});k$.displayName=PNe;var ZX=k$;const JX=ri("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"}}),TNe=_.forwardRef(({className:t,variant:e,size:n,...r},s)=>P.jsx(ZX,{ref:s,className:le(JX({variant:e,size:n,className:t})),...r}));TNe.displayName=ZX.displayName;var Hv="ToggleGroup",[eQ,IUe]=Nn(Hv,[Pl]),tQ=Pl(),N$=se.forwardRef((t,e)=>{const{type:n,...r}=t;if(n==="single"){const s=r;return P.jsx(kNe,{...s,ref:e})}if(n==="multiple"){const s=r;return P.jsx(NNe,{...s,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${Hv}\``)});N$.displayName=Hv;var[nQ,rQ]=eQ(Hv),kNe=se.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=t,[a,o]=lr({prop:n,defaultProp:r,onChange:s});return P.jsx(nQ,{scope:t.__scopeToggleGroup,type:"single",value:a?[a]:[],onItemActivate:o,onItemDeactivate:se.useCallback(()=>o(""),[o]),children:P.jsx(sQ,{...i,ref:e})})}),NNe=se.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=t,[a=[],o]=lr({prop:n,defaultProp:r,onChange:s}),c=se.useCallback(f=>o((l=[])=>[...l,f]),[o]),u=se.useCallback(f=>o((l=[])=>l.filter(d=>d!==f)),[o]);return P.jsx(nQ,{scope:t.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:c,onItemDeactivate:u,children:P.jsx(sQ,{...i,ref:e})})});N$.displayName=Hv;var[DNe,ONe]=eQ(Hv),sQ=se.forwardRef((t,e)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:s=!0,orientation:i,dir:a,loop:o=!0,...c}=t,u=tQ(n),f=Da(a),l={role:"group",dir:f,...c};return P.jsx(DNe,{scope:n,rovingFocus:s,disabled:r,children:s?P.jsx(P_,{asChild:!0,...u,orientation:i,dir:f,loop:o,children:P.jsx(Ne.div,{...l,ref:e})}):P.jsx(Ne.div,{...l,ref:e})})}),DC="ToggleGroupItem",iQ=se.forwardRef((t,e)=>{const n=rQ(DC,t.__scopeToggleGroup),r=ONe(DC,t.__scopeToggleGroup),s=tQ(t.__scopeToggleGroup),i=n.value.includes(t.value),a=r.disabled||t.disabled,o={...t,pressed:i,disabled:a},c=se.useRef(null);return r.rovingFocus?P.jsx(T_,{asChild:!0,...s,focusable:!a,active:i,ref:c,children:P.jsx(Qz,{...o,ref:e})}):P.jsx(Qz,{...o,ref:e})});iQ.displayName=DC;var Qz=se.forwardRef((t,e)=>{const{__scopeToggleGroup:n,value:r,...s}=t,i=rQ(DC,n),a={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},o=i.type==="single"?a:void 0;return P.jsx(k$,{...o,...s,ref:e,onPressedChange:c=>{c?i.onItemActivate(r):i.onItemDeactivate(r)}})}),oQ=N$,aQ=iQ;const lQ=_.createContext({size:"default",variant:"default"}),MNe=_.forwardRef(({className:t,variant:e,size:n,children:r,...s},i)=>P.jsx(oQ,{ref:i,className:le("flex items-center justify-center gap-1",t),...s,children:P.jsx(lQ.Provider,{value:{variant:e,size:n},children:r})}));MNe.displayName=oQ.displayName;const LNe=_.forwardRef(({className:t,children:e,variant:n,size:r,...s},i)=>{const a=_.useContext(lQ);return P.jsx(aQ,{ref:i,className:le(JX({variant:a.variant||n,size:a.size||r}),t),...s,children:e})});LNe.displayName=aQ.displayName;var[IA,$Ue]=Nn("Tooltip",[Rl]),$A=Rl(),cQ="TooltipProvider",INe=700,OD="tooltip.open",[$Ne,D$]=IA(cQ),uQ=t=>{const{__scopeTooltip:e,delayDuration:n=INe,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,[a,o]=_.useState(!0),c=_.useRef(!1),u=_.useRef(0);return _.useEffect(()=>{const f=u.current;return()=>window.clearTimeout(f)},[]),P.jsx($Ne,{scope:e,isOpenDelayed:a,delayDuration:n,onOpen:_.useCallback(()=>{window.clearTimeout(u.current),o(!1)},[]),onClose:_.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>o(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:_.useCallback(f=>{c.current=f},[]),disableHoverableContent:s,children:i})};uQ.displayName=cQ;var FA="Tooltip",[FNe,jA]=IA(FA),dQ=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s=!1,onOpenChange:i,disableHoverableContent:a,delayDuration:o}=t,c=D$(FA,t.__scopeTooltip),u=$A(e),[f,l]=_.useState(null),d=qr(),m=_.useRef(0),p=a??c.disableHoverableContent,h=o??c.delayDuration,y=_.useRef(!1),[g=!1,v]=lr({prop:r,defaultProp:s,onChange:R=>{R?(c.onOpen(),document.dispatchEvent(new CustomEvent(OD))):c.onClose(),i==null||i(R)}}),w=_.useMemo(()=>g?y.current?"delayed-open":"instant-open":"closed",[g]),x=_.useCallback(()=>{window.clearTimeout(m.current),y.current=!1,v(!0)},[v]),A=_.useCallback(()=>{window.clearTimeout(m.current),v(!1)},[v]),T=_.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,v(!0)},h)},[h,v]);return _.useEffect(()=>()=>window.clearTimeout(m.current),[]),P.jsx(vA,{...u,children:P.jsx(FNe,{scope:e,contentId:d,open:g,stateAttribute:w,trigger:f,onTriggerChange:l,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayed?T():x()},[c.isOpenDelayed,T,x]),onTriggerLeave:_.useCallback(()=>{p?A():window.clearTimeout(m.current)},[A,p]),onOpen:x,onClose:A,disableHoverableContent:p,children:n})})};dQ.displayName=FA;var MD="TooltipTrigger",fQ=_.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=jA(MD,n),i=D$(MD,n),a=$A(n),o=_.useRef(null),c=tt(e,o,s.onTriggerChange),u=_.useRef(!1),f=_.useRef(!1),l=_.useCallback(()=>u.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener("pointerup",l),[l]),P.jsx($v,{asChild:!0,...a,children:P.jsx(Ne.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:me(t.onPointerMove,d=>{d.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:me(t.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:me(t.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",l,{once:!0})}),onFocus:me(t.onFocus,()=>{u.current||s.onOpen()}),onBlur:me(t.onBlur,s.onClose),onClick:me(t.onClick,s.onClose)})})});fQ.displayName=MD;var jNe="TooltipPortal",[FUe,BNe]=IA(jNe,{forceMount:void 0}),bv="TooltipContent",hQ=_.forwardRef((t,e)=>{const n=BNe(bv,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,a=jA(bv,t.__scopeTooltip);return P.jsx(Wn,{present:r||a.open,children:a.disableHoverableContent?P.jsx(pQ,{side:s,...i,ref:e}):P.jsx(zNe,{side:s,...i,ref:e})})}),zNe=_.forwardRef((t,e)=>{const n=jA(bv,t.__scopeTooltip),r=D$(bv,t.__scopeTooltip),s=_.useRef(null),i=tt(e,s),[a,o]=_.useState(null),{trigger:c,onClose:u}=n,f=s.current,{onPointerInTransitChange:l}=r,d=_.useCallback(()=>{o(null),l(!1)},[l]),m=_.useCallback((p,h)=>{const y=p.currentTarget,g={x:p.clientX,y:p.clientY},v=WNe(g,y.getBoundingClientRect()),w=GNe(g,v),x=qNe(h.getBoundingClientRect()),A=YNe([...w,...x]);o(A),l(!0)},[l]);return _.useEffect(()=>()=>d(),[d]),_.useEffect(()=>{if(c&&f){const p=y=>m(y,f),h=y=>m(y,c);return c.addEventListener("pointerleave",p),f.addEventListener("pointerleave",h),()=>{c.removeEventListener("pointerleave",p),f.removeEventListener("pointerleave",h)}}},[c,f,m,d]),_.useEffect(()=>{if(a){const p=h=>{const y=h.target,g={x:h.clientX,y:h.clientY},v=(c==null?void 0:c.contains(y))||(f==null?void 0:f.contains(y)),w=!KNe(g,a);v?d():w&&(d(),u())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[c,f,a,u,d]),P.jsx(pQ,{...t,ref:i})}),[UNe,HNe]=IA(FA,{isInside:!1}),pQ=_.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:a,...o}=t,c=jA(bv,n),u=$A(n),{onClose:f}=c;return _.useEffect(()=>(document.addEventListener(OD,f),()=>document.removeEventListener(OD,f)),[f]),_.useEffect(()=>{if(c.trigger){const l=d=>{const m=d.target;m!=null&&m.contains(c.trigger)&&f()};return window.addEventListener("scroll",l,{capture:!0}),()=>window.removeEventListener("scroll",l,{capture:!0})}},[c.trigger,f]),P.jsx(Jc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:l=>l.preventDefault(),onDismiss:f,children:P.jsxs(A_,{"data-state":c.stateAttribute,...u,...o,ref:e,style:{...o.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[P.jsx(hL,{children:r}),P.jsx(UNe,{scope:n,isInside:!0,children:P.jsx(E7,{id:c.contentId,role:"tooltip",children:s||r})})]})})});hQ.displayName=bv;var mQ="TooltipArrow",VNe=_.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=$A(n);return HNe(mQ,n).isInside?null:P.jsx(R_,{...s,...r,ref:e})});VNe.displayName=mQ;function WNe(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 GNe(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 qNe(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 KNe(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;ir!=f>r&&n<(u-o)*(r-c)/(f-c)+o&&(s=!s)}return s}function YNe(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),XNe(e)}function XNe(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const i=e[e.length-1],a=e[e.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.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],a=n[n.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.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 QNe=uQ,ZNe=dQ,JNe=fQ,gQ=hQ;const eDe=QNe,jUe=ZNe,BUe=JNe,tDe=_.forwardRef(({className:t,sideOffset:e=4,...n},r)=>P.jsx(gQ,{ref:r,sideOffset:e,className:le("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}));tDe.displayName=gQ.displayName;/** * @remix-run/router v1.23.0 * * Copyright (c) Remix Software Inc. @@ -257,7 +257,7 @@ Defaulting to \`null\`.`}var p9=u9,RPe=f9;const PPe=_.forwardRef(({className:t,v * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function _v(){return _v=Object.assign?Object.assign.bind():function(t){for(var e=1;e{o.current=!0}),_.useCallback(function(u,f){if(f===void 0&&(f={}),!o.current)return;if(typeof u=="number"){r.go(u);return}let l=zA(u,JSON.parse(a),i,f.relative==="path");t==null&&e!=="/"&&(l.pathname=l.pathname==="/"?e:Mc([e,l.pathname])),(f.replace?r.replace:r.push)(l,f.state,f)},[e,r,a,i,t])}const eOe=_.createContext(null);function tOe(t){let e=_.useContext(Nl).outlet;return e&&_.createElement(eOe.Provider,{value:t},e)}function UUe(){let{matches:t}=_.useContext(Nl),e=t[t.length-1];return e?e.params:{}}function TQ(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=_.useContext(Hd),{matches:s}=_.useContext(Nl),{pathname:i}=Vd(),a=JSON.stringify(BA(s,r.v7_relativeSplatPath));return _.useMemo(()=>zA(t,JSON.parse(a),i,n==="path"),[t,a,i,n])}function nOe(t,e,n,r){Vv()||Nt(!1);let{navigator:s,static:i}=_.useContext(Hd),{matches:a}=_.useContext(Nl),o=a[a.length-1],c=o?o.params:{};o&&o.pathname;let u=o?o.pathnameBase:"/";o&&o.route;let f=Vd(),l;l=f;let d=l.pathname||"/",m=d;if(u!=="/"){let y=u.replace(/^\//,"").split("/");m="/"+d.replace(/^\//,"").split("/").slice(y.length).join("/")}let p=!i&&n&&n.matches&&n.matches.length>0?n.matches:gf(t,{pathname:m});return aOe(p&&p.map(y=>Object.assign({},y,{params:Object.assign({},c,y.params),pathname:Mc([u,s.encodeLocation?s.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?u:Mc([u,s.encodeLocation?s.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,n,r)}function rOe(){let t=cOe(),e=f0(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 _.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},e),n?_.createElement("pre",{style:s},n):null,null)}const sOe=_.createElement(rOe,null);class iOe extends _.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?_.createElement(Nl.Provider,{value:this.props.routeContext},_.createElement(RQ.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function oOe(t){let{routeContext:e,match:n,children:r}=t,s=_.useContext(UA);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),_.createElement(Nl.Provider,{value:e},r)}function aOe(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 a=t,o=(s=n)==null?void 0:s.errors;if(o!=null){let f=a.findIndex(l=>l.route.id&&(o==null?void 0:o[l.route.id])!==void 0);f>=0||Nt(!1),a=a.slice(0,Math.min(a.length,f+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let f=0;f=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((f,l,d)=>{let m,p=!1,h=null,y=null;n&&(m=o&&l.route.id?o[l.route.id]:void 0,h=l.route.errorElement||sOe,c&&(u<0&&d===0?(fOe("route-fallback"),p=!0,y=null):u===d&&(p=!0,y=l.route.hydrateFallbackElement||null)));let g=e.concat(a.slice(0,d+1)),v=()=>{let w;return m?w=h:p?w=y:l.route.Component?w=_.createElement(l.route.Component,null):l.route.element?w=l.route.element:w=f,_.createElement(oOe,{match:l,routeContext:{outlet:f,matches:g,isDataRoute:n!=null},children:w})};return n&&(l.route.ErrorBoundary||l.route.errorElement||d===0)?_.createElement(iOe,{location:n.location,revalidation:n.revalidation,component:h,error:m,children:v(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):v()},null)}var kQ=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(kQ||{}),NQ=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}(NQ||{});function DQ(t){let e=_.useContext(UA);return e||Nt(!1),e}function OQ(t){let e=_.useContext(AQ);return e||Nt(!1),e}function lOe(t){let e=_.useContext(Nl);return e||Nt(!1),e}function MQ(t){let e=lOe(),n=e.matches[e.matches.length-1];return n.route.id||Nt(!1),n.route.id}function cOe(){var t;let e=_.useContext(RQ),n=OQ(),r=MQ();return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}let uOe=0;function HUe(t){let{router:e,basename:n}=DQ(),r=OQ(),[s,i]=_.useState(""),a=_.useCallback(o=>{if(typeof t!="function")return!!t;if(n==="/")return t(o);let{currentLocation:c,nextLocation:u,historyAction:f}=o;return t({currentLocation:_v({},c,{pathname:Nd(c.pathname,n)||c.pathname}),nextLocation:_v({},u,{pathname:Nd(u.pathname,n)||u.pathname}),historyAction:f})},[n,t]);return _.useEffect(()=>{let o=String(++uOe);return i(o),()=>e.deleteBlocker(o)},[e]),_.useEffect(()=>{s!==""&&e.getBlocker(s,a)},[e,s,a]),s&&r.blockers.has(s)?r.blockers.get(s):lm}function dOe(){let{router:t}=DQ(kQ.UseNavigateStable),e=MQ(NQ.UseNavigateStable),n=_.useRef(!1);return PQ(()=>{n.current=!0}),_.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?t.navigate(s):t.navigate(s,_v({fromRouteId:e},i)))},[t,e])}const m4={};function fOe(t,e,n){m4[t]||(m4[t]=!0)}function hOe(t,e){t==null||t.v7_startTransition,(t==null?void 0:t.v7_relativeSplatPath)===void 0&&(!e||e.v7_relativeSplatPath),e&&(e.v7_fetcherPersist,e.v7_normalizeFormMethod,e.v7_partialHydration,e.v7_skipActionErrorRevalidation)}function LQ(t){let{to:e,replace:n,state:r,relative:s}=t;Vv()||Nt(!1);let{future:i,static:a}=_.useContext(Hd),{matches:o}=_.useContext(Nl),{pathname:c}=Vd(),u=Wv(),f=zA(e,BA(o,i.v7_relativeSplatPath),c,s==="path"),l=JSON.stringify(f);return _.useEffect(()=>u(JSON.parse(l),{replace:n,state:r,relative:s}),[u,l,s,n,r]),null}function ES(t){return tOe(t.context)}function pOe(t){let{basename:e="/",children:n=null,location:r,navigationType:s=Rr.Pop,navigator:i,static:a=!1,future:o}=t;Vv()&&Nt(!1);let c=e.replace(/^\/*/,"/"),u=_.useMemo(()=>({basename:c,navigator:i,static:a,future:_v({v7_relativeSplatPath:!1},o)}),[c,o,i,a]);typeof r=="string"&&(r=Ud(r));let{pathname:f="/",search:l="",hash:d="",state:m=null,key:p="default"}=r,h=_.useMemo(()=>{let y=Nd(f,c);return y==null?null:{location:{pathname:y,search:l,hash:d,state:m,key:p},navigationType:s}},[c,f,l,d,m,p,s]);return h==null?null:_.createElement(Hd.Provider,{value:u},_.createElement(I$.Provider,{children:n,value:h}))}new Promise(()=>{});function mOe(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:_.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(e,{hydrateFallbackElement:_.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:_.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}/** + */function _v(){return _v=Object.assign?Object.assign.bind():function(t){for(var e=1;e{o.current=!0}),_.useCallback(function(u,f){if(f===void 0&&(f={}),!o.current)return;if(typeof u=="number"){r.go(u);return}let l=zA(u,JSON.parse(a),i,f.relative==="path");t==null&&e!=="/"&&(l.pathname=l.pathname==="/"?e:Mc([e,l.pathname])),(f.replace?r.replace:r.push)(l,f.state,f)},[e,r,a,i,t])}const eOe=_.createContext(null);function tOe(t){let e=_.useContext(Nl).outlet;return e&&_.createElement(eOe.Provider,{value:t},e)}function zUe(){let{matches:t}=_.useContext(Nl),e=t[t.length-1];return e?e.params:{}}function TQ(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=_.useContext(Hd),{matches:s}=_.useContext(Nl),{pathname:i}=Vd(),a=JSON.stringify(BA(s,r.v7_relativeSplatPath));return _.useMemo(()=>zA(t,JSON.parse(a),i,n==="path"),[t,a,i,n])}function nOe(t,e,n,r){Vv()||Nt(!1);let{navigator:s,static:i}=_.useContext(Hd),{matches:a}=_.useContext(Nl),o=a[a.length-1],c=o?o.params:{};o&&o.pathname;let u=o?o.pathnameBase:"/";o&&o.route;let f=Vd(),l;l=f;let d=l.pathname||"/",m=d;if(u!=="/"){let y=u.replace(/^\//,"").split("/");m="/"+d.replace(/^\//,"").split("/").slice(y.length).join("/")}let p=!i&&n&&n.matches&&n.matches.length>0?n.matches:gf(t,{pathname:m});return aOe(p&&p.map(y=>Object.assign({},y,{params:Object.assign({},c,y.params),pathname:Mc([u,s.encodeLocation?s.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?u:Mc([u,s.encodeLocation?s.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,n,r)}function rOe(){let t=cOe(),e=f0(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 _.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},e),n?_.createElement("pre",{style:s},n):null,null)}const sOe=_.createElement(rOe,null);class iOe extends _.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?_.createElement(Nl.Provider,{value:this.props.routeContext},_.createElement(RQ.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function oOe(t){let{routeContext:e,match:n,children:r}=t,s=_.useContext(UA);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),_.createElement(Nl.Provider,{value:e},r)}function aOe(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 a=t,o=(s=n)==null?void 0:s.errors;if(o!=null){let f=a.findIndex(l=>l.route.id&&(o==null?void 0:o[l.route.id])!==void 0);f>=0||Nt(!1),a=a.slice(0,Math.min(a.length,f+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let f=0;f=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((f,l,d)=>{let m,p=!1,h=null,y=null;n&&(m=o&&l.route.id?o[l.route.id]:void 0,h=l.route.errorElement||sOe,c&&(u<0&&d===0?(fOe("route-fallback"),p=!0,y=null):u===d&&(p=!0,y=l.route.hydrateFallbackElement||null)));let g=e.concat(a.slice(0,d+1)),v=()=>{let w;return m?w=h:p?w=y:l.route.Component?w=_.createElement(l.route.Component,null):l.route.element?w=l.route.element:w=f,_.createElement(oOe,{match:l,routeContext:{outlet:f,matches:g,isDataRoute:n!=null},children:w})};return n&&(l.route.ErrorBoundary||l.route.errorElement||d===0)?_.createElement(iOe,{location:n.location,revalidation:n.revalidation,component:h,error:m,children:v(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):v()},null)}var kQ=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(kQ||{}),NQ=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}(NQ||{});function DQ(t){let e=_.useContext(UA);return e||Nt(!1),e}function OQ(t){let e=_.useContext(AQ);return e||Nt(!1),e}function lOe(t){let e=_.useContext(Nl);return e||Nt(!1),e}function MQ(t){let e=lOe(),n=e.matches[e.matches.length-1];return n.route.id||Nt(!1),n.route.id}function cOe(){var t;let e=_.useContext(RQ),n=OQ(),r=MQ();return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}let uOe=0;function UUe(t){let{router:e,basename:n}=DQ(),r=OQ(),[s,i]=_.useState(""),a=_.useCallback(o=>{if(typeof t!="function")return!!t;if(n==="/")return t(o);let{currentLocation:c,nextLocation:u,historyAction:f}=o;return t({currentLocation:_v({},c,{pathname:Nd(c.pathname,n)||c.pathname}),nextLocation:_v({},u,{pathname:Nd(u.pathname,n)||u.pathname}),historyAction:f})},[n,t]);return _.useEffect(()=>{let o=String(++uOe);return i(o),()=>e.deleteBlocker(o)},[e]),_.useEffect(()=>{s!==""&&e.getBlocker(s,a)},[e,s,a]),s&&r.blockers.has(s)?r.blockers.get(s):lm}function dOe(){let{router:t}=DQ(kQ.UseNavigateStable),e=MQ(NQ.UseNavigateStable),n=_.useRef(!1);return PQ(()=>{n.current=!0}),_.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?t.navigate(s):t.navigate(s,_v({fromRouteId:e},i)))},[t,e])}const m4={};function fOe(t,e,n){m4[t]||(m4[t]=!0)}function hOe(t,e){t==null||t.v7_startTransition,(t==null?void 0:t.v7_relativeSplatPath)===void 0&&(!e||e.v7_relativeSplatPath),e&&(e.v7_fetcherPersist,e.v7_normalizeFormMethod,e.v7_partialHydration,e.v7_skipActionErrorRevalidation)}function LQ(t){let{to:e,replace:n,state:r,relative:s}=t;Vv()||Nt(!1);let{future:i,static:a}=_.useContext(Hd),{matches:o}=_.useContext(Nl),{pathname:c}=Vd(),u=Wv(),f=zA(e,BA(o,i.v7_relativeSplatPath),c,s==="path"),l=JSON.stringify(f);return _.useEffect(()=>u(JSON.parse(l),{replace:n,state:r,relative:s}),[u,l,s,n,r]),null}function ES(t){return tOe(t.context)}function pOe(t){let{basename:e="/",children:n=null,location:r,navigationType:s=Rr.Pop,navigator:i,static:a=!1,future:o}=t;Vv()&&Nt(!1);let c=e.replace(/^\/*/,"/"),u=_.useMemo(()=>({basename:c,navigator:i,static:a,future:_v({v7_relativeSplatPath:!1},o)}),[c,o,i,a]);typeof r=="string"&&(r=Ud(r));let{pathname:f="/",search:l="",hash:d="",state:m=null,key:p="default"}=r,h=_.useMemo(()=>{let y=Nd(f,c);return y==null?null:{location:{pathname:y,search:l,hash:d,state:m,key:p},navigationType:s}},[c,f,l,d,m,p,s]);return h==null?null:_.createElement(Hd.Provider,{value:u},_.createElement(I$.Provider,{children:n,value:h}))}new Promise(()=>{});function mOe(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:_.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(e,{hydrateFallbackElement:_.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:_.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}/** * React Router DOM v6.30.0 * * Copyright (c) Remix Software Inc. @@ -266,7 +266,7 @@ Defaulting to \`null\`.`}var p9=u9,RPe=f9;const PPe=_.forwardRef(({className:t,v * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function h0(){return h0=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[s]=t[s]);return n}function vOe(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function yOe(t,e){return t.button===0&&(!e||e==="_self")&&!vOe(t)}function FD(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 bOe(t,e){let n=FD(t);return e&&e.forEach((r,s)=>{n.has(s)||e.getAll(s).forEach(i=>{n.append(s,i)})}),n}const wOe=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],_Oe="6";try{window.__reactRouterVersion=_Oe}catch{}function xOe(t,e){return DDe({basename:e==null?void 0:e.basename,future:h0({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:nDe({window:e==null?void 0:e.window}),hydrationData:(e==null?void 0:e.hydrationData)||SOe(),routes:t,mapRouteProperties:mOe,dataStrategy:e==null?void 0:e.dataStrategy,patchRoutesOnNavigation:e==null?void 0:e.patchRoutesOnNavigation,window:e==null?void 0:e.window}).initialize()}function SOe(){var t;let e=(t=window)==null?void 0:t.__staticRouterHydrationData;return e&&e.errors&&(e=h0({},e,{errors:EOe(e.errors)})),e}function EOe(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 MC(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 a=new i(s.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let i=new Error(s.message);i.stack="",n[r]=i}}else n[r]=s;return n}const COe=_.createContext({isTransitioning:!1}),AOe=_.createContext(new Map),ROe="startTransition",g4=r_[ROe],POe="flushSync",v4=ade[POe];function TOe(t){g4?g4(t):t()}function My(t){v4?v4(t):t()}class kOe{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 NOe(t){let{fallbackElement:e,router:n,future:r}=t,[s,i]=_.useState(n.state),[a,o]=_.useState(),[c,u]=_.useState({isTransitioning:!1}),[f,l]=_.useState(),[d,m]=_.useState(),[p,h]=_.useState(),y=_.useRef(new Map),{v7_startTransition:g}=r||{},v=_.useCallback(E=>{g?TOe(E):E()},[g]),w=_.useCallback((E,k)=>{let{deletedFetchers:N,flushSync:O,viewTransitionOpts:L}=k;E.fetchers.forEach((F,U)=>{F.data!==void 0&&y.current.set(U,F.data)}),N.forEach(F=>y.current.delete(F));let I=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!L||I){O?My(()=>i(E)):v(()=>i(E));return}if(O){My(()=>{d&&(f&&f.resolve(),d.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:L.currentLocation,nextLocation:L.nextLocation})});let F=n.window.document.startViewTransition(()=>{My(()=>i(E))});F.finished.finally(()=>{My(()=>{l(void 0),m(void 0),o(void 0),u({isTransitioning:!1})})}),My(()=>m(F));return}d?(f&&f.resolve(),d.skipTransition(),h({state:E,currentLocation:L.currentLocation,nextLocation:L.nextLocation})):(o(E),u({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}))},[n.window,d,f,y,v]);_.useLayoutEffect(()=>n.subscribe(w),[n,w]),_.useEffect(()=>{c.isTransitioning&&!c.flushSync&&l(new kOe)},[c]),_.useEffect(()=>{if(f&&a&&n.window){let E=a,k=f.promise,N=n.window.document.startViewTransition(async()=>{v(()=>i(E)),await k});N.finished.finally(()=>{l(void 0),m(void 0),o(void 0),u({isTransitioning:!1})}),m(N)}},[v,a,f,n.window]),_.useEffect(()=>{f&&a&&s.location.key===a.location.key&&f.resolve()},[f,d,s.location,a]),_.useEffect(()=>{!c.isTransitioning&&p&&(o(p.state),u({isTransitioning:!0,flushSync:!1,currentLocation:p.currentLocation,nextLocation:p.nextLocation}),h(void 0))},[c.isTransitioning,p]),_.useEffect(()=>{},[]);let x=_.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:E=>n.navigate(E),push:(E,k,N)=>n.navigate(E,{state:k,preventScrollReset:N==null?void 0:N.preventScrollReset}),replace:(E,k,N)=>n.navigate(E,{replace:!0,state:k,preventScrollReset:N==null?void 0:N.preventScrollReset})}),[n]),A=n.basename||"/",T=_.useMemo(()=>({router:n,navigator:x,static:!1,basename:A}),[n,x,A]),R=_.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return _.useEffect(()=>hOe(r,n.future),[r,n.future]),_.createElement(_.Fragment,null,_.createElement(UA.Provider,{value:T},_.createElement(AQ.Provider,{value:s},_.createElement(AOe.Provider,{value:y.current},_.createElement(COe.Provider,{value:c},_.createElement(pOe,{basename:A,location:s.location,navigationType:s.historyAction,navigator:x,future:R},s.initialized||n.future.v7_partialHydration?_.createElement(DOe,{routes:n.routes,future:n.future,state:s}):e))))),null)}const DOe=_.memo(OOe);function OOe(t){let{routes:e,future:n,state:r}=t;return nOe(e,void 0,r,n)}const MOe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",LOe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yf=_.forwardRef(function(e,n){let{onClick:r,relative:s,reloadDocument:i,replace:a,state:o,target:c,to:u,preventScrollReset:f,viewTransition:l}=e,d=gOe(e,wOe),{basename:m}=_.useContext(Hd),p,h=!1;if(typeof u=="string"&&LOe.test(u)&&(p=u,MOe))try{let w=new URL(window.location.href),x=u.startsWith("//")?new URL(w.protocol+u):new URL(u),A=Nd(x.pathname,m);x.origin===w.origin&&A!=null?u=A+x.search+x.hash:h=!0}catch{}let y=ZDe(u,{relative:s}),g=IOe(u,{replace:a,state:o,target:c,preventScrollReset:f,relative:s,viewTransition:l});function v(w){r&&r(w),w.defaultPrevented||g(w)}return _.createElement("a",h0({},d,{href:p||y,onClick:h||i?r:v,ref:n,target:c}))});var y4;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(y4||(y4={}));var b4;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(b4||(b4={}));function IOe(t,e){let{target:n,replace:r,state:s,preventScrollReset:i,relative:a,viewTransition:o}=e===void 0?{}:e,c=Wv(),u=Vd(),f=TQ(t,{relative:a});return _.useCallback(l=>{if(yOe(l,n)){l.preventDefault();let d=r!==void 0?r:ep(u)===ep(f);c(t,{replace:d,state:s,preventScrollReset:i,relative:a,viewTransition:o})}},[u,c,f,r,s,n,t,i,a,o])}function $Oe(t){let e=_.useRef(FD(t)),n=_.useRef(!1),r=Vd(),s=_.useMemo(()=>bOe(r.search,n.current?null:e.current),[r.search]),i=Wv(),a=_.useCallback((o,c)=>{const u=FD(typeof o=="function"?o(s):o);n.current=!0,i("?"+u,c)},[i,s]);return[s,a]}const IQ=({isOpen:t,onCancel:e,onConfirm:n,title:r,description:s,cancelLabel:i,confirmLabel:a})=>P.jsx(pW,{open:t,children:P.jsxs(IL,{children:[P.jsxs($L,{children:[P.jsx(jL,{children:r}),P.jsx(BL,{children:s})]}),P.jsxs(FL,{children:[P.jsx(UL,{children:P.jsx(yf,{to:"#",onClick:e,children:i})}),P.jsx(zL,{children:P.jsx(yf,{to:"#",onClick:n,children:a})})]})]})}),pt=t=>typeof t=="string",Ly=()=>{let t,e;const n=new Promise((r,s)=>{t=r,e=s});return n.resolve=t,n.reject=e,n},w4=t=>t==null?"":""+t,FOe=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},jOe=/###/g,_4=t=>t&&t.indexOf("###")>-1?t.replace(jOe,"."):t,x4=t=>!t||pt(t),Ab=(t,e,n)=>{const r=pt(e)?e.split("."):e;let s=0;for(;s{const{obj:r,k:s}=Ab(t,e,Object);if(r!==void 0||e.length===1){r[s]=n;return}let i=e[e.length-1],a=e.slice(0,e.length-1),o=Ab(t,a,Object);for(;o.obj===void 0&&a.length;)i=`${a[a.length-1]}.${i}`,a=a.slice(0,a.length-1),o=Ab(t,a,Object),o&&o.obj&&typeof o.obj[`${o.k}.${i}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${i}`]=n},BOe=(t,e,n,r)=>{const{obj:s,k:i}=Ab(t,e,Object);s[i]=s[i]||[],s[i].push(n)},LC=(t,e)=>{const{obj:n,k:r}=Ab(t,e);if(n)return n[r]},zOe=(t,e,n)=>{const r=LC(t,n);return r!==void 0?r:LC(e,n)},$Q=(t,e,n)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?pt(t[r])||t[r]instanceof String||pt(e[r])||e[r]instanceof String?n&&(t[r]=e[r]):$Q(t[r],e[r],n):t[r]=e[r]);return t},Jp=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var UOe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const HOe=t=>pt(t)?t.replace(/[&<>"'\/]/g,e=>UOe[e]):t;class VOe{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 WOe=[" ",",","?","!",";"],GOe=new VOe(20),qOe=(t,e,n)=>{e=e||"",n=n||"";const r=WOe.filter(a=>e.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const s=GOe.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let i=!s.test(t);if(!i){const a=t.indexOf(n);a>0&&!s.test(t.substring(0,a))&&(i=!0)}return i},jD=function(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&&ct&&t.replace("_","-"),KOe={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 $C{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||KOe,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[o,c]=a;for(let u=0;u{let[o,c]=a;for(let u=0;u1&&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,a=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,n],r&&(Array.isArray(r)?o.push(...r):pt(r)&&i?o.push(...r.split(i)):o.push(r)));const c=LC(this.data,o);return!c&&!n&&!r&&e.indexOf(".")>-1&&(e=o[0],n=o[1],r=o.slice(2).join(".")),c||!a||!pt(r)?c:jD(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 a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let o=[e,n];r&&(o=o.concat(a?r.split(a):r)),e.indexOf(".")>-1&&(o=e.split("."),s=n,n=o[1]),this.addNamespaces(n),S4(this.data,o,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)(pt(r[i])||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 a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},o=[e,n];e.indexOf(".")>-1&&(o=e.split("."),s=r,r=n,n=o[1]),this.addNamespaces(n);let c=LC(this.data,o)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?$Q(c,r,i):c={...c,...r},S4(this.data,o,c),a.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 FQ={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 C4={};class FC extends HA{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),FOe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=gl.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 a=r&&e.indexOf(r)>-1,o=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!qOe(e,r,s);if(a&&!o){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:pt(i)?[i]:i};const u=e.split(r);(r!==s||r===s&&this.options.ns.indexOf(u[0])>-1)&&(i=u.shift()),e=u.join(s)}return{key:e,namespaces:pt(i)?[i]: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:a,namespaces:o}=this.extractFromKey(e[e.length-1],n),c=o[o.length-1],u=n.lng||this.language,f=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(f){const x=n.nsSeparator||this.options.nsSeparator;return s?{res:`${c}${x}${a}`,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${x}${a}`}return s?{res:a,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:a}const l=this.resolve(e,n);let d=l&&l.res;const m=l&&l.usedKey||a,p=l&&l.exactUsedKey||a,h=Object.prototype.toString.apply(d),y=["[object Number]","[object Function]","[object RegExp]"],g=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,w=!pt(d)&&typeof d!="boolean"&&typeof d!="number";if(v&&d&&w&&y.indexOf(h)<0&&!(pt(g)&&Array.isArray(d))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const x=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,d,{...n,ns:o}):`key '${a} (${this.language})' returned an object instead of string.`;return s?(l.res=x,l.usedParams=this.getUsedParamsDetails(n),l):x}if(i){const x=Array.isArray(d),A=x?[]:{},T=x?p:m;for(const R in d)if(Object.prototype.hasOwnProperty.call(d,R)){const E=`${T}${i}${R}`;A[R]=this.translate(E,{...n,joinArrays:!1,ns:o}),A[R]===E&&(A[R]=d[R])}d=A}}else if(v&&pt(g)&&Array.isArray(d))d=d.join(g),d&&(d=this.extendTranslation(d,e,n,r));else{let x=!1,A=!1;const T=n.count!==void 0&&!pt(n.count),R=FC.hasDefaultValue(n),E=T?this.pluralResolver.getSuffix(u,n.count,n):"",k=n.ordinal&&T?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",N=T&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),O=N&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${E}`]||n[`defaultValue${k}`]||n.defaultValue;!this.isValidLookup(d)&&R&&(x=!0,d=O),this.isValidLookup(d)||(A=!0,d=a);const I=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&A?void 0:d,F=R&&O!==d&&this.options.updateMissing;if(A||x||F){if(this.logger.log(F?"updateKey":"missingKey",u,c,a,F?O:d),i){const H=this.resolve(a,{...n,keySeparator:!1});H&&H.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 U=[];const Y=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Y&&Y[0])for(let H=0;H{const X=R&&re!==d?re:I;this.options.missingKeyHandler?this.options.missingKeyHandler(H,c,ee,X,F,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(H,c,ee,X,F,n),this.emit("missingKey",H,c,ee,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&T?U.forEach(H=>{const ee=this.pluralResolver.getSuffixes(H,n);N&&n[`defaultValue${this.options.pluralSeparator}zero`]&&ee.indexOf(`${this.options.pluralSeparator}zero`)<0&&ee.push(`${this.options.pluralSeparator}zero`),ee.forEach(re=>{V([H],a+re,n[`defaultValue${re}`]||O)})}):V(U,a,O))}d=this.extendTranslation(d,e,n,l,r),A&&d===a&&this.options.appendNamespaceToMissingKey&&(d=`${c}:${a}`),(A||x)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${a}`:a,x?d:void 0):d=this.options.parseMissingKeyHandler(d))}return s?(l.res=d,l.usedParams=this.getUsedParamsDetails(n),l):d}extendTranslation(e,n,r,s,i){var a=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 u=pt(e)&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(u){const d=e.match(this.interpolator.nestingRegexp);f=d&&d.length}let l=r.replace&&!pt(r.replace)?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),u){const d=e.match(this.interpolator.nestingRegexp),m=d&&d.length;f1&&arguments[1]!==void 0?arguments[1]:{},r,s,i,a,o;return pt(e)&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(c,n),f=u.key;s=f;let l=u.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const d=n.count!==void 0&&!pt(n.count),m=d&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),p=n.context!==void 0&&(pt(n.context)||typeof n.context=="number")&&n.context!=="",h=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);l.forEach(y=>{this.isValidLookup(r)||(o=y,!C4[`${h[0]}-${y}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(o)&&(C4[`${h[0]}-${y}`]=!0,this.logger.warn(`key "${s}" for languages "${h.join(", ")}" won't get resolved as namespace "${o}" 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!!!")),h.forEach(g=>{if(this.isValidLookup(r))return;a=g;const v=[f];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(v,f,g,y,n);else{let x;d&&(x=this.pluralResolver.getSuffix(g,n.count,n));const A=`${this.options.pluralSeparator}zero`,T=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(v.push(f+x),n.ordinal&&x.indexOf(T)===0&&v.push(f+x.replace(T,this.options.pluralSeparator)),m&&v.push(f+A)),p){const R=`${f}${this.options.contextSeparator}${n.context}`;v.push(R),d&&(v.push(R+x),n.ordinal&&x.indexOf(T)===0&&v.push(R+x.replace(T,this.options.pluralSeparator)),m&&v.push(R+A))}}let w;for(;w=v.pop();)this.isValidLookup(r)||(i=w,r=this.getResource(g,y,w,n))}))})}),{res:r,usedKey:s,exactUsedKey:i,usedLng:a,usedNS:o}}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&&!pt(e.replace);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}}const nk=t=>t.charAt(0).toUpperCase()+t.slice(1);class A4{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=gl.create("languageUtils")}getScriptPartFromCode(e){if(e=IC(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=IC(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(pt(e)&&e.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let s=Intl.getCanonicalLocales(e)[0];if(s&&this.options.lowerCaseLng&&(s=s.toLowerCase()),s)return s}catch{}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]=nk(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]=nk(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=nk(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)),pt(e)&&(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=a=>{a&&(this.isSupportedCode(a)?s.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return pt(e)&&(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))):pt(e)&&i(this.formatLanguageCode(e)),r.forEach(a=>{s.indexOf(a)<0&&i(this.formatLanguageCode(a))}),s}}let YOe=[{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}],XOe={1:t=>+(t>1),2:t=>+(t!=1),3:t=>0,4:t=>t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2,5:t=>t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5,6:t=>t==1?0:t>=2&&t<=4?1:2,7:t=>t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2,8:t=>t==1?0:t==2?1:t!=8&&t!=11?2:3,9:t=>+(t>=2),10:t=>t==1?0:t==2?1:t<7?2:t<11?3:4,11:t=>t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3,12:t=>+(t%10!=1||t%100==11),13:t=>+(t!==0),14:t=>t==1?0:t==2?1:t==3?2:3,15:t=>t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2,16:t=>t%10==1&&t%100!=11?0:t!==0?1:2,17:t=>t==1||t%10==1&&t%100!=11?0:1,18:t=>t==0?0:t==1?1:2,19:t=>t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3,20:t=>t==1?0:t==0||t%100>0&&t%100<20?1:2,21:t=>t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0,22:t=>t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3};const QOe=["v1","v2","v3"],ZOe=["v4"],R4={zero:0,one:1,two:2,few:3,many:4,other:5},JOe=()=>{const t={};return YOe.forEach(e=>{e.lngs.forEach(n=>{t[n]={numbers:e.nr,plurals:XOe[e.fc]}})}),t};class eMe{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=gl.create("pluralResolver"),(!this.options.compatibilityJSON||ZOe.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=JOe(),this.pluralRulesCache={}}addRule(e,n){this.rules[e]=n}clearCache(){this.pluralRulesCache={}}getRule(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){const r=IC(e==="dev"?"en":e),s=n.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:s});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(r,{type:s})}catch{if(!e.match(/-|_/))return;const c=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(c,n)}return this.pluralRulesCache[i]=a,a}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)=>R4[s]-R4[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!QOe.includes(this.options.compatibilityJSON)}}const P4=function(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=zOe(t,e,n);return!i&&s&&pt(n)&&(i=jD(t,n,r),i===void 0&&(i=jD(e,n,r))),i},rk=t=>t.replace(/\$/g,"$$$$");class tMe{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=gl.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:a,suffix:o,suffixEscaped:c,formatSeparator:u,unescapeSuffix:f,unescapePrefix:l,nestingPrefix:d,nestingPrefixEscaped:m,nestingSuffix:p,nestingSuffixEscaped:h,nestingOptionsSeparator:y,maxReplaces:g,alwaysFormat:v}=e.interpolation;this.escape=n!==void 0?n:HOe,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=i?Jp(i):a||"{{",this.suffix=o?Jp(o):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=f?"":l||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=d?Jp(d):m||Jp("$t("),this.nestingSuffix=p?Jp(p):h||Jp(")"),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,a,o;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=m=>{if(m.indexOf(this.formatSeparator)<0){const g=P4(n,c,m,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(g,void 0,r,{...s,...n,interpolationkey:m}):g}const p=m.split(this.formatSeparator),h=p.shift().trim(),y=p.join(this.formatSeparator).trim();return this.format(P4(n,c,h,this.options.keySeparator,this.options.ignoreJSONStructure),y,r,{...s,...n,interpolationkey:h})};this.resetRegExp();const f=s&&s.missingInterpolationHandler||this.options.missingInterpolationHandler,l=s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:m=>rk(m)},{regex:this.regexp,safeValue:m=>this.escapeValue?rk(this.escape(m)):rk(m)}].forEach(m=>{for(o=0;i=m.regex.exec(e);){const p=i[1].trim();if(a=u(p),a===void 0)if(typeof f=="function"){const y=f(e,i,s);a=pt(y)?y:""}else if(s&&Object.prototype.hasOwnProperty.call(s,p))a="";else if(l){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${p} for interpolating ${e}`),a="";else!pt(a)&&!this.useRawValueToEscape&&(a=w4(a));const h=m.safeValue(a);if(e=e.replace(i[0],h),l?(m.regex.lastIndex+=a.length,m.regex.lastIndex-=i[0].length):m.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,i,a;const o=(c,u)=>{const f=this.nestingOptionsSeparator;if(c.indexOf(f)<0)return c;const l=c.split(new RegExp(`${f}[ ]*{`));let d=`{${l[1]}`;c=l[0],d=this.interpolate(d,a);const m=d.match(/'/g),p=d.match(/"/g);(m&&m.length%2===0&&!p||p.length%2!==0)&&(d=d.replace(/'/g,'"'));try{a=JSON.parse(d),u&&(a={...u,...a})}catch(h){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,h),`${c}${f}${d}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,c};for(;s=this.nestingRegexp.exec(e);){let c=[];a={...r},a=a.replace&&!pt(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let u=!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,u=!0}if(i=n(o.call(this,s[1].trim(),a),a),i&&s[0]===e&&!pt(i))return i;pt(i)||(i=w4(i)),i||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),i=""),u&&(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}}const nMe=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(a=>{if(a){const[o,...c]=a.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),f=o.trim();n[f]||(n[f]=u),u==="false"&&(n[f]=!1),u==="true"&&(n[f]=!0),isNaN(u)||(n[f]=parseInt(u,10))}})}return{formatName:e,formatOptions:n}},em=t=>{const e={};return(n,r,s)=>{let i=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(i={...i,[s.interpolationkey]:void 0});const a=r+JSON.stringify(i);let o=e[a];return o||(o=t(IC(r),s),e[a]=o),o(n)}};class rMe{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=gl.create("formatter"),this.options=e,this.formats={number:em((n,r)=>{const s=new Intl.NumberFormat(n,{...r});return i=>s.format(i)}),currency:em((n,r)=>{const s=new Intl.NumberFormat(n,{...r,style:"currency"});return i=>s.format(i)}),datetime:em((n,r)=>{const s=new Intl.DateTimeFormat(n,{...r});return i=>s.format(i)}),relativetime:em((n,r)=>{const s=new Intl.RelativeTimeFormat(n,{...r});return i=>s.format(i,r.range||"day")}),list:em((n,r)=>{const s=new Intl.ListFormat(n,{...r});return i=>s.format(i)})},this.init(e)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=em(n)}format(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=n.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(o=>o.indexOf(")")>-1)){const o=i.findIndex(c=>c.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,o)].join(this.formatSeparator)}return i.reduce((o,c)=>{const{formatName:u,formatOptions:f}=nMe(c);if(this.formats[u]){let l=o;try{const d=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},m=d.locale||d.lng||s.locale||s.lng||r;l=this.formats[u](o,m,{...f,...s,...d})}catch(d){this.logger.warn(d)}return l}else this.logger.warn(`there was no format function for ${u}`);return o},e)}}const sMe=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class iMe extends HA{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=gl.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={},a={},o={},c={};return e.forEach(u=>{let f=!0;n.forEach(l=>{const d=`${u}|${l}`;!r.reload&&this.store.hasResourceBundle(u,l)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?a[d]===void 0&&(a[d]=!0):(this.state[d]=1,f=!1,a[d]===void 0&&(a[d]=!0),i[d]===void 0&&(i[d]=!0),c[l]===void 0&&(c[l]=!0)))}),f||(o[u]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(c)}}loaded(e,n,r){const s=e.split("|"),i=s[0],a=s[1];n&&this.emit("failedLoading",i,a,n),!n&&r&&this.store.addResourceBundle(i,a,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&r&&(this.state[e]=0);const o={};this.queue.forEach(c=>{BOe(c.loaded,[i],a),sMe(c,e),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{o[u]||(o[u]={});const f=c.loaded[u];f.length&&f.forEach(l=>{o[u][l]===void 0&&(o[u][l]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",o),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,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:s,wait:i,callback:a});return}this.readingCalls++;const o=(u,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(u&&f&&s{this.read.call(this,e,n,r,s+1,i*2,a)},i);return}a(u,f)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const u=c(e,n);u&&typeof u.then=="function"?u.then(f=>o(null,f)).catch(o):o(null,u)}catch(u){o(u)}return}return c(e,n,o)}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();pt(e)&&(e=this.languageUtils.toResolveHierarchy(e)),pt(n)&&(n=[n]);const i=this.queueLoad(e,n,r,s);if(!i.toLoad.length)return i.pending.length||s(),null;i.toLoad.forEach(a=>{this.loadOne(a)})}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,(a,o)=>{a&&this.logger.warn(`${n}loading namespace ${i} for language ${s} failed`,a),!a&&o&&this.logger.log(`${n}loaded namespace ${i} for language ${s}`,o),this.loaded(e,a,o)})}saveMissing(e,n,r,s,i){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},o=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={...a,isUpdate:i},u=this.backend.create.bind(this.backend);if(u.length<6)try{let f;u.length===5?f=u(e,n,r,s,c):f=u(e,n,r,s),f&&typeof f.then=="function"?f.then(l=>o(null,l)).catch(o):o(null,f)}catch(f){o(f)}else u(e,n,r,s,o,c)}!e||!e[0]||this.store.addResource(e[0],n,r,s)}}}const T4=()=>({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:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),pt(t[1])&&(e.defaultValue=t[1]),pt(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),k4=t=>(pt(t.ns)&&(t.ns=[t.ns]),pt(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),pt(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),CS=()=>{},oMe=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class p0 extends HA{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=k4(e),this.services={},this.logger=gl,this.modules={external:[]},oMe(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&&(pt(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const s=T4();this.options={...s,...this.options,...k4(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);const i=f=>f?typeof f=="function"?new f:f:null;if(!this.options.isClone){this.modules.logger?gl.init(i(this.modules.logger),this.options):gl.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:typeof Intl<"u"&&(f=rMe);const l=new A4(this.options);this.store=new E4(this.options.resources,this.options);const d=this.services;d.logger=gl,d.resourceStore=this.store,d.languageUtils=l,d.pluralResolver=new eMe(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)&&(d.formatter=i(f),d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new tMe(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new iMe(i(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",function(m){for(var p=arguments.length,h=new Array(p>1?p-1:0),y=1;y1?p-1:0),y=1;y{m.init&&m.init(this)})}if(this.format=this.options.interpolation.format,r||(r=CS),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=Ly(),u=()=>{const f=(l,d)=>{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(d),r(l,d)};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?u():setTimeout(u,0),c}loadResources(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:CS;const s=pt(e)?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=[],a=o=>{if(!o||o==="cimode")return;this.services.languageUtils.toResolveHierarchy(o).forEach(u=>{u!=="cimode"&&i.indexOf(u)<0&&i.push(u)})};s?a(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>a(c)),this.options.preload&&this.options.preload.forEach(o=>a(o)),this.services.backendConnector.load(i,this.options.ns,o=>{!o&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(o)})}else r(null)}reloadResources(e,n,r){const s=Ly();return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),r||(r=CS),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"&&FQ.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=Ly();this.emit("languageChanging",e);const i=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},a=(c,u)=>{u?(i(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,s.resolve(function(){return r.t(...arguments)}),n&&n(c,function(){return r.t(...arguments)})},o=c=>{!e&&!c&&this.services.languageDetector&&(c=[]);const u=pt(c)?c:this.services.languageUtils.getBestMatchFromCodes(c);u&&(this.language||i(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,f=>{a(f,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),s}getFixedT(e,n,r){var s=this;const i=function(a,o){let c;if(typeof o!="object"){for(var u=arguments.length,f=new Array(u>2?u-2:0),l=2;l`${c.keyPrefix}${d}${p}`):m=c.keyPrefix?`${c.keyPrefix}${d}${a}`:a,s.t(m,c)};return pt(e)?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 a=(o,c)=>{const u=this.services.backendConnector.state[`${o}|${c}`];return u===-1||u===0||u===2};if(n.precheck){const o=n.precheck(this,a);if(o!==void 0)return o}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,e)&&(!s||a(i,e)))}loadNamespaces(e,n){const r=Ly();return this.options.ns?(pt(e)&&(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=Ly();pt(e)&&(e=[e]);const s=this.options.preload||[],i=e.filter(a=>s.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return i.length?(this.options.preload=s.concat(i),this.loadResources(a=>{r.resolve(),n&&n(a)}),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 A4(T4());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 p0(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:CS;const r=e.forkResourceStore;r&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},i=new p0(s);return(e.debug!==void 0||e.prefix!==void 0)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(o=>{i[o]=this[o]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r&&(i.store=new E4(this.store.data,s),i.services.resourceStore=i.store),i.translator=new FC(i.services,s),i.translator.on("*",function(o){for(var c=arguments.length,u=new Array(c>1?c-1:0),f=1;f{const[e,n]=_.useState(!1),[r,s]=_.useState({title:"Título",description:"Descripción",cancelLabel:sr("common.no"),confirmLabel:sr("common.yes"),onCancel:()=>{},onConfirm:()=>{},...t}),i=(u,f)=>{u==null||u.preventDefault(),f&&s(f),n(!0)},a=u=>{u==null||u.preventDefault(),n(!1),r==null||r.onCancel(u)},o=u=>{u==null||u.preventDefault(),n(!1),r==null||r.onConfirm(u)},c=r?P.jsx(IQ,{isOpen:e,onCancel:a,onConfirm:o,title:r.title,description:r.description,cancelLabel:r.cancelLabel,confirmLabel:r.confirmLabel}):P.jsx(P.Fragment,{});return{openDialog:i,cancelDialog:a,confirmDialog:o,DialogComponent:c}};var jQ={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(self,()=>{return n={7629:(s,i,a)=>{const o=a(375),c=a(8571),u=a(9474),f=a(1687),l=a(8652),d=a(8160),m=a(3292),p=a(6354),h=a(8901),y=a(9708),g=a(6914),v=a(2294),w=a(6133),x=a(1152),A=a(8863),T=a(2036),R={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 w.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 o(typeof y.describe=="function","Manifest functionality disabled"),y.describe(this)}allow(...E){return d.verifyFlat(E,"allow"),this._values(E,"_valids")}alter(E){o(E&&typeof E=="object"&&!Array.isArray(E),"Invalid targets argument"),o(!this._inRuleset(),"Cannot set alterations inside a ruleset");const k=this.clone();k.$_terms.alterations=k.$_terms.alterations||[];for(const N in E){const O=E[N];o(typeof O=="function","Alteration adjuster for",N,"must be a function"),k.$_terms.alterations.push({target:N,adjuster:O})}return k.$_temp.ruleset=!1,k}artifact(E){return o(E!==void 0,"Artifact cannot be undefined"),o(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",E)}cast(E){return o(E===!1||typeof E=="string","Invalid to value"),o(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,k){return this._default("default",E,k)}description(E){return o(E&&typeof E=="string","Description must be a non-empty string"),this.$_setFlag("description",E)}empty(E){const k=this.clone();return E!==void 0&&(E=k.$_compile(E,{override:!1})),k.$_setFlag("empty",E,{clone:!1})}error(E){return o(E,"Missing error"),o(E instanceof Error||typeof E=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",E)}example(E,k={}){return o(E!==void 0,"Missing example"),d.assertOptions(k,["override"]),this._inner("examples",E,{single:!0,override:k.override})}external(E,k){return typeof E=="object"&&(o(!k,"Cannot combine options with description"),k=E.description,E=E.method),o(typeof E=="function","Method must be a function"),o(k===void 0||k&&typeof k=="string","Description must be a non-empty string"),this._inner("externals",{method:E,description:k},{single:!0})}failover(E,k){return this._default("failover",E,k)}forbidden(){return this.presence("forbidden")}id(E){return E?(o(typeof E=="string","id must be a non-empty string"),o(/^[^\.]+$/.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 o(E&&typeof E=="string","Label name must be a non-empty string"),this.$_setFlag("label",E)}meta(E){return o(E!==void 0,"Meta cannot be undefined"),this._inner("metas",E,{single:!0})}note(...E){o(E.length,"Missing notes");for(const k of E)o(k&&typeof k=="string","Notes must be non-empty strings");return this._inner("notes",E)}only(E=!0){return o(typeof E=="boolean","Invalid mode:",E),this.$_setFlag("only",E)}optional(){return this.presence("optional")}prefs(E){o(E,"Missing preferences"),o(E.context===void 0,"Cannot override context"),o(E.externals===void 0,"Cannot override externals"),o(E.warnings===void 0,"Cannot override warnings"),o(E.debug===void 0,"Cannot override debug"),d.checkPreferences(E);const k=this.clone();return k._preferences=d.preferences(k._preferences,E),k}presence(E){return o(["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 o(["raw","strip"].includes(E),"Unknown result mode",E),this.$_setFlag("result",E)}required(){return this.presence("required")}strict(E){const k=this.clone(),N=E!==void 0&&!E;return k._preferences=d.preferences(k._preferences,{convert:N}),k}strip(E=!0){return this.$_setFlag("result",E?"strip":void 0)}tag(...E){o(E.length,"Missing tags");for(const k of E)o(k&&typeof k=="string","Tags must be non-empty strings");return this._inner("tags",E)}unit(E){return o(E&&typeof E=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",E)}valid(...E){d.verifyFlat(E,"valid");const k=this.allow(...E);return k.$_setFlag("only",!!k._valids,{clone:!1}),k}when(E,k){const N=this.clone();N.$_terms.whens||(N.$_terms.whens=[]);const O=m.when(N,E,k);if(!["any","link"].includes(N.type)){const L=O.is?[O]:O.switch;for(const I of L)o(!I.then||I.then.type==="any"||I.then.type===N.type,"Cannot combine",N.type,"with",I.then&&I.then.type),o(!I.otherwise||I.otherwise.type==="any"||I.otherwise.type===N.type,"Cannot combine",N.type,"with",I.otherwise&&I.otherwise.type)}return N.$_terms.whens.push(O),N.$_mutateRebuild()}cache(E){o(!this._inRuleset(),"Cannot set caching inside a ruleset"),o(!this._cache,"Cannot override schema cache"),o(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const k=this.clone();return k._cache=E||l.provider.provision(),k.$_temp.ruleset=!1,k}clone(){const E=Object.create(Object.getPrototypeOf(this));return this._assign(E)}concat(E){o(d.isSchema(E),"Invalid schema object"),o(this.type==="any"||E.type==="any"||E.type===this.type,"Cannot merge type",this.type,"with another type:",E.type),o(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),o(!E._inRuleset(),"Cannot concatenate a schema with open ruleset");let k=this.clone();if(this.type==="any"&&E.type!=="any"){const N=E.clone();for(const O of Object.keys(k))O!=="type"&&(N[O]=k[O]);k=N}k._ids.concat(E._ids),k._refs.register(E,w.toSibling),k._preferences=k._preferences?d.preferences(k._preferences,E._preferences):E._preferences,k._valids=T.merge(k._valids,E._valids,E._invalids),k._invalids=T.merge(k._invalids,E._invalids,E._valids);for(const N of E._singleRules.keys())k._singleRules.has(N)&&(k._rules=k._rules.filter(O=>O.keep||O.name!==N),k._singleRules.delete(N));for(const N of E._rules)E._definition.rules[N.method].multi||k._singleRules.set(N.name,N),k._rules.push(N);if(k._flags.empty&&E._flags.empty){k._flags.empty=k._flags.empty.concat(E._flags.empty);const N=Object.assign({},E._flags);delete N.empty,f(k._flags,N)}else if(E._flags.empty){k._flags.empty=E._flags.empty;const N=Object.assign({},E._flags);delete N.empty,f(k._flags,N)}else f(k._flags,E._flags);for(const N in E.$_terms){const O=E.$_terms[N];O?k.$_terms[N]?k.$_terms[N]=k.$_terms[N].concat(O):k.$_terms[N]=O.slice():k.$_terms[N]||(k.$_terms[N]=O)}return this.$_root._tracer&&this.$_root._tracer._combine(k,[this,E]),k.$_mutateRebuild()}extend(E){return o(!E.base,"Cannot extend type with another base"),h.type(this,E)}extract(E){return E=Array.isArray(E)?E:E.split("."),this._ids.reach(E)}fork(E,k){o(!this._inRuleset(),"Cannot fork inside a ruleset");let N=this;for(let O of[].concat(E))O=Array.isArray(O)?O:O.split("."),N=N._ids.fork(O,k,N);return N.$_temp.ruleset=!1,N}rule(E){const k=this._definition;d.assertOptions(E,Object.keys(k.modifiers)),o(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const N=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;o(N>=0&&NN.tailor(E),ref:!1}),k.$_temp.ruleset=!1,k.$_mutateRebuild()}tracer(){return x.location?x.location(this):this}validate(E,k){return A.entry(E,this,k)}validateAsync(E,k){return A.entryAsync(E,this,k)}$_addRule(E){typeof E=="string"&&(E={name:E}),o(E&&typeof E=="object","Invalid options"),o(E.name&&typeof E.name=="string","Invalid rule name");for(const I in E)o(I[0]!=="_","Cannot set private rule properties");const k=Object.assign({},E);k._resolve=[],k.method=k.method||k.name;const N=this._definition.rules[k.method],O=k.args;o(N,"Unknown rule",k.method);const L=this.clone();if(O){o(Object.keys(O).length===1||Object.keys(O).length===this._definition.rules[k.name].args.length,"Invalid rule definition for",this.type,k.name);for(const I in O){let F=O[I];if(N.argsByName){const U=N.argsByName.get(I);if(U.ref&&d.isResolvable(F))k._resolve.push(I),L.$_mutateRegister(F);else if(U.normalize&&(F=U.normalize(F),O[I]=F),U.assert){const Y=d.validateArg(F,I,U);o(!Y,Y,"or reference")}}F!==void 0?O[I]=F:delete O[I]}}return N.multi||(L._ruleRemove(k.name,{clone:!1}),L._singleRules.set(k.name,k)),L.$_temp.ruleset===!1&&(L.$_temp.ruleset=null),N.priority?L._rules.unshift(k):L._rules.push(k),L}$_compile(E,k){return m.schema(this.$_root,E,k)}$_createError(E,k,N,O,L,I={}){const F=I.flags!==!1?this._flags:{},U=I.messages?g.merge(this._definition.messages,I.messages):this._definition.messages;return new p.Report(E,k,N,F,U,O,L)}$_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,k,N,O){(N=Object.assign({},N)).abortEarly=!0,N._externals=!1,k.snapshot();const L=!A.validate(E,this,k,N,O).errors;return k.restore(),L}$_modify(E){return d.assertOptions(E,["each","once","ref","schema"]),v.schema(this,E)||this}$_mutateRebuild(){return o(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(E,{source:k,name:N,path:O,key:L})=>{const I=this._definition[k][N]&&this._definition[k][N].register;I!==!1&&this.$_mutateRegister(E,{family:I,key:L})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(E,{family:k,key:N}={}){this._refs.register(E,k),this._ids.register(E,{key:N})}$_property(E){return this._definition.properties[E]}$_reach(E){return this._ids.reach(E)}$_rootReferences(){return this._refs.roots()}$_setFlag(E,k,N={}){o(E[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const O=this._definition.flags[E]||{};if(u(k,O.default)&&(k=void 0),u(k,this._flags[E]))return this;const L=N.clone!==!1?this.clone():this;return k!==void 0?(L._flags[E]=k,L.$_mutateRegister(k)):delete L._flags[E],E[0]!=="_"&&(L.$_temp.ruleset=!1),L}$_parent(E,...k){return this[E][d.symbols.parent].call(this,...k)}$_validate(E,k,N){return A.validate(E,this,k,N)}_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 k in this.$_terms)E.$_terms[k]=this.$_terms[k]?this.$_terms[k].slice():null;E.$_super={};for(const k in this.$_super)E.$_super[k]=this._super[k].bind(E);return E}_bare(){const E=this.clone();E._reset();const k=E._definition.terms;for(const N in k){const O=k[N];E.$_terms[N]=O.init}return E.$_mutateRebuild()}_default(E,k,N={}){return d.assertOptions(N,"literal"),o(k!==void 0,"Missing",E,"value"),o(typeof k=="function"||!N.literal,"Only function value supports literal option"),typeof k=="function"&&N.literal&&(k={[d.symbols.literal]:!0,literal:k}),this.$_setFlag(E,k)}_generate(E,k,N){if(!this.$_terms.whens)return{schema:this};const O=[],L=[];for(let U=0;Uee)break}const I=L.join(", ");if(k.mainstay.tracer.debug(k,"rule","when",I),!I)return{schema:this};if(!k.mainstay.tracer.active&&this.$_temp.whens[I])return{schema:this.$_temp.whens[I],id:I};let F=this;this._definition.generate&&(F=this._definition.generate(this,E,k,N));for(const U of O)F=F.concat(U);return this.$_root._tracer&&this.$_root._tracer._combine(F,[this,...O]),this.$_temp.whens[I]=F,{schema:F,id:I}}_inner(E,k,N={}){o(!this._inRuleset(),`Cannot set ${E} inside a ruleset`);const O=this.clone();return O.$_terms[E]&&!N.override||(O.$_terms[E]=[]),N.single?O.$_terms[E].push(k):O.$_terms[E].push(...k),O.$_temp.ruleset=!1,O}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(E,k={}){if(!this._singleRules.has(E))return this;const N=k.clone!==!1?this.clone():this;N._singleRules.delete(E);const O=[];for(let L=0;L{const o=a(375),c=a(8571),u=a(8160),f={max:1e3,supported:new Set(["undefined","boolean","number","string"])};i.provider={provision:l=>new f.Cache(l)},f.Cache=class{constructor(l={}){u.assertOptions(l,["max"]),o(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,d){if(l!==null&&!f.supported.has(typeof l))return;let m=this._map.get(l);if(m)return m.value=d,void this._list.first(m);m=this._list.unshift({key:l,value:d}),this._map.set(l,m),this._compact()}get(l){const d=this._map.get(l);if(d)return this._list.first(d),c(d.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:d,prev:m}=l;return d.prev=m,m&&(m.next=d),l===this.tail&&(this.tail=d),l.prev=null,l.next=null,l}}},8160:(s,i,a)=>{const o=a(375),c=a(7916),u=a(5934);let f,l;const d={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=u.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(m,p,h="Options"){o(m&&typeof m=="object"&&!Array.isArray(m),"Options must be of type object");const y=Object.keys(m).filter(g=>!p.includes(g));o(y.length===0,`${h} contain unknown keys: ${y}`)},i.checkPreferences=function(m){l=l||a(3378);const p=l.preferences.validate(m);if(p.error)throw new c([p.error.details[0].message])},i.compare=function(m,p,h){switch(h){case"=":return m===p;case">":return m>p;case"<":return m=":return m>=p;case"<=":return m<=p}},i.default=function(m,p){return m===void 0?p:m},i.isIsoDate=function(m){return d.isoDate.test(m)},i.isNumber=function(m){return typeof m=="number"&&!isNaN(m)},i.isResolvable=function(m){return!!m&&(m[i.symbols.ref]||m[i.symbols.template])},i.isSchema=function(m,p={}){const h=m&&m[i.symbols.any];return!!h&&(o(p.legacy||h.version===i.version,"Cannot mix different versions of joi schemas"),!0)},i.isValues=function(m){return m[i.symbols.values]},i.limit=function(m){return Number.isSafeInteger(m)&&m>=0},i.preferences=function(m,p){f=f||a(6914),m=m||{},p=p||{};const h=Object.assign({},m,p);return p.errors&&m.errors&&(h.errors=Object.assign({},m.errors,p.errors),h.errors.wrap=Object.assign({},m.errors.wrap,p.errors.wrap)),p.messages&&(h.messages=f.compile(p.messages,m.messages)),delete h[i.symbols.prefs],h},i.tryWithPath=function(m,p,h={}){try{return m()}catch(y){throw y.path!==void 0?y.path=p+"."+y.path:y.path=p,h.append&&(y.message=`${y.message} (${y.path})`),y}},i.validateArg=function(m,p,{assert:h,message:y}){if(i.isSchema(h)){const g=h.validate(m);return g.error?g.error.message:void 0}if(!h(m))return p?`${p} ${y}`:y},i.verifyFlat=function(m,p){for(const h of m)o(!Array.isArray(h),"Method no longer accepts array arguments:",p)}},3292:(s,i,a)=>{const o=a(375),c=a(8160),u=a(6133),f={};i.schema=function(l,d,m={}){c.assertOptions(m,["appendPath","override"]);try{return f.schema(l,d,m)}catch(p){throw m.appendPath&&p.path!==void 0&&(p.message=`${p.message} (${p.path})`),p}},f.schema=function(l,d,m){o(d!==void 0,"Invalid undefined schema"),Array.isArray(d)&&(o(d.length,"Invalid empty array schema"),d.length===1&&(d=d[0]));const p=(h,...y)=>m.override!==!1?h.valid(l.override,...y):h.valid(...y);if(f.simple(d))return p(l,d);if(typeof d=="function")return l.custom(d);if(o(typeof d=="object","Invalid schema content:",typeof d),c.isResolvable(d))return p(l,d);if(c.isSchema(d))return d;if(Array.isArray(d)){for(const h of d)if(!f.simple(h))return l.alternatives().try(...d);return p(l,...d)}return d instanceof RegExp?l.string().regex(d):d instanceof Date?p(l.date(),d):(o(Object.getPrototypeOf(d)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),l.object().keys(d))},i.ref=function(l,d){return u.isRef(l)?l:u.create(l,d)},i.compile=function(l,d,m={}){c.assertOptions(m,["legacy"]);const p=d&&d[c.symbols.any];if(p)return o(m.legacy||p.version===c.version,"Cannot mix different versions of joi schemas:",p.version,c.version),d;if(typeof d!="object"||!m.legacy)return i.schema(l,d,{appendPath:!0});const h=f.walk(d);return h?h.compile(h.root,d):i.schema(l,d,{appendPath:!0})},f.walk=function(l){if(typeof l!="object")return null;if(Array.isArray(l)){for(const m of l){const p=f.walk(m);if(p)return p}return null}const d=l[c.symbols.any];if(d)return{root:l[d.root],compile:d.compile};o(Object.getPrototypeOf(l)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const m in l){const p=f.walk(l[m]);if(p)return p}return null},f.simple=function(l){return l===null||["boolean","string","number"].includes(typeof l)},i.when=function(l,d,m){if(m===void 0&&(o(d&&typeof d=="object","Missing options"),m=d,d=u.create(".")),Array.isArray(m)&&(m={switch:m}),c.assertOptions(m,["is","not","then","otherwise","switch","break"]),c.isSchema(d))return o(m.is===void 0,'"is" can not be used with a schema condition'),o(m.not===void 0,'"not" can not be used with a schema condition'),o(m.switch===void 0,'"switch" can not be used with a schema condition'),f.condition(l,{is:d,then:m.then,otherwise:m.otherwise,break:m.break});if(o(u.isRef(d)||typeof d=="string","Invalid condition:",d),o(m.not===void 0||m.is===void 0,'Cannot combine "is" with "not"'),m.switch===void 0){let h=m;m.not!==void 0&&(h={is:m.not,then:m.otherwise,otherwise:m.then,break:m.break});let y=h.is!==void 0?l.$_compile(h.is):l.$_root.invalid(null,!1,0,"").required();return o(h.then!==void 0||h.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),o(h.break===void 0||h.then===void 0||h.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),m.is===void 0||u.isRef(m.is)||c.isSchema(m.is)||(y=y.required()),f.condition(l,{ref:i.ref(d),is:y,then:h.then,otherwise:h.otherwise,break:h.break})}o(Array.isArray(m.switch),'"switch" must be an array'),o(m.is===void 0,'Cannot combine "switch" with "is"'),o(m.not===void 0,'Cannot combine "switch" with "not"'),o(m.then===void 0,'Cannot combine "switch" with "then"');const p={ref:i.ref(d),switch:[],break:m.break};for(let h=0;h{const o=a(5688),c=a(8160),u=a(3328);i.Report=class{constructor(f,l,d,m,p,h,y){if(this.code=f,this.flags=m,this.messages=p,this.path=h.path,this.prefs=y,this.state=h,this.value=l,this.message=null,this.template=null,this.local=d||{},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 d of f)typeof d!="object"&&(typeof d=="string"?(l&&(l+="."),l+=d):l+=`[${d}]`);return l},i.template=function(f,l,d,m,p){if(!l)return;if(u.isTemplate(l))return d!=="root"?l:null;let h=p.errors.language;if(c.isResolvable(h)&&(h=h.resolve(f,m,p)),h&&l[h]){if(l[h][d]!==void 0)return l[h][d];if(l[h]["*"]!==void 0)return l[h]["*"]}return l[d]?l[d]:l["*"]},i.label=function(f,l,d,m){if(!d.errors.label)return"";if(f.label)return f.label;let p=l.path;return d.errors.label==="key"&&l.path.length>1&&(p=l.path.slice(-1)),i.path(p)||i.template(null,d.messages,"root",l,d)||m&&i.template(null,m,"root",l,d)||"value"},i.process=function(f,l,d){if(!f)return null;const{override:m,message:p,details:h}=i.details(f);if(m)return m;if(d.errors.stack)return new i.ValidationError(p,h,l);const y=Error.stackTraceLimit;Error.stackTraceLimit=0;const g=new i.ValidationError(p,h,l);return Error.stackTraceLimit=y,g},i.details=function(f,l={}){let d=[];const m=[];for(const p of f){if(p instanceof Error){if(l.override!==!1)return{override:p};const y=p.toString();d.push(y),m.push({message:y,type:"override",context:{error:p}});continue}const h=p.toString();d.push(h),m.push({message:h,path:p.path.filter(y=>typeof y!="object"),type:p.code,context:p.local})}return d.length>1&&(d=[...new Set(d)]),{message:d.join(". "),details:m}},i.ValidationError=class extends Error{constructor(f,l,d){super(f),this._original=d,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=o.error},8901:(s,i,a)=>{const o=a(375),c=a(8571),u=a(8160),f=a(6914),l={};i.type=function(d,m){const p=Object.getPrototypeOf(d),h=c(p),y=d._assign(Object.create(h)),g=Object.assign({},m);delete g.base,h._definition=g;const v=p._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 w=Object.assign({},v.terms);if(g.terms)for(const R in g.terms){const E=g.terms[R];o(y.$_terms[R]===void 0,"Invalid term override for",g.type,R),y.$_terms[R]=E.init,w[R]=E}g.terms=w,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 x=Object.assign({},v.rules);if(g.rules)for(const R in g.rules){const E=g.rules[R];o(typeof E=="object","Invalid rule definition for",g.type,R);let k=E.method;if(k===void 0&&(k=function(){return this.$_addRule(R)}),k&&(o(!h[R],"Rule conflict in",g.type,R),h[R]=k),o(!x[R],"Rule conflict in",g.type,R),x[R]=E,E.alias){const N=[].concat(E.alias);for(const O of N)h[O]=E.method}E.args&&(E.argsByName=new Map,E.args=E.args.map(N=>(typeof N=="string"&&(N={name:N}),o(!E.argsByName.has(N.name),"Duplicated argument name",N.name),u.isSchema(N.assert)&&(N.assert=N.assert.strict().label(N.name)),E.argsByName.set(N.name,N),N)))}g.rules=x;const A=Object.assign({},v.modifiers);if(g.modifiers)for(const R in g.modifiers){o(!h[R],"Rule conflict in",g.type,R);const E=g.modifiers[R];o(typeof E=="function","Invalid modifier definition for",g.type,R);const k=function(N){return this.rule({[R]:N})};h[R]=k,A[R]=E}if(g.modifiers=A,g.overrides){h._super=p,y.$_super={};for(const R in g.overrides)o(p[R],"Cannot override missing",R),g.overrides[R][u.symbols.parent]=p[R],y.$_super[R]=p[R].bind(y);Object.assign(h,g.overrides)}g.cast=Object.assign({},v.cast,g.cast);const T=Object.assign({},v.manifest,g.manifest);return T.build=l.build(g.manifest&&g.manifest.build,v.manifest&&v.manifest.build),g.manifest=T,g.rebuild=l.rebuild(g.rebuild,v.rebuild),y},l.build=function(d,m){return d&&m?function(p,h){return m(d(p,h),h)}:d||m},l.coerce=function(d,m){return d&&m?{from:d.from&&m.from?[...new Set([...d.from,...m.from])]:null,method(p,h){let y;if((!m.from||m.from.includes(typeof p))&&(y=m.method(p,h),y)){if(y.errors||y.value===void 0)return y;p=y.value}if(!d.from||d.from.includes(typeof p)){const g=d.method(p,h);if(g)return g}return y}}:d||m},l.prepare=function(d,m){return d&&m?function(p,h){const y=d(p,h);if(y){if(y.errors||y.value===void 0)return y;p=y.value}return m(p,h)||y}:d||m},l.rebuild=function(d,m){return d&&m?function(p){m(p),d(p)}:d||m},l.validate=function(d,m){return d&&m?function(p,h){const y=m(p,h);if(y){if(y.errors&&(!Array.isArray(y.errors)||y.errors.length))return y;p=y.value}return d(p,h)||y}:d||m}},5107:(s,i,a)=>{const o=a(375),c=a(8571),u=a(8652),f=a(8160),l=a(3292),d=a(6354),m=a(8901),p=a(9708),h=a(6133),y=a(3328),g=a(1152);let v;const w={types:{alternatives:a(4946),any:a(8068),array:a(546),boolean:a(4937),date:a(7500),function:a(390),link:a(8785),number:a(3832),object:a(8966),string:a(7417),symbol:a(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const x={_types:new Set(Object.keys(w.types))};for(const A of x._types)x[A]=function(...T){return o(!T.length||["alternatives","link","object"].includes(A),"The",A,"type does not allow arguments"),w.generate(this,w.types[A],T)};for(const A of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])x[A]=function(...T){return this.any()[A](...T)};Object.assign(x,w.methods);for(const A in w.aliases){const T=w.aliases[A];x[A]=x[T]}return x.x=x.expression,g.setup&&g.setup(x),x}};w.methods={ValidationError:d.ValidationError,version:f.version,cache:u.provider,assert(x,A,...T){w.assert(x,A,!0,T)},attempt:(x,A,...T)=>w.assert(x,A,!1,T),build(x){return o(typeof p.build=="function","Manifest functionality disabled"),p.build(this,x)},checkPreferences(x){f.checkPreferences(x)},compile(x,A){return l.compile(this,x,A)},defaults(x){o(typeof x=="function","modifier must be a function");const A=Object.assign({},this);for(const T of A._types){const R=x(A[T]());o(f.isSchema(R),"modifier must return a valid schema object"),A[T]=function(...E){return w.generate(this,R,E)}}return A},expression:(...x)=>new y(...x),extend(...x){f.verifyFlat(x,"extend"),v=v||a(3378),o(x.length,"You need to provide at least one extension"),this.assert(x,v.extensions);const A=Object.assign({},this);A._types=new Set(A._types);for(let T of x){typeof T=="function"&&(T=T(A)),this.assert(T,v.extension);const R=w.expandExtension(T,A);for(const E of R){o(A[E.type]===void 0||A._types.has(E.type),"Cannot override name",E.type);const k=E.base||this.any(),N=m.type(k,E);A._types.add(E.type),A[E.type]=function(...O){return w.generate(this,N,O)}}}return A},isError:d.ValidationError.isError,isExpression:y.isTemplate,isRef:h.isRef,isSchema:f.isSchema,in:(...x)=>h.in(...x),override:f.symbols.override,ref:(...x)=>h.create(...x),types(){const x={};for(const A of this._types)x[A]=this[A]();for(const A in w.aliases)x[A]=this[A]();return x}},w.assert=function(x,A,T,R){const E=R[0]instanceof Error||typeof R[0]=="string"?R[0]:null,k=E!==null?R[1]:R[0],N=A.validate(x,f.preferences({errors:{stack:!0}},k||{}));let O=N.error;if(!O)return N.value;if(E instanceof Error)throw E;const L=T&&typeof O.annotate=="function"?O.annotate():O.message;throw O instanceof d.ValidationError==0&&(O=c(O)),O.message=E?`${E} ${L}`:L,O},w.generate=function(x,A,T){return o(x,"Must be invoked on a Joi instance."),A.$_root=x,A._definition.args&&T.length?A._definition.args(A,...T):A},w.expandExtension=function(x,A){if(typeof x.type=="string")return[x];const T=[];for(const R of A._types)if(x.type.test(R)){const E=Object.assign({},x);E.type=R,E.base=A[R](),T.push(E)}return T},s.exports=w.root()},6914:(s,i,a)=>{const o=a(375),c=a(8571),u=a(3328);i.compile=function(f,l){if(typeof f=="string")return o(!l,"Cannot set single message string"),new u(f);if(u.isTemplate(f))return o(!l,"Cannot set single message template"),f;o(typeof f=="object"&&!Array.isArray(f),"Invalid message options"),l=l?c(l):{};for(let d in f){const m=f[d];if(d==="root"||u.isTemplate(m)){l[d]=m;continue}if(typeof m=="string"){l[d]=new u(m);continue}o(typeof m=="object"&&!Array.isArray(m),"Invalid message for",d);const p=d;for(d in l[p]=l[p]||{},m){const h=m[d];d==="root"||u.isTemplate(h)?l[p][d]=h:(o(typeof h=="string","Invalid message for",d,"in",p),l[p][d]=new u(h))}}return l},i.decompile=function(f){const l={};for(let d in f){const m=f[d];if(d==="root"){l.root=m;continue}if(u.isTemplate(m)){l[d]=m.describe({compact:!0});continue}const p=d;for(d in l[p]={},m){const h=m[d];d!=="root"?l[p][d]=h.describe({compact:!0}):l[p].root=h}}return l},i.merge=function(f,l){if(!f)return i.compile(l);if(!l)return f;if(typeof l=="string")return new u(l);if(u.isTemplate(l))return l;const d=c(f);for(let m in l){const p=l[m];if(m==="root"||u.isTemplate(p)){d[m]=p;continue}if(typeof p=="string"){d[m]=new u(p);continue}o(typeof p=="object"&&!Array.isArray(p),"Invalid message for",m);const h=m;for(m in d[h]=d[h]||{},p){const y=p[m];m==="root"||u.isTemplate(y)?d[h][m]=y:(o(typeof y=="string","Invalid message for",m,"in",h),d[h][m]=new u(y))}}return d}},2294:(s,i,a)=>{const o=a(375),c=a(8160),u=a(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[d,m]of l._byId.entries())o(!this._byKey.has(d),"Schema id conflicts with existing key:",d),this._byId.set(d,m);for(const[d,m]of l._byKey.entries())o(!this._byId.has(d),"Schema key conflicts with existing id:",d),this._byKey.set(d,m)}fork(l,d,m){const p=this._collect(l);p.push({schema:m});const h=p.shift();let y={id:h.id,schema:d(h.schema)};o(c.isSchema(y.schema),"adjuster function failed to return a joi schema type");for(const g of p)y={id:g.id,schema:f.fork(g.schema,y.id,y.schema)};return y.schema}labels(l,d=[]){const m=l[0],p=this._get(m);if(!p)return[...d,...l].join(".");const h=l.slice(1);return d=[...d,p.schema._flags.label||m],h.length?p.schema._ids.labels(h,d):d.join(".")}reach(l,d=[]){const m=l[0],p=this._get(m);o(p,"Schema does not contain path",[...d,...l].join("."));const h=l.slice(1);return h.length?p.schema._ids.reach(h,[...d,m]):p.schema}register(l,{key:d}={}){if(!l||!c.isSchema(l))return;(l.$_property("schemaChain")||l._ids._schemaChain)&&(this._schemaChain=!0);const m=l._flags.id;if(m){const p=this._byId.get(m);o(!p||p.schema===l,"Cannot add different schemas with the same id:",m),o(!this._byKey.has(m),"Schema id conflicts with existing key:",m),this._byId.set(m,{schema:l,id:m})}d&&(o(!this._byKey.has(d),"Schema already contains key:",d),o(!this._byId.has(d),"Schema key conflicts with existing id:",d),this._byKey.set(d,{schema:l,id:d}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(l,d=[],m=[]){const p=l[0],h=this._get(p);o(h,"Schema does not contain path",[...d,...l].join(".")),m=[h,...m];const y=l.slice(1);return y.length?h.schema._ids._collect(y,[...d,p],m):m}_get(l){return this._byId.get(l)||this._byKey.get(l)}},f.fork=function(l,d,m){const p=i.schema(l,{each:(h,{key:y})=>{if(d===(h._flags.id||y))return m},ref:!1});return p?p.$_mutateRebuild():l},i.schema=function(l,d){let m;for(const p in l._flags){if(p[0]==="_")continue;const h=f.scan(l._flags[p],{source:"flags",name:p},d);h!==void 0&&(m=m||l.clone(),m._flags[p]=h)}for(let p=0;p{const o=a(375),c=a(8571),u=a(9621),f=a(8160);let l;const d={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};i.create=function(m,p={}){o(typeof m=="string","Invalid reference key:",m),f.assertOptions(p,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),o(!p.prefix||typeof p.prefix=="object","options.prefix must be of type object");const h=Object.assign({},d.defaults,p);delete h.prefix;const y=h.separator,g=d.context(m,y,p.prefix);if(h.type=g.type,m=g.key,h.type==="value")if(g.root&&(o(!y||m[0]!==y,"Cannot specify relative path with root prefix"),h.ancestor="root",m||(m=null)),y&&y===m)m=null,h.ancestor=0;else if(h.ancestor!==void 0)o(!y||!m||m[0]!==y,"Cannot combine prefix with ancestor option");else{const[v,w]=d.ancestor(m,y);w&&(m=m.slice(w))===""&&(m=null),h.ancestor=v}return h.path=y?m===null?[]:m.split(y):[m],new d.Ref(h)},i.in=function(m,p={}){return i.create(m,{...p,in:!0})},i.isRef=function(m){return!!m&&!!m[f.symbols.ref]},d.Ref=class{constructor(m){o(typeof m=="object","Invalid reference construction"),f.assertOptions(m,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),o([!1,void 0].includes(m.separator)||typeof m.separator=="string"&&m.separator.length===1,"Invalid separator"),o(!m.adjust||typeof m.adjust=="function","options.adjust must be a function"),o(!m.map||Array.isArray(m.map),"options.map must be an array"),o(!m.map||!m.adjust,"Cannot set both map and adjust options"),Object.assign(this,d.defaults,m),o(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(m,p,h,y,g={}){return o(!this.in||g.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(h.context,p,g):this.type==="local"?this._resolve(y,p,g):this.ancestor?this.ancestor==="root"?this._resolve(p.ancestors[p.ancestors.length-1],p,g):(o(this.ancestor<=p.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(p.ancestors[this.ancestor-1],p,g)):this._resolve(m,p,g)}_resolve(m,p,h){let y;if(this.type==="value"&&p.mainstay.shadow&&h.shadow!==!1&&(y=p.mainstay.shadow.get(this.absolute(p))),y===void 0&&(y=u(m,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 p.mainstay&&p.mainstay.tracer.resolve(p,this,y),y}toString(){return this.display}absolute(m){return[...m.path.slice(0,-this.ancestor),...this.path]}clone(){return new d.Ref(this)}describe(){const m={path:this.path};this.type!=="value"&&(m.type=this.type),this.separator!=="."&&(m.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(m.ancestor=this.ancestor),this.map&&(m.map=[...this.map]);for(const p of["adjust","iterables","render"])this[p]!==null&&this[p]!==void 0&&(m[p]=this[p]);return this.in!==!1&&(m.in=!0),{ref:m}}updateDisplay(){const m=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${m}`);if(!this.separator)return void(this.display=`ref:${m}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${m}`);if(this.ancestor==="root")return void(this.display=`ref:root:${m}`);if(this.ancestor===1)return void(this.display=`ref:${m||".."}`);const p=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${p}${m||""}`}},d.Ref.prototype[f.symbols.ref]=!0,i.build=function(m){return(m=Object.assign({},d.defaults,m)).type==="value"&&m.ancestor===void 0&&(m.ancestor=1),new d.Ref(m)},d.context=function(m,p,h={}){if(m=m.trim(),h){const y=h.global===void 0?"$":h.global;if(y!==p&&m.startsWith(y))return{key:m.slice(y.length),type:"global"};const g=h.local===void 0?"#":h.local;if(g!==p&&m.startsWith(g))return{key:m.slice(g.length),type:"local"};const v=h.root===void 0?"/":h.root;if(v!==p&&m.startsWith(v))return{key:m.slice(v.length),type:"value",root:!0}}return{key:m,type:"value"}},d.ancestor=function(m,p){if(!p)return[1,0];if(m[0]!==p)return[1,0];if(m[1]!==p)return[0,1];let h=2;for(;m[h]===p;)++h;return[h-1,h]},i.toSibling=0,i.toParent=1,i.Manager=class{constructor(){this.refs=[]}register(m,p){if(m)if(p=p===void 0?i.toParent:p,Array.isArray(m))for(const h of m)this.register(h,p);else if(f.isSchema(m))for(const h of m._refs.refs)h.ancestor-p>=0&&this.refs.push({ancestor:h.ancestor-p,root:h.root});else i.isRef(m)&&m.type==="value"&&m.ancestor-p>=0&&this.refs.push({ancestor:m.ancestor-p,root:m.root}),l=l||a(3328),l.isTemplate(m)&&this.register(m.refs(),p)}get length(){return this.refs.length}clone(){const m=new i.Manager;return m.refs=c(this.refs),m}reset(){this.refs=[]}roots(){return this.refs.filter(m=>!m.ancestor).map(m=>m.root)}}},3378:(s,i,a)=>{const o=a(5107),c={};c.wrap=o.string().min(1).max(2).allow(!1),i.preferences=o.object({allowUnknown:o.boolean(),abortEarly:o.boolean(),artifacts:o.boolean(),cache:o.boolean(),context:o.object(),convert:o.boolean(),dateFormat:o.valid("date","iso","string","time","utc"),debug:o.boolean(),errors:{escapeHtml:o.boolean(),label:o.valid("path","key",!1),language:[o.string(),o.object().ref()],render:o.boolean(),stack:o.boolean(),wrap:{label:c.wrap,array:c.wrap,string:c.wrap}},externals:o.boolean(),messages:o.object(),noDefaults:o.boolean(),nonEnumerables:o.boolean(),presence:o.valid("required","optional","forbidden"),skipFunctions:o.boolean(),stripUnknown:o.object({arrays:o.boolean(),objects:o.boolean()}).or("arrays","objects").allow(!0,!1),warnings:o.boolean()}).strict(),c.nameRx=/^[a-zA-Z0-9]\w*$/,c.rule=o.object({alias:o.array().items(o.string().pattern(c.nameRx)).single(),args:o.array().items(o.string(),o.object({name:o.string().pattern(c.nameRx).required(),ref:o.boolean(),assert:o.alternatives([o.function(),o.object().schema()]).conditional("ref",{is:!0,then:o.required()}),normalize:o.function(),message:o.string().when("assert",{is:o.function(),then:o.required()})})),convert:o.boolean(),manifest:o.boolean(),method:o.function().allow(!1),multi:o.boolean(),validate:o.function()}),i.extension=o.object({type:o.alternatives([o.string(),o.object().regex()]).required(),args:o.function(),cast:o.object().pattern(c.nameRx,o.object({from:o.function().maxArity(1).required(),to:o.function().minArity(1).maxArity(2).required()})),base:o.object().schema().when("type",{is:o.object().regex(),then:o.forbidden()}),coerce:[o.function().maxArity(3),o.object({method:o.function().maxArity(3).required(),from:o.array().items(o.string()).single()})],flags:o.object().pattern(c.nameRx,o.object({setter:o.string(),default:o.any()})),manifest:{build:o.function().arity(2)},messages:[o.object(),o.string()],modifiers:o.object().pattern(c.nameRx,o.function().minArity(1).maxArity(2)),overrides:o.object().pattern(c.nameRx,o.function()),prepare:o.function().maxArity(3),rebuild:o.function().arity(1),rules:o.object().pattern(c.nameRx,c.rule),terms:o.object().pattern(c.nameRx,o.object({init:o.array().allow(null).required(),manifest:o.object().pattern(/.+/,[o.valid("schema","single"),o.object({mapped:o.object({from:o.string().required(),to:o.string().required()}).required()})])})),validate:o.function().maxArity(3)}).strict(),i.extensions=o.array().items(o.object(),o.function().arity(1)).strict(),c.desc={buffer:o.object({buffer:o.string()}),func:o.object({function:o.function().required(),options:{literal:!0}}),override:o.object({override:!0}),ref:o.object({ref:o.object({type:o.valid("value","global","local"),path:o.array().required(),separator:o.string().length(1).allow(!1),ancestor:o.number().min(0).integer().allow("root"),map:o.array().items(o.array().length(2)).min(1),adjust:o.function(),iterables:o.boolean(),in:o.boolean(),render:o.boolean()}).required()}),regex:o.object({regex:o.string().min(3)}),special:o.object({special:o.valid("deep").required()}),template:o.object({template:o.string().required(),options:o.object()}),value:o.object({value:o.alternatives([o.object(),o.array()]).required()})},c.desc.entity=o.alternatives([o.array().items(o.link("...")),o.boolean(),o.function(),o.number(),o.string(),c.desc.buffer,c.desc.func,c.desc.ref,c.desc.regex,c.desc.special,c.desc.template,c.desc.value,o.link("/")]),c.desc.values=o.array().items(null,o.boolean(),o.function(),o.number().allow(1/0,-1/0),o.string().allow(""),o.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=o.object().pattern(/.+/,[o.string(),c.desc.template,o.object().pattern(/.+/,[o.string(),c.desc.template])]),i.description=o.object({type:o.string().required(),flags:o.object({cast:o.string(),default:o.any(),description:o.string(),empty:o.link("/"),failover:c.desc.entity,id:o.string(),label:o.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:o.boolean(),unit:o.string()}).unknown(),preferences:{allowUnknown:o.boolean(),abortEarly:o.boolean(),artifacts:o.boolean(),cache:o.boolean(),convert:o.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:o.boolean(),label:["path","key"],language:[o.string(),c.desc.ref],wrap:{label:c.wrap,array:c.wrap}},externals:o.boolean(),messages:c.desc.messages,noDefaults:o.boolean(),nonEnumerables:o.boolean(),presence:["required","optional","forbidden"],skipFunctions:o.boolean(),stripUnknown:o.object({arrays:o.boolean(),objects:o.boolean()}).or("arrays","objects").allow(!0,!1),warnings:o.boolean()},allow:c.desc.values,invalid:c.desc.values,rules:o.array().min(1).items({name:o.string().required(),args:o.object().min(1),keep:o.boolean(),message:[o.string(),c.desc.messages],warn:o.boolean()}),keys:o.object().pattern(/.*/,o.link("/")),link:c.desc.ref}).pattern(/^[a-z]\w*$/,o.any())},493:(s,i,a)=>{const o=a(8571),c=a(9621),u=a(8160),f={value:Symbol("value")};s.exports=f.State=class{constructor(l,d,m){this.path=l,this.ancestors=d,this.mainstay=m.mainstay,this.schemas=m.schemas,this.debug=null}localize(l,d=null,m=null){const p=new f.State(l,d,this);return m&&p.schemas&&(p.schemas=[f.schemas(m),...p.schemas]),p}nest(l,d){const m=new f.State(this.path,this.ancestors,this);return m.schemas=m.schemas&&[f.schemas(l),...m.schemas],m.debug=d,m}shadow(l,d){this.mainstay.shadow=this.mainstay.shadow||new f.Shadow,this.mainstay.shadow.set(this.path,l,d)}snapshot(){this.mainstay.shadow&&(this._snapshot=o(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 u.isSchema(l)?{schema:l}:l},f.Shadow=class{constructor(){this._values=null}set(l,d,m){if(!l.length||m==="strip"&&typeof l[l.length-1]=="number")return;this._values=this._values||new Map;let p=this._values;for(let h=0;h{const o=a(375),c=a(8571),u=a(5277),f=a(1447),l=a(8160),d=a(6354),m=a(6133),p={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=p.Template=class{constructor(h,y){if(o(typeof h=="string","Template source must be a string"),o(!h.includes("\0")&&!h.includes(""),"Template source cannot contain reserved control characters"),this.source=h,this.rendered=h,this._template=null,y){const{functions:g,...v}=y;this._settings=Object.keys(v).length?c(v):void 0,this._functions=g,this._functions&&(o(Object.keys(this._functions).every(w=>typeof w=="string"),"Functions keys must be strings"),o(Object.values(this._functions).every(w=>typeof w=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const h=p.encode(this.source),y=p.split(h);let g=!1;const v=[],w=y.shift();w&&v.push(w);for(const x of y){const A=x[0]!=="{",T=A?"}":"}}",R=x.indexOf(T);if(R===-1||x[1]==="{"){v.push(`{${p.decode(x)}`);continue}let E=x.slice(A?0:1,R);const k=E[0]===":";k&&(E=E.slice(1));const N=this._ref(p.decode(E),{raw:A,wrapped:k});v.push(N),typeof N!="string"&&(g=!0);const O=x.slice(R+T.length);O&&v.push(p.decode(O))}g?this._template=v:this.rendered=v.join("")}static date(h,y){return p.dateFormat[y.dateFormat].call(h)}describe(h={}){if(!this._settings&&h.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(h){return new p.Template(h.template,h.options||h.functions?{...h.options,functions:h.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(h){return!!h&&!!h[l.symbols.template]}refs(){if(!this._template)return;const h=[];for(const y of this._template)typeof y!="string"&&h.push(...y.refs);return h}resolve(h,y,g,v){return this._template&&this._template.length===1?this._part(this._template[0],h,y,g,v,{}):this.render(h,y,g,v)}_part(h,...y){return h.ref?h.ref.resolve(...y):h.formula.evaluate(y)}render(h,y,g,v,w={}){if(!this.isDynamic())return this.rendered;const x=[];for(const A of this._template)if(typeof A=="string")x.push(A);else{const T=this._part(A,h,y,g,v,w),R=p.stringify(T,h,y,g,v,w);if(R!==void 0){const E=A.raw||(w.errors&&w.errors.escapeHtml)===!1?R:u(R);x.push(p.wrap(E,A.wrapped&&g.errors.wrap.label))}}return x.join("")}_ref(h,{raw:y,wrapped:g}){const v=[],w=A=>{const T=m.create(A,this._settings);return v.push(T),R=>{const E=T.resolve(...R);return E!==void 0?E:null}};try{const A=this._functions?{...p.functions,...this._functions}:p.functions;var x=new f.Parser(h,{reference:w,functions:A,constants:p.constants})}catch(A){throw A.message=`Invalid template variable "${h}" fails due to: ${A.message}`,A}if(x.single){if(x.single.type==="reference"){const A=v[0];return{ref:A,raw:y,refs:v,wrapped:g||A.type==="local"&&A.key==="label"}}return p.stringify(x.single.value)}return{formula:x,raw:y,refs:v}}toString(){return this.source}},p.Template.prototype[l.symbols.template]=!0,p.Template.prototype.isImmutable=!0,p.encode=function(h){return h.replace(/\\(\{+)/g,(y,g)=>p.opens.slice(0,g.length)).replace(/\\(\}+)/g,(y,g)=>p.closes.slice(0,g.length))},p.decode=function(h){return h.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},p.split=function(h){const y=[];let g="";for(let v=0;v ${O.toString()}`);h=k}if(!Array.isArray(h))return h.toString();const E=[];for(const k of h)E.push(p.stringify(k,y,g,v,w,{arrayItems:!0,...x}));return p.wrap(E.join(", "),!R&&T.array)},p.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},p.functions={if:(h,y,g)=>h?y:g,length:h=>typeof h=="string"?h.length:h&&typeof h=="object"?Array.isArray(h)?h.length:Object.keys(h).length:null,msg(h){const[y,g,v,w,x]=this,A=x.messages;if(!A)return"";const T=d.template(y,A[0],h,g,v)||d.template(y,A[1],h,g,v);return T?T.render(y,g,v,w,x):""},number:h=>typeof h=="number"?h:typeof h=="string"?parseFloat(h):typeof h=="boolean"?h?1:0:h instanceof Date?h.getTime():null}},4946:(s,i,a)=>{const o=a(375),c=a(1687),u=a(8068),f=a(8160),l=a(3292),d=a(6354),m=a(6133),p={};s.exports=u.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:m.toSibling}},args:(h,...y)=>y.length===1&&Array.isArray(y[0])?h.try(...y[0]):h.try(...y),validate(h,y){const{schema:g,error:v,state:w,prefs:x}=y;if(g._flags.match){const T=[],R=[];for(let k=0;kd.details(k,{override:!1}))})};if(g._flags.match==="one")return T.length===1?{value:T[0]}:{errors:v("alternatives.one")};if(T.length!==g.$_terms.matches.length)return{errors:v("alternatives.all",{details:R.map(k=>d.details(k,{override:!1}))})};const E=k=>k.$_terms.matches.some(N=>N.schema.type==="object"||N.schema.type==="alternatives"&&E(N.schema));return E(g)?{value:T.reduce((k,N)=>c(k,N,{mergeArrays:!1}))}:{value:T[T.length-1]}}const A=[];for(let T=0;Tg.path[0]!=="is"&&typeof y._flags.label!="string"?y.label(h):void 0,ref:!1})}},rebuild(h){h.$_modify({each:y=>{f.isSchema(y)&&y.type==="array"&&h.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(h,y){if(y.matches)for(const g of y.matches){const{schema:v,ref:w,is:x,not:A,then:T,otherwise:R}=g;h=v?h.try(v):w?h.conditional(w,{is:x,then:T,not:A,otherwise:R,switch:g.switch}):h.conditional(x,{then:T,otherwise:R})}return h}},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}}"}}),p.errors=function(h,{error:y,state:g}){if(!h.length)return{errors:y("alternatives.any")};if(h.length===1)return{errors:h[0].reports};const v=new Set,w=[];for(const{reports:x,schema:A}of h){if(x.length>1)return p.unmatched(h,y);const T=x[0];if(T instanceof d.Report==0)return p.unmatched(h,y);if(T.state.path.length!==g.path.length){w.push({type:A.type,report:T});continue}if(T.code==="any.only"){for(const k of T.local.valids)v.add(k);continue}const[R,E]=T.code.split(".");E!=="base"?w.push({type:A.type,report:T}):T.code==="object.base"?v.add(T.local.type):v.add(R)}return w.length?w.length===1?{errors:w[0].report}:p.unmatched(h,y):{errors:y("alternatives.types",{types:[...v]})}},p.unmatched=function(h,y){const g=[];for(const v of h)g.push(...v.reports);return{errors:y("alternatives.match",d.details(g,{override:!1}))}}},8068:(s,i,a)=>{const o=a(375),c=a(7629),u=a(8160),f=a(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,d){return o(typeof l=="function","Method must be a function"),o(d===void 0||d&&typeof d=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:l,description:d}})},validate(l,d,{method:m}){try{return m(l,d)}catch(p){return d.error("any.custom",{error:p})}},args:["method","description"],multi:!0},messages:{method(l){return this.prefs({messages:l})}},shared:{method(l){o(u.isSchema(l)&&l._flags.id,"Schema must be a schema with an id");const d=this.clone();return d.$_terms.shared=d.$_terms.shared||[],d.$_terms.shared.push(l),d.$_mutateRegister(l),d}},warning:{method(l,d){return o(l&&typeof l=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:l,local:d},warn:!0})},validate:(l,d,{code:m,local:p})=>d.error(m,p),args:["code","local"],multi:!0}},modifiers:{keep(l,d=!0){l.keep=d},message(l,d){l.message=f.compile(d)},warn(l,d=!0){l.warn=d}},manifest:{build(l,d){for(const m in d){const p=d[m];if(["examples","externals","metas","notes","tags"].includes(m))for(const h of p)l=l[m.slice(0,-1)](h);else if(m!=="alterations")if(m!=="whens"){if(m==="shared")for(const h of p)l=l.shared(h)}else for(const h of p){const{ref:y,is:g,not:v,then:w,otherwise:x,concat:A}=h;l=A?l.concat(A):y?l.when(y,{is:g,not:v,then:w,otherwise:x,switch:h.switch,break:h.break}):l.when(g,{then:w,otherwise:x,break:h.break})}else{const h={};for(const{target:y,adjuster:g}of p)h[y]=g;l=l.alter(h)}}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,a)=>{const o=a(375),c=a(9474),u=a(9621),f=a(8068),l=a(8160),d=a(3292),m={};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(p,{schema:h,state:y,prefs:g}){if(!Array.isArray(p))return;const v=h.$_getRule("sort");return v?m.sort(h,p,v.args.options,y,g):void 0}},validate(p,{schema:h,error:y}){if(!Array.isArray(p)){if(h._flags.single){const g=[p];return g[l.symbols.arraySingle]=!0,{value:g}}return{errors:y("array.base")}}if(h.$_getRule("items")||h.$_terms.externals)return{value:p.slice()}},rules:{has:{method(p){p=this.$_compile(p,{appendPath:!0});const h=this.$_addRule({name:"has",args:{schema:p}});return h.$_mutateRegister(p),h},validate(p,{state:h,prefs:y,error:g},{schema:v}){const w=[p,...h.ancestors];for(let A=0;Athis.$_compile(p[y]),y,{append:!0});h.$_terms.items.push(g)}return h.$_mutateRebuild()},validate(p,{schema:h,error:y,state:g,prefs:v,errorsArray:w}){const x=h.$_terms._requireds.slice(),A=h.$_terms.ordered.slice(),T=[...h.$_terms._inclusions,...x],R=!p[l.symbols.arraySingle];delete p[l.symbols.arraySingle];const E=w();let k=p.length;for(let N=0;N="})}},ordered:{method(...p){l.verifyFlat(p,"ordered");const h=this.$_addRule("items");for(let y=0;ythis.$_compile(p[y]),y,{append:!0});m.validateSingle(g,h),h.$_mutateRegister(g),h.$_terms.ordered.push(g)}return h.$_mutateRebuild()}},single:{method(p){const h=p===void 0||!!p;return o(!h||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",h)}},sort:{method(p={}){l.assertOptions(p,["by","order"]);const h={order:p.order||"ascending"};return p.by&&(h.by=d.ref(p.by,{ancestor:0}),o(!h.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:h}})},validate(p,{error:h,state:y,prefs:g,schema:v},{options:w}){const{value:x,errors:A}=m.sort(v,p,w,y,g);if(A)return A;for(let T=0;Tnew Set(p)}},rebuild(p){p.$_terms._inclusions=[],p.$_terms._exclusions=[],p.$_terms._requireds=[];for(const h of p.$_terms.items)m.validateSingle(h,p),h._flags.presence==="required"?p.$_terms._requireds.push(h):h._flags.presence==="forbidden"?p.$_terms._exclusions.push(h):p.$_terms._inclusions.push(h);for(const h of p.$_terms.ordered)m.validateSingle(h,p)},manifest:{build:(p,h)=>(h.items&&(p=p.items(...h.items)),h.ordered&&(p=p.ordered(...h.ordered)),p)},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"}}),m.fillMissedErrors=function(p,h,y,g,v,w){const x=[];let A=0;for(const T of y){const R=T._flags.label;R?x.push(R):++A}x.length?A?h.push(p.$_createError("array.includesRequiredBoth",g,{knownMisses:x,unknownMisses:A},v,w)):h.push(p.$_createError("array.includesRequiredKnowns",g,{knownMisses:x},v,w)):h.push(p.$_createError("array.includesRequiredUnknowns",g,{unknownMisses:A},v,w))},m.fillOrderedErrors=function(p,h,y,g,v,w){const x=[];for(const A of y)A._flags.presence==="required"&&x.push(A);x.length&&m.fillMissedErrors(p,h,x,g,v,w)},m.fillDefault=function(p,h,y,g){const v=[];let w=!0;for(let x=p.length-1;x>=0;--x){const A=p[x],T=[h,...y.ancestors],R=A.$_validate(void 0,y.localize(y.path,T,A),g).value;if(w){if(R===void 0)continue;w=!1}v.unshift(R)}v.length&&h.push(...v)},m.fastSplice=function(p,h){let y=h;for(;y{let k=m.compare(R,E,x,A);if(k!==null||(y.by&&(R=y.by.resolve(R,g,v),E=y.by.resolve(E,g,v)),k=m.compare(R,E,x,A),k!==null))return k;const N=typeof R;if(N!==typeof E)throw p.$_createError("array.sort.mismatching",h,null,g,v);if(N!=="number"&&N!=="string")throw p.$_createError("array.sort.unsupported",h,{type:N},g,v);return N==="number"?(R-E)*w:R{const o=a(375),c=a(8068),u=a(8160),f=a(2036),l={isBool:function(d){return typeof d=="boolean"}};s.exports=c.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(d,{schema:m}){if(typeof d!="boolean"){if(typeof d=="string"){const p=m._flags.sensitive?d:d.toLowerCase();d=p==="true"||p!=="false"&&d}return typeof d!="boolean"&&(d=m.$_terms.truthy&&m.$_terms.truthy.has(d,null,null,!m._flags.sensitive)||(!m.$_terms.falsy||!m.$_terms.falsy.has(d,null,null,!m._flags.sensitive))&&d),{value:d}}},validate(d,{error:m}){if(typeof d!="boolean")return{value:d,errors:m("boolean.base")}},rules:{truthy:{method(...d){u.verifyFlat(d,"truthy");const m=this.clone();m.$_terms.truthy=m.$_terms.truthy||new f;for(let p=0;pd?1:0},string:{from:l.isBool,to:(d,m)=>d?"true":"false"}},manifest:{build:(d,m)=>(m.truthy&&(d=d.truthy(...m.truthy)),m.falsy&&(d=d.falsy(...m.falsy)),d)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(s,i,a)=>{const o=a(375),c=a(8068),u=a(8160),f=a(3328),l={isDate:function(d){return d instanceof Date}};s.exports=c.extend({type:"date",coerce:{from:["number","string"],method:(d,{schema:m})=>({value:l.parse(d,m._flags.format)||d})},validate(d,{schema:m,error:p,prefs:h}){if(d instanceof Date&&!isNaN(d.getTime()))return;const y=m._flags.format;return h.convert&&y&&typeof d=="string"?{value:d,errors:p("date.format",{format:y})}:{value:d,errors:p("date.base")}},rules:{compare:{method:!1,validate(d,m,{date:p},{name:h,operator:y,args:g}){const v=p==="now"?Date.now():p.getTime();return u.compare(d.getTime(),v,y)?d:m.error("date."+h,{limit:g.date,value:d})},args:[{name:"date",ref:!0,normalize:d=>d==="now"?d:l.parse(d),assert:d=>d!==null,message:"must have a valid date format"}]},format:{method(d){return o(["iso","javascript","unix"].includes(d),"Unknown date format",d),this.$_setFlag("format",d)}},greater:{method(d){return this.$_addRule({name:"greater",method:"compare",args:{date:d},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(d){return this.$_addRule({name:"less",method:"compare",args:{date:d},operator:"<"})}},max:{method(d){return this.$_addRule({name:"max",method:"compare",args:{date:d},operator:"<="})}},min:{method(d){return this.$_addRule({name:"min",method:"compare",args:{date:d},operator:">="})}},timestamp:{method(d="javascript"){return o(["javascript","unix"].includes(d),'"type" must be one of "javascript, unix"'),this.format(d)}}},cast:{number:{from:l.isDate,to:(d,m)=>d.getTime()},string:{from:l.isDate,to:(d,{prefs:m})=>f.date(d,m)}},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(d,m){if(d instanceof Date)return d;if(typeof d!="string"&&(isNaN(d)||!isFinite(d))||/^\s*$/.test(d))return null;if(m==="iso")return u.isIsoDate(d)?l.date(d.toString()):null;const p=d;if(typeof d=="string"&&/^[+-]?\d+(\.\d+)?$/.test(d)&&(d=parseFloat(d)),m){if(m==="javascript")return l.date(1*d);if(m==="unix")return l.date(1e3*d);if(typeof p=="string")return null}return l.date(d)},l.date=function(d){const m=new Date(d);return isNaN(m.getTime())?null:m}},390:(s,i,a)=>{const o=a(375),c=a(7824);s.exports=c.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(u){return o(Number.isSafeInteger(u)&&u>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:u}})},validate:(u,f,{n:l})=>u.length===l?u:f.error("function.arity",{n:l})},class:{method(){return this.$_addRule("class")},validate:(u,f)=>/^\s*class\s/.test(u.toString())?u:f.error("function.class",{value:u})},minArity:{method(u){return o(Number.isSafeInteger(u)&&u>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:u}})},validate:(u,f,{n:l})=>u.length>=l?u:f.error("function.minArity",{n:l})},maxArity:{method(u){return o(Number.isSafeInteger(u)&&u>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:u}})},validate:(u,f,{n:l})=>u.length<=l?u: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,a)=>{const o=a(978),c=a(375),u=a(8571),f=a(3652),l=a(8068),d=a(8160),m=a(3292),p=a(6354),h=a(6133),y=a(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,w)=>v.keys(w),validate(v,{schema:w,error:x,state:A,prefs:T}){if(!v||typeof v!==w.$_property("typeof")||Array.isArray(v))return{value:v,errors:x("object.base",{type:w.$_property("typeof")})};if(!(w.$_terms.renames||w.$_terms.dependencies||w.$_terms.keys||w.$_terms.patterns||w.$_terms.externals))return;v=g.clone(v,T);const R=[];if(w.$_terms.renames&&!g.rename(w,v,A,T,R))return{value:v,errors:R};if(!w.$_terms.keys&&!w.$_terms.patterns&&!w.$_terms.dependencies)return{value:v,errors:R};const E=new Set(Object.keys(v));if(w.$_terms.keys){const k=[v,...A.ancestors];for(const N of w.$_terms.keys){const O=N.key,L=v[O];E.delete(O);const I=A.localize([...A.path,O],k,N),F=N.schema.$_validate(L,I,T);if(F.errors){if(T.abortEarly)return{value:v,errors:F.errors};F.value!==void 0&&(v[O]=F.value),R.push(...F.errors)}else N.schema._flags.result==="strip"||F.value===void 0&&L!==void 0?delete v[O]:F.value!==void 0&&(v[O]=F.value)}}if(E.size||w._flags._hasPatternMatch){const k=g.unknown(w,v,E,R,A,T);if(k)return k}if(w.$_terms.dependencies)for(const k of w.$_terms.dependencies){if(k.key!==null&&g.isPresent(k.options)(k.key.resolve(v,A,T,null,{shadow:!1}))===!1)continue;const N=g.dependencies[k.rel](w,k,v,A,T);if(N){const O=w.$_createError(N.code,v,N.context,A,T);if(T.abortEarly)return{value:v,errors:O};R.push(O)}}return{value:v,errors:R}},rules:{and:{method(...v){return d.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,w,x){y.isTemplate(v)||(v=m.ref(v)),c(x===void 0||typeof x=="string","Message must be a string"),w=this.$_compile(w,{appendPath:!0});const A=this.$_addRule({name:"assert",args:{subject:v,schema:w,message:x}});return A.$_mutateRegister(v),A.$_mutateRegister(w),A},validate(v,{error:w,prefs:x,state:A},{subject:T,schema:R,message:E}){const k=T.resolve(v,A,x),N=h.isRef(T)?T.absolute(A):[];return R.$_match(k,A.localize(N,[v,...A.ancestors],R),x)?v:w("object.assert",{subject:T,message:E})},args:["subject","schema","message"],multi:!0},instance:{method(v,w){return c(typeof v=="function","constructor must be a function"),w=w||v.name,this.$_addRule({name:"instance",args:{constructor:v,name:w}})},validate:(v,w,{constructor:x,name:A})=>v instanceof x?v:w.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(!d.isSchema(v),"Object schema cannot be a joi schema");const w=this.clone();if(v)if(Object.keys(v).length){w.$_terms.keys=w.$_terms.keys?w.$_terms.keys.filter(x=>!v.hasOwnProperty(x.key)):new g.Keys;for(const x in v)d.tryWithPath(()=>w.$_terms.keys.push({key:x,schema:this.$_compile(v[x])}),x)}else w.$_terms.keys=new g.Keys;else w.$_terms.keys=null;return w.$_mutateRebuild()}},length:{method(v){return this.$_addRule({name:"length",args:{limit:v},operator:"="})},validate:(v,w,{limit:x},{name:A,operator:T,args:R})=>d.compare(Object.keys(v).length,x,T)?v:w.error("object."+A,{limit:R.limit,value:v}),args:[{name:"limit",ref:!0,assert:d.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 d.verifyFlat(v,"nand"),g.dependency(this,"nand",null,v)}},or:{method(...v){return d.verifyFlat(v,"or"),g.dependency(this,"or",null,v)}},oxor:{method(...v){return g.dependency(this,"oxor",null,v)}},pattern:{method(v,w,x={}){const A=v instanceof RegExp;A||(v=this.$_compile(v,{appendPath:!0})),c(w!==void 0,"Invalid rule"),d.assertOptions(x,["fallthrough","matches"]),A&&c(!v.flags.includes("g")&&!v.flags.includes("y"),"pattern should not use global or sticky mode"),w=this.$_compile(w,{appendPath:!0});const T=this.clone();T.$_terms.patterns=T.$_terms.patterns||[];const R={[A?"regex":"schema"]:v,rule:w};return x.matches&&(R.matches=this.$_compile(x.matches),R.matches.type!=="array"&&(R.matches=R.matches.$_root.array().items(R.matches)),T.$_mutateRegister(R.matches),T.$_setFlag("_hasPatternMatch",!0,{clone:!1})),x.fallthrough&&(R.fallthrough=!0),T.$_terms.patterns.push(R),T.$_mutateRegister(w),T}},ref:{method(){return this.$_addRule("ref")},validate:(v,w)=>h.isRef(v)?v:w.error("object.refType",{value:v})},regex:{method(){return this.$_addRule("regex")},validate:(v,w)=>v instanceof RegExp?v:w.error("object.regex",{value:v})},rename:{method(v,w,x={}){c(typeof v=="string"||v instanceof RegExp,"Rename missing the from argument"),c(typeof w=="string"||w instanceof y,"Invalid rename to argument"),c(w!==v,"Cannot rename key to same name:",v),d.assertOptions(x,["alias","ignoreUndefined","override","multiple"]);const A=this.clone();A.$_terms.renames=A.$_terms.renames||[];for(const T of A.$_terms.renames)c(T.from!==v,"Cannot rename the same key multiple times");return w instanceof y&&A.$_mutateRegister(w),A.$_terms.renames.push({from:v,to:w,options:o(g.renameDefaults,x)}),A}},schema:{method(v="any"){return this.$_addRule({name:"schema",args:{type:v}})},validate:(v,w,{type:x})=>!d.isSchema(v)||x!=="any"&&v.type!==x?w.error("object.schema",{type:x}):v},unknown:{method(v){return this.$_setFlag("unknown",v!==!1)}},with:{method(v,w,x={}){return g.dependency(this,"with",v,w,x)}},without:{method(v,w,x={}){return g.dependency(this,"without",v,w,x)}},xor:{method(...v){return d.verifyFlat(v,"xor"),g.dependency(this,"xor",null,v)}}},overrides:{default(v,w){return v===void 0&&(v=d.symbols.deepDefault),this.$_parent("default",v,w)}},rebuild(v){if(v.$_terms.keys){const w=new f.Sorter;for(const x of v.$_terms.keys)d.tryWithPath(()=>w.add(x,{after:x.schema.$_rootReferences(),group:x.key}),x.key);v.$_terms.keys=new g.Keys(...w.nodes)}},manifest:{build(v,w){if(w.keys&&(v=v.keys(w.keys)),w.dependencies)for(const{rel:x,key:A=null,peers:T,options:R}of w.dependencies)v=g.dependency(v,x,A,T,R);if(w.patterns)for(const{regex:x,schema:A,rule:T,fallthrough:R,matches:E}of w.patterns)v=v.pattern(x||A,T,{fallthrough:R,matches:E});if(w.renames)for(const{from:x,to:A,options:T}of w.renames)v=v.rename(x,A,T);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,w){if(typeof v=="object"){if(w.nonEnumerables)return u(v,{shallow:!0});const A=Object.create(Object.getPrototypeOf(v));return Object.assign(A,v),A}const x=function(...A){return v.apply(this,A)};return x.prototype=u(v.prototype),Object.defineProperty(x,"name",{value:v.name,writable:!1}),Object.defineProperty(x,"length",{value:v.length,writable:!1}),Object.assign(x,v),x},g.dependency=function(v,w,x,A,T){c(x===null||typeof x=="string",w,"key must be a strings"),T||(T=A.length>1&&typeof A[A.length-1]=="object"?A.pop():{}),d.assertOptions(T,["separator","isPresent"]),A=[].concat(A);const R=d.default(T.separator,"."),E=[];for(const N of A)c(typeof N=="string",w,"peers must be strings"),E.push(m.ref(N,{separator:R,ancestor:0,prefix:!1}));x!==null&&(x=m.ref(x,{separator:R,ancestor:0,prefix:!1}));const k=v.clone();return k.$_terms.dependencies=k.$_terms.dependencies||[],k.$_terms.dependencies.push(new g.Dependency(w,x,E,A,T)),k},g.dependencies={and(v,w,x,A,T){const R=[],E=[],k=w.peers.length,N=g.isPresent(w.options);for(const O of w.peers)N(O.resolve(x,A,T,null,{shadow:!1}))===!1?R.push(O.key):E.push(O.key);if(R.length!==k&&E.length!==k)return{code:"object.and",context:{present:E,presentWithLabels:g.keysToLabels(v,E),missing:R,missingWithLabels:g.keysToLabels(v,R)}}},nand(v,w,x,A,T){const R=[],E=g.isPresent(w.options);for(const O of w.peers)E(O.resolve(x,A,T,null,{shadow:!1}))&&R.push(O.key);if(R.length!==w.peers.length)return;const k=w.paths[0],N=w.paths.slice(1);return{code:"object.nand",context:{main:k,mainWithLabel:g.keysToLabels(v,k),peers:N,peersWithLabels:g.keysToLabels(v,N)}}},or(v,w,x,A,T){const R=g.isPresent(w.options);for(const E of w.peers)if(R(E.resolve(x,A,T,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:w.paths,peersWithLabels:g.keysToLabels(v,w.paths)}}},oxor(v,w,x,A,T){const R=[],E=g.isPresent(w.options);for(const N of w.peers)E(N.resolve(x,A,T,null,{shadow:!1}))&&R.push(N.key);if(!R.length||R.length===1)return;const k={peers:w.paths,peersWithLabels:g.keysToLabels(v,w.paths)};return k.present=R,k.presentWithLabels=g.keysToLabels(v,R),{code:"object.oxor",context:k}},with(v,w,x,A,T){const R=g.isPresent(w.options);for(const E of w.peers)if(R(E.resolve(x,A,T,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:w.key.key,mainWithLabel:g.keysToLabels(v,w.key.key),peer:E.key,peerWithLabel:g.keysToLabels(v,E.key)}}},without(v,w,x,A,T){const R=g.isPresent(w.options);for(const E of w.peers)if(R(E.resolve(x,A,T,null,{shadow:!1})))return{code:"object.without",context:{main:w.key.key,mainWithLabel:g.keysToLabels(v,w.key.key),peer:E.key,peerWithLabel:g.keysToLabels(v,E.key)}}},xor(v,w,x,A,T){const R=[],E=g.isPresent(w.options);for(const N of w.peers)E(N.resolve(x,A,T,null,{shadow:!1}))&&R.push(N.key);if(R.length===1)return;const k={peers:w.paths,peersWithLabels:g.keysToLabels(v,w.paths)};return R.length===0?{code:"object.missing",context:k}:(k.present=R,k.presentWithLabels=g.keysToLabels(v,R),{code:"object.xor",context:k})}},g.keysToLabels=function(v,w){return Array.isArray(w)?w.map(x=>v.$_mapLabels(x)):v.$_mapLabels(w)},g.isPresent=function(v){return typeof v.isPresent=="function"?v.isPresent:w=>w!==void 0},g.rename=function(v,w,x,A,T){const R={};for(const E of v.$_terms.renames){const k=[],N=typeof E.from!="string";if(N)for(const O in w){if(w[O]===void 0&&E.options.ignoreUndefined||O===E.to)continue;const L=E.from.exec(O);L&&k.push({from:O,to:E.to,match:L})}else!Object.prototype.hasOwnProperty.call(w,E.from)||w[E.from]===void 0&&E.options.ignoreUndefined||k.push(E);for(const O of k){const L=O.from;let I=O.to;if(I instanceof y&&(I=I.render(w,x,A,O.match)),L!==I){if(!E.options.multiple&&R[I]&&(T.push(v.$_createError("object.rename.multiple",w,{from:L,to:I,pattern:N},x,A)),A.abortEarly)||Object.prototype.hasOwnProperty.call(w,I)&&!E.options.override&&!R[I]&&(T.push(v.$_createError("object.rename.override",w,{from:L,to:I,pattern:N},x,A)),A.abortEarly))return!1;w[L]===void 0?delete w[I]:w[I]=w[L],R[I]=!0,E.options.alias||delete w[L]}}}return!0},g.unknown=function(v,w,x,A,T,R){if(v.$_terms.patterns){let E=!1;const k=v.$_terms.patterns.map(O=>{if(O.matches)return E=!0,[]}),N=[w,...T.ancestors];for(const O of x){const L=w[O],I=[...T.path,O];for(let F=0;F{const o=a(375),c=a(8068),u=a(8160),f=a(3292),l=a(6354),d={};s.exports=c.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(m,p)=>m.ref(p),validate(m,{schema:p,state:h,prefs:y}){o(p.$_terms.link,"Uninitialized link schema");const g=d.generate(p,m,h,y),v=p.$_terms.link[0].ref;return g.$_validate(m,h.nest(g,`link:${v.display}:${g.type}`),y)},generate:(m,p,h,y)=>d.generate(m,p,h,y),rules:{ref:{method(m){o(!this.$_terms.link,"Cannot reinitialize schema"),m=f.ref(m),o(m.type==="value"||m.type==="local","Invalid reference type:",m.type),o(m.type==="local"||m.ancestor==="root"||m.ancestor>0,"Link cannot reference itself");const p=this.clone();return p.$_terms.link=[{ref:m}],p}},relative:{method(m=!0){return this.$_setFlag("relative",m)}}},overrides:{concat(m){o(this.$_terms.link,"Uninitialized link schema"),o(u.isSchema(m),"Invalid schema object"),o(m.type!=="link","Cannot merge type link with another link");const p=this.clone();return p.$_terms.whens||(p.$_terms.whens=[]),p.$_terms.whens.push({concat:m}),p.$_mutateRebuild()}},manifest:{build:(m,p)=>(o(p.link,"Invalid link description missing link"),m.ref(p.link))}}),d.generate=function(m,p,h,y){let g=h.mainstay.links.get(m);if(g)return g._generate(p,h,y).schema;const v=m.$_terms.link[0].ref,{perspective:w,path:x}=d.perspective(v,h);d.assert(w,"which is outside of schema boundaries",v,m,h,y);try{g=x.length?w.$_reach(x):w}catch{d.assert(!1,"to non-existing schema",v,m,h,y)}return d.assert(g.type!=="link","which is another link",v,m,h,y),m._flags.relative||h.mainstay.links.set(m,g),g._generate(p,h,y).schema},d.perspective=function(m,p){if(m.type==="local"){for(const{schema:h,key:y}of p.schemas){if((h._flags.id||y)===m.path[0])return{perspective:h,path:m.path.slice(1)};if(h.$_terms.shared){for(const g of h.$_terms.shared)if(g._flags.id===m.path[0])return{perspective:g,path:m.path.slice(1)}}}return{perspective:null,path:null}}return m.ancestor==="root"?{perspective:p.schemas[p.schemas.length-1].schema,path:m.path}:{perspective:p.schemas[m.ancestor]&&p.schemas[m.ancestor].schema,path:m.path}},d.assert=function(m,p,h,y,g,v){m||o(!1,`"${l.label(y._flags,g,v)}" contains link reference "${h.display}" ${p}`)}},3832:(s,i,a)=>{const o=a(375),c=a(8068),u=a(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 d=l.toString(),m=d.indexOf("."),p=d.indexOf("e");return(m<0?0:(p<0?d.length:p)-m-1)+(p<0?0:Math.max(0,-parseInt(d.slice(p+1))))}};s.exports=c.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(l,{schema:d,error:m}){if(!l.match(f.numberRx))return;l=l.trim();const p={value:parseFloat(l)};if(p.value===0&&(p.value=0),!d._flags.unsafe)if(l.match(/e/i)){if(f.extractSignificantDigits(l)!==f.extractSignificantDigits(String(p.value)))return p.errors=m("number.unsafe"),p}else{const h=p.value.toString();if(h.match(/e/i))return p;if(h!==f.normalizeDecimal(l))return p.errors=m("number.unsafe"),p}return p}},validate(l,{schema:d,error:m,prefs:p}){if(l===1/0||l===-1/0)return{value:l,errors:m("number.infinity")};if(!u.isNumber(l))return{value:l,errors:m("number.base")};const h={value:l};if(p.convert){const y=d.$_getRule("precision");if(y){const g=Math.pow(10,y.args.limit);h.value=Math.round(h.value*g)/g}}return h.value===0&&(h.value=0),!d._flags.unsafe&&(l>Number.MAX_SAFE_INTEGER||lu.compare(l,m,h)?l:d.error("number."+p,{limit:y.limit,value:l}),args:[{name:"limit",ref:!0,assert:u.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,d)=>Math.trunc(l)-l==0?l:d.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 d=typeof l=="number"?f.decimalPlaces(l):null,m=Math.pow(10,d);return this.$_addRule({name:"multiple",args:{base:l,baseDecimalPlace:d,pfactor:m}})},validate:(l,d,{base:m,baseDecimalPlace:p,pfactor:h},y)=>f.decimalPlaces(l)>p?d.error("number.multiple",{multiple:y.args.base,value:l}):Math.round(h*l)%Math.round(h*m)==0?l:d.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,d)=>Number.isSafeInteger(l)&&l>=0&&l<=65535?l:d.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(l){return o(Number.isSafeInteger(l),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:l}})},validate(l,d,{limit:m}){const p=l.toString().match(f.precisionRx);return Math.max((p[1]?p[1].length:0)-(p[2]?parseInt(p[2],10):0),0)<=m?l:d.error("number.precision",{limit:m,value:l})},convert:!0},sign:{method(l){return o(["negative","positive"].includes(l),"Invalid sign",l),this.$_addRule({name:"sign",args:{sign:l}})},validate:(l,d,{sign:m})=>m==="negative"&&l<0||m==="positive"&&l>0?l:d.error(`number.${m}`)},unsafe:{method(l=!0){return o(typeof l=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",l)}}},cast:{string:{from:l=>typeof l=="number",to:(l,d)=>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,a)=>{const o=a(7824);s.exports=o.extend({type:"object",cast:{map:{from:c=>c&&typeof c=="object",to:(c,u)=>new Map(Object.entries(c))}}})},7417:(s,i,a)=>{const o=a(375),c=a(5380),u=a(1745),f=a(9959),l=a(6064),d=a(9926),m=a(5752),p=a(8068),h=a(8160),y={tlds:d instanceof Set&&{tlds:{allow:d,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=p.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(g,{schema:v,state:w,prefs:x}){const A=v.$_getRule("normalize");A&&(g=g.normalize(A.args.form));const T=v.$_getRule("case");T&&(g=T.args.direction==="upper"?g.toLocaleUpperCase():g.toLocaleLowerCase());const R=v.$_getRule("trim");if(R&&R.args.enabled&&(g=g.trim()),v.$_terms.replacements)for(const k of v.$_terms.replacements)g=g.replace(k.pattern,k.replacement);const E=v.$_getRule("hex");if(E&&E.args.options.byteAligned&&g.length%2!=0&&(g=`0${g}`),v.$_getRule("isoDate")){const k=y.isoDate(g);k&&(g=k)}if(v._flags.truncate){const k=v.$_getRule("max");if(k){let N=k.args.limit;if(h.isResolvable(N)&&(N=N.resolve(g,w,x),!h.limit(N)))return{value:g,errors:v.$_createError("any.ref",N,{ref:k.args.limit,arg:"limit",reason:"must be a positive integer"},w,x)};g=g.slice(0,N)}}return{value:g}}},validate(g,{schema:v,error:w}){if(typeof g!="string")return{value:g,errors:w("string.base")};if(g===""){const x=v.$_getRule("min");return x&&x.args.limit===0?void 0:{value:g,errors:w("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 h.assertOptions(g,["paddingRequired","urlSafe"]),g={urlSafe:!1,paddingRequired:!0,...g},o(typeof g.paddingRequired=="boolean","paddingRequired must be boolean"),o(typeof g.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:g}})},validate:(g,v,{options:w})=>y.base64Regex[w.paddingRequired][w.urlSafe].test(g)?g:v.error("string.base64")},case:{method(g){return o(["lower","upper"].includes(g),"Invalid case:",g),this.$_addRule({name:"case",args:{direction:g}})},validate:(g,v,{direction:w})=>w==="lower"&&g===g.toLocaleLowerCase()||w==="upper"&&g===g.toLocaleUpperCase()?g:v.error(`string.${w}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(g,v){let w=g.length,x=0,A=1;for(;w--;){const T=g.charAt(w)*A;x+=T-9*(T>9),A^=3}return x>0&&x%10==0?g:v.error("string.creditCard")}},dataUri:{method(g={}){return h.assertOptions(g,["paddingRequired"]),g={paddingRequired:!0,...g},o(typeof g.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:g}})},validate(g,v,{options:w}){const x=g.match(y.dataUriRegex);return x&&(!x[2]||x[2]!=="base64"||y.base64Regex[w.paddingRequired].false.test(x[3]))?g:v.error("string.dataUri")}},domain:{method(g){g&&h.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,w,{address:x})=>c.isValid(g,x)?g:v.error("string.domain")},email:{method(g={}){h.assertOptions(g,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),o(g.multiple===void 0||typeof g.multiple=="boolean","multiple option must be an boolean");const v=y.addressOptions(g),w=new RegExp(`\\s*[${g.separator?l(g.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:g},regex:w,address:v})},validate(g,v,{options:w},{regex:x,address:A}){const T=w.multiple?g.split(x):[g],R=[];for(const E of T)u.isValid(E,A)||R.push(E);return R.length?v.error("string.email",{value:g,invalids:R}):g}},guid:{alias:"uuid",method(g={}){h.assertOptions(g,["version","separator"]);let v="";if(g.version){const A=[].concat(g.version);o(A.length>=1,"version must have at least 1 valid version specified");const T=new Set;for(let R=0;R(w.prefix==="optional"?y.hexRegex.withOptionalPrefix:w.prefix===!0?y.hexRegex.withPrefix:y.hexRegex.withoutPrefix).test(g)?w.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={}){h.assertOptions(g,["cidr","version"]);const{cidr:v,versions:w,regex:x}=f.regex(g),A=g.version?w:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:v,version:A}},regex:x})},validate:(g,v,{options:w},{regex:x})=>x.test(g)?g:w.version?v.error("string.ipVersion",{value:g,cidr:w.cidr,version:w.version}):v.error("string.ip",{value:g,cidr:w.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:w,encoding:x},{name:A,operator:T,args:R}){const E=!x&&g.length;return h.compare(E,w,T)?g:v.error("string."+A,{limit:R.limit,value:g,encoding:x})},args:[{name:"limit",ref:!0,assert:h.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 o(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:w})=>g===g.normalize(w)?g:v("string.normalize",{value:g,form:w}),convert:!0},pattern:{alias:"regex",method(g,v={}){o(g instanceof RegExp,"regex must be a RegExp"),o(!g.flags.includes("g")&&!g.flags.includes("y"),"regex should not use global or sticky mode"),typeof v=="string"&&(v={name:v}),h.assertOptions(v,["invert","name"]);const w=["string.pattern",v.invert?".invert":"",v.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:g,options:v},errorCode:w})},validate:(g,v,{regex:w,options:x},{errorCode:A})=>w.test(g)^x.invert?g:v.error(A,{name:x.name,regex:w,value:g}),args:["regex","options"],multi:!0},replace:{method(g,v){typeof g=="string"&&(g=new RegExp(l(g),"g")),o(g instanceof RegExp,"pattern must be a RegExp"),o(typeof v=="string","replacement must be a String");const w=this.clone();return w.$_terms.replacements||(w.$_terms.replacements=[]),w.$_terms.replacements.push({pattern:g,replacement:v}),w}},token:{method(){return this.$_addRule("token")},validate:(g,v)=>/^\w+$/.test(g)?g:v.error("string.token")},trim:{method(g=!0){return o(typeof g=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:g}})},validate:(g,v,{enabled:w})=>w&&g!==g.trim()?v.error("string.trim"):g,convert:!0},truncate:{method(g=!0){return o(typeof g=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",g)}},uppercase:{method(){return this.case("upper")}},uri:{method(g={}){h.assertOptions(g,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),g.domain&&h.assertOptions(g.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:v,scheme:w}=m.regex(g),x=g.domain?y.addressOptions(g.domain):null;return this.$_addRule({name:"uri",args:{options:g},regex:v,domain:x,scheme:w})},validate(g,v,{options:w},{regex:x,domain:A,scheme:T}){if(["http:/","https:/"].includes(g))return v.error("string.uri");let R=x.exec(g);if(!R&&v.prefs.convert&&w.encodeUri){const E=encodeURI(g);R=x.exec(E),R&&(g=E)}if(R){const E=R[1]||R[2];return!A||w.allowRelative&&!E||c.isValid(E,A)?g:v.error("string.domain",{value:E})}return w.relativeOnly?v.error("string.uriRelativeOnly"):w.scheme?v.error("string.uriCustomScheme",{scheme:T,value:g}):v.error("string.uri")}}},manifest:{build(g,v){if(v.replacements)for(const{pattern:w,replacement:x}of v.replacements)g=g.replace(w,x);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(o(g.minDomainSegments===void 0||Number.isSafeInteger(g.minDomainSegments)&&g.minDomainSegments>0,"minDomainSegments must be a positive integer"),o(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 o(y.tlds,"Built-in TLD list disabled"),Object.assign({},g,y.tlds);o(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)}})),o(g.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),o(!g.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),y.validateTlds(g.tlds.deny,"tlds.deny"),g;const w=g.tlds.allow;return w?w===!0?(o(y.tlds,"Built-in TLD list disabled"),Object.assign({},g,y.tlds)):(Array.isArray(w)&&(g=Object.assign({},g,{tlds:{allow:new Set(w)}})),o(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 w of g)o(c.isValid(w,{minDomainSegments:1,maxDomainSegments:1}),`${v} must contain valid top level domain names`)},y.isoDate=function(g){if(!h.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,w,x,A){return o(!A||!1,"Invalid encoding:",A),g.$_addRule({name:v,method:"length",args:{limit:w,encoding:A},operator:x})}},8826:(s,i,a)=>{const o=a(375),c=a(8068),u={};u.Map=class extends Map{slice(){return new u.Map(this)}},s.exports=c.extend({type:"symbol",terms:{map:{init:new u.Map}},coerce:{method(f,{schema:l,error:d}){const m=l.$_terms.map.get(f);return m&&(f=m),l._flags.only&&typeof f!="symbol"?{value:f,errors:d("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)),o(f&&f[Symbol.iterator],"Iterable must be an iterable or object");const l=this.clone(),d=[];for(const m of f){o(m&&m[Symbol.iterator],"Entry must be an iterable");const[p,h]=m;o(typeof p!="object"&&typeof p!="function"&&typeof p!="symbol","Key must not be of type object, function, or Symbol"),o(typeof h=="symbol","Value must be a Symbol"),l.$_terms.map.set(p,h),d.push(h)}return l.valid(...d)}}},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,a)=>{const o=a(375),c=a(8571),u=a(738),f=a(9621),l=a(8160),d=a(6354),m=a(493),p={result:Symbol("result")};i.entry=function(h,y,g){let v=l.defaults;g&&(o(g.warnings===void 0,"Cannot override warnings preference in synchronous validation"),o(g.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),v=l.preferences(l.defaults,g));const w=p.entry(h,y,v);o(!w.mainstay.externals.length,"Schema with external rules must use validateAsync()");const x={value:w.value};return w.error&&(x.error=w.error),w.mainstay.warnings.length&&(x.warning=d.details(w.mainstay.warnings)),w.mainstay.debug&&(x.debug=w.mainstay.debug),w.mainstay.artifacts&&(x.artifacts=w.mainstay.artifacts),x},i.entryAsync=async function(h,y,g){let v=l.defaults;g&&(v=l.preferences(l.defaults,g));const w=p.entry(h,y,v),x=w.mainstay;if(w.error)throw x.debug&&(w.error.debug=x.debug),w.error;if(x.externals.length){let T=w.value;const R=[];for(const E of x.externals){const k=E.state.path,N=E.schema.type==="link"?x.links.get(E.schema):null;let O,L,I=T;const F=k.length?[T]:[],U=k.length?f(h,k):h;if(k.length){O=k[k.length-1];let Y=T;for(const V of k.slice(0,-1))Y=Y[V],F.unshift(Y);L=F[0],I=L[O]}try{const Y=(H,ee)=>(N||E.schema).$_createError(H,I,ee,E.state,v),V=await E.method(I,{schema:E.schema,linked:N,state:E.state,prefs:g,original:U,error:Y,errorsArray:p.errorsArray,warn:(H,ee)=>x.warnings.push((N||E.schema).$_createError(H,I,ee,E.state,v)),message:(H,ee)=>(N||E.schema).$_createError("external",I,ee,E.state,v,{messages:H})});if(V===void 0||V===I)continue;if(V instanceof d.Report){if(x.tracer.log(E.schema,E.state,"rule","external","error"),R.push(V),v.abortEarly)break;continue}if(Array.isArray(V)&&V[l.symbols.errors]){if(x.tracer.log(E.schema,E.state,"rule","external","error"),R.push(...V),v.abortEarly)break;continue}L?(x.tracer.value(E.state,"rule",I,V,"external"),L[O]=V):(x.tracer.value(E.state,"rule",T,V,"external"),T=V)}catch(Y){throw v.errors.label&&(Y.message+=` (${E.label})`),Y}}if(w.value=T,R.length)throw w.error=d.process(R,h,v),x.debug&&(w.error.debug=x.debug),w.error}if(!v.warnings&&!v.debug&&!v.artifacts)return w.value;const A={value:w.value};return x.warnings.length&&(A.warning=d.details(x.warnings)),x.debug&&(A.debug=x.debug),x.artifacts&&(A.artifacts=x.artifacts),A},p.Mainstay=class{constructor(h,y,g){this.externals=[],this.warnings=[],this.tracer=h,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 h=this._snapshots.pop();this.externals=h.externals,this.warnings=h.warnings}commit(){this._snapshots.pop()}},p.entry=function(h,y,g){const{tracer:v,cleanup:w}=p.tracer(y,g),x=g.debug?[]:null,A=y._ids._schemaChain?new Map:null,T=new p.Mainstay(v,x,A),R=y._ids._schemaChain?[{schema:y}]:null,E=new m([],[],{mainstay:T,schemas:R}),k=i.validate(h,y,E,g);w&&y.$_root.untrace();const N=d.process(k.errors,h,g);return{value:k.value,error:N,mainstay:T}},p.tracer=function(h,y){return h.$_root._tracer?{tracer:h.$_root._tracer._register(h)}:y.debug?(o(h.$_root.trace,"Debug mode not supported"),{tracer:h.$_root.trace()._register(h),cleanup:!0}):{tracer:p.ignore}},i.validate=function(h,y,g,v,w={}){if(y.$_terms.whens&&(y=y._generate(h,g,v).schema),y._preferences&&(v=p.prefs(y,v)),y._cache&&v.cache){const N=y._cache.get(h);if(g.mainstay.tracer.debug(g,"validate","cached",!!N),N)return N}const x=(N,O,L)=>y.$_createError(N,h,O,L||g,v),A={original:h,prefs:v,schema:y,state:g,error:x,errorsArray:p.errorsArray,warn:(N,O,L)=>g.mainstay.warnings.push(x(N,O,L)),message:(N,O)=>y.$_createError("custom",h,O,g,v,{messages:N})};g.mainstay.tracer.entry(y,g);const T=y._definition;if(T.prepare&&h!==void 0&&v.convert){const N=T.prepare(h,A);if(N){if(g.mainstay.tracer.value(g,"prepare",h,N.value),N.errors)return p.finalize(N.value,[].concat(N.errors),A);h=N.value}}if(T.coerce&&h!==void 0&&v.convert&&(!T.coerce.from||T.coerce.from.includes(typeof h))){const N=T.coerce.method(h,A);if(N){if(g.mainstay.tracer.value(g,"coerced",h,N.value),N.errors)return p.finalize(N.value,[].concat(N.errors),A);h=N.value}}const R=y._flags.empty;R&&R.$_match(p.trim(h,y),g.nest(R),l.defaults)&&(g.mainstay.tracer.value(g,"empty",h,void 0),h=void 0);const E=w.presence||y._flags.presence||(y._flags._endedSwitch?null:v.presence);if(h===void 0){if(E==="forbidden")return p.finalize(h,null,A);if(E==="required")return p.finalize(h,[y.$_createError("any.required",h,null,g,v)],A);if(E==="optional"){if(y._flags.default!==l.symbols.deepDefault)return p.finalize(h,null,A);g.mainstay.tracer.value(g,"default",h,{}),h={}}}else if(E==="forbidden")return p.finalize(h,[y.$_createError("any.unknown",h,null,g,v)],A);const k=[];if(y._valids){const N=y._valids.get(h,g,v,y._flags.insensitive);if(N)return v.convert&&(g.mainstay.tracer.value(g,"valids",h,N.value),h=N.value),g.mainstay.tracer.filter(y,g,"valid",N),p.finalize(h,null,A);if(y._flags.only){const O=y.$_createError("any.only",h,{valids:y._valids.values({display:!0})},g,v);if(v.abortEarly)return p.finalize(h,[O],A);k.push(O)}}if(y._invalids){const N=y._invalids.get(h,g,v,y._flags.insensitive);if(N){g.mainstay.tracer.filter(y,g,"invalid",N);const O=y.$_createError("any.invalid",h,{invalids:y._invalids.values({display:!0})},g,v);if(v.abortEarly)return p.finalize(h,[O],A);k.push(O)}}if(T.validate){const N=T.validate(h,A);if(N&&(g.mainstay.tracer.value(g,"base",h,N.value),h=N.value,N.errors)){if(!Array.isArray(N.errors))return k.push(N.errors),p.finalize(h,k,A);if(N.errors.length)return k.push(...N.errors),p.finalize(h,k,A)}}return y._rules.length?p.rules(h,k,A):p.finalize(h,k,A)},p.rules=function(h,y,g){const{schema:v,state:w,prefs:x}=g;for(const A of v._rules){const T=v._definition.rules[A.method];if(T.convert&&x.convert){w.mainstay.tracer.log(v,w,"rule",A.name,"full");continue}let R,E=A.args;if(A._resolve.length){E=Object.assign({},E);for(const N of A._resolve){const O=T.argsByName.get(N),L=E[N].resolve(h,w,x),I=O.normalize?O.normalize(L):L,F=l.validateArg(I,null,O);if(F){R=v.$_createError("any.ref",L,{arg:N,ref:E[N],reason:F},w,x);break}E[N]=I}}R=R||T.validate(h,g,E,A);const k=p.rule(R,A);if(k.errors){if(w.mainstay.tracer.log(v,w,"rule",A.name,"error"),A.warn){w.mainstay.warnings.push(...k.errors);continue}if(x.abortEarly)return p.finalize(h,k.errors,g);y.push(...k.errors)}else w.mainstay.tracer.log(v,w,"rule",A.name,"pass"),w.mainstay.tracer.value(w,"rule",h,k.value,A.name),h=k.value}return p.finalize(h,y,g)},p.rule=function(h,y){return h instanceof d.Report?(p.error(h,y),{errors:[h],value:null}):Array.isArray(h)&&h[l.symbols.errors]?(h.forEach(g=>p.error(g,y)),{errors:h,value:null}):{errors:null,value:h}},p.error=function(h,y){return y.message&&h._setTemplate(y.message),h},p.finalize=function(h,y,g){y=y||[];const{schema:v,state:w,prefs:x}=g;if(y.length){const T=p.default("failover",void 0,y,g);T!==void 0&&(w.mainstay.tracer.value(w,"failover",h,T),h=T,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 T of y)o(T instanceof Error||T instanceof d.Report,"error() must return an Error object")}else y=[v._flags.error];if(h===void 0){const T=p.default("default",h,y,g);w.mainstay.tracer.value(w,"default",h,T),h=T}if(v._flags.cast&&h!==void 0){const T=v._definition.cast[v._flags.cast];if(T.from(h)){const R=T.to(h,g);w.mainstay.tracer.value(w,"cast",h,R,v._flags.cast),h=R}}if(v.$_terms.externals&&x.externals&&x._externals!==!1)for(const{method:T}of v.$_terms.externals)w.mainstay.externals.push({method:T,schema:v,state:w,label:d.label(v._flags,w,x)});const A={value:h,errors:y.length?y:null};return v._flags.result&&(A.value=v._flags.result==="strip"?void 0:g.original,w.mainstay.tracer.value(w,v._flags.result,h,A.value),w.shadow(h,v._flags.result)),v._cache&&x.cache!==!1&&!v._refs.length&&v._cache.set(g.original,A),h===void 0||A.errors||v._flags.artifact===void 0||(w.mainstay.artifacts=w.mainstay.artifacts||new Map,w.mainstay.artifacts.has(v._flags.artifact)||w.mainstay.artifacts.set(v._flags.artifact,[]),w.mainstay.artifacts.get(v._flags.artifact).push(w.path)),A},p.prefs=function(h,y){const g=y===l.defaults;return g&&h._preferences[l.symbols.prefs]?h._preferences[l.symbols.prefs]:(y=l.preferences(y,h._preferences),g&&(h._preferences[l.symbols.prefs]=y),y)},p.default=function(h,y,g,v){const{schema:w,state:x,prefs:A}=v,T=w._flags[h];if(A.noDefaults||T===void 0)return y;if(x.mainstay.tracer.log(w,x,"rule",h,"full"),!T)return T;if(typeof T=="function"){const R=T.length?[c(x.ancestors[0]),v]:[];try{return T(...R)}catch(E){return void g.push(w.$_createError(`any.${h}`,null,{error:E},x,A))}}return typeof T!="object"?T:T[l.symbols.literal]?T.literal:l.isResolvable(T)?T.resolve(y,x,A):c(T)},p.trim=function(h,y){if(typeof h!="string")return h;const g=y.$_getRule("trim");return g&&g.args.enabled?h.trim():h},p.ignore={active:!1,debug:u,entry:u,filter:u,log:u,resolve:u,value:u},p.errorsArray=function(){const h=[];return h[l.symbols.errors]=!0,h}},2036:(s,i,a)=>{const o=a(375),c=a(9474),u=a(8160),f={};s.exports=f.Values=class{constructor(l,d){this._values=new Set(l),this._refs=new Set(d),this._lowercase=f.lowercases(l),this._override=!1}get length(){return this._values.size+this._refs.size}add(l,d){u.isResolvable(l)?this._refs.has(l)||(this._refs.add(l),d&&d.register(l)):this.has(l,null,null,!1)||(this._values.add(l),typeof l=="string"&&this._lowercase.set(l.toLowerCase(),l))}static merge(l,d,m){if(l=l||new f.Values,d){if(d._override)return d.clone();for(const p of[...d._values,...d._refs])l.add(p)}if(m)for(const p of[...m._values,...m._refs])l.remove(p);return l.length?l:null}remove(l){u.isResolvable(l)?this._refs.delete(l):(this._values.delete(l),typeof l=="string"&&this._lowercase.delete(l.toLowerCase()))}has(l,d,m,p){return!!this.get(l,d,m,p)}get(l,d,m,p){if(!this.length)return!1;if(this._values.has(l))return{value:l};if(typeof l=="string"&&l&&p){const h=this._lowercase.get(l.toLowerCase());if(h)return{value:h}}if(!this._refs.size&&typeof l!="object")return!1;if(typeof l=="object"){for(const h of this._values)if(c(h,l))return{value:h}}if(d)for(const h of this._refs){const y=h.resolve(l,d,m,null,{in:!0});if(y===void 0)continue;const g=h.in&&typeof y=="object"?Array.isArray(y)?y:Object.keys(y):[y];for(const v of g)if(typeof v==typeof l){if(p&&l&&typeof l=="string"){if(v.toLowerCase()===l.toLowerCase())return{value:v,ref:h}}else if(c(v,l))return{value:v,ref:h}}}return!1}override(){this._override=!0}values(l){if(l&&l.display){const d=[];for(const m of[...this._values,...this._refs])m!==void 0&&d.push(m);return d}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){o(!l._override,"Cannot concat override set of values");const d=new f.Values([...this._values,...l._values],[...this._refs,...l._refs]);return d._override=this._override,d}describe(){const l=[];this._override&&l.push({override:!0});for(const d of this._values.values())l.push(d&&typeof d=="object"?{value:d}:d);for(const d of this._refs.values())l.push(d.describe());return l}},f.Values.prototype[u.symbols.values]=!0,f.Values.prototype.slice=f.Values.prototype.clone,f.lowercases=function(l){const d=new Map;if(l)for(const m of l)typeof m=="string"&&d.set(m.toLowerCase(),m);return d}},978:(s,i,a)=>{const o=a(375),c=a(8571),u=a(1687),f=a(9621),l={};s.exports=function(d,m,p={}){if(o(d&&typeof d=="object","Invalid defaults value: must be an object"),o(!m||m===!0||typeof m=="object","Invalid source value: must be true, falsy or an object"),o(typeof p=="object","Invalid options: must be an object"),!m)return null;if(p.shallow)return l.applyToDefaultsWithShallow(d,m,p);const h=c(d);if(m===!0)return h;const y=p.nullOverride!==void 0&&p.nullOverride;return u(h,m,{nullOverride:y,mergeArrays:!1})},l.applyToDefaultsWithShallow=function(d,m,p){const h=p.shallow;o(Array.isArray(h),"Invalid keys");const y=new Map,g=m===!0?null:new Set;for(let x of h){x=Array.isArray(x)?x:x.split(".");const A=f(d,x);A&&typeof A=="object"?y.set(A,g&&f(m,x)||A):g&&g.add(x)}const v=c(d,{},y);if(!g)return v;for(const x of g)l.reachCopy(v,m,x);const w=p.nullOverride!==void 0&&p.nullOverride;return u(v,m,{nullOverride:w,mergeArrays:!1})},l.reachCopy=function(d,m,p){for(const g of p){if(!(g in m))return;const v=m[g];if(typeof v!="object"||v===null)return;m=v}const h=m;let y=d;for(let g=0;g{const o=a(7916);s.exports=function(c,...u){if(!c)throw u.length===1&&u[0]instanceof Error?u[0]:new o(u)}},8571:(s,i,a)=>{const o=a(9621),c=a(4277),u=a(7043),f={needsProtoHack:new Set([c.set,c.map,c.weakSet,c.weakMap])};s.exports=f.clone=function(l,d={},m=null){if(typeof l!="object"||l===null)return l;let p=f.clone,h=m;if(d.shallow){if(d.shallow!==!0)return f.cloneWithShallow(l,d);p=w=>w}else if(h){const w=h.get(l);if(w)return w}else h=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,d);if(g===l)return l;if(h&&h.set(l,g),y===c.set)for(const w of l)g.add(p(w,d,h));else if(y===c.map)for(const[w,x]of l)g.set(w,p(x,d,h));const v=u.keys(l,d);for(const w of v){if(w==="__proto__")continue;if(y===c.array&&w==="length"){g.length=l.length;continue}const x=Object.getOwnPropertyDescriptor(l,w);x?x.get||x.set?Object.defineProperty(g,w,x):x.enumerable?g[w]=p(l[w],d,h):Object.defineProperty(g,w,{enumerable:!1,writable:!0,configurable:!0,value:p(l[w],d,h)}):Object.defineProperty(g,w,{enumerable:!0,writable:!0,configurable:!0,value:p(l[w],d,h)})}return g},f.cloneWithShallow=function(l,d){const m=d.shallow;(d=Object.assign({},d)).shallow=!1;const p=new Map;for(const h of m){const y=o(l,h);typeof y!="object"&&typeof y!="function"||p.set(y,y)}return f.clone(l,d,p)},f.base=function(l,d,m){if(m.prototype===!1)return f.needsProtoHack.has(d)?new d.constructor:d===c.array?[]:{};const p=Object.getPrototypeOf(l);if(p&&p.isImmutable)return l;if(d===c.array){const h=[];return p!==d&&Object.setPrototypeOf(h,p),h}if(f.needsProtoHack.has(d)){const h=new p.constructor;return p!==d&&Object.setPrototypeOf(h,p),h}return Object.create(p)}},9474:(s,i,a)=>{const o=a(4277),c={mismatched:null};s.exports=function(u,f,l){return l=Object.assign({prototype:!0},l),!!c.isDeepEqual(u,f,l,[])},c.isDeepEqual=function(u,f,l,d){if(u===f)return u!==0||1/u==1/f;const m=typeof u;if(m!==typeof f||u===null||f===null)return!1;if(m==="function"){if(!l.deepFunction||u.toString()!==f.toString())return!1}else if(m!=="object")return u!=u&&f!=f;const p=c.getSharedType(u,f,!!l.prototype);switch(p){case o.buffer:return!1;case o.promise:return u===f;case o.regex:return u.toString()===f.toString();case c.mismatched:return!1}for(let h=d.length-1;h>=0;--h)if(d[h].isSame(u,f))return!0;d.push(new c.SeenEntry(u,f));try{return!!c.isDeepEqualObj(p,u,f,l,d)}finally{d.pop()}},c.getSharedType=function(u,f,l){if(l)return Object.getPrototypeOf(u)!==Object.getPrototypeOf(f)?c.mismatched:o.getInternalProto(u);const d=o.getInternalProto(u);return d!==o.getInternalProto(f)?c.mismatched:d},c.valueOf=function(u){const f=u.valueOf;if(f===void 0)return u;try{return f.call(u)}catch(l){return l}},c.hasOwnEnumerableProperty=function(u,f){return Object.prototype.propertyIsEnumerable.call(u,f)},c.isSetSimpleEqual=function(u,f){for(const l of Set.prototype.values.call(u))if(!Set.prototype.has.call(f,l))return!1;return!0},c.isDeepEqualObj=function(u,f,l,d,m){const{isDeepEqual:p,valueOf:h,hasOwnEnumerableProperty:y}=c,{keys:g,getOwnPropertySymbols:v}=Object;if(u===o.array){if(!d.part){if(f.length!==l.length)return!1;for(let R=0;R{const o=a(8761);s.exports=class extends Error{constructor(c){super(c.filter(u=>u!=="").map(u=>typeof u=="string"?u:u instanceof Error?u.message:o(u)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,i.assert)}}},5277:s=>{const i={};s.exports=function(a){if(!a)return"";let o="";for(let c=0;c=256?"&#"+a+";":`&#x${a.toString(16).padStart(2,"0")};`)},i.isSafe=function(a){return i.safeCharCodes.has(a)},i.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),i.safeCharCodes=function(){const a=new Set;for(let o=32;o<123;++o)(o>=97||o>=65&&o<=90||o>=48&&o<=57||o===32||o===46||o===44||o===45||o===58||o===95)&&a.add(o);return a}()},6064:s=>{s.exports=function(i){return i.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:s=>{s.exports=function(){}},1687:(s,i,a)=>{const o=a(375),c=a(8571),u=a(7043),f={};s.exports=f.merge=function(l,d,m){if(o(l&&typeof l=="object","Invalid target value: must be an object"),o(d==null||typeof d=="object","Invalid source value: must be null, undefined, or an object"),!d)return l;if(m=Object.assign({nullOverride:!0,mergeArrays:!0},m),Array.isArray(d)){o(Array.isArray(l),"Cannot merge array onto an object"),m.mergeArrays||(l.length=0);for(let h=0;h{const o=a(375),c={};s.exports=function(u,f,l){if(f===!1||f==null)return u;typeof(l=l||{})=="string"&&(l={separator:l});const d=Array.isArray(f);o(!d||!l.separator,"Separator option is not valid for array-based chain");const m=d?f:f.split(l.separator||".");let p=u;for(let h=0;h{s.exports=function(...i){try{return JSON.stringify(...i)}catch(a){return"[Cannot display object: "+a.message+"]"}}},4277:(s,i)=>{const a={};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},a.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(o){if(Array.isArray(o))return i.array;if(o instanceof Date)return i.date;if(o instanceof RegExp)return i.regex;if(o instanceof Error)return i.error;const c=Object.prototype.toString.call(o);return a.typeMap.get(c)||i.generic}},7043:(s,i)=>{i.keys=function(a,o={}){return o.symbols!==!1?Reflect.ownKeys(a):Object.getOwnPropertyNames(a)}},3652:(s,i,a)=>{const o=a(375),c={};i.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(u,f){const l=[].concat((f=f||{}).before||[]),d=[].concat(f.after||[]),m=f.group||"?",p=f.sort||0;o(!l.includes(m),`Item cannot come before itself: ${m}`),o(!l.includes("?"),"Item cannot come before unassociated items"),o(!d.includes(m),`Item cannot come after itself: ${m}`),o(!d.includes("?"),"Item cannot come after unassociated items"),Array.isArray(u)||(u=[u]);for(const h of u){const y={seq:this._items.length,sort:p,before:l,after:d,group:m,node:h};this._items.push(y)}if(!f.manual){const h=this._sort();o(h,"item",m!=="?"?`added into group ${m}`:"","created a dependencies error")}return this.nodes}merge(u){Array.isArray(u)||(u=[u]);for(const l of u)if(l)for(const d of l._items)this._items.push(Object.assign({},d));this._items.sort(c.mergeSort);for(let l=0;lu.sort===f.sort?0:u.sort{const o=a(443),c=a(2178),u={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:o.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(u.nonAsciiRx.test(f)){if(l.allowUnicode===!1)return c.code("DOMAIN_INVALID_UNICODE_CHARS");f=f.normalize("NFC")}if(u.domainControlRx.test(f))return c.code("DOMAIN_INVALID_CHARS");f=u.punycode(f),l.allowFullyQualified&&f[f.length-1]==="."&&(f=f.slice(0,-1));const d=l.minDomainSegments||u.minDomainSegments,m=f.split(".");if(m.lengthl.maxDomainSegments)return c.code("DOMAIN_SEGMENTS_COUNT_MAX");const p=l.tlds;if(p){const h=m[m.length-1].toLowerCase();if(p.deny&&p.deny.has(h)||p.allow&&!p.allow.has(h))return c.code("DOMAIN_FORBIDDEN_TLDS")}for(let h=0;h63)return c.code("DOMAIN_LONG_SEGMENT");if(h{const o=a(9848),c=a(5380),u=a(2178),f={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(o.TextEncoder||TextEncoder)};i.analyze=function(l,d){return f.email(l,d)},i.isValid=function(l,d){return!f.email(l,d)},f.email=function(l,d={}){if(typeof l!="string")throw new Error("Invalid input: email must be a string");if(!l)return u.code("EMPTY_STRING");const m=!f.nonAsciiRx.test(l);if(!m){if(d.allowUnicode===!1)return u.code("FORBIDDEN_UNICODE");l=l.normalize("NFC")}const p=l.split("@");if(p.length!==2)return p.length>2?u.code("MULTIPLE_AT_CHAR"):u.code("MISSING_AT_CHAR");const[h,y]=p;if(!h)return u.code("EMPTY_LOCAL");if(!d.ignoreLength){if(l.length>254)return u.code("ADDRESS_TOO_LONG");if(f.encoder.encode(h).length>64)return u.code("LOCAL_TOO_LONG")}return f.local(h,m)||c.analyze(y,d)},f.local=function(l,d){const m=l.split(".");for(const p of m){if(!p.length)return u.code("EMPTY_LOCAL_SEGMENT");if(d){if(!f.atextRx.test(p))return u.code("INVALID_LOCAL_CHARS")}else for(const h of p){if(f.atextRx.test(h))continue;const y=f.binary(h);if(!f.atomRx.test(y))return u.code("INVALID_LOCAL_CHARS")}}},f.binary=function(l){return Array.from(f.encoder.encode(l)).map(d=>String.fromCharCode(d)).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(a){return{code:a,error:i.codes[a]}}},9959:(s,i,a)=>{const o=a(375),c=a(5752);i.regex=function(u={}){o(u.cidr===void 0||typeof u.cidr=="string","options.cidr must be a string");const f=u.cidr?u.cidr.toLowerCase():"optional";o(["required","optional","forbidden"].includes(f),"options.cidr must be one of required, optional, forbidden"),o(u.version===void 0||typeof u.version=="string"||Array.isArray(u.version),"options.version must be a string or an array of string");let l=u.version||["ipv4","ipv6","ipvfuture"];Array.isArray(l)||(l=[l]),o(l.length>=1,"options.version must have at least 1 version specified");for(let p=0;p{if(f==="forbidden")return c.ip[p];const h=`\\/${p==="ipv4"?c.ip.v4Cidr:c.ip.v6Cidr}`;return f==="required"?`${c.ip[p]}${h}`:`${c.ip[p]}(?:${h})?`}).join("|")})`,m=new RegExp(`^${d}$`);return{cidr:f,versions:l,regex:m,raw:d}}},5752:(s,i,a)=>{const o=a(375),c=a(6064),u={generate:function(){const f={},l="\\dA-Fa-f",d="["+l+"]",m="\\w-\\.~",p="!\\$&'\\(\\)\\*\\+,;=",h="%"+l,y=m+h+p+":@",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 w=d+"{1,4}",x="(?:"+w+":"+w+"|"+f.ipv4address+")",A="(?:"+w+":){6}"+x,T="::(?:"+w+":){5}"+x,R="(?:"+w+")?::(?:"+w+":){4}"+x,E="(?:(?:"+w+":){0,1}"+w+")?::(?:"+w+":){3}"+x,k="(?:(?:"+w+":){0,2}"+w+")?::(?:"+w+":){2}"+x,N="(?:(?:"+w+":){0,3}"+w+")?::"+w+":"+x,O="(?:(?:"+w+":){0,4}"+w+")?::"+x,L="(?:(?:"+w+":){0,5}"+w+")?::"+w,I="(?:(?:"+w+":){0,6}"+w+")?::";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+"|"+T+"|"+R+"|"+E+"|"+k+"|"+N+"|"+O+"|"+L+"|"+I+")",f.ipvFuture="v"+d+"+\\.["+m+p+":]+",f.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",f.schemeRegex=new RegExp(f.scheme);const F="["+m+h+p+":]*",U="["+m+h+p+"]{1,255}",Y="(?:\\[(?:"+f.ipv6address+"|"+f.ipvFuture+")\\]|"+f.ipv4address+"|"+U+")",V="(?:"+F+"@)?"+Y+"(?::\\d*)?",H="(?:"+F+"@)?("+Y+")(?::\\d*)?",ee=g+"*",re=g+"+",X="(?:\\/"+ee+")*",q="\\/(?:"+re+X+")?",K=re+X,Z="["+m+h+p+"@]+"+X,ue="(?:\\/\\/\\/"+ee+X+")";return f.hierPart="(?:(?:\\/\\/"+V+X+")|"+q+"|"+K+"|"+ue+")",f.hierPartCapture="(?:(?:\\/\\/"+H+X+")|"+q+"|"+K+")",f.relativeRef="(?:(?:\\/\\/"+V+X+")|"+q+"|"+Z+"|)",f.relativeRefCapture="(?:(?:\\/\\/"+H+X+")|"+q+"|"+Z+"|)",f.query="["+y+"\\/\\?]*(?=#|$)",f.queryWithSquareBrackets="["+y+"\\[\\]\\/\\?]*(?=#|$)",f.fragment="["+y+"\\/\\?]*",f}};u.rfc3986=u.generate(),i.ip={v4Cidr:u.rfc3986.ipv4Cidr,v6Cidr:u.rfc3986.ipv6Cidr,ipv4:u.rfc3986.ipv4address,ipv6:u.rfc3986.ipv6address,ipvfuture:u.rfc3986.ipvFuture},u.createRegex=function(f){const l=u.rfc3986,d="(?:\\?"+(f.allowQuerySquareBrackets?l.queryWithSquareBrackets:l.query)+")?(?:#"+l.fragment+")?",m=f.domain?l.relativeRefCapture:l.relativeRef;if(f.relativeOnly)return u.wrap(m+d);let p="";if(f.scheme){o(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);o(g.length>=1,"scheme must have at least 1 scheme specified");const v=[];for(let w=0;w{const a={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};i.Parser=class{constructor(o,c={}){if(!c[a.settings]&&c.constants)for(const u in c.constants){const f=c.constants[u];if(f!==null&&!["boolean","number","string"].includes(typeof f))throw new Error(`Formula constant ${u} contains invalid ${typeof f} value type`)}this.settings=c[a.settings]?c:Object.assign({[a.settings]:!0,constants:{},functions:{}},c),this.single=null,this._parts=null,this._parse(o)}_parse(o){let c=[],u="",f=0,l=!1;const d=p=>{if(f)throw new Error("Formula missing closing parenthesis");const h=c.length?c[c.length-1]:null;if(l||u||p){if(h&&h.type==="reference"&&p===")")return h.type="function",h.value=this._subFormula(u,h.value),void(u="");if(p===")"){const y=new i.Parser(u,this.settings);c.push({type:"segment",value:y})}else if(l){if(l==="]")return c.push({type:"reference",value:u}),void(u="");c.push({type:"literal",value:u})}else if(a.operatorCharacters.includes(u))h&&h.type==="operator"&&a.operators.includes(h.value+u)?h.value+=u:c.push({type:"operator",value:u});else if(u.match(a.numberRx))c.push({type:"constant",value:parseFloat(u)});else if(this.settings.constants[u]!==void 0)c.push({type:"constant",value:this.settings.constants[u]});else{if(!u.match(a.tokenRx))throw new Error(`Formula contains invalid token: ${u}`);c.push({type:"reference",value:u})}u=""}};for(const p of o)l?p===l?(d(),l=!1):u+=p:f?p==="("?(u+=p,++f):p===")"?(--f,f?u+=p:d(p)):u+=p:p in a.literals?l=a.literals[p]:p==="("?(d(),++f):a.operatorCharacters.includes(p)?(d(),u=p,d()):p!==" "?u+=p:d();d(),c=c.map((p,h)=>p.type!=="operator"||p.value!=="-"||h&&c[h-1].type!=="operator"?p:{type:"operator",value:"n"});let m=!1;for(const p of c){if(p.type==="operator"){if(a.operatorsPrefix.includes(p.value))continue;if(!m)throw new Error("Formula contains an operator in invalid position");if(!a.operators.includes(p.value))throw new Error(`Formula contains an unknown operator ${p.value}`)}else if(m)throw new Error("Formula missing expected operator");m=!m}if(!m)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(p=>{if(p.type==="operator")return a.operatorsPrefix.includes(p.value)?p:p.value;if(p.type!=="reference")return p.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(p.value))throw new Error(`Formula contains invalid reference ${p.value}`);return this.settings.reference?this.settings.reference(p.value):a.reference(p.value)})}_subFormula(o,c){const u=this.settings.functions[c];if(typeof u!="function")throw new Error(`Formula contains unknown function ${c}`);let f=[];if(o){let l="",d=0,m=!1;const p=()=>{if(!l)throw new Error(`Formula contains function ${c} with invalid arguments ${o}`);f.push(l),l=""};for(let h=0;hnew i.Parser(l,this.settings)),function(l){const d=[];for(const m of f)d.push(m.evaluate(l));return u.call(l,...d)}}evaluate(o){const c=this._parts.slice();for(let u=c.length-2;u>=0;--u){const f=c[u];if(f&&f.type==="operator"){const l=c[u+1];c.splice(u+1,1);const d=a.evaluate(l,o);c[u]=a.single(f.value,d)}}return a.operatorsOrder.forEach(u=>{for(let f=1;f":return c>u;case">=":return c>=u;case"==":return c===u;case"!=":return c!==u;case"&&":return c&&u;case"||":return c||u}return null},a.exists=function(o){return o!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:s=>{s.exports=JSON.parse('{"version":"17.13.3"}')}},r={},function s(i){var a=r[i];if(a!==void 0)return a.exports;var o=r[i]={exports:{}};return n[i](o,o.exports,s),o.exports}(5107);var n,r})})(jQ);var lMe=jQ.exports;const xn=Yc(lMe);class Tr{constructor(e){Le(this,"_object");Le(this,"_error");Le(this,"isSuccess");Le(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 Tr({isSuccess:!0,object:e})}static fail(e){return new Tr({isSuccess:!1,error:e})}static combine(e){for(const n of e)if(n.isFailure)return n;return Tr.ok()}}class ir{static validate(e,n,r={}){if(!xn.isSchema(e))throw new cMe("Rule provided is not a valid Joi schema!");const s={abortEarly:!1,errors:{wrap:{label:"{}"}},...r},i=e.validate(n,s);return i.error?Tr.fail(i.error):Tr.ok(i.value)}static validateFnc(e){return(n,r)=>{const s=e(n);return s.isSuccess?n:r.message({custom:s.error.message})}}}Le(ir,"RULE_NOT_NULL_OR_UNDEFINED",xn.any().required().invalid(null)),Le(ir,"RULE_ALLOW_NULL_OR_UNDEFINED",xn.any().optional().valid(null)),Le(ir,"RULE_ALLOW_NULL",xn.any().valid(null)),Le(ir,"RULE_ALLOW_EMPTY",xn.any().optional().valid(null,"")),Le(ir,"RULE_IS_TYPE_STRING",xn.string()),Le(ir,"RULE_IS_TYPE_NUMBER",xn.number());class cMe extends Error{}class $$ extends Error{constructor(n,r,s={}){super(r);Le(this,"code");Le(this,"payload",{});this.name=this.constructor.name,this.code=n,this.payload=s,Object.setPrototypeOf(this,$$.prototype)}}const a1=class a1 extends $${static create(e,n,r){return new a1(e,n,r)}};Le(a1,"INVALID_INPUT_DATA","INVALID_INPUT_DATA");let tp=a1;function VA(t,e="",n){return tp.create(t,e,n)}var BQ={};(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),a=Object.keys(r);if(i.length!==a.length)return!1;for(var o=s&&typeof s.customEqual=="function"?s.customEqual:t.is,c=0;cthis.props===null)}}class GUe extends xn.ValidationError{}class qUe extends xn.ValidationError{}class KUe extends xn.ValidationError{}class YUe extends xn.ValidationError{}class XUe extends xn.ValidationError{}const sk={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"}},ku=class ku extends F${constructor(){super(...arguments);Le(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=xn.alternatives(ir.RULE_ALLOW_EMPTY.default(""),xn.string().uppercase().valid(...Object.keys(sk)).label(String(r.label)));return ir.validate(s,n)}static createFromCode(n,r={}){const s={...r,label:r.label?r.label:"current_code"},i=ku.validate(n,s);return i.isFailure?Tr.fail(VA(tp.INVALID_INPUT_DATA,i.error.message,s)):Tr.ok(new ku(sk[i.object]))}static createDefaultCode(){return ku.createFromCode(ku.DEFAULT_CURRENCY_CODE)}isEmpty(){return this.isNull()||this.props===void 0}toPrimitive(){return this.toString()}};Le(ku,"DEFAULT_CURRENCY_CODE","EUR"),Le(ku,"CURRENCIES",sk);let jC=ku;class QUe extends xn.ValidationError{}var uMe={defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},dMe={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 Rb(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Rb=function(e){return typeof e}:Rb=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rb(t)}function N4(t){return fMe(t)||hMe(t)||pMe(t)||mMe()}function fMe(t){if(Array.isArray(t))return t}function hMe(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function pMe(t,e){if(t){if(typeof t=="string")return D4(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 D4(t,e)}}function D4(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&(n[s]=t[s]);return n}function vOe(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function yOe(t,e){return t.button===0&&(!e||e==="_self")&&!vOe(t)}function FD(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 bOe(t,e){let n=FD(t);return e&&e.forEach((r,s)=>{n.has(s)||e.getAll(s).forEach(i=>{n.append(s,i)})}),n}const wOe=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],_Oe="6";try{window.__reactRouterVersion=_Oe}catch{}function xOe(t,e){return DDe({basename:e==null?void 0:e.basename,future:h0({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:nDe({window:e==null?void 0:e.window}),hydrationData:(e==null?void 0:e.hydrationData)||SOe(),routes:t,mapRouteProperties:mOe,dataStrategy:e==null?void 0:e.dataStrategy,patchRoutesOnNavigation:e==null?void 0:e.patchRoutesOnNavigation,window:e==null?void 0:e.window}).initialize()}function SOe(){var t;let e=(t=window)==null?void 0:t.__staticRouterHydrationData;return e&&e.errors&&(e=h0({},e,{errors:EOe(e.errors)})),e}function EOe(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 MC(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 a=new i(s.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let i=new Error(s.message);i.stack="",n[r]=i}}else n[r]=s;return n}const COe=_.createContext({isTransitioning:!1}),AOe=_.createContext(new Map),ROe="startTransition",g4=r_[ROe],POe="flushSync",v4=ade[POe];function TOe(t){g4?g4(t):t()}function My(t){v4?v4(t):t()}class kOe{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 NOe(t){let{fallbackElement:e,router:n,future:r}=t,[s,i]=_.useState(n.state),[a,o]=_.useState(),[c,u]=_.useState({isTransitioning:!1}),[f,l]=_.useState(),[d,m]=_.useState(),[p,h]=_.useState(),y=_.useRef(new Map),{v7_startTransition:g}=r||{},v=_.useCallback(E=>{g?TOe(E):E()},[g]),w=_.useCallback((E,k)=>{let{deletedFetchers:N,flushSync:O,viewTransitionOpts:L}=k;E.fetchers.forEach((F,U)=>{F.data!==void 0&&y.current.set(U,F.data)}),N.forEach(F=>y.current.delete(F));let I=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!L||I){O?My(()=>i(E)):v(()=>i(E));return}if(O){My(()=>{d&&(f&&f.resolve(),d.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:L.currentLocation,nextLocation:L.nextLocation})});let F=n.window.document.startViewTransition(()=>{My(()=>i(E))});F.finished.finally(()=>{My(()=>{l(void 0),m(void 0),o(void 0),u({isTransitioning:!1})})}),My(()=>m(F));return}d?(f&&f.resolve(),d.skipTransition(),h({state:E,currentLocation:L.currentLocation,nextLocation:L.nextLocation})):(o(E),u({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}))},[n.window,d,f,y,v]);_.useLayoutEffect(()=>n.subscribe(w),[n,w]),_.useEffect(()=>{c.isTransitioning&&!c.flushSync&&l(new kOe)},[c]),_.useEffect(()=>{if(f&&a&&n.window){let E=a,k=f.promise,N=n.window.document.startViewTransition(async()=>{v(()=>i(E)),await k});N.finished.finally(()=>{l(void 0),m(void 0),o(void 0),u({isTransitioning:!1})}),m(N)}},[v,a,f,n.window]),_.useEffect(()=>{f&&a&&s.location.key===a.location.key&&f.resolve()},[f,d,s.location,a]),_.useEffect(()=>{!c.isTransitioning&&p&&(o(p.state),u({isTransitioning:!0,flushSync:!1,currentLocation:p.currentLocation,nextLocation:p.nextLocation}),h(void 0))},[c.isTransitioning,p]),_.useEffect(()=>{},[]);let x=_.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:E=>n.navigate(E),push:(E,k,N)=>n.navigate(E,{state:k,preventScrollReset:N==null?void 0:N.preventScrollReset}),replace:(E,k,N)=>n.navigate(E,{replace:!0,state:k,preventScrollReset:N==null?void 0:N.preventScrollReset})}),[n]),A=n.basename||"/",T=_.useMemo(()=>({router:n,navigator:x,static:!1,basename:A}),[n,x,A]),R=_.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return _.useEffect(()=>hOe(r,n.future),[r,n.future]),_.createElement(_.Fragment,null,_.createElement(UA.Provider,{value:T},_.createElement(AQ.Provider,{value:s},_.createElement(AOe.Provider,{value:y.current},_.createElement(COe.Provider,{value:c},_.createElement(pOe,{basename:A,location:s.location,navigationType:s.historyAction,navigator:x,future:R},s.initialized||n.future.v7_partialHydration?_.createElement(DOe,{routes:n.routes,future:n.future,state:s}):e))))),null)}const DOe=_.memo(OOe);function OOe(t){let{routes:e,future:n,state:r}=t;return nOe(e,void 0,r,n)}const MOe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",LOe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yf=_.forwardRef(function(e,n){let{onClick:r,relative:s,reloadDocument:i,replace:a,state:o,target:c,to:u,preventScrollReset:f,viewTransition:l}=e,d=gOe(e,wOe),{basename:m}=_.useContext(Hd),p,h=!1;if(typeof u=="string"&&LOe.test(u)&&(p=u,MOe))try{let w=new URL(window.location.href),x=u.startsWith("//")?new URL(w.protocol+u):new URL(u),A=Nd(x.pathname,m);x.origin===w.origin&&A!=null?u=A+x.search+x.hash:h=!0}catch{}let y=ZDe(u,{relative:s}),g=IOe(u,{replace:a,state:o,target:c,preventScrollReset:f,relative:s,viewTransition:l});function v(w){r&&r(w),w.defaultPrevented||g(w)}return _.createElement("a",h0({},d,{href:p||y,onClick:h||i?r:v,ref:n,target:c}))});var y4;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(y4||(y4={}));var b4;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(b4||(b4={}));function IOe(t,e){let{target:n,replace:r,state:s,preventScrollReset:i,relative:a,viewTransition:o}=e===void 0?{}:e,c=Wv(),u=Vd(),f=TQ(t,{relative:a});return _.useCallback(l=>{if(yOe(l,n)){l.preventDefault();let d=r!==void 0?r:ep(u)===ep(f);c(t,{replace:d,state:s,preventScrollReset:i,relative:a,viewTransition:o})}},[u,c,f,r,s,n,t,i,a,o])}function $Oe(t){let e=_.useRef(FD(t)),n=_.useRef(!1),r=Vd(),s=_.useMemo(()=>bOe(r.search,n.current?null:e.current),[r.search]),i=Wv(),a=_.useCallback((o,c)=>{const u=FD(typeof o=="function"?o(s):o);n.current=!0,i("?"+u,c)},[i,s]);return[s,a]}const IQ=({isOpen:t,onCancel:e,onConfirm:n,title:r,description:s,cancelLabel:i,confirmLabel:a})=>P.jsx(pW,{open:t,children:P.jsxs(IL,{children:[P.jsxs($L,{children:[P.jsx(jL,{children:r}),P.jsx(BL,{children:s})]}),P.jsxs(FL,{children:[P.jsx(UL,{children:P.jsx(yf,{to:"#",onClick:e,children:i})}),P.jsx(zL,{children:P.jsx(yf,{to:"#",onClick:n,children:a})})]})]})}),pt=t=>typeof t=="string",Ly=()=>{let t,e;const n=new Promise((r,s)=>{t=r,e=s});return n.resolve=t,n.reject=e,n},w4=t=>t==null?"":""+t,FOe=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},jOe=/###/g,_4=t=>t&&t.indexOf("###")>-1?t.replace(jOe,"."):t,x4=t=>!t||pt(t),Ab=(t,e,n)=>{const r=pt(e)?e.split("."):e;let s=0;for(;s{const{obj:r,k:s}=Ab(t,e,Object);if(r!==void 0||e.length===1){r[s]=n;return}let i=e[e.length-1],a=e.slice(0,e.length-1),o=Ab(t,a,Object);for(;o.obj===void 0&&a.length;)i=`${a[a.length-1]}.${i}`,a=a.slice(0,a.length-1),o=Ab(t,a,Object),o&&o.obj&&typeof o.obj[`${o.k}.${i}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${i}`]=n},BOe=(t,e,n,r)=>{const{obj:s,k:i}=Ab(t,e,Object);s[i]=s[i]||[],s[i].push(n)},LC=(t,e)=>{const{obj:n,k:r}=Ab(t,e);if(n)return n[r]},zOe=(t,e,n)=>{const r=LC(t,n);return r!==void 0?r:LC(e,n)},$Q=(t,e,n)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?pt(t[r])||t[r]instanceof String||pt(e[r])||e[r]instanceof String?n&&(t[r]=e[r]):$Q(t[r],e[r],n):t[r]=e[r]);return t},Jp=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var UOe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const HOe=t=>pt(t)?t.replace(/[&<>"'\/]/g,e=>UOe[e]):t;class VOe{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 WOe=[" ",",","?","!",";"],GOe=new VOe(20),qOe=(t,e,n)=>{e=e||"",n=n||"";const r=WOe.filter(a=>e.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const s=GOe.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let i=!s.test(t);if(!i){const a=t.indexOf(n);a>0&&!s.test(t.substring(0,a))&&(i=!0)}return i},jD=function(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&&ct&&t.replace("_","-"),KOe={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 $C{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||KOe,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[o,c]=a;for(let u=0;u{let[o,c]=a;for(let u=0;u1&&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,a=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,n],r&&(Array.isArray(r)?o.push(...r):pt(r)&&i?o.push(...r.split(i)):o.push(r)));const c=LC(this.data,o);return!c&&!n&&!r&&e.indexOf(".")>-1&&(e=o[0],n=o[1],r=o.slice(2).join(".")),c||!a||!pt(r)?c:jD(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 a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let o=[e,n];r&&(o=o.concat(a?r.split(a):r)),e.indexOf(".")>-1&&(o=e.split("."),s=n,n=o[1]),this.addNamespaces(n),S4(this.data,o,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)(pt(r[i])||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 a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},o=[e,n];e.indexOf(".")>-1&&(o=e.split("."),s=r,r=n,n=o[1]),this.addNamespaces(n);let c=LC(this.data,o)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?$Q(c,r,i):c={...c,...r},S4(this.data,o,c),a.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 FQ={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 C4={};class FC extends HA{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),FOe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=gl.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 a=r&&e.indexOf(r)>-1,o=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!qOe(e,r,s);if(a&&!o){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:pt(i)?[i]:i};const u=e.split(r);(r!==s||r===s&&this.options.ns.indexOf(u[0])>-1)&&(i=u.shift()),e=u.join(s)}return{key:e,namespaces:pt(i)?[i]: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:a,namespaces:o}=this.extractFromKey(e[e.length-1],n),c=o[o.length-1],u=n.lng||this.language,f=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(f){const x=n.nsSeparator||this.options.nsSeparator;return s?{res:`${c}${x}${a}`,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${x}${a}`}return s?{res:a,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:a}const l=this.resolve(e,n);let d=l&&l.res;const m=l&&l.usedKey||a,p=l&&l.exactUsedKey||a,h=Object.prototype.toString.apply(d),y=["[object Number]","[object Function]","[object RegExp]"],g=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,w=!pt(d)&&typeof d!="boolean"&&typeof d!="number";if(v&&d&&w&&y.indexOf(h)<0&&!(pt(g)&&Array.isArray(d))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const x=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,d,{...n,ns:o}):`key '${a} (${this.language})' returned an object instead of string.`;return s?(l.res=x,l.usedParams=this.getUsedParamsDetails(n),l):x}if(i){const x=Array.isArray(d),A=x?[]:{},T=x?p:m;for(const R in d)if(Object.prototype.hasOwnProperty.call(d,R)){const E=`${T}${i}${R}`;A[R]=this.translate(E,{...n,joinArrays:!1,ns:o}),A[R]===E&&(A[R]=d[R])}d=A}}else if(v&&pt(g)&&Array.isArray(d))d=d.join(g),d&&(d=this.extendTranslation(d,e,n,r));else{let x=!1,A=!1;const T=n.count!==void 0&&!pt(n.count),R=FC.hasDefaultValue(n),E=T?this.pluralResolver.getSuffix(u,n.count,n):"",k=n.ordinal&&T?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",N=T&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),O=N&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${E}`]||n[`defaultValue${k}`]||n.defaultValue;!this.isValidLookup(d)&&R&&(x=!0,d=O),this.isValidLookup(d)||(A=!0,d=a);const I=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&A?void 0:d,F=R&&O!==d&&this.options.updateMissing;if(A||x||F){if(this.logger.log(F?"updateKey":"missingKey",u,c,a,F?O:d),i){const H=this.resolve(a,{...n,keySeparator:!1});H&&H.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 U=[];const Y=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Y&&Y[0])for(let H=0;H{const X=R&&re!==d?re:I;this.options.missingKeyHandler?this.options.missingKeyHandler(H,c,ee,X,F,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(H,c,ee,X,F,n),this.emit("missingKey",H,c,ee,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&T?U.forEach(H=>{const ee=this.pluralResolver.getSuffixes(H,n);N&&n[`defaultValue${this.options.pluralSeparator}zero`]&&ee.indexOf(`${this.options.pluralSeparator}zero`)<0&&ee.push(`${this.options.pluralSeparator}zero`),ee.forEach(re=>{V([H],a+re,n[`defaultValue${re}`]||O)})}):V(U,a,O))}d=this.extendTranslation(d,e,n,l,r),A&&d===a&&this.options.appendNamespaceToMissingKey&&(d=`${c}:${a}`),(A||x)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${a}`:a,x?d:void 0):d=this.options.parseMissingKeyHandler(d))}return s?(l.res=d,l.usedParams=this.getUsedParamsDetails(n),l):d}extendTranslation(e,n,r,s,i){var a=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 u=pt(e)&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(u){const d=e.match(this.interpolator.nestingRegexp);f=d&&d.length}let l=r.replace&&!pt(r.replace)?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),u){const d=e.match(this.interpolator.nestingRegexp),m=d&&d.length;f1&&arguments[1]!==void 0?arguments[1]:{},r,s,i,a,o;return pt(e)&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(c,n),f=u.key;s=f;let l=u.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const d=n.count!==void 0&&!pt(n.count),m=d&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),p=n.context!==void 0&&(pt(n.context)||typeof n.context=="number")&&n.context!=="",h=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);l.forEach(y=>{this.isValidLookup(r)||(o=y,!C4[`${h[0]}-${y}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(o)&&(C4[`${h[0]}-${y}`]=!0,this.logger.warn(`key "${s}" for languages "${h.join(", ")}" won't get resolved as namespace "${o}" 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!!!")),h.forEach(g=>{if(this.isValidLookup(r))return;a=g;const v=[f];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(v,f,g,y,n);else{let x;d&&(x=this.pluralResolver.getSuffix(g,n.count,n));const A=`${this.options.pluralSeparator}zero`,T=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(v.push(f+x),n.ordinal&&x.indexOf(T)===0&&v.push(f+x.replace(T,this.options.pluralSeparator)),m&&v.push(f+A)),p){const R=`${f}${this.options.contextSeparator}${n.context}`;v.push(R),d&&(v.push(R+x),n.ordinal&&x.indexOf(T)===0&&v.push(R+x.replace(T,this.options.pluralSeparator)),m&&v.push(R+A))}}let w;for(;w=v.pop();)this.isValidLookup(r)||(i=w,r=this.getResource(g,y,w,n))}))})}),{res:r,usedKey:s,exactUsedKey:i,usedLng:a,usedNS:o}}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&&!pt(e.replace);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}}const nk=t=>t.charAt(0).toUpperCase()+t.slice(1);class A4{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=gl.create("languageUtils")}getScriptPartFromCode(e){if(e=IC(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=IC(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(pt(e)&&e.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let s=Intl.getCanonicalLocales(e)[0];if(s&&this.options.lowerCaseLng&&(s=s.toLowerCase()),s)return s}catch{}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]=nk(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]=nk(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=nk(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)),pt(e)&&(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=a=>{a&&(this.isSupportedCode(a)?s.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return pt(e)&&(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))):pt(e)&&i(this.formatLanguageCode(e)),r.forEach(a=>{s.indexOf(a)<0&&i(this.formatLanguageCode(a))}),s}}let YOe=[{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}],XOe={1:t=>+(t>1),2:t=>+(t!=1),3:t=>0,4:t=>t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2,5:t=>t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5,6:t=>t==1?0:t>=2&&t<=4?1:2,7:t=>t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2,8:t=>t==1?0:t==2?1:t!=8&&t!=11?2:3,9:t=>+(t>=2),10:t=>t==1?0:t==2?1:t<7?2:t<11?3:4,11:t=>t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3,12:t=>+(t%10!=1||t%100==11),13:t=>+(t!==0),14:t=>t==1?0:t==2?1:t==3?2:3,15:t=>t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2,16:t=>t%10==1&&t%100!=11?0:t!==0?1:2,17:t=>t==1||t%10==1&&t%100!=11?0:1,18:t=>t==0?0:t==1?1:2,19:t=>t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3,20:t=>t==1?0:t==0||t%100>0&&t%100<20?1:2,21:t=>t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0,22:t=>t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3};const QOe=["v1","v2","v3"],ZOe=["v4"],R4={zero:0,one:1,two:2,few:3,many:4,other:5},JOe=()=>{const t={};return YOe.forEach(e=>{e.lngs.forEach(n=>{t[n]={numbers:e.nr,plurals:XOe[e.fc]}})}),t};class eMe{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=gl.create("pluralResolver"),(!this.options.compatibilityJSON||ZOe.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=JOe(),this.pluralRulesCache={}}addRule(e,n){this.rules[e]=n}clearCache(){this.pluralRulesCache={}}getRule(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){const r=IC(e==="dev"?"en":e),s=n.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:s});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(r,{type:s})}catch{if(!e.match(/-|_/))return;const c=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(c,n)}return this.pluralRulesCache[i]=a,a}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)=>R4[s]-R4[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!QOe.includes(this.options.compatibilityJSON)}}const P4=function(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=zOe(t,e,n);return!i&&s&&pt(n)&&(i=jD(t,n,r),i===void 0&&(i=jD(e,n,r))),i},rk=t=>t.replace(/\$/g,"$$$$");class tMe{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=gl.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:a,suffix:o,suffixEscaped:c,formatSeparator:u,unescapeSuffix:f,unescapePrefix:l,nestingPrefix:d,nestingPrefixEscaped:m,nestingSuffix:p,nestingSuffixEscaped:h,nestingOptionsSeparator:y,maxReplaces:g,alwaysFormat:v}=e.interpolation;this.escape=n!==void 0?n:HOe,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=i?Jp(i):a||"{{",this.suffix=o?Jp(o):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=f?"":l||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=d?Jp(d):m||Jp("$t("),this.nestingSuffix=p?Jp(p):h||Jp(")"),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,a,o;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=m=>{if(m.indexOf(this.formatSeparator)<0){const g=P4(n,c,m,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(g,void 0,r,{...s,...n,interpolationkey:m}):g}const p=m.split(this.formatSeparator),h=p.shift().trim(),y=p.join(this.formatSeparator).trim();return this.format(P4(n,c,h,this.options.keySeparator,this.options.ignoreJSONStructure),y,r,{...s,...n,interpolationkey:h})};this.resetRegExp();const f=s&&s.missingInterpolationHandler||this.options.missingInterpolationHandler,l=s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:m=>rk(m)},{regex:this.regexp,safeValue:m=>this.escapeValue?rk(this.escape(m)):rk(m)}].forEach(m=>{for(o=0;i=m.regex.exec(e);){const p=i[1].trim();if(a=u(p),a===void 0)if(typeof f=="function"){const y=f(e,i,s);a=pt(y)?y:""}else if(s&&Object.prototype.hasOwnProperty.call(s,p))a="";else if(l){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${p} for interpolating ${e}`),a="";else!pt(a)&&!this.useRawValueToEscape&&(a=w4(a));const h=m.safeValue(a);if(e=e.replace(i[0],h),l?(m.regex.lastIndex+=a.length,m.regex.lastIndex-=i[0].length):m.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,i,a;const o=(c,u)=>{const f=this.nestingOptionsSeparator;if(c.indexOf(f)<0)return c;const l=c.split(new RegExp(`${f}[ ]*{`));let d=`{${l[1]}`;c=l[0],d=this.interpolate(d,a);const m=d.match(/'/g),p=d.match(/"/g);(m&&m.length%2===0&&!p||p.length%2!==0)&&(d=d.replace(/'/g,'"'));try{a=JSON.parse(d),u&&(a={...u,...a})}catch(h){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,h),`${c}${f}${d}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,c};for(;s=this.nestingRegexp.exec(e);){let c=[];a={...r},a=a.replace&&!pt(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let u=!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,u=!0}if(i=n(o.call(this,s[1].trim(),a),a),i&&s[0]===e&&!pt(i))return i;pt(i)||(i=w4(i)),i||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),i=""),u&&(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}}const nMe=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(a=>{if(a){const[o,...c]=a.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),f=o.trim();n[f]||(n[f]=u),u==="false"&&(n[f]=!1),u==="true"&&(n[f]=!0),isNaN(u)||(n[f]=parseInt(u,10))}})}return{formatName:e,formatOptions:n}},em=t=>{const e={};return(n,r,s)=>{let i=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(i={...i,[s.interpolationkey]:void 0});const a=r+JSON.stringify(i);let o=e[a];return o||(o=t(IC(r),s),e[a]=o),o(n)}};class rMe{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=gl.create("formatter"),this.options=e,this.formats={number:em((n,r)=>{const s=new Intl.NumberFormat(n,{...r});return i=>s.format(i)}),currency:em((n,r)=>{const s=new Intl.NumberFormat(n,{...r,style:"currency"});return i=>s.format(i)}),datetime:em((n,r)=>{const s=new Intl.DateTimeFormat(n,{...r});return i=>s.format(i)}),relativetime:em((n,r)=>{const s=new Intl.RelativeTimeFormat(n,{...r});return i=>s.format(i,r.range||"day")}),list:em((n,r)=>{const s=new Intl.ListFormat(n,{...r});return i=>s.format(i)})},this.init(e)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=em(n)}format(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=n.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(o=>o.indexOf(")")>-1)){const o=i.findIndex(c=>c.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,o)].join(this.formatSeparator)}return i.reduce((o,c)=>{const{formatName:u,formatOptions:f}=nMe(c);if(this.formats[u]){let l=o;try{const d=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},m=d.locale||d.lng||s.locale||s.lng||r;l=this.formats[u](o,m,{...f,...s,...d})}catch(d){this.logger.warn(d)}return l}else this.logger.warn(`there was no format function for ${u}`);return o},e)}}const sMe=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class iMe extends HA{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=gl.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={},a={},o={},c={};return e.forEach(u=>{let f=!0;n.forEach(l=>{const d=`${u}|${l}`;!r.reload&&this.store.hasResourceBundle(u,l)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?a[d]===void 0&&(a[d]=!0):(this.state[d]=1,f=!1,a[d]===void 0&&(a[d]=!0),i[d]===void 0&&(i[d]=!0),c[l]===void 0&&(c[l]=!0)))}),f||(o[u]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(c)}}loaded(e,n,r){const s=e.split("|"),i=s[0],a=s[1];n&&this.emit("failedLoading",i,a,n),!n&&r&&this.store.addResourceBundle(i,a,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&r&&(this.state[e]=0);const o={};this.queue.forEach(c=>{BOe(c.loaded,[i],a),sMe(c,e),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{o[u]||(o[u]={});const f=c.loaded[u];f.length&&f.forEach(l=>{o[u][l]===void 0&&(o[u][l]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",o),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,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:s,wait:i,callback:a});return}this.readingCalls++;const o=(u,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(u&&f&&s{this.read.call(this,e,n,r,s+1,i*2,a)},i);return}a(u,f)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const u=c(e,n);u&&typeof u.then=="function"?u.then(f=>o(null,f)).catch(o):o(null,u)}catch(u){o(u)}return}return c(e,n,o)}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();pt(e)&&(e=this.languageUtils.toResolveHierarchy(e)),pt(n)&&(n=[n]);const i=this.queueLoad(e,n,r,s);if(!i.toLoad.length)return i.pending.length||s(),null;i.toLoad.forEach(a=>{this.loadOne(a)})}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,(a,o)=>{a&&this.logger.warn(`${n}loading namespace ${i} for language ${s} failed`,a),!a&&o&&this.logger.log(`${n}loaded namespace ${i} for language ${s}`,o),this.loaded(e,a,o)})}saveMissing(e,n,r,s,i){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},o=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={...a,isUpdate:i},u=this.backend.create.bind(this.backend);if(u.length<6)try{let f;u.length===5?f=u(e,n,r,s,c):f=u(e,n,r,s),f&&typeof f.then=="function"?f.then(l=>o(null,l)).catch(o):o(null,f)}catch(f){o(f)}else u(e,n,r,s,o,c)}!e||!e[0]||this.store.addResource(e[0],n,r,s)}}}const T4=()=>({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:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),pt(t[1])&&(e.defaultValue=t[1]),pt(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),k4=t=>(pt(t.ns)&&(t.ns=[t.ns]),pt(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),pt(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),CS=()=>{},oMe=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class p0 extends HA{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=k4(e),this.services={},this.logger=gl,this.modules={external:[]},oMe(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&&(pt(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const s=T4();this.options={...s,...this.options,...k4(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);const i=f=>f?typeof f=="function"?new f:f:null;if(!this.options.isClone){this.modules.logger?gl.init(i(this.modules.logger),this.options):gl.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:typeof Intl<"u"&&(f=rMe);const l=new A4(this.options);this.store=new E4(this.options.resources,this.options);const d=this.services;d.logger=gl,d.resourceStore=this.store,d.languageUtils=l,d.pluralResolver=new eMe(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)&&(d.formatter=i(f),d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new tMe(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new iMe(i(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",function(m){for(var p=arguments.length,h=new Array(p>1?p-1:0),y=1;y1?p-1:0),y=1;y{m.init&&m.init(this)})}if(this.format=this.options.interpolation.format,r||(r=CS),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=Ly(),u=()=>{const f=(l,d)=>{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(d),r(l,d)};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?u():setTimeout(u,0),c}loadResources(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:CS;const s=pt(e)?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=[],a=o=>{if(!o||o==="cimode")return;this.services.languageUtils.toResolveHierarchy(o).forEach(u=>{u!=="cimode"&&i.indexOf(u)<0&&i.push(u)})};s?a(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>a(c)),this.options.preload&&this.options.preload.forEach(o=>a(o)),this.services.backendConnector.load(i,this.options.ns,o=>{!o&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(o)})}else r(null)}reloadResources(e,n,r){const s=Ly();return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),r||(r=CS),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"&&FQ.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=Ly();this.emit("languageChanging",e);const i=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},a=(c,u)=>{u?(i(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,s.resolve(function(){return r.t(...arguments)}),n&&n(c,function(){return r.t(...arguments)})},o=c=>{!e&&!c&&this.services.languageDetector&&(c=[]);const u=pt(c)?c:this.services.languageUtils.getBestMatchFromCodes(c);u&&(this.language||i(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,f=>{a(f,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),s}getFixedT(e,n,r){var s=this;const i=function(a,o){let c;if(typeof o!="object"){for(var u=arguments.length,f=new Array(u>2?u-2:0),l=2;l`${c.keyPrefix}${d}${p}`):m=c.keyPrefix?`${c.keyPrefix}${d}${a}`:a,s.t(m,c)};return pt(e)?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 a=(o,c)=>{const u=this.services.backendConnector.state[`${o}|${c}`];return u===-1||u===0||u===2};if(n.precheck){const o=n.precheck(this,a);if(o!==void 0)return o}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,e)&&(!s||a(i,e)))}loadNamespaces(e,n){const r=Ly();return this.options.ns?(pt(e)&&(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=Ly();pt(e)&&(e=[e]);const s=this.options.preload||[],i=e.filter(a=>s.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return i.length?(this.options.preload=s.concat(i),this.loadResources(a=>{r.resolve(),n&&n(a)}),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 A4(T4());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 p0(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:CS;const r=e.forkResourceStore;r&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},i=new p0(s);return(e.debug!==void 0||e.prefix!==void 0)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(o=>{i[o]=this[o]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r&&(i.store=new E4(this.store.data,s),i.services.resourceStore=i.store),i.translator=new FC(i.services,s),i.translator.on("*",function(o){for(var c=arguments.length,u=new Array(c>1?c-1:0),f=1;f{const[e,n]=_.useState(!1),[r,s]=_.useState({title:"Título",description:"Descripción",cancelLabel:sr("common.no"),confirmLabel:sr("common.yes"),onCancel:()=>{},onConfirm:()=>{},...t}),i=(u,f)=>{u==null||u.preventDefault(),f&&s(f),n(!0)},a=u=>{u==null||u.preventDefault(),n(!1),r==null||r.onCancel(u)},o=u=>{u==null||u.preventDefault(),n(!1),r==null||r.onConfirm(u)},c=r?P.jsx(IQ,{isOpen:e,onCancel:a,onConfirm:o,title:r.title,description:r.description,cancelLabel:r.cancelLabel,confirmLabel:r.confirmLabel}):P.jsx(P.Fragment,{});return{openDialog:i,cancelDialog:a,confirmDialog:o,DialogComponent:c}};var jQ={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(self,()=>{return n={7629:(s,i,a)=>{const o=a(375),c=a(8571),u=a(9474),f=a(1687),l=a(8652),d=a(8160),m=a(3292),p=a(6354),h=a(8901),y=a(9708),g=a(6914),v=a(2294),w=a(6133),x=a(1152),A=a(8863),T=a(2036),R={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 w.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 o(typeof y.describe=="function","Manifest functionality disabled"),y.describe(this)}allow(...E){return d.verifyFlat(E,"allow"),this._values(E,"_valids")}alter(E){o(E&&typeof E=="object"&&!Array.isArray(E),"Invalid targets argument"),o(!this._inRuleset(),"Cannot set alterations inside a ruleset");const k=this.clone();k.$_terms.alterations=k.$_terms.alterations||[];for(const N in E){const O=E[N];o(typeof O=="function","Alteration adjuster for",N,"must be a function"),k.$_terms.alterations.push({target:N,adjuster:O})}return k.$_temp.ruleset=!1,k}artifact(E){return o(E!==void 0,"Artifact cannot be undefined"),o(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",E)}cast(E){return o(E===!1||typeof E=="string","Invalid to value"),o(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,k){return this._default("default",E,k)}description(E){return o(E&&typeof E=="string","Description must be a non-empty string"),this.$_setFlag("description",E)}empty(E){const k=this.clone();return E!==void 0&&(E=k.$_compile(E,{override:!1})),k.$_setFlag("empty",E,{clone:!1})}error(E){return o(E,"Missing error"),o(E instanceof Error||typeof E=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",E)}example(E,k={}){return o(E!==void 0,"Missing example"),d.assertOptions(k,["override"]),this._inner("examples",E,{single:!0,override:k.override})}external(E,k){return typeof E=="object"&&(o(!k,"Cannot combine options with description"),k=E.description,E=E.method),o(typeof E=="function","Method must be a function"),o(k===void 0||k&&typeof k=="string","Description must be a non-empty string"),this._inner("externals",{method:E,description:k},{single:!0})}failover(E,k){return this._default("failover",E,k)}forbidden(){return this.presence("forbidden")}id(E){return E?(o(typeof E=="string","id must be a non-empty string"),o(/^[^\.]+$/.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 o(E&&typeof E=="string","Label name must be a non-empty string"),this.$_setFlag("label",E)}meta(E){return o(E!==void 0,"Meta cannot be undefined"),this._inner("metas",E,{single:!0})}note(...E){o(E.length,"Missing notes");for(const k of E)o(k&&typeof k=="string","Notes must be non-empty strings");return this._inner("notes",E)}only(E=!0){return o(typeof E=="boolean","Invalid mode:",E),this.$_setFlag("only",E)}optional(){return this.presence("optional")}prefs(E){o(E,"Missing preferences"),o(E.context===void 0,"Cannot override context"),o(E.externals===void 0,"Cannot override externals"),o(E.warnings===void 0,"Cannot override warnings"),o(E.debug===void 0,"Cannot override debug"),d.checkPreferences(E);const k=this.clone();return k._preferences=d.preferences(k._preferences,E),k}presence(E){return o(["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 o(["raw","strip"].includes(E),"Unknown result mode",E),this.$_setFlag("result",E)}required(){return this.presence("required")}strict(E){const k=this.clone(),N=E!==void 0&&!E;return k._preferences=d.preferences(k._preferences,{convert:N}),k}strip(E=!0){return this.$_setFlag("result",E?"strip":void 0)}tag(...E){o(E.length,"Missing tags");for(const k of E)o(k&&typeof k=="string","Tags must be non-empty strings");return this._inner("tags",E)}unit(E){return o(E&&typeof E=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",E)}valid(...E){d.verifyFlat(E,"valid");const k=this.allow(...E);return k.$_setFlag("only",!!k._valids,{clone:!1}),k}when(E,k){const N=this.clone();N.$_terms.whens||(N.$_terms.whens=[]);const O=m.when(N,E,k);if(!["any","link"].includes(N.type)){const L=O.is?[O]:O.switch;for(const I of L)o(!I.then||I.then.type==="any"||I.then.type===N.type,"Cannot combine",N.type,"with",I.then&&I.then.type),o(!I.otherwise||I.otherwise.type==="any"||I.otherwise.type===N.type,"Cannot combine",N.type,"with",I.otherwise&&I.otherwise.type)}return N.$_terms.whens.push(O),N.$_mutateRebuild()}cache(E){o(!this._inRuleset(),"Cannot set caching inside a ruleset"),o(!this._cache,"Cannot override schema cache"),o(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const k=this.clone();return k._cache=E||l.provider.provision(),k.$_temp.ruleset=!1,k}clone(){const E=Object.create(Object.getPrototypeOf(this));return this._assign(E)}concat(E){o(d.isSchema(E),"Invalid schema object"),o(this.type==="any"||E.type==="any"||E.type===this.type,"Cannot merge type",this.type,"with another type:",E.type),o(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),o(!E._inRuleset(),"Cannot concatenate a schema with open ruleset");let k=this.clone();if(this.type==="any"&&E.type!=="any"){const N=E.clone();for(const O of Object.keys(k))O!=="type"&&(N[O]=k[O]);k=N}k._ids.concat(E._ids),k._refs.register(E,w.toSibling),k._preferences=k._preferences?d.preferences(k._preferences,E._preferences):E._preferences,k._valids=T.merge(k._valids,E._valids,E._invalids),k._invalids=T.merge(k._invalids,E._invalids,E._valids);for(const N of E._singleRules.keys())k._singleRules.has(N)&&(k._rules=k._rules.filter(O=>O.keep||O.name!==N),k._singleRules.delete(N));for(const N of E._rules)E._definition.rules[N.method].multi||k._singleRules.set(N.name,N),k._rules.push(N);if(k._flags.empty&&E._flags.empty){k._flags.empty=k._flags.empty.concat(E._flags.empty);const N=Object.assign({},E._flags);delete N.empty,f(k._flags,N)}else if(E._flags.empty){k._flags.empty=E._flags.empty;const N=Object.assign({},E._flags);delete N.empty,f(k._flags,N)}else f(k._flags,E._flags);for(const N in E.$_terms){const O=E.$_terms[N];O?k.$_terms[N]?k.$_terms[N]=k.$_terms[N].concat(O):k.$_terms[N]=O.slice():k.$_terms[N]||(k.$_terms[N]=O)}return this.$_root._tracer&&this.$_root._tracer._combine(k,[this,E]),k.$_mutateRebuild()}extend(E){return o(!E.base,"Cannot extend type with another base"),h.type(this,E)}extract(E){return E=Array.isArray(E)?E:E.split("."),this._ids.reach(E)}fork(E,k){o(!this._inRuleset(),"Cannot fork inside a ruleset");let N=this;for(let O of[].concat(E))O=Array.isArray(O)?O:O.split("."),N=N._ids.fork(O,k,N);return N.$_temp.ruleset=!1,N}rule(E){const k=this._definition;d.assertOptions(E,Object.keys(k.modifiers)),o(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const N=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;o(N>=0&&NN.tailor(E),ref:!1}),k.$_temp.ruleset=!1,k.$_mutateRebuild()}tracer(){return x.location?x.location(this):this}validate(E,k){return A.entry(E,this,k)}validateAsync(E,k){return A.entryAsync(E,this,k)}$_addRule(E){typeof E=="string"&&(E={name:E}),o(E&&typeof E=="object","Invalid options"),o(E.name&&typeof E.name=="string","Invalid rule name");for(const I in E)o(I[0]!=="_","Cannot set private rule properties");const k=Object.assign({},E);k._resolve=[],k.method=k.method||k.name;const N=this._definition.rules[k.method],O=k.args;o(N,"Unknown rule",k.method);const L=this.clone();if(O){o(Object.keys(O).length===1||Object.keys(O).length===this._definition.rules[k.name].args.length,"Invalid rule definition for",this.type,k.name);for(const I in O){let F=O[I];if(N.argsByName){const U=N.argsByName.get(I);if(U.ref&&d.isResolvable(F))k._resolve.push(I),L.$_mutateRegister(F);else if(U.normalize&&(F=U.normalize(F),O[I]=F),U.assert){const Y=d.validateArg(F,I,U);o(!Y,Y,"or reference")}}F!==void 0?O[I]=F:delete O[I]}}return N.multi||(L._ruleRemove(k.name,{clone:!1}),L._singleRules.set(k.name,k)),L.$_temp.ruleset===!1&&(L.$_temp.ruleset=null),N.priority?L._rules.unshift(k):L._rules.push(k),L}$_compile(E,k){return m.schema(this.$_root,E,k)}$_createError(E,k,N,O,L,I={}){const F=I.flags!==!1?this._flags:{},U=I.messages?g.merge(this._definition.messages,I.messages):this._definition.messages;return new p.Report(E,k,N,F,U,O,L)}$_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,k,N,O){(N=Object.assign({},N)).abortEarly=!0,N._externals=!1,k.snapshot();const L=!A.validate(E,this,k,N,O).errors;return k.restore(),L}$_modify(E){return d.assertOptions(E,["each","once","ref","schema"]),v.schema(this,E)||this}$_mutateRebuild(){return o(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(E,{source:k,name:N,path:O,key:L})=>{const I=this._definition[k][N]&&this._definition[k][N].register;I!==!1&&this.$_mutateRegister(E,{family:I,key:L})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(E,{family:k,key:N}={}){this._refs.register(E,k),this._ids.register(E,{key:N})}$_property(E){return this._definition.properties[E]}$_reach(E){return this._ids.reach(E)}$_rootReferences(){return this._refs.roots()}$_setFlag(E,k,N={}){o(E[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const O=this._definition.flags[E]||{};if(u(k,O.default)&&(k=void 0),u(k,this._flags[E]))return this;const L=N.clone!==!1?this.clone():this;return k!==void 0?(L._flags[E]=k,L.$_mutateRegister(k)):delete L._flags[E],E[0]!=="_"&&(L.$_temp.ruleset=!1),L}$_parent(E,...k){return this[E][d.symbols.parent].call(this,...k)}$_validate(E,k,N){return A.validate(E,this,k,N)}_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 k in this.$_terms)E.$_terms[k]=this.$_terms[k]?this.$_terms[k].slice():null;E.$_super={};for(const k in this.$_super)E.$_super[k]=this._super[k].bind(E);return E}_bare(){const E=this.clone();E._reset();const k=E._definition.terms;for(const N in k){const O=k[N];E.$_terms[N]=O.init}return E.$_mutateRebuild()}_default(E,k,N={}){return d.assertOptions(N,"literal"),o(k!==void 0,"Missing",E,"value"),o(typeof k=="function"||!N.literal,"Only function value supports literal option"),typeof k=="function"&&N.literal&&(k={[d.symbols.literal]:!0,literal:k}),this.$_setFlag(E,k)}_generate(E,k,N){if(!this.$_terms.whens)return{schema:this};const O=[],L=[];for(let U=0;Uee)break}const I=L.join(", ");if(k.mainstay.tracer.debug(k,"rule","when",I),!I)return{schema:this};if(!k.mainstay.tracer.active&&this.$_temp.whens[I])return{schema:this.$_temp.whens[I],id:I};let F=this;this._definition.generate&&(F=this._definition.generate(this,E,k,N));for(const U of O)F=F.concat(U);return this.$_root._tracer&&this.$_root._tracer._combine(F,[this,...O]),this.$_temp.whens[I]=F,{schema:F,id:I}}_inner(E,k,N={}){o(!this._inRuleset(),`Cannot set ${E} inside a ruleset`);const O=this.clone();return O.$_terms[E]&&!N.override||(O.$_terms[E]=[]),N.single?O.$_terms[E].push(k):O.$_terms[E].push(...k),O.$_temp.ruleset=!1,O}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(E,k={}){if(!this._singleRules.has(E))return this;const N=k.clone!==!1?this.clone():this;N._singleRules.delete(E);const O=[];for(let L=0;L{const o=a(375),c=a(8571),u=a(8160),f={max:1e3,supported:new Set(["undefined","boolean","number","string"])};i.provider={provision:l=>new f.Cache(l)},f.Cache=class{constructor(l={}){u.assertOptions(l,["max"]),o(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,d){if(l!==null&&!f.supported.has(typeof l))return;let m=this._map.get(l);if(m)return m.value=d,void this._list.first(m);m=this._list.unshift({key:l,value:d}),this._map.set(l,m),this._compact()}get(l){const d=this._map.get(l);if(d)return this._list.first(d),c(d.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:d,prev:m}=l;return d.prev=m,m&&(m.next=d),l===this.tail&&(this.tail=d),l.prev=null,l.next=null,l}}},8160:(s,i,a)=>{const o=a(375),c=a(7916),u=a(5934);let f,l;const d={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=u.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(m,p,h="Options"){o(m&&typeof m=="object"&&!Array.isArray(m),"Options must be of type object");const y=Object.keys(m).filter(g=>!p.includes(g));o(y.length===0,`${h} contain unknown keys: ${y}`)},i.checkPreferences=function(m){l=l||a(3378);const p=l.preferences.validate(m);if(p.error)throw new c([p.error.details[0].message])},i.compare=function(m,p,h){switch(h){case"=":return m===p;case">":return m>p;case"<":return m=":return m>=p;case"<=":return m<=p}},i.default=function(m,p){return m===void 0?p:m},i.isIsoDate=function(m){return d.isoDate.test(m)},i.isNumber=function(m){return typeof m=="number"&&!isNaN(m)},i.isResolvable=function(m){return!!m&&(m[i.symbols.ref]||m[i.symbols.template])},i.isSchema=function(m,p={}){const h=m&&m[i.symbols.any];return!!h&&(o(p.legacy||h.version===i.version,"Cannot mix different versions of joi schemas"),!0)},i.isValues=function(m){return m[i.symbols.values]},i.limit=function(m){return Number.isSafeInteger(m)&&m>=0},i.preferences=function(m,p){f=f||a(6914),m=m||{},p=p||{};const h=Object.assign({},m,p);return p.errors&&m.errors&&(h.errors=Object.assign({},m.errors,p.errors),h.errors.wrap=Object.assign({},m.errors.wrap,p.errors.wrap)),p.messages&&(h.messages=f.compile(p.messages,m.messages)),delete h[i.symbols.prefs],h},i.tryWithPath=function(m,p,h={}){try{return m()}catch(y){throw y.path!==void 0?y.path=p+"."+y.path:y.path=p,h.append&&(y.message=`${y.message} (${y.path})`),y}},i.validateArg=function(m,p,{assert:h,message:y}){if(i.isSchema(h)){const g=h.validate(m);return g.error?g.error.message:void 0}if(!h(m))return p?`${p} ${y}`:y},i.verifyFlat=function(m,p){for(const h of m)o(!Array.isArray(h),"Method no longer accepts array arguments:",p)}},3292:(s,i,a)=>{const o=a(375),c=a(8160),u=a(6133),f={};i.schema=function(l,d,m={}){c.assertOptions(m,["appendPath","override"]);try{return f.schema(l,d,m)}catch(p){throw m.appendPath&&p.path!==void 0&&(p.message=`${p.message} (${p.path})`),p}},f.schema=function(l,d,m){o(d!==void 0,"Invalid undefined schema"),Array.isArray(d)&&(o(d.length,"Invalid empty array schema"),d.length===1&&(d=d[0]));const p=(h,...y)=>m.override!==!1?h.valid(l.override,...y):h.valid(...y);if(f.simple(d))return p(l,d);if(typeof d=="function")return l.custom(d);if(o(typeof d=="object","Invalid schema content:",typeof d),c.isResolvable(d))return p(l,d);if(c.isSchema(d))return d;if(Array.isArray(d)){for(const h of d)if(!f.simple(h))return l.alternatives().try(...d);return p(l,...d)}return d instanceof RegExp?l.string().regex(d):d instanceof Date?p(l.date(),d):(o(Object.getPrototypeOf(d)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),l.object().keys(d))},i.ref=function(l,d){return u.isRef(l)?l:u.create(l,d)},i.compile=function(l,d,m={}){c.assertOptions(m,["legacy"]);const p=d&&d[c.symbols.any];if(p)return o(m.legacy||p.version===c.version,"Cannot mix different versions of joi schemas:",p.version,c.version),d;if(typeof d!="object"||!m.legacy)return i.schema(l,d,{appendPath:!0});const h=f.walk(d);return h?h.compile(h.root,d):i.schema(l,d,{appendPath:!0})},f.walk=function(l){if(typeof l!="object")return null;if(Array.isArray(l)){for(const m of l){const p=f.walk(m);if(p)return p}return null}const d=l[c.symbols.any];if(d)return{root:l[d.root],compile:d.compile};o(Object.getPrototypeOf(l)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const m in l){const p=f.walk(l[m]);if(p)return p}return null},f.simple=function(l){return l===null||["boolean","string","number"].includes(typeof l)},i.when=function(l,d,m){if(m===void 0&&(o(d&&typeof d=="object","Missing options"),m=d,d=u.create(".")),Array.isArray(m)&&(m={switch:m}),c.assertOptions(m,["is","not","then","otherwise","switch","break"]),c.isSchema(d))return o(m.is===void 0,'"is" can not be used with a schema condition'),o(m.not===void 0,'"not" can not be used with a schema condition'),o(m.switch===void 0,'"switch" can not be used with a schema condition'),f.condition(l,{is:d,then:m.then,otherwise:m.otherwise,break:m.break});if(o(u.isRef(d)||typeof d=="string","Invalid condition:",d),o(m.not===void 0||m.is===void 0,'Cannot combine "is" with "not"'),m.switch===void 0){let h=m;m.not!==void 0&&(h={is:m.not,then:m.otherwise,otherwise:m.then,break:m.break});let y=h.is!==void 0?l.$_compile(h.is):l.$_root.invalid(null,!1,0,"").required();return o(h.then!==void 0||h.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),o(h.break===void 0||h.then===void 0||h.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),m.is===void 0||u.isRef(m.is)||c.isSchema(m.is)||(y=y.required()),f.condition(l,{ref:i.ref(d),is:y,then:h.then,otherwise:h.otherwise,break:h.break})}o(Array.isArray(m.switch),'"switch" must be an array'),o(m.is===void 0,'Cannot combine "switch" with "is"'),o(m.not===void 0,'Cannot combine "switch" with "not"'),o(m.then===void 0,'Cannot combine "switch" with "then"');const p={ref:i.ref(d),switch:[],break:m.break};for(let h=0;h{const o=a(5688),c=a(8160),u=a(3328);i.Report=class{constructor(f,l,d,m,p,h,y){if(this.code=f,this.flags=m,this.messages=p,this.path=h.path,this.prefs=y,this.state=h,this.value=l,this.message=null,this.template=null,this.local=d||{},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 d of f)typeof d!="object"&&(typeof d=="string"?(l&&(l+="."),l+=d):l+=`[${d}]`);return l},i.template=function(f,l,d,m,p){if(!l)return;if(u.isTemplate(l))return d!=="root"?l:null;let h=p.errors.language;if(c.isResolvable(h)&&(h=h.resolve(f,m,p)),h&&l[h]){if(l[h][d]!==void 0)return l[h][d];if(l[h]["*"]!==void 0)return l[h]["*"]}return l[d]?l[d]:l["*"]},i.label=function(f,l,d,m){if(!d.errors.label)return"";if(f.label)return f.label;let p=l.path;return d.errors.label==="key"&&l.path.length>1&&(p=l.path.slice(-1)),i.path(p)||i.template(null,d.messages,"root",l,d)||m&&i.template(null,m,"root",l,d)||"value"},i.process=function(f,l,d){if(!f)return null;const{override:m,message:p,details:h}=i.details(f);if(m)return m;if(d.errors.stack)return new i.ValidationError(p,h,l);const y=Error.stackTraceLimit;Error.stackTraceLimit=0;const g=new i.ValidationError(p,h,l);return Error.stackTraceLimit=y,g},i.details=function(f,l={}){let d=[];const m=[];for(const p of f){if(p instanceof Error){if(l.override!==!1)return{override:p};const y=p.toString();d.push(y),m.push({message:y,type:"override",context:{error:p}});continue}const h=p.toString();d.push(h),m.push({message:h,path:p.path.filter(y=>typeof y!="object"),type:p.code,context:p.local})}return d.length>1&&(d=[...new Set(d)]),{message:d.join(". "),details:m}},i.ValidationError=class extends Error{constructor(f,l,d){super(f),this._original=d,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=o.error},8901:(s,i,a)=>{const o=a(375),c=a(8571),u=a(8160),f=a(6914),l={};i.type=function(d,m){const p=Object.getPrototypeOf(d),h=c(p),y=d._assign(Object.create(h)),g=Object.assign({},m);delete g.base,h._definition=g;const v=p._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 w=Object.assign({},v.terms);if(g.terms)for(const R in g.terms){const E=g.terms[R];o(y.$_terms[R]===void 0,"Invalid term override for",g.type,R),y.$_terms[R]=E.init,w[R]=E}g.terms=w,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 x=Object.assign({},v.rules);if(g.rules)for(const R in g.rules){const E=g.rules[R];o(typeof E=="object","Invalid rule definition for",g.type,R);let k=E.method;if(k===void 0&&(k=function(){return this.$_addRule(R)}),k&&(o(!h[R],"Rule conflict in",g.type,R),h[R]=k),o(!x[R],"Rule conflict in",g.type,R),x[R]=E,E.alias){const N=[].concat(E.alias);for(const O of N)h[O]=E.method}E.args&&(E.argsByName=new Map,E.args=E.args.map(N=>(typeof N=="string"&&(N={name:N}),o(!E.argsByName.has(N.name),"Duplicated argument name",N.name),u.isSchema(N.assert)&&(N.assert=N.assert.strict().label(N.name)),E.argsByName.set(N.name,N),N)))}g.rules=x;const A=Object.assign({},v.modifiers);if(g.modifiers)for(const R in g.modifiers){o(!h[R],"Rule conflict in",g.type,R);const E=g.modifiers[R];o(typeof E=="function","Invalid modifier definition for",g.type,R);const k=function(N){return this.rule({[R]:N})};h[R]=k,A[R]=E}if(g.modifiers=A,g.overrides){h._super=p,y.$_super={};for(const R in g.overrides)o(p[R],"Cannot override missing",R),g.overrides[R][u.symbols.parent]=p[R],y.$_super[R]=p[R].bind(y);Object.assign(h,g.overrides)}g.cast=Object.assign({},v.cast,g.cast);const T=Object.assign({},v.manifest,g.manifest);return T.build=l.build(g.manifest&&g.manifest.build,v.manifest&&v.manifest.build),g.manifest=T,g.rebuild=l.rebuild(g.rebuild,v.rebuild),y},l.build=function(d,m){return d&&m?function(p,h){return m(d(p,h),h)}:d||m},l.coerce=function(d,m){return d&&m?{from:d.from&&m.from?[...new Set([...d.from,...m.from])]:null,method(p,h){let y;if((!m.from||m.from.includes(typeof p))&&(y=m.method(p,h),y)){if(y.errors||y.value===void 0)return y;p=y.value}if(!d.from||d.from.includes(typeof p)){const g=d.method(p,h);if(g)return g}return y}}:d||m},l.prepare=function(d,m){return d&&m?function(p,h){const y=d(p,h);if(y){if(y.errors||y.value===void 0)return y;p=y.value}return m(p,h)||y}:d||m},l.rebuild=function(d,m){return d&&m?function(p){m(p),d(p)}:d||m},l.validate=function(d,m){return d&&m?function(p,h){const y=m(p,h);if(y){if(y.errors&&(!Array.isArray(y.errors)||y.errors.length))return y;p=y.value}return d(p,h)||y}:d||m}},5107:(s,i,a)=>{const o=a(375),c=a(8571),u=a(8652),f=a(8160),l=a(3292),d=a(6354),m=a(8901),p=a(9708),h=a(6133),y=a(3328),g=a(1152);let v;const w={types:{alternatives:a(4946),any:a(8068),array:a(546),boolean:a(4937),date:a(7500),function:a(390),link:a(8785),number:a(3832),object:a(8966),string:a(7417),symbol:a(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const x={_types:new Set(Object.keys(w.types))};for(const A of x._types)x[A]=function(...T){return o(!T.length||["alternatives","link","object"].includes(A),"The",A,"type does not allow arguments"),w.generate(this,w.types[A],T)};for(const A of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])x[A]=function(...T){return this.any()[A](...T)};Object.assign(x,w.methods);for(const A in w.aliases){const T=w.aliases[A];x[A]=x[T]}return x.x=x.expression,g.setup&&g.setup(x),x}};w.methods={ValidationError:d.ValidationError,version:f.version,cache:u.provider,assert(x,A,...T){w.assert(x,A,!0,T)},attempt:(x,A,...T)=>w.assert(x,A,!1,T),build(x){return o(typeof p.build=="function","Manifest functionality disabled"),p.build(this,x)},checkPreferences(x){f.checkPreferences(x)},compile(x,A){return l.compile(this,x,A)},defaults(x){o(typeof x=="function","modifier must be a function");const A=Object.assign({},this);for(const T of A._types){const R=x(A[T]());o(f.isSchema(R),"modifier must return a valid schema object"),A[T]=function(...E){return w.generate(this,R,E)}}return A},expression:(...x)=>new y(...x),extend(...x){f.verifyFlat(x,"extend"),v=v||a(3378),o(x.length,"You need to provide at least one extension"),this.assert(x,v.extensions);const A=Object.assign({},this);A._types=new Set(A._types);for(let T of x){typeof T=="function"&&(T=T(A)),this.assert(T,v.extension);const R=w.expandExtension(T,A);for(const E of R){o(A[E.type]===void 0||A._types.has(E.type),"Cannot override name",E.type);const k=E.base||this.any(),N=m.type(k,E);A._types.add(E.type),A[E.type]=function(...O){return w.generate(this,N,O)}}}return A},isError:d.ValidationError.isError,isExpression:y.isTemplate,isRef:h.isRef,isSchema:f.isSchema,in:(...x)=>h.in(...x),override:f.symbols.override,ref:(...x)=>h.create(...x),types(){const x={};for(const A of this._types)x[A]=this[A]();for(const A in w.aliases)x[A]=this[A]();return x}},w.assert=function(x,A,T,R){const E=R[0]instanceof Error||typeof R[0]=="string"?R[0]:null,k=E!==null?R[1]:R[0],N=A.validate(x,f.preferences({errors:{stack:!0}},k||{}));let O=N.error;if(!O)return N.value;if(E instanceof Error)throw E;const L=T&&typeof O.annotate=="function"?O.annotate():O.message;throw O instanceof d.ValidationError==0&&(O=c(O)),O.message=E?`${E} ${L}`:L,O},w.generate=function(x,A,T){return o(x,"Must be invoked on a Joi instance."),A.$_root=x,A._definition.args&&T.length?A._definition.args(A,...T):A},w.expandExtension=function(x,A){if(typeof x.type=="string")return[x];const T=[];for(const R of A._types)if(x.type.test(R)){const E=Object.assign({},x);E.type=R,E.base=A[R](),T.push(E)}return T},s.exports=w.root()},6914:(s,i,a)=>{const o=a(375),c=a(8571),u=a(3328);i.compile=function(f,l){if(typeof f=="string")return o(!l,"Cannot set single message string"),new u(f);if(u.isTemplate(f))return o(!l,"Cannot set single message template"),f;o(typeof f=="object"&&!Array.isArray(f),"Invalid message options"),l=l?c(l):{};for(let d in f){const m=f[d];if(d==="root"||u.isTemplate(m)){l[d]=m;continue}if(typeof m=="string"){l[d]=new u(m);continue}o(typeof m=="object"&&!Array.isArray(m),"Invalid message for",d);const p=d;for(d in l[p]=l[p]||{},m){const h=m[d];d==="root"||u.isTemplate(h)?l[p][d]=h:(o(typeof h=="string","Invalid message for",d,"in",p),l[p][d]=new u(h))}}return l},i.decompile=function(f){const l={};for(let d in f){const m=f[d];if(d==="root"){l.root=m;continue}if(u.isTemplate(m)){l[d]=m.describe({compact:!0});continue}const p=d;for(d in l[p]={},m){const h=m[d];d!=="root"?l[p][d]=h.describe({compact:!0}):l[p].root=h}}return l},i.merge=function(f,l){if(!f)return i.compile(l);if(!l)return f;if(typeof l=="string")return new u(l);if(u.isTemplate(l))return l;const d=c(f);for(let m in l){const p=l[m];if(m==="root"||u.isTemplate(p)){d[m]=p;continue}if(typeof p=="string"){d[m]=new u(p);continue}o(typeof p=="object"&&!Array.isArray(p),"Invalid message for",m);const h=m;for(m in d[h]=d[h]||{},p){const y=p[m];m==="root"||u.isTemplate(y)?d[h][m]=y:(o(typeof y=="string","Invalid message for",m,"in",h),d[h][m]=new u(y))}}return d}},2294:(s,i,a)=>{const o=a(375),c=a(8160),u=a(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[d,m]of l._byId.entries())o(!this._byKey.has(d),"Schema id conflicts with existing key:",d),this._byId.set(d,m);for(const[d,m]of l._byKey.entries())o(!this._byId.has(d),"Schema key conflicts with existing id:",d),this._byKey.set(d,m)}fork(l,d,m){const p=this._collect(l);p.push({schema:m});const h=p.shift();let y={id:h.id,schema:d(h.schema)};o(c.isSchema(y.schema),"adjuster function failed to return a joi schema type");for(const g of p)y={id:g.id,schema:f.fork(g.schema,y.id,y.schema)};return y.schema}labels(l,d=[]){const m=l[0],p=this._get(m);if(!p)return[...d,...l].join(".");const h=l.slice(1);return d=[...d,p.schema._flags.label||m],h.length?p.schema._ids.labels(h,d):d.join(".")}reach(l,d=[]){const m=l[0],p=this._get(m);o(p,"Schema does not contain path",[...d,...l].join("."));const h=l.slice(1);return h.length?p.schema._ids.reach(h,[...d,m]):p.schema}register(l,{key:d}={}){if(!l||!c.isSchema(l))return;(l.$_property("schemaChain")||l._ids._schemaChain)&&(this._schemaChain=!0);const m=l._flags.id;if(m){const p=this._byId.get(m);o(!p||p.schema===l,"Cannot add different schemas with the same id:",m),o(!this._byKey.has(m),"Schema id conflicts with existing key:",m),this._byId.set(m,{schema:l,id:m})}d&&(o(!this._byKey.has(d),"Schema already contains key:",d),o(!this._byId.has(d),"Schema key conflicts with existing id:",d),this._byKey.set(d,{schema:l,id:d}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(l,d=[],m=[]){const p=l[0],h=this._get(p);o(h,"Schema does not contain path",[...d,...l].join(".")),m=[h,...m];const y=l.slice(1);return y.length?h.schema._ids._collect(y,[...d,p],m):m}_get(l){return this._byId.get(l)||this._byKey.get(l)}},f.fork=function(l,d,m){const p=i.schema(l,{each:(h,{key:y})=>{if(d===(h._flags.id||y))return m},ref:!1});return p?p.$_mutateRebuild():l},i.schema=function(l,d){let m;for(const p in l._flags){if(p[0]==="_")continue;const h=f.scan(l._flags[p],{source:"flags",name:p},d);h!==void 0&&(m=m||l.clone(),m._flags[p]=h)}for(let p=0;p{const o=a(375),c=a(8571),u=a(9621),f=a(8160);let l;const d={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};i.create=function(m,p={}){o(typeof m=="string","Invalid reference key:",m),f.assertOptions(p,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),o(!p.prefix||typeof p.prefix=="object","options.prefix must be of type object");const h=Object.assign({},d.defaults,p);delete h.prefix;const y=h.separator,g=d.context(m,y,p.prefix);if(h.type=g.type,m=g.key,h.type==="value")if(g.root&&(o(!y||m[0]!==y,"Cannot specify relative path with root prefix"),h.ancestor="root",m||(m=null)),y&&y===m)m=null,h.ancestor=0;else if(h.ancestor!==void 0)o(!y||!m||m[0]!==y,"Cannot combine prefix with ancestor option");else{const[v,w]=d.ancestor(m,y);w&&(m=m.slice(w))===""&&(m=null),h.ancestor=v}return h.path=y?m===null?[]:m.split(y):[m],new d.Ref(h)},i.in=function(m,p={}){return i.create(m,{...p,in:!0})},i.isRef=function(m){return!!m&&!!m[f.symbols.ref]},d.Ref=class{constructor(m){o(typeof m=="object","Invalid reference construction"),f.assertOptions(m,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),o([!1,void 0].includes(m.separator)||typeof m.separator=="string"&&m.separator.length===1,"Invalid separator"),o(!m.adjust||typeof m.adjust=="function","options.adjust must be a function"),o(!m.map||Array.isArray(m.map),"options.map must be an array"),o(!m.map||!m.adjust,"Cannot set both map and adjust options"),Object.assign(this,d.defaults,m),o(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(m,p,h,y,g={}){return o(!this.in||g.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(h.context,p,g):this.type==="local"?this._resolve(y,p,g):this.ancestor?this.ancestor==="root"?this._resolve(p.ancestors[p.ancestors.length-1],p,g):(o(this.ancestor<=p.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(p.ancestors[this.ancestor-1],p,g)):this._resolve(m,p,g)}_resolve(m,p,h){let y;if(this.type==="value"&&p.mainstay.shadow&&h.shadow!==!1&&(y=p.mainstay.shadow.get(this.absolute(p))),y===void 0&&(y=u(m,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 p.mainstay&&p.mainstay.tracer.resolve(p,this,y),y}toString(){return this.display}absolute(m){return[...m.path.slice(0,-this.ancestor),...this.path]}clone(){return new d.Ref(this)}describe(){const m={path:this.path};this.type!=="value"&&(m.type=this.type),this.separator!=="."&&(m.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(m.ancestor=this.ancestor),this.map&&(m.map=[...this.map]);for(const p of["adjust","iterables","render"])this[p]!==null&&this[p]!==void 0&&(m[p]=this[p]);return this.in!==!1&&(m.in=!0),{ref:m}}updateDisplay(){const m=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${m}`);if(!this.separator)return void(this.display=`ref:${m}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${m}`);if(this.ancestor==="root")return void(this.display=`ref:root:${m}`);if(this.ancestor===1)return void(this.display=`ref:${m||".."}`);const p=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${p}${m||""}`}},d.Ref.prototype[f.symbols.ref]=!0,i.build=function(m){return(m=Object.assign({},d.defaults,m)).type==="value"&&m.ancestor===void 0&&(m.ancestor=1),new d.Ref(m)},d.context=function(m,p,h={}){if(m=m.trim(),h){const y=h.global===void 0?"$":h.global;if(y!==p&&m.startsWith(y))return{key:m.slice(y.length),type:"global"};const g=h.local===void 0?"#":h.local;if(g!==p&&m.startsWith(g))return{key:m.slice(g.length),type:"local"};const v=h.root===void 0?"/":h.root;if(v!==p&&m.startsWith(v))return{key:m.slice(v.length),type:"value",root:!0}}return{key:m,type:"value"}},d.ancestor=function(m,p){if(!p)return[1,0];if(m[0]!==p)return[1,0];if(m[1]!==p)return[0,1];let h=2;for(;m[h]===p;)++h;return[h-1,h]},i.toSibling=0,i.toParent=1,i.Manager=class{constructor(){this.refs=[]}register(m,p){if(m)if(p=p===void 0?i.toParent:p,Array.isArray(m))for(const h of m)this.register(h,p);else if(f.isSchema(m))for(const h of m._refs.refs)h.ancestor-p>=0&&this.refs.push({ancestor:h.ancestor-p,root:h.root});else i.isRef(m)&&m.type==="value"&&m.ancestor-p>=0&&this.refs.push({ancestor:m.ancestor-p,root:m.root}),l=l||a(3328),l.isTemplate(m)&&this.register(m.refs(),p)}get length(){return this.refs.length}clone(){const m=new i.Manager;return m.refs=c(this.refs),m}reset(){this.refs=[]}roots(){return this.refs.filter(m=>!m.ancestor).map(m=>m.root)}}},3378:(s,i,a)=>{const o=a(5107),c={};c.wrap=o.string().min(1).max(2).allow(!1),i.preferences=o.object({allowUnknown:o.boolean(),abortEarly:o.boolean(),artifacts:o.boolean(),cache:o.boolean(),context:o.object(),convert:o.boolean(),dateFormat:o.valid("date","iso","string","time","utc"),debug:o.boolean(),errors:{escapeHtml:o.boolean(),label:o.valid("path","key",!1),language:[o.string(),o.object().ref()],render:o.boolean(),stack:o.boolean(),wrap:{label:c.wrap,array:c.wrap,string:c.wrap}},externals:o.boolean(),messages:o.object(),noDefaults:o.boolean(),nonEnumerables:o.boolean(),presence:o.valid("required","optional","forbidden"),skipFunctions:o.boolean(),stripUnknown:o.object({arrays:o.boolean(),objects:o.boolean()}).or("arrays","objects").allow(!0,!1),warnings:o.boolean()}).strict(),c.nameRx=/^[a-zA-Z0-9]\w*$/,c.rule=o.object({alias:o.array().items(o.string().pattern(c.nameRx)).single(),args:o.array().items(o.string(),o.object({name:o.string().pattern(c.nameRx).required(),ref:o.boolean(),assert:o.alternatives([o.function(),o.object().schema()]).conditional("ref",{is:!0,then:o.required()}),normalize:o.function(),message:o.string().when("assert",{is:o.function(),then:o.required()})})),convert:o.boolean(),manifest:o.boolean(),method:o.function().allow(!1),multi:o.boolean(),validate:o.function()}),i.extension=o.object({type:o.alternatives([o.string(),o.object().regex()]).required(),args:o.function(),cast:o.object().pattern(c.nameRx,o.object({from:o.function().maxArity(1).required(),to:o.function().minArity(1).maxArity(2).required()})),base:o.object().schema().when("type",{is:o.object().regex(),then:o.forbidden()}),coerce:[o.function().maxArity(3),o.object({method:o.function().maxArity(3).required(),from:o.array().items(o.string()).single()})],flags:o.object().pattern(c.nameRx,o.object({setter:o.string(),default:o.any()})),manifest:{build:o.function().arity(2)},messages:[o.object(),o.string()],modifiers:o.object().pattern(c.nameRx,o.function().minArity(1).maxArity(2)),overrides:o.object().pattern(c.nameRx,o.function()),prepare:o.function().maxArity(3),rebuild:o.function().arity(1),rules:o.object().pattern(c.nameRx,c.rule),terms:o.object().pattern(c.nameRx,o.object({init:o.array().allow(null).required(),manifest:o.object().pattern(/.+/,[o.valid("schema","single"),o.object({mapped:o.object({from:o.string().required(),to:o.string().required()}).required()})])})),validate:o.function().maxArity(3)}).strict(),i.extensions=o.array().items(o.object(),o.function().arity(1)).strict(),c.desc={buffer:o.object({buffer:o.string()}),func:o.object({function:o.function().required(),options:{literal:!0}}),override:o.object({override:!0}),ref:o.object({ref:o.object({type:o.valid("value","global","local"),path:o.array().required(),separator:o.string().length(1).allow(!1),ancestor:o.number().min(0).integer().allow("root"),map:o.array().items(o.array().length(2)).min(1),adjust:o.function(),iterables:o.boolean(),in:o.boolean(),render:o.boolean()}).required()}),regex:o.object({regex:o.string().min(3)}),special:o.object({special:o.valid("deep").required()}),template:o.object({template:o.string().required(),options:o.object()}),value:o.object({value:o.alternatives([o.object(),o.array()]).required()})},c.desc.entity=o.alternatives([o.array().items(o.link("...")),o.boolean(),o.function(),o.number(),o.string(),c.desc.buffer,c.desc.func,c.desc.ref,c.desc.regex,c.desc.special,c.desc.template,c.desc.value,o.link("/")]),c.desc.values=o.array().items(null,o.boolean(),o.function(),o.number().allow(1/0,-1/0),o.string().allow(""),o.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=o.object().pattern(/.+/,[o.string(),c.desc.template,o.object().pattern(/.+/,[o.string(),c.desc.template])]),i.description=o.object({type:o.string().required(),flags:o.object({cast:o.string(),default:o.any(),description:o.string(),empty:o.link("/"),failover:c.desc.entity,id:o.string(),label:o.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:o.boolean(),unit:o.string()}).unknown(),preferences:{allowUnknown:o.boolean(),abortEarly:o.boolean(),artifacts:o.boolean(),cache:o.boolean(),convert:o.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:o.boolean(),label:["path","key"],language:[o.string(),c.desc.ref],wrap:{label:c.wrap,array:c.wrap}},externals:o.boolean(),messages:c.desc.messages,noDefaults:o.boolean(),nonEnumerables:o.boolean(),presence:["required","optional","forbidden"],skipFunctions:o.boolean(),stripUnknown:o.object({arrays:o.boolean(),objects:o.boolean()}).or("arrays","objects").allow(!0,!1),warnings:o.boolean()},allow:c.desc.values,invalid:c.desc.values,rules:o.array().min(1).items({name:o.string().required(),args:o.object().min(1),keep:o.boolean(),message:[o.string(),c.desc.messages],warn:o.boolean()}),keys:o.object().pattern(/.*/,o.link("/")),link:c.desc.ref}).pattern(/^[a-z]\w*$/,o.any())},493:(s,i,a)=>{const o=a(8571),c=a(9621),u=a(8160),f={value:Symbol("value")};s.exports=f.State=class{constructor(l,d,m){this.path=l,this.ancestors=d,this.mainstay=m.mainstay,this.schemas=m.schemas,this.debug=null}localize(l,d=null,m=null){const p=new f.State(l,d,this);return m&&p.schemas&&(p.schemas=[f.schemas(m),...p.schemas]),p}nest(l,d){const m=new f.State(this.path,this.ancestors,this);return m.schemas=m.schemas&&[f.schemas(l),...m.schemas],m.debug=d,m}shadow(l,d){this.mainstay.shadow=this.mainstay.shadow||new f.Shadow,this.mainstay.shadow.set(this.path,l,d)}snapshot(){this.mainstay.shadow&&(this._snapshot=o(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 u.isSchema(l)?{schema:l}:l},f.Shadow=class{constructor(){this._values=null}set(l,d,m){if(!l.length||m==="strip"&&typeof l[l.length-1]=="number")return;this._values=this._values||new Map;let p=this._values;for(let h=0;h{const o=a(375),c=a(8571),u=a(5277),f=a(1447),l=a(8160),d=a(6354),m=a(6133),p={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=p.Template=class{constructor(h,y){if(o(typeof h=="string","Template source must be a string"),o(!h.includes("\0")&&!h.includes(""),"Template source cannot contain reserved control characters"),this.source=h,this.rendered=h,this._template=null,y){const{functions:g,...v}=y;this._settings=Object.keys(v).length?c(v):void 0,this._functions=g,this._functions&&(o(Object.keys(this._functions).every(w=>typeof w=="string"),"Functions keys must be strings"),o(Object.values(this._functions).every(w=>typeof w=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const h=p.encode(this.source),y=p.split(h);let g=!1;const v=[],w=y.shift();w&&v.push(w);for(const x of y){const A=x[0]!=="{",T=A?"}":"}}",R=x.indexOf(T);if(R===-1||x[1]==="{"){v.push(`{${p.decode(x)}`);continue}let E=x.slice(A?0:1,R);const k=E[0]===":";k&&(E=E.slice(1));const N=this._ref(p.decode(E),{raw:A,wrapped:k});v.push(N),typeof N!="string"&&(g=!0);const O=x.slice(R+T.length);O&&v.push(p.decode(O))}g?this._template=v:this.rendered=v.join("")}static date(h,y){return p.dateFormat[y.dateFormat].call(h)}describe(h={}){if(!this._settings&&h.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(h){return new p.Template(h.template,h.options||h.functions?{...h.options,functions:h.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(h){return!!h&&!!h[l.symbols.template]}refs(){if(!this._template)return;const h=[];for(const y of this._template)typeof y!="string"&&h.push(...y.refs);return h}resolve(h,y,g,v){return this._template&&this._template.length===1?this._part(this._template[0],h,y,g,v,{}):this.render(h,y,g,v)}_part(h,...y){return h.ref?h.ref.resolve(...y):h.formula.evaluate(y)}render(h,y,g,v,w={}){if(!this.isDynamic())return this.rendered;const x=[];for(const A of this._template)if(typeof A=="string")x.push(A);else{const T=this._part(A,h,y,g,v,w),R=p.stringify(T,h,y,g,v,w);if(R!==void 0){const E=A.raw||(w.errors&&w.errors.escapeHtml)===!1?R:u(R);x.push(p.wrap(E,A.wrapped&&g.errors.wrap.label))}}return x.join("")}_ref(h,{raw:y,wrapped:g}){const v=[],w=A=>{const T=m.create(A,this._settings);return v.push(T),R=>{const E=T.resolve(...R);return E!==void 0?E:null}};try{const A=this._functions?{...p.functions,...this._functions}:p.functions;var x=new f.Parser(h,{reference:w,functions:A,constants:p.constants})}catch(A){throw A.message=`Invalid template variable "${h}" fails due to: ${A.message}`,A}if(x.single){if(x.single.type==="reference"){const A=v[0];return{ref:A,raw:y,refs:v,wrapped:g||A.type==="local"&&A.key==="label"}}return p.stringify(x.single.value)}return{formula:x,raw:y,refs:v}}toString(){return this.source}},p.Template.prototype[l.symbols.template]=!0,p.Template.prototype.isImmutable=!0,p.encode=function(h){return h.replace(/\\(\{+)/g,(y,g)=>p.opens.slice(0,g.length)).replace(/\\(\}+)/g,(y,g)=>p.closes.slice(0,g.length))},p.decode=function(h){return h.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},p.split=function(h){const y=[];let g="";for(let v=0;v ${O.toString()}`);h=k}if(!Array.isArray(h))return h.toString();const E=[];for(const k of h)E.push(p.stringify(k,y,g,v,w,{arrayItems:!0,...x}));return p.wrap(E.join(", "),!R&&T.array)},p.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},p.functions={if:(h,y,g)=>h?y:g,length:h=>typeof h=="string"?h.length:h&&typeof h=="object"?Array.isArray(h)?h.length:Object.keys(h).length:null,msg(h){const[y,g,v,w,x]=this,A=x.messages;if(!A)return"";const T=d.template(y,A[0],h,g,v)||d.template(y,A[1],h,g,v);return T?T.render(y,g,v,w,x):""},number:h=>typeof h=="number"?h:typeof h=="string"?parseFloat(h):typeof h=="boolean"?h?1:0:h instanceof Date?h.getTime():null}},4946:(s,i,a)=>{const o=a(375),c=a(1687),u=a(8068),f=a(8160),l=a(3292),d=a(6354),m=a(6133),p={};s.exports=u.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:m.toSibling}},args:(h,...y)=>y.length===1&&Array.isArray(y[0])?h.try(...y[0]):h.try(...y),validate(h,y){const{schema:g,error:v,state:w,prefs:x}=y;if(g._flags.match){const T=[],R=[];for(let k=0;kd.details(k,{override:!1}))})};if(g._flags.match==="one")return T.length===1?{value:T[0]}:{errors:v("alternatives.one")};if(T.length!==g.$_terms.matches.length)return{errors:v("alternatives.all",{details:R.map(k=>d.details(k,{override:!1}))})};const E=k=>k.$_terms.matches.some(N=>N.schema.type==="object"||N.schema.type==="alternatives"&&E(N.schema));return E(g)?{value:T.reduce((k,N)=>c(k,N,{mergeArrays:!1}))}:{value:T[T.length-1]}}const A=[];for(let T=0;Tg.path[0]!=="is"&&typeof y._flags.label!="string"?y.label(h):void 0,ref:!1})}},rebuild(h){h.$_modify({each:y=>{f.isSchema(y)&&y.type==="array"&&h.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(h,y){if(y.matches)for(const g of y.matches){const{schema:v,ref:w,is:x,not:A,then:T,otherwise:R}=g;h=v?h.try(v):w?h.conditional(w,{is:x,then:T,not:A,otherwise:R,switch:g.switch}):h.conditional(x,{then:T,otherwise:R})}return h}},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}}"}}),p.errors=function(h,{error:y,state:g}){if(!h.length)return{errors:y("alternatives.any")};if(h.length===1)return{errors:h[0].reports};const v=new Set,w=[];for(const{reports:x,schema:A}of h){if(x.length>1)return p.unmatched(h,y);const T=x[0];if(T instanceof d.Report==0)return p.unmatched(h,y);if(T.state.path.length!==g.path.length){w.push({type:A.type,report:T});continue}if(T.code==="any.only"){for(const k of T.local.valids)v.add(k);continue}const[R,E]=T.code.split(".");E!=="base"?w.push({type:A.type,report:T}):T.code==="object.base"?v.add(T.local.type):v.add(R)}return w.length?w.length===1?{errors:w[0].report}:p.unmatched(h,y):{errors:y("alternatives.types",{types:[...v]})}},p.unmatched=function(h,y){const g=[];for(const v of h)g.push(...v.reports);return{errors:y("alternatives.match",d.details(g,{override:!1}))}}},8068:(s,i,a)=>{const o=a(375),c=a(7629),u=a(8160),f=a(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,d){return o(typeof l=="function","Method must be a function"),o(d===void 0||d&&typeof d=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:l,description:d}})},validate(l,d,{method:m}){try{return m(l,d)}catch(p){return d.error("any.custom",{error:p})}},args:["method","description"],multi:!0},messages:{method(l){return this.prefs({messages:l})}},shared:{method(l){o(u.isSchema(l)&&l._flags.id,"Schema must be a schema with an id");const d=this.clone();return d.$_terms.shared=d.$_terms.shared||[],d.$_terms.shared.push(l),d.$_mutateRegister(l),d}},warning:{method(l,d){return o(l&&typeof l=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:l,local:d},warn:!0})},validate:(l,d,{code:m,local:p})=>d.error(m,p),args:["code","local"],multi:!0}},modifiers:{keep(l,d=!0){l.keep=d},message(l,d){l.message=f.compile(d)},warn(l,d=!0){l.warn=d}},manifest:{build(l,d){for(const m in d){const p=d[m];if(["examples","externals","metas","notes","tags"].includes(m))for(const h of p)l=l[m.slice(0,-1)](h);else if(m!=="alterations")if(m!=="whens"){if(m==="shared")for(const h of p)l=l.shared(h)}else for(const h of p){const{ref:y,is:g,not:v,then:w,otherwise:x,concat:A}=h;l=A?l.concat(A):y?l.when(y,{is:g,not:v,then:w,otherwise:x,switch:h.switch,break:h.break}):l.when(g,{then:w,otherwise:x,break:h.break})}else{const h={};for(const{target:y,adjuster:g}of p)h[y]=g;l=l.alter(h)}}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,a)=>{const o=a(375),c=a(9474),u=a(9621),f=a(8068),l=a(8160),d=a(3292),m={};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(p,{schema:h,state:y,prefs:g}){if(!Array.isArray(p))return;const v=h.$_getRule("sort");return v?m.sort(h,p,v.args.options,y,g):void 0}},validate(p,{schema:h,error:y}){if(!Array.isArray(p)){if(h._flags.single){const g=[p];return g[l.symbols.arraySingle]=!0,{value:g}}return{errors:y("array.base")}}if(h.$_getRule("items")||h.$_terms.externals)return{value:p.slice()}},rules:{has:{method(p){p=this.$_compile(p,{appendPath:!0});const h=this.$_addRule({name:"has",args:{schema:p}});return h.$_mutateRegister(p),h},validate(p,{state:h,prefs:y,error:g},{schema:v}){const w=[p,...h.ancestors];for(let A=0;Athis.$_compile(p[y]),y,{append:!0});h.$_terms.items.push(g)}return h.$_mutateRebuild()},validate(p,{schema:h,error:y,state:g,prefs:v,errorsArray:w}){const x=h.$_terms._requireds.slice(),A=h.$_terms.ordered.slice(),T=[...h.$_terms._inclusions,...x],R=!p[l.symbols.arraySingle];delete p[l.symbols.arraySingle];const E=w();let k=p.length;for(let N=0;N="})}},ordered:{method(...p){l.verifyFlat(p,"ordered");const h=this.$_addRule("items");for(let y=0;ythis.$_compile(p[y]),y,{append:!0});m.validateSingle(g,h),h.$_mutateRegister(g),h.$_terms.ordered.push(g)}return h.$_mutateRebuild()}},single:{method(p){const h=p===void 0||!!p;return o(!h||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",h)}},sort:{method(p={}){l.assertOptions(p,["by","order"]);const h={order:p.order||"ascending"};return p.by&&(h.by=d.ref(p.by,{ancestor:0}),o(!h.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:h}})},validate(p,{error:h,state:y,prefs:g,schema:v},{options:w}){const{value:x,errors:A}=m.sort(v,p,w,y,g);if(A)return A;for(let T=0;Tnew Set(p)}},rebuild(p){p.$_terms._inclusions=[],p.$_terms._exclusions=[],p.$_terms._requireds=[];for(const h of p.$_terms.items)m.validateSingle(h,p),h._flags.presence==="required"?p.$_terms._requireds.push(h):h._flags.presence==="forbidden"?p.$_terms._exclusions.push(h):p.$_terms._inclusions.push(h);for(const h of p.$_terms.ordered)m.validateSingle(h,p)},manifest:{build:(p,h)=>(h.items&&(p=p.items(...h.items)),h.ordered&&(p=p.ordered(...h.ordered)),p)},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"}}),m.fillMissedErrors=function(p,h,y,g,v,w){const x=[];let A=0;for(const T of y){const R=T._flags.label;R?x.push(R):++A}x.length?A?h.push(p.$_createError("array.includesRequiredBoth",g,{knownMisses:x,unknownMisses:A},v,w)):h.push(p.$_createError("array.includesRequiredKnowns",g,{knownMisses:x},v,w)):h.push(p.$_createError("array.includesRequiredUnknowns",g,{unknownMisses:A},v,w))},m.fillOrderedErrors=function(p,h,y,g,v,w){const x=[];for(const A of y)A._flags.presence==="required"&&x.push(A);x.length&&m.fillMissedErrors(p,h,x,g,v,w)},m.fillDefault=function(p,h,y,g){const v=[];let w=!0;for(let x=p.length-1;x>=0;--x){const A=p[x],T=[h,...y.ancestors],R=A.$_validate(void 0,y.localize(y.path,T,A),g).value;if(w){if(R===void 0)continue;w=!1}v.unshift(R)}v.length&&h.push(...v)},m.fastSplice=function(p,h){let y=h;for(;y{let k=m.compare(R,E,x,A);if(k!==null||(y.by&&(R=y.by.resolve(R,g,v),E=y.by.resolve(E,g,v)),k=m.compare(R,E,x,A),k!==null))return k;const N=typeof R;if(N!==typeof E)throw p.$_createError("array.sort.mismatching",h,null,g,v);if(N!=="number"&&N!=="string")throw p.$_createError("array.sort.unsupported",h,{type:N},g,v);return N==="number"?(R-E)*w:R{const o=a(375),c=a(8068),u=a(8160),f=a(2036),l={isBool:function(d){return typeof d=="boolean"}};s.exports=c.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(d,{schema:m}){if(typeof d!="boolean"){if(typeof d=="string"){const p=m._flags.sensitive?d:d.toLowerCase();d=p==="true"||p!=="false"&&d}return typeof d!="boolean"&&(d=m.$_terms.truthy&&m.$_terms.truthy.has(d,null,null,!m._flags.sensitive)||(!m.$_terms.falsy||!m.$_terms.falsy.has(d,null,null,!m._flags.sensitive))&&d),{value:d}}},validate(d,{error:m}){if(typeof d!="boolean")return{value:d,errors:m("boolean.base")}},rules:{truthy:{method(...d){u.verifyFlat(d,"truthy");const m=this.clone();m.$_terms.truthy=m.$_terms.truthy||new f;for(let p=0;pd?1:0},string:{from:l.isBool,to:(d,m)=>d?"true":"false"}},manifest:{build:(d,m)=>(m.truthy&&(d=d.truthy(...m.truthy)),m.falsy&&(d=d.falsy(...m.falsy)),d)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(s,i,a)=>{const o=a(375),c=a(8068),u=a(8160),f=a(3328),l={isDate:function(d){return d instanceof Date}};s.exports=c.extend({type:"date",coerce:{from:["number","string"],method:(d,{schema:m})=>({value:l.parse(d,m._flags.format)||d})},validate(d,{schema:m,error:p,prefs:h}){if(d instanceof Date&&!isNaN(d.getTime()))return;const y=m._flags.format;return h.convert&&y&&typeof d=="string"?{value:d,errors:p("date.format",{format:y})}:{value:d,errors:p("date.base")}},rules:{compare:{method:!1,validate(d,m,{date:p},{name:h,operator:y,args:g}){const v=p==="now"?Date.now():p.getTime();return u.compare(d.getTime(),v,y)?d:m.error("date."+h,{limit:g.date,value:d})},args:[{name:"date",ref:!0,normalize:d=>d==="now"?d:l.parse(d),assert:d=>d!==null,message:"must have a valid date format"}]},format:{method(d){return o(["iso","javascript","unix"].includes(d),"Unknown date format",d),this.$_setFlag("format",d)}},greater:{method(d){return this.$_addRule({name:"greater",method:"compare",args:{date:d},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(d){return this.$_addRule({name:"less",method:"compare",args:{date:d},operator:"<"})}},max:{method(d){return this.$_addRule({name:"max",method:"compare",args:{date:d},operator:"<="})}},min:{method(d){return this.$_addRule({name:"min",method:"compare",args:{date:d},operator:">="})}},timestamp:{method(d="javascript"){return o(["javascript","unix"].includes(d),'"type" must be one of "javascript, unix"'),this.format(d)}}},cast:{number:{from:l.isDate,to:(d,m)=>d.getTime()},string:{from:l.isDate,to:(d,{prefs:m})=>f.date(d,m)}},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(d,m){if(d instanceof Date)return d;if(typeof d!="string"&&(isNaN(d)||!isFinite(d))||/^\s*$/.test(d))return null;if(m==="iso")return u.isIsoDate(d)?l.date(d.toString()):null;const p=d;if(typeof d=="string"&&/^[+-]?\d+(\.\d+)?$/.test(d)&&(d=parseFloat(d)),m){if(m==="javascript")return l.date(1*d);if(m==="unix")return l.date(1e3*d);if(typeof p=="string")return null}return l.date(d)},l.date=function(d){const m=new Date(d);return isNaN(m.getTime())?null:m}},390:(s,i,a)=>{const o=a(375),c=a(7824);s.exports=c.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(u){return o(Number.isSafeInteger(u)&&u>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:u}})},validate:(u,f,{n:l})=>u.length===l?u:f.error("function.arity",{n:l})},class:{method(){return this.$_addRule("class")},validate:(u,f)=>/^\s*class\s/.test(u.toString())?u:f.error("function.class",{value:u})},minArity:{method(u){return o(Number.isSafeInteger(u)&&u>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:u}})},validate:(u,f,{n:l})=>u.length>=l?u:f.error("function.minArity",{n:l})},maxArity:{method(u){return o(Number.isSafeInteger(u)&&u>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:u}})},validate:(u,f,{n:l})=>u.length<=l?u: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,a)=>{const o=a(978),c=a(375),u=a(8571),f=a(3652),l=a(8068),d=a(8160),m=a(3292),p=a(6354),h=a(6133),y=a(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,w)=>v.keys(w),validate(v,{schema:w,error:x,state:A,prefs:T}){if(!v||typeof v!==w.$_property("typeof")||Array.isArray(v))return{value:v,errors:x("object.base",{type:w.$_property("typeof")})};if(!(w.$_terms.renames||w.$_terms.dependencies||w.$_terms.keys||w.$_terms.patterns||w.$_terms.externals))return;v=g.clone(v,T);const R=[];if(w.$_terms.renames&&!g.rename(w,v,A,T,R))return{value:v,errors:R};if(!w.$_terms.keys&&!w.$_terms.patterns&&!w.$_terms.dependencies)return{value:v,errors:R};const E=new Set(Object.keys(v));if(w.$_terms.keys){const k=[v,...A.ancestors];for(const N of w.$_terms.keys){const O=N.key,L=v[O];E.delete(O);const I=A.localize([...A.path,O],k,N),F=N.schema.$_validate(L,I,T);if(F.errors){if(T.abortEarly)return{value:v,errors:F.errors};F.value!==void 0&&(v[O]=F.value),R.push(...F.errors)}else N.schema._flags.result==="strip"||F.value===void 0&&L!==void 0?delete v[O]:F.value!==void 0&&(v[O]=F.value)}}if(E.size||w._flags._hasPatternMatch){const k=g.unknown(w,v,E,R,A,T);if(k)return k}if(w.$_terms.dependencies)for(const k of w.$_terms.dependencies){if(k.key!==null&&g.isPresent(k.options)(k.key.resolve(v,A,T,null,{shadow:!1}))===!1)continue;const N=g.dependencies[k.rel](w,k,v,A,T);if(N){const O=w.$_createError(N.code,v,N.context,A,T);if(T.abortEarly)return{value:v,errors:O};R.push(O)}}return{value:v,errors:R}},rules:{and:{method(...v){return d.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,w,x){y.isTemplate(v)||(v=m.ref(v)),c(x===void 0||typeof x=="string","Message must be a string"),w=this.$_compile(w,{appendPath:!0});const A=this.$_addRule({name:"assert",args:{subject:v,schema:w,message:x}});return A.$_mutateRegister(v),A.$_mutateRegister(w),A},validate(v,{error:w,prefs:x,state:A},{subject:T,schema:R,message:E}){const k=T.resolve(v,A,x),N=h.isRef(T)?T.absolute(A):[];return R.$_match(k,A.localize(N,[v,...A.ancestors],R),x)?v:w("object.assert",{subject:T,message:E})},args:["subject","schema","message"],multi:!0},instance:{method(v,w){return c(typeof v=="function","constructor must be a function"),w=w||v.name,this.$_addRule({name:"instance",args:{constructor:v,name:w}})},validate:(v,w,{constructor:x,name:A})=>v instanceof x?v:w.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(!d.isSchema(v),"Object schema cannot be a joi schema");const w=this.clone();if(v)if(Object.keys(v).length){w.$_terms.keys=w.$_terms.keys?w.$_terms.keys.filter(x=>!v.hasOwnProperty(x.key)):new g.Keys;for(const x in v)d.tryWithPath(()=>w.$_terms.keys.push({key:x,schema:this.$_compile(v[x])}),x)}else w.$_terms.keys=new g.Keys;else w.$_terms.keys=null;return w.$_mutateRebuild()}},length:{method(v){return this.$_addRule({name:"length",args:{limit:v},operator:"="})},validate:(v,w,{limit:x},{name:A,operator:T,args:R})=>d.compare(Object.keys(v).length,x,T)?v:w.error("object."+A,{limit:R.limit,value:v}),args:[{name:"limit",ref:!0,assert:d.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 d.verifyFlat(v,"nand"),g.dependency(this,"nand",null,v)}},or:{method(...v){return d.verifyFlat(v,"or"),g.dependency(this,"or",null,v)}},oxor:{method(...v){return g.dependency(this,"oxor",null,v)}},pattern:{method(v,w,x={}){const A=v instanceof RegExp;A||(v=this.$_compile(v,{appendPath:!0})),c(w!==void 0,"Invalid rule"),d.assertOptions(x,["fallthrough","matches"]),A&&c(!v.flags.includes("g")&&!v.flags.includes("y"),"pattern should not use global or sticky mode"),w=this.$_compile(w,{appendPath:!0});const T=this.clone();T.$_terms.patterns=T.$_terms.patterns||[];const R={[A?"regex":"schema"]:v,rule:w};return x.matches&&(R.matches=this.$_compile(x.matches),R.matches.type!=="array"&&(R.matches=R.matches.$_root.array().items(R.matches)),T.$_mutateRegister(R.matches),T.$_setFlag("_hasPatternMatch",!0,{clone:!1})),x.fallthrough&&(R.fallthrough=!0),T.$_terms.patterns.push(R),T.$_mutateRegister(w),T}},ref:{method(){return this.$_addRule("ref")},validate:(v,w)=>h.isRef(v)?v:w.error("object.refType",{value:v})},regex:{method(){return this.$_addRule("regex")},validate:(v,w)=>v instanceof RegExp?v:w.error("object.regex",{value:v})},rename:{method(v,w,x={}){c(typeof v=="string"||v instanceof RegExp,"Rename missing the from argument"),c(typeof w=="string"||w instanceof y,"Invalid rename to argument"),c(w!==v,"Cannot rename key to same name:",v),d.assertOptions(x,["alias","ignoreUndefined","override","multiple"]);const A=this.clone();A.$_terms.renames=A.$_terms.renames||[];for(const T of A.$_terms.renames)c(T.from!==v,"Cannot rename the same key multiple times");return w instanceof y&&A.$_mutateRegister(w),A.$_terms.renames.push({from:v,to:w,options:o(g.renameDefaults,x)}),A}},schema:{method(v="any"){return this.$_addRule({name:"schema",args:{type:v}})},validate:(v,w,{type:x})=>!d.isSchema(v)||x!=="any"&&v.type!==x?w.error("object.schema",{type:x}):v},unknown:{method(v){return this.$_setFlag("unknown",v!==!1)}},with:{method(v,w,x={}){return g.dependency(this,"with",v,w,x)}},without:{method(v,w,x={}){return g.dependency(this,"without",v,w,x)}},xor:{method(...v){return d.verifyFlat(v,"xor"),g.dependency(this,"xor",null,v)}}},overrides:{default(v,w){return v===void 0&&(v=d.symbols.deepDefault),this.$_parent("default",v,w)}},rebuild(v){if(v.$_terms.keys){const w=new f.Sorter;for(const x of v.$_terms.keys)d.tryWithPath(()=>w.add(x,{after:x.schema.$_rootReferences(),group:x.key}),x.key);v.$_terms.keys=new g.Keys(...w.nodes)}},manifest:{build(v,w){if(w.keys&&(v=v.keys(w.keys)),w.dependencies)for(const{rel:x,key:A=null,peers:T,options:R}of w.dependencies)v=g.dependency(v,x,A,T,R);if(w.patterns)for(const{regex:x,schema:A,rule:T,fallthrough:R,matches:E}of w.patterns)v=v.pattern(x||A,T,{fallthrough:R,matches:E});if(w.renames)for(const{from:x,to:A,options:T}of w.renames)v=v.rename(x,A,T);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,w){if(typeof v=="object"){if(w.nonEnumerables)return u(v,{shallow:!0});const A=Object.create(Object.getPrototypeOf(v));return Object.assign(A,v),A}const x=function(...A){return v.apply(this,A)};return x.prototype=u(v.prototype),Object.defineProperty(x,"name",{value:v.name,writable:!1}),Object.defineProperty(x,"length",{value:v.length,writable:!1}),Object.assign(x,v),x},g.dependency=function(v,w,x,A,T){c(x===null||typeof x=="string",w,"key must be a strings"),T||(T=A.length>1&&typeof A[A.length-1]=="object"?A.pop():{}),d.assertOptions(T,["separator","isPresent"]),A=[].concat(A);const R=d.default(T.separator,"."),E=[];for(const N of A)c(typeof N=="string",w,"peers must be strings"),E.push(m.ref(N,{separator:R,ancestor:0,prefix:!1}));x!==null&&(x=m.ref(x,{separator:R,ancestor:0,prefix:!1}));const k=v.clone();return k.$_terms.dependencies=k.$_terms.dependencies||[],k.$_terms.dependencies.push(new g.Dependency(w,x,E,A,T)),k},g.dependencies={and(v,w,x,A,T){const R=[],E=[],k=w.peers.length,N=g.isPresent(w.options);for(const O of w.peers)N(O.resolve(x,A,T,null,{shadow:!1}))===!1?R.push(O.key):E.push(O.key);if(R.length!==k&&E.length!==k)return{code:"object.and",context:{present:E,presentWithLabels:g.keysToLabels(v,E),missing:R,missingWithLabels:g.keysToLabels(v,R)}}},nand(v,w,x,A,T){const R=[],E=g.isPresent(w.options);for(const O of w.peers)E(O.resolve(x,A,T,null,{shadow:!1}))&&R.push(O.key);if(R.length!==w.peers.length)return;const k=w.paths[0],N=w.paths.slice(1);return{code:"object.nand",context:{main:k,mainWithLabel:g.keysToLabels(v,k),peers:N,peersWithLabels:g.keysToLabels(v,N)}}},or(v,w,x,A,T){const R=g.isPresent(w.options);for(const E of w.peers)if(R(E.resolve(x,A,T,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:w.paths,peersWithLabels:g.keysToLabels(v,w.paths)}}},oxor(v,w,x,A,T){const R=[],E=g.isPresent(w.options);for(const N of w.peers)E(N.resolve(x,A,T,null,{shadow:!1}))&&R.push(N.key);if(!R.length||R.length===1)return;const k={peers:w.paths,peersWithLabels:g.keysToLabels(v,w.paths)};return k.present=R,k.presentWithLabels=g.keysToLabels(v,R),{code:"object.oxor",context:k}},with(v,w,x,A,T){const R=g.isPresent(w.options);for(const E of w.peers)if(R(E.resolve(x,A,T,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:w.key.key,mainWithLabel:g.keysToLabels(v,w.key.key),peer:E.key,peerWithLabel:g.keysToLabels(v,E.key)}}},without(v,w,x,A,T){const R=g.isPresent(w.options);for(const E of w.peers)if(R(E.resolve(x,A,T,null,{shadow:!1})))return{code:"object.without",context:{main:w.key.key,mainWithLabel:g.keysToLabels(v,w.key.key),peer:E.key,peerWithLabel:g.keysToLabels(v,E.key)}}},xor(v,w,x,A,T){const R=[],E=g.isPresent(w.options);for(const N of w.peers)E(N.resolve(x,A,T,null,{shadow:!1}))&&R.push(N.key);if(R.length===1)return;const k={peers:w.paths,peersWithLabels:g.keysToLabels(v,w.paths)};return R.length===0?{code:"object.missing",context:k}:(k.present=R,k.presentWithLabels=g.keysToLabels(v,R),{code:"object.xor",context:k})}},g.keysToLabels=function(v,w){return Array.isArray(w)?w.map(x=>v.$_mapLabels(x)):v.$_mapLabels(w)},g.isPresent=function(v){return typeof v.isPresent=="function"?v.isPresent:w=>w!==void 0},g.rename=function(v,w,x,A,T){const R={};for(const E of v.$_terms.renames){const k=[],N=typeof E.from!="string";if(N)for(const O in w){if(w[O]===void 0&&E.options.ignoreUndefined||O===E.to)continue;const L=E.from.exec(O);L&&k.push({from:O,to:E.to,match:L})}else!Object.prototype.hasOwnProperty.call(w,E.from)||w[E.from]===void 0&&E.options.ignoreUndefined||k.push(E);for(const O of k){const L=O.from;let I=O.to;if(I instanceof y&&(I=I.render(w,x,A,O.match)),L!==I){if(!E.options.multiple&&R[I]&&(T.push(v.$_createError("object.rename.multiple",w,{from:L,to:I,pattern:N},x,A)),A.abortEarly)||Object.prototype.hasOwnProperty.call(w,I)&&!E.options.override&&!R[I]&&(T.push(v.$_createError("object.rename.override",w,{from:L,to:I,pattern:N},x,A)),A.abortEarly))return!1;w[L]===void 0?delete w[I]:w[I]=w[L],R[I]=!0,E.options.alias||delete w[L]}}}return!0},g.unknown=function(v,w,x,A,T,R){if(v.$_terms.patterns){let E=!1;const k=v.$_terms.patterns.map(O=>{if(O.matches)return E=!0,[]}),N=[w,...T.ancestors];for(const O of x){const L=w[O],I=[...T.path,O];for(let F=0;F{const o=a(375),c=a(8068),u=a(8160),f=a(3292),l=a(6354),d={};s.exports=c.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(m,p)=>m.ref(p),validate(m,{schema:p,state:h,prefs:y}){o(p.$_terms.link,"Uninitialized link schema");const g=d.generate(p,m,h,y),v=p.$_terms.link[0].ref;return g.$_validate(m,h.nest(g,`link:${v.display}:${g.type}`),y)},generate:(m,p,h,y)=>d.generate(m,p,h,y),rules:{ref:{method(m){o(!this.$_terms.link,"Cannot reinitialize schema"),m=f.ref(m),o(m.type==="value"||m.type==="local","Invalid reference type:",m.type),o(m.type==="local"||m.ancestor==="root"||m.ancestor>0,"Link cannot reference itself");const p=this.clone();return p.$_terms.link=[{ref:m}],p}},relative:{method(m=!0){return this.$_setFlag("relative",m)}}},overrides:{concat(m){o(this.$_terms.link,"Uninitialized link schema"),o(u.isSchema(m),"Invalid schema object"),o(m.type!=="link","Cannot merge type link with another link");const p=this.clone();return p.$_terms.whens||(p.$_terms.whens=[]),p.$_terms.whens.push({concat:m}),p.$_mutateRebuild()}},manifest:{build:(m,p)=>(o(p.link,"Invalid link description missing link"),m.ref(p.link))}}),d.generate=function(m,p,h,y){let g=h.mainstay.links.get(m);if(g)return g._generate(p,h,y).schema;const v=m.$_terms.link[0].ref,{perspective:w,path:x}=d.perspective(v,h);d.assert(w,"which is outside of schema boundaries",v,m,h,y);try{g=x.length?w.$_reach(x):w}catch{d.assert(!1,"to non-existing schema",v,m,h,y)}return d.assert(g.type!=="link","which is another link",v,m,h,y),m._flags.relative||h.mainstay.links.set(m,g),g._generate(p,h,y).schema},d.perspective=function(m,p){if(m.type==="local"){for(const{schema:h,key:y}of p.schemas){if((h._flags.id||y)===m.path[0])return{perspective:h,path:m.path.slice(1)};if(h.$_terms.shared){for(const g of h.$_terms.shared)if(g._flags.id===m.path[0])return{perspective:g,path:m.path.slice(1)}}}return{perspective:null,path:null}}return m.ancestor==="root"?{perspective:p.schemas[p.schemas.length-1].schema,path:m.path}:{perspective:p.schemas[m.ancestor]&&p.schemas[m.ancestor].schema,path:m.path}},d.assert=function(m,p,h,y,g,v){m||o(!1,`"${l.label(y._flags,g,v)}" contains link reference "${h.display}" ${p}`)}},3832:(s,i,a)=>{const o=a(375),c=a(8068),u=a(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 d=l.toString(),m=d.indexOf("."),p=d.indexOf("e");return(m<0?0:(p<0?d.length:p)-m-1)+(p<0?0:Math.max(0,-parseInt(d.slice(p+1))))}};s.exports=c.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(l,{schema:d,error:m}){if(!l.match(f.numberRx))return;l=l.trim();const p={value:parseFloat(l)};if(p.value===0&&(p.value=0),!d._flags.unsafe)if(l.match(/e/i)){if(f.extractSignificantDigits(l)!==f.extractSignificantDigits(String(p.value)))return p.errors=m("number.unsafe"),p}else{const h=p.value.toString();if(h.match(/e/i))return p;if(h!==f.normalizeDecimal(l))return p.errors=m("number.unsafe"),p}return p}},validate(l,{schema:d,error:m,prefs:p}){if(l===1/0||l===-1/0)return{value:l,errors:m("number.infinity")};if(!u.isNumber(l))return{value:l,errors:m("number.base")};const h={value:l};if(p.convert){const y=d.$_getRule("precision");if(y){const g=Math.pow(10,y.args.limit);h.value=Math.round(h.value*g)/g}}return h.value===0&&(h.value=0),!d._flags.unsafe&&(l>Number.MAX_SAFE_INTEGER||lu.compare(l,m,h)?l:d.error("number."+p,{limit:y.limit,value:l}),args:[{name:"limit",ref:!0,assert:u.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,d)=>Math.trunc(l)-l==0?l:d.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 d=typeof l=="number"?f.decimalPlaces(l):null,m=Math.pow(10,d);return this.$_addRule({name:"multiple",args:{base:l,baseDecimalPlace:d,pfactor:m}})},validate:(l,d,{base:m,baseDecimalPlace:p,pfactor:h},y)=>f.decimalPlaces(l)>p?d.error("number.multiple",{multiple:y.args.base,value:l}):Math.round(h*l)%Math.round(h*m)==0?l:d.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,d)=>Number.isSafeInteger(l)&&l>=0&&l<=65535?l:d.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(l){return o(Number.isSafeInteger(l),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:l}})},validate(l,d,{limit:m}){const p=l.toString().match(f.precisionRx);return Math.max((p[1]?p[1].length:0)-(p[2]?parseInt(p[2],10):0),0)<=m?l:d.error("number.precision",{limit:m,value:l})},convert:!0},sign:{method(l){return o(["negative","positive"].includes(l),"Invalid sign",l),this.$_addRule({name:"sign",args:{sign:l}})},validate:(l,d,{sign:m})=>m==="negative"&&l<0||m==="positive"&&l>0?l:d.error(`number.${m}`)},unsafe:{method(l=!0){return o(typeof l=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",l)}}},cast:{string:{from:l=>typeof l=="number",to:(l,d)=>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,a)=>{const o=a(7824);s.exports=o.extend({type:"object",cast:{map:{from:c=>c&&typeof c=="object",to:(c,u)=>new Map(Object.entries(c))}}})},7417:(s,i,a)=>{const o=a(375),c=a(5380),u=a(1745),f=a(9959),l=a(6064),d=a(9926),m=a(5752),p=a(8068),h=a(8160),y={tlds:d instanceof Set&&{tlds:{allow:d,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=p.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(g,{schema:v,state:w,prefs:x}){const A=v.$_getRule("normalize");A&&(g=g.normalize(A.args.form));const T=v.$_getRule("case");T&&(g=T.args.direction==="upper"?g.toLocaleUpperCase():g.toLocaleLowerCase());const R=v.$_getRule("trim");if(R&&R.args.enabled&&(g=g.trim()),v.$_terms.replacements)for(const k of v.$_terms.replacements)g=g.replace(k.pattern,k.replacement);const E=v.$_getRule("hex");if(E&&E.args.options.byteAligned&&g.length%2!=0&&(g=`0${g}`),v.$_getRule("isoDate")){const k=y.isoDate(g);k&&(g=k)}if(v._flags.truncate){const k=v.$_getRule("max");if(k){let N=k.args.limit;if(h.isResolvable(N)&&(N=N.resolve(g,w,x),!h.limit(N)))return{value:g,errors:v.$_createError("any.ref",N,{ref:k.args.limit,arg:"limit",reason:"must be a positive integer"},w,x)};g=g.slice(0,N)}}return{value:g}}},validate(g,{schema:v,error:w}){if(typeof g!="string")return{value:g,errors:w("string.base")};if(g===""){const x=v.$_getRule("min");return x&&x.args.limit===0?void 0:{value:g,errors:w("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 h.assertOptions(g,["paddingRequired","urlSafe"]),g={urlSafe:!1,paddingRequired:!0,...g},o(typeof g.paddingRequired=="boolean","paddingRequired must be boolean"),o(typeof g.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:g}})},validate:(g,v,{options:w})=>y.base64Regex[w.paddingRequired][w.urlSafe].test(g)?g:v.error("string.base64")},case:{method(g){return o(["lower","upper"].includes(g),"Invalid case:",g),this.$_addRule({name:"case",args:{direction:g}})},validate:(g,v,{direction:w})=>w==="lower"&&g===g.toLocaleLowerCase()||w==="upper"&&g===g.toLocaleUpperCase()?g:v.error(`string.${w}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(g,v){let w=g.length,x=0,A=1;for(;w--;){const T=g.charAt(w)*A;x+=T-9*(T>9),A^=3}return x>0&&x%10==0?g:v.error("string.creditCard")}},dataUri:{method(g={}){return h.assertOptions(g,["paddingRequired"]),g={paddingRequired:!0,...g},o(typeof g.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:g}})},validate(g,v,{options:w}){const x=g.match(y.dataUriRegex);return x&&(!x[2]||x[2]!=="base64"||y.base64Regex[w.paddingRequired].false.test(x[3]))?g:v.error("string.dataUri")}},domain:{method(g){g&&h.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,w,{address:x})=>c.isValid(g,x)?g:v.error("string.domain")},email:{method(g={}){h.assertOptions(g,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),o(g.multiple===void 0||typeof g.multiple=="boolean","multiple option must be an boolean");const v=y.addressOptions(g),w=new RegExp(`\\s*[${g.separator?l(g.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:g},regex:w,address:v})},validate(g,v,{options:w},{regex:x,address:A}){const T=w.multiple?g.split(x):[g],R=[];for(const E of T)u.isValid(E,A)||R.push(E);return R.length?v.error("string.email",{value:g,invalids:R}):g}},guid:{alias:"uuid",method(g={}){h.assertOptions(g,["version","separator"]);let v="";if(g.version){const A=[].concat(g.version);o(A.length>=1,"version must have at least 1 valid version specified");const T=new Set;for(let R=0;R(w.prefix==="optional"?y.hexRegex.withOptionalPrefix:w.prefix===!0?y.hexRegex.withPrefix:y.hexRegex.withoutPrefix).test(g)?w.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={}){h.assertOptions(g,["cidr","version"]);const{cidr:v,versions:w,regex:x}=f.regex(g),A=g.version?w:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:v,version:A}},regex:x})},validate:(g,v,{options:w},{regex:x})=>x.test(g)?g:w.version?v.error("string.ipVersion",{value:g,cidr:w.cidr,version:w.version}):v.error("string.ip",{value:g,cidr:w.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:w,encoding:x},{name:A,operator:T,args:R}){const E=!x&&g.length;return h.compare(E,w,T)?g:v.error("string."+A,{limit:R.limit,value:g,encoding:x})},args:[{name:"limit",ref:!0,assert:h.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 o(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:w})=>g===g.normalize(w)?g:v("string.normalize",{value:g,form:w}),convert:!0},pattern:{alias:"regex",method(g,v={}){o(g instanceof RegExp,"regex must be a RegExp"),o(!g.flags.includes("g")&&!g.flags.includes("y"),"regex should not use global or sticky mode"),typeof v=="string"&&(v={name:v}),h.assertOptions(v,["invert","name"]);const w=["string.pattern",v.invert?".invert":"",v.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:g,options:v},errorCode:w})},validate:(g,v,{regex:w,options:x},{errorCode:A})=>w.test(g)^x.invert?g:v.error(A,{name:x.name,regex:w,value:g}),args:["regex","options"],multi:!0},replace:{method(g,v){typeof g=="string"&&(g=new RegExp(l(g),"g")),o(g instanceof RegExp,"pattern must be a RegExp"),o(typeof v=="string","replacement must be a String");const w=this.clone();return w.$_terms.replacements||(w.$_terms.replacements=[]),w.$_terms.replacements.push({pattern:g,replacement:v}),w}},token:{method(){return this.$_addRule("token")},validate:(g,v)=>/^\w+$/.test(g)?g:v.error("string.token")},trim:{method(g=!0){return o(typeof g=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:g}})},validate:(g,v,{enabled:w})=>w&&g!==g.trim()?v.error("string.trim"):g,convert:!0},truncate:{method(g=!0){return o(typeof g=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",g)}},uppercase:{method(){return this.case("upper")}},uri:{method(g={}){h.assertOptions(g,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),g.domain&&h.assertOptions(g.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:v,scheme:w}=m.regex(g),x=g.domain?y.addressOptions(g.domain):null;return this.$_addRule({name:"uri",args:{options:g},regex:v,domain:x,scheme:w})},validate(g,v,{options:w},{regex:x,domain:A,scheme:T}){if(["http:/","https:/"].includes(g))return v.error("string.uri");let R=x.exec(g);if(!R&&v.prefs.convert&&w.encodeUri){const E=encodeURI(g);R=x.exec(E),R&&(g=E)}if(R){const E=R[1]||R[2];return!A||w.allowRelative&&!E||c.isValid(E,A)?g:v.error("string.domain",{value:E})}return w.relativeOnly?v.error("string.uriRelativeOnly"):w.scheme?v.error("string.uriCustomScheme",{scheme:T,value:g}):v.error("string.uri")}}},manifest:{build(g,v){if(v.replacements)for(const{pattern:w,replacement:x}of v.replacements)g=g.replace(w,x);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(o(g.minDomainSegments===void 0||Number.isSafeInteger(g.minDomainSegments)&&g.minDomainSegments>0,"minDomainSegments must be a positive integer"),o(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 o(y.tlds,"Built-in TLD list disabled"),Object.assign({},g,y.tlds);o(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)}})),o(g.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),o(!g.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),y.validateTlds(g.tlds.deny,"tlds.deny"),g;const w=g.tlds.allow;return w?w===!0?(o(y.tlds,"Built-in TLD list disabled"),Object.assign({},g,y.tlds)):(Array.isArray(w)&&(g=Object.assign({},g,{tlds:{allow:new Set(w)}})),o(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 w of g)o(c.isValid(w,{minDomainSegments:1,maxDomainSegments:1}),`${v} must contain valid top level domain names`)},y.isoDate=function(g){if(!h.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,w,x,A){return o(!A||!1,"Invalid encoding:",A),g.$_addRule({name:v,method:"length",args:{limit:w,encoding:A},operator:x})}},8826:(s,i,a)=>{const o=a(375),c=a(8068),u={};u.Map=class extends Map{slice(){return new u.Map(this)}},s.exports=c.extend({type:"symbol",terms:{map:{init:new u.Map}},coerce:{method(f,{schema:l,error:d}){const m=l.$_terms.map.get(f);return m&&(f=m),l._flags.only&&typeof f!="symbol"?{value:f,errors:d("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)),o(f&&f[Symbol.iterator],"Iterable must be an iterable or object");const l=this.clone(),d=[];for(const m of f){o(m&&m[Symbol.iterator],"Entry must be an iterable");const[p,h]=m;o(typeof p!="object"&&typeof p!="function"&&typeof p!="symbol","Key must not be of type object, function, or Symbol"),o(typeof h=="symbol","Value must be a Symbol"),l.$_terms.map.set(p,h),d.push(h)}return l.valid(...d)}}},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,a)=>{const o=a(375),c=a(8571),u=a(738),f=a(9621),l=a(8160),d=a(6354),m=a(493),p={result:Symbol("result")};i.entry=function(h,y,g){let v=l.defaults;g&&(o(g.warnings===void 0,"Cannot override warnings preference in synchronous validation"),o(g.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),v=l.preferences(l.defaults,g));const w=p.entry(h,y,v);o(!w.mainstay.externals.length,"Schema with external rules must use validateAsync()");const x={value:w.value};return w.error&&(x.error=w.error),w.mainstay.warnings.length&&(x.warning=d.details(w.mainstay.warnings)),w.mainstay.debug&&(x.debug=w.mainstay.debug),w.mainstay.artifacts&&(x.artifacts=w.mainstay.artifacts),x},i.entryAsync=async function(h,y,g){let v=l.defaults;g&&(v=l.preferences(l.defaults,g));const w=p.entry(h,y,v),x=w.mainstay;if(w.error)throw x.debug&&(w.error.debug=x.debug),w.error;if(x.externals.length){let T=w.value;const R=[];for(const E of x.externals){const k=E.state.path,N=E.schema.type==="link"?x.links.get(E.schema):null;let O,L,I=T;const F=k.length?[T]:[],U=k.length?f(h,k):h;if(k.length){O=k[k.length-1];let Y=T;for(const V of k.slice(0,-1))Y=Y[V],F.unshift(Y);L=F[0],I=L[O]}try{const Y=(H,ee)=>(N||E.schema).$_createError(H,I,ee,E.state,v),V=await E.method(I,{schema:E.schema,linked:N,state:E.state,prefs:g,original:U,error:Y,errorsArray:p.errorsArray,warn:(H,ee)=>x.warnings.push((N||E.schema).$_createError(H,I,ee,E.state,v)),message:(H,ee)=>(N||E.schema).$_createError("external",I,ee,E.state,v,{messages:H})});if(V===void 0||V===I)continue;if(V instanceof d.Report){if(x.tracer.log(E.schema,E.state,"rule","external","error"),R.push(V),v.abortEarly)break;continue}if(Array.isArray(V)&&V[l.symbols.errors]){if(x.tracer.log(E.schema,E.state,"rule","external","error"),R.push(...V),v.abortEarly)break;continue}L?(x.tracer.value(E.state,"rule",I,V,"external"),L[O]=V):(x.tracer.value(E.state,"rule",T,V,"external"),T=V)}catch(Y){throw v.errors.label&&(Y.message+=` (${E.label})`),Y}}if(w.value=T,R.length)throw w.error=d.process(R,h,v),x.debug&&(w.error.debug=x.debug),w.error}if(!v.warnings&&!v.debug&&!v.artifacts)return w.value;const A={value:w.value};return x.warnings.length&&(A.warning=d.details(x.warnings)),x.debug&&(A.debug=x.debug),x.artifacts&&(A.artifacts=x.artifacts),A},p.Mainstay=class{constructor(h,y,g){this.externals=[],this.warnings=[],this.tracer=h,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 h=this._snapshots.pop();this.externals=h.externals,this.warnings=h.warnings}commit(){this._snapshots.pop()}},p.entry=function(h,y,g){const{tracer:v,cleanup:w}=p.tracer(y,g),x=g.debug?[]:null,A=y._ids._schemaChain?new Map:null,T=new p.Mainstay(v,x,A),R=y._ids._schemaChain?[{schema:y}]:null,E=new m([],[],{mainstay:T,schemas:R}),k=i.validate(h,y,E,g);w&&y.$_root.untrace();const N=d.process(k.errors,h,g);return{value:k.value,error:N,mainstay:T}},p.tracer=function(h,y){return h.$_root._tracer?{tracer:h.$_root._tracer._register(h)}:y.debug?(o(h.$_root.trace,"Debug mode not supported"),{tracer:h.$_root.trace()._register(h),cleanup:!0}):{tracer:p.ignore}},i.validate=function(h,y,g,v,w={}){if(y.$_terms.whens&&(y=y._generate(h,g,v).schema),y._preferences&&(v=p.prefs(y,v)),y._cache&&v.cache){const N=y._cache.get(h);if(g.mainstay.tracer.debug(g,"validate","cached",!!N),N)return N}const x=(N,O,L)=>y.$_createError(N,h,O,L||g,v),A={original:h,prefs:v,schema:y,state:g,error:x,errorsArray:p.errorsArray,warn:(N,O,L)=>g.mainstay.warnings.push(x(N,O,L)),message:(N,O)=>y.$_createError("custom",h,O,g,v,{messages:N})};g.mainstay.tracer.entry(y,g);const T=y._definition;if(T.prepare&&h!==void 0&&v.convert){const N=T.prepare(h,A);if(N){if(g.mainstay.tracer.value(g,"prepare",h,N.value),N.errors)return p.finalize(N.value,[].concat(N.errors),A);h=N.value}}if(T.coerce&&h!==void 0&&v.convert&&(!T.coerce.from||T.coerce.from.includes(typeof h))){const N=T.coerce.method(h,A);if(N){if(g.mainstay.tracer.value(g,"coerced",h,N.value),N.errors)return p.finalize(N.value,[].concat(N.errors),A);h=N.value}}const R=y._flags.empty;R&&R.$_match(p.trim(h,y),g.nest(R),l.defaults)&&(g.mainstay.tracer.value(g,"empty",h,void 0),h=void 0);const E=w.presence||y._flags.presence||(y._flags._endedSwitch?null:v.presence);if(h===void 0){if(E==="forbidden")return p.finalize(h,null,A);if(E==="required")return p.finalize(h,[y.$_createError("any.required",h,null,g,v)],A);if(E==="optional"){if(y._flags.default!==l.symbols.deepDefault)return p.finalize(h,null,A);g.mainstay.tracer.value(g,"default",h,{}),h={}}}else if(E==="forbidden")return p.finalize(h,[y.$_createError("any.unknown",h,null,g,v)],A);const k=[];if(y._valids){const N=y._valids.get(h,g,v,y._flags.insensitive);if(N)return v.convert&&(g.mainstay.tracer.value(g,"valids",h,N.value),h=N.value),g.mainstay.tracer.filter(y,g,"valid",N),p.finalize(h,null,A);if(y._flags.only){const O=y.$_createError("any.only",h,{valids:y._valids.values({display:!0})},g,v);if(v.abortEarly)return p.finalize(h,[O],A);k.push(O)}}if(y._invalids){const N=y._invalids.get(h,g,v,y._flags.insensitive);if(N){g.mainstay.tracer.filter(y,g,"invalid",N);const O=y.$_createError("any.invalid",h,{invalids:y._invalids.values({display:!0})},g,v);if(v.abortEarly)return p.finalize(h,[O],A);k.push(O)}}if(T.validate){const N=T.validate(h,A);if(N&&(g.mainstay.tracer.value(g,"base",h,N.value),h=N.value,N.errors)){if(!Array.isArray(N.errors))return k.push(N.errors),p.finalize(h,k,A);if(N.errors.length)return k.push(...N.errors),p.finalize(h,k,A)}}return y._rules.length?p.rules(h,k,A):p.finalize(h,k,A)},p.rules=function(h,y,g){const{schema:v,state:w,prefs:x}=g;for(const A of v._rules){const T=v._definition.rules[A.method];if(T.convert&&x.convert){w.mainstay.tracer.log(v,w,"rule",A.name,"full");continue}let R,E=A.args;if(A._resolve.length){E=Object.assign({},E);for(const N of A._resolve){const O=T.argsByName.get(N),L=E[N].resolve(h,w,x),I=O.normalize?O.normalize(L):L,F=l.validateArg(I,null,O);if(F){R=v.$_createError("any.ref",L,{arg:N,ref:E[N],reason:F},w,x);break}E[N]=I}}R=R||T.validate(h,g,E,A);const k=p.rule(R,A);if(k.errors){if(w.mainstay.tracer.log(v,w,"rule",A.name,"error"),A.warn){w.mainstay.warnings.push(...k.errors);continue}if(x.abortEarly)return p.finalize(h,k.errors,g);y.push(...k.errors)}else w.mainstay.tracer.log(v,w,"rule",A.name,"pass"),w.mainstay.tracer.value(w,"rule",h,k.value,A.name),h=k.value}return p.finalize(h,y,g)},p.rule=function(h,y){return h instanceof d.Report?(p.error(h,y),{errors:[h],value:null}):Array.isArray(h)&&h[l.symbols.errors]?(h.forEach(g=>p.error(g,y)),{errors:h,value:null}):{errors:null,value:h}},p.error=function(h,y){return y.message&&h._setTemplate(y.message),h},p.finalize=function(h,y,g){y=y||[];const{schema:v,state:w,prefs:x}=g;if(y.length){const T=p.default("failover",void 0,y,g);T!==void 0&&(w.mainstay.tracer.value(w,"failover",h,T),h=T,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 T of y)o(T instanceof Error||T instanceof d.Report,"error() must return an Error object")}else y=[v._flags.error];if(h===void 0){const T=p.default("default",h,y,g);w.mainstay.tracer.value(w,"default",h,T),h=T}if(v._flags.cast&&h!==void 0){const T=v._definition.cast[v._flags.cast];if(T.from(h)){const R=T.to(h,g);w.mainstay.tracer.value(w,"cast",h,R,v._flags.cast),h=R}}if(v.$_terms.externals&&x.externals&&x._externals!==!1)for(const{method:T}of v.$_terms.externals)w.mainstay.externals.push({method:T,schema:v,state:w,label:d.label(v._flags,w,x)});const A={value:h,errors:y.length?y:null};return v._flags.result&&(A.value=v._flags.result==="strip"?void 0:g.original,w.mainstay.tracer.value(w,v._flags.result,h,A.value),w.shadow(h,v._flags.result)),v._cache&&x.cache!==!1&&!v._refs.length&&v._cache.set(g.original,A),h===void 0||A.errors||v._flags.artifact===void 0||(w.mainstay.artifacts=w.mainstay.artifacts||new Map,w.mainstay.artifacts.has(v._flags.artifact)||w.mainstay.artifacts.set(v._flags.artifact,[]),w.mainstay.artifacts.get(v._flags.artifact).push(w.path)),A},p.prefs=function(h,y){const g=y===l.defaults;return g&&h._preferences[l.symbols.prefs]?h._preferences[l.symbols.prefs]:(y=l.preferences(y,h._preferences),g&&(h._preferences[l.symbols.prefs]=y),y)},p.default=function(h,y,g,v){const{schema:w,state:x,prefs:A}=v,T=w._flags[h];if(A.noDefaults||T===void 0)return y;if(x.mainstay.tracer.log(w,x,"rule",h,"full"),!T)return T;if(typeof T=="function"){const R=T.length?[c(x.ancestors[0]),v]:[];try{return T(...R)}catch(E){return void g.push(w.$_createError(`any.${h}`,null,{error:E},x,A))}}return typeof T!="object"?T:T[l.symbols.literal]?T.literal:l.isResolvable(T)?T.resolve(y,x,A):c(T)},p.trim=function(h,y){if(typeof h!="string")return h;const g=y.$_getRule("trim");return g&&g.args.enabled?h.trim():h},p.ignore={active:!1,debug:u,entry:u,filter:u,log:u,resolve:u,value:u},p.errorsArray=function(){const h=[];return h[l.symbols.errors]=!0,h}},2036:(s,i,a)=>{const o=a(375),c=a(9474),u=a(8160),f={};s.exports=f.Values=class{constructor(l,d){this._values=new Set(l),this._refs=new Set(d),this._lowercase=f.lowercases(l),this._override=!1}get length(){return this._values.size+this._refs.size}add(l,d){u.isResolvable(l)?this._refs.has(l)||(this._refs.add(l),d&&d.register(l)):this.has(l,null,null,!1)||(this._values.add(l),typeof l=="string"&&this._lowercase.set(l.toLowerCase(),l))}static merge(l,d,m){if(l=l||new f.Values,d){if(d._override)return d.clone();for(const p of[...d._values,...d._refs])l.add(p)}if(m)for(const p of[...m._values,...m._refs])l.remove(p);return l.length?l:null}remove(l){u.isResolvable(l)?this._refs.delete(l):(this._values.delete(l),typeof l=="string"&&this._lowercase.delete(l.toLowerCase()))}has(l,d,m,p){return!!this.get(l,d,m,p)}get(l,d,m,p){if(!this.length)return!1;if(this._values.has(l))return{value:l};if(typeof l=="string"&&l&&p){const h=this._lowercase.get(l.toLowerCase());if(h)return{value:h}}if(!this._refs.size&&typeof l!="object")return!1;if(typeof l=="object"){for(const h of this._values)if(c(h,l))return{value:h}}if(d)for(const h of this._refs){const y=h.resolve(l,d,m,null,{in:!0});if(y===void 0)continue;const g=h.in&&typeof y=="object"?Array.isArray(y)?y:Object.keys(y):[y];for(const v of g)if(typeof v==typeof l){if(p&&l&&typeof l=="string"){if(v.toLowerCase()===l.toLowerCase())return{value:v,ref:h}}else if(c(v,l))return{value:v,ref:h}}}return!1}override(){this._override=!0}values(l){if(l&&l.display){const d=[];for(const m of[...this._values,...this._refs])m!==void 0&&d.push(m);return d}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){o(!l._override,"Cannot concat override set of values");const d=new f.Values([...this._values,...l._values],[...this._refs,...l._refs]);return d._override=this._override,d}describe(){const l=[];this._override&&l.push({override:!0});for(const d of this._values.values())l.push(d&&typeof d=="object"?{value:d}:d);for(const d of this._refs.values())l.push(d.describe());return l}},f.Values.prototype[u.symbols.values]=!0,f.Values.prototype.slice=f.Values.prototype.clone,f.lowercases=function(l){const d=new Map;if(l)for(const m of l)typeof m=="string"&&d.set(m.toLowerCase(),m);return d}},978:(s,i,a)=>{const o=a(375),c=a(8571),u=a(1687),f=a(9621),l={};s.exports=function(d,m,p={}){if(o(d&&typeof d=="object","Invalid defaults value: must be an object"),o(!m||m===!0||typeof m=="object","Invalid source value: must be true, falsy or an object"),o(typeof p=="object","Invalid options: must be an object"),!m)return null;if(p.shallow)return l.applyToDefaultsWithShallow(d,m,p);const h=c(d);if(m===!0)return h;const y=p.nullOverride!==void 0&&p.nullOverride;return u(h,m,{nullOverride:y,mergeArrays:!1})},l.applyToDefaultsWithShallow=function(d,m,p){const h=p.shallow;o(Array.isArray(h),"Invalid keys");const y=new Map,g=m===!0?null:new Set;for(let x of h){x=Array.isArray(x)?x:x.split(".");const A=f(d,x);A&&typeof A=="object"?y.set(A,g&&f(m,x)||A):g&&g.add(x)}const v=c(d,{},y);if(!g)return v;for(const x of g)l.reachCopy(v,m,x);const w=p.nullOverride!==void 0&&p.nullOverride;return u(v,m,{nullOverride:w,mergeArrays:!1})},l.reachCopy=function(d,m,p){for(const g of p){if(!(g in m))return;const v=m[g];if(typeof v!="object"||v===null)return;m=v}const h=m;let y=d;for(let g=0;g{const o=a(7916);s.exports=function(c,...u){if(!c)throw u.length===1&&u[0]instanceof Error?u[0]:new o(u)}},8571:(s,i,a)=>{const o=a(9621),c=a(4277),u=a(7043),f={needsProtoHack:new Set([c.set,c.map,c.weakSet,c.weakMap])};s.exports=f.clone=function(l,d={},m=null){if(typeof l!="object"||l===null)return l;let p=f.clone,h=m;if(d.shallow){if(d.shallow!==!0)return f.cloneWithShallow(l,d);p=w=>w}else if(h){const w=h.get(l);if(w)return w}else h=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,d);if(g===l)return l;if(h&&h.set(l,g),y===c.set)for(const w of l)g.add(p(w,d,h));else if(y===c.map)for(const[w,x]of l)g.set(w,p(x,d,h));const v=u.keys(l,d);for(const w of v){if(w==="__proto__")continue;if(y===c.array&&w==="length"){g.length=l.length;continue}const x=Object.getOwnPropertyDescriptor(l,w);x?x.get||x.set?Object.defineProperty(g,w,x):x.enumerable?g[w]=p(l[w],d,h):Object.defineProperty(g,w,{enumerable:!1,writable:!0,configurable:!0,value:p(l[w],d,h)}):Object.defineProperty(g,w,{enumerable:!0,writable:!0,configurable:!0,value:p(l[w],d,h)})}return g},f.cloneWithShallow=function(l,d){const m=d.shallow;(d=Object.assign({},d)).shallow=!1;const p=new Map;for(const h of m){const y=o(l,h);typeof y!="object"&&typeof y!="function"||p.set(y,y)}return f.clone(l,d,p)},f.base=function(l,d,m){if(m.prototype===!1)return f.needsProtoHack.has(d)?new d.constructor:d===c.array?[]:{};const p=Object.getPrototypeOf(l);if(p&&p.isImmutable)return l;if(d===c.array){const h=[];return p!==d&&Object.setPrototypeOf(h,p),h}if(f.needsProtoHack.has(d)){const h=new p.constructor;return p!==d&&Object.setPrototypeOf(h,p),h}return Object.create(p)}},9474:(s,i,a)=>{const o=a(4277),c={mismatched:null};s.exports=function(u,f,l){return l=Object.assign({prototype:!0},l),!!c.isDeepEqual(u,f,l,[])},c.isDeepEqual=function(u,f,l,d){if(u===f)return u!==0||1/u==1/f;const m=typeof u;if(m!==typeof f||u===null||f===null)return!1;if(m==="function"){if(!l.deepFunction||u.toString()!==f.toString())return!1}else if(m!=="object")return u!=u&&f!=f;const p=c.getSharedType(u,f,!!l.prototype);switch(p){case o.buffer:return!1;case o.promise:return u===f;case o.regex:return u.toString()===f.toString();case c.mismatched:return!1}for(let h=d.length-1;h>=0;--h)if(d[h].isSame(u,f))return!0;d.push(new c.SeenEntry(u,f));try{return!!c.isDeepEqualObj(p,u,f,l,d)}finally{d.pop()}},c.getSharedType=function(u,f,l){if(l)return Object.getPrototypeOf(u)!==Object.getPrototypeOf(f)?c.mismatched:o.getInternalProto(u);const d=o.getInternalProto(u);return d!==o.getInternalProto(f)?c.mismatched:d},c.valueOf=function(u){const f=u.valueOf;if(f===void 0)return u;try{return f.call(u)}catch(l){return l}},c.hasOwnEnumerableProperty=function(u,f){return Object.prototype.propertyIsEnumerable.call(u,f)},c.isSetSimpleEqual=function(u,f){for(const l of Set.prototype.values.call(u))if(!Set.prototype.has.call(f,l))return!1;return!0},c.isDeepEqualObj=function(u,f,l,d,m){const{isDeepEqual:p,valueOf:h,hasOwnEnumerableProperty:y}=c,{keys:g,getOwnPropertySymbols:v}=Object;if(u===o.array){if(!d.part){if(f.length!==l.length)return!1;for(let R=0;R{const o=a(8761);s.exports=class extends Error{constructor(c){super(c.filter(u=>u!=="").map(u=>typeof u=="string"?u:u instanceof Error?u.message:o(u)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,i.assert)}}},5277:s=>{const i={};s.exports=function(a){if(!a)return"";let o="";for(let c=0;c=256?"&#"+a+";":`&#x${a.toString(16).padStart(2,"0")};`)},i.isSafe=function(a){return i.safeCharCodes.has(a)},i.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),i.safeCharCodes=function(){const a=new Set;for(let o=32;o<123;++o)(o>=97||o>=65&&o<=90||o>=48&&o<=57||o===32||o===46||o===44||o===45||o===58||o===95)&&a.add(o);return a}()},6064:s=>{s.exports=function(i){return i.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:s=>{s.exports=function(){}},1687:(s,i,a)=>{const o=a(375),c=a(8571),u=a(7043),f={};s.exports=f.merge=function(l,d,m){if(o(l&&typeof l=="object","Invalid target value: must be an object"),o(d==null||typeof d=="object","Invalid source value: must be null, undefined, or an object"),!d)return l;if(m=Object.assign({nullOverride:!0,mergeArrays:!0},m),Array.isArray(d)){o(Array.isArray(l),"Cannot merge array onto an object"),m.mergeArrays||(l.length=0);for(let h=0;h{const o=a(375),c={};s.exports=function(u,f,l){if(f===!1||f==null)return u;typeof(l=l||{})=="string"&&(l={separator:l});const d=Array.isArray(f);o(!d||!l.separator,"Separator option is not valid for array-based chain");const m=d?f:f.split(l.separator||".");let p=u;for(let h=0;h{s.exports=function(...i){try{return JSON.stringify(...i)}catch(a){return"[Cannot display object: "+a.message+"]"}}},4277:(s,i)=>{const a={};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},a.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(o){if(Array.isArray(o))return i.array;if(o instanceof Date)return i.date;if(o instanceof RegExp)return i.regex;if(o instanceof Error)return i.error;const c=Object.prototype.toString.call(o);return a.typeMap.get(c)||i.generic}},7043:(s,i)=>{i.keys=function(a,o={}){return o.symbols!==!1?Reflect.ownKeys(a):Object.getOwnPropertyNames(a)}},3652:(s,i,a)=>{const o=a(375),c={};i.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(u,f){const l=[].concat((f=f||{}).before||[]),d=[].concat(f.after||[]),m=f.group||"?",p=f.sort||0;o(!l.includes(m),`Item cannot come before itself: ${m}`),o(!l.includes("?"),"Item cannot come before unassociated items"),o(!d.includes(m),`Item cannot come after itself: ${m}`),o(!d.includes("?"),"Item cannot come after unassociated items"),Array.isArray(u)||(u=[u]);for(const h of u){const y={seq:this._items.length,sort:p,before:l,after:d,group:m,node:h};this._items.push(y)}if(!f.manual){const h=this._sort();o(h,"item",m!=="?"?`added into group ${m}`:"","created a dependencies error")}return this.nodes}merge(u){Array.isArray(u)||(u=[u]);for(const l of u)if(l)for(const d of l._items)this._items.push(Object.assign({},d));this._items.sort(c.mergeSort);for(let l=0;lu.sort===f.sort?0:u.sort{const o=a(443),c=a(2178),u={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:o.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(u.nonAsciiRx.test(f)){if(l.allowUnicode===!1)return c.code("DOMAIN_INVALID_UNICODE_CHARS");f=f.normalize("NFC")}if(u.domainControlRx.test(f))return c.code("DOMAIN_INVALID_CHARS");f=u.punycode(f),l.allowFullyQualified&&f[f.length-1]==="."&&(f=f.slice(0,-1));const d=l.minDomainSegments||u.minDomainSegments,m=f.split(".");if(m.lengthl.maxDomainSegments)return c.code("DOMAIN_SEGMENTS_COUNT_MAX");const p=l.tlds;if(p){const h=m[m.length-1].toLowerCase();if(p.deny&&p.deny.has(h)||p.allow&&!p.allow.has(h))return c.code("DOMAIN_FORBIDDEN_TLDS")}for(let h=0;h63)return c.code("DOMAIN_LONG_SEGMENT");if(h{const o=a(9848),c=a(5380),u=a(2178),f={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(o.TextEncoder||TextEncoder)};i.analyze=function(l,d){return f.email(l,d)},i.isValid=function(l,d){return!f.email(l,d)},f.email=function(l,d={}){if(typeof l!="string")throw new Error("Invalid input: email must be a string");if(!l)return u.code("EMPTY_STRING");const m=!f.nonAsciiRx.test(l);if(!m){if(d.allowUnicode===!1)return u.code("FORBIDDEN_UNICODE");l=l.normalize("NFC")}const p=l.split("@");if(p.length!==2)return p.length>2?u.code("MULTIPLE_AT_CHAR"):u.code("MISSING_AT_CHAR");const[h,y]=p;if(!h)return u.code("EMPTY_LOCAL");if(!d.ignoreLength){if(l.length>254)return u.code("ADDRESS_TOO_LONG");if(f.encoder.encode(h).length>64)return u.code("LOCAL_TOO_LONG")}return f.local(h,m)||c.analyze(y,d)},f.local=function(l,d){const m=l.split(".");for(const p of m){if(!p.length)return u.code("EMPTY_LOCAL_SEGMENT");if(d){if(!f.atextRx.test(p))return u.code("INVALID_LOCAL_CHARS")}else for(const h of p){if(f.atextRx.test(h))continue;const y=f.binary(h);if(!f.atomRx.test(y))return u.code("INVALID_LOCAL_CHARS")}}},f.binary=function(l){return Array.from(f.encoder.encode(l)).map(d=>String.fromCharCode(d)).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(a){return{code:a,error:i.codes[a]}}},9959:(s,i,a)=>{const o=a(375),c=a(5752);i.regex=function(u={}){o(u.cidr===void 0||typeof u.cidr=="string","options.cidr must be a string");const f=u.cidr?u.cidr.toLowerCase():"optional";o(["required","optional","forbidden"].includes(f),"options.cidr must be one of required, optional, forbidden"),o(u.version===void 0||typeof u.version=="string"||Array.isArray(u.version),"options.version must be a string or an array of string");let l=u.version||["ipv4","ipv6","ipvfuture"];Array.isArray(l)||(l=[l]),o(l.length>=1,"options.version must have at least 1 version specified");for(let p=0;p{if(f==="forbidden")return c.ip[p];const h=`\\/${p==="ipv4"?c.ip.v4Cidr:c.ip.v6Cidr}`;return f==="required"?`${c.ip[p]}${h}`:`${c.ip[p]}(?:${h})?`}).join("|")})`,m=new RegExp(`^${d}$`);return{cidr:f,versions:l,regex:m,raw:d}}},5752:(s,i,a)=>{const o=a(375),c=a(6064),u={generate:function(){const f={},l="\\dA-Fa-f",d="["+l+"]",m="\\w-\\.~",p="!\\$&'\\(\\)\\*\\+,;=",h="%"+l,y=m+h+p+":@",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 w=d+"{1,4}",x="(?:"+w+":"+w+"|"+f.ipv4address+")",A="(?:"+w+":){6}"+x,T="::(?:"+w+":){5}"+x,R="(?:"+w+")?::(?:"+w+":){4}"+x,E="(?:(?:"+w+":){0,1}"+w+")?::(?:"+w+":){3}"+x,k="(?:(?:"+w+":){0,2}"+w+")?::(?:"+w+":){2}"+x,N="(?:(?:"+w+":){0,3}"+w+")?::"+w+":"+x,O="(?:(?:"+w+":){0,4}"+w+")?::"+x,L="(?:(?:"+w+":){0,5}"+w+")?::"+w,I="(?:(?:"+w+":){0,6}"+w+")?::";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+"|"+T+"|"+R+"|"+E+"|"+k+"|"+N+"|"+O+"|"+L+"|"+I+")",f.ipvFuture="v"+d+"+\\.["+m+p+":]+",f.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",f.schemeRegex=new RegExp(f.scheme);const F="["+m+h+p+":]*",U="["+m+h+p+"]{1,255}",Y="(?:\\[(?:"+f.ipv6address+"|"+f.ipvFuture+")\\]|"+f.ipv4address+"|"+U+")",V="(?:"+F+"@)?"+Y+"(?::\\d*)?",H="(?:"+F+"@)?("+Y+")(?::\\d*)?",ee=g+"*",re=g+"+",X="(?:\\/"+ee+")*",q="\\/(?:"+re+X+")?",K=re+X,Z="["+m+h+p+"@]+"+X,ue="(?:\\/\\/\\/"+ee+X+")";return f.hierPart="(?:(?:\\/\\/"+V+X+")|"+q+"|"+K+"|"+ue+")",f.hierPartCapture="(?:(?:\\/\\/"+H+X+")|"+q+"|"+K+")",f.relativeRef="(?:(?:\\/\\/"+V+X+")|"+q+"|"+Z+"|)",f.relativeRefCapture="(?:(?:\\/\\/"+H+X+")|"+q+"|"+Z+"|)",f.query="["+y+"\\/\\?]*(?=#|$)",f.queryWithSquareBrackets="["+y+"\\[\\]\\/\\?]*(?=#|$)",f.fragment="["+y+"\\/\\?]*",f}};u.rfc3986=u.generate(),i.ip={v4Cidr:u.rfc3986.ipv4Cidr,v6Cidr:u.rfc3986.ipv6Cidr,ipv4:u.rfc3986.ipv4address,ipv6:u.rfc3986.ipv6address,ipvfuture:u.rfc3986.ipvFuture},u.createRegex=function(f){const l=u.rfc3986,d="(?:\\?"+(f.allowQuerySquareBrackets?l.queryWithSquareBrackets:l.query)+")?(?:#"+l.fragment+")?",m=f.domain?l.relativeRefCapture:l.relativeRef;if(f.relativeOnly)return u.wrap(m+d);let p="";if(f.scheme){o(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);o(g.length>=1,"scheme must have at least 1 scheme specified");const v=[];for(let w=0;w{const a={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};i.Parser=class{constructor(o,c={}){if(!c[a.settings]&&c.constants)for(const u in c.constants){const f=c.constants[u];if(f!==null&&!["boolean","number","string"].includes(typeof f))throw new Error(`Formula constant ${u} contains invalid ${typeof f} value type`)}this.settings=c[a.settings]?c:Object.assign({[a.settings]:!0,constants:{},functions:{}},c),this.single=null,this._parts=null,this._parse(o)}_parse(o){let c=[],u="",f=0,l=!1;const d=p=>{if(f)throw new Error("Formula missing closing parenthesis");const h=c.length?c[c.length-1]:null;if(l||u||p){if(h&&h.type==="reference"&&p===")")return h.type="function",h.value=this._subFormula(u,h.value),void(u="");if(p===")"){const y=new i.Parser(u,this.settings);c.push({type:"segment",value:y})}else if(l){if(l==="]")return c.push({type:"reference",value:u}),void(u="");c.push({type:"literal",value:u})}else if(a.operatorCharacters.includes(u))h&&h.type==="operator"&&a.operators.includes(h.value+u)?h.value+=u:c.push({type:"operator",value:u});else if(u.match(a.numberRx))c.push({type:"constant",value:parseFloat(u)});else if(this.settings.constants[u]!==void 0)c.push({type:"constant",value:this.settings.constants[u]});else{if(!u.match(a.tokenRx))throw new Error(`Formula contains invalid token: ${u}`);c.push({type:"reference",value:u})}u=""}};for(const p of o)l?p===l?(d(),l=!1):u+=p:f?p==="("?(u+=p,++f):p===")"?(--f,f?u+=p:d(p)):u+=p:p in a.literals?l=a.literals[p]:p==="("?(d(),++f):a.operatorCharacters.includes(p)?(d(),u=p,d()):p!==" "?u+=p:d();d(),c=c.map((p,h)=>p.type!=="operator"||p.value!=="-"||h&&c[h-1].type!=="operator"?p:{type:"operator",value:"n"});let m=!1;for(const p of c){if(p.type==="operator"){if(a.operatorsPrefix.includes(p.value))continue;if(!m)throw new Error("Formula contains an operator in invalid position");if(!a.operators.includes(p.value))throw new Error(`Formula contains an unknown operator ${p.value}`)}else if(m)throw new Error("Formula missing expected operator");m=!m}if(!m)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(p=>{if(p.type==="operator")return a.operatorsPrefix.includes(p.value)?p:p.value;if(p.type!=="reference")return p.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(p.value))throw new Error(`Formula contains invalid reference ${p.value}`);return this.settings.reference?this.settings.reference(p.value):a.reference(p.value)})}_subFormula(o,c){const u=this.settings.functions[c];if(typeof u!="function")throw new Error(`Formula contains unknown function ${c}`);let f=[];if(o){let l="",d=0,m=!1;const p=()=>{if(!l)throw new Error(`Formula contains function ${c} with invalid arguments ${o}`);f.push(l),l=""};for(let h=0;hnew i.Parser(l,this.settings)),function(l){const d=[];for(const m of f)d.push(m.evaluate(l));return u.call(l,...d)}}evaluate(o){const c=this._parts.slice();for(let u=c.length-2;u>=0;--u){const f=c[u];if(f&&f.type==="operator"){const l=c[u+1];c.splice(u+1,1);const d=a.evaluate(l,o);c[u]=a.single(f.value,d)}}return a.operatorsOrder.forEach(u=>{for(let f=1;f":return c>u;case">=":return c>=u;case"==":return c===u;case"!=":return c!==u;case"&&":return c&&u;case"||":return c||u}return null},a.exists=function(o){return o!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:s=>{s.exports=JSON.parse('{"version":"17.13.3"}')}},r={},function s(i){var a=r[i];if(a!==void 0)return a.exports;var o=r[i]={exports:{}};return n[i](o,o.exports,s),o.exports}(5107);var n,r})})(jQ);var lMe=jQ.exports;const xn=Yc(lMe);class Tr{constructor(e){Le(this,"_object");Le(this,"_error");Le(this,"isSuccess");Le(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 Tr({isSuccess:!0,object:e})}static fail(e){return new Tr({isSuccess:!1,error:e})}static combine(e){for(const n of e)if(n.isFailure)return n;return Tr.ok()}}class ir{static validate(e,n,r={}){if(!xn.isSchema(e))throw new cMe("Rule provided is not a valid Joi schema!");const s={abortEarly:!1,errors:{wrap:{label:"{}"}},...r},i=e.validate(n,s);return i.error?Tr.fail(i.error):Tr.ok(i.value)}static validateFnc(e){return(n,r)=>{const s=e(n);return s.isSuccess?n:r.message({custom:s.error.message})}}}Le(ir,"RULE_NOT_NULL_OR_UNDEFINED",xn.any().required().invalid(null)),Le(ir,"RULE_ALLOW_NULL_OR_UNDEFINED",xn.any().optional().valid(null)),Le(ir,"RULE_ALLOW_NULL",xn.any().valid(null)),Le(ir,"RULE_ALLOW_EMPTY",xn.any().optional().valid(null,"")),Le(ir,"RULE_IS_TYPE_STRING",xn.string()),Le(ir,"RULE_IS_TYPE_NUMBER",xn.number());class cMe extends Error{}class $$ extends Error{constructor(n,r,s={}){super(r);Le(this,"code");Le(this,"payload",{});this.name=this.constructor.name,this.code=n,this.payload=s,Object.setPrototypeOf(this,$$.prototype)}}const a1=class a1 extends $${static create(e,n,r){return new a1(e,n,r)}};Le(a1,"INVALID_INPUT_DATA","INVALID_INPUT_DATA");let tp=a1;function VA(t,e="",n){return tp.create(t,e,n)}var BQ={};(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),a=Object.keys(r);if(i.length!==a.length)return!1;for(var o=s&&typeof s.customEqual=="function"?s.customEqual:t.is,c=0;cthis.props===null)}}class WUe extends xn.ValidationError{}class GUe extends xn.ValidationError{}class qUe extends xn.ValidationError{}class KUe extends xn.ValidationError{}class YUe extends xn.ValidationError{}const sk={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"}},ku=class ku extends F${constructor(){super(...arguments);Le(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=xn.alternatives(ir.RULE_ALLOW_EMPTY.default(""),xn.string().uppercase().valid(...Object.keys(sk)).label(String(r.label)));return ir.validate(s,n)}static createFromCode(n,r={}){const s={...r,label:r.label?r.label:"current_code"},i=ku.validate(n,s);return i.isFailure?Tr.fail(VA(tp.INVALID_INPUT_DATA,i.error.message,s)):Tr.ok(new ku(sk[i.object]))}static createDefaultCode(){return ku.createFromCode(ku.DEFAULT_CURRENCY_CODE)}isEmpty(){return this.isNull()||this.props===void 0}toPrimitive(){return this.toString()}};Le(ku,"DEFAULT_CURRENCY_CODE","EUR"),Le(ku,"CURRENCIES",sk);let jC=ku;class XUe extends xn.ValidationError{}var uMe={defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},dMe={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 Rb(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Rb=function(e){return typeof e}:Rb=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rb(t)}function N4(t){return fMe(t)||hMe(t)||pMe(t)||mMe()}function fMe(t){if(Array.isArray(t))return t}function hMe(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function pMe(t,e){if(t){if(typeof t=="string")return D4(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 D4(t,e)}}function D4(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0}function yMe(t){return t.length>0&&t.every(function(e){return e>=0})&&t.some(function(e){return e>0})}function O4(t){return t%2===0}function M4(t){return UQ(t)&&!Number.isInteger(t)}function bMe(){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 Iy(t){return Math.abs(t)%1===.5}function wMe(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),_Me(s,e.headers),s.send()})}function _Me(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 Zy(t){return typeof t>"u"}function HQ(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",n={};return Object.entries(t).forEach(function(r){if(Rb(r[1])==="object"){var s=HQ(r[1]);Object.entries(s).forEach(function(i){n[r[0]+e+i[0]]=i[1]})}else n[r[0]]=r[1]}),n}function xMe(t){return!!t&&(Rb(t)==="object"||typeof t=="function")&&typeof t.then=="function"}function VQ(){var t=function(r,s){var i=function(c){return Math.pow(10,bMe(c))},a=Math.max(i(r),i(s));return Math.round(r*a)*Math.round(s*a)/(a*a)},e={HALF_ODD:function(r){var s=Math.round(r);return Iy(r)&&O4(s)?s-1:s},HALF_EVEN:function(r){var s=Math.round(r);return Iy(r)?O4(s)?s:s-1:s},HALF_UP:function(r){return Math.round(r)},HALF_DOWN:function(r){return Iy(r)?Math.floor(r):Math.round(r)},HALF_TOWARDS_ZERO:function(r){return Iy(r)?Math.sign(r)*Math.floor(Math.abs(r)):Math.round(r)},HALF_AWAY_FROM_ZERO:function(r){return Iy(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 M4(r)||M4(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 SMe=VQ();function EMe(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!Zy(r)}):[]},getMinimumFractionDigits:function(){var r=function(i){return i==="."};return Zy(this.getMatches().find(r))?0:this.getMatches()[SMe.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 Zy(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!Zy(this.getMatches().find(function(r){return r===","}))}}}function CMe(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 a in i)s=s.replace("{{".concat(a,"}}"),i[a]);return s},n=function(s,i){return wMe(e(t.endpoint,{from:s,to:i}),{headers:t.headers})};return{getExchangeRate:function(s,i){return(xMe(t.endpoint)?t.endpoint:n(s,i)).then(function(a){return HQ(a)[e(t.propertyPath,{from:s,to:i})]})}}}function m0(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!t)throw new n(e)}function AMe(t){m0(vMe(t),"You must provide a numeric value between 0 and 100.",RangeError)}function RMe(t){m0(yMe(t),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function ik(t){m0(Number.isInteger(t),"You must provide an integer.",TypeError)}var zn=VQ(),PMe=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;ik(r),ik(i);var a=t.globalLocale,o=t.globalFormat,c=t.globalRoundingMode,u=t.globalFormatRoundingMode,f=Object.assign({},t.globalExchangeRatesApi),l=function(p){var h=Object.assign({},Object.assign({},{amount:r,currency:s,precision:i},p),Object.assign({},{locale:this.locale},p));return Object.assign(t({amount:h.amount,currency:h.currency,precision:h.precision}),{locale:h.locale})},d=function(p){m0(this.hasSameCurrency(p),"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||a},setLocale:function(p){return l.call(this,{locale:p})},getPrecision:function(){return i},convertPrecision:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;ik(p);var y=this.getPrecision(),g=p>y,v=g?zn.multiply:zn.divide,w=g?[p,y]:[y,p],x=Math.pow(10,zn.subtract.apply(zn,w));return l.call(this,{amount:zn.round(v(this.getAmount(),x),h),precision:p})},add:function(p){d.call(this,p);var h=t.normalizePrecision([this,p]);return l.call(this,{amount:zn.add(h[0].getAmount(),h[1].getAmount()),precision:h[0].getPrecision()})},subtract:function(p){d.call(this,p);var h=t.normalizePrecision([this,p]);return l.call(this,{amount:zn.subtract(h[0].getAmount(),h[1].getAmount()),precision:h[0].getPrecision()})},multiply:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return l.call(this,{amount:zn.round(zn.multiply(this.getAmount(),p),h)})},divide:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return l.call(this,{amount:zn.round(zn.divide(this.getAmount(),p),h)})},percentage:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return AMe(p),this.multiply(zn.divide(p,100),h)},allocate:function(p){var h=this;RMe(p);for(var y=p.reduce(function(x,A){return zn.add(x,A)}),g=this.getAmount(),v=p.map(function(x){var A=Math.floor(zn.divide(zn.multiply(h.getAmount(),x),y));return g=zn.subtract(g,A),l.call(h,{amount:A})}),w=0;g>0;)p[w]>0&&(v[w]=v[w].add(l.call(this,{amount:1})),g=zn.subtract(g,1)),w+=1;return v},convert:function(p){var h=this,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g=y.endpoint,v=g===void 0?f.endpoint:g,w=y.propertyPath,x=w===void 0?f.propertyPath||"rates.{{to}}":w,A=y.headers,T=A===void 0?f.headers:A,R=y.roundingMode,E=R===void 0?c:R,k=Object.assign({},{endpoint:v,propertyPath:x,headers:T,roundingMode:E});return CMe(k).getExchangeRate(this.getCurrency(),p).then(function(N){return m0(!Zy(N),'No rate was found for the destination currency "'.concat(p,'".'),TypeError),l.call(h,{amount:zn.round(zn.multiply(h.getAmount(),parseFloat(N)),k.roundingMode),currency:p})})},equalsTo:function(p){return this.hasSameAmount(p)&&this.hasSameCurrency(p)},lessThan:function(p){d.call(this,p);var h=t.normalizePrecision([this,p]);return h[0].getAmount()h[1].getAmount()},greaterThanOrEqual:function(p){d.call(this,p);var h=t.normalizePrecision([this,p]);return h[0].getAmount()>=h[1].getAmount()},isZero:function(){return this.getAmount()===0},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return zn.modulo(this.getAmount(),Math.pow(10,i))!==0},hasCents:function(){return zn.modulo(this.getAmount(),Math.pow(10,i))!==0},hasSameCurrency:function(p){return this.getCurrency()===p.getCurrency()},hasSameAmount:function(p){var h=t.normalizePrecision([this,p]);return h[0].getAmount()===h[1].getAmount()},toFormat:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:o,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u,y=EMe(p);return this.toRoundedUnit(y.getMinimumFractionDigits(),h).toLocaleString(this.getLocale(),{currencyDisplay:y.getCurrencyDisplay(),useGrouping:y.getUseGrouping(),minimumFractionDigits:y.getMinimumFractionDigits(),style:y.getStyle(),currency:this.getCurrency()})},toUnit:function(){return zn.divide(this.getAmount(),Math.pow(10,i))},toRoundedUnit:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u,y=Math.pow(10,p);return zn.divide(zn.round(zn.multiply(this.toUnit(),y),h),y)},toObject:function(){return{amount:r,currency:s,precision:i}},toJSON:function(){return this.toObject()}}},AS=Object.assign(PMe,uMe,dMe,gMe),BC={exports:{}};/** * @license * Lodash @@ -293,11 +293,11 @@ __p += '`),Ft&&(Re+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+Re+`return __p -}`;var Et=kj(function(){return en(G,Ze+"return "+Re).apply(n,Q)});if(Et.source=Re,yP(Et))throw Et;return Et}function Bae(b){return rn(b).toLowerCase()}function zae(b){return rn(b).toUpperCase()}function Uae(b,S,D){if(b=rn(b),b&&(D||S===n))return j2(b);if(!b||!(S=Ii(S)))return b;var M=Ko(b),j=Ko(S),G=B2(M,j),Q=z2(M,j)+1;return fu(M,G,Q).join("")}function Hae(b,S,D){if(b=rn(b),b&&(D||S===n))return b.slice(0,H2(b)+1);if(!b||!(S=Ii(S)))return b;var M=Ko(b),j=z2(M,Ko(S))+1;return fu(M,0,j).join("")}function Vae(b,S,D){if(b=rn(b),b&&(D||S===n))return b.replace(he,"");if(!b||!(S=Ii(S)))return b;var M=Ko(b),j=B2(M,Ko(S));return fu(M,j).join("")}function Wae(b,S){var D=N,M=O;if(Zn(S)){var j="separator"in S?S.separator:j;D="length"in S?_t(S.length):D,M="omission"in S?Ii(S.omission):M}b=rn(b);var G=b.length;if(Pp(b)){var Q=Ko(b);G=Q.length}if(D>=G)return b;var ne=D-Tp(M);if(ne<1)return M;var ce=Q?fu(Q,0,ne).join(""):b.slice(0,ne);if(j===n)return ce+M;if(Q&&(ne+=ce.length-ne),bP(j)){if(b.slice(ne).search(j)){var Se,Ee=ce;for(j.global||(j=LR(j.source,rn(mt.exec(j))+"g")),j.lastIndex=0;Se=j.exec(Ee);)var Re=Se.index;ce=ce.slice(0,Re===n?ne:Re)}}else if(b.indexOf(Ii(j),ne)!=ne){var je=ce.lastIndexOf(j);je>-1&&(ce=ce.slice(0,je))}return ce+M}function Gae(b){return b=rn(b),b&&Ht.test(b)?b.replace(St,_ne):b}var qae=Ip(function(b,S,D){return b+(D?" ":"")+S.toUpperCase()}),xP=NF("toUpperCase");function Tj(b,S,D){return b=rn(b),S=D?n:S,S===n?gne(b)?Ene(b):ane(b):b.match(S)||[]}var kj=At(function(b,S){try{return Mi(b,n,S)}catch(D){return yP(D)?D:new gt(D)}}),Kae=Fl(function(b,S){return go(S,function(D){D=za(D),Il(b,D,gP(b[D],b))}),b});function Yae(b){var S=b==null?0:b.length,D=at();return b=S?Kn(b,function(M){if(typeof M[1]!="function")throw new vo(a);return[D(M[0]),M[1]]}):[],At(function(M){for(var j=-1;++jH)return[];var D=X,M=bs(b,X);S=at(S),b-=X;for(var j=DR(M,S);++D0||S<0)?new It(D):(b<0?D=D.takeRight(-b):b&&(D=D.drop(b)),S!==n&&(S=_t(S),D=S<0?D.dropRight(-S):D.take(S-b)),D)},It.prototype.takeRightWhile=function(b){return this.reverse().takeWhile(b).reverse()},It.prototype.toArray=function(){return this.take(X)},ja(It.prototype,function(b,S){var D=/^(?:filter|find|map|reject)|While$/.test(S),M=/^(?:head|last)$/.test(S),j=W[M?"take"+(S=="last"?"Right":""):S],G=M||/^find/.test(S);j&&(W.prototype[S]=function(){var Q=this.__wrapped__,ne=M?[1]:arguments,ce=Q instanceof It,Se=ne[0],Ee=ce||yt(Q),Re=function(kt){var Ft=j.apply(W,ou([kt],ne));return M&&je?Ft[0]:Ft};Ee&&D&&typeof Se=="function"&&Se.length!=1&&(ce=Ee=!1);var je=this.__chain__,Ze=!!this.__actions__.length,lt=G&&!je,Et=ce&&!Ze;if(!G&&Ee){Q=Et?Q:new It(this);var ct=b.apply(Q,ne);return ct.__actions__.push({func:Nx,args:[Re],thisArg:n}),new yo(ct,je)}return lt&&Et?b.apply(this,ne):(ct=this.thru(Re),lt?M?ct.value()[0]:ct.value():ct)})}),go(["pop","push","shift","sort","splice","unshift"],function(b){var S=rx[b],D=/^(?:push|sort|unshift)$/.test(b)?"tap":"thru",M=/^(?:pop|shift)$/.test(b);W.prototype[b]=function(){var j=arguments;if(M&&!this.__chain__){var G=this.value();return S.apply(yt(G)?G:[],j)}return this[D](function(Q){return S.apply(yt(Q)?Q:[],j)})}}),ja(It.prototype,function(b,S){var D=W[S];if(D){var M=D.name+"";cn.call(Op,M)||(Op[M]=[]),Op[M].push({name:S,func:D})}}),Op[Ex(n,g).name]=[{name:"wrapper",func:n}],It.prototype.clone=Gne,It.prototype.reverse=qne,It.prototype.value=Kne,W.prototype.at=Sie,W.prototype.chain=Eie,W.prototype.commit=Cie,W.prototype.next=Aie,W.prototype.plant=Pie,W.prototype.reverse=Tie,W.prototype.toJSON=W.prototype.valueOf=W.prototype.value=kie,W.prototype.first=W.prototype.head,ey&&(W.prototype[ey]=Rie),W},kp=Cne();Qd?((Qd.exports=kp)._=kp,ER._=kp):rs._=kp}).call(_r)})(BC,BC.exports);var tE=BC.exports;const TMe=({amount:t,scale:e})=>{const n=10**e;return Number(t)/n},ZUe=t=>{const e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${e}-${n}-${r}`},ok={locale:"es-ES"},tm={amount:null,currencyCode:jC.DEFAULT_CURRENCY_CODE,scale:2},dr=class dr extends zQ{constructor(n,r,s){super(n);Le(this,"_isNull");Le(this,"_options");Le(this,"isEmpty",()=>this.isNull());Le(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(r),this._options=Object.freeze(s)}static validate(n,r){const s=xn.any().optional().valid(null),i=xn.number().label(r.label?r.label:"amount"),a=xn.alternatives(s,i);return ir.validate(a,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=tm,r=ok){if(n===null)throw new Error("InvalidParams: props params is missing");const{amount:s=tm.amount,currencyCode:i=tm.currencyCode,scale:a=tm.scale}=n||{},o=dr.validate(s,r);if(o.isFailure)return Tr.fail(VA(tp.INVALID_INPUT_DATA,o.error.message,r));const c=dr.sanitize(o.object),u=i,f=AS({amount:Number(c),currency:u,precision:a}).setLocale(r.locale);return Tr.ok(new this(f,tE.isNull(c),r))}static createFromFormattedValue(n,r,s=dr.DEFAULT_SCALE,i={locale:ok.locale}){if(n===null||n==="")return dr.create({amount:null,scale:s,currencyCode:r});const a=String(n),[o,c]=a.split(",");let u=o,f=2;return c===void 0?f=0:(c===""&&(u=o+c.padEnd(1,"0"),f=1),c.length===1?(u=o+c.padEnd(1,"0"),f=1):c.length===2?(u=o+c.padEnd(2,"0"),f=2):c.length===3?(u=o+c.padEnd(3,"0"),f=3):c.length===4&&(u=o+c.padEnd(4,"0"),f=4)),dr.create({amount:u,scale:f,currencyCode:r},i)}static sanitize(n){let r=null;return typeof n=="string"?r=parseFloat(n):r=n,r}static createFromDinero(n){return Tr.ok(new dr(n,!1,ok))}static normalizeScale(n){return AS.normalizePrecision(n.map(r=>r.props)).map(r=>dr.createFromDinero(r).object)}static minimum(n){return dr.createFromDinero(AS.minimum(n.map(r=>r.props))).object}static maximum(n){return dr.createFromDinero(AS.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:TMe({amount:n,scale:r}));const i=Math.pow(10,r);return(Number(n)/i).toFixed(r)}toString(){return dr._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?dr.create({amount:null,scale:n,currencyCode:this.getCurrency().code}).object:dr.createFromDinero(this.props.convertPrecision(n,r)).object}getCurrency(){return jC.createFromCode(this.props.getCurrency()).object}getLocale(){return this.props.getLocale()}add(n){return dr.createFromDinero(this.props.add(n.props)).object}subtract(n){return dr.createFromDinero(this.props.subtract(n.props)).object}multiply(n,r){return dr.createFromDinero(this.props.multiply(n,r)).object}divide(n,r){return dr.createFromDinero(this.props.divide(n,r)).object}percentage(n,r){return dr.createFromDinero(this.props.percentage(n,r)).object}allocate(n){return this.props.allocate(n).map(r=>dr.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()}};Le(dr,"DEFAULT_SCALE",tm.scale),Le(dr,"DEFAULT_CURRENCY_CODE",tm.currencyCode);let zC=dr;class JUe extends xn.ValidationError{}class WQ{constructor(e){Le(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 GQ=2,ak={amount:0,scale:GQ},un=class un extends F${constructor(n,r,s){super(n);Le(this,"_isNull");Le(this,"_options");Le(this,"isEmpty",()=>this.isNull());Le(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(r),this._options=Object.freeze(s)}static validate(n,r,s){const i=ir.RULE_ALLOW_NULL_OR_UNDEFINED,a=ir.RULE_ALLOW_EMPTY,o=ir.RULE_IS_TYPE_NUMBER.label(s.label?s.label:"amount"),c=ir.RULE_IS_TYPE_STRING.regex(/^[-]?\d+$/).label(s.label?s.label:"amount"),u=xn.number().min(un.MIN_SCALE).max(un.MAX_SCALE).label(s.label?s.label:"scale"),f=new WQ([ir.validate(xn.alternatives(i,a,o,c),n),ir.validate(xn.alternatives(ir.RULE_IS_TYPE_NUMBER.label(s.label?s.label:"scale"),u),r)]);if(f.hasSomeFaultyResult())return f.getFirstFaultyResult();let l=typeof n=="string"?parseInt(n,10):Number(n),d=tE.isNull(r)?un.DEFAULT_SCALE:Number(r);const m=l/Math.pow(10,d);return mun.MAX_VALUE?Tr.fail(new Error(`Value with scale is out of range: ${m}`)):Tr.ok()}static create(n=ak,r={}){if(n===null)throw new Error("InvalidParams: props params is missing");const{amount:s=ak.amount,scale:i=ak.scale}=n,a={label:"percentage",...r},o=un.validate(s,i,a);if(o.isFailure)return Tr.fail(VA(tp.INVALID_INPUT_DATA,o.error.message,a));let c=un._sanitize(s);const u={amount:tE.isNull(c)?0:c,scale:i};return Tr.ok(new this(u,tE.isNull(c),r))}static createFromFormattedValue(n,r={}){if(n===null||n==="")return un.create({amount:null,scale:un.DEFAULT_SCALE});const s=String(n),[i,a]=s.split(",");let o=i,c=2;return a===void 0?c=0:(a===""&&(o=i+a.padEnd(1,"0"),c=1),a.length===1?(o=i+a.padEnd(1,"0"),c=1):a.length===2&&(o=i+a.padEnd(2,"0"),c=2)),un.create({amount:o,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(un._toString(n,r));return s>=un.MIN_VALUE&&s<=un.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 un._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!==un.DEFAULT_SCALE?this.convertScale(un.DEFAULT_SCALE).toPrimitive():this.amount}toPrimitives(){return this.toObject()}toObject(){return{amount:this.amount,scale:this.scale}}convertScale(n){if(nun.MAX_SCALE)throw new Error(`Scale out of range: ${n}`);if(this.isNull())return new un({amount:null,scale:n},!0,this._options);const r=Math.pow(10,this.scale),s=Number(this.amount)/r,i=Math.pow(10,n),a=Math.round(s*i);if(!un._isWithinRange(a,n))throw new Error(`Value out of range after conversion: ${a} ${n}`);return new un({amount:a,scale:n},!1,this._options)}hasSameScale(n){return this.scale===n.scale}isWithinRange(){return un._isWithinRange(this.amount,this.scale)}};Le(un,"DEFAULT_SCALE",GQ),Le(un,"MIN_VALUE",0),Le(un,"MAX_VALUE",100),Le(un,"MIN_SCALE",0),Le(un,"MAX_SCALE",2);let UC=un;class e5e extends xn.ValidationError{}const qQ=2,lk={amount:0,scale:qQ},wn=class wn extends F${constructor(n,r,s){super(n);Le(this,"_isNull");Le(this,"_options");Le(this,"isEmpty",()=>this.isNull());Le(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(r),this._options=Object.freeze(s)}static validate(n,r,s={}){const i=ir.RULE_ALLOW_NULL_OR_UNDEFINED,a=ir.RULE_ALLOW_EMPTY,o=ir.RULE_IS_TYPE_NUMBER.label(s.label?s.label:"amount"),c=ir.RULE_IS_TYPE_STRING.regex(/^[-]?\d+$/).label(s.label?s.label:"amount"),u=xn.number().min(wn.MIN_SCALE).max(wn.MAX_SCALE).label(s.label?s.label:"scale"),f=new WQ([ir.validate(xn.alternatives(i,a,o,c),n),ir.validate(xn.alternatives(ir.RULE_IS_TYPE_NUMBER.label(s.label?s.label:"scale"),u),r)]);return f.hasSomeFaultyResult()?f.getFirstFaultyResult():Tr.ok()}static create(n=lk,r={}){if(n===null)throw new Error("InvalidParams: props params is missing");const{amount:s=lk.amount,scale:i=lk.scale}=n,a={label:"quantity",...r},o=wn.validate(s,i,a);if(o.isFailure)return Tr.fail(VA(tp.INVALID_INPUT_DATA,o.error.message,a));let c=wn._sanitize(s);const u={amount:c===null?0:c,scale:i};return Tr.ok(new wn(u,c===null,r))}static createFromFormattedValue(n,r={}){if(n===null||n==="")return wn.create({amount:null,scale:wn.DEFAULT_SCALE});const s=String(n),[i,a]=s.split(",");let o=i,c=2;return a===void 0?c=0:(a===""&&(o=i+a.padEnd(1,"0"),c=1),a.length===1?(o=i+a.padEnd(1,"0"),c=1):a.length===2&&(o=i+a.padEnd(2,"0"),c=2)),wn.create({amount:o,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 wn._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!==wn.DEFAULT_SCALE?this.convertScale(wn.DEFAULT_SCALE).toPrimitive():this.amount}toPrimitives(){return this.toObject()}toObject(){return{amount:this.amount,scale:this.scale}}convertScale(n){if(nwn.MAX_SCALE)throw new Error(`Scale out of range: ${n}`);if(this.isNull())return new wn({amount:null,scale:n},!0,this._options);const r=Math.pow(10,this.scale),s=Number(this.amount)/r,i=Math.pow(10,n),a=Math.round(s*i);return new wn({amount:a,scale:n},!1,this._options)}hasSameScale(n){return this.scale===n.scale}increment(n){return this.isNull()?n?wn.create(n.toObject()):wn.create():n?this.hasSameScale(n)?wn.create({amount:Number(this.amount)+Number(n.amount),scale:this.scale},this._options):Tr.fail(Error("No se pueden sumar cantidades con diferentes escalas.")):wn.create({amount:Number(this.amount)+1,scale:this.scale},this._options)}decrement(n){return this.isNull()?n?wn.create(n.toObject()):wn.create():n?this.hasSameScale(n)?wn.create({amount:Number(this.amount)-Number(n.amount),scale:this.scale},this._options):Tr.fail(Error("No se pueden restar cantidades con diferentes escalas.")):wn.create({amount:Number(this.amount)-1,scale:this.scale},this._options)}};Le(wn,"DEFAULT_SCALE",qQ),Le(wn,"MIN_SCALE",0),Le(wn,"MAX_SCALE",2);let HC=wn;const Pb=0,j$=10,BD=1,KQ=9999,YQ=_.createContext(void 0),kMe=({dataSource:t,children:e})=>P.jsx(YQ.Provider,{value:t,children:e}),t5e=[5,10,15,30,50,75,100],XQ=(t=Pb,e=j$)=>{const[n,r]=_.useState({pageIndex:t,pageSize:e});return[n,i=>{const a=i;return a.pageIndexKQ)&&(a.pageSize=BD),r(o=>({...o,pageIndex:i.pageIndex,pageSize:i.pageSize})),a}]},NMe=(t=Pb,e=j$)=>{const[n,r]=$Oe(),s=n.get("page_index"),i=n.get("page_size"),a=_.useMemo(()=>{const l=parseInt(s??"",10);let d=isNaN(l)?t:l;return d{const l=parseInt(i??"",10);let d=isNaN(l)?e:l;return(dKQ)&&(d=e),d},[i,e]),[c,u]=XQ(a,o);return[c,l=>{const d=u(l);r({page_index:String(d.pageIndex),page_size:String(d.pageSize)})}]},DMe=({syncWithLocation:t=!0,initialPageIndex:e,initialPageSize:n})=>{const[r,s]=NMe(),[i,a]=XQ(e,n);return t?[r,s]:[i,a]},OMe=_.createContext(null),n5e=({syncWithLocation:t=!0,initialGlobalFilter:e=[],initialPageIndex:n,initialPageSize:r,children:s})=>{const[i,a]=DMe({syncWithLocation:t,initialPageIndex:n,initialPageSize:r}),[o,c]=_.useState(e||[]),[u,f]=_.useState([]),l=_.useMemo(()=>!!(o&&o.length),[o]),d=_.useCallback(()=>c([]),[]);return P.jsx(OMe.Provider,{value:{pagination:i,setPagination:a,sorting:u,setSorting:f,globalFilter:o,setGlobalFilter:c,resetGlobalFilter:d,isFiltered:l},children:s})},MMe=se.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:le("flex items-center gap-2",t),...e}));MMe.displayName="ButtonGroup";const LMe=({label:t="Cancelar",...e})=>P.jsx(ao,{type:"button",variant:"secondary",...e,children:t});LMe.displayName="CancelButton";const IMe=ri("",{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"}}),QQ=se.forwardRef(({className:t,label:e,size:n,icon:r,children:s,...i},a)=>{const o=!!r;return P.jsxs(ao,{ref:a,size:n,className:le(o?"gap-1":"",t),...i,children:[o&&P.jsx(r,{className:le(IMe({size:n}))}),P.jsx(P.Fragment,{children:e||s})]})});QQ.displayName="CustomButton";const $Me=({label:t="Enviar",...e})=>P.jsx(QQ,{type:"submit",label:t,variant:"default",...e});$Me.displayName="SubmitButton";const FMe=ri("p-6",{variants:{variant:{full:"w-full",boxed:"container max-w-3xl lg:max-w-5xl mx-auto"}},defaultVariants:{variant:"full"}}),jMe=({className:t,as:e="article",variant:n,...r})=>P.jsx(e,{className:le(FMe({variant:n,className:t})),...r});jMe.displayName="Container";const BMe=()=>{const t=Wv();return P.jsxs(ao,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:()=>t(-1),children:[P.jsx(_L,{className:"w-4 h-4"}),P.jsx("span",{className:"sr-only",children:sr("common.back")})]})};function zMe(){for(var t=arguments.length,e=new Array(t),n=0;nr=>{e.forEach(s=>s(r))},e)}const WA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Gv(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function B$(t){return"nodeType"in t}function ii(t){var e,n;return t?Gv(t)?t:B$(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function z$(t){const{Document:e}=ii(t);return t instanceof e}function j_(t){return Gv(t)?!1:t instanceof ii(t).HTMLElement}function ZQ(t){return t instanceof ii(t).SVGElement}function qv(t){return t?Gv(t)?t.document:B$(t)?z$(t)?t:j_(t)||ZQ(t)?t.ownerDocument:document:document:document}const ka=WA?_.useLayoutEffect:_.useEffect;function GA(t){const e=_.useRef(t);return ka(()=>{e.current=t}),_.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s{t.current=setInterval(r,s)},[]),n=_.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function g0(t,e){e===void 0&&(e=[t]);const n=_.useRef(t);return ka(()=>{n.current!==t&&(n.current=t)},e),n}function B_(t,e){const n=_.useRef();return _.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function VC(t){const e=GA(t),n=_.useRef(null),r=_.useCallback(s=>{s!==n.current&&(e==null||e(s,n.current)),n.current=s},[]);return[n,r]}function WC(t){const e=_.useRef();return _.useEffect(()=>{e.current=t},[t]),e.current}let ck={};function z_(t,e){return _.useMemo(()=>{if(e)return e;const n=ck[t]==null?0:ck[t]+1;return ck[t]=n,t+"-"+n},[t,e])}function JQ(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s{const o=Object.entries(a);for(const[c,u]of o){const f=i[c];f!=null&&(i[c]=f+t*u)}return i},{...e})}}const qm=JQ(1),GC=JQ(-1);function HMe(t){return"clientX"in t&&"clientY"in t}function qA(t){if(!t)return!1;const{KeyboardEvent:e}=ii(t.target);return e&&t instanceof e}function VMe(t){if(!t)return!1;const{TouchEvent:e}=ii(t.target);return e&&t instanceof e}function qC(t){if(VMe(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 HMe(t)?{x:t.clientX,y:t.clientY}:null}const np=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[np.Translate.toString(t),np.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),L4="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function WMe(t){return t.matches(L4)?t:t.querySelector(L4)}const GMe={display:"none"};function qMe(t){let{id:e,value:n}=t;return se.createElement("div",{id:e,style:GMe},n)}function KMe(t){let{id:e,announcement:n,ariaLiveType:r="assertive"}=t;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return se.createElement("div",{id:e,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function YMe(){const[t,e]=_.useState("");return{announce:_.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const eZ=_.createContext(null);function XMe(t){const e=_.useContext(eZ);_.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of ");return e(t)},[t,e])}function QMe(){const[t]=_.useState(()=>new Set),e=_.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[_.useCallback(r=>{let{type:s,event:i}=r;t.forEach(a=>{var o;return(o=a[s])==null?void 0:o.call(a,i)})},[t]),e]}const ZMe={draggable:` +}`;var Et=kj(function(){return en(G,Ze+"return "+Re).apply(n,Q)});if(Et.source=Re,yP(Et))throw Et;return Et}function Bae(b){return rn(b).toLowerCase()}function zae(b){return rn(b).toUpperCase()}function Uae(b,S,D){if(b=rn(b),b&&(D||S===n))return j2(b);if(!b||!(S=Ii(S)))return b;var M=Ko(b),j=Ko(S),G=B2(M,j),Q=z2(M,j)+1;return fu(M,G,Q).join("")}function Hae(b,S,D){if(b=rn(b),b&&(D||S===n))return b.slice(0,H2(b)+1);if(!b||!(S=Ii(S)))return b;var M=Ko(b),j=z2(M,Ko(S))+1;return fu(M,0,j).join("")}function Vae(b,S,D){if(b=rn(b),b&&(D||S===n))return b.replace(he,"");if(!b||!(S=Ii(S)))return b;var M=Ko(b),j=B2(M,Ko(S));return fu(M,j).join("")}function Wae(b,S){var D=N,M=O;if(Zn(S)){var j="separator"in S?S.separator:j;D="length"in S?_t(S.length):D,M="omission"in S?Ii(S.omission):M}b=rn(b);var G=b.length;if(Pp(b)){var Q=Ko(b);G=Q.length}if(D>=G)return b;var ne=D-Tp(M);if(ne<1)return M;var ce=Q?fu(Q,0,ne).join(""):b.slice(0,ne);if(j===n)return ce+M;if(Q&&(ne+=ce.length-ne),bP(j)){if(b.slice(ne).search(j)){var Se,Ee=ce;for(j.global||(j=LR(j.source,rn(mt.exec(j))+"g")),j.lastIndex=0;Se=j.exec(Ee);)var Re=Se.index;ce=ce.slice(0,Re===n?ne:Re)}}else if(b.indexOf(Ii(j),ne)!=ne){var je=ce.lastIndexOf(j);je>-1&&(ce=ce.slice(0,je))}return ce+M}function Gae(b){return b=rn(b),b&&Ht.test(b)?b.replace(St,_ne):b}var qae=Ip(function(b,S,D){return b+(D?" ":"")+S.toUpperCase()}),xP=NF("toUpperCase");function Tj(b,S,D){return b=rn(b),S=D?n:S,S===n?gne(b)?Ene(b):ane(b):b.match(S)||[]}var kj=At(function(b,S){try{return Mi(b,n,S)}catch(D){return yP(D)?D:new gt(D)}}),Kae=Fl(function(b,S){return go(S,function(D){D=za(D),Il(b,D,gP(b[D],b))}),b});function Yae(b){var S=b==null?0:b.length,D=at();return b=S?Kn(b,function(M){if(typeof M[1]!="function")throw new vo(a);return[D(M[0]),M[1]]}):[],At(function(M){for(var j=-1;++jH)return[];var D=X,M=bs(b,X);S=at(S),b-=X;for(var j=DR(M,S);++D0||S<0)?new It(D):(b<0?D=D.takeRight(-b):b&&(D=D.drop(b)),S!==n&&(S=_t(S),D=S<0?D.dropRight(-S):D.take(S-b)),D)},It.prototype.takeRightWhile=function(b){return this.reverse().takeWhile(b).reverse()},It.prototype.toArray=function(){return this.take(X)},ja(It.prototype,function(b,S){var D=/^(?:filter|find|map|reject)|While$/.test(S),M=/^(?:head|last)$/.test(S),j=W[M?"take"+(S=="last"?"Right":""):S],G=M||/^find/.test(S);j&&(W.prototype[S]=function(){var Q=this.__wrapped__,ne=M?[1]:arguments,ce=Q instanceof It,Se=ne[0],Ee=ce||yt(Q),Re=function(kt){var Ft=j.apply(W,ou([kt],ne));return M&&je?Ft[0]:Ft};Ee&&D&&typeof Se=="function"&&Se.length!=1&&(ce=Ee=!1);var je=this.__chain__,Ze=!!this.__actions__.length,lt=G&&!je,Et=ce&&!Ze;if(!G&&Ee){Q=Et?Q:new It(this);var ct=b.apply(Q,ne);return ct.__actions__.push({func:Nx,args:[Re],thisArg:n}),new yo(ct,je)}return lt&&Et?b.apply(this,ne):(ct=this.thru(Re),lt?M?ct.value()[0]:ct.value():ct)})}),go(["pop","push","shift","sort","splice","unshift"],function(b){var S=rx[b],D=/^(?:push|sort|unshift)$/.test(b)?"tap":"thru",M=/^(?:pop|shift)$/.test(b);W.prototype[b]=function(){var j=arguments;if(M&&!this.__chain__){var G=this.value();return S.apply(yt(G)?G:[],j)}return this[D](function(Q){return S.apply(yt(Q)?Q:[],j)})}}),ja(It.prototype,function(b,S){var D=W[S];if(D){var M=D.name+"";cn.call(Op,M)||(Op[M]=[]),Op[M].push({name:S,func:D})}}),Op[Ex(n,g).name]=[{name:"wrapper",func:n}],It.prototype.clone=Gne,It.prototype.reverse=qne,It.prototype.value=Kne,W.prototype.at=Sie,W.prototype.chain=Eie,W.prototype.commit=Cie,W.prototype.next=Aie,W.prototype.plant=Pie,W.prototype.reverse=Tie,W.prototype.toJSON=W.prototype.valueOf=W.prototype.value=kie,W.prototype.first=W.prototype.head,ey&&(W.prototype[ey]=Rie),W},kp=Cne();Qd?((Qd.exports=kp)._=kp,ER._=kp):rs._=kp}).call(_r)})(BC,BC.exports);var tE=BC.exports;const TMe=({amount:t,scale:e})=>{const n=10**e;return Number(t)/n},QUe=t=>{const e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${e}-${n}-${r}`},ok={locale:"es-ES"},tm={amount:null,currencyCode:jC.DEFAULT_CURRENCY_CODE,scale:2},dr=class dr extends zQ{constructor(n,r,s){super(n);Le(this,"_isNull");Le(this,"_options");Le(this,"isEmpty",()=>this.isNull());Le(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(r),this._options=Object.freeze(s)}static validate(n,r){const s=xn.any().optional().valid(null),i=xn.number().label(r.label?r.label:"amount"),a=xn.alternatives(s,i);return ir.validate(a,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=tm,r=ok){if(n===null)throw new Error("InvalidParams: props params is missing");const{amount:s=tm.amount,currencyCode:i=tm.currencyCode,scale:a=tm.scale}=n||{},o=dr.validate(s,r);if(o.isFailure)return Tr.fail(VA(tp.INVALID_INPUT_DATA,o.error.message,r));const c=dr.sanitize(o.object),u=i,f=AS({amount:Number(c),currency:u,precision:a}).setLocale(r.locale);return Tr.ok(new this(f,tE.isNull(c),r))}static createFromFormattedValue(n,r,s=dr.DEFAULT_SCALE,i={locale:ok.locale}){if(n===null||n==="")return dr.create({amount:null,scale:s,currencyCode:r});const a=String(n),[o,c]=a.split(",");let u=o,f=2;return c===void 0?f=0:(c===""&&(u=o+c.padEnd(1,"0"),f=1),c.length===1?(u=o+c.padEnd(1,"0"),f=1):c.length===2?(u=o+c.padEnd(2,"0"),f=2):c.length===3?(u=o+c.padEnd(3,"0"),f=3):c.length===4&&(u=o+c.padEnd(4,"0"),f=4)),dr.create({amount:u,scale:f,currencyCode:r},i)}static sanitize(n){let r=null;return typeof n=="string"?r=parseFloat(n):r=n,r}static createFromDinero(n){return Tr.ok(new dr(n,!1,ok))}static normalizeScale(n){return AS.normalizePrecision(n.map(r=>r.props)).map(r=>dr.createFromDinero(r).object)}static minimum(n){return dr.createFromDinero(AS.minimum(n.map(r=>r.props))).object}static maximum(n){return dr.createFromDinero(AS.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:TMe({amount:n,scale:r}));const i=Math.pow(10,r);return(Number(n)/i).toFixed(r)}toString(){return dr._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?dr.create({amount:null,scale:n,currencyCode:this.getCurrency().code}).object:dr.createFromDinero(this.props.convertPrecision(n,r)).object}getCurrency(){return jC.createFromCode(this.props.getCurrency()).object}getLocale(){return this.props.getLocale()}add(n){return dr.createFromDinero(this.props.add(n.props)).object}subtract(n){return dr.createFromDinero(this.props.subtract(n.props)).object}multiply(n,r){return dr.createFromDinero(this.props.multiply(n,r)).object}divide(n,r){return dr.createFromDinero(this.props.divide(n,r)).object}percentage(n,r){return dr.createFromDinero(this.props.percentage(n,r)).object}allocate(n){return this.props.allocate(n).map(r=>dr.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()}};Le(dr,"DEFAULT_SCALE",tm.scale),Le(dr,"DEFAULT_CURRENCY_CODE",tm.currencyCode);let zC=dr;class ZUe extends xn.ValidationError{}class WQ{constructor(e){Le(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 GQ=2,ak={amount:0,scale:GQ},un=class un extends F${constructor(n,r,s){super(n);Le(this,"_isNull");Le(this,"_options");Le(this,"isEmpty",()=>this.isNull());Le(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(r),this._options=Object.freeze(s)}static validate(n,r,s){const i=ir.RULE_ALLOW_NULL_OR_UNDEFINED,a=ir.RULE_ALLOW_EMPTY,o=ir.RULE_IS_TYPE_NUMBER.label(s.label?s.label:"amount"),c=ir.RULE_IS_TYPE_STRING.regex(/^[-]?\d+$/).label(s.label?s.label:"amount"),u=xn.number().min(un.MIN_SCALE).max(un.MAX_SCALE).label(s.label?s.label:"scale"),f=new WQ([ir.validate(xn.alternatives(i,a,o,c),n),ir.validate(xn.alternatives(ir.RULE_IS_TYPE_NUMBER.label(s.label?s.label:"scale"),u),r)]);if(f.hasSomeFaultyResult())return f.getFirstFaultyResult();let l=typeof n=="string"?parseInt(n,10):Number(n),d=tE.isNull(r)?un.DEFAULT_SCALE:Number(r);const m=l/Math.pow(10,d);return mun.MAX_VALUE?Tr.fail(new Error(`Value with scale is out of range: ${m}`)):Tr.ok()}static create(n=ak,r={}){if(n===null)throw new Error("InvalidParams: props params is missing");const{amount:s=ak.amount,scale:i=ak.scale}=n,a={label:"percentage",...r},o=un.validate(s,i,a);if(o.isFailure)return Tr.fail(VA(tp.INVALID_INPUT_DATA,o.error.message,a));let c=un._sanitize(s);const u={amount:tE.isNull(c)?0:c,scale:i};return Tr.ok(new this(u,tE.isNull(c),r))}static createFromFormattedValue(n,r={}){if(n===null||n==="")return un.create({amount:null,scale:un.DEFAULT_SCALE});const s=String(n),[i,a]=s.split(",");let o=i,c=2;return a===void 0?c=0:(a===""&&(o=i+a.padEnd(1,"0"),c=1),a.length===1?(o=i+a.padEnd(1,"0"),c=1):a.length===2&&(o=i+a.padEnd(2,"0"),c=2)),un.create({amount:o,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(un._toString(n,r));return s>=un.MIN_VALUE&&s<=un.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 un._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!==un.DEFAULT_SCALE?this.convertScale(un.DEFAULT_SCALE).toPrimitive():this.amount}toPrimitives(){return this.toObject()}toObject(){return{amount:this.amount,scale:this.scale}}convertScale(n){if(nun.MAX_SCALE)throw new Error(`Scale out of range: ${n}`);if(this.isNull())return new un({amount:null,scale:n},!0,this._options);const r=Math.pow(10,this.scale),s=Number(this.amount)/r,i=Math.pow(10,n),a=Math.round(s*i);if(!un._isWithinRange(a,n))throw new Error(`Value out of range after conversion: ${a} ${n}`);return new un({amount:a,scale:n},!1,this._options)}hasSameScale(n){return this.scale===n.scale}isWithinRange(){return un._isWithinRange(this.amount,this.scale)}};Le(un,"DEFAULT_SCALE",GQ),Le(un,"MIN_VALUE",0),Le(un,"MAX_VALUE",100),Le(un,"MIN_SCALE",0),Le(un,"MAX_SCALE",2);let UC=un;class JUe extends xn.ValidationError{}const qQ=2,lk={amount:0,scale:qQ},wn=class wn extends F${constructor(n,r,s){super(n);Le(this,"_isNull");Le(this,"_options");Le(this,"isEmpty",()=>this.isNull());Le(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(r),this._options=Object.freeze(s)}static validate(n,r,s={}){const i=ir.RULE_ALLOW_NULL_OR_UNDEFINED,a=ir.RULE_ALLOW_EMPTY,o=ir.RULE_IS_TYPE_NUMBER.label(s.label?s.label:"amount"),c=ir.RULE_IS_TYPE_STRING.regex(/^[-]?\d+$/).label(s.label?s.label:"amount"),u=xn.number().min(wn.MIN_SCALE).max(wn.MAX_SCALE).label(s.label?s.label:"scale"),f=new WQ([ir.validate(xn.alternatives(i,a,o,c),n),ir.validate(xn.alternatives(ir.RULE_IS_TYPE_NUMBER.label(s.label?s.label:"scale"),u),r)]);return f.hasSomeFaultyResult()?f.getFirstFaultyResult():Tr.ok()}static create(n=lk,r={}){if(n===null)throw new Error("InvalidParams: props params is missing");const{amount:s=lk.amount,scale:i=lk.scale}=n,a={label:"quantity",...r},o=wn.validate(s,i,a);if(o.isFailure)return Tr.fail(VA(tp.INVALID_INPUT_DATA,o.error.message,a));let c=wn._sanitize(s);const u={amount:c===null?0:c,scale:i};return Tr.ok(new wn(u,c===null,r))}static createFromFormattedValue(n,r={}){if(n===null||n==="")return wn.create({amount:null,scale:wn.DEFAULT_SCALE});const s=String(n),[i,a]=s.split(",");let o=i,c=2;return a===void 0?c=0:(a===""&&(o=i+a.padEnd(1,"0"),c=1),a.length===1?(o=i+a.padEnd(1,"0"),c=1):a.length===2&&(o=i+a.padEnd(2,"0"),c=2)),wn.create({amount:o,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 wn._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!==wn.DEFAULT_SCALE?this.convertScale(wn.DEFAULT_SCALE).toPrimitive():this.amount}toPrimitives(){return this.toObject()}toObject(){return{amount:this.amount,scale:this.scale}}convertScale(n){if(nwn.MAX_SCALE)throw new Error(`Scale out of range: ${n}`);if(this.isNull())return new wn({amount:null,scale:n},!0,this._options);const r=Math.pow(10,this.scale),s=Number(this.amount)/r,i=Math.pow(10,n),a=Math.round(s*i);return new wn({amount:a,scale:n},!1,this._options)}hasSameScale(n){return this.scale===n.scale}increment(n){return this.isNull()?n?wn.create(n.toObject()):wn.create():n?this.hasSameScale(n)?wn.create({amount:Number(this.amount)+Number(n.amount),scale:this.scale},this._options):Tr.fail(Error("No se pueden sumar cantidades con diferentes escalas.")):wn.create({amount:Number(this.amount)+1,scale:this.scale},this._options)}decrement(n){return this.isNull()?n?wn.create(n.toObject()):wn.create():n?this.hasSameScale(n)?wn.create({amount:Number(this.amount)-Number(n.amount),scale:this.scale},this._options):Tr.fail(Error("No se pueden restar cantidades con diferentes escalas.")):wn.create({amount:Number(this.amount)-1,scale:this.scale},this._options)}};Le(wn,"DEFAULT_SCALE",qQ),Le(wn,"MIN_SCALE",0),Le(wn,"MAX_SCALE",2);let HC=wn;const Pb=0,j$=10,BD=1,KQ=9999,YQ=_.createContext(void 0),kMe=({dataSource:t,children:e})=>P.jsx(YQ.Provider,{value:t,children:e}),e5e=[5,10,15,30,50,75,100],XQ=(t=Pb,e=j$)=>{const[n,r]=_.useState({pageIndex:t,pageSize:e});return[n,i=>{const a=i;return a.pageIndexKQ)&&(a.pageSize=BD),r(o=>({...o,pageIndex:i.pageIndex,pageSize:i.pageSize})),a}]},NMe=(t=Pb,e=j$)=>{const[n,r]=$Oe(),s=n.get("page_index"),i=n.get("page_size"),a=_.useMemo(()=>{const l=parseInt(s??"",10);let d=isNaN(l)?t:l;return d{const l=parseInt(i??"",10);let d=isNaN(l)?e:l;return(dKQ)&&(d=e),d},[i,e]),[c,u]=XQ(a,o);return[c,l=>{const d=u(l);r({page_index:String(d.pageIndex),page_size:String(d.pageSize)})}]},DMe=({syncWithLocation:t=!0,initialPageIndex:e,initialPageSize:n})=>{const[r,s]=NMe(),[i,a]=XQ(e,n);return t?[r,s]:[i,a]},OMe=_.createContext(null),t5e=({syncWithLocation:t=!0,initialGlobalFilter:e=[],initialPageIndex:n,initialPageSize:r,children:s})=>{const[i,a]=DMe({syncWithLocation:t,initialPageIndex:n,initialPageSize:r}),[o,c]=_.useState(e||[]),[u,f]=_.useState([]),l=_.useMemo(()=>!!(o&&o.length),[o]),d=_.useCallback(()=>c([]),[]);return P.jsx(OMe.Provider,{value:{pagination:i,setPagination:a,sorting:u,setSorting:f,globalFilter:o,setGlobalFilter:c,resetGlobalFilter:d,isFiltered:l},children:s})},MMe=se.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:le("flex items-center gap-2",t),...e}));MMe.displayName="ButtonGroup";const LMe=({label:t="Cancelar",...e})=>P.jsx(ao,{type:"button",variant:"secondary",...e,children:t});LMe.displayName="CancelButton";const IMe=ri("",{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"}}),QQ=se.forwardRef(({className:t,label:e,size:n,icon:r,children:s,...i},a)=>{const o=!!r;return P.jsxs(ao,{ref:a,size:n,className:le(o?"gap-1":"",t),...i,children:[o&&P.jsx(r,{className:le(IMe({size:n}))}),P.jsx(P.Fragment,{children:e||s})]})});QQ.displayName="CustomButton";const $Me=({label:t="Enviar",...e})=>P.jsx(QQ,{type:"submit",label:t,variant:"default",...e});$Me.displayName="SubmitButton";const FMe=ri("p-6",{variants:{variant:{full:"w-full",boxed:"container max-w-3xl lg:max-w-5xl mx-auto"}},defaultVariants:{variant:"full"}}),jMe=({className:t,as:e="article",variant:n,...r})=>P.jsx(e,{className:le(FMe({variant:n,className:t})),...r});jMe.displayName="Container";const BMe=()=>{const t=Wv();return P.jsxs(ao,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:()=>t(-1),children:[P.jsx(_L,{className:"w-4 h-4"}),P.jsx("span",{className:"sr-only",children:sr("common.back")})]})};function zMe(){for(var t=arguments.length,e=new Array(t),n=0;nr=>{e.forEach(s=>s(r))},e)}const WA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Gv(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function B$(t){return"nodeType"in t}function ii(t){var e,n;return t?Gv(t)?t:B$(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function z$(t){const{Document:e}=ii(t);return t instanceof e}function j_(t){return Gv(t)?!1:t instanceof ii(t).HTMLElement}function ZQ(t){return t instanceof ii(t).SVGElement}function qv(t){return t?Gv(t)?t.document:B$(t)?z$(t)?t:j_(t)||ZQ(t)?t.ownerDocument:document:document:document}const ka=WA?_.useLayoutEffect:_.useEffect;function GA(t){const e=_.useRef(t);return ka(()=>{e.current=t}),_.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s{t.current=setInterval(r,s)},[]),n=_.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function g0(t,e){e===void 0&&(e=[t]);const n=_.useRef(t);return ka(()=>{n.current!==t&&(n.current=t)},e),n}function B_(t,e){const n=_.useRef();return _.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function VC(t){const e=GA(t),n=_.useRef(null),r=_.useCallback(s=>{s!==n.current&&(e==null||e(s,n.current)),n.current=s},[]);return[n,r]}function WC(t){const e=_.useRef();return _.useEffect(()=>{e.current=t},[t]),e.current}let ck={};function z_(t,e){return _.useMemo(()=>{if(e)return e;const n=ck[t]==null?0:ck[t]+1;return ck[t]=n,t+"-"+n},[t,e])}function JQ(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s{const o=Object.entries(a);for(const[c,u]of o){const f=i[c];f!=null&&(i[c]=f+t*u)}return i},{...e})}}const qm=JQ(1),GC=JQ(-1);function HMe(t){return"clientX"in t&&"clientY"in t}function qA(t){if(!t)return!1;const{KeyboardEvent:e}=ii(t.target);return e&&t instanceof e}function VMe(t){if(!t)return!1;const{TouchEvent:e}=ii(t.target);return e&&t instanceof e}function qC(t){if(VMe(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 HMe(t)?{x:t.clientX,y:t.clientY}:null}const np=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[np.Translate.toString(t),np.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),L4="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function WMe(t){return t.matches(L4)?t:t.querySelector(L4)}const GMe={display:"none"};function qMe(t){let{id:e,value:n}=t;return se.createElement("div",{id:e,style:GMe},n)}function KMe(t){let{id:e,announcement:n,ariaLiveType:r="assertive"}=t;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return se.createElement("div",{id:e,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function YMe(){const[t,e]=_.useState("");return{announce:_.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const eZ=_.createContext(null);function XMe(t){const e=_.useContext(eZ);_.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of ");return e(t)},[t,e])}function QMe(){const[t]=_.useState(()=>new Set),e=_.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[_.useCallback(r=>{let{type:s,event:i}=r;t.forEach(a=>{var o;return(o=a[s])==null?void 0:o.call(a,i)})},[t]),e]}const ZMe={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. - `},JMe={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 eLe(t){let{announcements:e=JMe,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=ZMe}=t;const{announce:i,announcement:a}=YMe(),o=z_("DndLiveRegion"),[c,u]=_.useState(!1);if(_.useEffect(()=>{u(!0)},[]),XMe(_.useMemo(()=>({onDragStart(l){let{active:d}=l;i(e.onDragStart({active:d}))},onDragMove(l){let{active:d,over:m}=l;e.onDragMove&&i(e.onDragMove({active:d,over:m}))},onDragOver(l){let{active:d,over:m}=l;i(e.onDragOver({active:d,over:m}))},onDragEnd(l){let{active:d,over:m}=l;i(e.onDragEnd({active:d,over:m}))},onDragCancel(l){let{active:d,over:m}=l;i(e.onDragCancel({active:d,over:m}))}}),[i,e])),!c)return null;const f=se.createElement(se.Fragment,null,se.createElement(qMe,{id:r,value:s.draggable}),se.createElement(KMe,{id:o,announcement:a}));return n?Ms.createPortal(f,n):f}var Hr;(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"})(Hr||(Hr={}));function KC(){}function r5e(t,e){return _.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function s5e(){for(var t=arguments.length,e=new Array(t),n=0;n[...e].filter(r=>r!=null),[...e])}const Na=Object.freeze({x:0,y:0});function tLe(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function nLe(t,e){const n=qC(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 rLe(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function sLe(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function iLe(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function I4(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 i5e=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=I4(e,e.left,e.top),i=[];for(const a of r){const{id:o}=a,c=n.get(o);if(c){const u=tLe(I4(c),s);i.push({id:o,data:{droppableContainer:a,value:u}})}}return i.sort(rLe)};function oLe(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),a=s-r,o=i-n;if(r{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=[];for(const i of r){const{id:a}=i,o=n.get(a);if(o){const c=oLe(o,e);c>0&&s.push({id:a,data:{droppableContainer:i,value:c}})}}return s.sort(sLe)};function lLe(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function tZ(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:Na}function cLe(t){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i({...a,top:a.top+t*o.y,bottom:a.bottom+t*o.y,left:a.left+t*o.x,right:a.right+t*o.x}),{...n})}}const uLe=cLe(1);function nZ(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 dLe(t,e,n){const r=nZ(e);if(!r)return t;const{scaleX:s,scaleY:i,x:a,y:o}=r,c=t.left-a-(1-s)*parseFloat(n),u=t.top-o-(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:u,right:c+f,bottom:u+l,left:c}}const fLe={ignoreTransform:!1};function Kv(t,e){e===void 0&&(e=fLe);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:u,transformOrigin:f}=ii(t).getComputedStyle(t);u&&(n=dLe(n,u,f))}const{top:r,left:s,width:i,height:a,bottom:o,right:c}=n;return{top:r,left:s,width:i,height:a,bottom:o,right:c}}function $4(t){return Kv(t,{ignoreTransform:!0})}function hLe(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function pLe(t,e){return e===void 0&&(e=ii(t).getComputedStyle(t)),e.position==="fixed"}function mLe(t,e){e===void 0&&(e=ii(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 U$(t,e){const n=[];function r(s){if(e!=null&&n.length>=e||!s)return n;if(z$(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!j_(s)||ZQ(s)||n.includes(s))return n;const i=ii(t).getComputedStyle(s);return s!==t&&mLe(s,i)&&n.push(s),pLe(s,i)?n:r(s.parentNode)}return t?r(t):n}function rZ(t){const[e]=U$(t,1);return e??null}function uk(t){return!WA||!t?null:Gv(t)?t:B$(t)?z$(t)||t===qv(t).scrollingElement?window:j_(t)?t:null:null}function sZ(t){return Gv(t)?t.scrollX:t.scrollLeft}function iZ(t){return Gv(t)?t.scrollY:t.scrollTop}function zD(t){return{x:sZ(t),y:iZ(t)}}var Jr;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Jr||(Jr={}));function oZ(t){return!WA||!t?!1:t===document.scrollingElement}function aZ(t){const e={x:0,y:0},n=oZ(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,a=t.scrollTop>=r.y,o=t.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:a,isRight:o,maxScroll:r,minScroll:e}}const gLe={x:.2,y:.2};function vLe(t,e,n,r,s){let{top:i,left:a,right:o,bottom:c}=n;r===void 0&&(r=10),s===void 0&&(s=gLe);const{isTop:u,isBottom:f,isLeft:l,isRight:d}=aZ(t),m={x:0,y:0},p={x:0,y:0},h={height:e.height*s.y,width:e.width*s.x};return!u&&i<=e.top+h.height?(m.y=Jr.Backward,p.y=r*Math.abs((e.top+h.height-i)/h.height)):!f&&c>=e.bottom-h.height&&(m.y=Jr.Forward,p.y=r*Math.abs((e.bottom-h.height-c)/h.height)),!d&&o>=e.right-h.width?(m.x=Jr.Forward,p.x=r*Math.abs((e.right-h.width-o)/h.width)):!l&&a<=e.left+h.width&&(m.x=Jr.Backward,p.x=r*Math.abs((e.left+h.width-a)/h.width)),{direction:m,speed:p}}function yLe(t){if(t===document.scrollingElement){const{innerWidth:i,innerHeight:a}=window;return{top:0,left:0,right:i,bottom:a,width:i,height:a}}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 lZ(t){return t.reduce((e,n)=>qm(e,zD(n)),Na)}function bLe(t){return t.reduce((e,n)=>e+sZ(n),0)}function wLe(t){return t.reduce((e,n)=>e+iZ(n),0)}function cZ(t,e){if(e===void 0&&(e=Kv),!t)return;const{top:n,left:r,bottom:s,right:i}=e(t);rZ(t)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const _Le=[["x",["left","right"],bLe],["y",["top","bottom"],wLe]];class H${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=U$(n),s=lZ(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,a,o]of _Le)for(const c of a)Object.defineProperty(this,c,{get:()=>{const u=o(r),f=s[i]-u;return this.rect[c]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Tb{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 xLe(t){const{EventTarget:e}=ii(t);return t instanceof e?t:qv(t)}function dk(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 Do;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Do||(Do={}));function F4(t){t.preventDefault()}function SLe(t){t.stopPropagation()}var nn;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(nn||(nn={}));const uZ={start:[nn.Space,nn.Enter],cancel:[nn.Esc],end:[nn.Space,nn.Enter,nn.Tab]},ELe=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case nn.Right:return{...n,x:n.x+25};case nn.Left:return{...n,x:n.x-25};case nn.Down:return{...n,y:n.y+25};case nn.Up:return{...n,y:n.y-25}}};class dZ{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 Tb(qv(n)),this.windowListeners=new Tb(ii(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Do.Resize,this.handleCancel),this.windowListeners.add(Do.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Do.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&cZ(r),n(Na)}handleKeyDown(e){if(qA(e)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=uZ,coordinateGetter:a=ELe,scrollBehavior:o="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:u}=r.current,f=u?{x:u.left,y:u.top}:Na;this.referenceCoordinates||(this.referenceCoordinates=f);const l=a(e,{active:n,context:r.current,currentCoordinates:f});if(l){const d=GC(l,f),m={x:0,y:0},{scrollableAncestors:p}=r.current;for(const h of p){const y=e.code,{isTop:g,isRight:v,isLeft:w,isBottom:x,maxScroll:A,minScroll:T}=aZ(h),R=yLe(h),E={x:Math.min(y===nn.Right?R.right-R.width/2:R.right,Math.max(y===nn.Right?R.left:R.left+R.width/2,l.x)),y:Math.min(y===nn.Down?R.bottom-R.height/2:R.bottom,Math.max(y===nn.Down?R.top:R.top+R.height/2,l.y))},k=y===nn.Right&&!v||y===nn.Left&&!w,N=y===nn.Down&&!x||y===nn.Up&&!g;if(k&&E.x!==l.x){const O=h.scrollLeft+d.x,L=y===nn.Right&&O<=A.x||y===nn.Left&&O>=T.x;if(L&&!d.y){h.scrollTo({left:O,behavior:o});return}L?m.x=h.scrollLeft-O:m.x=y===nn.Right?h.scrollLeft-A.x:h.scrollLeft-T.x,m.x&&h.scrollBy({left:-m.x,behavior:o});break}else if(N&&E.y!==l.y){const O=h.scrollTop+d.y,L=y===nn.Down&&O<=A.y||y===nn.Up&&O>=T.y;if(L&&!d.x){h.scrollTo({top:O,behavior:o});return}L?m.y=h.scrollTop-O:m.y=y===nn.Down?h.scrollTop-A.y:h.scrollTop-T.y,m.y&&h.scrollBy({top:-m.y,behavior:o});break}}this.handleMove(e,qm(GC(l,this.referenceCoordinates),m))}}}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()}}dZ.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=uZ,onActivation:s}=e,{active:i}=n;const{code:a}=t.nativeEvent;if(r.start.includes(a)){const o=i.activatorNode.current;return o&&t.target!==o?!1:(t.preventDefault(),s==null||s({event:t.nativeEvent}),!0)}return!1}}];function j4(t){return!!(t&&"distance"in t)}function B4(t){return!!(t&&"delay"in t)}class V${constructor(e,n,r){var s;r===void 0&&(r=xLe(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:a}=i;this.props=e,this.events=n,this.document=qv(a),this.documentListeners=new Tb(this.document),this.listeners=new Tb(r),this.windowListeners=new Tb(ii(a)),this.initialCoordinates=(s=qC(i))!=null?s:Na,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),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Do.Resize,this.handleCancel),this.windowListeners.add(Do.DragStart,F4),this.windowListeners.add(Do.VisibilityChange,this.handleCancel),this.windowListeners.add(Do.ContextMenu,F4),this.documentListeners.add(Do.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(B4(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(j4(n)){this.handlePending(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)}handlePending(e,n){const{active:r,onPending:s}=this.props;s(r,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(Do.Click,SLe,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Do.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:a,options:{activationConstraint:o}}=i;if(!s)return;const c=(n=qC(e))!=null?n:Na,u=GC(s,c);if(!r&&o){if(j4(o)){if(o.tolerance!=null&&dk(u,o.tolerance))return this.handleCancel();if(dk(u,o.distance))return this.handleStart()}if(B4(o)&&dk(u,o.tolerance))return this.handleCancel();this.handlePending(o,u);return}e.cancelable&&e.preventDefault(),a(c)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===nn.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const CLe={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class fZ extends V${constructor(e){const{event:n}=e,r=qv(n.target);super(e,CLe,r)}}fZ.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 ALe={move:{name:"mousemove"},end:{name:"mouseup"}};var UD;(function(t){t[t.RightClick=2]="RightClick"})(UD||(UD={}));class RLe extends V${constructor(e){super(e,ALe,qv(e.event.target))}}RLe.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===UD.RightClick?!1:(r==null||r({event:n}),!0)}}];const fk={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class PLe extends V${constructor(e){super(e,fk)}static setup(){return window.addEventListener(fk.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(fk.move.name,e)};function e(){}}}PLe.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 kb;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(kb||(kb={}));var YC;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(YC||(YC={}));function TLe(t){let{acceleration:e,activator:n=kb.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:a=5,order:o=YC.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:f,delta:l,threshold:d}=t;const m=NLe({delta:l,disabled:!i}),[p,h]=UMe(),y=_.useRef({x:0,y:0}),g=_.useRef({x:0,y:0}),v=_.useMemo(()=>{switch(n){case kb.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case kb.DraggableRect:return s}},[n,s,c]),w=_.useRef(null),x=_.useCallback(()=>{const T=w.current;if(!T)return;const R=y.current.x*g.current.x,E=y.current.y*g.current.y;T.scrollBy(R,E)},[]),A=_.useMemo(()=>o===YC.TreeOrder?[...u].reverse():u,[o,u]);_.useEffect(()=>{if(!i||!u.length||!v){h();return}for(const T of A){if((r==null?void 0:r(T))===!1)continue;const R=u.indexOf(T),E=f[R];if(!E)continue;const{direction:k,speed:N}=vLe(T,E,v,e,d);for(const O of["x","y"])m[O][k[O]]||(N[O]=0,k[O]=0);if(N.x>0||N.y>0){h(),w.current=T,p(x,a),y.current=N,g.current=k;return}}y.current={x:0,y:0},g.current={x:0,y:0},h()},[e,x,r,h,i,a,JSON.stringify(v),JSON.stringify(m),p,u,A,f,JSON.stringify(d)])}const kLe={x:{[Jr.Backward]:!1,[Jr.Forward]:!1},y:{[Jr.Backward]:!1,[Jr.Forward]:!1}};function NLe(t){let{delta:e,disabled:n}=t;const r=WC(e);return B_(s=>{if(n||!r||!s)return kLe;const i={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[Jr.Backward]:s.x[Jr.Backward]||i.x===-1,[Jr.Forward]:s.x[Jr.Forward]||i.x===1},y:{[Jr.Backward]:s.y[Jr.Backward]||i.y===-1,[Jr.Forward]:s.y[Jr.Forward]||i.y===1}}},[n,e,r])}function DLe(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return B_(s=>{var i;return e==null?null:(i=r??s)!=null?i:null},[r,e])}function OLe(t,e){return _.useMemo(()=>t.reduce((n,r)=>{const{sensor:s}=r,i=s.activators.map(a=>({eventName:a.eventName,handler:e(a.handler,r)}));return[...n,...i]},[]),[t,e])}var v0;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(v0||(v0={}));var HD;(function(t){t.Optimized="optimized"})(HD||(HD={}));const z4=new Map;function MLe(t,e){let{dragging:n,dependencies:r,config:s}=e;const[i,a]=_.useState(null),{frequency:o,measure:c,strategy:u}=s,f=_.useRef(t),l=y(),d=g0(l),m=_.useCallback(function(g){g===void 0&&(g=[]),!d.current&&a(v=>v===null?g:v.concat(g.filter(w=>!v.includes(w))))},[d]),p=_.useRef(null),h=B_(g=>{if(l&&!n)return z4;if(!g||g===z4||f.current!==t||i!=null){const v=new Map;for(let w of t){if(!w)continue;if(i&&i.length>0&&!i.includes(w.id)&&w.rect.current){v.set(w.id,w.rect.current);continue}const x=w.node.current,A=x?new H$(c(x),x):null;w.rect.current=A,A&&v.set(w.id,A)}return v}return g},[t,i,n,l,c]);return _.useEffect(()=>{f.current=t},[t]),_.useEffect(()=>{l||m()},[n,l]),_.useEffect(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),_.useEffect(()=>{l||typeof o!="number"||p.current!==null||(p.current=setTimeout(()=>{m(),p.current=null},o))},[o,l,m,...r]),{droppableRects:h,measureDroppableContainers:m,measuringScheduled:i!=null};function y(){switch(u){case v0.Always:return!1;case v0.BeforeDragging:return n;default:return!n}}}function W$(t,e){return B_(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function LLe(t,e){return W$(t,e)}function ILe(t){let{callback:e,disabled:n}=t;const r=GA(e),s=_.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return _.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function KA(t){let{callback:e,disabled:n}=t;const r=GA(e),s=_.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return _.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function $Le(t){return new H$(Kv(t),t)}function U4(t,e,n){e===void 0&&(e=$Le);const[r,s]=_.useState(null);function i(){s(c=>{if(!t)return null;if(t.isConnected===!1){var u;return(u=c??n)!=null?u:null}const f=e(t);return JSON.stringify(c)===JSON.stringify(f)?c:f})}const a=ILe({callback(c){if(t)for(const u of c){const{type:f,target:l}=u;if(f==="childList"&&l instanceof HTMLElement&&l.contains(t)){i();break}}}}),o=KA({callback:i});return ka(()=>{i(),t?(o==null||o.observe(t),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(o==null||o.disconnect(),a==null||a.disconnect())},[t]),r}function FLe(t){const e=W$(t);return tZ(t,e)}const H4=[];function jLe(t){const e=_.useRef(t),n=B_(r=>t?r&&r!==H4&&t&&e.current&&t.parentNode===e.current.parentNode?r:U$(t):H4,[t]);return _.useEffect(()=>{e.current=t},[t]),n}function BLe(t){const[e,n]=_.useState(null),r=_.useRef(t),s=_.useCallback(i=>{const a=uk(i.target);a&&n(o=>o?(o.set(a,zD(a)),new Map(o)):null)},[]);return _.useEffect(()=>{const i=r.current;if(t!==i){a(i);const o=t.map(c=>{const u=uk(c);return u?(u.addEventListener("scroll",s,{passive:!0}),[u,zD(u)]):null}).filter(c=>c!=null);n(o.length?new Map(o):null),r.current=t}return()=>{a(t),a(i)};function a(o){o.forEach(c=>{const u=uk(c);u==null||u.removeEventListener("scroll",s)})}},[s,t]),_.useMemo(()=>t.length?e?Array.from(e.values()).reduce((i,a)=>qm(i,a),Na):lZ(t):Na,[t,e])}function V4(t,e){e===void 0&&(e=[]);const n=_.useRef(null);return _.useEffect(()=>{n.current=null},e),_.useEffect(()=>{const r=t!==Na;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?GC(t,n.current):Na}function zLe(t){_.useEffect(()=>{if(!WA)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 ULe(t,e){return _.useMemo(()=>t.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=a=>{i(a,e)},n},{}),[t,e])}function hZ(t){return _.useMemo(()=>t?hLe(t):null,[t])}const W4=[];function HLe(t,e){e===void 0&&(e=Kv);const[n]=t,r=hZ(n?ii(n):null),[s,i]=_.useState(W4);function a(){i(()=>t.length?t.map(c=>oZ(c)?r:new H$(e(c),c)):W4)}const o=KA({callback:a});return ka(()=>{o==null||o.disconnect(),a(),t.forEach(c=>o==null?void 0:o.observe(c))},[t]),s}function pZ(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return j_(e)?e:t}function VLe(t){let{measure:e}=t;const[n,r]=_.useState(null),s=_.useCallback(u=>{for(const{target:f}of u)if(j_(f)){r(l=>{const d=e(f);return l?{...l,width:d.width,height:d.height}:d});break}},[e]),i=KA({callback:s}),a=_.useCallback(u=>{const f=pZ(u);i==null||i.disconnect(),f&&(i==null||i.observe(f)),r(f?e(f):null)},[e,i]),[o,c]=VC(a);return _.useMemo(()=>({nodeRef:o,rect:n,setRef:c}),[n,o,c])}const WLe=[{sensor:fZ,options:{}},{sensor:dZ,options:{}}],GLe={current:{}},nE={draggable:{measure:$4},droppable:{measure:$4,strategy:v0.WhileDragging,frequency:HD.Optimized},dragOverlay:{measure:Kv}};class Nb 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 qLe={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Nb,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:KC},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:nE,measureDroppableContainers:KC,windowRect:null,measuringScheduled:!1},mZ={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:KC,draggableNodes:new Map,over:null,measureDroppableContainers:KC},U_=_.createContext(mZ),gZ=_.createContext(qLe);function KLe(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Nb}}}function YLe(t,e){switch(e.type){case Hr.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case Hr.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case Hr.DragEnd:case Hr.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Hr.RegisterDroppable:{const{element:n}=e,{id:r}=n,s=new Nb(t.droppable.containers);return s.set(r,n),{...t,droppable:{...t.droppable,containers:s}}}case Hr.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=e,i=t.droppable.containers.get(n);if(!i||r!==i.key)return t;const a=new Nb(t.droppable.containers);return a.set(n,{...i,disabled:s}),{...t,droppable:{...t.droppable,containers:a}}}case Hr.UnregisterDroppable:{const{id:n,key:r}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const i=new Nb(t.droppable.containers);return i.delete(n),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function XLe(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:s}=_.useContext(U_),i=WC(r),a=WC(n==null?void 0:n.id);return _.useEffect(()=>{if(!e&&!r&&i&&a!=null){if(!qA(i)||document.activeElement===i.target)return;const o=s.get(a);if(!o)return;const{activatorNode:c,node:u}=o;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[c.current,u.current]){if(!f)continue;const l=WMe(f);if(l){l.focus();break}}})}},[r,e,s,a,i]),null}function vZ(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((s,i)=>i({transform:s,...r}),n):n}function QLe(t){return _.useMemo(()=>({draggable:{...nE.draggable,...t==null?void 0:t.draggable},droppable:{...nE.droppable,...t==null?void 0:t.droppable},dragOverlay:{...nE.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 ZLe(t){let{activeNode:e,measure:n,initialRect:r,config:s=!0}=t;const i=_.useRef(!1),{x:a,y:o}=typeof s=="boolean"?{x:s,y:s}:s;ka(()=>{if(!a&&!o||!e){i.current=!1;return}if(i.current||!r)return;const u=e==null?void 0:e.node.current;if(!u||u.isConnected===!1)return;const f=n(u),l=tZ(f,r);if(a||(l.x=0),o||(l.y=0),i.current=!0,Math.abs(l.x)>0||Math.abs(l.y)>0){const d=rZ(u);d&&d.scrollBy({top:l.y,left:l.x})}},[e,a,o,r,n])}const YA=_.createContext({...Na,scaleX:1,scaleY:1});var Tu;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Tu||(Tu={}));const o5e=_.memo(function(e){var n,r,s,i;let{id:a,accessibility:o,autoScroll:c=!0,children:u,sensors:f=WLe,collisionDetection:l=aLe,measuring:d,modifiers:m,...p}=e;const h=_.useReducer(YLe,void 0,KLe),[y,g]=h,[v,w]=QMe(),[x,A]=_.useState(Tu.Uninitialized),T=x===Tu.Initialized,{draggable:{active:R,nodes:E,translate:k},droppable:{containers:N}}=y,O=R!=null?E.get(R):null,L=_.useRef({initial:null,translated:null}),I=_.useMemo(()=>{var nt;return R!=null?{id:R,data:(nt=O==null?void 0:O.data)!=null?nt:GLe,rect:L}:null},[R,O]),F=_.useRef(null),[U,Y]=_.useState(null),[V,H]=_.useState(null),ee=g0(p,Object.values(p)),re=z_("DndDescribedBy",a),X=_.useMemo(()=>N.getEnabled(),[N]),q=QLe(d),{droppableRects:K,measureDroppableContainers:Z,measuringScheduled:ue}=MLe(X,{dragging:T,dependencies:[k.x,k.y],config:q.droppable}),de=DLe(E,R),ie=_.useMemo(()=>V?qC(V):null,[V]),be=St(),Ae=LLe(de,q.draggable.measure);ZLe({activeNode:R!=null?E.get(R):null,config:be.layoutShiftCompensation,initialRect:Ae,measure:q.draggable.measure});const _e=U4(de,q.draggable.measure,Ae),Me=U4(de?de.parentElement:null),De=_.useRef({activatorEvent:null,active:null,activeNode:de,collisionRect:null,collisions:null,droppableRects:K,draggableNodes:E,draggingNode:null,draggingNodeRect:null,droppableContainers:N,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ye=N.getNodeFor((n=De.current.over)==null?void 0:n.id),Fe=VLe({measure:q.dragOverlay.measure}),ut=(r=Fe.nodeRef.current)!=null?r:de,Qe=T?(s=Fe.rect)!=null?s:_e:null,vt=!!(Fe.nodeRef.current&&Fe.rect),An=FLe(vt?null:_e),Yt=hZ(ut?ii(ut):null),gn=jLe(T?ye??de:null),Xt=HLe(gn),J=vZ(m,{transform:{x:k.x-An.x,y:k.y-An.y,scaleX:1,scaleY:1},activatorEvent:V,active:I,activeNodeRect:_e,containerNodeRect:Me,draggingNodeRect:Qe,over:De.current.over,overlayNodeRect:Fe.rect,scrollableAncestors:gn,scrollableAncestorRects:Xt,windowRect:Yt}),fe=ie?qm(ie,k):null,ge=BLe(gn),Pe=V4(ge),Oe=V4(ge,[_e]),xe=qm(J,Pe),Te=Qe?uLe(Qe,J):null,Ye=I&&Te?l({active:I,collisionRect:Te,droppableRects:K,droppableContainers:X,pointerCoordinates:fe}):null,Rt=iLe(Ye,"id"),[bt,$s]=_.useState(null),Qn=vt?J:qm(J,Oe),ys=lLe(Qn,(i=bt==null?void 0:bt.rect)!=null?i:null,_e),Ut=_.useRef(null),on=_.useCallback((nt,Ht)=>{let{sensor:Ct,options:yn}=Ht;if(F.current==null)return;const an=E.get(F.current);if(!an)return;const ln=nt.nativeEvent,Dn=new Ct({active:F.current,activeNode:an,event:ln,options:yn,context:De,onAbort(On){if(!E.get(On))return;const{onDragAbort:oe}=ee.current,he={id:On};oe==null||oe(he),v({type:"onDragAbort",event:he})},onPending(On,te,oe,he){if(!E.get(On))return;const{onDragPending:Ie}=ee.current,qe={id:On,constraint:te,initialCoordinates:oe,offset:he};Ie==null||Ie(qe),v({type:"onDragPending",event:qe})},onStart(On){const te=F.current;if(te==null)return;const oe=E.get(te);if(!oe)return;const{onDragStart:he}=ee.current,Ce={activatorEvent:ln,active:{id:te,data:oe.data,rect:L}};Ms.unstable_batchedUpdates(()=>{he==null||he(Ce),A(Tu.Initializing),g({type:Hr.DragStart,initialCoordinates:On,active:te}),v({type:"onDragStart",event:Ce}),Y(Ut.current),H(ln)})},onMove(On){g({type:Hr.DragMove,coordinates:On})},onEnd:gr(Hr.DragEnd),onCancel:gr(Hr.DragCancel)});Ut.current=Dn;function gr(On){return async function(){const{active:oe,collisions:he,over:Ce,scrollAdjustedTranslate:Ie}=De.current;let qe=null;if(oe&&Ie){const{cancelDrop:st}=ee.current;qe={activatorEvent:ln,active:oe,collisions:he,delta:Ie,over:Ce},On===Hr.DragEnd&&typeof st=="function"&&await Promise.resolve(st(qe))&&(On=Hr.DragCancel)}F.current=null,Ms.unstable_batchedUpdates(()=>{g({type:On}),A(Tu.Uninitialized),$s(null),Y(null),H(null),Ut.current=null;const st=On===Hr.DragEnd?"onDragEnd":"onDragCancel";if(qe){const He=ee.current[st];He==null||He(qe),v({type:st,event:qe})}})}}},[E]),vn=_.useCallback((nt,Ht)=>(Ct,yn)=>{const an=Ct.nativeEvent,ln=E.get(yn);if(F.current!==null||!ln||an.dndKit||an.defaultPrevented)return;const Dn={active:ln};nt(Ct,Ht.options,Dn)===!0&&(an.dndKit={capturedBy:Ht.sensor},F.current=yn,on(Ct,Ht))},[E,on]),Ue=OLe(f,vn);zLe(f),ka(()=>{_e&&x===Tu.Initializing&&A(Tu.Initialized)},[_e,x]),_.useEffect(()=>{const{onDragMove:nt}=ee.current,{active:Ht,activatorEvent:Ct,collisions:yn,over:an}=De.current;if(!Ht||!Ct)return;const ln={active:Ht,activatorEvent:Ct,collisions:yn,delta:{x:xe.x,y:xe.y},over:an};Ms.unstable_batchedUpdates(()=>{nt==null||nt(ln),v({type:"onDragMove",event:ln})})},[xe.x,xe.y]),_.useEffect(()=>{const{active:nt,activatorEvent:Ht,collisions:Ct,droppableContainers:yn,scrollAdjustedTranslate:an}=De.current;if(!nt||F.current==null||!Ht||!an)return;const{onDragOver:ln}=ee.current,Dn=yn.get(Rt),gr=Dn&&Dn.rect.current?{id:Dn.id,rect:Dn.rect.current,data:Dn.data,disabled:Dn.disabled}:null,On={active:nt,activatorEvent:Ht,collisions:Ct,delta:{x:an.x,y:an.y},over:gr};Ms.unstable_batchedUpdates(()=>{$s(gr),ln==null||ln(On),v({type:"onDragOver",event:On})})},[Rt]),ka(()=>{De.current={activatorEvent:V,active:I,activeNode:de,collisionRect:Te,collisions:Ye,droppableRects:K,draggableNodes:E,draggingNode:ut,draggingNodeRect:Qe,droppableContainers:N,over:bt,scrollableAncestors:gn,scrollAdjustedTranslate:xe},L.current={initial:Qe,translated:Te}},[I,de,Ye,Te,E,ut,Qe,K,N,bt,gn,xe]),TLe({...be,delta:k,draggingRect:Te,pointerCoordinates:fe,scrollableAncestors:gn,scrollableAncestorRects:Xt});const it=_.useMemo(()=>({active:I,activeNode:de,activeNodeRect:_e,activatorEvent:V,collisions:Ye,containerNodeRect:Me,dragOverlay:Fe,draggableNodes:E,droppableContainers:N,droppableRects:K,over:bt,measureDroppableContainers:Z,scrollableAncestors:gn,scrollableAncestorRects:Xt,measuringConfiguration:q,measuringScheduled:ue,windowRect:Yt}),[I,de,_e,V,Ye,Me,Fe,E,N,K,bt,Z,gn,Xt,q,ue,Yt]),ot=_.useMemo(()=>({activatorEvent:V,activators:Ue,active:I,activeNodeRect:_e,ariaDescribedById:{draggable:re},dispatch:g,draggableNodes:E,over:bt,measureDroppableContainers:Z}),[V,Ue,I,_e,g,re,E,bt,Z]);return se.createElement(eZ.Provider,{value:w},se.createElement(U_.Provider,{value:ot},se.createElement(gZ.Provider,{value:it},se.createElement(YA.Provider,{value:ys},u)),se.createElement(XLe,{disabled:(o==null?void 0:o.restoreFocus)===!1})),se.createElement(eLe,{...o,hiddenTextDescribedById:re}));function St(){const nt=(U==null?void 0:U.autoScrollEnabled)===!1,Ht=typeof c=="object"?c.enabled===!1:c===!1,Ct=T&&!nt&&!Ht;return typeof c=="object"?{...c,enabled:Ct}:{enabled:Ct}}}),JLe=_.createContext(null),G4="button",eIe="Draggable";function tIe(t){let{id:e,data:n,disabled:r=!1,attributes:s}=t;const i=z_(eIe),{activators:a,activatorEvent:o,active:c,activeNodeRect:u,ariaDescribedById:f,draggableNodes:l,over:d}=_.useContext(U_),{role:m=G4,roleDescription:p="draggable",tabIndex:h=0}=s??{},y=(c==null?void 0:c.id)===e,g=_.useContext(y?YA:JLe),[v,w]=VC(),[x,A]=VC(),T=ULe(a,e),R=g0(n);ka(()=>(l.set(e,{id:e,key:i,node:v,activatorNode:x,data:R}),()=>{const k=l.get(e);k&&k.key===i&&l.delete(e)}),[l,e]);const E=_.useMemo(()=>({role:m,tabIndex:h,"aria-disabled":r,"aria-pressed":y&&m===G4?!0:void 0,"aria-roledescription":p,"aria-describedby":f.draggable}),[r,m,h,y,p,f.draggable]);return{active:c,activatorEvent:o,activeNodeRect:u,attributes:E,isDragging:y,listeners:r?void 0:T,node:v,over:d,setNodeRef:w,setActivatorNodeRef:A,transform:g}}function yZ(){return _.useContext(gZ)}const nIe="Droppable",rIe={timeout:25};function sIe(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:s}=t;const i=z_(nIe),{active:a,dispatch:o,over:c,measureDroppableContainers:u}=_.useContext(U_),f=_.useRef({disabled:n}),l=_.useRef(!1),d=_.useRef(null),m=_.useRef(null),{disabled:p,updateMeasurementsFor:h,timeout:y}={...rIe,...s},g=g0(h??r),v=_.useCallback(()=>{if(!l.current){l.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{u(Array.isArray(g.current)?g.current:[g.current]),m.current=null},y)},[y]),w=KA({callback:v,disabled:p||!a}),x=_.useCallback((E,k)=>{w&&(k&&(w.unobserve(k),l.current=!1),E&&w.observe(E))},[w]),[A,T]=VC(x),R=g0(e);return _.useEffect(()=>{!w||!A.current||(w.disconnect(),l.current=!1,w.observe(A.current))},[A,w]),_.useEffect(()=>(o({type:Hr.RegisterDroppable,element:{id:r,key:i,disabled:n,node:A,rect:d,data:R}}),()=>o({type:Hr.UnregisterDroppable,key:i,id:r})),[r]),_.useEffect(()=>{n!==f.current.disabled&&(o({type:Hr.SetDroppableDisabled,id:r,key:i,disabled:n}),f.current.disabled=n)},[r,i,n,o]),{active:a,rect:d,isOver:(c==null?void 0:c.id)===r,node:A,over:c,setNodeRef:T}}function iIe(t){let{animation:e,children:n}=t;const[r,s]=_.useState(null),[i,a]=_.useState(null),o=WC(n);return!n&&!r&&o&&s(o),ka(()=>{if(!i)return;const c=r==null?void 0:r.key,u=r==null?void 0:r.props.id;if(c==null||u==null){s(null);return}Promise.resolve(e(u,i)).then(()=>{s(null)})},[e,r,i]),se.createElement(se.Fragment,null,n,r?_.cloneElement(r,{ref:a}):null)}const oIe={x:0,y:0,scaleX:1,scaleY:1};function aIe(t){let{children:e}=t;return se.createElement(U_.Provider,{value:mZ},se.createElement(YA.Provider,{value:oIe},e))}const lIe={position:"fixed",touchAction:"none"},cIe=t=>qA(t)?"transform 250ms ease":void 0,uIe=_.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:s,children:i,className:a,rect:o,style:c,transform:u,transition:f=cIe}=t;if(!o)return null;const l=s?u:{...u,scaleX:1,scaleY:1},d={...lIe,width:o.width,height:o.height,top:o.top,left:o.left,transform:np.Transform.toString(l),transformOrigin:s&&r?nLe(r,o):void 0,transition:typeof f=="function"?f(r):f,...c};return se.createElement(n,{className:a,style:d,ref:e},i)}),dIe=t=>e=>{let{active:n,dragOverlay:r}=e;const s={},{styles:i,className:a}=t;if(i!=null&&i.active)for(const[o,c]of Object.entries(i.active))c!==void 0&&(s[o]=n.node.style.getPropertyValue(o),n.node.style.setProperty(o,c));if(i!=null&&i.dragOverlay)for(const[o,c]of Object.entries(i.dragOverlay))c!==void 0&&r.node.style.setProperty(o,c);return a!=null&&a.active&&n.node.classList.add(a.active),a!=null&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[c,u]of Object.entries(s))n.node.style.setProperty(c,u);a!=null&&a.active&&n.node.classList.remove(a.active)}},fIe=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:np.Transform.toString(e)},{transform:np.Transform.toString(n)}]},hIe={duration:250,easing:"ease",keyframes:fIe,sideEffects:dIe({styles:{active:{opacity:"0"}}})};function pIe(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:s}=t;return GA((i,a)=>{if(e===null)return;const o=n.get(i);if(!o)return;const c=o.node.current;if(!c)return;const u=pZ(a);if(!u)return;const{transform:f}=ii(a).getComputedStyle(a),l=nZ(f);if(!l)return;const d=typeof e=="function"?e:mIe(e);return cZ(c,s.draggable.measure),d({active:{id:i,data:o.data,node:c,rect:s.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:a,rect:s.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:s,transform:l})})}function mIe(t){const{duration:e,easing:n,sideEffects:r,keyframes:s}={...hIe,...t};return i=>{let{active:a,dragOverlay:o,transform:c,...u}=i;if(!e)return;const f={x:o.rect.left-a.rect.left,y:o.rect.top-a.rect.top},l={scaleX:c.scaleX!==1?a.rect.width*c.scaleX/o.rect.width:1,scaleY:c.scaleY!==1?a.rect.height*c.scaleY/o.rect.height:1},d={x:c.x-f.x,y:c.y-f.y,...l},m=s({...u,active:a,dragOverlay:o,transform:{initial:c,final:d}}),[p]=m,h=m[m.length-1];if(JSON.stringify(p)===JSON.stringify(h))return;const y=r==null?void 0:r({active:a,dragOverlay:o,...u}),g=o.node.animate(m,{duration:e,easing:n,fill:"forwards"});return new Promise(v=>{g.onfinish=()=>{y==null||y(),v()}})}}let q4=0;function gIe(t){return _.useMemo(()=>{if(t!=null)return q4++,q4},[t])}const a5e=se.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:r,style:s,transition:i,modifiers:a,wrapperElement:o="div",className:c,zIndex:u=999}=t;const{activatorEvent:f,active:l,activeNodeRect:d,containerNodeRect:m,draggableNodes:p,droppableContainers:h,dragOverlay:y,over:g,measuringConfiguration:v,scrollableAncestors:w,scrollableAncestorRects:x,windowRect:A}=yZ(),T=_.useContext(YA),R=gIe(l==null?void 0:l.id),E=vZ(a,{activatorEvent:f,active:l,activeNodeRect:d,containerNodeRect:m,draggingNodeRect:y.rect,over:g,overlayNodeRect:y.rect,scrollableAncestors:w,scrollableAncestorRects:x,transform:T,windowRect:A}),k=W$(d),N=pIe({config:r,draggableNodes:p,droppableContainers:h,measuringConfiguration:v}),O=k?y.setRef:void 0;return se.createElement(aIe,null,se.createElement(iIe,{animation:N},l&&R?se.createElement(uIe,{key:R,id:l.id,ref:O,as:o,activatorEvent:f,adjustScale:e,className:c,transition:i,rect:k,style:{zIndex:u,...s},transform:E},n):null))});function bZ(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function vIe(t,e){return t.reduce((n,r,s)=>{const i=e.get(r);return i&&(n[s]=i),n},Array(t.length))}function RS(t){return t!==null&&t>=0}function yIe(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=bZ(e,r,n),a=e[s],o=i[s];return!o||!a?null:{x:o.left-a.left,y:o.top-a.top,scaleX:o.width/a.width,scaleY:o.height/a.height}},PS={scaleX:1,scaleY:1},l5e=t=>{var e;let{activeIndex:n,activeNodeRect:r,index:s,rects:i,overIndex:a}=t;const o=(e=i[n])!=null?e:r;if(!o)return null;if(s===n){const u=i[a];return u?{x:0,y:nn&&s<=a?{x:0,y:-o.height-c,...PS}:s=a?{x:0,y:o.height+c,...PS}:{x:0,y:0,...PS}};function wIe(t,e,n){const r=t[e],s=t[e-1],i=t[e+1];return r?nr.map(T=>typeof T=="object"&&"id"in T?T.id:T),[r]),p=a!=null,h=a?m.indexOf(a.id):-1,y=u?m.indexOf(u.id):-1,g=_.useRef(m),v=!yIe(m,g.current),w=y!==-1&&h===-1||v,x=bIe(i);ka(()=>{v&&p&&f(m)},[v,m,p,f]),_.useEffect(()=>{g.current=m},[m]);const A=_.useMemo(()=>({activeIndex:h,containerId:l,disabled:x,disableTransforms:w,items:m,overIndex:y,useDragOverlay:d,sortedRects:vIe(m,c),strategy:s}),[h,l,x.draggable,x.droppable,w,m,y,c,d,s]);return se.createElement(xZ.Provider,{value:A},e)}const _Ie=t=>{let{id:e,items:n,activeIndex:r,overIndex:s}=t;return bZ(n,r,s).indexOf(e)},xIe=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:s,items:i,newIndex:a,previousItems:o,previousContainerId:c,transition:u}=t;return!u||!r||o!==i&&s===a?!1:n?!0:a!==s&&e===c},SIe={duration:200,easing:"ease"},SZ="transform",EIe=np.Transition.toString({property:SZ,duration:0,easing:"linear"}),CIe={roleDescription:"sortable"};function AIe(t){let{disabled:e,index:n,node:r,rect:s}=t;const[i,a]=_.useState(null),o=_.useRef(n);return ka(()=>{if(!e&&n!==o.current&&r.current){const c=s.current;if(c){const u=Kv(r.current,{ignoreTransform:!0}),f={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(f.x||f.y)&&a(f)}}n!==o.current&&(o.current=n)},[e,n,r,s]),_.useEffect(()=>{i&&a(null)},[i]),i}function u5e(t){let{animateLayoutChanges:e=xIe,attributes:n,disabled:r,data:s,getNewIndex:i=_Ie,id:a,strategy:o,resizeObserverConfig:c,transition:u=SIe}=t;const{items:f,containerId:l,activeIndex:d,disabled:m,disableTransforms:p,sortedRects:h,overIndex:y,useDragOverlay:g,strategy:v}=_.useContext(xZ),w=RIe(r,m),x=f.indexOf(a),A=_.useMemo(()=>({sortable:{containerId:l,index:x,items:f},...s}),[l,s,x,f]),T=_.useMemo(()=>f.slice(f.indexOf(a)),[f,a]),{rect:R,node:E,isOver:k,setNodeRef:N}=sIe({id:a,data:A,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:T,...c}}),{active:O,activatorEvent:L,activeNodeRect:I,attributes:F,setNodeRef:U,listeners:Y,isDragging:V,over:H,setActivatorNodeRef:ee,transform:re}=tIe({id:a,data:A,attributes:{...CIe,...n},disabled:w.draggable}),X=zMe(N,U),q=!!O,K=q&&!p&&RS(d)&&RS(y),Z=!g&&V,ue=Z&&K?re:null,ie=K?ue??(o??v)({rects:h,activeNodeRect:I,activeIndex:d,overIndex:y,index:x}):null,be=RS(d)&&RS(y)?i({id:a,items:f,activeIndex:d,overIndex:y}):x,Ae=O==null?void 0:O.id,_e=_.useRef({activeId:Ae,items:f,newIndex:be,containerId:l}),Me=f!==_e.current.items,De=e({active:O,containerId:l,isDragging:V,isSorting:q,id:a,index:x,items:f,newIndex:_e.current.newIndex,previousItems:_e.current.items,previousContainerId:_e.current.containerId,transition:u,wasDragging:_e.current.activeId!=null}),ye=AIe({disabled:!De,index:x,node:E,rect:R});return _.useEffect(()=>{q&&_e.current.newIndex!==be&&(_e.current.newIndex=be),l!==_e.current.containerId&&(_e.current.containerId=l),f!==_e.current.items&&(_e.current.items=f)},[q,be,l,f]),_.useEffect(()=>{if(Ae===_e.current.activeId)return;if(Ae&&!_e.current.activeId){_e.current.activeId=Ae;return}const ut=setTimeout(()=>{_e.current.activeId=Ae},50);return()=>clearTimeout(ut)},[Ae]),{active:O,activeIndex:d,attributes:F,data:A,rect:R,index:x,newIndex:be,items:f,isOver:k,isSorting:q,isDragging:V,listeners:Y,node:E,overIndex:y,over:H,setNodeRef:X,setActivatorNodeRef:ee,setDroppableNodeRef:N,setDraggableNodeRef:U,transform:ye??ie,transition:Fe()};function Fe(){if(ye||Me&&_e.current.newIndex===x)return EIe;if(!(Z&&!qA(L)||!u)&&(q||De))return np.Transition.toString({...u,property:SZ})}}function RIe(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}}nn.Down,nn.Right,nn.Up,nn.Left;const EZ=({title:t="Se ha producido un error",subtitle:e=void 0,description:n=void 0,errorMessage:r=void 0})=>{const s=Wv();return P.jsx("div",{className:"grid h-screen place-items-center ",children:P.jsxs("div",{className:"text-center",children:[P.jsx("h2",{className:"mt-2 text-xl font-semibold text-center text-slate-900",children:t}),P.jsxs("p",{className:"mt-1 font-medium text-slate-500",children:[e||r,P.jsx("br",{}),n]}),P.jsxs("div",{className:"mt-6 space-x-8 md:ml-4",children:[P.jsx(BMe,{}),P.jsxs(ao,{onClick:()=>s("/"),children:[P.jsx(jfe,{className:"w-4 h-4 mr-2"})," Ir al inicio"]})]})]})})};EZ.displayName="ErrorOverlay";var Zt=function(){return Zt=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 a=t.length>n?new RegExp("(\\d+)(\\d{".concat(n,"})")):new RegExp("(\\d)(\\d+)"),o=t.match(a);if(o){var s=o[1],i=o[2];return"".concat(s).concat(e).concat(i)}}return t},CZ=function(t,e){var n=e.groupSeparator,r=n===void 0?",":n,s=e.decimalSeparator,i=s===void 0?".":s,a=new RegExp("\\d([^".concat(Cl(r)).concat(Cl(i),"0-9]+)")),o=t.match(a);return o?o[1]:void 0},$y=function(t){var e=t.value,n=t.decimalSeparator,r=t.intlConfig,s=t.decimalScale,i=t.prefix,a=i===void 0?"":i,o=t.suffix,c=o===void 0?"":o;if(e===""||e===void 0)return"";if(e==="-")return"-";var u=new RegExp("^\\d?-".concat(a?"".concat(Cl(a),"?"):"","\\d")).test(e),f=n!=="."?OIe(e,n,u):e;n&&n!=="-"&&f.startsWith(n)&&(f="0"+f);var l=r||{},d=l.locale,m=l.currency,p=G$(l,["locale","currency"]),h=Zt(Zt({},p),{minimumFractionDigits:s||0,maximumFractionDigits:20}),y=r?new Intl.NumberFormat(d,Zt(Zt({},h),m&&{style:"currency",currency:m})):new Intl.NumberFormat(void 0,h),g=y.formatToParts(Number(f)),v=MIe(g,t),w=CZ(v,Zt({},t)),x=e.slice(-1)===n?n:"",A=f.match(RegExp("\\d+\\.(\\d+)"))||[],T=A[1];return s===void 0&&T&&n&&(v.includes(n)?v=v.replace(RegExp("(\\d+)(".concat(Cl(n),")(\\d+)"),"g"),"$1$2".concat(T)):w&&!c?v=v.replace(w,"".concat(n).concat(T).concat(w)):v="".concat(v).concat(n).concat(T)),c&&x?"".concat(v).concat(x).concat(c):w&&x?v.replace(w,"".concat(x).concat(w)):w&&c?v.replace(w,"".concat(x).concat(c)):[v,x,c].join("")},OIe=function(t,e,n){var r=t;return e&&e!=="."&&(r=r.replace(RegExp(Cl(e),"g"),"."),n&&e==="-"&&(r="-".concat(r.slice(1)))),r},MIe=function(t,e){var n=e.prefix,r=e.groupSeparator,s=e.decimalSeparator,i=e.decimalScale,a=e.disableGroupSeparators,o=a===void 0?!1:a;return t.reduce(function(c,u,f){var l=u.type,d=u.value;return f===0&&n?l==="minusSign"?[d,n]:l==="currency"?Ui(Ui([],c,!0),[n],!1):[n,d]:l==="currency"?n?c:Ui(Ui([],c,!0),[d],!1):l==="group"?o?c:Ui(Ui([],c,!0),[r!==void 0?r:d],!1):l==="decimal"?i!==void 0&&i===0?c:Ui(Ui([],c,!0),[s!==void 0?s:d],!1):l==="fraction"?Ui(Ui([],c,!0),[i!==void 0?d.slice(0,i):d],!1):Ui(Ui([],c,!0),[d],!1)},[""]).join("")},LIe={currencySymbol:"",groupSeparator:"",decimalSeparator:"",prefix:"",suffix:""},IIe=function(t){var e=t||{},n=e.locale,r=e.currency,s=G$(e,["locale","currency"]),i=n?new Intl.NumberFormat(n,Zt(Zt({},s),r&&{currency:r,style:"currency"})):new Intl.NumberFormat;return i.formatToParts(1000.1).reduce(function(a,o,c){return o.type==="currency"?c===0?Zt(Zt({},a),{currencySymbol:o.value,prefix:o.value}):Zt(Zt({},a),{currencySymbol:o.value,suffix:o.value}):o.type==="group"?Zt(Zt({},a),{groupSeparator:o.value}):o.type==="decimal"?Zt(Zt({},a),{decimalSeparator:o.value}):a},LIe)},K4=function(t){return RegExp(/\d/,"gi").test(t)},$Ie=function(t,e,n){if(n===void 0||e===""||e===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 a=i||"";if(a.lengthp)){if(ot===""||ot==="-"||ot===de){y&&y(void 0,o,{float:null,formatted:"",value:""}),De(ot),An(1);return}var St=de?ot.replace(de,"."):ot,nt=parseFloat(St),Ht=$y(Zt({value:ot},be));if(it!=null){var Ct=it+(Ht.length-Ut.length);Ct=Ct<=0?x?x.length:0:Ct,An(Ct),Xt(gn+1)}if(De(Ht),y){var yn={float:nt,formatted:Ht,value:ot};y(ot,o,yn)}}},xe=function(Ut){var on=Ut.target,vn=on.value,Ue=on.selectionStart;Oe(vn,Ue),Y&&Y(Ut)},Te=function(Ut){return V&&V(Ut),Me?Me.length:0},Ye=function(Ut){var on=Ut.target.value,vn=hk(Zt({value:on},Ae));if(vn==="-"||vn===de||!vn){De(""),H&&H(Ut);return}var Ue=DIe(vn,de,g),it=$Ie(Ue,de,w!==void 0?w:g),ot=de?it.replace(de,"."):it,St=parseFloat(ot),nt=$y(Zt(Zt({},be),{value:it}));y&&K&&y(it,o,{float:St,formatted:nt,value:it}),De(nt),H&&H(Ut)},Rt=function(Ut){var on=Ut.key;if(ge(on),R&&(on==="ArrowUp"||on==="ArrowDown")){Ut.preventDefault(),An(Me.length);var vn=h!=null?String(h):void 0,Ue=de&&vn?vn.replace(de,"."):vn,it=parseFloat(Ue??hk(Zt({value:Me},Ae)))||0,ot=on==="ArrowUp"?it+R:it-R;if(E!==void 0&&otNumber(k))return;var St=String(R).includes(".")?Number(String(R).split(".")[1].length):void 0;Oe(String(St?ot.toFixed(St):ot).replace(".",de))}ee&&ee(Ut)},bt=function(Ut){var on=Ut.key,vn=Ut.currentTarget.selectionStart;if(on!=="ArrowUp"&&on!=="ArrowDown"&&Me!=="-"){var Ue=CZ(Me,{groupSeparator:ie,decimalSeparator:de});if(Ue&&vn&&vn>Me.length-Ue.length&&Pe.current){var it=Me.length-Ue.length;Pe.current.setSelectionRange(it,it)}}re&&re(Ut)};_.useEffect(function(){h==null&&l==null&&De("")},[l,h]),_.useEffect(function(){Fe&&Me!=="-"&&Pe.current&&document.activeElement===Pe.current&&Pe.current.setSelectionRange(vt,vt)},[Me,vt,Pe,Fe,gn]);var $s=function(){return h!=null&&Me!=="-"&&(!de||Me!==de)?$y(Zt(Zt({},be),{decimalScale:Fe?void 0:w,value:String(h)})):Me},Qn=Zt({type:"text",inputMode:"decimal",id:a,name:o,className:c,onChange:xe,onBlur:Ye,onFocus:Te,onKeyDown:Rt,onKeyUp:bt,placeholder:v,disabled:m,value:$s(),ref:Pe},Z);if(u){var ys=u;return se.createElement(ys,Zt({},Qn))}return se.createElement("input",Zt({},Qn))});XA.displayName="CurrencyInput";const _p=_.forwardRef(({children:t,...e},n)=>{var i;const{error:r}=jv();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=sr("common.required_field"))),P.jsx(VK,{ref:n,...e,children:s})});_p.displayName="FormErrorMessage";const xp=se.forwardRef(({label:t,hint:e,required:n,...r},s)=>{const{error:i}=jv(),a=e||(n?sr("common.required"):""),o=i?"text-destructive font-semibold":"";return P.jsxs(HK,{ref:s,className:"flex justify-between text-sm",...r,children:[P.jsx("span",{className:`block font-semibold ${o}`,children:t}),a&&P.jsx("span",{className:`text-xs font-medium text-primary ${o} `,children:a})]})});xp.displayName="FormLabel";const jIe=ri("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"}}),BIe=_.forwardRef(t=>{const{name:e,label:n,hint:r,description:s,placeholder:i,className:a,disabled:o,defaultValue:c,rules:u,readOnly:f,scale:l,currency:d,language:m,variant:p}=t,{control:h}=Ia(),[y,g]=_.useState(""),v={input:w=>{if(w==null||typeof w!="object")return w;const x=zC.create(w);if(x.isFailure)throw console.error(x.error),x.error;const A=x.object.toString();return y.endsWith(",")?A.replace(/.0$/,","):A},output:(w,x,A)=>{const{value:T}=A??{value:null};g(T??"");const R=zC.createFromFormattedValue(T,d.code,l);if(R.isFailure)throw R.error;return R.object.toObject()}};return P.jsx(Fv,{defaultValue:c,control:h,name:e,disabled:o,rules:u,render:({field:w})=>{const x=v.input(w.value),A=o||w.disabled,T=!!((u==null?void 0:u.required)??!1);return P.jsxs(yp,{className:le(a,"space-y-3"),children:[n&&P.jsx(xp,{label:n,hint:r,required:T}),P.jsx(bp,{children:P.jsx(XA,{intlConfig:{locale:m.code,useGrouping:!0},name:w.name,ref:w.ref,onBlur:w.onBlur,disabled:A,readOnly:f,className:le(jIe({variant:p,className:a})),suffix:` ${d==null?void 0:d.symbol}`,groupSeparator:".",decimalSeparator:",",placeholder:i,decimalsLimit:l,decimalScale:l,step:1,value:x,onValueChange:(R,E,k)=>w.onChange(v.output(R,E,k))})}),s&&P.jsx(wp,{children:s}),P.jsx(_p,{})]})}})});BIe.displayName="FormCurrencyField";const d5e=_.forwardRef((t,e)=>{const{label:n,placeholder:r,hint:s,description:i,required:a,disabled:o,className:c,name:u}=t,{control:f}=Ia(),[l,d]=_.useState(!1);return P.jsx(Fv,{control:f,disabled:o,name:u,rules:{required:a},render:({field:m})=>P.jsxs(yp,{ref:e,className:le(c,"flex flex-col space-y-3"),children:[n&&P.jsx(xp,{label:n,hint:s,required:a}),P.jsxs(bPe,{open:l,onOpenChange:d,children:[P.jsx(wPe,{asChild:!0,children:P.jsx(bp,{children:P.jsxs(ao,{disabled:o,variant:"ghost",className:le("pl-3 text-left font-normal","border border-input ",!m.value&&"text-muted-foreground"),children:[m.value?new Date(m.value).toLocaleDateString():r||P.jsx("span",{children:sr("common.pick_date")}),P.jsx(Lfe,{className:le("w-4 h-4 ml-auto disabled:opacity-50 ",o?"text-foreground":"text-ring")})]})})}),P.jsx(c9,{className:"w-auto p-0",align:"start",children:P.jsx(WW,{className:"bg-background",mode:"single",captionLayout:"buttons",defaultMonth:m.value,selected:new Date(m.value),onSelect:p=>{m.onChange(p),d(!1)},disabled:p=>p{const o=se.useId(),c=_.useMemo(()=>e||n||r,[e,n,r]);return P.jsxs(GW,{id:o,className:le(c?"":"pt-6",t),ref:a,children:[c&&P.jsxs(qW,{className:"flex flex-row flex-wrap items-center justify-between sm:flex-nowrap",children:[P.jsxs("div",{children:[e&&P.jsx(KW,{className:"text-lg leading-normal",children:e}),n&&P.jsx(YW,{className:"leading-loose",children:n})]}),r&&P.jsx("div",{className:"flex-shrink-0",children:r})]}),P.jsx(XW,{className:"grid items-start gap-6",children:i}),s&&P.jsx(QW,{className:"px-6 py-4 border-t",style:{borderStyle:"inherit"},children:s})]})});zIe.displayName="FormGroup";const UIe=ri("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"}}),f5e=_.forwardRef(t=>{const{name:e,label:n,hint:r,description:s,placeholder:i,className:a,disabled:o,defaultValue:c,rules:u,readOnly:f,scale:l,variant:d}=t,{control:m}=Ia(),[p,h]=_.useState(""),y={input:g=>{if(typeof g!="object")return g;const v=UC.create(g);if(v.isFailure)throw v.error;const w=v.object.toString();return p.endsWith(",")?w.replace(/.0$/,","):w},output:(g,v,w)=>{const{value:x}=w??{value:null};h(x??"");const A=UC.createFromFormattedValue(x);if(A.isFailure)throw A.error;return A.object.toObject()}};return P.jsx(Fv,{defaultValue:c,control:m,name:e,disabled:o,rules:{max:100,min:0,...u},render:({field:g})=>{const v=y.input(g.value),w=o||g.disabled,x=!!((u==null?void 0:u.required)??!1);return P.jsxs(yp,{className:le(a,"space-y-3"),children:[n&&P.jsx(xp,{label:n,hint:r,required:x}),P.jsx(bp,{children:P.jsx(XA,{name:g.name,ref:g.ref,onBlur:g.onBlur,disabled:w,readOnly:f,className:le(UIe({variant:d,className:a})),groupSeparator:".",decimalSeparator:",",placeholder:i,allowDecimals:l!==0,decimalsLimit:l,decimalScale:l,step:1,value:v,onValueChange:(A,T,R)=>g.onChange(y.output(A,T,R))})}),s&&P.jsx(wp,{children:s}),P.jsx(_p,{})]})}})}),HIe=ri("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"}}),h5e=_.forwardRef(t=>{const{name:e,label:n,hint:r,description:s,placeholder:i,className:a,disabled:o,defaultValue:c,rules:u,readOnly:f,scale:l,variant:d}=t,{control:m}=Ia(),[p,h]=_.useState(""),y={input:g=>{if(typeof g!="object")return g;const v=HC.create(g);if(v.isFailure)throw v.error;const w=v.object.toString();return p.endsWith(",")?w.replace(/.0$/,","):w},output:(g,v,w)=>{const{value:x}=w??{value:null};h(x??"");const A=HC.createFromFormattedValue(x);if(A.isFailure)throw A.error;return A.object.toObject()}};return P.jsx(Fv,{defaultValue:c,control:m,name:e,disabled:o,rules:u,render:({field:g})=>{const v=y.input(g.value),w=o||g.disabled,x=!!((u==null?void 0:u.required)??!1);return P.jsxs(yp,{className:le(a,"space-y-3"),children:[n&&P.jsx(xp,{label:n,hint:r,required:x}),P.jsx(bp,{children:P.jsx(XA,{name:g.name,ref:g.ref,onBlur:g.onBlur,disabled:w,readOnly:f,className:le(HIe({variant:d,className:a})),groupSeparator:".",decimalSeparator:",",placeholder:i,allowDecimals:l!==0,decimalsLimit:l,decimalScale:l,step:1,value:v,onValueChange:(A,T,R)=>g.onChange(y.output(A,T,R))})}),s&&P.jsx(wp,{children:s}),P.jsx(_p,{})]})}})}),Y4=ri("",{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"}}),VIe=_.forwardRef(({name:t,label:e,hint:n,placeholder:r,description:s,required:i,className:a,autoSize:o,variant:c,...u})=>{const{control:f}=Ia();return P.jsx(Fv,{control:f,name:t,rules:{required:i},render:({field:l,fieldState:d})=>P.jsxs(yp,{className:le(a,"flex flex-col space-y-3"),children:[e&&P.jsx(xp,{label:e,hint:n,required:i}),P.jsx(bp,{className:"grow",children:o?P.jsx(gW,{placeholder:r,className:le(d.error?"border-destructive focus-visible:ring-destructive":"","resize-y",Y4({variant:c,className:a})),...u,...l}):P.jsx(CX,{placeholder:r,className:le(d.error?"border-destructive focus-visible:ring-destructive":"","resize-y",Y4({variant:c,className:a})),...u,...l})}),s&&P.jsx(wp,{children:s}),P.jsx(_p,{})]})})}),WIe=ri("",{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"}}),p5e=_.forwardRef(t=>{const{name:e,label:n,hint:r,description:s,placeholder:i,className:a,disabled:o,rules:c,required:u,type:f,variant:l}=t,{control:d}=Ia();return P.jsx(Fv,{control:d,name:e,disabled:o,rules:{required:u,...c},render:({field:m,fieldState:p})=>{const h=!!((c==null?void 0:c.required)??u);return P.jsxs(yp,{className:le(a,"space-y-3"),children:[n&&P.jsx(xp,{label:n,hint:r,required:h}),P.jsx(bp,{className:"block",children:P.jsx(XK,{type:f,placeholder:i,className:le(p.error?"border-destructive focus-visible:ring-destructive":"",WIe({variant:l,className:a})),...m})}),s&&P.jsx(wp,{children:s}),P.jsx(_p,{})]})}})}),GIe=({className:t,children:e})=>P.jsx(nte,{children:P.jsx("div",{className:le("flex flex-col w-full min-h-screen",t),children:e})});GIe.displayName="Layout";const qIe=({className:t,children:e})=>P.jsxs(P.Fragment,{children:[P.jsx("main",{className:le("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}),P.jsx(QX,{})]});qIe.displayName="LayoutContent";const X4=(t,e,n)=>{if(t&&"reportValidity"in t){const r=$e(n,e);t.setCustomValidity(r&&r.message||""),t.reportValidity()}},AZ=(t,e)=>{for(const n in e.fields){const r=e.fields[n];r&&r.ref&&"reportValidity"in r.ref?X4(r.ref,n,t):r.refs&&r.refs.forEach(s=>X4(s,n,t))}},KIe=(t,e)=>{e.shouldUseNativeValidation&&AZ(t,e);const n={};for(const r in t){const s=$e(e.fields,r),i=Object.assign(t[r]||{},{ref:s&&s.ref});if(YIe(e.names||Object.keys(t),r)){const a=Object.assign({},$e(n,r));Qt(a,"root",i),Qt(n,r,a)}else Qt(n,r,i)}return n},YIe=(t,e)=>t.some(n=>n.startsWith(e+"."));var XIe=function(t,e,n){return e===void 0&&(e={abortEarly:!1}),n===void 0&&(n={}),function(r,s,i){try{var a=function(){return c.error?{values:{},errors:KIe((f=c.error,l=!i.shouldUseNativeValidation&&i.criteriaMode==="all",f.details.length?f.details.reduce(function(d,m){var p=m.path.join(".");if(d[p]||(d[p]={message:m.message,type:m.type}),l){var h=d[p].types,y=h&&h[m.type];d[p]=kK(p,l,d,m.type,y?[].concat(y,m.message):m.message)}return d},{}):{}),i)}:(i.shouldUseNativeValidation&&AZ({},i),{errors:{},values:c.value});var f,l},o=Object.assign({},e,{context:s}),c={},u=function(){if(n.mode==="sync")c=t.validate(r,o);else{var f=function(l,d){try{var m=l()}catch(p){return d(p)}return m&&m.then?m.then(void 0,d):m}(function(){return Promise.resolve(t.validateAsync(r,o)).then(function(l){c.value=l})},function(l){c.error=l});if(f&&f.then)return f.then(function(){})}}();return Promise.resolve(u&&u.then?u.then(a):a())}catch(f){return Promise.reject(f)}}},RZ={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(self,()=>{return n={7629:(s,i,a)=>{const o=a(375),c=a(8571),u=a(9474),f=a(1687),l=a(8652),d=a(8160),m=a(3292),p=a(6354),h=a(8901),y=a(9708),g=a(6914),v=a(2294),w=a(6133),x=a(1152),A=a(8863),T=a(2036),R={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 w.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 o(typeof y.describe=="function","Manifest functionality disabled"),y.describe(this)}allow(...E){return d.verifyFlat(E,"allow"),this._values(E,"_valids")}alter(E){o(E&&typeof E=="object"&&!Array.isArray(E),"Invalid targets argument"),o(!this._inRuleset(),"Cannot set alterations inside a ruleset");const k=this.clone();k.$_terms.alterations=k.$_terms.alterations||[];for(const N in E){const O=E[N];o(typeof O=="function","Alteration adjuster for",N,"must be a function"),k.$_terms.alterations.push({target:N,adjuster:O})}return k.$_temp.ruleset=!1,k}artifact(E){return o(E!==void 0,"Artifact cannot be undefined"),o(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",E)}cast(E){return o(E===!1||typeof E=="string","Invalid to value"),o(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,k){return this._default("default",E,k)}description(E){return o(E&&typeof E=="string","Description must be a non-empty string"),this.$_setFlag("description",E)}empty(E){const k=this.clone();return E!==void 0&&(E=k.$_compile(E,{override:!1})),k.$_setFlag("empty",E,{clone:!1})}error(E){return o(E,"Missing error"),o(E instanceof Error||typeof E=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",E)}example(E,k={}){return o(E!==void 0,"Missing example"),d.assertOptions(k,["override"]),this._inner("examples",E,{single:!0,override:k.override})}external(E,k){return typeof E=="object"&&(o(!k,"Cannot combine options with description"),k=E.description,E=E.method),o(typeof E=="function","Method must be a function"),o(k===void 0||k&&typeof k=="string","Description must be a non-empty string"),this._inner("externals",{method:E,description:k},{single:!0})}failover(E,k){return this._default("failover",E,k)}forbidden(){return this.presence("forbidden")}id(E){return E?(o(typeof E=="string","id must be a non-empty string"),o(/^[^\.]+$/.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 o(E&&typeof E=="string","Label name must be a non-empty string"),this.$_setFlag("label",E)}meta(E){return o(E!==void 0,"Meta cannot be undefined"),this._inner("metas",E,{single:!0})}note(...E){o(E.length,"Missing notes");for(const k of E)o(k&&typeof k=="string","Notes must be non-empty strings");return this._inner("notes",E)}only(E=!0){return o(typeof E=="boolean","Invalid mode:",E),this.$_setFlag("only",E)}optional(){return this.presence("optional")}prefs(E){o(E,"Missing preferences"),o(E.context===void 0,"Cannot override context"),o(E.externals===void 0,"Cannot override externals"),o(E.warnings===void 0,"Cannot override warnings"),o(E.debug===void 0,"Cannot override debug"),d.checkPreferences(E);const k=this.clone();return k._preferences=d.preferences(k._preferences,E),k}presence(E){return o(["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 o(["raw","strip"].includes(E),"Unknown result mode",E),this.$_setFlag("result",E)}required(){return this.presence("required")}strict(E){const k=this.clone(),N=E!==void 0&&!E;return k._preferences=d.preferences(k._preferences,{convert:N}),k}strip(E=!0){return this.$_setFlag("result",E?"strip":void 0)}tag(...E){o(E.length,"Missing tags");for(const k of E)o(k&&typeof k=="string","Tags must be non-empty strings");return this._inner("tags",E)}unit(E){return o(E&&typeof E=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",E)}valid(...E){d.verifyFlat(E,"valid");const k=this.allow(...E);return k.$_setFlag("only",!!k._valids,{clone:!1}),k}when(E,k){const N=this.clone();N.$_terms.whens||(N.$_terms.whens=[]);const O=m.when(N,E,k);if(!["any","link"].includes(N.type)){const L=O.is?[O]:O.switch;for(const I of L)o(!I.then||I.then.type==="any"||I.then.type===N.type,"Cannot combine",N.type,"with",I.then&&I.then.type),o(!I.otherwise||I.otherwise.type==="any"||I.otherwise.type===N.type,"Cannot combine",N.type,"with",I.otherwise&&I.otherwise.type)}return N.$_terms.whens.push(O),N.$_mutateRebuild()}cache(E){o(!this._inRuleset(),"Cannot set caching inside a ruleset"),o(!this._cache,"Cannot override schema cache"),o(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const k=this.clone();return k._cache=E||l.provider.provision(),k.$_temp.ruleset=!1,k}clone(){const E=Object.create(Object.getPrototypeOf(this));return this._assign(E)}concat(E){o(d.isSchema(E),"Invalid schema object"),o(this.type==="any"||E.type==="any"||E.type===this.type,"Cannot merge type",this.type,"with another type:",E.type),o(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),o(!E._inRuleset(),"Cannot concatenate a schema with open ruleset");let k=this.clone();if(this.type==="any"&&E.type!=="any"){const N=E.clone();for(const O of Object.keys(k))O!=="type"&&(N[O]=k[O]);k=N}k._ids.concat(E._ids),k._refs.register(E,w.toSibling),k._preferences=k._preferences?d.preferences(k._preferences,E._preferences):E._preferences,k._valids=T.merge(k._valids,E._valids,E._invalids),k._invalids=T.merge(k._invalids,E._invalids,E._valids);for(const N of E._singleRules.keys())k._singleRules.has(N)&&(k._rules=k._rules.filter(O=>O.keep||O.name!==N),k._singleRules.delete(N));for(const N of E._rules)E._definition.rules[N.method].multi||k._singleRules.set(N.name,N),k._rules.push(N);if(k._flags.empty&&E._flags.empty){k._flags.empty=k._flags.empty.concat(E._flags.empty);const N=Object.assign({},E._flags);delete N.empty,f(k._flags,N)}else if(E._flags.empty){k._flags.empty=E._flags.empty;const N=Object.assign({},E._flags);delete N.empty,f(k._flags,N)}else f(k._flags,E._flags);for(const N in E.$_terms){const O=E.$_terms[N];O?k.$_terms[N]?k.$_terms[N]=k.$_terms[N].concat(O):k.$_terms[N]=O.slice():k.$_terms[N]||(k.$_terms[N]=O)}return this.$_root._tracer&&this.$_root._tracer._combine(k,[this,E]),k.$_mutateRebuild()}extend(E){return o(!E.base,"Cannot extend type with another base"),h.type(this,E)}extract(E){return E=Array.isArray(E)?E:E.split("."),this._ids.reach(E)}fork(E,k){o(!this._inRuleset(),"Cannot fork inside a ruleset");let N=this;for(let O of[].concat(E))O=Array.isArray(O)?O:O.split("."),N=N._ids.fork(O,k,N);return N.$_temp.ruleset=!1,N}rule(E){const k=this._definition;d.assertOptions(E,Object.keys(k.modifiers)),o(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const N=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;o(N>=0&&NN.tailor(E),ref:!1}),k.$_temp.ruleset=!1,k.$_mutateRebuild()}tracer(){return x.location?x.location(this):this}validate(E,k){return A.entry(E,this,k)}validateAsync(E,k){return A.entryAsync(E,this,k)}$_addRule(E){typeof E=="string"&&(E={name:E}),o(E&&typeof E=="object","Invalid options"),o(E.name&&typeof E.name=="string","Invalid rule name");for(const I in E)o(I[0]!=="_","Cannot set private rule properties");const k=Object.assign({},E);k._resolve=[],k.method=k.method||k.name;const N=this._definition.rules[k.method],O=k.args;o(N,"Unknown rule",k.method);const L=this.clone();if(O){o(Object.keys(O).length===1||Object.keys(O).length===this._definition.rules[k.name].args.length,"Invalid rule definition for",this.type,k.name);for(const I in O){let F=O[I];if(N.argsByName){const U=N.argsByName.get(I);if(U.ref&&d.isResolvable(F))k._resolve.push(I),L.$_mutateRegister(F);else if(U.normalize&&(F=U.normalize(F),O[I]=F),U.assert){const Y=d.validateArg(F,I,U);o(!Y,Y,"or reference")}}F!==void 0?O[I]=F:delete O[I]}}return N.multi||(L._ruleRemove(k.name,{clone:!1}),L._singleRules.set(k.name,k)),L.$_temp.ruleset===!1&&(L.$_temp.ruleset=null),N.priority?L._rules.unshift(k):L._rules.push(k),L}$_compile(E,k){return m.schema(this.$_root,E,k)}$_createError(E,k,N,O,L,I={}){const F=I.flags!==!1?this._flags:{},U=I.messages?g.merge(this._definition.messages,I.messages):this._definition.messages;return new p.Report(E,k,N,F,U,O,L)}$_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,k,N,O){(N=Object.assign({},N)).abortEarly=!0,N._externals=!1,k.snapshot();const L=!A.validate(E,this,k,N,O).errors;return k.restore(),L}$_modify(E){return d.assertOptions(E,["each","once","ref","schema"]),v.schema(this,E)||this}$_mutateRebuild(){return o(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(E,{source:k,name:N,path:O,key:L})=>{const I=this._definition[k][N]&&this._definition[k][N].register;I!==!1&&this.$_mutateRegister(E,{family:I,key:L})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(E,{family:k,key:N}={}){this._refs.register(E,k),this._ids.register(E,{key:N})}$_property(E){return this._definition.properties[E]}$_reach(E){return this._ids.reach(E)}$_rootReferences(){return this._refs.roots()}$_setFlag(E,k,N={}){o(E[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const O=this._definition.flags[E]||{};if(u(k,O.default)&&(k=void 0),u(k,this._flags[E]))return this;const L=N.clone!==!1?this.clone():this;return k!==void 0?(L._flags[E]=k,L.$_mutateRegister(k)):delete L._flags[E],E[0]!=="_"&&(L.$_temp.ruleset=!1),L}$_parent(E,...k){return this[E][d.symbols.parent].call(this,...k)}$_validate(E,k,N){return A.validate(E,this,k,N)}_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 k in this.$_terms)E.$_terms[k]=this.$_terms[k]?this.$_terms[k].slice():null;E.$_super={};for(const k in this.$_super)E.$_super[k]=this._super[k].bind(E);return E}_bare(){const E=this.clone();E._reset();const k=E._definition.terms;for(const N in k){const O=k[N];E.$_terms[N]=O.init}return E.$_mutateRebuild()}_default(E,k,N={}){return d.assertOptions(N,"literal"),o(k!==void 0,"Missing",E,"value"),o(typeof k=="function"||!N.literal,"Only function value supports literal option"),typeof k=="function"&&N.literal&&(k={[d.symbols.literal]:!0,literal:k}),this.$_setFlag(E,k)}_generate(E,k,N){if(!this.$_terms.whens)return{schema:this};const O=[],L=[];for(let U=0;Uee)break}const I=L.join(", ");if(k.mainstay.tracer.debug(k,"rule","when",I),!I)return{schema:this};if(!k.mainstay.tracer.active&&this.$_temp.whens[I])return{schema:this.$_temp.whens[I],id:I};let F=this;this._definition.generate&&(F=this._definition.generate(this,E,k,N));for(const U of O)F=F.concat(U);return this.$_root._tracer&&this.$_root._tracer._combine(F,[this,...O]),this.$_temp.whens[I]=F,{schema:F,id:I}}_inner(E,k,N={}){o(!this._inRuleset(),`Cannot set ${E} inside a ruleset`);const O=this.clone();return O.$_terms[E]&&!N.override||(O.$_terms[E]=[]),N.single?O.$_terms[E].push(k):O.$_terms[E].push(...k),O.$_temp.ruleset=!1,O}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(E,k={}){if(!this._singleRules.has(E))return this;const N=k.clone!==!1?this.clone():this;N._singleRules.delete(E);const O=[];for(let L=0;L{const o=a(375),c=a(8571),u=a(8160),f={max:1e3,supported:new Set(["undefined","boolean","number","string"])};i.provider={provision:l=>new f.Cache(l)},f.Cache=class{constructor(l={}){u.assertOptions(l,["max"]),o(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,d){if(l!==null&&!f.supported.has(typeof l))return;let m=this._map.get(l);if(m)return m.value=d,void this._list.first(m);m=this._list.unshift({key:l,value:d}),this._map.set(l,m),this._compact()}get(l){const d=this._map.get(l);if(d)return this._list.first(d),c(d.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:d,prev:m}=l;return d.prev=m,m&&(m.next=d),l===this.tail&&(this.tail=d),l.prev=null,l.next=null,l}}},8160:(s,i,a)=>{const o=a(375),c=a(7916),u=a(5934);let f,l;const d={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=u.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(m,p,h="Options"){o(m&&typeof m=="object"&&!Array.isArray(m),"Options must be of type object");const y=Object.keys(m).filter(g=>!p.includes(g));o(y.length===0,`${h} contain unknown keys: ${y}`)},i.checkPreferences=function(m){l=l||a(3378);const p=l.preferences.validate(m);if(p.error)throw new c([p.error.details[0].message])},i.compare=function(m,p,h){switch(h){case"=":return m===p;case">":return m>p;case"<":return m=":return m>=p;case"<=":return m<=p}},i.default=function(m,p){return m===void 0?p:m},i.isIsoDate=function(m){return d.isoDate.test(m)},i.isNumber=function(m){return typeof m=="number"&&!isNaN(m)},i.isResolvable=function(m){return!!m&&(m[i.symbols.ref]||m[i.symbols.template])},i.isSchema=function(m,p={}){const h=m&&m[i.symbols.any];return!!h&&(o(p.legacy||h.version===i.version,"Cannot mix different versions of joi schemas"),!0)},i.isValues=function(m){return m[i.symbols.values]},i.limit=function(m){return Number.isSafeInteger(m)&&m>=0},i.preferences=function(m,p){f=f||a(6914),m=m||{},p=p||{};const h=Object.assign({},m,p);return p.errors&&m.errors&&(h.errors=Object.assign({},m.errors,p.errors),h.errors.wrap=Object.assign({},m.errors.wrap,p.errors.wrap)),p.messages&&(h.messages=f.compile(p.messages,m.messages)),delete h[i.symbols.prefs],h},i.tryWithPath=function(m,p,h={}){try{return m()}catch(y){throw y.path!==void 0?y.path=p+"."+y.path:y.path=p,h.append&&(y.message=`${y.message} (${y.path})`),y}},i.validateArg=function(m,p,{assert:h,message:y}){if(i.isSchema(h)){const g=h.validate(m);return g.error?g.error.message:void 0}if(!h(m))return p?`${p} ${y}`:y},i.verifyFlat=function(m,p){for(const h of m)o(!Array.isArray(h),"Method no longer accepts array arguments:",p)}},3292:(s,i,a)=>{const o=a(375),c=a(8160),u=a(6133),f={};i.schema=function(l,d,m={}){c.assertOptions(m,["appendPath","override"]);try{return f.schema(l,d,m)}catch(p){throw m.appendPath&&p.path!==void 0&&(p.message=`${p.message} (${p.path})`),p}},f.schema=function(l,d,m){o(d!==void 0,"Invalid undefined schema"),Array.isArray(d)&&(o(d.length,"Invalid empty array schema"),d.length===1&&(d=d[0]));const p=(h,...y)=>m.override!==!1?h.valid(l.override,...y):h.valid(...y);if(f.simple(d))return p(l,d);if(typeof d=="function")return l.custom(d);if(o(typeof d=="object","Invalid schema content:",typeof d),c.isResolvable(d))return p(l,d);if(c.isSchema(d))return d;if(Array.isArray(d)){for(const h of d)if(!f.simple(h))return l.alternatives().try(...d);return p(l,...d)}return d instanceof RegExp?l.string().regex(d):d instanceof Date?p(l.date(),d):(o(Object.getPrototypeOf(d)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),l.object().keys(d))},i.ref=function(l,d){return u.isRef(l)?l:u.create(l,d)},i.compile=function(l,d,m={}){c.assertOptions(m,["legacy"]);const p=d&&d[c.symbols.any];if(p)return o(m.legacy||p.version===c.version,"Cannot mix different versions of joi schemas:",p.version,c.version),d;if(typeof d!="object"||!m.legacy)return i.schema(l,d,{appendPath:!0});const h=f.walk(d);return h?h.compile(h.root,d):i.schema(l,d,{appendPath:!0})},f.walk=function(l){if(typeof l!="object")return null;if(Array.isArray(l)){for(const m of l){const p=f.walk(m);if(p)return p}return null}const d=l[c.symbols.any];if(d)return{root:l[d.root],compile:d.compile};o(Object.getPrototypeOf(l)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const m in l){const p=f.walk(l[m]);if(p)return p}return null},f.simple=function(l){return l===null||["boolean","string","number"].includes(typeof l)},i.when=function(l,d,m){if(m===void 0&&(o(d&&typeof d=="object","Missing options"),m=d,d=u.create(".")),Array.isArray(m)&&(m={switch:m}),c.assertOptions(m,["is","not","then","otherwise","switch","break"]),c.isSchema(d))return o(m.is===void 0,'"is" can not be used with a schema condition'),o(m.not===void 0,'"not" can not be used with a schema condition'),o(m.switch===void 0,'"switch" can not be used with a schema condition'),f.condition(l,{is:d,then:m.then,otherwise:m.otherwise,break:m.break});if(o(u.isRef(d)||typeof d=="string","Invalid condition:",d),o(m.not===void 0||m.is===void 0,'Cannot combine "is" with "not"'),m.switch===void 0){let h=m;m.not!==void 0&&(h={is:m.not,then:m.otherwise,otherwise:m.then,break:m.break});let y=h.is!==void 0?l.$_compile(h.is):l.$_root.invalid(null,!1,0,"").required();return o(h.then!==void 0||h.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),o(h.break===void 0||h.then===void 0||h.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),m.is===void 0||u.isRef(m.is)||c.isSchema(m.is)||(y=y.required()),f.condition(l,{ref:i.ref(d),is:y,then:h.then,otherwise:h.otherwise,break:h.break})}o(Array.isArray(m.switch),'"switch" must be an array'),o(m.is===void 0,'Cannot combine "switch" with "is"'),o(m.not===void 0,'Cannot combine "switch" with "not"'),o(m.then===void 0,'Cannot combine "switch" with "then"');const p={ref:i.ref(d),switch:[],break:m.break};for(let h=0;h{const o=a(5688),c=a(8160),u=a(3328);i.Report=class{constructor(f,l,d,m,p,h,y){if(this.code=f,this.flags=m,this.messages=p,this.path=h.path,this.prefs=y,this.state=h,this.value=l,this.message=null,this.template=null,this.local=d||{},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 d of f)typeof d!="object"&&(typeof d=="string"?(l&&(l+="."),l+=d):l+=`[${d}]`);return l},i.template=function(f,l,d,m,p){if(!l)return;if(u.isTemplate(l))return d!=="root"?l:null;let h=p.errors.language;if(c.isResolvable(h)&&(h=h.resolve(f,m,p)),h&&l[h]){if(l[h][d]!==void 0)return l[h][d];if(l[h]["*"]!==void 0)return l[h]["*"]}return l[d]?l[d]:l["*"]},i.label=function(f,l,d,m){if(!d.errors.label)return"";if(f.label)return f.label;let p=l.path;return d.errors.label==="key"&&l.path.length>1&&(p=l.path.slice(-1)),i.path(p)||i.template(null,d.messages,"root",l,d)||m&&i.template(null,m,"root",l,d)||"value"},i.process=function(f,l,d){if(!f)return null;const{override:m,message:p,details:h}=i.details(f);if(m)return m;if(d.errors.stack)return new i.ValidationError(p,h,l);const y=Error.stackTraceLimit;Error.stackTraceLimit=0;const g=new i.ValidationError(p,h,l);return Error.stackTraceLimit=y,g},i.details=function(f,l={}){let d=[];const m=[];for(const p of f){if(p instanceof Error){if(l.override!==!1)return{override:p};const y=p.toString();d.push(y),m.push({message:y,type:"override",context:{error:p}});continue}const h=p.toString();d.push(h),m.push({message:h,path:p.path.filter(y=>typeof y!="object"),type:p.code,context:p.local})}return d.length>1&&(d=[...new Set(d)]),{message:d.join(". "),details:m}},i.ValidationError=class extends Error{constructor(f,l,d){super(f),this._original=d,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=o.error},8901:(s,i,a)=>{const o=a(375),c=a(8571),u=a(8160),f=a(6914),l={};i.type=function(d,m){const p=Object.getPrototypeOf(d),h=c(p),y=d._assign(Object.create(h)),g=Object.assign({},m);delete g.base,h._definition=g;const v=p._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 w=Object.assign({},v.terms);if(g.terms)for(const R in g.terms){const E=g.terms[R];o(y.$_terms[R]===void 0,"Invalid term override for",g.type,R),y.$_terms[R]=E.init,w[R]=E}g.terms=w,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 x=Object.assign({},v.rules);if(g.rules)for(const R in g.rules){const E=g.rules[R];o(typeof E=="object","Invalid rule definition for",g.type,R);let k=E.method;if(k===void 0&&(k=function(){return this.$_addRule(R)}),k&&(o(!h[R],"Rule conflict in",g.type,R),h[R]=k),o(!x[R],"Rule conflict in",g.type,R),x[R]=E,E.alias){const N=[].concat(E.alias);for(const O of N)h[O]=E.method}E.args&&(E.argsByName=new Map,E.args=E.args.map(N=>(typeof N=="string"&&(N={name:N}),o(!E.argsByName.has(N.name),"Duplicated argument name",N.name),u.isSchema(N.assert)&&(N.assert=N.assert.strict().label(N.name)),E.argsByName.set(N.name,N),N)))}g.rules=x;const A=Object.assign({},v.modifiers);if(g.modifiers)for(const R in g.modifiers){o(!h[R],"Rule conflict in",g.type,R);const E=g.modifiers[R];o(typeof E=="function","Invalid modifier definition for",g.type,R);const k=function(N){return this.rule({[R]:N})};h[R]=k,A[R]=E}if(g.modifiers=A,g.overrides){h._super=p,y.$_super={};for(const R in g.overrides)o(p[R],"Cannot override missing",R),g.overrides[R][u.symbols.parent]=p[R],y.$_super[R]=p[R].bind(y);Object.assign(h,g.overrides)}g.cast=Object.assign({},v.cast,g.cast);const T=Object.assign({},v.manifest,g.manifest);return T.build=l.build(g.manifest&&g.manifest.build,v.manifest&&v.manifest.build),g.manifest=T,g.rebuild=l.rebuild(g.rebuild,v.rebuild),y},l.build=function(d,m){return d&&m?function(p,h){return m(d(p,h),h)}:d||m},l.coerce=function(d,m){return d&&m?{from:d.from&&m.from?[...new Set([...d.from,...m.from])]:null,method(p,h){let y;if((!m.from||m.from.includes(typeof p))&&(y=m.method(p,h),y)){if(y.errors||y.value===void 0)return y;p=y.value}if(!d.from||d.from.includes(typeof p)){const g=d.method(p,h);if(g)return g}return y}}:d||m},l.prepare=function(d,m){return d&&m?function(p,h){const y=d(p,h);if(y){if(y.errors||y.value===void 0)return y;p=y.value}return m(p,h)||y}:d||m},l.rebuild=function(d,m){return d&&m?function(p){m(p),d(p)}:d||m},l.validate=function(d,m){return d&&m?function(p,h){const y=m(p,h);if(y){if(y.errors&&(!Array.isArray(y.errors)||y.errors.length))return y;p=y.value}return d(p,h)||y}:d||m}},5107:(s,i,a)=>{const o=a(375),c=a(8571),u=a(8652),f=a(8160),l=a(3292),d=a(6354),m=a(8901),p=a(9708),h=a(6133),y=a(3328),g=a(1152);let v;const w={types:{alternatives:a(4946),any:a(8068),array:a(546),boolean:a(4937),date:a(7500),function:a(390),link:a(8785),number:a(3832),object:a(8966),string:a(7417),symbol:a(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const x={_types:new Set(Object.keys(w.types))};for(const A of x._types)x[A]=function(...T){return o(!T.length||["alternatives","link","object"].includes(A),"The",A,"type does not allow arguments"),w.generate(this,w.types[A],T)};for(const A of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])x[A]=function(...T){return this.any()[A](...T)};Object.assign(x,w.methods);for(const A in w.aliases){const T=w.aliases[A];x[A]=x[T]}return x.x=x.expression,g.setup&&g.setup(x),x}};w.methods={ValidationError:d.ValidationError,version:f.version,cache:u.provider,assert(x,A,...T){w.assert(x,A,!0,T)},attempt:(x,A,...T)=>w.assert(x,A,!1,T),build(x){return o(typeof p.build=="function","Manifest functionality disabled"),p.build(this,x)},checkPreferences(x){f.checkPreferences(x)},compile(x,A){return l.compile(this,x,A)},defaults(x){o(typeof x=="function","modifier must be a function");const A=Object.assign({},this);for(const T of A._types){const R=x(A[T]());o(f.isSchema(R),"modifier must return a valid schema object"),A[T]=function(...E){return w.generate(this,R,E)}}return A},expression:(...x)=>new y(...x),extend(...x){f.verifyFlat(x,"extend"),v=v||a(3378),o(x.length,"You need to provide at least one extension"),this.assert(x,v.extensions);const A=Object.assign({},this);A._types=new Set(A._types);for(let T of x){typeof T=="function"&&(T=T(A)),this.assert(T,v.extension);const R=w.expandExtension(T,A);for(const E of R){o(A[E.type]===void 0||A._types.has(E.type),"Cannot override name",E.type);const k=E.base||this.any(),N=m.type(k,E);A._types.add(E.type),A[E.type]=function(...O){return w.generate(this,N,O)}}}return A},isError:d.ValidationError.isError,isExpression:y.isTemplate,isRef:h.isRef,isSchema:f.isSchema,in:(...x)=>h.in(...x),override:f.symbols.override,ref:(...x)=>h.create(...x),types(){const x={};for(const A of this._types)x[A]=this[A]();for(const A in w.aliases)x[A]=this[A]();return x}},w.assert=function(x,A,T,R){const E=R[0]instanceof Error||typeof R[0]=="string"?R[0]:null,k=E!==null?R[1]:R[0],N=A.validate(x,f.preferences({errors:{stack:!0}},k||{}));let O=N.error;if(!O)return N.value;if(E instanceof Error)throw E;const L=T&&typeof O.annotate=="function"?O.annotate():O.message;throw O instanceof d.ValidationError==0&&(O=c(O)),O.message=E?`${E} ${L}`:L,O},w.generate=function(x,A,T){return o(x,"Must be invoked on a Joi instance."),A.$_root=x,A._definition.args&&T.length?A._definition.args(A,...T):A},w.expandExtension=function(x,A){if(typeof x.type=="string")return[x];const T=[];for(const R of A._types)if(x.type.test(R)){const E=Object.assign({},x);E.type=R,E.base=A[R](),T.push(E)}return T},s.exports=w.root()},6914:(s,i,a)=>{const o=a(375),c=a(8571),u=a(3328);i.compile=function(f,l){if(typeof f=="string")return o(!l,"Cannot set single message string"),new u(f);if(u.isTemplate(f))return o(!l,"Cannot set single message template"),f;o(typeof f=="object"&&!Array.isArray(f),"Invalid message options"),l=l?c(l):{};for(let d in f){const m=f[d];if(d==="root"||u.isTemplate(m)){l[d]=m;continue}if(typeof m=="string"){l[d]=new u(m);continue}o(typeof m=="object"&&!Array.isArray(m),"Invalid message for",d);const p=d;for(d in l[p]=l[p]||{},m){const h=m[d];d==="root"||u.isTemplate(h)?l[p][d]=h:(o(typeof h=="string","Invalid message for",d,"in",p),l[p][d]=new u(h))}}return l},i.decompile=function(f){const l={};for(let d in f){const m=f[d];if(d==="root"){l.root=m;continue}if(u.isTemplate(m)){l[d]=m.describe({compact:!0});continue}const p=d;for(d in l[p]={},m){const h=m[d];d!=="root"?l[p][d]=h.describe({compact:!0}):l[p].root=h}}return l},i.merge=function(f,l){if(!f)return i.compile(l);if(!l)return f;if(typeof l=="string")return new u(l);if(u.isTemplate(l))return l;const d=c(f);for(let m in l){const p=l[m];if(m==="root"||u.isTemplate(p)){d[m]=p;continue}if(typeof p=="string"){d[m]=new u(p);continue}o(typeof p=="object"&&!Array.isArray(p),"Invalid message for",m);const h=m;for(m in d[h]=d[h]||{},p){const y=p[m];m==="root"||u.isTemplate(y)?d[h][m]=y:(o(typeof y=="string","Invalid message for",m,"in",h),d[h][m]=new u(y))}}return d}},2294:(s,i,a)=>{const o=a(375),c=a(8160),u=a(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[d,m]of l._byId.entries())o(!this._byKey.has(d),"Schema id conflicts with existing key:",d),this._byId.set(d,m);for(const[d,m]of l._byKey.entries())o(!this._byId.has(d),"Schema key conflicts with existing id:",d),this._byKey.set(d,m)}fork(l,d,m){const p=this._collect(l);p.push({schema:m});const h=p.shift();let y={id:h.id,schema:d(h.schema)};o(c.isSchema(y.schema),"adjuster function failed to return a joi schema type");for(const g of p)y={id:g.id,schema:f.fork(g.schema,y.id,y.schema)};return y.schema}labels(l,d=[]){const m=l[0],p=this._get(m);if(!p)return[...d,...l].join(".");const h=l.slice(1);return d=[...d,p.schema._flags.label||m],h.length?p.schema._ids.labels(h,d):d.join(".")}reach(l,d=[]){const m=l[0],p=this._get(m);o(p,"Schema does not contain path",[...d,...l].join("."));const h=l.slice(1);return h.length?p.schema._ids.reach(h,[...d,m]):p.schema}register(l,{key:d}={}){if(!l||!c.isSchema(l))return;(l.$_property("schemaChain")||l._ids._schemaChain)&&(this._schemaChain=!0);const m=l._flags.id;if(m){const p=this._byId.get(m);o(!p||p.schema===l,"Cannot add different schemas with the same id:",m),o(!this._byKey.has(m),"Schema id conflicts with existing key:",m),this._byId.set(m,{schema:l,id:m})}d&&(o(!this._byKey.has(d),"Schema already contains key:",d),o(!this._byId.has(d),"Schema key conflicts with existing id:",d),this._byKey.set(d,{schema:l,id:d}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(l,d=[],m=[]){const p=l[0],h=this._get(p);o(h,"Schema does not contain path",[...d,...l].join(".")),m=[h,...m];const y=l.slice(1);return y.length?h.schema._ids._collect(y,[...d,p],m):m}_get(l){return this._byId.get(l)||this._byKey.get(l)}},f.fork=function(l,d,m){const p=i.schema(l,{each:(h,{key:y})=>{if(d===(h._flags.id||y))return m},ref:!1});return p?p.$_mutateRebuild():l},i.schema=function(l,d){let m;for(const p in l._flags){if(p[0]==="_")continue;const h=f.scan(l._flags[p],{source:"flags",name:p},d);h!==void 0&&(m=m||l.clone(),m._flags[p]=h)}for(let p=0;p{const o=a(375),c=a(8571),u=a(9621),f=a(8160);let l;const d={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};i.create=function(m,p={}){o(typeof m=="string","Invalid reference key:",m),f.assertOptions(p,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),o(!p.prefix||typeof p.prefix=="object","options.prefix must be of type object");const h=Object.assign({},d.defaults,p);delete h.prefix;const y=h.separator,g=d.context(m,y,p.prefix);if(h.type=g.type,m=g.key,h.type==="value")if(g.root&&(o(!y||m[0]!==y,"Cannot specify relative path with root prefix"),h.ancestor="root",m||(m=null)),y&&y===m)m=null,h.ancestor=0;else if(h.ancestor!==void 0)o(!y||!m||m[0]!==y,"Cannot combine prefix with ancestor option");else{const[v,w]=d.ancestor(m,y);w&&(m=m.slice(w))===""&&(m=null),h.ancestor=v}return h.path=y?m===null?[]:m.split(y):[m],new d.Ref(h)},i.in=function(m,p={}){return i.create(m,{...p,in:!0})},i.isRef=function(m){return!!m&&!!m[f.symbols.ref]},d.Ref=class{constructor(m){o(typeof m=="object","Invalid reference construction"),f.assertOptions(m,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),o([!1,void 0].includes(m.separator)||typeof m.separator=="string"&&m.separator.length===1,"Invalid separator"),o(!m.adjust||typeof m.adjust=="function","options.adjust must be a function"),o(!m.map||Array.isArray(m.map),"options.map must be an array"),o(!m.map||!m.adjust,"Cannot set both map and adjust options"),Object.assign(this,d.defaults,m),o(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(m,p,h,y,g={}){return o(!this.in||g.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(h.context,p,g):this.type==="local"?this._resolve(y,p,g):this.ancestor?this.ancestor==="root"?this._resolve(p.ancestors[p.ancestors.length-1],p,g):(o(this.ancestor<=p.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(p.ancestors[this.ancestor-1],p,g)):this._resolve(m,p,g)}_resolve(m,p,h){let y;if(this.type==="value"&&p.mainstay.shadow&&h.shadow!==!1&&(y=p.mainstay.shadow.get(this.absolute(p))),y===void 0&&(y=u(m,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 p.mainstay&&p.mainstay.tracer.resolve(p,this,y),y}toString(){return this.display}absolute(m){return[...m.path.slice(0,-this.ancestor),...this.path]}clone(){return new d.Ref(this)}describe(){const m={path:this.path};this.type!=="value"&&(m.type=this.type),this.separator!=="."&&(m.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(m.ancestor=this.ancestor),this.map&&(m.map=[...this.map]);for(const p of["adjust","iterables","render"])this[p]!==null&&this[p]!==void 0&&(m[p]=this[p]);return this.in!==!1&&(m.in=!0),{ref:m}}updateDisplay(){const m=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${m}`);if(!this.separator)return void(this.display=`ref:${m}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${m}`);if(this.ancestor==="root")return void(this.display=`ref:root:${m}`);if(this.ancestor===1)return void(this.display=`ref:${m||".."}`);const p=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${p}${m||""}`}},d.Ref.prototype[f.symbols.ref]=!0,i.build=function(m){return(m=Object.assign({},d.defaults,m)).type==="value"&&m.ancestor===void 0&&(m.ancestor=1),new d.Ref(m)},d.context=function(m,p,h={}){if(m=m.trim(),h){const y=h.global===void 0?"$":h.global;if(y!==p&&m.startsWith(y))return{key:m.slice(y.length),type:"global"};const g=h.local===void 0?"#":h.local;if(g!==p&&m.startsWith(g))return{key:m.slice(g.length),type:"local"};const v=h.root===void 0?"/":h.root;if(v!==p&&m.startsWith(v))return{key:m.slice(v.length),type:"value",root:!0}}return{key:m,type:"value"}},d.ancestor=function(m,p){if(!p)return[1,0];if(m[0]!==p)return[1,0];if(m[1]!==p)return[0,1];let h=2;for(;m[h]===p;)++h;return[h-1,h]},i.toSibling=0,i.toParent=1,i.Manager=class{constructor(){this.refs=[]}register(m,p){if(m)if(p=p===void 0?i.toParent:p,Array.isArray(m))for(const h of m)this.register(h,p);else if(f.isSchema(m))for(const h of m._refs.refs)h.ancestor-p>=0&&this.refs.push({ancestor:h.ancestor-p,root:h.root});else i.isRef(m)&&m.type==="value"&&m.ancestor-p>=0&&this.refs.push({ancestor:m.ancestor-p,root:m.root}),l=l||a(3328),l.isTemplate(m)&&this.register(m.refs(),p)}get length(){return this.refs.length}clone(){const m=new i.Manager;return m.refs=c(this.refs),m}reset(){this.refs=[]}roots(){return this.refs.filter(m=>!m.ancestor).map(m=>m.root)}}},3378:(s,i,a)=>{const o=a(5107),c={};c.wrap=o.string().min(1).max(2).allow(!1),i.preferences=o.object({allowUnknown:o.boolean(),abortEarly:o.boolean(),artifacts:o.boolean(),cache:o.boolean(),context:o.object(),convert:o.boolean(),dateFormat:o.valid("date","iso","string","time","utc"),debug:o.boolean(),errors:{escapeHtml:o.boolean(),label:o.valid("path","key",!1),language:[o.string(),o.object().ref()],render:o.boolean(),stack:o.boolean(),wrap:{label:c.wrap,array:c.wrap,string:c.wrap}},externals:o.boolean(),messages:o.object(),noDefaults:o.boolean(),nonEnumerables:o.boolean(),presence:o.valid("required","optional","forbidden"),skipFunctions:o.boolean(),stripUnknown:o.object({arrays:o.boolean(),objects:o.boolean()}).or("arrays","objects").allow(!0,!1),warnings:o.boolean()}).strict(),c.nameRx=/^[a-zA-Z0-9]\w*$/,c.rule=o.object({alias:o.array().items(o.string().pattern(c.nameRx)).single(),args:o.array().items(o.string(),o.object({name:o.string().pattern(c.nameRx).required(),ref:o.boolean(),assert:o.alternatives([o.function(),o.object().schema()]).conditional("ref",{is:!0,then:o.required()}),normalize:o.function(),message:o.string().when("assert",{is:o.function(),then:o.required()})})),convert:o.boolean(),manifest:o.boolean(),method:o.function().allow(!1),multi:o.boolean(),validate:o.function()}),i.extension=o.object({type:o.alternatives([o.string(),o.object().regex()]).required(),args:o.function(),cast:o.object().pattern(c.nameRx,o.object({from:o.function().maxArity(1).required(),to:o.function().minArity(1).maxArity(2).required()})),base:o.object().schema().when("type",{is:o.object().regex(),then:o.forbidden()}),coerce:[o.function().maxArity(3),o.object({method:o.function().maxArity(3).required(),from:o.array().items(o.string()).single()})],flags:o.object().pattern(c.nameRx,o.object({setter:o.string(),default:o.any()})),manifest:{build:o.function().arity(2)},messages:[o.object(),o.string()],modifiers:o.object().pattern(c.nameRx,o.function().minArity(1).maxArity(2)),overrides:o.object().pattern(c.nameRx,o.function()),prepare:o.function().maxArity(3),rebuild:o.function().arity(1),rules:o.object().pattern(c.nameRx,c.rule),terms:o.object().pattern(c.nameRx,o.object({init:o.array().allow(null).required(),manifest:o.object().pattern(/.+/,[o.valid("schema","single"),o.object({mapped:o.object({from:o.string().required(),to:o.string().required()}).required()})])})),validate:o.function().maxArity(3)}).strict(),i.extensions=o.array().items(o.object(),o.function().arity(1)).strict(),c.desc={buffer:o.object({buffer:o.string()}),func:o.object({function:o.function().required(),options:{literal:!0}}),override:o.object({override:!0}),ref:o.object({ref:o.object({type:o.valid("value","global","local"),path:o.array().required(),separator:o.string().length(1).allow(!1),ancestor:o.number().min(0).integer().allow("root"),map:o.array().items(o.array().length(2)).min(1),adjust:o.function(),iterables:o.boolean(),in:o.boolean(),render:o.boolean()}).required()}),regex:o.object({regex:o.string().min(3)}),special:o.object({special:o.valid("deep").required()}),template:o.object({template:o.string().required(),options:o.object()}),value:o.object({value:o.alternatives([o.object(),o.array()]).required()})},c.desc.entity=o.alternatives([o.array().items(o.link("...")),o.boolean(),o.function(),o.number(),o.string(),c.desc.buffer,c.desc.func,c.desc.ref,c.desc.regex,c.desc.special,c.desc.template,c.desc.value,o.link("/")]),c.desc.values=o.array().items(null,o.boolean(),o.function(),o.number().allow(1/0,-1/0),o.string().allow(""),o.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=o.object().pattern(/.+/,[o.string(),c.desc.template,o.object().pattern(/.+/,[o.string(),c.desc.template])]),i.description=o.object({type:o.string().required(),flags:o.object({cast:o.string(),default:o.any(),description:o.string(),empty:o.link("/"),failover:c.desc.entity,id:o.string(),label:o.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:o.boolean(),unit:o.string()}).unknown(),preferences:{allowUnknown:o.boolean(),abortEarly:o.boolean(),artifacts:o.boolean(),cache:o.boolean(),convert:o.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:o.boolean(),label:["path","key"],language:[o.string(),c.desc.ref],wrap:{label:c.wrap,array:c.wrap}},externals:o.boolean(),messages:c.desc.messages,noDefaults:o.boolean(),nonEnumerables:o.boolean(),presence:["required","optional","forbidden"],skipFunctions:o.boolean(),stripUnknown:o.object({arrays:o.boolean(),objects:o.boolean()}).or("arrays","objects").allow(!0,!1),warnings:o.boolean()},allow:c.desc.values,invalid:c.desc.values,rules:o.array().min(1).items({name:o.string().required(),args:o.object().min(1),keep:o.boolean(),message:[o.string(),c.desc.messages],warn:o.boolean()}),keys:o.object().pattern(/.*/,o.link("/")),link:c.desc.ref}).pattern(/^[a-z]\w*$/,o.any())},493:(s,i,a)=>{const o=a(8571),c=a(9621),u=a(8160),f={value:Symbol("value")};s.exports=f.State=class{constructor(l,d,m){this.path=l,this.ancestors=d,this.mainstay=m.mainstay,this.schemas=m.schemas,this.debug=null}localize(l,d=null,m=null){const p=new f.State(l,d,this);return m&&p.schemas&&(p.schemas=[f.schemas(m),...p.schemas]),p}nest(l,d){const m=new f.State(this.path,this.ancestors,this);return m.schemas=m.schemas&&[f.schemas(l),...m.schemas],m.debug=d,m}shadow(l,d){this.mainstay.shadow=this.mainstay.shadow||new f.Shadow,this.mainstay.shadow.set(this.path,l,d)}snapshot(){this.mainstay.shadow&&(this._snapshot=o(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 u.isSchema(l)?{schema:l}:l},f.Shadow=class{constructor(){this._values=null}set(l,d,m){if(!l.length||m==="strip"&&typeof l[l.length-1]=="number")return;this._values=this._values||new Map;let p=this._values;for(let h=0;h{const o=a(375),c=a(8571),u=a(5277),f=a(1447),l=a(8160),d=a(6354),m=a(6133),p={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=p.Template=class{constructor(h,y){if(o(typeof h=="string","Template source must be a string"),o(!h.includes("\0")&&!h.includes(""),"Template source cannot contain reserved control characters"),this.source=h,this.rendered=h,this._template=null,y){const{functions:g,...v}=y;this._settings=Object.keys(v).length?c(v):void 0,this._functions=g,this._functions&&(o(Object.keys(this._functions).every(w=>typeof w=="string"),"Functions keys must be strings"),o(Object.values(this._functions).every(w=>typeof w=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const h=p.encode(this.source),y=p.split(h);let g=!1;const v=[],w=y.shift();w&&v.push(w);for(const x of y){const A=x[0]!=="{",T=A?"}":"}}",R=x.indexOf(T);if(R===-1||x[1]==="{"){v.push(`{${p.decode(x)}`);continue}let E=x.slice(A?0:1,R);const k=E[0]===":";k&&(E=E.slice(1));const N=this._ref(p.decode(E),{raw:A,wrapped:k});v.push(N),typeof N!="string"&&(g=!0);const O=x.slice(R+T.length);O&&v.push(p.decode(O))}g?this._template=v:this.rendered=v.join("")}static date(h,y){return p.dateFormat[y.dateFormat].call(h)}describe(h={}){if(!this._settings&&h.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(h){return new p.Template(h.template,h.options||h.functions?{...h.options,functions:h.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(h){return!!h&&!!h[l.symbols.template]}refs(){if(!this._template)return;const h=[];for(const y of this._template)typeof y!="string"&&h.push(...y.refs);return h}resolve(h,y,g,v){return this._template&&this._template.length===1?this._part(this._template[0],h,y,g,v,{}):this.render(h,y,g,v)}_part(h,...y){return h.ref?h.ref.resolve(...y):h.formula.evaluate(y)}render(h,y,g,v,w={}){if(!this.isDynamic())return this.rendered;const x=[];for(const A of this._template)if(typeof A=="string")x.push(A);else{const T=this._part(A,h,y,g,v,w),R=p.stringify(T,h,y,g,v,w);if(R!==void 0){const E=A.raw||(w.errors&&w.errors.escapeHtml)===!1?R:u(R);x.push(p.wrap(E,A.wrapped&&g.errors.wrap.label))}}return x.join("")}_ref(h,{raw:y,wrapped:g}){const v=[],w=A=>{const T=m.create(A,this._settings);return v.push(T),R=>{const E=T.resolve(...R);return E!==void 0?E:null}};try{const A=this._functions?{...p.functions,...this._functions}:p.functions;var x=new f.Parser(h,{reference:w,functions:A,constants:p.constants})}catch(A){throw A.message=`Invalid template variable "${h}" fails due to: ${A.message}`,A}if(x.single){if(x.single.type==="reference"){const A=v[0];return{ref:A,raw:y,refs:v,wrapped:g||A.type==="local"&&A.key==="label"}}return p.stringify(x.single.value)}return{formula:x,raw:y,refs:v}}toString(){return this.source}},p.Template.prototype[l.symbols.template]=!0,p.Template.prototype.isImmutable=!0,p.encode=function(h){return h.replace(/\\(\{+)/g,(y,g)=>p.opens.slice(0,g.length)).replace(/\\(\}+)/g,(y,g)=>p.closes.slice(0,g.length))},p.decode=function(h){return h.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},p.split=function(h){const y=[];let g="";for(let v=0;v ${O.toString()}`);h=k}if(!Array.isArray(h))return h.toString();const E=[];for(const k of h)E.push(p.stringify(k,y,g,v,w,{arrayItems:!0,...x}));return p.wrap(E.join(", "),!R&&T.array)},p.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},p.functions={if:(h,y,g)=>h?y:g,length:h=>typeof h=="string"?h.length:h&&typeof h=="object"?Array.isArray(h)?h.length:Object.keys(h).length:null,msg(h){const[y,g,v,w,x]=this,A=x.messages;if(!A)return"";const T=d.template(y,A[0],h,g,v)||d.template(y,A[1],h,g,v);return T?T.render(y,g,v,w,x):""},number:h=>typeof h=="number"?h:typeof h=="string"?parseFloat(h):typeof h=="boolean"?h?1:0:h instanceof Date?h.getTime():null}},4946:(s,i,a)=>{const o=a(375),c=a(1687),u=a(8068),f=a(8160),l=a(3292),d=a(6354),m=a(6133),p={};s.exports=u.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:m.toSibling}},args:(h,...y)=>y.length===1&&Array.isArray(y[0])?h.try(...y[0]):h.try(...y),validate(h,y){const{schema:g,error:v,state:w,prefs:x}=y;if(g._flags.match){const T=[],R=[];for(let k=0;kd.details(k,{override:!1}))})};if(g._flags.match==="one")return T.length===1?{value:T[0]}:{errors:v("alternatives.one")};if(T.length!==g.$_terms.matches.length)return{errors:v("alternatives.all",{details:R.map(k=>d.details(k,{override:!1}))})};const E=k=>k.$_terms.matches.some(N=>N.schema.type==="object"||N.schema.type==="alternatives"&&E(N.schema));return E(g)?{value:T.reduce((k,N)=>c(k,N,{mergeArrays:!1}))}:{value:T[T.length-1]}}const A=[];for(let T=0;Tg.path[0]!=="is"&&typeof y._flags.label!="string"?y.label(h):void 0,ref:!1})}},rebuild(h){h.$_modify({each:y=>{f.isSchema(y)&&y.type==="array"&&h.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(h,y){if(y.matches)for(const g of y.matches){const{schema:v,ref:w,is:x,not:A,then:T,otherwise:R}=g;h=v?h.try(v):w?h.conditional(w,{is:x,then:T,not:A,otherwise:R,switch:g.switch}):h.conditional(x,{then:T,otherwise:R})}return h}},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}}"}}),p.errors=function(h,{error:y,state:g}){if(!h.length)return{errors:y("alternatives.any")};if(h.length===1)return{errors:h[0].reports};const v=new Set,w=[];for(const{reports:x,schema:A}of h){if(x.length>1)return p.unmatched(h,y);const T=x[0];if(T instanceof d.Report==0)return p.unmatched(h,y);if(T.state.path.length!==g.path.length){w.push({type:A.type,report:T});continue}if(T.code==="any.only"){for(const k of T.local.valids)v.add(k);continue}const[R,E]=T.code.split(".");E!=="base"?w.push({type:A.type,report:T}):T.code==="object.base"?v.add(T.local.type):v.add(R)}return w.length?w.length===1?{errors:w[0].report}:p.unmatched(h,y):{errors:y("alternatives.types",{types:[...v]})}},p.unmatched=function(h,y){const g=[];for(const v of h)g.push(...v.reports);return{errors:y("alternatives.match",d.details(g,{override:!1}))}}},8068:(s,i,a)=>{const o=a(375),c=a(7629),u=a(8160),f=a(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,d){return o(typeof l=="function","Method must be a function"),o(d===void 0||d&&typeof d=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:l,description:d}})},validate(l,d,{method:m}){try{return m(l,d)}catch(p){return d.error("any.custom",{error:p})}},args:["method","description"],multi:!0},messages:{method(l){return this.prefs({messages:l})}},shared:{method(l){o(u.isSchema(l)&&l._flags.id,"Schema must be a schema with an id");const d=this.clone();return d.$_terms.shared=d.$_terms.shared||[],d.$_terms.shared.push(l),d.$_mutateRegister(l),d}},warning:{method(l,d){return o(l&&typeof l=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:l,local:d},warn:!0})},validate:(l,d,{code:m,local:p})=>d.error(m,p),args:["code","local"],multi:!0}},modifiers:{keep(l,d=!0){l.keep=d},message(l,d){l.message=f.compile(d)},warn(l,d=!0){l.warn=d}},manifest:{build(l,d){for(const m in d){const p=d[m];if(["examples","externals","metas","notes","tags"].includes(m))for(const h of p)l=l[m.slice(0,-1)](h);else if(m!=="alterations")if(m!=="whens"){if(m==="shared")for(const h of p)l=l.shared(h)}else for(const h of p){const{ref:y,is:g,not:v,then:w,otherwise:x,concat:A}=h;l=A?l.concat(A):y?l.when(y,{is:g,not:v,then:w,otherwise:x,switch:h.switch,break:h.break}):l.when(g,{then:w,otherwise:x,break:h.break})}else{const h={};for(const{target:y,adjuster:g}of p)h[y]=g;l=l.alter(h)}}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,a)=>{const o=a(375),c=a(9474),u=a(9621),f=a(8068),l=a(8160),d=a(3292),m={};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(p,{schema:h,state:y,prefs:g}){if(!Array.isArray(p))return;const v=h.$_getRule("sort");return v?m.sort(h,p,v.args.options,y,g):void 0}},validate(p,{schema:h,error:y}){if(!Array.isArray(p)){if(h._flags.single){const g=[p];return g[l.symbols.arraySingle]=!0,{value:g}}return{errors:y("array.base")}}if(h.$_getRule("items")||h.$_terms.externals)return{value:p.slice()}},rules:{has:{method(p){p=this.$_compile(p,{appendPath:!0});const h=this.$_addRule({name:"has",args:{schema:p}});return h.$_mutateRegister(p),h},validate(p,{state:h,prefs:y,error:g},{schema:v}){const w=[p,...h.ancestors];for(let A=0;Athis.$_compile(p[y]),y,{append:!0});h.$_terms.items.push(g)}return h.$_mutateRebuild()},validate(p,{schema:h,error:y,state:g,prefs:v,errorsArray:w}){const x=h.$_terms._requireds.slice(),A=h.$_terms.ordered.slice(),T=[...h.$_terms._inclusions,...x],R=!p[l.symbols.arraySingle];delete p[l.symbols.arraySingle];const E=w();let k=p.length;for(let N=0;N="})}},ordered:{method(...p){l.verifyFlat(p,"ordered");const h=this.$_addRule("items");for(let y=0;ythis.$_compile(p[y]),y,{append:!0});m.validateSingle(g,h),h.$_mutateRegister(g),h.$_terms.ordered.push(g)}return h.$_mutateRebuild()}},single:{method(p){const h=p===void 0||!!p;return o(!h||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",h)}},sort:{method(p={}){l.assertOptions(p,["by","order"]);const h={order:p.order||"ascending"};return p.by&&(h.by=d.ref(p.by,{ancestor:0}),o(!h.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:h}})},validate(p,{error:h,state:y,prefs:g,schema:v},{options:w}){const{value:x,errors:A}=m.sort(v,p,w,y,g);if(A)return A;for(let T=0;Tnew Set(p)}},rebuild(p){p.$_terms._inclusions=[],p.$_terms._exclusions=[],p.$_terms._requireds=[];for(const h of p.$_terms.items)m.validateSingle(h,p),h._flags.presence==="required"?p.$_terms._requireds.push(h):h._flags.presence==="forbidden"?p.$_terms._exclusions.push(h):p.$_terms._inclusions.push(h);for(const h of p.$_terms.ordered)m.validateSingle(h,p)},manifest:{build:(p,h)=>(h.items&&(p=p.items(...h.items)),h.ordered&&(p=p.ordered(...h.ordered)),p)},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"}}),m.fillMissedErrors=function(p,h,y,g,v,w){const x=[];let A=0;for(const T of y){const R=T._flags.label;R?x.push(R):++A}x.length?A?h.push(p.$_createError("array.includesRequiredBoth",g,{knownMisses:x,unknownMisses:A},v,w)):h.push(p.$_createError("array.includesRequiredKnowns",g,{knownMisses:x},v,w)):h.push(p.$_createError("array.includesRequiredUnknowns",g,{unknownMisses:A},v,w))},m.fillOrderedErrors=function(p,h,y,g,v,w){const x=[];for(const A of y)A._flags.presence==="required"&&x.push(A);x.length&&m.fillMissedErrors(p,h,x,g,v,w)},m.fillDefault=function(p,h,y,g){const v=[];let w=!0;for(let x=p.length-1;x>=0;--x){const A=p[x],T=[h,...y.ancestors],R=A.$_validate(void 0,y.localize(y.path,T,A),g).value;if(w){if(R===void 0)continue;w=!1}v.unshift(R)}v.length&&h.push(...v)},m.fastSplice=function(p,h){let y=h;for(;y{let k=m.compare(R,E,x,A);if(k!==null||(y.by&&(R=y.by.resolve(R,g,v),E=y.by.resolve(E,g,v)),k=m.compare(R,E,x,A),k!==null))return k;const N=typeof R;if(N!==typeof E)throw p.$_createError("array.sort.mismatching",h,null,g,v);if(N!=="number"&&N!=="string")throw p.$_createError("array.sort.unsupported",h,{type:N},g,v);return N==="number"?(R-E)*w:R{const o=a(375),c=a(8068),u=a(8160),f=a(2036),l={isBool:function(d){return typeof d=="boolean"}};s.exports=c.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(d,{schema:m}){if(typeof d!="boolean"){if(typeof d=="string"){const p=m._flags.sensitive?d:d.toLowerCase();d=p==="true"||p!=="false"&&d}return typeof d!="boolean"&&(d=m.$_terms.truthy&&m.$_terms.truthy.has(d,null,null,!m._flags.sensitive)||(!m.$_terms.falsy||!m.$_terms.falsy.has(d,null,null,!m._flags.sensitive))&&d),{value:d}}},validate(d,{error:m}){if(typeof d!="boolean")return{value:d,errors:m("boolean.base")}},rules:{truthy:{method(...d){u.verifyFlat(d,"truthy");const m=this.clone();m.$_terms.truthy=m.$_terms.truthy||new f;for(let p=0;pd?1:0},string:{from:l.isBool,to:(d,m)=>d?"true":"false"}},manifest:{build:(d,m)=>(m.truthy&&(d=d.truthy(...m.truthy)),m.falsy&&(d=d.falsy(...m.falsy)),d)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(s,i,a)=>{const o=a(375),c=a(8068),u=a(8160),f=a(3328),l={isDate:function(d){return d instanceof Date}};s.exports=c.extend({type:"date",coerce:{from:["number","string"],method:(d,{schema:m})=>({value:l.parse(d,m._flags.format)||d})},validate(d,{schema:m,error:p,prefs:h}){if(d instanceof Date&&!isNaN(d.getTime()))return;const y=m._flags.format;return h.convert&&y&&typeof d=="string"?{value:d,errors:p("date.format",{format:y})}:{value:d,errors:p("date.base")}},rules:{compare:{method:!1,validate(d,m,{date:p},{name:h,operator:y,args:g}){const v=p==="now"?Date.now():p.getTime();return u.compare(d.getTime(),v,y)?d:m.error("date."+h,{limit:g.date,value:d})},args:[{name:"date",ref:!0,normalize:d=>d==="now"?d:l.parse(d),assert:d=>d!==null,message:"must have a valid date format"}]},format:{method(d){return o(["iso","javascript","unix"].includes(d),"Unknown date format",d),this.$_setFlag("format",d)}},greater:{method(d){return this.$_addRule({name:"greater",method:"compare",args:{date:d},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(d){return this.$_addRule({name:"less",method:"compare",args:{date:d},operator:"<"})}},max:{method(d){return this.$_addRule({name:"max",method:"compare",args:{date:d},operator:"<="})}},min:{method(d){return this.$_addRule({name:"min",method:"compare",args:{date:d},operator:">="})}},timestamp:{method(d="javascript"){return o(["javascript","unix"].includes(d),'"type" must be one of "javascript, unix"'),this.format(d)}}},cast:{number:{from:l.isDate,to:(d,m)=>d.getTime()},string:{from:l.isDate,to:(d,{prefs:m})=>f.date(d,m)}},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(d,m){if(d instanceof Date)return d;if(typeof d!="string"&&(isNaN(d)||!isFinite(d))||/^\s*$/.test(d))return null;if(m==="iso")return u.isIsoDate(d)?l.date(d.toString()):null;const p=d;if(typeof d=="string"&&/^[+-]?\d+(\.\d+)?$/.test(d)&&(d=parseFloat(d)),m){if(m==="javascript")return l.date(1*d);if(m==="unix")return l.date(1e3*d);if(typeof p=="string")return null}return l.date(d)},l.date=function(d){const m=new Date(d);return isNaN(m.getTime())?null:m}},390:(s,i,a)=>{const o=a(375),c=a(7824);s.exports=c.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(u){return o(Number.isSafeInteger(u)&&u>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:u}})},validate:(u,f,{n:l})=>u.length===l?u:f.error("function.arity",{n:l})},class:{method(){return this.$_addRule("class")},validate:(u,f)=>/^\s*class\s/.test(u.toString())?u:f.error("function.class",{value:u})},minArity:{method(u){return o(Number.isSafeInteger(u)&&u>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:u}})},validate:(u,f,{n:l})=>u.length>=l?u:f.error("function.minArity",{n:l})},maxArity:{method(u){return o(Number.isSafeInteger(u)&&u>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:u}})},validate:(u,f,{n:l})=>u.length<=l?u: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,a)=>{const o=a(978),c=a(375),u=a(8571),f=a(3652),l=a(8068),d=a(8160),m=a(3292),p=a(6354),h=a(6133),y=a(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,w)=>v.keys(w),validate(v,{schema:w,error:x,state:A,prefs:T}){if(!v||typeof v!==w.$_property("typeof")||Array.isArray(v))return{value:v,errors:x("object.base",{type:w.$_property("typeof")})};if(!(w.$_terms.renames||w.$_terms.dependencies||w.$_terms.keys||w.$_terms.patterns||w.$_terms.externals))return;v=g.clone(v,T);const R=[];if(w.$_terms.renames&&!g.rename(w,v,A,T,R))return{value:v,errors:R};if(!w.$_terms.keys&&!w.$_terms.patterns&&!w.$_terms.dependencies)return{value:v,errors:R};const E=new Set(Object.keys(v));if(w.$_terms.keys){const k=[v,...A.ancestors];for(const N of w.$_terms.keys){const O=N.key,L=v[O];E.delete(O);const I=A.localize([...A.path,O],k,N),F=N.schema.$_validate(L,I,T);if(F.errors){if(T.abortEarly)return{value:v,errors:F.errors};F.value!==void 0&&(v[O]=F.value),R.push(...F.errors)}else N.schema._flags.result==="strip"||F.value===void 0&&L!==void 0?delete v[O]:F.value!==void 0&&(v[O]=F.value)}}if(E.size||w._flags._hasPatternMatch){const k=g.unknown(w,v,E,R,A,T);if(k)return k}if(w.$_terms.dependencies)for(const k of w.$_terms.dependencies){if(k.key!==null&&g.isPresent(k.options)(k.key.resolve(v,A,T,null,{shadow:!1}))===!1)continue;const N=g.dependencies[k.rel](w,k,v,A,T);if(N){const O=w.$_createError(N.code,v,N.context,A,T);if(T.abortEarly)return{value:v,errors:O};R.push(O)}}return{value:v,errors:R}},rules:{and:{method(...v){return d.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,w,x){y.isTemplate(v)||(v=m.ref(v)),c(x===void 0||typeof x=="string","Message must be a string"),w=this.$_compile(w,{appendPath:!0});const A=this.$_addRule({name:"assert",args:{subject:v,schema:w,message:x}});return A.$_mutateRegister(v),A.$_mutateRegister(w),A},validate(v,{error:w,prefs:x,state:A},{subject:T,schema:R,message:E}){const k=T.resolve(v,A,x),N=h.isRef(T)?T.absolute(A):[];return R.$_match(k,A.localize(N,[v,...A.ancestors],R),x)?v:w("object.assert",{subject:T,message:E})},args:["subject","schema","message"],multi:!0},instance:{method(v,w){return c(typeof v=="function","constructor must be a function"),w=w||v.name,this.$_addRule({name:"instance",args:{constructor:v,name:w}})},validate:(v,w,{constructor:x,name:A})=>v instanceof x?v:w.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(!d.isSchema(v),"Object schema cannot be a joi schema");const w=this.clone();if(v)if(Object.keys(v).length){w.$_terms.keys=w.$_terms.keys?w.$_terms.keys.filter(x=>!v.hasOwnProperty(x.key)):new g.Keys;for(const x in v)d.tryWithPath(()=>w.$_terms.keys.push({key:x,schema:this.$_compile(v[x])}),x)}else w.$_terms.keys=new g.Keys;else w.$_terms.keys=null;return w.$_mutateRebuild()}},length:{method(v){return this.$_addRule({name:"length",args:{limit:v},operator:"="})},validate:(v,w,{limit:x},{name:A,operator:T,args:R})=>d.compare(Object.keys(v).length,x,T)?v:w.error("object."+A,{limit:R.limit,value:v}),args:[{name:"limit",ref:!0,assert:d.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 d.verifyFlat(v,"nand"),g.dependency(this,"nand",null,v)}},or:{method(...v){return d.verifyFlat(v,"or"),g.dependency(this,"or",null,v)}},oxor:{method(...v){return g.dependency(this,"oxor",null,v)}},pattern:{method(v,w,x={}){const A=v instanceof RegExp;A||(v=this.$_compile(v,{appendPath:!0})),c(w!==void 0,"Invalid rule"),d.assertOptions(x,["fallthrough","matches"]),A&&c(!v.flags.includes("g")&&!v.flags.includes("y"),"pattern should not use global or sticky mode"),w=this.$_compile(w,{appendPath:!0});const T=this.clone();T.$_terms.patterns=T.$_terms.patterns||[];const R={[A?"regex":"schema"]:v,rule:w};return x.matches&&(R.matches=this.$_compile(x.matches),R.matches.type!=="array"&&(R.matches=R.matches.$_root.array().items(R.matches)),T.$_mutateRegister(R.matches),T.$_setFlag("_hasPatternMatch",!0,{clone:!1})),x.fallthrough&&(R.fallthrough=!0),T.$_terms.patterns.push(R),T.$_mutateRegister(w),T}},ref:{method(){return this.$_addRule("ref")},validate:(v,w)=>h.isRef(v)?v:w.error("object.refType",{value:v})},regex:{method(){return this.$_addRule("regex")},validate:(v,w)=>v instanceof RegExp?v:w.error("object.regex",{value:v})},rename:{method(v,w,x={}){c(typeof v=="string"||v instanceof RegExp,"Rename missing the from argument"),c(typeof w=="string"||w instanceof y,"Invalid rename to argument"),c(w!==v,"Cannot rename key to same name:",v),d.assertOptions(x,["alias","ignoreUndefined","override","multiple"]);const A=this.clone();A.$_terms.renames=A.$_terms.renames||[];for(const T of A.$_terms.renames)c(T.from!==v,"Cannot rename the same key multiple times");return w instanceof y&&A.$_mutateRegister(w),A.$_terms.renames.push({from:v,to:w,options:o(g.renameDefaults,x)}),A}},schema:{method(v="any"){return this.$_addRule({name:"schema",args:{type:v}})},validate:(v,w,{type:x})=>!d.isSchema(v)||x!=="any"&&v.type!==x?w.error("object.schema",{type:x}):v},unknown:{method(v){return this.$_setFlag("unknown",v!==!1)}},with:{method(v,w,x={}){return g.dependency(this,"with",v,w,x)}},without:{method(v,w,x={}){return g.dependency(this,"without",v,w,x)}},xor:{method(...v){return d.verifyFlat(v,"xor"),g.dependency(this,"xor",null,v)}}},overrides:{default(v,w){return v===void 0&&(v=d.symbols.deepDefault),this.$_parent("default",v,w)}},rebuild(v){if(v.$_terms.keys){const w=new f.Sorter;for(const x of v.$_terms.keys)d.tryWithPath(()=>w.add(x,{after:x.schema.$_rootReferences(),group:x.key}),x.key);v.$_terms.keys=new g.Keys(...w.nodes)}},manifest:{build(v,w){if(w.keys&&(v=v.keys(w.keys)),w.dependencies)for(const{rel:x,key:A=null,peers:T,options:R}of w.dependencies)v=g.dependency(v,x,A,T,R);if(w.patterns)for(const{regex:x,schema:A,rule:T,fallthrough:R,matches:E}of w.patterns)v=v.pattern(x||A,T,{fallthrough:R,matches:E});if(w.renames)for(const{from:x,to:A,options:T}of w.renames)v=v.rename(x,A,T);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,w){if(typeof v=="object"){if(w.nonEnumerables)return u(v,{shallow:!0});const A=Object.create(Object.getPrototypeOf(v));return Object.assign(A,v),A}const x=function(...A){return v.apply(this,A)};return x.prototype=u(v.prototype),Object.defineProperty(x,"name",{value:v.name,writable:!1}),Object.defineProperty(x,"length",{value:v.length,writable:!1}),Object.assign(x,v),x},g.dependency=function(v,w,x,A,T){c(x===null||typeof x=="string",w,"key must be a strings"),T||(T=A.length>1&&typeof A[A.length-1]=="object"?A.pop():{}),d.assertOptions(T,["separator","isPresent"]),A=[].concat(A);const R=d.default(T.separator,"."),E=[];for(const N of A)c(typeof N=="string",w,"peers must be strings"),E.push(m.ref(N,{separator:R,ancestor:0,prefix:!1}));x!==null&&(x=m.ref(x,{separator:R,ancestor:0,prefix:!1}));const k=v.clone();return k.$_terms.dependencies=k.$_terms.dependencies||[],k.$_terms.dependencies.push(new g.Dependency(w,x,E,A,T)),k},g.dependencies={and(v,w,x,A,T){const R=[],E=[],k=w.peers.length,N=g.isPresent(w.options);for(const O of w.peers)N(O.resolve(x,A,T,null,{shadow:!1}))===!1?R.push(O.key):E.push(O.key);if(R.length!==k&&E.length!==k)return{code:"object.and",context:{present:E,presentWithLabels:g.keysToLabels(v,E),missing:R,missingWithLabels:g.keysToLabels(v,R)}}},nand(v,w,x,A,T){const R=[],E=g.isPresent(w.options);for(const O of w.peers)E(O.resolve(x,A,T,null,{shadow:!1}))&&R.push(O.key);if(R.length!==w.peers.length)return;const k=w.paths[0],N=w.paths.slice(1);return{code:"object.nand",context:{main:k,mainWithLabel:g.keysToLabels(v,k),peers:N,peersWithLabels:g.keysToLabels(v,N)}}},or(v,w,x,A,T){const R=g.isPresent(w.options);for(const E of w.peers)if(R(E.resolve(x,A,T,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:w.paths,peersWithLabels:g.keysToLabels(v,w.paths)}}},oxor(v,w,x,A,T){const R=[],E=g.isPresent(w.options);for(const N of w.peers)E(N.resolve(x,A,T,null,{shadow:!1}))&&R.push(N.key);if(!R.length||R.length===1)return;const k={peers:w.paths,peersWithLabels:g.keysToLabels(v,w.paths)};return k.present=R,k.presentWithLabels=g.keysToLabels(v,R),{code:"object.oxor",context:k}},with(v,w,x,A,T){const R=g.isPresent(w.options);for(const E of w.peers)if(R(E.resolve(x,A,T,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:w.key.key,mainWithLabel:g.keysToLabels(v,w.key.key),peer:E.key,peerWithLabel:g.keysToLabels(v,E.key)}}},without(v,w,x,A,T){const R=g.isPresent(w.options);for(const E of w.peers)if(R(E.resolve(x,A,T,null,{shadow:!1})))return{code:"object.without",context:{main:w.key.key,mainWithLabel:g.keysToLabels(v,w.key.key),peer:E.key,peerWithLabel:g.keysToLabels(v,E.key)}}},xor(v,w,x,A,T){const R=[],E=g.isPresent(w.options);for(const N of w.peers)E(N.resolve(x,A,T,null,{shadow:!1}))&&R.push(N.key);if(R.length===1)return;const k={peers:w.paths,peersWithLabels:g.keysToLabels(v,w.paths)};return R.length===0?{code:"object.missing",context:k}:(k.present=R,k.presentWithLabels=g.keysToLabels(v,R),{code:"object.xor",context:k})}},g.keysToLabels=function(v,w){return Array.isArray(w)?w.map(x=>v.$_mapLabels(x)):v.$_mapLabels(w)},g.isPresent=function(v){return typeof v.isPresent=="function"?v.isPresent:w=>w!==void 0},g.rename=function(v,w,x,A,T){const R={};for(const E of v.$_terms.renames){const k=[],N=typeof E.from!="string";if(N)for(const O in w){if(w[O]===void 0&&E.options.ignoreUndefined||O===E.to)continue;const L=E.from.exec(O);L&&k.push({from:O,to:E.to,match:L})}else!Object.prototype.hasOwnProperty.call(w,E.from)||w[E.from]===void 0&&E.options.ignoreUndefined||k.push(E);for(const O of k){const L=O.from;let I=O.to;if(I instanceof y&&(I=I.render(w,x,A,O.match)),L!==I){if(!E.options.multiple&&R[I]&&(T.push(v.$_createError("object.rename.multiple",w,{from:L,to:I,pattern:N},x,A)),A.abortEarly)||Object.prototype.hasOwnProperty.call(w,I)&&!E.options.override&&!R[I]&&(T.push(v.$_createError("object.rename.override",w,{from:L,to:I,pattern:N},x,A)),A.abortEarly))return!1;w[L]===void 0?delete w[I]:w[I]=w[L],R[I]=!0,E.options.alias||delete w[L]}}}return!0},g.unknown=function(v,w,x,A,T,R){if(v.$_terms.patterns){let E=!1;const k=v.$_terms.patterns.map(O=>{if(O.matches)return E=!0,[]}),N=[w,...T.ancestors];for(const O of x){const L=w[O],I=[...T.path,O];for(let F=0;F{const o=a(375),c=a(8068),u=a(8160),f=a(3292),l=a(6354),d={};s.exports=c.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(m,p)=>m.ref(p),validate(m,{schema:p,state:h,prefs:y}){o(p.$_terms.link,"Uninitialized link schema");const g=d.generate(p,m,h,y),v=p.$_terms.link[0].ref;return g.$_validate(m,h.nest(g,`link:${v.display}:${g.type}`),y)},generate:(m,p,h,y)=>d.generate(m,p,h,y),rules:{ref:{method(m){o(!this.$_terms.link,"Cannot reinitialize schema"),m=f.ref(m),o(m.type==="value"||m.type==="local","Invalid reference type:",m.type),o(m.type==="local"||m.ancestor==="root"||m.ancestor>0,"Link cannot reference itself");const p=this.clone();return p.$_terms.link=[{ref:m}],p}},relative:{method(m=!0){return this.$_setFlag("relative",m)}}},overrides:{concat(m){o(this.$_terms.link,"Uninitialized link schema"),o(u.isSchema(m),"Invalid schema object"),o(m.type!=="link","Cannot merge type link with another link");const p=this.clone();return p.$_terms.whens||(p.$_terms.whens=[]),p.$_terms.whens.push({concat:m}),p.$_mutateRebuild()}},manifest:{build:(m,p)=>(o(p.link,"Invalid link description missing link"),m.ref(p.link))}}),d.generate=function(m,p,h,y){let g=h.mainstay.links.get(m);if(g)return g._generate(p,h,y).schema;const v=m.$_terms.link[0].ref,{perspective:w,path:x}=d.perspective(v,h);d.assert(w,"which is outside of schema boundaries",v,m,h,y);try{g=x.length?w.$_reach(x):w}catch{d.assert(!1,"to non-existing schema",v,m,h,y)}return d.assert(g.type!=="link","which is another link",v,m,h,y),m._flags.relative||h.mainstay.links.set(m,g),g._generate(p,h,y).schema},d.perspective=function(m,p){if(m.type==="local"){for(const{schema:h,key:y}of p.schemas){if((h._flags.id||y)===m.path[0])return{perspective:h,path:m.path.slice(1)};if(h.$_terms.shared){for(const g of h.$_terms.shared)if(g._flags.id===m.path[0])return{perspective:g,path:m.path.slice(1)}}}return{perspective:null,path:null}}return m.ancestor==="root"?{perspective:p.schemas[p.schemas.length-1].schema,path:m.path}:{perspective:p.schemas[m.ancestor]&&p.schemas[m.ancestor].schema,path:m.path}},d.assert=function(m,p,h,y,g,v){m||o(!1,`"${l.label(y._flags,g,v)}" contains link reference "${h.display}" ${p}`)}},3832:(s,i,a)=>{const o=a(375),c=a(8068),u=a(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 d=l.toString(),m=d.indexOf("."),p=d.indexOf("e");return(m<0?0:(p<0?d.length:p)-m-1)+(p<0?0:Math.max(0,-parseInt(d.slice(p+1))))}};s.exports=c.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(l,{schema:d,error:m}){if(!l.match(f.numberRx))return;l=l.trim();const p={value:parseFloat(l)};if(p.value===0&&(p.value=0),!d._flags.unsafe)if(l.match(/e/i)){if(f.extractSignificantDigits(l)!==f.extractSignificantDigits(String(p.value)))return p.errors=m("number.unsafe"),p}else{const h=p.value.toString();if(h.match(/e/i))return p;if(h!==f.normalizeDecimal(l))return p.errors=m("number.unsafe"),p}return p}},validate(l,{schema:d,error:m,prefs:p}){if(l===1/0||l===-1/0)return{value:l,errors:m("number.infinity")};if(!u.isNumber(l))return{value:l,errors:m("number.base")};const h={value:l};if(p.convert){const y=d.$_getRule("precision");if(y){const g=Math.pow(10,y.args.limit);h.value=Math.round(h.value*g)/g}}return h.value===0&&(h.value=0),!d._flags.unsafe&&(l>Number.MAX_SAFE_INTEGER||lu.compare(l,m,h)?l:d.error("number."+p,{limit:y.limit,value:l}),args:[{name:"limit",ref:!0,assert:u.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,d)=>Math.trunc(l)-l==0?l:d.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 d=typeof l=="number"?f.decimalPlaces(l):null,m=Math.pow(10,d);return this.$_addRule({name:"multiple",args:{base:l,baseDecimalPlace:d,pfactor:m}})},validate:(l,d,{base:m,baseDecimalPlace:p,pfactor:h},y)=>f.decimalPlaces(l)>p?d.error("number.multiple",{multiple:y.args.base,value:l}):Math.round(h*l)%Math.round(h*m)==0?l:d.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,d)=>Number.isSafeInteger(l)&&l>=0&&l<=65535?l:d.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(l){return o(Number.isSafeInteger(l),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:l}})},validate(l,d,{limit:m}){const p=l.toString().match(f.precisionRx);return Math.max((p[1]?p[1].length:0)-(p[2]?parseInt(p[2],10):0),0)<=m?l:d.error("number.precision",{limit:m,value:l})},convert:!0},sign:{method(l){return o(["negative","positive"].includes(l),"Invalid sign",l),this.$_addRule({name:"sign",args:{sign:l}})},validate:(l,d,{sign:m})=>m==="negative"&&l<0||m==="positive"&&l>0?l:d.error(`number.${m}`)},unsafe:{method(l=!0){return o(typeof l=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",l)}}},cast:{string:{from:l=>typeof l=="number",to:(l,d)=>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,a)=>{const o=a(7824);s.exports=o.extend({type:"object",cast:{map:{from:c=>c&&typeof c=="object",to:(c,u)=>new Map(Object.entries(c))}}})},7417:(s,i,a)=>{const o=a(375),c=a(5380),u=a(1745),f=a(9959),l=a(6064),d=a(9926),m=a(5752),p=a(8068),h=a(8160),y={tlds:d instanceof Set&&{tlds:{allow:d,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=p.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(g,{schema:v,state:w,prefs:x}){const A=v.$_getRule("normalize");A&&(g=g.normalize(A.args.form));const T=v.$_getRule("case");T&&(g=T.args.direction==="upper"?g.toLocaleUpperCase():g.toLocaleLowerCase());const R=v.$_getRule("trim");if(R&&R.args.enabled&&(g=g.trim()),v.$_terms.replacements)for(const k of v.$_terms.replacements)g=g.replace(k.pattern,k.replacement);const E=v.$_getRule("hex");if(E&&E.args.options.byteAligned&&g.length%2!=0&&(g=`0${g}`),v.$_getRule("isoDate")){const k=y.isoDate(g);k&&(g=k)}if(v._flags.truncate){const k=v.$_getRule("max");if(k){let N=k.args.limit;if(h.isResolvable(N)&&(N=N.resolve(g,w,x),!h.limit(N)))return{value:g,errors:v.$_createError("any.ref",N,{ref:k.args.limit,arg:"limit",reason:"must be a positive integer"},w,x)};g=g.slice(0,N)}}return{value:g}}},validate(g,{schema:v,error:w}){if(typeof g!="string")return{value:g,errors:w("string.base")};if(g===""){const x=v.$_getRule("min");return x&&x.args.limit===0?void 0:{value:g,errors:w("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 h.assertOptions(g,["paddingRequired","urlSafe"]),g={urlSafe:!1,paddingRequired:!0,...g},o(typeof g.paddingRequired=="boolean","paddingRequired must be boolean"),o(typeof g.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:g}})},validate:(g,v,{options:w})=>y.base64Regex[w.paddingRequired][w.urlSafe].test(g)?g:v.error("string.base64")},case:{method(g){return o(["lower","upper"].includes(g),"Invalid case:",g),this.$_addRule({name:"case",args:{direction:g}})},validate:(g,v,{direction:w})=>w==="lower"&&g===g.toLocaleLowerCase()||w==="upper"&&g===g.toLocaleUpperCase()?g:v.error(`string.${w}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(g,v){let w=g.length,x=0,A=1;for(;w--;){const T=g.charAt(w)*A;x+=T-9*(T>9),A^=3}return x>0&&x%10==0?g:v.error("string.creditCard")}},dataUri:{method(g={}){return h.assertOptions(g,["paddingRequired"]),g={paddingRequired:!0,...g},o(typeof g.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:g}})},validate(g,v,{options:w}){const x=g.match(y.dataUriRegex);return x&&(!x[2]||x[2]!=="base64"||y.base64Regex[w.paddingRequired].false.test(x[3]))?g:v.error("string.dataUri")}},domain:{method(g){g&&h.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,w,{address:x})=>c.isValid(g,x)?g:v.error("string.domain")},email:{method(g={}){h.assertOptions(g,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),o(g.multiple===void 0||typeof g.multiple=="boolean","multiple option must be an boolean");const v=y.addressOptions(g),w=new RegExp(`\\s*[${g.separator?l(g.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:g},regex:w,address:v})},validate(g,v,{options:w},{regex:x,address:A}){const T=w.multiple?g.split(x):[g],R=[];for(const E of T)u.isValid(E,A)||R.push(E);return R.length?v.error("string.email",{value:g,invalids:R}):g}},guid:{alias:"uuid",method(g={}){h.assertOptions(g,["version","separator"]);let v="";if(g.version){const A=[].concat(g.version);o(A.length>=1,"version must have at least 1 valid version specified");const T=new Set;for(let R=0;R(w.prefix==="optional"?y.hexRegex.withOptionalPrefix:w.prefix===!0?y.hexRegex.withPrefix:y.hexRegex.withoutPrefix).test(g)?w.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={}){h.assertOptions(g,["cidr","version"]);const{cidr:v,versions:w,regex:x}=f.regex(g),A=g.version?w:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:v,version:A}},regex:x})},validate:(g,v,{options:w},{regex:x})=>x.test(g)?g:w.version?v.error("string.ipVersion",{value:g,cidr:w.cidr,version:w.version}):v.error("string.ip",{value:g,cidr:w.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:w,encoding:x},{name:A,operator:T,args:R}){const E=!x&&g.length;return h.compare(E,w,T)?g:v.error("string."+A,{limit:R.limit,value:g,encoding:x})},args:[{name:"limit",ref:!0,assert:h.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 o(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:w})=>g===g.normalize(w)?g:v("string.normalize",{value:g,form:w}),convert:!0},pattern:{alias:"regex",method(g,v={}){o(g instanceof RegExp,"regex must be a RegExp"),o(!g.flags.includes("g")&&!g.flags.includes("y"),"regex should not use global or sticky mode"),typeof v=="string"&&(v={name:v}),h.assertOptions(v,["invert","name"]);const w=["string.pattern",v.invert?".invert":"",v.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:g,options:v},errorCode:w})},validate:(g,v,{regex:w,options:x},{errorCode:A})=>w.test(g)^x.invert?g:v.error(A,{name:x.name,regex:w,value:g}),args:["regex","options"],multi:!0},replace:{method(g,v){typeof g=="string"&&(g=new RegExp(l(g),"g")),o(g instanceof RegExp,"pattern must be a RegExp"),o(typeof v=="string","replacement must be a String");const w=this.clone();return w.$_terms.replacements||(w.$_terms.replacements=[]),w.$_terms.replacements.push({pattern:g,replacement:v}),w}},token:{method(){return this.$_addRule("token")},validate:(g,v)=>/^\w+$/.test(g)?g:v.error("string.token")},trim:{method(g=!0){return o(typeof g=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:g}})},validate:(g,v,{enabled:w})=>w&&g!==g.trim()?v.error("string.trim"):g,convert:!0},truncate:{method(g=!0){return o(typeof g=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",g)}},uppercase:{method(){return this.case("upper")}},uri:{method(g={}){h.assertOptions(g,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),g.domain&&h.assertOptions(g.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:v,scheme:w}=m.regex(g),x=g.domain?y.addressOptions(g.domain):null;return this.$_addRule({name:"uri",args:{options:g},regex:v,domain:x,scheme:w})},validate(g,v,{options:w},{regex:x,domain:A,scheme:T}){if(["http:/","https:/"].includes(g))return v.error("string.uri");let R=x.exec(g);if(!R&&v.prefs.convert&&w.encodeUri){const E=encodeURI(g);R=x.exec(E),R&&(g=E)}if(R){const E=R[1]||R[2];return!A||w.allowRelative&&!E||c.isValid(E,A)?g:v.error("string.domain",{value:E})}return w.relativeOnly?v.error("string.uriRelativeOnly"):w.scheme?v.error("string.uriCustomScheme",{scheme:T,value:g}):v.error("string.uri")}}},manifest:{build(g,v){if(v.replacements)for(const{pattern:w,replacement:x}of v.replacements)g=g.replace(w,x);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(o(g.minDomainSegments===void 0||Number.isSafeInteger(g.minDomainSegments)&&g.minDomainSegments>0,"minDomainSegments must be a positive integer"),o(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 o(y.tlds,"Built-in TLD list disabled"),Object.assign({},g,y.tlds);o(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)}})),o(g.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),o(!g.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),y.validateTlds(g.tlds.deny,"tlds.deny"),g;const w=g.tlds.allow;return w?w===!0?(o(y.tlds,"Built-in TLD list disabled"),Object.assign({},g,y.tlds)):(Array.isArray(w)&&(g=Object.assign({},g,{tlds:{allow:new Set(w)}})),o(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 w of g)o(c.isValid(w,{minDomainSegments:1,maxDomainSegments:1}),`${v} must contain valid top level domain names`)},y.isoDate=function(g){if(!h.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,w,x,A){return o(!A||!1,"Invalid encoding:",A),g.$_addRule({name:v,method:"length",args:{limit:w,encoding:A},operator:x})}},8826:(s,i,a)=>{const o=a(375),c=a(8068),u={};u.Map=class extends Map{slice(){return new u.Map(this)}},s.exports=c.extend({type:"symbol",terms:{map:{init:new u.Map}},coerce:{method(f,{schema:l,error:d}){const m=l.$_terms.map.get(f);return m&&(f=m),l._flags.only&&typeof f!="symbol"?{value:f,errors:d("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)),o(f&&f[Symbol.iterator],"Iterable must be an iterable or object");const l=this.clone(),d=[];for(const m of f){o(m&&m[Symbol.iterator],"Entry must be an iterable");const[p,h]=m;o(typeof p!="object"&&typeof p!="function"&&typeof p!="symbol","Key must not be of type object, function, or Symbol"),o(typeof h=="symbol","Value must be a Symbol"),l.$_terms.map.set(p,h),d.push(h)}return l.valid(...d)}}},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,a)=>{const o=a(375),c=a(8571),u=a(738),f=a(9621),l=a(8160),d=a(6354),m=a(493),p={result:Symbol("result")};i.entry=function(h,y,g){let v=l.defaults;g&&(o(g.warnings===void 0,"Cannot override warnings preference in synchronous validation"),o(g.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),v=l.preferences(l.defaults,g));const w=p.entry(h,y,v);o(!w.mainstay.externals.length,"Schema with external rules must use validateAsync()");const x={value:w.value};return w.error&&(x.error=w.error),w.mainstay.warnings.length&&(x.warning=d.details(w.mainstay.warnings)),w.mainstay.debug&&(x.debug=w.mainstay.debug),w.mainstay.artifacts&&(x.artifacts=w.mainstay.artifacts),x},i.entryAsync=async function(h,y,g){let v=l.defaults;g&&(v=l.preferences(l.defaults,g));const w=p.entry(h,y,v),x=w.mainstay;if(w.error)throw x.debug&&(w.error.debug=x.debug),w.error;if(x.externals.length){let T=w.value;const R=[];for(const E of x.externals){const k=E.state.path,N=E.schema.type==="link"?x.links.get(E.schema):null;let O,L,I=T;const F=k.length?[T]:[],U=k.length?f(h,k):h;if(k.length){O=k[k.length-1];let Y=T;for(const V of k.slice(0,-1))Y=Y[V],F.unshift(Y);L=F[0],I=L[O]}try{const Y=(H,ee)=>(N||E.schema).$_createError(H,I,ee,E.state,v),V=await E.method(I,{schema:E.schema,linked:N,state:E.state,prefs:g,original:U,error:Y,errorsArray:p.errorsArray,warn:(H,ee)=>x.warnings.push((N||E.schema).$_createError(H,I,ee,E.state,v)),message:(H,ee)=>(N||E.schema).$_createError("external",I,ee,E.state,v,{messages:H})});if(V===void 0||V===I)continue;if(V instanceof d.Report){if(x.tracer.log(E.schema,E.state,"rule","external","error"),R.push(V),v.abortEarly)break;continue}if(Array.isArray(V)&&V[l.symbols.errors]){if(x.tracer.log(E.schema,E.state,"rule","external","error"),R.push(...V),v.abortEarly)break;continue}L?(x.tracer.value(E.state,"rule",I,V,"external"),L[O]=V):(x.tracer.value(E.state,"rule",T,V,"external"),T=V)}catch(Y){throw v.errors.label&&(Y.message+=` (${E.label})`),Y}}if(w.value=T,R.length)throw w.error=d.process(R,h,v),x.debug&&(w.error.debug=x.debug),w.error}if(!v.warnings&&!v.debug&&!v.artifacts)return w.value;const A={value:w.value};return x.warnings.length&&(A.warning=d.details(x.warnings)),x.debug&&(A.debug=x.debug),x.artifacts&&(A.artifacts=x.artifacts),A},p.Mainstay=class{constructor(h,y,g){this.externals=[],this.warnings=[],this.tracer=h,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 h=this._snapshots.pop();this.externals=h.externals,this.warnings=h.warnings}commit(){this._snapshots.pop()}},p.entry=function(h,y,g){const{tracer:v,cleanup:w}=p.tracer(y,g),x=g.debug?[]:null,A=y._ids._schemaChain?new Map:null,T=new p.Mainstay(v,x,A),R=y._ids._schemaChain?[{schema:y}]:null,E=new m([],[],{mainstay:T,schemas:R}),k=i.validate(h,y,E,g);w&&y.$_root.untrace();const N=d.process(k.errors,h,g);return{value:k.value,error:N,mainstay:T}},p.tracer=function(h,y){return h.$_root._tracer?{tracer:h.$_root._tracer._register(h)}:y.debug?(o(h.$_root.trace,"Debug mode not supported"),{tracer:h.$_root.trace()._register(h),cleanup:!0}):{tracer:p.ignore}},i.validate=function(h,y,g,v,w={}){if(y.$_terms.whens&&(y=y._generate(h,g,v).schema),y._preferences&&(v=p.prefs(y,v)),y._cache&&v.cache){const N=y._cache.get(h);if(g.mainstay.tracer.debug(g,"validate","cached",!!N),N)return N}const x=(N,O,L)=>y.$_createError(N,h,O,L||g,v),A={original:h,prefs:v,schema:y,state:g,error:x,errorsArray:p.errorsArray,warn:(N,O,L)=>g.mainstay.warnings.push(x(N,O,L)),message:(N,O)=>y.$_createError("custom",h,O,g,v,{messages:N})};g.mainstay.tracer.entry(y,g);const T=y._definition;if(T.prepare&&h!==void 0&&v.convert){const N=T.prepare(h,A);if(N){if(g.mainstay.tracer.value(g,"prepare",h,N.value),N.errors)return p.finalize(N.value,[].concat(N.errors),A);h=N.value}}if(T.coerce&&h!==void 0&&v.convert&&(!T.coerce.from||T.coerce.from.includes(typeof h))){const N=T.coerce.method(h,A);if(N){if(g.mainstay.tracer.value(g,"coerced",h,N.value),N.errors)return p.finalize(N.value,[].concat(N.errors),A);h=N.value}}const R=y._flags.empty;R&&R.$_match(p.trim(h,y),g.nest(R),l.defaults)&&(g.mainstay.tracer.value(g,"empty",h,void 0),h=void 0);const E=w.presence||y._flags.presence||(y._flags._endedSwitch?null:v.presence);if(h===void 0){if(E==="forbidden")return p.finalize(h,null,A);if(E==="required")return p.finalize(h,[y.$_createError("any.required",h,null,g,v)],A);if(E==="optional"){if(y._flags.default!==l.symbols.deepDefault)return p.finalize(h,null,A);g.mainstay.tracer.value(g,"default",h,{}),h={}}}else if(E==="forbidden")return p.finalize(h,[y.$_createError("any.unknown",h,null,g,v)],A);const k=[];if(y._valids){const N=y._valids.get(h,g,v,y._flags.insensitive);if(N)return v.convert&&(g.mainstay.tracer.value(g,"valids",h,N.value),h=N.value),g.mainstay.tracer.filter(y,g,"valid",N),p.finalize(h,null,A);if(y._flags.only){const O=y.$_createError("any.only",h,{valids:y._valids.values({display:!0})},g,v);if(v.abortEarly)return p.finalize(h,[O],A);k.push(O)}}if(y._invalids){const N=y._invalids.get(h,g,v,y._flags.insensitive);if(N){g.mainstay.tracer.filter(y,g,"invalid",N);const O=y.$_createError("any.invalid",h,{invalids:y._invalids.values({display:!0})},g,v);if(v.abortEarly)return p.finalize(h,[O],A);k.push(O)}}if(T.validate){const N=T.validate(h,A);if(N&&(g.mainstay.tracer.value(g,"base",h,N.value),h=N.value,N.errors)){if(!Array.isArray(N.errors))return k.push(N.errors),p.finalize(h,k,A);if(N.errors.length)return k.push(...N.errors),p.finalize(h,k,A)}}return y._rules.length?p.rules(h,k,A):p.finalize(h,k,A)},p.rules=function(h,y,g){const{schema:v,state:w,prefs:x}=g;for(const A of v._rules){const T=v._definition.rules[A.method];if(T.convert&&x.convert){w.mainstay.tracer.log(v,w,"rule",A.name,"full");continue}let R,E=A.args;if(A._resolve.length){E=Object.assign({},E);for(const N of A._resolve){const O=T.argsByName.get(N),L=E[N].resolve(h,w,x),I=O.normalize?O.normalize(L):L,F=l.validateArg(I,null,O);if(F){R=v.$_createError("any.ref",L,{arg:N,ref:E[N],reason:F},w,x);break}E[N]=I}}R=R||T.validate(h,g,E,A);const k=p.rule(R,A);if(k.errors){if(w.mainstay.tracer.log(v,w,"rule",A.name,"error"),A.warn){w.mainstay.warnings.push(...k.errors);continue}if(x.abortEarly)return p.finalize(h,k.errors,g);y.push(...k.errors)}else w.mainstay.tracer.log(v,w,"rule",A.name,"pass"),w.mainstay.tracer.value(w,"rule",h,k.value,A.name),h=k.value}return p.finalize(h,y,g)},p.rule=function(h,y){return h instanceof d.Report?(p.error(h,y),{errors:[h],value:null}):Array.isArray(h)&&h[l.symbols.errors]?(h.forEach(g=>p.error(g,y)),{errors:h,value:null}):{errors:null,value:h}},p.error=function(h,y){return y.message&&h._setTemplate(y.message),h},p.finalize=function(h,y,g){y=y||[];const{schema:v,state:w,prefs:x}=g;if(y.length){const T=p.default("failover",void 0,y,g);T!==void 0&&(w.mainstay.tracer.value(w,"failover",h,T),h=T,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 T of y)o(T instanceof Error||T instanceof d.Report,"error() must return an Error object")}else y=[v._flags.error];if(h===void 0){const T=p.default("default",h,y,g);w.mainstay.tracer.value(w,"default",h,T),h=T}if(v._flags.cast&&h!==void 0){const T=v._definition.cast[v._flags.cast];if(T.from(h)){const R=T.to(h,g);w.mainstay.tracer.value(w,"cast",h,R,v._flags.cast),h=R}}if(v.$_terms.externals&&x.externals&&x._externals!==!1)for(const{method:T}of v.$_terms.externals)w.mainstay.externals.push({method:T,schema:v,state:w,label:d.label(v._flags,w,x)});const A={value:h,errors:y.length?y:null};return v._flags.result&&(A.value=v._flags.result==="strip"?void 0:g.original,w.mainstay.tracer.value(w,v._flags.result,h,A.value),w.shadow(h,v._flags.result)),v._cache&&x.cache!==!1&&!v._refs.length&&v._cache.set(g.original,A),h===void 0||A.errors||v._flags.artifact===void 0||(w.mainstay.artifacts=w.mainstay.artifacts||new Map,w.mainstay.artifacts.has(v._flags.artifact)||w.mainstay.artifacts.set(v._flags.artifact,[]),w.mainstay.artifacts.get(v._flags.artifact).push(w.path)),A},p.prefs=function(h,y){const g=y===l.defaults;return g&&h._preferences[l.symbols.prefs]?h._preferences[l.symbols.prefs]:(y=l.preferences(y,h._preferences),g&&(h._preferences[l.symbols.prefs]=y),y)},p.default=function(h,y,g,v){const{schema:w,state:x,prefs:A}=v,T=w._flags[h];if(A.noDefaults||T===void 0)return y;if(x.mainstay.tracer.log(w,x,"rule",h,"full"),!T)return T;if(typeof T=="function"){const R=T.length?[c(x.ancestors[0]),v]:[];try{return T(...R)}catch(E){return void g.push(w.$_createError(`any.${h}`,null,{error:E},x,A))}}return typeof T!="object"?T:T[l.symbols.literal]?T.literal:l.isResolvable(T)?T.resolve(y,x,A):c(T)},p.trim=function(h,y){if(typeof h!="string")return h;const g=y.$_getRule("trim");return g&&g.args.enabled?h.trim():h},p.ignore={active:!1,debug:u,entry:u,filter:u,log:u,resolve:u,value:u},p.errorsArray=function(){const h=[];return h[l.symbols.errors]=!0,h}},2036:(s,i,a)=>{const o=a(375),c=a(9474),u=a(8160),f={};s.exports=f.Values=class{constructor(l,d){this._values=new Set(l),this._refs=new Set(d),this._lowercase=f.lowercases(l),this._override=!1}get length(){return this._values.size+this._refs.size}add(l,d){u.isResolvable(l)?this._refs.has(l)||(this._refs.add(l),d&&d.register(l)):this.has(l,null,null,!1)||(this._values.add(l),typeof l=="string"&&this._lowercase.set(l.toLowerCase(),l))}static merge(l,d,m){if(l=l||new f.Values,d){if(d._override)return d.clone();for(const p of[...d._values,...d._refs])l.add(p)}if(m)for(const p of[...m._values,...m._refs])l.remove(p);return l.length?l:null}remove(l){u.isResolvable(l)?this._refs.delete(l):(this._values.delete(l),typeof l=="string"&&this._lowercase.delete(l.toLowerCase()))}has(l,d,m,p){return!!this.get(l,d,m,p)}get(l,d,m,p){if(!this.length)return!1;if(this._values.has(l))return{value:l};if(typeof l=="string"&&l&&p){const h=this._lowercase.get(l.toLowerCase());if(h)return{value:h}}if(!this._refs.size&&typeof l!="object")return!1;if(typeof l=="object"){for(const h of this._values)if(c(h,l))return{value:h}}if(d)for(const h of this._refs){const y=h.resolve(l,d,m,null,{in:!0});if(y===void 0)continue;const g=h.in&&typeof y=="object"?Array.isArray(y)?y:Object.keys(y):[y];for(const v of g)if(typeof v==typeof l){if(p&&l&&typeof l=="string"){if(v.toLowerCase()===l.toLowerCase())return{value:v,ref:h}}else if(c(v,l))return{value:v,ref:h}}}return!1}override(){this._override=!0}values(l){if(l&&l.display){const d=[];for(const m of[...this._values,...this._refs])m!==void 0&&d.push(m);return d}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){o(!l._override,"Cannot concat override set of values");const d=new f.Values([...this._values,...l._values],[...this._refs,...l._refs]);return d._override=this._override,d}describe(){const l=[];this._override&&l.push({override:!0});for(const d of this._values.values())l.push(d&&typeof d=="object"?{value:d}:d);for(const d of this._refs.values())l.push(d.describe());return l}},f.Values.prototype[u.symbols.values]=!0,f.Values.prototype.slice=f.Values.prototype.clone,f.lowercases=function(l){const d=new Map;if(l)for(const m of l)typeof m=="string"&&d.set(m.toLowerCase(),m);return d}},978:(s,i,a)=>{const o=a(375),c=a(8571),u=a(1687),f=a(9621),l={};s.exports=function(d,m,p={}){if(o(d&&typeof d=="object","Invalid defaults value: must be an object"),o(!m||m===!0||typeof m=="object","Invalid source value: must be true, falsy or an object"),o(typeof p=="object","Invalid options: must be an object"),!m)return null;if(p.shallow)return l.applyToDefaultsWithShallow(d,m,p);const h=c(d);if(m===!0)return h;const y=p.nullOverride!==void 0&&p.nullOverride;return u(h,m,{nullOverride:y,mergeArrays:!1})},l.applyToDefaultsWithShallow=function(d,m,p){const h=p.shallow;o(Array.isArray(h),"Invalid keys");const y=new Map,g=m===!0?null:new Set;for(let x of h){x=Array.isArray(x)?x:x.split(".");const A=f(d,x);A&&typeof A=="object"?y.set(A,g&&f(m,x)||A):g&&g.add(x)}const v=c(d,{},y);if(!g)return v;for(const x of g)l.reachCopy(v,m,x);const w=p.nullOverride!==void 0&&p.nullOverride;return u(v,m,{nullOverride:w,mergeArrays:!1})},l.reachCopy=function(d,m,p){for(const g of p){if(!(g in m))return;const v=m[g];if(typeof v!="object"||v===null)return;m=v}const h=m;let y=d;for(let g=0;g{const o=a(7916);s.exports=function(c,...u){if(!c)throw u.length===1&&u[0]instanceof Error?u[0]:new o(u)}},8571:(s,i,a)=>{const o=a(9621),c=a(4277),u=a(7043),f={needsProtoHack:new Set([c.set,c.map,c.weakSet,c.weakMap])};s.exports=f.clone=function(l,d={},m=null){if(typeof l!="object"||l===null)return l;let p=f.clone,h=m;if(d.shallow){if(d.shallow!==!0)return f.cloneWithShallow(l,d);p=w=>w}else if(h){const w=h.get(l);if(w)return w}else h=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,d);if(g===l)return l;if(h&&h.set(l,g),y===c.set)for(const w of l)g.add(p(w,d,h));else if(y===c.map)for(const[w,x]of l)g.set(w,p(x,d,h));const v=u.keys(l,d);for(const w of v){if(w==="__proto__")continue;if(y===c.array&&w==="length"){g.length=l.length;continue}const x=Object.getOwnPropertyDescriptor(l,w);x?x.get||x.set?Object.defineProperty(g,w,x):x.enumerable?g[w]=p(l[w],d,h):Object.defineProperty(g,w,{enumerable:!1,writable:!0,configurable:!0,value:p(l[w],d,h)}):Object.defineProperty(g,w,{enumerable:!0,writable:!0,configurable:!0,value:p(l[w],d,h)})}return g},f.cloneWithShallow=function(l,d){const m=d.shallow;(d=Object.assign({},d)).shallow=!1;const p=new Map;for(const h of m){const y=o(l,h);typeof y!="object"&&typeof y!="function"||p.set(y,y)}return f.clone(l,d,p)},f.base=function(l,d,m){if(m.prototype===!1)return f.needsProtoHack.has(d)?new d.constructor:d===c.array?[]:{};const p=Object.getPrototypeOf(l);if(p&&p.isImmutable)return l;if(d===c.array){const h=[];return p!==d&&Object.setPrototypeOf(h,p),h}if(f.needsProtoHack.has(d)){const h=new p.constructor;return p!==d&&Object.setPrototypeOf(h,p),h}return Object.create(p)}},9474:(s,i,a)=>{const o=a(4277),c={mismatched:null};s.exports=function(u,f,l){return l=Object.assign({prototype:!0},l),!!c.isDeepEqual(u,f,l,[])},c.isDeepEqual=function(u,f,l,d){if(u===f)return u!==0||1/u==1/f;const m=typeof u;if(m!==typeof f||u===null||f===null)return!1;if(m==="function"){if(!l.deepFunction||u.toString()!==f.toString())return!1}else if(m!=="object")return u!=u&&f!=f;const p=c.getSharedType(u,f,!!l.prototype);switch(p){case o.buffer:return!1;case o.promise:return u===f;case o.regex:return u.toString()===f.toString();case c.mismatched:return!1}for(let h=d.length-1;h>=0;--h)if(d[h].isSame(u,f))return!0;d.push(new c.SeenEntry(u,f));try{return!!c.isDeepEqualObj(p,u,f,l,d)}finally{d.pop()}},c.getSharedType=function(u,f,l){if(l)return Object.getPrototypeOf(u)!==Object.getPrototypeOf(f)?c.mismatched:o.getInternalProto(u);const d=o.getInternalProto(u);return d!==o.getInternalProto(f)?c.mismatched:d},c.valueOf=function(u){const f=u.valueOf;if(f===void 0)return u;try{return f.call(u)}catch(l){return l}},c.hasOwnEnumerableProperty=function(u,f){return Object.prototype.propertyIsEnumerable.call(u,f)},c.isSetSimpleEqual=function(u,f){for(const l of Set.prototype.values.call(u))if(!Set.prototype.has.call(f,l))return!1;return!0},c.isDeepEqualObj=function(u,f,l,d,m){const{isDeepEqual:p,valueOf:h,hasOwnEnumerableProperty:y}=c,{keys:g,getOwnPropertySymbols:v}=Object;if(u===o.array){if(!d.part){if(f.length!==l.length)return!1;for(let R=0;R{const o=a(8761);s.exports=class extends Error{constructor(c){super(c.filter(u=>u!=="").map(u=>typeof u=="string"?u:u instanceof Error?u.message:o(u)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,i.assert)}}},5277:s=>{const i={};s.exports=function(a){if(!a)return"";let o="";for(let c=0;c=256?"&#"+a+";":`&#x${a.toString(16).padStart(2,"0")};`)},i.isSafe=function(a){return i.safeCharCodes.has(a)},i.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),i.safeCharCodes=function(){const a=new Set;for(let o=32;o<123;++o)(o>=97||o>=65&&o<=90||o>=48&&o<=57||o===32||o===46||o===44||o===45||o===58||o===95)&&a.add(o);return a}()},6064:s=>{s.exports=function(i){return i.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:s=>{s.exports=function(){}},1687:(s,i,a)=>{const o=a(375),c=a(8571),u=a(7043),f={};s.exports=f.merge=function(l,d,m){if(o(l&&typeof l=="object","Invalid target value: must be an object"),o(d==null||typeof d=="object","Invalid source value: must be null, undefined, or an object"),!d)return l;if(m=Object.assign({nullOverride:!0,mergeArrays:!0},m),Array.isArray(d)){o(Array.isArray(l),"Cannot merge array onto an object"),m.mergeArrays||(l.length=0);for(let h=0;h{const o=a(375),c={};s.exports=function(u,f,l){if(f===!1||f==null)return u;typeof(l=l||{})=="string"&&(l={separator:l});const d=Array.isArray(f);o(!d||!l.separator,"Separator option is not valid for array-based chain");const m=d?f:f.split(l.separator||".");let p=u;for(let h=0;h{s.exports=function(...i){try{return JSON.stringify(...i)}catch(a){return"[Cannot display object: "+a.message+"]"}}},4277:(s,i)=>{const a={};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},a.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(o){if(Array.isArray(o))return i.array;if(o instanceof Date)return i.date;if(o instanceof RegExp)return i.regex;if(o instanceof Error)return i.error;const c=Object.prototype.toString.call(o);return a.typeMap.get(c)||i.generic}},7043:(s,i)=>{i.keys=function(a,o={}){return o.symbols!==!1?Reflect.ownKeys(a):Object.getOwnPropertyNames(a)}},3652:(s,i,a)=>{const o=a(375),c={};i.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(u,f){const l=[].concat((f=f||{}).before||[]),d=[].concat(f.after||[]),m=f.group||"?",p=f.sort||0;o(!l.includes(m),`Item cannot come before itself: ${m}`),o(!l.includes("?"),"Item cannot come before unassociated items"),o(!d.includes(m),`Item cannot come after itself: ${m}`),o(!d.includes("?"),"Item cannot come after unassociated items"),Array.isArray(u)||(u=[u]);for(const h of u){const y={seq:this._items.length,sort:p,before:l,after:d,group:m,node:h};this._items.push(y)}if(!f.manual){const h=this._sort();o(h,"item",m!=="?"?`added into group ${m}`:"","created a dependencies error")}return this.nodes}merge(u){Array.isArray(u)||(u=[u]);for(const l of u)if(l)for(const d of l._items)this._items.push(Object.assign({},d));this._items.sort(c.mergeSort);for(let l=0;lu.sort===f.sort?0:u.sort{const o=a(443),c=a(2178),u={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:o.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(u.nonAsciiRx.test(f)){if(l.allowUnicode===!1)return c.code("DOMAIN_INVALID_UNICODE_CHARS");f=f.normalize("NFC")}if(u.domainControlRx.test(f))return c.code("DOMAIN_INVALID_CHARS");f=u.punycode(f),l.allowFullyQualified&&f[f.length-1]==="."&&(f=f.slice(0,-1));const d=l.minDomainSegments||u.minDomainSegments,m=f.split(".");if(m.lengthl.maxDomainSegments)return c.code("DOMAIN_SEGMENTS_COUNT_MAX");const p=l.tlds;if(p){const h=m[m.length-1].toLowerCase();if(p.deny&&p.deny.has(h)||p.allow&&!p.allow.has(h))return c.code("DOMAIN_FORBIDDEN_TLDS")}for(let h=0;h63)return c.code("DOMAIN_LONG_SEGMENT");if(h{const o=a(9848),c=a(5380),u=a(2178),f={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(o.TextEncoder||TextEncoder)};i.analyze=function(l,d){return f.email(l,d)},i.isValid=function(l,d){return!f.email(l,d)},f.email=function(l,d={}){if(typeof l!="string")throw new Error("Invalid input: email must be a string");if(!l)return u.code("EMPTY_STRING");const m=!f.nonAsciiRx.test(l);if(!m){if(d.allowUnicode===!1)return u.code("FORBIDDEN_UNICODE");l=l.normalize("NFC")}const p=l.split("@");if(p.length!==2)return p.length>2?u.code("MULTIPLE_AT_CHAR"):u.code("MISSING_AT_CHAR");const[h,y]=p;if(!h)return u.code("EMPTY_LOCAL");if(!d.ignoreLength){if(l.length>254)return u.code("ADDRESS_TOO_LONG");if(f.encoder.encode(h).length>64)return u.code("LOCAL_TOO_LONG")}return f.local(h,m)||c.analyze(y,d)},f.local=function(l,d){const m=l.split(".");for(const p of m){if(!p.length)return u.code("EMPTY_LOCAL_SEGMENT");if(d){if(!f.atextRx.test(p))return u.code("INVALID_LOCAL_CHARS")}else for(const h of p){if(f.atextRx.test(h))continue;const y=f.binary(h);if(!f.atomRx.test(y))return u.code("INVALID_LOCAL_CHARS")}}},f.binary=function(l){return Array.from(f.encoder.encode(l)).map(d=>String.fromCharCode(d)).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(a){return{code:a,error:i.codes[a]}}},9959:(s,i,a)=>{const o=a(375),c=a(5752);i.regex=function(u={}){o(u.cidr===void 0||typeof u.cidr=="string","options.cidr must be a string");const f=u.cidr?u.cidr.toLowerCase():"optional";o(["required","optional","forbidden"].includes(f),"options.cidr must be one of required, optional, forbidden"),o(u.version===void 0||typeof u.version=="string"||Array.isArray(u.version),"options.version must be a string or an array of string");let l=u.version||["ipv4","ipv6","ipvfuture"];Array.isArray(l)||(l=[l]),o(l.length>=1,"options.version must have at least 1 version specified");for(let p=0;p{if(f==="forbidden")return c.ip[p];const h=`\\/${p==="ipv4"?c.ip.v4Cidr:c.ip.v6Cidr}`;return f==="required"?`${c.ip[p]}${h}`:`${c.ip[p]}(?:${h})?`}).join("|")})`,m=new RegExp(`^${d}$`);return{cidr:f,versions:l,regex:m,raw:d}}},5752:(s,i,a)=>{const o=a(375),c=a(6064),u={generate:function(){const f={},l="\\dA-Fa-f",d="["+l+"]",m="\\w-\\.~",p="!\\$&'\\(\\)\\*\\+,;=",h="%"+l,y=m+h+p+":@",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 w=d+"{1,4}",x="(?:"+w+":"+w+"|"+f.ipv4address+")",A="(?:"+w+":){6}"+x,T="::(?:"+w+":){5}"+x,R="(?:"+w+")?::(?:"+w+":){4}"+x,E="(?:(?:"+w+":){0,1}"+w+")?::(?:"+w+":){3}"+x,k="(?:(?:"+w+":){0,2}"+w+")?::(?:"+w+":){2}"+x,N="(?:(?:"+w+":){0,3}"+w+")?::"+w+":"+x,O="(?:(?:"+w+":){0,4}"+w+")?::"+x,L="(?:(?:"+w+":){0,5}"+w+")?::"+w,I="(?:(?:"+w+":){0,6}"+w+")?::";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+"|"+T+"|"+R+"|"+E+"|"+k+"|"+N+"|"+O+"|"+L+"|"+I+")",f.ipvFuture="v"+d+"+\\.["+m+p+":]+",f.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",f.schemeRegex=new RegExp(f.scheme);const F="["+m+h+p+":]*",U="["+m+h+p+"]{1,255}",Y="(?:\\[(?:"+f.ipv6address+"|"+f.ipvFuture+")\\]|"+f.ipv4address+"|"+U+")",V="(?:"+F+"@)?"+Y+"(?::\\d*)?",H="(?:"+F+"@)?("+Y+")(?::\\d*)?",ee=g+"*",re=g+"+",X="(?:\\/"+ee+")*",q="\\/(?:"+re+X+")?",K=re+X,Z="["+m+h+p+"@]+"+X,ue="(?:\\/\\/\\/"+ee+X+")";return f.hierPart="(?:(?:\\/\\/"+V+X+")|"+q+"|"+K+"|"+ue+")",f.hierPartCapture="(?:(?:\\/\\/"+H+X+")|"+q+"|"+K+")",f.relativeRef="(?:(?:\\/\\/"+V+X+")|"+q+"|"+Z+"|)",f.relativeRefCapture="(?:(?:\\/\\/"+H+X+")|"+q+"|"+Z+"|)",f.query="["+y+"\\/\\?]*(?=#|$)",f.queryWithSquareBrackets="["+y+"\\[\\]\\/\\?]*(?=#|$)",f.fragment="["+y+"\\/\\?]*",f}};u.rfc3986=u.generate(),i.ip={v4Cidr:u.rfc3986.ipv4Cidr,v6Cidr:u.rfc3986.ipv6Cidr,ipv4:u.rfc3986.ipv4address,ipv6:u.rfc3986.ipv6address,ipvfuture:u.rfc3986.ipvFuture},u.createRegex=function(f){const l=u.rfc3986,d="(?:\\?"+(f.allowQuerySquareBrackets?l.queryWithSquareBrackets:l.query)+")?(?:#"+l.fragment+")?",m=f.domain?l.relativeRefCapture:l.relativeRef;if(f.relativeOnly)return u.wrap(m+d);let p="";if(f.scheme){o(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);o(g.length>=1,"scheme must have at least 1 scheme specified");const v=[];for(let w=0;w{const a={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};i.Parser=class{constructor(o,c={}){if(!c[a.settings]&&c.constants)for(const u in c.constants){const f=c.constants[u];if(f!==null&&!["boolean","number","string"].includes(typeof f))throw new Error(`Formula constant ${u} contains invalid ${typeof f} value type`)}this.settings=c[a.settings]?c:Object.assign({[a.settings]:!0,constants:{},functions:{}},c),this.single=null,this._parts=null,this._parse(o)}_parse(o){let c=[],u="",f=0,l=!1;const d=p=>{if(f)throw new Error("Formula missing closing parenthesis");const h=c.length?c[c.length-1]:null;if(l||u||p){if(h&&h.type==="reference"&&p===")")return h.type="function",h.value=this._subFormula(u,h.value),void(u="");if(p===")"){const y=new i.Parser(u,this.settings);c.push({type:"segment",value:y})}else if(l){if(l==="]")return c.push({type:"reference",value:u}),void(u="");c.push({type:"literal",value:u})}else if(a.operatorCharacters.includes(u))h&&h.type==="operator"&&a.operators.includes(h.value+u)?h.value+=u:c.push({type:"operator",value:u});else if(u.match(a.numberRx))c.push({type:"constant",value:parseFloat(u)});else if(this.settings.constants[u]!==void 0)c.push({type:"constant",value:this.settings.constants[u]});else{if(!u.match(a.tokenRx))throw new Error(`Formula contains invalid token: ${u}`);c.push({type:"reference",value:u})}u=""}};for(const p of o)l?p===l?(d(),l=!1):u+=p:f?p==="("?(u+=p,++f):p===")"?(--f,f?u+=p:d(p)):u+=p:p in a.literals?l=a.literals[p]:p==="("?(d(),++f):a.operatorCharacters.includes(p)?(d(),u=p,d()):p!==" "?u+=p:d();d(),c=c.map((p,h)=>p.type!=="operator"||p.value!=="-"||h&&c[h-1].type!=="operator"?p:{type:"operator",value:"n"});let m=!1;for(const p of c){if(p.type==="operator"){if(a.operatorsPrefix.includes(p.value))continue;if(!m)throw new Error("Formula contains an operator in invalid position");if(!a.operators.includes(p.value))throw new Error(`Formula contains an unknown operator ${p.value}`)}else if(m)throw new Error("Formula missing expected operator");m=!m}if(!m)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(p=>{if(p.type==="operator")return a.operatorsPrefix.includes(p.value)?p:p.value;if(p.type!=="reference")return p.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(p.value))throw new Error(`Formula contains invalid reference ${p.value}`);return this.settings.reference?this.settings.reference(p.value):a.reference(p.value)})}_subFormula(o,c){const u=this.settings.functions[c];if(typeof u!="function")throw new Error(`Formula contains unknown function ${c}`);let f=[];if(o){let l="",d=0,m=!1;const p=()=>{if(!l)throw new Error(`Formula contains function ${c} with invalid arguments ${o}`);f.push(l),l=""};for(let h=0;hnew i.Parser(l,this.settings)),function(l){const d=[];for(const m of f)d.push(m.evaluate(l));return u.call(l,...d)}}evaluate(o){const c=this._parts.slice();for(let u=c.length-2;u>=0;--u){const f=c[u];if(f&&f.type==="operator"){const l=c[u+1];c.splice(u+1,1);const d=a.evaluate(l,o);c[u]=a.single(f.value,d)}}return a.operatorsOrder.forEach(u=>{for(let f=1;f":return c>u;case">=":return c>=u;case"==":return c===u;case"!=":return c!==u;case"&&":return c&&u;case"||":return c||u}return null},a.exists=function(o){return o!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:s=>{s.exports=JSON.parse('{"version":"17.13.3"}')}},r={},function s(i){var a=r[i];if(a!==void 0)return a.exports;var o=r[i]={exports:{}};return n[i](o,o.exports,s),o.exports}(5107);var n,r})})(RZ);var QIe=RZ.exports;const Q4=Yc(QIe),ZIe=()=>{const t=_.useContext(YQ);if(t===void 0)throw new Error("useDataSource must be used within a DataSourceProvider");return t},JIe=()=>{const t=ZIe();return{useSubmitIncidence:e=>{const{mutateOptions:n={}}=e||{};return zde({mutationFn:r=>t.createOne({resource:"support",data:r}),...n})}}},e$e=Q4.object({incidence:Q4.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 t$e(){const[t,e]=_.useState(!1),[n,r]=_.useState(!1),{toast:s}=XX(),{useSubmitIncidence:i}=JIe(),a=MAe({mode:"onBlur",resolver:XIe(e$e),defaultValues:{incidence:""}}),{handleSubmit:o,watch:c,reset:u}=a,f=c("incidence"),{mutate:l}=i({mutateOptions:{onSuccess:()=>{s({title:"Incidencia enviada",description:"La incidencia se ha enviado correctamente",variant:"success"}),e(!1),u()},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"})}}}),d=async h=>{l(h)},m=()=>{f.trim()?r(!0):(e(!1),u())},p=()=>{r(!1),e(!1),u()};return P.jsxs(P.Fragment,{children:[P.jsxs(Dxe,{open:t,onOpenChange:e,children:[P.jsx(Oxe,{asChild:!0,children:P.jsxs(ao,{variant:"outline",size:"icon",className:"overflow-hidden rounded-full bg-primary text-primary-foreground",onClick:()=>e(!0),children:[P.jsx($fe,{className:"w-5 h-5"}),P.jsx("span",{className:"sr-only",children:"Abrir ventana de soporte"})]})}),P.jsxs(W8,{className:"sm:max-w-xl",children:[P.jsxs(G8,{className:"mb-2",children:[P.jsx(K8,{children:sr("support.modal.title")}),P.jsx(Y8,{children:sr("support.modal.subtitle")})]}),P.jsx($Ae,{...a,children:P.jsxs("form",{onSubmit:o(d),className:"space-y-4",children:[P.jsx(VIe,{name:"incidence",placeholder:"Describe la incidencia aquí...",className:"min-h-96"}),P.jsxs(q8,{children:[P.jsx(ao,{type:"button",variant:"outline",onClick:m,children:"Cancelar"}),P.jsx(ao,{type:"submit",children:"Enviar incidencia"})]})]})})]})]}),P.jsx(pW,{open:n,onOpenChange:r,children:P.jsxs(IL,{children:[P.jsxs($L,{children:[P.jsx(jL,{children:"¿Estás seguro de que quieres cancelar?"}),P.jsx(BL,{children:"Has escrito texto en el campo de descripción. Si cierras la ventana, perderás los cambios no guardados."})]}),P.jsxs(FL,{children:[P.jsx(UL,{onClick:()=>r(!1),children:"Volver al formulario"}),P.jsx(zL,{onClick:p,children:"Sí, cerrar"})]})]})})]})}var n$e={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 r$e=Yc(n$e);var s$e=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function Z4(t){var e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=t.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(e.name=n[1],(r$e[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(s$e),i=null;(i=s.exec(t))!==null;)if(i[0].trim())if(i[1]){var a=i[1].trim(),o=[a,""];a.indexOf("=")>-1&&(o=a.split("=")),e.attrs[o[0]]=o[1],s.lastIndex--}else i[2]&&(e.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return e}var i$e=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,o$e=/^\s*$/,a$e=Object.create(null);function PZ(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(PZ,"")+"";case"comment":return t+""}}var l$e={parse:function(t,e){e||(e={}),e.components||(e.components=a$e);var n,r=[],s=[],i=-1,a=!1;if(t.indexOf("<")!==0){var o=t.indexOf("<");r.push({type:"text",content:o===-1?t:t.substring(0,o)})}return t.replace(i$e,function(c,u){if(a){if(c!=="")return;a=!1}var f,l=c.charAt(1)!=="/",d=c.startsWith("");return{type:"comment",comment:r!==-1?t.slice(4,r):""}}for(var s=new RegExp(s$e),i=null;(i=s.exec(t))!==null;)if(i[0].trim())if(i[1]){var a=i[1].trim(),o=[a,""];a.indexOf("=")>-1&&(o=a.split("=")),e.attrs[o[0]]=o[1],s.lastIndex--}else i[2]&&(e.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return e}var i$e=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,o$e=/^\s*$/,a$e=Object.create(null);function PZ(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(PZ,"")+"";case"comment":return t+""}}var l$e={parse:function(t,e){e||(e={}),e.components||(e.components=a$e);var n,r=[],s=[],i=-1,a=!1;if(t.indexOf("<")!==0){var o=t.indexOf("<");r.push({type:"text",content:o===-1?t:t.substring(0,o)})}return t.replace(i$e,function(c,u){if(a){if(c!=="")return;a=!1}var f,l=c.charAt(1)!=="/",d=c.startsWith("