327 lines
1.7 MiB
327 lines
1.7 MiB
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DfxjigQf.js","assets/index-DtTssDoC.css"])))=>i.map(i=>d[i]);
|
||
var Ele=Object.defineProperty;var Pj=t=>{throw TypeError(t)};var Cle=(t,e,n)=>e in t?Ele(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var He=(t,e,n)=>Cle(t,typeof e!="symbol"?e+"":e,n),EP=(t,e,n)=>e.has(t)||Pj("Cannot "+n);var C=(t,e,n)=>(EP(t,e,"read from private field"),n?n.call(t):e.get(t)),z=(t,e,n)=>e.has(t)?Pj("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),$=(t,e,n,r)=>(EP(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),B=(t,e,n)=>(EP(t,e,"access private method"),n);var bs=(t,e,n,r)=>({set _(s){$(t,e,s,n)},get _(){return C(t,e,r)}});function mH(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in t)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>r[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 yr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Od(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ale(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 gH={exports:{}},yC={},vH={exports:{}},Lt={};/**
|
||
* @license React
|
||
* react.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var Y0=Symbol.for("react.element"),Rle=Symbol.for("react.portal"),Ple=Symbol.for("react.fragment"),Tle=Symbol.for("react.strict_mode"),kle=Symbol.for("react.profiler"),Dle=Symbol.for("react.provider"),Nle=Symbol.for("react.context"),Mle=Symbol.for("react.forward_ref"),Ole=Symbol.for("react.suspense"),Lle=Symbol.for("react.memo"),Ile=Symbol.for("react.lazy"),Tj=Symbol.iterator;function $le(t){return t===null||typeof t!="object"?null:(t=Tj&&t[Tj]||t["@@iterator"],typeof t=="function"?t:null)}var yH={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},bH=Object.assign,wH={};function yv(t,e,n){this.props=t,this.context=e,this.refs=wH,this.updater=n||yH}yv.prototype.isReactComponent={};yv.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};yv.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function _H(){}_H.prototype=yv.prototype;function lO(t,e,n){this.props=t,this.context=e,this.refs=wH,this.updater=n||yH}var cO=lO.prototype=new _H;cO.constructor=lO;bH(cO,yv.prototype);cO.isPureReactComponent=!0;var kj=Array.isArray,xH=Object.prototype.hasOwnProperty,uO={current:null},SH={key:!0,ref:!0,__self:!0,__source:!0};function EH(t,e,n){var r,s={},i=null,a=null;if(e!=null)for(r in e.ref!==void 0&&(a=e.ref),e.key!==void 0&&(i=""+e.key),e)xH.call(e,r)&&!SH.hasOwnProperty(r)&&(s[r]=e[r]);var o=arguments.length-2;if(o===1)s.children=n;else if(1<o){for(var c=Array(o),u=0;u<o;u++)c[u]=arguments[u+2];s.children=c}if(t&&t.defaultProps)for(r in o=t.defaultProps,o)s[r]===void 0&&(s[r]=o[r]);return{$$typeof:Y0,type:t,key:i,ref:a,props:s,_owner:uO.current}}function Fle(t,e){return{$$typeof:Y0,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function dO(t){return typeof t=="object"&&t!==null&&t.$$typeof===Y0}function jle(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var Dj=/\/+/g;function CP(t,e){return typeof t=="object"&&t!==null&&t.key!=null?jle(""+t.key):e.toString(36)}function TS(t,e,n,r,s){var i=typeof t;(i==="undefined"||i==="boolean")&&(t=null);var a=!1;if(t===null)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case Y0:case Rle:a=!0}}if(a)return a=t,s=s(a),t=r===""?"."+CP(a,0):r,kj(s)?(n="",t!=null&&(n=t.replace(Dj,"$&/")+"/"),TS(s,e,n,"",function(u){return u})):s!=null&&(dO(s)&&(s=Fle(s,n+(!s.key||a&&a.key===s.key?"":(""+s.key).replace(Dj,"$&/")+"/")+t)),e.push(s)),1;if(a=0,r=r===""?".":r+":",kj(t))for(var o=0;o<t.length;o++){i=t[o];var c=r+CP(i,o);a+=TS(i,e,n,c,s)}else if(c=$le(t),typeof c=="function")for(t=c.call(t),o=0;!(i=t.next()).done;)i=i.value,c=r+CP(i,o++),a+=TS(i,e,n,c,s);else if(i==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return a}function Mx(t,e,n){if(t==null)return t;var r=[],s=0;return TS(t,r,"","",function(i){return e.call(n,i,s++)}),r}function zle(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var Zs={current:null},kS={transition:null},Ble={ReactCurrentDispatcher:Zs,ReactCurrentBatchConfig:kS,ReactCurrentOwner:uO};function CH(){throw Error("act(...) is not supported in production builds of React.")}Lt.Children={map:Mx,forEach:function(t,e,n){Mx(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return Mx(t,function(){e++}),e},toArray:function(t){return Mx(t,function(e){return e})||[]},only:function(t){if(!dO(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Lt.Component=yv;Lt.Fragment=Ple;Lt.Profiler=kle;Lt.PureComponent=lO;Lt.StrictMode=Tle;Lt.Suspense=Ole;Lt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ble;Lt.act=CH;Lt.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=bH({},t.props),s=t.key,i=t.ref,a=t._owner;if(e!=null){if(e.ref!==void 0&&(i=e.ref,a=uO.current),e.key!==void 0&&(s=""+e.key),t.type&&t.type.defaultProps)var o=t.type.defaultProps;for(c in e)xH.call(e,c)&&!SH.hasOwnProperty(c)&&(r[c]=e[c]===void 0&&o!==void 0?o[c]:e[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){o=Array(c);for(var u=0;u<c;u++)o[u]=arguments[u+2];r.children=o}return{$$typeof:Y0,type:t.type,key:s,ref:i,props:r,_owner:a}};Lt.createContext=function(t){return t={$$typeof:Nle,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:Dle,_context:t},t.Consumer=t};Lt.createElement=EH;Lt.createFactory=function(t){var e=EH.bind(null,t);return e.type=t,e};Lt.createRef=function(){return{current:null}};Lt.forwardRef=function(t){return{$$typeof:Mle,render:t}};Lt.isValidElement=dO;Lt.lazy=function(t){return{$$typeof:Ile,_payload:{_status:-1,_result:t},_init:zle}};Lt.memo=function(t,e){return{$$typeof:Lle,type:t,compare:e===void 0?null:e}};Lt.startTransition=function(t){var e=kS.transition;kS.transition={};try{t()}finally{kS.transition=e}};Lt.unstable_act=CH;Lt.useCallback=function(t,e){return Zs.current.useCallback(t,e)};Lt.useContext=function(t){return Zs.current.useContext(t)};Lt.useDebugValue=function(){};Lt.useDeferredValue=function(t){return Zs.current.useDeferredValue(t)};Lt.useEffect=function(t,e){return Zs.current.useEffect(t,e)};Lt.useId=function(){return Zs.current.useId()};Lt.useImperativeHandle=function(t,e,n){return Zs.current.useImperativeHandle(t,e,n)};Lt.useInsertionEffect=function(t,e){return Zs.current.useInsertionEffect(t,e)};Lt.useLayoutEffect=function(t,e){return Zs.current.useLayoutEffect(t,e)};Lt.useMemo=function(t,e){return Zs.current.useMemo(t,e)};Lt.useReducer=function(t,e,n){return Zs.current.useReducer(t,e,n)};Lt.useRef=function(t){return Zs.current.useRef(t)};Lt.useState=function(t){return Zs.current.useState(t)};Lt.useSyncExternalStore=function(t,e,n){return Zs.current.useSyncExternalStore(t,e,n)};Lt.useTransition=function(){return Zs.current.useTransition()};Lt.version="18.3.1";vH.exports=Lt;var _=vH.exports;const se=Od(_),X0=mH({__proto__:null,default:se},[_]);/**
|
||
* @license React
|
||
* react-jsx-runtime.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var Ule=_,Hle=Symbol.for("react.element"),Wle=Symbol.for("react.fragment"),Vle=Object.prototype.hasOwnProperty,qle=Ule.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Gle={key:!0,ref:!0,__self:!0,__source:!0};function AH(t,e,n){var r,s={},i=null,a=null;n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(a=e.ref);for(r in e)Vle.call(e,r)&&!Gle.hasOwnProperty(r)&&(s[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)s[r]===void 0&&(s[r]=e[r]);return{$$typeof:Hle,type:t,key:i,ref:a,props:s,_owner:qle.current}}yC.Fragment=Wle;yC.jsx=AH;yC.jsxs=AH;gH.exports=yC;var P=gH.exports,Ek={},RH={exports:{}},co={},PH={exports:{}},TH={};/**
|
||
* @license React
|
||
* scheduler.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/(function(t){function e(H,ee){var re=H.length;H.push(ee);e:for(;0<re;){var X=re-1>>>1,G=H[X];if(0<s(G,ee))H[X]=ee,H[re]=G,re=X;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var ee=H[0],re=H.pop();if(re!==ee){H[0]=re;e:for(var X=0,G=H.length,K=G>>>1;X<K;){var J=2*(X+1)-1,ue=H[J],de=J+1,ie=H[de];if(0>s(ue,re))de<G&&0>s(ie,ue)?(H[X]=ie,H[de]=re,X=de):(H[X]=ue,H[J]=re,X=J);else if(de<G&&0>s(ie,re))H[X]=ie,H[de]=re,X=de;else break e}}return ee}function s(H,ee){var re=H.sortIndex-ee.sortIndex;return re!==0?re:H.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();t.unstable_now=function(){return a.now()-o}}var c=[],u=[],f=1,l=null,d=3,m=!1,p=!1,h=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(H){for(var ee=n(u);ee!==null;){if(ee.callback===null)r(u);else if(ee.startTime<=H)r(u),ee.sortIndex=ee.expirationTime,e(c,ee);else break;ee=n(u)}}function x(H){if(h=!1,w(H),!p)if(n(c)!==null)p=!0,Y(A);else{var ee=n(u);ee!==null&&W(x,ee.startTime-H)}}function A(H,ee){p=!1,h&&(h=!1,g(E),E=-1),m=!0;var re=d;try{for(w(ee),l=n(c);l!==null&&(!(l.expirationTime>ee)||H&&!M());){var X=l.callback;if(typeof X=="function"){l.callback=null,d=l.priorityLevel;var G=X(l.expirationTime<=ee);ee=t.unstable_now(),typeof G=="function"?l.callback=G:l===n(c)&&r(c),w(ee)}else r(c);l=n(c)}if(l!==null)var K=!0;else{var J=n(u);J!==null&&W(x,J.startTime-ee),K=!1}return K}finally{l=null,d=re,m=!1}}var k=!1,R=null,E=-1,T=5,D=-1;function M(){return!(t.unstable_now()-D<T)}function L(){if(R!==null){var H=t.unstable_now();D=H;var ee=!0;try{ee=R(!0,H)}finally{ee?I():(k=!1,R=null)}}else k=!1}var I;if(typeof v=="function")I=function(){v(L)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,U=F.port2;F.port1.onmessage=L,I=function(){U.postMessage(null)}}else I=function(){y(L,0)};function Y(H){R=H,k||(k=!0,I())}function W(H,ee){E=y(function(){H(t.unstable_now())},ee)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(H){H.callback=null},t.unstable_continueExecution=function(){p||m||(p=!0,Y(A))},t.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<H?Math.floor(1e3/H):5},t.unstable_getCurrentPriorityLevel=function(){return d},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function(H){switch(d){case 1:case 2:case 3:var ee=3;break;default:ee=d}var re=d;d=ee;try{return H()}finally{d=re}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(H,ee){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var re=d;d=H;try{return ee()}finally{d=re}},t.unstable_scheduleCallback=function(H,ee,re){var X=t.unstable_now();switch(typeof re=="object"&&re!==null?(re=re.delay,re=typeof re=="number"&&0<re?X+re:X):re=X,H){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=re+G,H={id:f++,callback:ee,priorityLevel:H,startTime:re,expirationTime:G,sortIndex:-1},re>X?(H.sortIndex=re,e(u,H),n(c)===null&&H===n(u)&&(h?(g(E),E=-1):h=!0,W(x,re-X))):(H.sortIndex=G,e(c,H),p||m||(p=!0,Y(A))),H},t.unstable_shouldYield=M,t.unstable_wrapCallback=function(H){var ee=d;return function(){var re=d;d=ee;try{return H.apply(this,arguments)}finally{d=re}}}})(TH);PH.exports=TH;var Kle=PH.exports;/**
|
||
* @license React
|
||
* react-dom.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var Yle=_,ao=Kle;function ke(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var kH=new Set,Ab={};function dp(t,e){tv(t,e),tv(t+"Capture",e)}function tv(t,e){for(Ab[t]=e,t=0;t<e.length;t++)kH.add(e[t])}var Bc=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ck=Object.prototype.hasOwnProperty,Xle=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Nj={},Mj={};function Qle(t){return Ck.call(Mj,t)?!0:Ck.call(Nj,t)?!1:Xle.test(t)?Mj[t]=!0:(Nj[t]=!0,!1)}function Jle(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function Zle(t,e,n,r){if(e===null||typeof e>"u"||Jle(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function ei(t,e,n,r,s,i,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=a}var hs={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){hs[t]=new ei(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];hs[e]=new ei(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){hs[t]=new ei(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){hs[t]=new ei(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){hs[t]=new ei(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){hs[t]=new ei(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){hs[t]=new ei(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){hs[t]=new ei(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){hs[t]=new ei(t,5,!1,t.toLowerCase(),null,!1,!1)});var fO=/[\-:]([a-z])/g;function hO(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(fO,hO);hs[e]=new ei(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(fO,hO);hs[e]=new ei(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(fO,hO);hs[e]=new ei(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){hs[t]=new ei(t,1,!1,t.toLowerCase(),null,!1,!1)});hs.xlinkHref=new ei("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){hs[t]=new ei(t,1,!1,t.toLowerCase(),null,!0,!0)});function pO(t,e,n,r){var s=hs.hasOwnProperty(e)?hs[e]:null;(s!==null?s.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(Zle(e,n,s,r)&&(n=null),r||s===null?Qle(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):s.mustUseProperty?t[s.propertyName]=n===null?s.type===3?!1:"":n:(e=s.attributeName,r=s.attributeNamespace,n===null?t.removeAttribute(e):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var Yc=Yle.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ox=Symbol.for("react.element"),dm=Symbol.for("react.portal"),fm=Symbol.for("react.fragment"),mO=Symbol.for("react.strict_mode"),Ak=Symbol.for("react.profiler"),DH=Symbol.for("react.provider"),NH=Symbol.for("react.context"),gO=Symbol.for("react.forward_ref"),Rk=Symbol.for("react.suspense"),Pk=Symbol.for("react.suspense_list"),vO=Symbol.for("react.memo"),Au=Symbol.for("react.lazy"),MH=Symbol.for("react.offscreen"),Oj=Symbol.iterator;function ay(t){return t===null||typeof t!="object"?null:(t=Oj&&t[Oj]||t["@@iterator"],typeof t=="function"?t:null)}var rr=Object.assign,AP;function My(t){if(AP===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);AP=e&&e[1]||""}return`
|
||
`+AP+t}var RP=!1;function PP(t,e){if(!t||RP)return"";RP=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(u){var r=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){r=u}t.call(e.prototype)}else{try{throw Error()}catch(u){r=u}t()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var s=u.stack.split(`
|
||
`),i=r.stack.split(`
|
||
`),a=s.length-1,o=i.length-1;1<=a&&0<=o&&s[a]!==i[o];)o--;for(;1<=a&&0<=o;a--,o--)if(s[a]!==i[o]){if(a!==1||o!==1)do if(a--,o--,0>o||s[a]!==i[o]){var c=`
|
||
`+s[a].replace(" at new "," at ");return t.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",t.displayName)),c}while(1<=a&&0<=o);break}}}finally{RP=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?My(t):""}function ece(t){switch(t.tag){case 5:return My(t.type);case 16:return My("Lazy");case 13:return My("Suspense");case 19:return My("SuspenseList");case 0:case 2:case 15:return t=PP(t.type,!1),t;case 11:return t=PP(t.type.render,!1),t;case 1:return t=PP(t.type,!0),t;default:return""}}function Tk(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 fm:return"Fragment";case dm:return"Portal";case Ak:return"Profiler";case mO:return"StrictMode";case Rk:return"Suspense";case Pk:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case NH:return(t.displayName||"Context")+".Consumer";case DH:return(t._context.displayName||"Context")+".Provider";case gO:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case vO:return e=t.displayName||null,e!==null?e:Tk(t.type)||"Memo";case Au:e=t._payload,t=t._init;try{return Tk(t(e))}catch{}}return null}function tce(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 Tk(e);case 8:return e===mO?"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 Ed(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function OH(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function nce(t){var e=OH(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 Lx(t){t._valueTracker||(t._valueTracker=nce(t))}function LH(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=OH(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function RE(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 kk(t,e){var n=e.checked;return rr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function Lj(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Ed(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 IH(t,e){e=e.checked,e!=null&&pO(t,"checked",e,!1)}function Dk(t,e){IH(t,e);var n=Ed(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")?Nk(t,e.type,n):e.hasOwnProperty("defaultValue")&&Nk(t,e.type,Ed(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Ij(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 Nk(t,e,n){(e!=="number"||RE(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Oy=Array.isArray;function Rm(t,e,n,r){if(t=t.options,e){e={};for(var s=0;s<n.length;s++)e["$"+n[s]]=!0;for(n=0;n<t.length;n++)s=e.hasOwnProperty("$"+t[n].value),t[n].selected!==s&&(t[n].selected=s),s&&r&&(t[n].defaultSelected=!0)}else{for(n=""+Ed(n),e=null,s=0;s<t.length;s++){if(t[s].value===n){t[s].selected=!0,r&&(t[s].defaultSelected=!0);return}e!==null||t[s].disabled||(e=t[s])}e!==null&&(e.selected=!0)}}function Mk(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(ke(91));return rr({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function $j(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(ke(92));if(Oy(n)){if(1<n.length)throw Error(ke(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:Ed(n)}}function $H(t,e){var n=Ed(e.value),r=Ed(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function Fj(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function FH(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ok(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?FH(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Ix,jH=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,s){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,s)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(Ix=Ix||document.createElement("div"),Ix.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Ix.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Rb(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var ob={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},rce=["Webkit","ms","Moz","O"];Object.keys(ob).forEach(function(t){rce.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),ob[e]=ob[t]})});function zH(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||ob.hasOwnProperty(t)&&ob[t]?(""+e).trim():e+"px"}function BH(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=zH(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,s):t[n]=s}}var sce=rr({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 Lk(t,e){if(e){if(sce[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 Ik(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 $k=null;function yO(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Fk=null,Pm=null,Tm=null;function jj(t){if(t=Z0(t)){if(typeof Fk!="function")throw Error(ke(280));var e=t.stateNode;e&&(e=SC(e),Fk(t.stateNode,t.type,e))}}function UH(t){Pm?Tm?Tm.push(t):Tm=[t]:Pm=t}function HH(){if(Pm){var t=Pm,e=Tm;if(Tm=Pm=null,jj(t),e)for(t=0;t<e.length;t++)jj(e[t])}}function WH(t,e){return t(e)}function VH(){}var TP=!1;function qH(t,e,n){if(TP)return t(e,n);TP=!0;try{return WH(t,e,n)}finally{TP=!1,(Pm!==null||Tm!==null)&&(VH(),HH())}}function Pb(t,e){var n=t.stateNode;if(n===null)return null;var r=SC(n);if(r===null)return null;n=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(ke(231,e,typeof n));return n}var jk=!1;if(Bc)try{var ly={};Object.defineProperty(ly,"passive",{get:function(){jk=!0}}),window.addEventListener("test",ly,ly),window.removeEventListener("test",ly,ly)}catch{jk=!1}function ice(t,e,n,r,s,i,a,o,c){var u=Array.prototype.slice.call(arguments,3);try{e.apply(n,u)}catch(f){this.onError(f)}}var ab=!1,PE=null,TE=!1,zk=null,oce={onError:function(t){ab=!0,PE=t}};function ace(t,e,n,r,s,i,a,o,c){ab=!1,PE=null,ice.apply(oce,arguments)}function lce(t,e,n,r,s,i,a,o,c){if(ace.apply(this,arguments),ab){if(ab){var u=PE;ab=!1,PE=null}else throw Error(ke(198));TE||(TE=!0,zk=u)}}function fp(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function GH(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function zj(t){if(fp(t)!==t)throw Error(ke(188))}function cce(t){var e=t.alternate;if(!e){if(e=fp(t),e===null)throw Error(ke(188));return e!==t?null:t}for(var n=t,r=e;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return zj(s),t;if(i===r)return zj(s),e;i=i.sibling}throw Error(ke(188))}if(n.return!==r.return)n=s,r=i;else{for(var a=!1,o=s.child;o;){if(o===n){a=!0,n=s,r=i;break}if(o===r){a=!0,r=s,n=i;break}o=o.sibling}if(!a){for(o=i.child;o;){if(o===n){a=!0,n=i,r=s;break}if(o===r){a=!0,r=i,n=s;break}o=o.sibling}if(!a)throw Error(ke(189))}}if(n.alternate!==r)throw Error(ke(190))}if(n.tag!==3)throw Error(ke(188));return n.stateNode.current===n?t:e}function KH(t){return t=cce(t),t!==null?YH(t):null}function YH(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=YH(t);if(e!==null)return e;t=t.sibling}return null}var XH=ao.unstable_scheduleCallback,Bj=ao.unstable_cancelCallback,uce=ao.unstable_shouldYield,dce=ao.unstable_requestPaint,vr=ao.unstable_now,fce=ao.unstable_getCurrentPriorityLevel,bO=ao.unstable_ImmediatePriority,QH=ao.unstable_UserBlockingPriority,kE=ao.unstable_NormalPriority,hce=ao.unstable_LowPriority,JH=ao.unstable_IdlePriority,bC=null,vl=null;function pce(t){if(vl&&typeof vl.onCommitFiberRoot=="function")try{vl.onCommitFiberRoot(bC,t,void 0,(t.current.flags&128)===128)}catch{}}var xa=Math.clz32?Math.clz32:vce,mce=Math.log,gce=Math.LN2;function vce(t){return t>>>=0,t===0?32:31-(mce(t)/gce|0)|0}var $x=64,Fx=4194304;function Ly(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 DE(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=Ly(o):(i&=a,i!==0&&(r=Ly(i)))}else a=n&~s,a!==0?r=Ly(a):i!==0&&(r=Ly(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;0<e;)n=31-xa(e),s=1<<n,r|=t[n],e&=~s;return r}function yce(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function bce(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,s=t.expirationTimes,i=t.pendingLanes;0<i;){var a=31-xa(i),o=1<<a,c=s[a];c===-1?(!(o&n)||o&r)&&(s[a]=yce(o,e)):c<=e&&(t.expiredLanes|=o),i&=~o}}function Bk(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function ZH(){var t=$x;return $x<<=1,!($x&4194240)&&($x=64),t}function kP(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Q0(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 wce(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var s=31-xa(n),i=1<<s;e[s]=0,r[s]=-1,t[s]=-1,n&=~i}}function wO(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-xa(n),s=1<<r;s&e|t[r]&e&&(t[r]|=e),n&=~s}}var mn=0;function e5(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var t5,_O,n5,r5,s5,Uk=!1,jx=[],pd=null,md=null,gd=null,Tb=new Map,kb=new Map,ku=[],_ce="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Uj(t,e){switch(t){case"focusin":case"focusout":pd=null;break;case"dragenter":case"dragleave":md=null;break;case"mouseover":case"mouseout":gd=null;break;case"pointerover":case"pointerout":Tb.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":kb.delete(e.pointerId)}}function cy(t,e,n,r,s,i){return t===null||t.nativeEvent!==i?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},e!==null&&(e=Z0(e),e!==null&&_O(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,s!==null&&e.indexOf(s)===-1&&e.push(s),t)}function xce(t,e,n,r,s){switch(e){case"focusin":return pd=cy(pd,t,e,n,r,s),!0;case"dragenter":return md=cy(md,t,e,n,r,s),!0;case"mouseover":return gd=cy(gd,t,e,n,r,s),!0;case"pointerover":var i=s.pointerId;return Tb.set(i,cy(Tb.get(i)||null,t,e,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,kb.set(i,cy(kb.get(i)||null,t,e,n,r,s)),!0}return!1}function i5(t){var e=xf(t.target);if(e!==null){var n=fp(e);if(n!==null){if(e=n.tag,e===13){if(e=GH(n),e!==null){t.blockedOn=e,s5(t.priority,function(){n5(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function DS(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Hk(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);$k=r,n.target.dispatchEvent(r),$k=null}else return e=Z0(n),e!==null&&_O(e),t.blockedOn=n,!1;e.shift()}return!0}function Hj(t,e,n){DS(t)&&n.delete(e)}function Sce(){Uk=!1,pd!==null&&DS(pd)&&(pd=null),md!==null&&DS(md)&&(md=null),gd!==null&&DS(gd)&&(gd=null),Tb.forEach(Hj),kb.forEach(Hj)}function uy(t,e){t.blockedOn===e&&(t.blockedOn=null,Uk||(Uk=!0,ao.unstable_scheduleCallback(ao.unstable_NormalPriority,Sce)))}function Db(t){function e(s){return uy(s,t)}if(0<jx.length){uy(jx[0],t);for(var n=1;n<jx.length;n++){var r=jx[n];r.blockedOn===t&&(r.blockedOn=null)}}for(pd!==null&&uy(pd,t),md!==null&&uy(md,t),gd!==null&&uy(gd,t),Tb.forEach(e),kb.forEach(e),n=0;n<ku.length;n++)r=ku[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<ku.length&&(n=ku[0],n.blockedOn===null);)i5(n),n.blockedOn===null&&ku.shift()}var km=Yc.ReactCurrentBatchConfig,NE=!0;function Ece(t,e,n,r){var s=mn,i=km.transition;km.transition=null;try{mn=1,xO(t,e,n,r)}finally{mn=s,km.transition=i}}function Cce(t,e,n,r){var s=mn,i=km.transition;km.transition=null;try{mn=4,xO(t,e,n,r)}finally{mn=s,km.transition=i}}function xO(t,e,n,r){if(NE){var s=Hk(t,e,n,r);if(s===null)zP(t,e,r,ME,n),Uj(t,r);else if(xce(s,t,e,n,r))r.stopPropagation();else if(Uj(t,r),e&4&&-1<_ce.indexOf(t)){for(;s!==null;){var i=Z0(s);if(i!==null&&t5(i),i=Hk(t,e,n,r),i===null&&zP(t,e,r,ME,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else zP(t,e,r,null,n)}}var ME=null;function Hk(t,e,n,r){if(ME=null,t=yO(r),t=xf(t),t!==null)if(e=fp(t),e===null)t=null;else if(n=e.tag,n===13){if(t=GH(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return ME=t,null}function o5(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(fce()){case bO:return 1;case QH:return 4;case kE:case hce:return 16;case JH:return 536870912;default:return 16}default:return 16}}var dd=null,SO=null,NS=null;function a5(){if(NS)return NS;var t,e=SO,n=e.length,r,s="value"in dd?dd.value:dd.textContent,i=s.length;for(t=0;t<n&&e[t]===s[t];t++);var a=n-t;for(r=1;r<=a&&e[n-r]===s[i-r];r++);return NS=s.slice(t,1<r?1-r:void 0)}function MS(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function zx(){return!0}function Wj(){return!1}function uo(t){function e(n,r,s,i,a){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=a,this.currentTarget=null;for(var o in t)t.hasOwnProperty(o)&&(n=t[o],this[o]=n?n(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?zx:Wj,this.isPropagationStopped=Wj,this}return rr(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=zx)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=zx)},persist:function(){},isPersistent:zx}),e}var bv={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},EO=uo(bv),J0=rr({},bv,{view:0,detail:0}),Ace=uo(J0),DP,NP,dy,wC=rr({},J0,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:CO,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==dy&&(dy&&t.type==="mousemove"?(DP=t.screenX-dy.screenX,NP=t.screenY-dy.screenY):NP=DP=0,dy=t),DP)},movementY:function(t){return"movementY"in t?t.movementY:NP}}),Vj=uo(wC),Rce=rr({},wC,{dataTransfer:0}),Pce=uo(Rce),Tce=rr({},J0,{relatedTarget:0}),MP=uo(Tce),kce=rr({},bv,{animationName:0,elapsedTime:0,pseudoElement:0}),Dce=uo(kce),Nce=rr({},bv,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Mce=uo(Nce),Oce=rr({},bv,{data:0}),qj=uo(Oce),Lce={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ice={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},$ce={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Fce(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=$ce[t])?!!e[t]:!1}function CO(){return Fce}var jce=rr({},J0,{key:function(t){if(t.key){var e=Lce[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=MS(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Ice[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:CO,charCode:function(t){return t.type==="keypress"?MS(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?MS(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),zce=uo(jce),Bce=rr({},wC,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Gj=uo(Bce),Uce=rr({},J0,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:CO}),Hce=uo(Uce),Wce=rr({},bv,{propertyName:0,elapsedTime:0,pseudoElement:0}),Vce=uo(Wce),qce=rr({},wC,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Gce=uo(qce),Kce=[9,13,27,32],AO=Bc&&"CompositionEvent"in window,lb=null;Bc&&"documentMode"in document&&(lb=document.documentMode);var Yce=Bc&&"TextEvent"in window&&!lb,l5=Bc&&(!AO||lb&&8<lb&&11>=lb),Kj=" ",Yj=!1;function c5(t,e){switch(t){case"keyup":return Kce.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function u5(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var hm=!1;function Xce(t,e){switch(t){case"compositionend":return u5(e);case"keypress":return e.which!==32?null:(Yj=!0,Kj);case"textInput":return t=e.data,t===Kj&&Yj?null:t;default:return null}}function Qce(t,e){if(hm)return t==="compositionend"||!AO&&c5(t,e)?(t=a5(),NS=SO=dd=null,hm=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return l5&&e.locale!=="ko"?null:e.data;default:return null}}var Jce={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Xj(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!Jce[t.type]:e==="textarea"}function d5(t,e,n,r){UH(r),e=OE(e,"onChange"),0<e.length&&(n=new EO("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var cb=null,Nb=null;function Zce(t){x5(t,0)}function _C(t){var e=gm(t);if(LH(e))return t}function eue(t,e){if(t==="change")return e}var f5=!1;if(Bc){var OP;if(Bc){var LP="oninput"in document;if(!LP){var Qj=document.createElement("div");Qj.setAttribute("oninput","return;"),LP=typeof Qj.oninput=="function"}OP=LP}else OP=!1;f5=OP&&(!document.documentMode||9<document.documentMode)}function Jj(){cb&&(cb.detachEvent("onpropertychange",h5),Nb=cb=null)}function h5(t){if(t.propertyName==="value"&&_C(Nb)){var e=[];d5(e,Nb,t,yO(t)),qH(Zce,e)}}function tue(t,e,n){t==="focusin"?(Jj(),cb=e,Nb=n,cb.attachEvent("onpropertychange",h5)):t==="focusout"&&Jj()}function nue(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return _C(Nb)}function rue(t,e){if(t==="click")return _C(e)}function sue(t,e){if(t==="input"||t==="change")return _C(e)}function iue(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Aa=typeof Object.is=="function"?Object.is:iue;function Mb(t,e){if(Aa(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!Ck.call(e,s)||!Aa(t[s],e[s]))return!1}return!0}function Zj(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function e3(t,e){var n=Zj(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Zj(n)}}function p5(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?p5(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function m5(){for(var t=window,e=RE();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=RE(t.document)}return e}function RO(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 oue(t){var e=m5(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&p5(n.ownerDocument.documentElement,n)){if(r!==null&&RO(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=e3(n,i);var a=e3(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<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var aue=Bc&&"documentMode"in document&&11>=document.documentMode,pm=null,Wk=null,ub=null,Vk=!1;function t3(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Vk||pm==null||pm!==RE(r)||(r=pm,"selectionStart"in r&&RO(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}),ub&&Mb(ub,r)||(ub=r,r=OE(Wk,"onSelect"),0<r.length&&(e=new EO("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=pm)))}function Bx(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var mm={animationend:Bx("Animation","AnimationEnd"),animationiteration:Bx("Animation","AnimationIteration"),animationstart:Bx("Animation","AnimationStart"),transitionend:Bx("Transition","TransitionEnd")},IP={},g5={};Bc&&(g5=document.createElement("div").style,"AnimationEvent"in window||(delete mm.animationend.animation,delete mm.animationiteration.animation,delete mm.animationstart.animation),"TransitionEvent"in window||delete mm.transitionend.transition);function xC(t){if(IP[t])return IP[t];if(!mm[t])return t;var e=mm[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in g5)return IP[t]=e[n];return t}var v5=xC("animationend"),y5=xC("animationiteration"),b5=xC("animationstart"),w5=xC("transitionend"),_5=new Map,n3="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ld(t,e){_5.set(t,e),dp(e,[t])}for(var $P=0;$P<n3.length;$P++){var FP=n3[$P],lue=FP.toLowerCase(),cue=FP[0].toUpperCase()+FP.slice(1);Ld(lue,"on"+cue)}Ld(v5,"onAnimationEnd");Ld(y5,"onAnimationIteration");Ld(b5,"onAnimationStart");Ld("dblclick","onDoubleClick");Ld("focusin","onFocus");Ld("focusout","onBlur");Ld(w5,"onTransitionEnd");tv("onMouseEnter",["mouseout","mouseover"]);tv("onMouseLeave",["mouseout","mouseover"]);tv("onPointerEnter",["pointerout","pointerover"]);tv("onPointerLeave",["pointerout","pointerover"]);dp("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));dp("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));dp("onBeforeInput",["compositionend","keypress","textInput","paste"]);dp("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));dp("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));dp("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Iy="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),uue=new Set("cancel close invalid load scroll toggle".split(" ").concat(Iy));function r3(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,lce(r,e,void 0,t),t.currentTarget=null}function x5(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],s=r.event;r=r.listeners;e:{var i=void 0;if(e)for(var a=r.length-1;0<=a;a--){var o=r[a],c=o.instance,u=o.currentTarget;if(o=o.listener,c!==i&&s.isPropagationStopped())break e;r3(s,o,u),i=c}else for(a=0;a<r.length;a++){if(o=r[a],c=o.instance,u=o.currentTarget,o=o.listener,c!==i&&s.isPropagationStopped())break e;r3(s,o,u),i=c}}}if(TE)throw t=zk,TE=!1,zk=null,t}function zn(t,e){var n=e[Xk];n===void 0&&(n=e[Xk]=new Set);var r=t+"__bubble";n.has(r)||(S5(e,t,2,!1),n.add(r))}function jP(t,e,n){var r=0;e&&(r|=4),S5(n,t,r,e)}var Ux="_reactListening"+Math.random().toString(36).slice(2);function Ob(t){if(!t[Ux]){t[Ux]=!0,kH.forEach(function(n){n!=="selectionchange"&&(uue.has(n)||jP(n,!1,t),jP(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Ux]||(e[Ux]=!0,jP("selectionchange",!1,e))}}function S5(t,e,n,r){switch(o5(e)){case 1:var s=Ece;break;case 4:s=Cce;break;default:s=xO}n=s.bind(null,e,n,t),s=void 0,!jk||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(s=!0),r?s!==void 0?t.addEventListener(e,n,{capture:!0,passive:s}):t.addEventListener(e,n,!0):s!==void 0?t.addEventListener(e,n,{passive:s}):t.addEventListener(e,n,!1)}function zP(t,e,n,r,s){var i=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var o=r.stateNode.containerInfo;if(o===s||o.nodeType===8&&o.parentNode===s)break;if(a===4)for(a=r.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;a=a.return}for(;o!==null;){if(a=xf(o),a===null)return;if(c=a.tag,c===5||c===6){r=i=a;continue e}o=o.parentNode}}r=r.return}qH(function(){var u=i,f=yO(n),l=[];e:{var d=_5.get(t);if(d!==void 0){var m=EO,p=t;switch(t){case"keypress":if(MS(n)===0)break e;case"keydown":case"keyup":m=zce;break;case"focusin":p="focus",m=MP;break;case"focusout":p="blur",m=MP;break;case"beforeblur":case"afterblur":m=MP;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=Vj;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=Pce;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=Hce;break;case v5:case y5:case b5:m=Dce;break;case w5:m=Vce;break;case"scroll":m=Ace;break;case"wheel":m=Gce;break;case"copy":case"cut":case"paste":m=Mce;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=Gj}var h=(e&4)!==0,y=!h&&t==="scroll",g=h?d!==null?d+"Capture":null:d;h=[];for(var v=u,w;v!==null;){w=v;var x=w.stateNode;if(w.tag===5&&x!==null&&(w=x,g!==null&&(x=Pb(v,g),x!=null&&h.push(Lb(v,x,w)))),y)break;v=v.return}0<h.length&&(d=new m(d,p,null,n,f),l.push({event:d,listeners:h}))}}if(!(e&7)){e:{if(d=t==="mouseover"||t==="pointerover",m=t==="mouseout"||t==="pointerout",d&&n!==$k&&(p=n.relatedTarget||n.fromElement)&&(xf(p)||p[Uc]))break e;if((m||d)&&(d=f.window===f?f:(d=f.ownerDocument)?d.defaultView||d.parentWindow:window,m?(p=n.relatedTarget||n.toElement,m=u,p=p?xf(p):null,p!==null&&(y=fp(p),p!==y||p.tag!==5&&p.tag!==6)&&(p=null)):(m=null,p=u),m!==p)){if(h=Vj,x="onMouseLeave",g="onMouseEnter",v="mouse",(t==="pointerout"||t==="pointerover")&&(h=Gj,x="onPointerLeave",g="onPointerEnter",v="pointer"),y=m==null?d:gm(m),w=p==null?d:gm(p),d=new h(x,v+"leave",m,n,f),d.target=y,d.relatedTarget=w,x=null,xf(f)===u&&(h=new h(g,v+"enter",p,n,f),h.target=w,h.relatedTarget=y,x=h),y=x,m&&p)t:{for(h=m,g=p,v=0,w=h;w;w=Ip(w))v++;for(w=0,x=g;x;x=Ip(x))w++;for(;0<v-w;)h=Ip(h),v--;for(;0<w-v;)g=Ip(g),w--;for(;v--;){if(h===g||g!==null&&h===g.alternate)break t;h=Ip(h),g=Ip(g)}h=null}else h=null;m!==null&&s3(l,d,m,h,!1),p!==null&&y!==null&&s3(l,y,p,h,!0)}}e:{if(d=u?gm(u):window,m=d.nodeName&&d.nodeName.toLowerCase(),m==="select"||m==="input"&&d.type==="file")var A=eue;else if(Xj(d))if(f5)A=sue;else{A=nue;var k=tue}else(m=d.nodeName)&&m.toLowerCase()==="input"&&(d.type==="checkbox"||d.type==="radio")&&(A=rue);if(A&&(A=A(t,u))){d5(l,A,n,f);break e}k&&k(t,d,u),t==="focusout"&&(k=d._wrapperState)&&k.controlled&&d.type==="number"&&Nk(d,"number",d.value)}switch(k=u?gm(u):window,t){case"focusin":(Xj(k)||k.contentEditable==="true")&&(pm=k,Wk=u,ub=null);break;case"focusout":ub=Wk=pm=null;break;case"mousedown":Vk=!0;break;case"contextmenu":case"mouseup":case"dragend":Vk=!1,t3(l,n,f);break;case"selectionchange":if(aue)break;case"keydown":case"keyup":t3(l,n,f)}var R;if(AO)e:{switch(t){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else hm?c5(t,n)&&(E="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(l5&&n.locale!=="ko"&&(hm||E!=="onCompositionStart"?E==="onCompositionEnd"&&hm&&(R=a5()):(dd=f,SO="value"in dd?dd.value:dd.textContent,hm=!0)),k=OE(u,E),0<k.length&&(E=new qj(E,t,null,n,f),l.push({event:E,listeners:k}),R?E.data=R:(R=u5(n),R!==null&&(E.data=R)))),(R=Yce?Xce(t,n):Qce(t,n))&&(u=OE(u,"onBeforeInput"),0<u.length&&(f=new qj("onBeforeInput","beforeinput",null,n,f),l.push({event:f,listeners:u}),f.data=R))}x5(l,e)})}function Lb(t,e,n){return{instance:t,listener:e,currentTarget:n}}function OE(t,e){for(var n=e+"Capture",r=[];t!==null;){var s=t,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=Pb(t,n),i!=null&&r.unshift(Lb(t,i,s)),i=Pb(t,e),i!=null&&r.push(Lb(t,i,s))),t=t.return}return r}function Ip(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function s3(t,e,n,r,s){for(var i=e._reactName,a=[];n!==null&&n!==r;){var o=n,c=o.alternate,u=o.stateNode;if(c!==null&&c===r)break;o.tag===5&&u!==null&&(o=u,s?(c=Pb(n,i),c!=null&&a.unshift(Lb(n,c,o))):s||(c=Pb(n,i),c!=null&&a.push(Lb(n,c,o)))),n=n.return}a.length!==0&&t.push({event:e,listeners:a})}var due=/\r\n?/g,fue=/\u0000|\uFFFD/g;function i3(t){return(typeof t=="string"?t:""+t).replace(due,`
|
||
`).replace(fue,"")}function Hx(t,e,n){if(e=i3(e),i3(t)!==e&&n)throw Error(ke(425))}function LE(){}var qk=null,Gk=null;function Kk(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Yk=typeof setTimeout=="function"?setTimeout:void 0,hue=typeof clearTimeout=="function"?clearTimeout:void 0,o3=typeof Promise=="function"?Promise:void 0,pue=typeof queueMicrotask=="function"?queueMicrotask:typeof o3<"u"?function(t){return o3.resolve(null).then(t).catch(mue)}:Yk;function mue(t){setTimeout(function(){throw t})}function BP(t,e){var n=e,r=0;do{var s=n.nextSibling;if(t.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){t.removeChild(s),Db(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Db(e)}function vd(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function a3(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var wv=Math.random().toString(36).slice(2),fl="__reactFiber$"+wv,Ib="__reactProps$"+wv,Uc="__reactContainer$"+wv,Xk="__reactEvents$"+wv,gue="__reactListeners$"+wv,vue="__reactHandles$"+wv;function xf(t){var e=t[fl];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Uc]||n[fl]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=a3(t);t!==null;){if(n=t[fl])return n;t=a3(t)}return e}t=n,n=t.parentNode}return null}function Z0(t){return t=t[fl]||t[Uc],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function gm(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(ke(33))}function SC(t){return t[Ib]||null}var Qk=[],vm=-1;function Id(t){return{current:t}}function Un(t){0>vm||(t.current=Qk[vm],Qk[vm]=null,vm--)}function On(t,e){vm++,Qk[vm]=t.current,t.current=e}var Cd={},Os=Id(Cd),xi=Id(!1),jh=Cd;function nv(t,e){var n=t.type.contextTypes;if(!n)return Cd;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 Si(t){return t=t.childContextTypes,t!=null}function IE(){Un(xi),Un(Os)}function l3(t,e,n){if(Os.current!==Cd)throw Error(ke(168));On(Os,e),On(xi,n)}function E5(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,tce(t)||"Unknown",s));return rr({},n,r)}function $E(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Cd,jh=Os.current,On(Os,t),On(xi,xi.current),!0}function c3(t,e,n){var r=t.stateNode;if(!r)throw Error(ke(169));n?(t=E5(t,e,jh),r.__reactInternalMemoizedMergedChildContext=t,Un(xi),Un(Os),On(Os,t)):Un(xi),On(xi,n)}var tc=null,EC=!1,UP=!1;function C5(t){tc===null?tc=[t]:tc.push(t)}function yue(t){EC=!0,C5(t)}function $d(){if(!UP&&tc!==null){UP=!0;var t=0,e=mn;try{var n=tc;for(mn=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}tc=null,EC=!1}catch(s){throw tc!==null&&(tc=tc.slice(t+1)),XH(bO,$d),s}finally{mn=e,UP=!1}}return null}var ym=[],bm=0,FE=null,jE=0,ko=[],Do=0,zh=null,Dc=1,Nc="";function df(t,e){ym[bm++]=jE,ym[bm++]=FE,FE=t,jE=e}function A5(t,e,n){ko[Do++]=Dc,ko[Do++]=Nc,ko[Do++]=zh,zh=t;var r=Dc;t=Nc;var s=32-xa(r)-1;r&=~(1<<s),n+=1;var i=32-xa(e)+s;if(30<i){var a=s-s%5;i=(r&(1<<a)-1).toString(32),r>>=a,s-=a,Dc=1<<32-xa(e)+s|n<<s|r,Nc=i+t}else Dc=1<<i|n<<s|r,Nc=t}function PO(t){t.return!==null&&(df(t,1),A5(t,1,0))}function TO(t){for(;t===FE;)FE=ym[--bm],ym[bm]=null,jE=ym[--bm],ym[bm]=null;for(;t===zh;)zh=ko[--Do],ko[Do]=null,Nc=ko[--Do],ko[Do]=null,Dc=ko[--Do],ko[Do]=null}var so=null,ro=null,Kn=!1,ba=null;function R5(t,e){var n=Lo(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function u3(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,so=t,ro=vd(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,so=t,ro=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=zh!==null?{id:Dc,overflow:Nc}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=Lo(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,so=t,ro=null,!0):!1;default:return!1}}function Jk(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Zk(t){if(Kn){var e=ro;if(e){var n=e;if(!u3(t,e)){if(Jk(t))throw Error(ke(418));e=vd(n.nextSibling);var r=so;e&&u3(t,e)?R5(r,n):(t.flags=t.flags&-4097|2,Kn=!1,so=t)}}else{if(Jk(t))throw Error(ke(418));t.flags=t.flags&-4097|2,Kn=!1,so=t}}}function d3(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;so=t}function Wx(t){if(t!==so)return!1;if(!Kn)return d3(t),Kn=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Kk(t.type,t.memoizedProps)),e&&(e=ro)){if(Jk(t))throw P5(),Error(ke(418));for(;e;)R5(t,e),e=vd(e.nextSibling)}if(d3(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(ke(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){ro=vd(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}ro=null}}else ro=so?vd(t.stateNode.nextSibling):null;return!0}function P5(){for(var t=ro;t;)t=vd(t.nextSibling)}function rv(){ro=so=null,Kn=!1}function kO(t){ba===null?ba=[t]:ba.push(t)}var bue=Yc.ReactCurrentBatchConfig;function fy(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(ke(309));var r=n.stateNode}if(!r)throw Error(ke(147,t));var s=r,i=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===i?e.ref:(e=function(a){var o=s.refs;a===null?delete o[i]:o[i]=a},e._stringRef=i,e)}if(typeof t!="string")throw Error(ke(284));if(!n._owner)throw Error(ke(290,t))}return t}function Vx(t,e){throw t=Object.prototype.toString.call(e),Error(ke(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function f3(t){var e=t._init;return e(t._payload)}function T5(t){function e(g,v){if(t){var w=g.deletions;w===null?(g.deletions=[v],g.flags|=16):w.push(v)}}function n(g,v){if(!t)return null;for(;v!==null;)e(g,v),v=v.sibling;return null}function r(g,v){for(g=new Map;v!==null;)v.key!==null?g.set(v.key,v):g.set(v.index,v),v=v.sibling;return g}function s(g,v){return g=_d(g,v),g.index=0,g.sibling=null,g}function i(g,v,w){return g.index=w,t?(w=g.alternate,w!==null?(w=w.index,w<v?(g.flags|=2,v):w):(g.flags|=2,v)):(g.flags|=1048576,v)}function a(g){return t&&g.alternate===null&&(g.flags|=2),g}function o(g,v,w,x){return v===null||v.tag!==6?(v=YP(w,g.mode,x),v.return=g,v):(v=s(v,w),v.return=g,v)}function c(g,v,w,x){var A=w.type;return A===fm?f(g,v,w.props.children,x,w.key):v!==null&&(v.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===Au&&f3(A)===v.type)?(x=s(v,w.props),x.ref=fy(g,v,w),x.return=g,x):(x=zS(w.type,w.key,w.props,null,g.mode,x),x.ref=fy(g,v,w),x.return=g,x)}function u(g,v,w,x){return v===null||v.tag!==4||v.stateNode.containerInfo!==w.containerInfo||v.stateNode.implementation!==w.implementation?(v=XP(w,g.mode,x),v.return=g,v):(v=s(v,w.children||[]),v.return=g,v)}function f(g,v,w,x,A){return v===null||v.tag!==7?(v=Oh(w,g.mode,x,A),v.return=g,v):(v=s(v,w),v.return=g,v)}function l(g,v,w){if(typeof v=="string"&&v!==""||typeof v=="number")return v=YP(""+v,g.mode,w),v.return=g,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Ox:return w=zS(v.type,v.key,v.props,null,g.mode,w),w.ref=fy(g,null,v),w.return=g,w;case dm:return v=XP(v,g.mode,w),v.return=g,v;case Au:var x=v._init;return l(g,x(v._payload),w)}if(Oy(v)||ay(v))return v=Oh(v,g.mode,w,null),v.return=g,v;Vx(g,v)}return null}function d(g,v,w,x){var A=v!==null?v.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return A!==null?null:o(g,v,""+w,x);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ox:return w.key===A?c(g,v,w,x):null;case dm:return w.key===A?u(g,v,w,x):null;case Au:return A=w._init,d(g,v,A(w._payload),x)}if(Oy(w)||ay(w))return A!==null?null:f(g,v,w,x,null);Vx(g,w)}return null}function m(g,v,w,x,A){if(typeof x=="string"&&x!==""||typeof x=="number")return g=g.get(w)||null,o(v,g,""+x,A);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Ox:return g=g.get(x.key===null?w:x.key)||null,c(v,g,x,A);case dm:return g=g.get(x.key===null?w:x.key)||null,u(v,g,x,A);case Au:var k=x._init;return m(g,v,w,k(x._payload),A)}if(Oy(x)||ay(x))return g=g.get(w)||null,f(v,g,x,A,null);Vx(v,x)}return null}function p(g,v,w,x){for(var A=null,k=null,R=v,E=v=0,T=null;R!==null&&E<w.length;E++){R.index>E?(T=R,R=null):T=R.sibling;var D=d(g,R,w[E],x);if(D===null){R===null&&(R=T);break}t&&R&&D.alternate===null&&e(g,R),v=i(D,v,E),k===null?A=D:k.sibling=D,k=D,R=T}if(E===w.length)return n(g,R),Kn&&df(g,E),A;if(R===null){for(;E<w.length;E++)R=l(g,w[E],x),R!==null&&(v=i(R,v,E),k===null?A=R:k.sibling=R,k=R);return Kn&&df(g,E),A}for(R=r(g,R);E<w.length;E++)T=m(R,g,E,w[E],x),T!==null&&(t&&T.alternate!==null&&R.delete(T.key===null?E:T.key),v=i(T,v,E),k===null?A=T:k.sibling=T,k=T);return t&&R.forEach(function(M){return e(g,M)}),Kn&&df(g,E),A}function h(g,v,w,x){var A=ay(w);if(typeof A!="function")throw Error(ke(150));if(w=A.call(w),w==null)throw Error(ke(151));for(var k=A=null,R=v,E=v=0,T=null,D=w.next();R!==null&&!D.done;E++,D=w.next()){R.index>E?(T=R,R=null):T=R.sibling;var M=d(g,R,D.value,x);if(M===null){R===null&&(R=T);break}t&&R&&M.alternate===null&&e(g,R),v=i(M,v,E),k===null?A=M:k.sibling=M,k=M,R=T}if(D.done)return n(g,R),Kn&&df(g,E),A;if(R===null){for(;!D.done;E++,D=w.next())D=l(g,D.value,x),D!==null&&(v=i(D,v,E),k===null?A=D:k.sibling=D,k=D);return Kn&&df(g,E),A}for(R=r(g,R);!D.done;E++,D=w.next())D=m(R,g,E,D.value,x),D!==null&&(t&&D.alternate!==null&&R.delete(D.key===null?E:D.key),v=i(D,v,E),k===null?A=D:k.sibling=D,k=D);return t&&R.forEach(function(L){return e(g,L)}),Kn&&df(g,E),A}function y(g,v,w,x){if(typeof w=="object"&&w!==null&&w.type===fm&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Ox:e:{for(var A=w.key,k=v;k!==null;){if(k.key===A){if(A=w.type,A===fm){if(k.tag===7){n(g,k.sibling),v=s(k,w.props.children),v.return=g,g=v;break e}}else if(k.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===Au&&f3(A)===k.type){n(g,k.sibling),v=s(k,w.props),v.ref=fy(g,k,w),v.return=g,g=v;break e}n(g,k);break}else e(g,k);k=k.sibling}w.type===fm?(v=Oh(w.props.children,g.mode,x,w.key),v.return=g,g=v):(x=zS(w.type,w.key,w.props,null,g.mode,x),x.ref=fy(g,v,w),x.return=g,g=x)}return a(g);case dm:e:{for(k=w.key;v!==null;){if(v.key===k)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=XP(w,g.mode,x),v.return=g,g=v}return a(g);case Au:return k=w._init,y(g,v,k(w._payload),x)}if(Oy(w))return p(g,v,w,x);if(ay(w))return h(g,v,w,x);Vx(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=YP(w,g.mode,x),v.return=g,g=v),a(g)):n(g,v)}return y}var sv=T5(!0),k5=T5(!1),zE=Id(null),BE=null,wm=null,DO=null;function NO(){DO=wm=BE=null}function MO(t){var e=zE.current;Un(zE),t._currentValue=e}function eD(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 Dm(t,e){BE=t,DO=wm=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(vi=!0),t.firstContext=null)}function zo(t){var e=t._currentValue;if(DO!==t)if(t={context:t,memoizedValue:e,next:null},wm===null){if(BE===null)throw Error(ke(308));wm=t,BE.dependencies={lanes:0,firstContext:t}}else wm=wm.next=t;return e}var Sf=null;function OO(t){Sf===null?Sf=[t]:Sf.push(t)}function D5(t,e,n,r){var s=e.interleaved;return s===null?(n.next=n,OO(e)):(n.next=s.next,s.next=n),e.interleaved=n,Hc(t,r)}function Hc(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 Ru=!1;function LO(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function N5(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 Mc(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function yd(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Kt&2){var s=r.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),r.pending=e,Hc(t,n)}return s=r.interleaved,s===null?(e.next=e,OO(r)):(e.next=s.next,s.next=e),r.interleaved=e,Hc(t,n)}function OS(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,wO(t,n)}}function h3(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 UE(t,e,n,r){var s=t.updateQueue;Ru=!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=rr({},l,d);break e;case 2:Ru=!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);Uh|=a,t.lanes=a,t.memoizedState=l}}function p3(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(ke(191,s));s.call(r)}}}var e_={},yl=Id(e_),$b=Id(e_),Fb=Id(e_);function Ef(t){if(t===e_)throw Error(ke(174));return t}function IO(t,e){switch(On(Fb,e),On($b,t),On(yl,e_),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Ok(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Ok(e,t)}Un(yl),On(yl,e)}function iv(){Un(yl),Un($b),Un(Fb)}function M5(t){Ef(Fb.current);var e=Ef(yl.current),n=Ok(e,t.type);e!==n&&(On($b,t),On(yl,n))}function $O(t){$b.current===t&&(Un(yl),Un($b))}var tr=Id(0);function HE(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var HP=[];function FO(){for(var t=0;t<HP.length;t++)HP[t]._workInProgressVersionPrimary=null;HP.length=0}var LS=Yc.ReactCurrentDispatcher,WP=Yc.ReactCurrentBatchConfig,Bh=0,nr=null,zr=null,Xr=null,WE=!1,db=!1,jb=0,wue=0;function ws(){throw Error(ke(321))}function jO(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Aa(t[n],e[n]))return!1;return!0}function zO(t,e,n,r,s,i){if(Bh=i,nr=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,LS.current=t===null||t.memoizedState===null?Eue:Cue,t=n(r,s),db){i=0;do{if(db=!1,jb=0,25<=i)throw Error(ke(301));i+=1,Xr=zr=null,e.updateQueue=null,LS.current=Aue,t=n(r,s)}while(db)}if(LS.current=VE,e=zr!==null&&zr.next!==null,Bh=0,Xr=zr=nr=null,WE=!1,e)throw Error(ke(300));return t}function BO(){var t=jb!==0;return jb=0,t}function Va(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xr===null?nr.memoizedState=Xr=t:Xr=Xr.next=t,Xr}function Bo(){if(zr===null){var t=nr.alternate;t=t!==null?t.memoizedState:null}else t=zr.next;var e=Xr===null?nr.memoizedState:Xr.next;if(e!==null)Xr=e,zr=t;else{if(t===null)throw Error(ke(310));zr=t,t={memoizedState:zr.memoizedState,baseState:zr.baseState,baseQueue:zr.baseQueue,queue:zr.queue,next:null},Xr===null?nr.memoizedState=Xr=t:Xr=Xr.next=t}return Xr}function zb(t,e){return typeof e=="function"?e(t):e}function VP(t){var e=Bo(),n=e.queue;if(n===null)throw Error(ke(311));n.lastRenderedReducer=t;var r=zr,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var a=s.next;s.next=i.next,i.next=a}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var o=a=null,c=null,u=i;do{var f=u.lane;if((Bh&f)===f)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:t(r,u.action);else{var l={lane:f,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(o=c=l,a=r):c=c.next=l,nr.lanes|=f,Uh|=f}u=u.next}while(u!==null&&u!==i);c===null?a=r:c.next=o,Aa(r,e.memoizedState)||(vi=!0),e.memoizedState=r,e.baseState=a,e.baseQueue=c,n.lastRenderedState=r}if(t=n.interleaved,t!==null){s=t;do i=s.lane,nr.lanes|=i,Uh|=i,s=s.next;while(s!==t)}else s===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function qP(t){var e=Bo(),n=e.queue;if(n===null)throw Error(ke(311));n.lastRenderedReducer=t;var r=n.dispatch,s=n.pending,i=e.memoizedState;if(s!==null){n.pending=null;var a=s=s.next;do i=t(i,a.action),a=a.next;while(a!==s);Aa(i,e.memoizedState)||(vi=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),n.lastRenderedState=i}return[i,r]}function O5(){}function L5(t,e){var n=nr,r=Bo(),s=e(),i=!Aa(r.memoizedState,s);if(i&&(r.memoizedState=s,vi=!0),r=r.queue,UO(F5.bind(null,n,r,t),[t]),r.getSnapshot!==e||i||Xr!==null&&Xr.memoizedState.tag&1){if(n.flags|=2048,Bb(9,$5.bind(null,n,r,s,e),void 0,null),Zr===null)throw Error(ke(349));Bh&30||I5(n,e,s)}return s}function I5(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=nr.updateQueue,e===null?(e={lastEffect:null,stores:null},nr.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function $5(t,e,n,r){e.value=n,e.getSnapshot=r,j5(e)&&z5(t)}function F5(t,e,n){return n(function(){j5(e)&&z5(t)})}function j5(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Aa(t,n)}catch{return!0}}function z5(t){var e=Hc(t,1);e!==null&&Sa(e,t,1,-1)}function m3(t){var e=Va();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:zb,lastRenderedState:t},e.queue=t,t=t.dispatch=Sue.bind(null,nr,t),[e.memoizedState,t]}function Bb(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=nr.updateQueue,e===null?(e={lastEffect:null,stores:null},nr.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function B5(){return Bo().memoizedState}function IS(t,e,n,r){var s=Va();nr.flags|=t,s.memoizedState=Bb(1|e,n,void 0,r===void 0?null:r)}function CC(t,e,n,r){var s=Bo();r=r===void 0?null:r;var i=void 0;if(zr!==null){var a=zr.memoizedState;if(i=a.destroy,r!==null&&jO(r,a.deps)){s.memoizedState=Bb(e,n,i,r);return}}nr.flags|=t,s.memoizedState=Bb(1|e,n,i,r)}function g3(t,e){return IS(8390656,8,t,e)}function UO(t,e){return CC(2048,8,t,e)}function U5(t,e){return CC(4,2,t,e)}function H5(t,e){return CC(4,4,t,e)}function W5(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function V5(t,e,n){return n=n!=null?n.concat([t]):null,CC(4,4,W5.bind(null,e,t),n)}function HO(){}function q5(t,e){var n=Bo();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&jO(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function G5(t,e){var n=Bo();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&jO(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function K5(t,e,n){return Bh&21?(Aa(n,e)||(n=ZH(),nr.lanes|=n,Uh|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,vi=!0),t.memoizedState=n)}function _ue(t,e){var n=mn;mn=n!==0&&4>n?n:4,t(!0);var r=WP.transition;WP.transition={};try{t(!1),e()}finally{mn=n,WP.transition=r}}function Y5(){return Bo().memoizedState}function xue(t,e,n){var r=wd(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},X5(t))Q5(e,n);else if(n=D5(t,e,n,r),n!==null){var s=Xs();Sa(n,t,r,s),J5(n,e,r)}}function Sue(t,e,n){var r=wd(t),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(X5(t))Q5(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,Aa(o,a)){var c=e.interleaved;c===null?(s.next=s,OO(e)):(s.next=c.next,c.next=s),e.interleaved=s;return}}catch{}finally{}n=D5(t,e,s,r),n!==null&&(s=Xs(),Sa(n,t,r,s),J5(n,e,r))}}function X5(t){var e=t.alternate;return t===nr||e!==null&&e===nr}function Q5(t,e){db=WE=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function J5(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,wO(t,n)}}var VE={readContext:zo,useCallback:ws,useContext:ws,useEffect:ws,useImperativeHandle:ws,useInsertionEffect:ws,useLayoutEffect:ws,useMemo:ws,useReducer:ws,useRef:ws,useState:ws,useDebugValue:ws,useDeferredValue:ws,useTransition:ws,useMutableSource:ws,useSyncExternalStore:ws,useId:ws,unstable_isNewReconciler:!1},Eue={readContext:zo,useCallback:function(t,e){return Va().memoizedState=[t,e===void 0?null:e],t},useContext:zo,useEffect:g3,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,IS(4194308,4,W5.bind(null,e,t),n)},useLayoutEffect:function(t,e){return IS(4194308,4,t,e)},useInsertionEffect:function(t,e){return IS(4,2,t,e)},useMemo:function(t,e){var n=Va();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Va();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=xue.bind(null,nr,t),[r.memoizedState,t]},useRef:function(t){var e=Va();return t={current:t},e.memoizedState=t},useState:m3,useDebugValue:HO,useDeferredValue:function(t){return Va().memoizedState=t},useTransition:function(){var t=m3(!1),e=t[0];return t=_ue.bind(null,t[1]),Va().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=nr,s=Va();if(Kn){if(n===void 0)throw Error(ke(407));n=n()}else{if(n=e(),Zr===null)throw Error(ke(349));Bh&30||I5(r,e,n)}s.memoizedState=n;var i={value:n,getSnapshot:e};return s.queue=i,g3(F5.bind(null,r,i,t),[t]),r.flags|=2048,Bb(9,$5.bind(null,r,i,n,e),void 0,null),n},useId:function(){var t=Va(),e=Zr.identifierPrefix;if(Kn){var n=Nc,r=Dc;n=(r&~(1<<32-xa(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=jb++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=wue++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},Cue={readContext:zo,useCallback:q5,useContext:zo,useEffect:UO,useImperativeHandle:V5,useInsertionEffect:U5,useLayoutEffect:H5,useMemo:G5,useReducer:VP,useRef:B5,useState:function(){return VP(zb)},useDebugValue:HO,useDeferredValue:function(t){var e=Bo();return K5(e,zr.memoizedState,t)},useTransition:function(){var t=VP(zb)[0],e=Bo().memoizedState;return[t,e]},useMutableSource:O5,useSyncExternalStore:L5,useId:Y5,unstable_isNewReconciler:!1},Aue={readContext:zo,useCallback:q5,useContext:zo,useEffect:UO,useImperativeHandle:V5,useInsertionEffect:U5,useLayoutEffect:H5,useMemo:G5,useReducer:qP,useRef:B5,useState:function(){return qP(zb)},useDebugValue:HO,useDeferredValue:function(t){var e=Bo();return zr===null?e.memoizedState=t:K5(e,zr.memoizedState,t)},useTransition:function(){var t=qP(zb)[0],e=Bo().memoizedState;return[t,e]},useMutableSource:O5,useSyncExternalStore:L5,useId:Y5,unstable_isNewReconciler:!1};function ea(t,e){if(t&&t.defaultProps){e=rr({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function tD(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:rr({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var AC={isMounted:function(t){return(t=t._reactInternals)?fp(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=Xs(),s=wd(t),i=Mc(r,s);i.payload=e,n!=null&&(i.callback=n),e=yd(t,i,s),e!==null&&(Sa(e,t,s,r),OS(e,t,s))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=Xs(),s=wd(t),i=Mc(r,s);i.tag=1,i.payload=e,n!=null&&(i.callback=n),e=yd(t,i,s),e!==null&&(Sa(e,t,s,r),OS(e,t,s))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=Xs(),r=wd(t),s=Mc(n,r);s.tag=2,e!=null&&(s.callback=e),e=yd(t,s,r),e!==null&&(Sa(e,t,r,n),OS(e,t,r))}};function v3(t,e,n,r,s,i,a){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,i,a):e.prototype&&e.prototype.isPureReactComponent?!Mb(n,r)||!Mb(s,i):!0}function Z5(t,e,n){var r=!1,s=Cd,i=e.contextType;return typeof i=="object"&&i!==null?i=zo(i):(s=Si(e)?jh:Os.current,r=e.contextTypes,i=(r=r!=null)?nv(t,s):Cd),e=new e(n,i),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=AC,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=s,t.__reactInternalMemoizedMaskedChildContext=i),e}function y3(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&AC.enqueueReplaceState(e,e.state,null)}function nD(t,e,n,r){var s=t.stateNode;s.props=n,s.state=t.memoizedState,s.refs={},LO(t);var i=e.contextType;typeof i=="object"&&i!==null?s.context=zo(i):(i=Si(e)?jh:Os.current,s.context=nv(t,i)),s.state=t.memoizedState,i=e.getDerivedStateFromProps,typeof i=="function"&&(tD(t,e,i,n),s.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(e=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),e!==s.state&&AC.enqueueReplaceState(s,s.state,null),UE(t,n,s,r),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308)}function ov(t,e){try{var n="",r=e;do n+=ece(r),r=r.return;while(r);var s=n}catch(i){s=`
|
||
Error generating stack: `+i.message+`
|
||
`+i.stack}return{value:t,source:e,stack:s,digest:null}}function GP(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function rD(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var Rue=typeof WeakMap=="function"?WeakMap:Map;function eW(t,e,n){n=Mc(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){GE||(GE=!0,hD=r),rD(t,e)},n}function tW(t,e,n){n=Mc(-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(){rD(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){rD(t,e),typeof r!="function"&&(bd===null?bd=new Set([this]):bd.add(this));var a=e.stack;this.componentDidCatch(e.value,{componentStack:a!==null?a:""})}),n}function b3(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new Rue;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=Bue.bind(null,t,e,n),e.then(t,t))}function w3(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 _3(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=Mc(-1,1),e.tag=2,yd(n,e,1))),n.lanes|=1),t)}var Pue=Yc.ReactCurrentOwner,vi=!1;function Vs(t,e,n,r){e.child=t===null?k5(e,null,n,r):sv(e,t.child,n,r)}function x3(t,e,n,r,s){n=n.render;var i=e.ref;return Dm(e,s),r=zO(t,e,n,r,i,s),n=BO(),t!==null&&!vi?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,Wc(t,e,s)):(Kn&&n&&PO(e),e.flags|=1,Vs(t,e,r,s),e.child)}function S3(t,e,n,r,s){if(t===null){var i=n.type;return typeof i=="function"&&!QO(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=i,nW(t,e,i,r,s)):(t=zS(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:Mb,n(a,r)&&t.ref===e.ref)return Wc(t,e,s)}return e.flags|=1,t=_d(i,r),t.ref=e.ref,t.return=e,e.child=t}function nW(t,e,n,r,s){if(t!==null){var i=t.memoizedProps;if(Mb(i,r)&&t.ref===e.ref)if(vi=!1,e.pendingProps=r=i,(t.lanes&s)!==0)t.flags&131072&&(vi=!0);else return e.lanes=t.lanes,Wc(t,e,s)}return sD(t,e,n,r,s)}function rW(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},On(xm,Qi),Qi|=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,On(xm,Qi),Qi|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,On(xm,Qi),Qi|=r}else i!==null?(r=i.baseLanes|n,e.memoizedState=null):r=n,On(xm,Qi),Qi|=r;return Vs(t,e,s,n),e.child}function sW(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function sD(t,e,n,r,s){var i=Si(n)?jh:Os.current;return i=nv(e,i),Dm(e,s),n=zO(t,e,n,r,i,s),r=BO(),t!==null&&!vi?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,Wc(t,e,s)):(Kn&&r&&PO(e),e.flags|=1,Vs(t,e,n,s),e.child)}function E3(t,e,n,r,s){if(Si(n)){var i=!0;$E(e)}else i=!1;if(Dm(e,s),e.stateNode===null)$S(t,e),Z5(e,n,r),nD(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=Si(n)?jh:Os.current,u=nv(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)&&y3(e,a,r,u),Ru=!1;var d=e.memoizedState;a.state=d,UE(e,r,a,s),c=e.memoizedState,o!==r||d!==c||xi.current||Ru?(typeof f=="function"&&(tD(e,n,f,r),c=e.memoizedState),(o=Ru||v3(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,N5(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=Si(n)?jh:Os.current,c=nv(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)&&y3(e,a,r,c),Ru=!1,d=e.memoizedState,a.state=d,UE(e,r,a,s);var p=e.memoizedState;o!==l||d!==p||xi.current||Ru?(typeof m=="function"&&(tD(e,n,m,r),p=e.memoizedState),(u=Ru||v3(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 iD(t,e,n,r,i,s)}function iD(t,e,n,r,s,i){sW(t,e);var a=(e.flags&128)!==0;if(!r&&!a)return s&&c3(e,n,!1),Wc(t,e,i);r=e.stateNode,Pue.current=e;var o=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&a?(e.child=sv(e,t.child,null,i),e.child=sv(e,null,o,i)):Vs(t,e,o,i),e.memoizedState=r.state,s&&c3(e,n,!0),e.child}function iW(t){var e=t.stateNode;e.pendingContext?l3(t,e.pendingContext,e.pendingContext!==e.context):e.context&&l3(t,e.context,!1),IO(t,e.containerInfo)}function C3(t,e,n,r,s){return rv(),kO(s),e.flags|=256,Vs(t,e,n,r),e.child}var oD={dehydrated:null,treeContext:null,retryLane:0};function aD(t){return{baseLanes:t,cachePool:null,transitions:null}}function oW(t,e,n){var r=e.pendingProps,s=tr.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),On(tr,s&1),t===null)return Zk(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=TC(a,r,0,null),t=Oh(t,r,n,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=aD(n),e.memoizedState=oD,t):WO(e,a));if(s=t.memoizedState,s!==null&&(o=s.dehydrated,o!==null))return Tue(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=_d(s,c),r.subtreeFlags=s.subtreeFlags&14680064),o!==null?i=_d(o,i):(i=Oh(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?aD(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=t.childLanes&~n,e.memoizedState=oD,r}return i=t.child,t=i.sibling,r=_d(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 WO(t,e){return e=TC({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function qx(t,e,n,r){return r!==null&&kO(r),sv(e,t.child,null,n),t=WO(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Tue(t,e,n,r,s,i,a){if(n)return e.flags&256?(e.flags&=-257,r=GP(Error(ke(422))),qx(t,e,a,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=r.fallback,s=e.mode,r=TC({mode:"visible",children:r.children},s,0,null),i=Oh(i,s,a,null),i.flags|=2,r.return=e,i.return=e,r.sibling=i,e.child=r,e.mode&1&&sv(e,t.child,null,a),e.child.memoizedState=aD(a),e.memoizedState=oD,i);if(!(e.mode&1))return qx(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=GP(i,r,void 0),qx(t,e,a,r)}if(o=(a&t.childLanes)!==0,vi||o){if(r=Zr,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,Hc(t,s),Sa(r,t,s,-1))}return XO(),r=GP(Error(ke(421))),qx(t,e,a,r)}return s.data==="$?"?(e.flags|=128,e.child=t.child,e=Uue.bind(null,t),s._reactRetry=e,null):(t=i.treeContext,ro=vd(s.nextSibling),so=e,Kn=!0,ba=null,t!==null&&(ko[Do++]=Dc,ko[Do++]=Nc,ko[Do++]=zh,Dc=t.id,Nc=t.overflow,zh=e),e=WO(e,r.children),e.flags|=4096,e)}function A3(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),eD(t.return,e,n)}function KP(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 aW(t,e,n){var r=e.pendingProps,s=r.revealOrder,i=r.tail;if(Vs(t,e,r.children,n),r=tr.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&&A3(t,n,e);else if(t.tag===19)A3(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(On(tr,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&&HE(t)===null&&(s=n),n=n.sibling;n=s,n===null?(s=e.child,e.child=null):(s=n.sibling,n.sibling=null),KP(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&&HE(t)===null){e.child=s;break}t=s.sibling,s.sibling=n,n=s,s=t}KP(e,!0,n,null,i);break;case"together":KP(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function $S(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Wc(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Uh|=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=_d(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=_d(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function kue(t,e,n){switch(e.tag){case 3:iW(e),rv();break;case 5:M5(e);break;case 1:Si(e.type)&&$E(e);break;case 4:IO(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,s=e.memoizedProps.value;On(zE,r._currentValue),r._currentValue=s;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(On(tr,tr.current&1),e.flags|=128,null):n&e.child.childLanes?oW(t,e,n):(On(tr,tr.current&1),t=Wc(t,e,n),t!==null?t.sibling:null);On(tr,tr.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return aW(t,e,n);e.flags|=128}if(s=e.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),On(tr,tr.current),r)break;return null;case 22:case 23:return e.lanes=0,rW(t,e,n)}return Wc(t,e,n)}var lW,lD,cW,uW;lW=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}};lD=function(){};cW=function(t,e,n,r){var s=t.memoizedProps;if(s!==r){t=e.stateNode,Ef(yl.current);var i=null;switch(n){case"input":s=kk(t,s),r=kk(t,r),i=[];break;case"select":s=rr({},s,{value:void 0}),r=rr({},r,{value:void 0}),i=[];break;case"textarea":s=Mk(t,s),r=Mk(t,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=LE)}Lk(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"&&(Ab.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"&&(Ab.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&zn("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)}};uW=function(t,e,n,r){n!==r&&(e.flags|=4)};function hy(t,e){if(!Kn)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 _s(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 Due(t,e,n){var r=e.pendingProps;switch(TO(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _s(e),null;case 1:return Si(e.type)&&IE(),_s(e),null;case 3:return r=e.stateNode,iv(),Un(xi),Un(Os),FO(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Wx(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,ba!==null&&(gD(ba),ba=null))),lD(t,e),_s(e),null;case 5:$O(e);var s=Ef(Fb.current);if(n=e.type,t!==null&&e.stateNode!=null)cW(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 _s(e),null}if(t=Ef(yl.current),Wx(e)){r=e.stateNode,n=e.type;var i=e.memoizedProps;switch(r[fl]=e,r[Ib]=i,t=(e.mode&1)!==0,n){case"dialog":zn("cancel",r),zn("close",r);break;case"iframe":case"object":case"embed":zn("load",r);break;case"video":case"audio":for(s=0;s<Iy.length;s++)zn(Iy[s],r);break;case"source":zn("error",r);break;case"img":case"image":case"link":zn("error",r),zn("load",r);break;case"details":zn("toggle",r);break;case"input":Lj(r,i),zn("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},zn("invalid",r);break;case"textarea":$j(r,i),zn("invalid",r)}Lk(n,i),s=null;for(var a in i)if(i.hasOwnProperty(a)){var o=i[a];a==="children"?typeof o=="string"?r.textContent!==o&&(i.suppressHydrationWarning!==!0&&Hx(r.textContent,o,t),s=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(i.suppressHydrationWarning!==!0&&Hx(r.textContent,o,t),s=["children",""+o]):Ab.hasOwnProperty(a)&&o!=null&&a==="onScroll"&&zn("scroll",r)}switch(n){case"input":Lx(r),Ij(r,i,!0);break;case"textarea":Lx(r),Fj(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=LE)}r=s,e.updateQueue=r,r!==null&&(e.flags|=4)}else{a=s.nodeType===9?s:s.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=FH(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=a.createElement("div"),t.innerHTML="<script><\/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[Ib]=r,lW(t,e,!1,!1),e.stateNode=t;e:{switch(a=Ik(n,r),n){case"dialog":zn("cancel",t),zn("close",t),s=r;break;case"iframe":case"object":case"embed":zn("load",t),s=r;break;case"video":case"audio":for(s=0;s<Iy.length;s++)zn(Iy[s],t);s=r;break;case"source":zn("error",t),s=r;break;case"img":case"image":case"link":zn("error",t),zn("load",t),s=r;break;case"details":zn("toggle",t),s=r;break;case"input":Lj(t,r),s=kk(t,r),zn("invalid",t);break;case"option":s=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},s=rr({},r,{value:void 0}),zn("invalid",t);break;case"textarea":$j(t,r),s=Mk(t,r),zn("invalid",t);break;default:s=r}Lk(n,s),o=s;for(i in o)if(o.hasOwnProperty(i)){var c=o[i];i==="style"?BH(t,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&jH(t,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Rb(t,c):typeof c=="number"&&Rb(t,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Ab.hasOwnProperty(i)?c!=null&&i==="onScroll"&&zn("scroll",t):c!=null&&pO(t,i,c,a))}switch(n){case"input":Lx(t),Ij(t,r,!1);break;case"textarea":Lx(t),Fj(t);break;case"option":r.value!=null&&t.setAttribute("value",""+Ed(r.value));break;case"select":t.multiple=!!r.multiple,i=r.value,i!=null?Rm(t,!!r.multiple,i,!1):r.defaultValue!=null&&Rm(t,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(t.onclick=LE)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return _s(e),null;case 6:if(t&&e.stateNode!=null)uW(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(ke(166));if(n=Ef(Fb.current),Ef(yl.current),Wx(e)){if(r=e.stateNode,n=e.memoizedProps,r[fl]=e,(i=r.nodeValue!==n)&&(t=so,t!==null))switch(t.tag){case 3:Hx(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Hx(r.nodeValue,n,(t.mode&1)!==0)}i&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[fl]=e,e.stateNode=r}return _s(e),null;case 13:if(Un(tr),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Kn&&ro!==null&&e.mode&1&&!(e.flags&128))P5(),rv(),e.flags|=98560,i=!1;else if(i=Wx(e),r!==null&&r.dehydrated!==null){if(t===null){if(!i)throw Error(ke(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(ke(317));i[fl]=e}else rv(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;_s(e),i=!1}else ba!==null&&(gD(ba),ba=null),i=!0;if(!i)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||tr.current&1?Wr===0&&(Wr=3):XO())),e.updateQueue!==null&&(e.flags|=4),_s(e),null);case 4:return iv(),lD(t,e),t===null&&Ob(e.stateNode.containerInfo),_s(e),null;case 10:return MO(e.type._context),_s(e),null;case 17:return Si(e.type)&&IE(),_s(e),null;case 19:if(Un(tr),i=e.memoizedState,i===null)return _s(e),null;if(r=(e.flags&128)!==0,a=i.rendering,a===null)if(r)hy(i,!1);else{if(Wr!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(a=HE(t),a!==null){for(e.flags|=128,hy(i,!1),r=a.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)i=n,t=r,i.flags&=14680066,a=i.alternate,a===null?(i.childLanes=0,i.lanes=t,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,t=a.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return On(tr,tr.current&1|2),e.child}t=t.sibling}i.tail!==null&&vr()>av&&(e.flags|=128,r=!0,hy(i,!1),e.lanes=4194304)}else{if(!r)if(t=HE(a),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),hy(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!Kn)return _s(e),null}else 2*vr()-i.renderingStartTime>av&&n!==1073741824&&(e.flags|=128,r=!0,hy(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=vr(),e.sibling=null,n=tr.current,On(tr,r?n&1|2:n&1),e):(_s(e),null);case 22:case 23:return YO(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Qi&1073741824&&(_s(e),e.subtreeFlags&6&&(e.flags|=8192)):_s(e),null;case 24:return null;case 25:return null}throw Error(ke(156,e.tag))}function Nue(t,e){switch(TO(e),e.tag){case 1:return Si(e.type)&&IE(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return iv(),Un(xi),Un(Os),FO(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return $O(e),null;case 13:if(Un(tr),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(ke(340));rv()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Un(tr),null;case 4:return iv(),null;case 10:return MO(e.type._context),null;case 22:case 23:return YO(),null;case 24:return null;default:return null}}var Gx=!1,Ts=!1,Mue=typeof WeakSet=="function"?WeakSet:Set,qe=null;function _m(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ur(t,e,r)}else n.current=null}function cD(t,e,n){try{n()}catch(r){ur(t,e,r)}}var R3=!1;function Oue(t,e){if(qk=NE,t=m5(),RO(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(Gk={focusedElem:t,selectionRange:n},NE=!1,qe=e;qe!==null;)if(e=qe,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,qe=t;else for(;qe!==null;){e=qe;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){ur(e,e.return,x)}if(t=e.sibling,t!==null){t.return=e.return,qe=t;break}qe=e.return}return p=R3,R3=!1,p}function fb(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&&cD(e,n,i)}s=s.next}while(s!==r)}}function RC(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 uD(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 dW(t){var e=t.alternate;e!==null&&(t.alternate=null,dW(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[fl],delete e[Ib],delete e[Xk],delete e[gue],delete e[vue])),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 fW(t){return t.tag===5||t.tag===3||t.tag===4}function P3(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||fW(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 dD(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=LE));else if(r!==4&&(t=t.child,t!==null))for(dD(t,e,n),t=t.sibling;t!==null;)dD(t,e,n),t=t.sibling}function fD(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(fD(t,e,n),t=t.sibling;t!==null;)fD(t,e,n),t=t.sibling}var us=null,va=!1;function hu(t,e,n){for(n=n.child;n!==null;)hW(t,e,n),n=n.sibling}function hW(t,e,n){if(vl&&typeof vl.onCommitFiberUnmount=="function")try{vl.onCommitFiberUnmount(bC,n)}catch{}switch(n.tag){case 5:Ts||_m(n,e);case 6:var r=us,s=va;us=null,hu(t,e,n),us=r,va=s,us!==null&&(va?(t=us,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):us.removeChild(n.stateNode));break;case 18:us!==null&&(va?(t=us,n=n.stateNode,t.nodeType===8?BP(t.parentNode,n):t.nodeType===1&&BP(t,n),Db(t)):BP(us,n.stateNode));break;case 4:r=us,s=va,us=n.stateNode.containerInfo,va=!0,hu(t,e,n),us=r,va=s;break;case 0:case 11:case 14:case 15:if(!Ts&&(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)&&cD(n,e,a),s=s.next}while(s!==r)}hu(t,e,n);break;case 1:if(!Ts&&(_m(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){ur(n,e,o)}hu(t,e,n);break;case 21:hu(t,e,n);break;case 22:n.mode&1?(Ts=(r=Ts)||n.memoizedState!==null,hu(t,e,n),Ts=r):hu(t,e,n);break;default:hu(t,e,n)}}function T3(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new Mue),e.forEach(function(r){var s=Hue.bind(null,t,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Jo(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=t,a=e,o=a;e:for(;o!==null;){switch(o.tag){case 5:us=o.stateNode,va=!1;break e;case 3:us=o.stateNode.containerInfo,va=!0;break e;case 4:us=o.stateNode.containerInfo,va=!0;break e}o=o.return}if(us===null)throw Error(ke(160));hW(i,a,s),us=null,va=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(u){ur(s,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)pW(e,t),e=e.sibling}function pW(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Jo(e,t),Ua(t),r&4){try{fb(3,t,t.return),RC(3,t)}catch(h){ur(t,t.return,h)}try{fb(5,t,t.return)}catch(h){ur(t,t.return,h)}}break;case 1:Jo(e,t),Ua(t),r&512&&n!==null&&_m(n,n.return);break;case 5:if(Jo(e,t),Ua(t),r&512&&n!==null&&_m(n,n.return),t.flags&32){var s=t.stateNode;try{Rb(s,"")}catch(h){ur(t,t.return,h)}}if(r&4&&(s=t.stateNode,s!=null)){var i=t.memoizedProps,a=n!==null?n.memoizedProps:i,o=t.type,c=t.updateQueue;if(t.updateQueue=null,c!==null)try{o==="input"&&i.type==="radio"&&i.name!=null&&IH(s,i),Ik(o,a);var u=Ik(o,i);for(a=0;a<c.length;a+=2){var f=c[a],l=c[a+1];f==="style"?BH(s,l):f==="dangerouslySetInnerHTML"?jH(s,l):f==="children"?Rb(s,l):pO(s,f,l,u)}switch(o){case"input":Dk(s,i);break;case"textarea":$H(s,i);break;case"select":var d=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var m=i.value;m!=null?Rm(s,!!i.multiple,m,!1):d!==!!i.multiple&&(i.defaultValue!=null?Rm(s,!!i.multiple,i.defaultValue,!0):Rm(s,!!i.multiple,i.multiple?[]:"",!1))}s[Ib]=i}catch(h){ur(t,t.return,h)}}break;case 6:if(Jo(e,t),Ua(t),r&4){if(t.stateNode===null)throw Error(ke(162));s=t.stateNode,i=t.memoizedProps;try{s.nodeValue=i}catch(h){ur(t,t.return,h)}}break;case 3:if(Jo(e,t),Ua(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Db(e.containerInfo)}catch(h){ur(t,t.return,h)}break;case 4:Jo(e,t),Ua(t);break;case 13:Jo(e,t),Ua(t),s=t.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(GO=vr())),r&4&&T3(t);break;case 22:if(f=n!==null&&n.memoizedState!==null,t.mode&1?(Ts=(u=Ts)||f,Jo(e,t),Ts=u):Jo(e,t),Ua(t),r&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!f&&t.mode&1)for(qe=t,f=t.child;f!==null;){for(l=qe=f;qe!==null;){switch(d=qe,m=d.child,d.tag){case 0:case 11:case 14:case 15:fb(4,d,d.return);break;case 1:_m(d,d.return);var p=d.stateNode;if(typeof p.componentWillUnmount=="function"){r=d,n=d.return;try{e=r,p.props=e.memoizedProps,p.state=e.memoizedState,p.componentWillUnmount()}catch(h){ur(r,n,h)}}break;case 5:_m(d,d.return);break;case 22:if(d.memoizedState!==null){D3(l);continue}}m!==null?(m.return=d,qe=m):D3(l)}f=f.sibling}e:for(f=null,l=t;;){if(l.tag===5){if(f===null){f=l;try{s=l.stateNode,u?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(o=l.stateNode,c=l.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,o.style.display=zH("display",a))}catch(h){ur(t,t.return,h)}}}else if(l.tag===6){if(f===null)try{l.stateNode.nodeValue=u?"":l.memoizedProps}catch(h){ur(t,t.return,h)}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===t)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===t)break e;for(;l.sibling===null;){if(l.return===null||l.return===t)break e;f===l&&(f=null),l=l.return}f===l&&(f=null),l.sibling.return=l.return,l=l.sibling}}break;case 19:Jo(e,t),Ua(t),r&4&&T3(t);break;case 21:break;default:Jo(e,t),Ua(t)}}function Ua(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(fW(n)){var r=n;break e}n=n.return}throw Error(ke(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(Rb(s,""),r.flags&=-33);var i=P3(t);fD(t,i,s);break;case 3:case 4:var a=r.stateNode.containerInfo,o=P3(t);dD(t,o,a);break;default:throw Error(ke(161))}}catch(c){ur(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function Lue(t,e,n){qe=t,mW(t)}function mW(t,e,n){for(var r=(t.mode&1)!==0;qe!==null;){var s=qe,i=s.child;if(s.tag===22&&r){var a=s.memoizedState!==null||Gx;if(!a){var o=s.alternate,c=o!==null&&o.memoizedState!==null||Ts;o=Gx;var u=Ts;if(Gx=a,(Ts=c)&&!u)for(qe=s;qe!==null;)a=qe,c=a.child,a.tag===22&&a.memoizedState!==null?N3(s):c!==null?(c.return=a,qe=c):N3(s);for(;i!==null;)qe=i,mW(i),i=i.sibling;qe=s,Gx=o,Ts=u}k3(t)}else s.subtreeFlags&8772&&i!==null?(i.return=s,qe=i):k3(t)}}function k3(t){for(;qe!==null;){var e=qe;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Ts||RC(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!Ts)if(n===null)r.componentDidMount();else{var s=e.elementType===e.type?n.memoizedProps:ea(e.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=e.updateQueue;i!==null&&p3(e,i,r);break;case 3:var a=e.updateQueue;if(a!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}p3(e,a,n)}break;case 5:var o=e.stateNode;if(n===null&&e.flags&4){n=o;var c=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var u=e.alternate;if(u!==null){var f=u.memoizedState;if(f!==null){var l=f.dehydrated;l!==null&&Db(l)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ke(163))}Ts||e.flags&512&&uD(e)}catch(d){ur(e,e.return,d)}}if(e===t){qe=null;break}if(n=e.sibling,n!==null){n.return=e.return,qe=n;break}qe=e.return}}function D3(t){for(;qe!==null;){var e=qe;if(e===t){qe=null;break}var n=e.sibling;if(n!==null){n.return=e.return,qe=n;break}qe=e.return}}function N3(t){for(;qe!==null;){var e=qe;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{RC(4,e)}catch(c){ur(e,n,c)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var s=e.return;try{r.componentDidMount()}catch(c){ur(e,s,c)}}var i=e.return;try{uD(e)}catch(c){ur(e,i,c)}break;case 5:var a=e.return;try{uD(e)}catch(c){ur(e,a,c)}}}catch(c){ur(e,e.return,c)}if(e===t){qe=null;break}var o=e.sibling;if(o!==null){o.return=e.return,qe=o;break}qe=e.return}}var Iue=Math.ceil,qE=Yc.ReactCurrentDispatcher,VO=Yc.ReactCurrentOwner,Io=Yc.ReactCurrentBatchConfig,Kt=0,Zr=null,Cr=null,ds=0,Qi=0,xm=Id(0),Wr=0,Ub=null,Uh=0,PC=0,qO=0,hb=null,gi=null,GO=0,av=1/0,Xl=null,GE=!1,hD=null,bd=null,Kx=!1,fd=null,KE=0,pb=0,pD=null,FS=-1,jS=0;function Xs(){return Kt&6?vr():FS!==-1?FS:FS=vr()}function wd(t){return t.mode&1?Kt&2&&ds!==0?ds&-ds:bue.transition!==null?(jS===0&&(jS=ZH()),jS):(t=mn,t!==0||(t=window.event,t=t===void 0?16:o5(t.type)),t):1}function Sa(t,e,n,r){if(50<pb)throw pb=0,pD=null,Error(ke(185));Q0(t,n,r),(!(Kt&2)||t!==Zr)&&(t===Zr&&(!(Kt&2)&&(PC|=n),Wr===4&&Du(t,ds)),Ei(t,r),n===1&&Kt===0&&!(e.mode&1)&&(av=vr()+500,EC&&$d()))}function Ei(t,e){var n=t.callbackNode;bce(t,e);var r=DE(t,t===Zr?ds:0);if(r===0)n!==null&&Bj(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&Bj(n),e===1)t.tag===0?yue(M3.bind(null,t)):C5(M3.bind(null,t)),pue(function(){!(Kt&6)&&$d()}),n=null;else{switch(e5(r)){case 1:n=bO;break;case 4:n=QH;break;case 16:n=kE;break;case 536870912:n=JH;break;default:n=kE}n=SW(n,gW.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function gW(t,e){if(FS=-1,jS=0,Kt&6)throw Error(ke(327));var n=t.callbackNode;if(Nm()&&t.callbackNode!==n)return null;var r=DE(t,t===Zr?ds:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=YE(t,r);else{e=r;var s=Kt;Kt|=2;var i=yW();(Zr!==t||ds!==e)&&(Xl=null,av=vr()+500,Mh(t,e));do try{jue();break}catch(o){vW(t,o)}while(!0);NO(),qE.current=i,Kt=s,Cr!==null?e=0:(Zr=null,ds=0,e=Wr)}if(e!==0){if(e===2&&(s=Bk(t),s!==0&&(r=s,e=mD(t,s))),e===1)throw n=Ub,Mh(t,0),Du(t,r),Ei(t,vr()),n;if(e===6)Du(t,r);else{if(s=t.current.alternate,!(r&30)&&!$ue(s)&&(e=YE(t,r),e===2&&(i=Bk(t),i!==0&&(r=i,e=mD(t,i))),e===1))throw n=Ub,Mh(t,0),Du(t,r),Ei(t,vr()),n;switch(t.finishedWork=s,t.finishedLanes=r,e){case 0:case 1:throw Error(ke(345));case 2:ff(t,gi,Xl);break;case 3:if(Du(t,r),(r&130023424)===r&&(e=GO+500-vr(),10<e)){if(DE(t,0)!==0)break;if(s=t.suspendedLanes,(s&r)!==r){Xs(),t.pingedLanes|=t.suspendedLanes&s;break}t.timeoutHandle=Yk(ff.bind(null,t,gi,Xl),e);break}ff(t,gi,Xl);break;case 4:if(Du(t,r),(r&4194240)===r)break;for(e=t.eventTimes,s=-1;0<r;){var a=31-xa(r);i=1<<a,a=e[a],a>s&&(s=a),r&=~i}if(r=s,r=vr()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Iue(r/1960))-r,10<r){t.timeoutHandle=Yk(ff.bind(null,t,gi,Xl),r);break}ff(t,gi,Xl);break;case 5:ff(t,gi,Xl);break;default:throw Error(ke(329))}}}return Ei(t,vr()),t.callbackNode===n?gW.bind(null,t):null}function mD(t,e){var n=hb;return t.current.memoizedState.isDehydrated&&(Mh(t,e).flags|=256),t=YE(t,e),t!==2&&(e=gi,gi=n,e!==null&&gD(e)),t}function gD(t){gi===null?gi=t:gi.push.apply(gi,t)}function $ue(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],i=s.getSnapshot;s=s.value;try{if(!Aa(i(),s))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Du(t,e){for(e&=~qO,e&=~PC,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-xa(e),r=1<<n;t[n]=-1,e&=~r}}function M3(t){if(Kt&6)throw Error(ke(327));Nm();var e=DE(t,0);if(!(e&1))return Ei(t,vr()),null;var n=YE(t,e);if(t.tag!==0&&n===2){var r=Bk(t);r!==0&&(e=r,n=mD(t,r))}if(n===1)throw n=Ub,Mh(t,0),Du(t,e),Ei(t,vr()),n;if(n===6)throw Error(ke(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,ff(t,gi,Xl),Ei(t,vr()),null}function KO(t,e){var n=Kt;Kt|=1;try{return t(e)}finally{Kt=n,Kt===0&&(av=vr()+500,EC&&$d())}}function Hh(t){fd!==null&&fd.tag===0&&!(Kt&6)&&Nm();var e=Kt;Kt|=1;var n=Io.transition,r=mn;try{if(Io.transition=null,mn=1,t)return t()}finally{mn=r,Io.transition=n,Kt=e,!(Kt&6)&&$d()}}function YO(){Qi=xm.current,Un(xm)}function Mh(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,hue(n)),Cr!==null)for(n=Cr.return;n!==null;){var r=n;switch(TO(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&IE();break;case 3:iv(),Un(xi),Un(Os),FO();break;case 5:$O(r);break;case 4:iv();break;case 13:Un(tr);break;case 19:Un(tr);break;case 10:MO(r.type._context);break;case 22:case 23:YO()}n=n.return}if(Zr=t,Cr=t=_d(t.current,null),ds=Qi=e,Wr=0,Ub=null,qO=PC=Uh=0,gi=hb=null,Sf!==null){for(e=0;e<Sf.length;e++)if(n=Sf[e],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var a=i.next;i.next=s,r.next=a}n.pending=r}Sf=null}return t}function vW(t,e){do{var n=Cr;try{if(NO(),LS.current=VE,WE){for(var r=nr.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}WE=!1}if(Bh=0,Xr=zr=nr=null,db=!1,jb=0,VO.current=null,n===null||n.return===null){Wr=1,Ub=e,Cr=null;break}e:{var i=t,a=n.return,o=n,c=e;if(e=ds,o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,f=o,l=f.tag;if(!(f.mode&1)&&(l===0||l===11||l===15)){var d=f.alternate;d?(f.updateQueue=d.updateQueue,f.memoizedState=d.memoizedState,f.lanes=d.lanes):(f.updateQueue=null,f.memoizedState=null)}var m=w3(a);if(m!==null){m.flags&=-257,_3(m,a,o,i,e),m.mode&1&&b3(i,u,e),e=m,c=u;var p=e.updateQueue;if(p===null){var h=new Set;h.add(c),e.updateQueue=h}else p.add(c);break e}else{if(!(e&1)){b3(i,u,e),XO();break e}c=Error(ke(426))}}else if(Kn&&o.mode&1){var y=w3(a);if(y!==null){!(y.flags&65536)&&(y.flags|=256),_3(y,a,o,i,e),kO(ov(c,o));break e}}i=c=ov(c,o),Wr!==4&&(Wr=2),hb===null?hb=[i]:hb.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,e&=-e,i.lanes|=e;var g=eW(i,c,e);h3(i,g);break e;case 1:o=c;var v=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof v.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(bd===null||!bd.has(w)))){i.flags|=65536,e&=-e,i.lanes|=e;var x=tW(i,o,e);h3(i,x);break e}}i=i.return}while(i!==null)}wW(n)}catch(A){e=A,Cr===n&&n!==null&&(Cr=n=n.return);continue}break}while(!0)}function yW(){var t=qE.current;return qE.current=VE,t===null?VE:t}function XO(){(Wr===0||Wr===3||Wr===2)&&(Wr=4),Zr===null||!(Uh&268435455)&&!(PC&268435455)||Du(Zr,ds)}function YE(t,e){var n=Kt;Kt|=2;var r=yW();(Zr!==t||ds!==e)&&(Xl=null,Mh(t,e));do try{Fue();break}catch(s){vW(t,s)}while(!0);if(NO(),Kt=n,qE.current=r,Cr!==null)throw Error(ke(261));return Zr=null,ds=0,Wr}function Fue(){for(;Cr!==null;)bW(Cr)}function jue(){for(;Cr!==null&&!uce();)bW(Cr)}function bW(t){var e=xW(t.alternate,t,Qi);t.memoizedProps=t.pendingProps,e===null?wW(t):Cr=e,VO.current=null}function wW(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=Nue(n,e),n!==null){n.flags&=32767,Cr=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Wr=6,Cr=null;return}}else if(n=Due(n,e,Qi),n!==null){Cr=n;return}if(e=e.sibling,e!==null){Cr=e;return}Cr=e=t}while(e!==null);Wr===0&&(Wr=5)}function ff(t,e,n){var r=mn,s=Io.transition;try{Io.transition=null,mn=1,zue(t,e,n,r)}finally{Io.transition=s,mn=r}return null}function zue(t,e,n,r){do Nm();while(fd!==null);if(Kt&6)throw Error(ke(327));n=t.finishedWork;var s=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(ke(177));t.callbackNode=null,t.callbackPriority=0;var i=n.lanes|n.childLanes;if(wce(t,i),t===Zr&&(Cr=Zr=null,ds=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Kx||(Kx=!0,SW(kE,function(){return Nm(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Io.transition,Io.transition=null;var a=mn;mn=1;var o=Kt;Kt|=4,VO.current=null,Oue(t,n),pW(n,t),oue(Gk),NE=!!qk,Gk=qk=null,t.current=n,Lue(n),dce(),Kt=o,mn=a,Io.transition=i}else t.current=n;if(Kx&&(Kx=!1,fd=t,KE=s),i=t.pendingLanes,i===0&&(bd=null),pce(n.stateNode),Ei(t,vr()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)s=e[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(GE)throw GE=!1,t=hD,hD=null,t;return KE&1&&t.tag!==0&&Nm(),i=t.pendingLanes,i&1?t===pD?pb++:(pb=0,pD=t):pb=0,$d(),null}function Nm(){if(fd!==null){var t=e5(KE),e=Io.transition,n=mn;try{if(Io.transition=null,mn=16>t?16:t,fd===null)var r=!1;else{if(t=fd,fd=null,KE=0,Kt&6)throw Error(ke(331));var s=Kt;for(Kt|=4,qe=t.current;qe!==null;){var i=qe,a=i.child;if(qe.flags&16){var o=i.deletions;if(o!==null){for(var c=0;c<o.length;c++){var u=o[c];for(qe=u;qe!==null;){var f=qe;switch(f.tag){case 0:case 11:case 15:fb(8,f,i)}var l=f.child;if(l!==null)l.return=f,qe=l;else for(;qe!==null;){f=qe;var d=f.sibling,m=f.return;if(dW(f),f===u){qe=null;break}if(d!==null){d.return=m,qe=d;break}qe=m}}}var p=i.alternate;if(p!==null){var h=p.child;if(h!==null){p.child=null;do{var y=h.sibling;h.sibling=null,h=y}while(h!==null)}}qe=i}}if(i.subtreeFlags&2064&&a!==null)a.return=i,qe=a;else e:for(;qe!==null;){if(i=qe,i.flags&2048)switch(i.tag){case 0:case 11:case 15:fb(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,qe=g;break e}qe=i.return}}var v=t.current;for(qe=v;qe!==null;){a=qe;var w=a.child;if(a.subtreeFlags&2064&&w!==null)w.return=a,qe=w;else e:for(a=v;qe!==null;){if(o=qe,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:RC(9,o)}}catch(A){ur(o,o.return,A)}if(o===a){qe=null;break e}var x=o.sibling;if(x!==null){x.return=o.return,qe=x;break e}qe=o.return}}if(Kt=s,$d(),vl&&typeof vl.onPostCommitFiberRoot=="function")try{vl.onPostCommitFiberRoot(bC,t)}catch{}r=!0}return r}finally{mn=n,Io.transition=e}}return!1}function O3(t,e,n){e=ov(n,e),e=eW(t,e,1),t=yd(t,e,1),e=Xs(),t!==null&&(Q0(t,1,e),Ei(t,e))}function ur(t,e,n){if(t.tag===3)O3(t,t,n);else for(;e!==null;){if(e.tag===3){O3(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(bd===null||!bd.has(r))){t=ov(n,t),t=tW(e,t,1),e=yd(e,t,1),t=Xs(),e!==null&&(Q0(e,1,t),Ei(e,t));break}}e=e.return}}function Bue(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=Xs(),t.pingedLanes|=t.suspendedLanes&n,Zr===t&&(ds&n)===n&&(Wr===4||Wr===3&&(ds&130023424)===ds&&500>vr()-GO?Mh(t,0):qO|=n),Ei(t,e)}function _W(t,e){e===0&&(t.mode&1?(e=Fx,Fx<<=1,!(Fx&130023424)&&(Fx=4194304)):e=1);var n=Xs();t=Hc(t,e),t!==null&&(Q0(t,e,n),Ei(t,n))}function Uue(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),_W(t,n)}function Hue(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),_W(t,n)}var xW;xW=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||xi.current)vi=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return vi=!1,kue(t,e,n);vi=!!(t.flags&131072)}else vi=!1,Kn&&e.flags&1048576&&A5(e,jE,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;$S(t,e),t=e.pendingProps;var s=nv(e,Os.current);Dm(e,n),s=zO(null,e,r,t,s,n);var i=BO();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,Si(r)?(i=!0,$E(e)):i=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,LO(e),s.updater=AC,e.stateNode=s,s._reactInternals=e,nD(e,r,t,n),e=iD(null,e,r,!0,i,n)):(e.tag=0,Kn&&i&&PO(e),Vs(null,e,s,n),e=e.child),e;case 16:r=e.elementType;e:{switch($S(t,e),t=e.pendingProps,s=r._init,r=s(r._payload),e.type=r,s=e.tag=Vue(r),t=ea(r,t),s){case 0:e=sD(null,e,r,t,n);break e;case 1:e=E3(null,e,r,t,n);break e;case 11:e=x3(null,e,r,t,n);break e;case 14:e=S3(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),sD(t,e,r,s,n);case 1:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:ea(r,s),E3(t,e,r,s,n);case 3:e:{if(iW(e),t===null)throw Error(ke(387));r=e.pendingProps,i=e.memoizedState,s=i.element,N5(t,e),UE(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=ov(Error(ke(423)),e),e=C3(t,e,r,n,s);break e}else if(r!==s){s=ov(Error(ke(424)),e),e=C3(t,e,r,n,s);break e}else for(ro=vd(e.stateNode.containerInfo.firstChild),so=e,Kn=!0,ba=null,n=k5(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(rv(),r===s){e=Wc(t,e,n);break e}Vs(t,e,r,n)}e=e.child}return e;case 5:return M5(e),t===null&&Zk(e),r=e.type,s=e.pendingProps,i=t!==null?t.memoizedProps:null,a=s.children,Kk(r,s)?a=null:i!==null&&Kk(r,i)&&(e.flags|=32),sW(t,e),Vs(t,e,a,n),e.child;case 6:return t===null&&Zk(e),null;case 13:return oW(t,e,n);case 4:return IO(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=sv(e,null,r,n):Vs(t,e,r,n),e.child;case 11:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:ea(r,s),x3(t,e,r,s,n);case 7:return Vs(t,e,e.pendingProps,n),e.child;case 8:return Vs(t,e,e.pendingProps.children,n),e.child;case 12:return Vs(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,On(zE,r._currentValue),r._currentValue=a,i!==null)if(Aa(i.value,a)){if(i.children===s.children&&!xi.current){e=Wc(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=Mc(-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),eD(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),eD(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}Vs(t,e,s.children,n),e=e.child}return e;case 9:return s=e.type,r=e.pendingProps.children,Dm(e,n),s=zo(s),r=r(s),e.flags|=1,Vs(t,e,r,n),e.child;case 14:return r=e.type,s=ea(r,e.pendingProps),s=ea(r.type,s),S3(t,e,r,s,n);case 15:return nW(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:ea(r,s),$S(t,e),e.tag=1,Si(r)?(t=!0,$E(e)):t=!1,Dm(e,n),Z5(e,r,s),nD(e,r,s,n),iD(null,e,r,!0,t,n);case 19:return aW(t,e,n);case 22:return rW(t,e,n)}throw Error(ke(156,e.tag))};function SW(t,e){return XH(t,e)}function Wue(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 Lo(t,e,n,r){return new Wue(t,e,n,r)}function QO(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Vue(t){if(typeof t=="function")return QO(t)?1:0;if(t!=null){if(t=t.$$typeof,t===gO)return 11;if(t===vO)return 14}return 2}function _d(t,e){var n=t.alternate;return n===null?(n=Lo(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 zS(t,e,n,r,s,i){var a=2;if(r=t,typeof t=="function")QO(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case fm:return Oh(n.children,s,i,e);case mO:a=8,s|=8;break;case Ak:return t=Lo(12,n,e,s|2),t.elementType=Ak,t.lanes=i,t;case Rk:return t=Lo(13,n,e,s),t.elementType=Rk,t.lanes=i,t;case Pk:return t=Lo(19,n,e,s),t.elementType=Pk,t.lanes=i,t;case MH:return TC(n,s,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case DH:a=10;break e;case NH:a=9;break e;case gO:a=11;break e;case vO:a=14;break e;case Au:a=16,r=null;break e}throw Error(ke(130,t==null?t:typeof t,""))}return e=Lo(a,n,e,s),e.elementType=t,e.type=r,e.lanes=i,e}function Oh(t,e,n,r){return t=Lo(7,t,r,e),t.lanes=n,t}function TC(t,e,n,r){return t=Lo(22,t,r,e),t.elementType=MH,t.lanes=n,t.stateNode={isHidden:!1},t}function YP(t,e,n){return t=Lo(6,t,null,e),t.lanes=n,t}function XP(t,e,n){return e=Lo(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function que(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=kP(0),this.expirationTimes=kP(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kP(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function JO(t,e,n,r,s,i,a,o,c){return t=new que(t,e,n,o,c),e===1?(e=1,i===!0&&(e|=8)):e=0,i=Lo(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},LO(i),t}function Gue(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:dm,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function EW(t){if(!t)return Cd;t=t._reactInternals;e:{if(fp(t)!==t||t.tag!==1)throw Error(ke(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Si(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(ke(171))}if(t.tag===1){var n=t.type;if(Si(n))return E5(t,n,e)}return e}function CW(t,e,n,r,s,i,a,o,c){return t=JO(n,r,!0,t,s,i,a,o,c),t.context=EW(null),n=t.current,r=Xs(),s=wd(n),i=Mc(r,s),i.callback=e??null,yd(n,i,s),t.current.lanes=s,Q0(t,s,r),Ei(t,r),t}function kC(t,e,n,r){var s=e.current,i=Xs(),a=wd(s);return n=EW(n),e.context===null?e.context=n:e.pendingContext=n,e=Mc(i,a),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=yd(s,e,a),t!==null&&(Sa(t,s,a,i),OS(t,s,a)),a}function XE(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function L3(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function ZO(t,e){L3(t,e),(t=t.alternate)&&L3(t,e)}function Kue(){return null}var AW=typeof reportError=="function"?reportError:function(t){console.error(t)};function eL(t){this._internalRoot=t}DC.prototype.render=eL.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(ke(409));kC(t,e,null,null)};DC.prototype.unmount=eL.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Hh(function(){kC(null,t,null,null)}),e[Uc]=null}};function DC(t){this._internalRoot=t}DC.prototype.unstable_scheduleHydration=function(t){if(t){var e=r5();t={blockedOn:null,target:t,priority:e};for(var n=0;n<ku.length&&e!==0&&e<ku[n].priority;n++);ku.splice(n,0,t),n===0&&i5(t)}};function tL(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function NC(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function I3(){}function Yue(t,e,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var u=XE(a);i.call(u)}}var a=CW(e,r,t,0,null,!1,!1,"",I3);return t._reactRootContainer=a,t[Uc]=a.current,Ob(t.nodeType===8?t.parentNode:t),Hh(),a}for(;s=t.lastChild;)t.removeChild(s);if(typeof r=="function"){var o=r;r=function(){var u=XE(c);o.call(u)}}var c=JO(t,0,!1,null,null,!1,!1,"",I3);return t._reactRootContainer=c,t[Uc]=c.current,Ob(t.nodeType===8?t.parentNode:t),Hh(function(){kC(e,c,n,r)}),c}function MC(t,e,n,r,s){var i=n._reactRootContainer;if(i){var a=i;if(typeof s=="function"){var o=s;s=function(){var c=XE(a);o.call(c)}}kC(e,a,t,s)}else a=Yue(n,e,t,s,r);return XE(a)}t5=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=Ly(e.pendingLanes);n!==0&&(wO(e,n|1),Ei(e,vr()),!(Kt&6)&&(av=vr()+500,$d()))}break;case 13:Hh(function(){var r=Hc(t,1);if(r!==null){var s=Xs();Sa(r,t,1,s)}}),ZO(t,1)}};_O=function(t){if(t.tag===13){var e=Hc(t,134217728);if(e!==null){var n=Xs();Sa(e,t,134217728,n)}ZO(t,134217728)}};n5=function(t){if(t.tag===13){var e=wd(t),n=Hc(t,e);if(n!==null){var r=Xs();Sa(n,t,e,r)}ZO(t,e)}};r5=function(){return mn};s5=function(t,e){var n=mn;try{return mn=t,e()}finally{mn=n}};Fk=function(t,e,n){switch(e){case"input":if(Dk(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var s=SC(r);if(!s)throw Error(ke(90));LH(r),Dk(r,s)}}}break;case"textarea":$H(t,n);break;case"select":e=n.value,e!=null&&Rm(t,!!n.multiple,e,!1)}};WH=KO;VH=Hh;var Xue={usingClientEntryPoint:!1,Events:[Z0,gm,SC,UH,HH,KO]},py={findFiberByHostInstance:xf,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Que={bundleType:py.bundleType,version:py.version,rendererPackageName:py.rendererPackageName,rendererConfig:py.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Yc.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=KH(t),t===null?null:t.stateNode},findFiberByHostInstance:py.findFiberByHostInstance||Kue,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yx=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yx.isDisabled&&Yx.supportsFiber)try{bC=Yx.inject(Que),vl=Yx}catch{}}co.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Xue;co.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!tL(e))throw Error(ke(200));return Gue(t,e,null,n)};co.createRoot=function(t,e){if(!tL(t))throw Error(ke(299));var n=!1,r="",s=AW;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(s=e.onRecoverableError)),e=JO(t,1,!1,null,null,n,!1,r,s),t[Uc]=e.current,Ob(t.nodeType===8?t.parentNode:t),new eL(e)};co.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(ke(188)):(t=Object.keys(t).join(","),Error(ke(268,t)));return t=KH(e),t=t===null?null:t.stateNode,t};co.flushSync=function(t){return Hh(t)};co.hydrate=function(t,e,n){if(!NC(e))throw Error(ke(200));return MC(null,t,e,!0,n)};co.hydrateRoot=function(t,e,n){if(!tL(t))throw Error(ke(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",a=AW;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),e=CW(e,null,t,1,n??null,s,!1,i,a),t[Uc]=e.current,Ob(t),r)for(t=0;t<r.length;t++)n=r[t],s=n._getVersion,s=s(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,s]:e.mutableSourceEagerHydrationData.push(n,s);return new DC(e)};co.render=function(t,e,n){if(!NC(e))throw Error(ke(200));return MC(null,t,e,!1,n)};co.unmountComponentAtNode=function(t){if(!NC(t))throw Error(ke(40));return t._reactRootContainer?(Hh(function(){MC(null,null,t,!1,function(){t._reactRootContainer=null,t[Uc]=null})}),!0):!1};co.unstable_batchedUpdates=KO;co.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!NC(n))throw Error(ke(200));if(t==null||t._reactInternals===void 0)throw Error(ke(38));return MC(t,e,n,!1,r)};co.version="18.3.1-next-f1338f8080-20240426";function RW(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(RW)}catch(t){console.error(t)}}RW(),RH.exports=co;var Ns=RH.exports;const t_=Od(Ns),Jue=mH({__proto__:null,default:t_},[Ns]);var $3=Ns;Ek.createRoot=$3.createRoot,Ek.hydrateRoot=$3.hydrateRoot;const PW=_.createContext({}),Zue=({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(PW.Provider,{value:{...e,login:n,logout:r,check:s},children:t})},TW=()=>{const t=_.useContext(PW);if(t===null)throw new Error("useAuth must be used within a AuthProvider");return t};var _v=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(){}},Wh=typeof window>"u"||"Deno"in globalThis;function Ao(){}function ede(t,e){return typeof t=="function"?t(e):t}function vD(t){return typeof t=="number"&&t>=0&&t!==1/0}function kW(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Mm(t,e){return typeof t=="function"?t(e):t}function wa(t,e){return typeof t=="function"?t(e):t}function F3(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:o}=t;if(a){if(r){if(e.queryHash!==nL(a,e.options))return!1}else if(!Hb(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 j3(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(Vh(e.options.mutationKey)!==Vh(i))return!1}else if(!Hb(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function nL(t,e){return((e==null?void 0:e.queryKeyHashFn)||Vh)(t)}function Vh(t){return JSON.stringify(t,(e,n)=>yD(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Hb(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Hb(t[n],e[n])):!1}function DW(t,e){if(t===e)return t;const n=z3(t)&&z3(e);if(n||yD(t)&&yD(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<a;u++){const f=n?u:i[u];(!n&&r.includes(f)||n)&&t[f]===void 0&&e[f]===void 0?(o[f]=void 0,c++):(o[f]=DW(t[f],e[f]),o[f]===t[f]&&t[f]!==void 0&&c++)}return s===a&&c===s?t:o}return e}function QE(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function z3(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function yD(t){if(!B3(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!B3(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function B3(t){return Object.prototype.toString.call(t)==="[object Object]"}function tde(t){return new Promise(e=>{setTimeout(e,t)})}function bD(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?DW(t,e):e}function CHe(t){return t}function nde(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function rde(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var rL=Symbol();function NW(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===rL?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var kf,Lu,Gm,rH,sde=(rH=class extends _v{constructor(){super();z(this,kf);z(this,Lu);z(this,Gm);$(this,Gm,e=>{if(!Wh&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){C(this,Lu)||this.setEventListener(C(this,Gm))}onUnsubscribe(){var e;this.hasListeners()||((e=C(this,Lu))==null||e.call(this),$(this,Lu,void 0))}setEventListener(e){var n;$(this,Gm,e),(n=C(this,Lu))==null||n.call(this),$(this,Lu,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){C(this,kf)!==e&&($(this,kf,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof C(this,kf)=="boolean"?C(this,kf):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},kf=new WeakMap,Lu=new WeakMap,Gm=new WeakMap,rH),sL=new sde,Km,Iu,Ym,sH,ide=(sH=class extends _v{constructor(){super();z(this,Km,!0);z(this,Iu);z(this,Ym);$(this,Ym,e=>{if(!Wh&&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,Iu)||this.setEventListener(C(this,Ym))}onUnsubscribe(){var e;this.hasListeners()||((e=C(this,Iu))==null||e.call(this),$(this,Iu,void 0))}setEventListener(e){var n;$(this,Ym,e),(n=C(this,Iu))==null||n.call(this),$(this,Iu,e(this.setOnline.bind(this)))}setOnline(e){C(this,Km)!==e&&($(this,Km,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return C(this,Km)}},Km=new WeakMap,Iu=new WeakMap,Ym=new WeakMap,sH),JE=new ide;function wD(){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 ode(t){return Math.min(1e3*2**t,3e4)}function MW(t){return(t??"online")==="online"?JE.isOnline():!0}var OW=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function QP(t){return t instanceof OW}function LW(t){let e=!1,n=0,r=!1,s;const i=wD(),a=h=>{var y;r||(d(new OW(h)),(y=t.abort)==null||y.call(t))},o=()=>{e=!0},c=()=>{e=!1},u=()=>sL.isFocused()&&(t.networkMode==="always"||JE.isOnline())&&t.canRun(),f=()=>MW(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 k;if(r)return;const v=t.retry??(Wh?0:3),w=t.retryDelay??ode,x=typeof w=="function"?w(n,g):w,A=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,g);if(e||!A){d(g);return}n++,(k=t.onFail)==null||k.call(t,n,g),tde(x).then(()=>u()?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 ade=t=>setTimeout(t,0);function lde(){let t=[],e=0,n=o=>{o()},r=o=>{o()},s=ade;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 Ur=lde(),Df,iH,IW=(iH=class{constructor(){z(this,Df)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),vD(this.gcTime)&&$(this,Df,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Wh?1/0:5*60*1e3))}clearGcTimeout(){C(this,Df)&&(clearTimeout(C(this,Df)),$(this,Df,void 0))}},Df=new WeakMap,iH),Xm,Qm,_o,Nf,Cs,hw,Mf,na,Kl,oH,cde=(oH=class extends IW{constructor(e){super();z(this,na);z(this,Xm);z(this,Qm);z(this,_o);z(this,Nf);z(this,Cs);z(this,hw);z(this,Mf);$(this,Mf,!1),$(this,hw,e.defaultOptions),this.setOptions(e.options),this.observers=[],$(this,Nf,e.client),$(this,_o,C(this,Nf).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,$(this,Xm,ude(this.options)),this.state=e.state??C(this,Xm),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=C(this,Cs))==null?void 0:e.promise}setOptions(e){this.options={...C(this,hw),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&C(this,_o).remove(this)}setData(e,n){const r=bD(this.state.data,e,this.options);return B(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){B(this,na,Kl).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,s;const n=(r=C(this,Cs))==null?void 0:r.promise;return(s=C(this,Cs))==null||s.cancel(e),n?n.then(Ao).catch(Ao):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(C(this,Xm))}isActive(){return this.observers.some(e=>wa(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===rL||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||!kW(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=C(this,Cs))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=C(this,Cs))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),C(this,_o).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,Cs)&&(C(this,Mf)?C(this,Cs).cancel({revert:!0}):C(this,Cs).cancelRetry()),this.scheduleGc()),C(this,_o).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||B(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,Cs))return C(this,Cs).continueRetry(),C(this,Cs).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,Mf,!0),r.signal)})},i=()=>{const l=NW(this.options,n),d={client:C(this,Nf),queryKey:this.queryKey,meta:this.meta};return s(d),$(this,Mf,!1),this.options.persister?this.options.persister(l,d,this):l(d)},a={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:C(this,Nf),state:this.state,fetchFn:i};s(a),(c=this.options.behavior)==null||c.onFetch(a,this),$(this,Qm,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=a.fetchOptions)==null?void 0:u.meta))&&B(this,na,Kl).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta});const o=l=>{var d,m,p,h;QP(l)&&l.silent||B(this,na,Kl).call(this,{type:"error",error:l}),QP(l)||((m=(d=C(this,_o).config).onError)==null||m.call(d,l,this),(h=(p=C(this,_o).config).onSettled)==null||h.call(p,this.state.data,l,this)),this.scheduleGc()};return $(this,Cs,LW({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,_o).config).onSuccess)==null||m.call(d,l,this),(h=(p=C(this,_o).config).onSettled)==null||h.call(p,l,this.state.error,this),this.scheduleGc()},onError:o,onFail:(l,d)=>{B(this,na,Kl).call(this,{type:"failed",failureCount:l,error:d})},onPause:()=>{B(this,na,Kl).call(this,{type:"pause"})},onContinue:()=>{B(this,na,Kl).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),C(this,Cs).start()}},Xm=new WeakMap,Qm=new WeakMap,_o=new WeakMap,Nf=new WeakMap,Cs=new WeakMap,hw=new WeakMap,Mf=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,...$W(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 QP(s)&&s.revert&&C(this,Qm)?{...C(this,Qm),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),Ur.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),C(this,_o).notify({query:this,type:"updated",action:e})})},oH);function $W(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:MW(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function ude(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 qa,aH,dde=(aH=class extends _v{constructor(e={}){super();z(this,qa);this.config=e,$(this,qa,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??nL(s,n);let a=this.get(i);return a||(a=new cde({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){C(this,qa).has(e.queryHash)||(C(this,qa).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=C(this,qa).get(e.queryHash);n&&(e.destroy(),n===e&&C(this,qa).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ur.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return C(this,qa).get(e)}getAll(){return[...C(this,qa).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>F3(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>F3(e,r)):n}notify(e){Ur.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Ur.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ur.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},qa=new WeakMap,aH),Ga,Bs,Of,Ka,yu,lH,fde=(lH=class extends IW{constructor(e){super();z(this,Ka);z(this,Ga);z(this,Bs);z(this,Of);this.mutationId=e.mutationId,$(this,Bs,e.mutationCache),$(this,Ga,[]),this.state=e.state||FW(),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,Ga).includes(e)||(C(this,Ga).push(e),this.clearGcTimeout(),C(this,Bs).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){$(this,Ga,C(this,Ga).filter(n=>n!==e)),this.scheduleGc(),C(this,Bs).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){C(this,Ga).length||(this.state.status==="pending"?this.scheduleGc():C(this,Bs).remove(this))}continue(){var e;return((e=C(this,Of))==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,k,R;$(this,Of,LW({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(E,T)=>{B(this,Ka,yu).call(this,{type:"failed",failureCount:E,error:T})},onPause:()=>{B(this,Ka,yu).call(this,{type:"pause"})},onContinue:()=>{B(this,Ka,yu).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>C(this,Bs).canRun(this)}));const n=this.state.status==="pending",r=!C(this,Of).canStart();try{if(!n){B(this,Ka,yu).call(this,{type:"pending",variables:e,isPaused:r}),await((i=(s=C(this,Bs).config).onMutate)==null?void 0:i.call(s,e,this));const T=await((o=(a=this.options).onMutate)==null?void 0:o.call(a,e));T!==this.state.context&&B(this,Ka,yu).call(this,{type:"pending",context:T,variables:e,isPaused:r})}const E=await C(this,Of).start();return await((u=(c=C(this,Bs).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,Bs).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)),B(this,Ka,yu).call(this,{type:"success",data:E}),E}catch(E){try{throw await((g=(y=C(this,Bs).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,Bs).config).onSettled)==null?void 0:A.call(x,void 0,E,this.state.variables,this.state.context,this)),await((R=(k=this.options).onSettled)==null?void 0:R.call(k,void 0,E,e,this.state.context)),E}finally{B(this,Ka,yu).call(this,{type:"error",error:E})}}finally{C(this,Bs).runNext(this)}}},Ga=new WeakMap,Bs=new WeakMap,Of=new WeakMap,Ka=new WeakSet,yu=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),Ur.batch(()=>{C(this,Ga).forEach(r=>{r.onMutationUpdate(e)}),C(this,Bs).notify({mutation:this,type:"updated",action:e})})},lH);function FW(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var sc,ra,pw,cH,hde=(cH=class extends _v{constructor(e={}){super();z(this,sc);z(this,ra);z(this,pw);this.config=e,$(this,sc,new Set),$(this,ra,new Map),$(this,pw,0)}build(e,n,r){const s=new fde({mutationCache:this,mutationId:++bs(this,pw)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){C(this,sc).add(e);const n=Xx(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,sc).delete(e)){const n=Xx(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=Xx(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=Xx(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(){Ur.batch(()=>{C(this,sc).forEach(e=>{this.notify({type:"removed",mutation:e})}),C(this,sc).clear(),C(this,ra).clear()})}getAll(){return Array.from(C(this,sc))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>j3(n,r))}findAll(e={}){return this.getAll().filter(n=>j3(e,n))}notify(e){Ur.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Ur.batch(()=>Promise.all(e.map(n=>n.continue().catch(Ao))))}},sc=new WeakMap,ra=new WeakMap,pw=new WeakMap,cH);function Xx(t){var e;return(e=t.options.scope)==null?void 0:e.id}function U3(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=NW(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 k={client:e.client,queryKey:e.queryKey,pageParam:x,direction:A?"backward":"forward",meta:e.options.meta};y(k);const R=await g(k),{maxPages:E}=e.options,T=A?rde:nde;return{pages:T(w.pages,R,E),pageParams:T(w.pageParams,x,E)}};if(s&&i.length){const w=s==="backward",x=w?pde:H3,A={pages:i,pageParams:a},k=x(r,A);o=await v(A,k,w)}else{const w=t??i.length;do{const x=c===0?a[0]??r.initialPageParam:H3(r,o);if(c>0&&x==null)break;o=await v(o,x),c++}while(c<w)}return o};e.options.persister?e.fetchFn=()=>{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 H3(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 pde(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 lr,$u,Fu,Jm,Zm,ju,eg,tg,uH,mde=(uH=class{constructor(t={}){z(this,lr);z(this,$u);z(this,Fu);z(this,Jm);z(this,Zm);z(this,ju);z(this,eg);z(this,tg);$(this,lr,t.queryCache||new dde),$(this,$u,t.mutationCache||new hde),$(this,Fu,t.defaultOptions||{}),$(this,Jm,new Map),$(this,Zm,new Map),$(this,ju,0)}mount(){bs(this,ju)._++,C(this,ju)===1&&($(this,eg,sL.subscribe(async t=>{t&&(await this.resumePausedMutations(),C(this,lr).onFocus())})),$(this,tg,JE.subscribe(async t=>{t&&(await this.resumePausedMutations(),C(this,lr).onOnline())})))}unmount(){var t,e;bs(this,ju)._--,C(this,ju)===0&&((t=C(this,eg))==null||t.call(this),$(this,eg,void 0),(e=C(this,tg))==null||e.call(this),$(this,tg,void 0))}isFetching(t){return C(this,lr).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return C(this,$u).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=C(this,lr).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=C(this,lr).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Mm(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return C(this,lr).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,lr).get(r.queryHash),i=s==null?void 0:s.state.data,a=ede(e,i);if(a!==void 0)return C(this,lr).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return Ur.batch(()=>C(this,lr).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,lr).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=C(this,lr);Ur.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=C(this,lr);return Ur.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Ur.batch(()=>C(this,lr).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Ao).catch(Ao)}invalidateQueries(t,e={}){return Ur.batch(()=>(C(this,lr).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=Ur.batch(()=>C(this,lr).findAll(t).filter(s=>!s.isDisabled()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Ao)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ao)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=C(this,lr).build(this,e);return n.isStaleByTime(Mm(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Ao).catch(Ao)}fetchInfiniteQuery(t){return t.behavior=U3(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Ao).catch(Ao)}ensureInfiniteQueryData(t){return t.behavior=U3(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return JE.isOnline()?C(this,$u).resumePausedMutations():Promise.resolve()}getQueryCache(){return C(this,lr)}getMutationCache(){return C(this,$u)}getDefaultOptions(){return C(this,Fu)}setDefaultOptions(t){$(this,Fu,t)}setQueryDefaults(t,e){C(this,Jm).set(Vh(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...C(this,Jm).values()],n={};return e.forEach(r=>{Hb(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){C(this,Zm).set(Vh(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...C(this,Zm).values()],n={};return e.forEach(r=>{Hb(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...C(this,Fu).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=nL(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===rL&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...C(this,Fu).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){C(this,lr).clear(),C(this,$u).clear()}},lr=new WeakMap,$u=new WeakMap,Fu=new WeakMap,Jm=new WeakMap,Zm=new WeakMap,ju=new WeakMap,eg=new WeakMap,tg=new WeakMap,uH),ci,zt,mw,Us,Lf,ng,zu,Ya,gw,rg,sg,If,$f,Bu,ig,on,$y,_D,xD,SD,ED,CD,AD,RD,jW,dH,gde=(dH=class extends _v{constructor(e,n){super();z(this,on);z(this,ci);z(this,zt);z(this,mw);z(this,Us);z(this,Lf);z(this,ng);z(this,zu);z(this,Ya);z(this,gw);z(this,rg);z(this,sg);z(this,If);z(this,$f);z(this,Bu);z(this,ig,new Set);this.options=n,$(this,ci,e),$(this,Ya,null),$(this,zu,wD()),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,zt).addObserver(this),W3(C(this,zt),this.options)?B(this,on,$y).call(this):this.updateResult(),B(this,on,ED).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return PD(C(this,zt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return PD(C(this,zt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,B(this,on,CD).call(this),B(this,on,AD).call(this),C(this,zt).removeObserver(this)}setOptions(e){const n=this.options,r=C(this,zt);if(this.options=C(this,ci).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof wa(this.options.enabled,C(this,zt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");B(this,on,RD).call(this),C(this,zt).setOptions(this.options),n._defaulted&&!QE(this.options,n)&&C(this,ci).getQueryCache().notify({type:"observerOptionsUpdated",query:C(this,zt),observer:this});const s=this.hasListeners();s&&V3(C(this,zt),r,this.options,n)&&B(this,on,$y).call(this),this.updateResult(),s&&(C(this,zt)!==r||wa(this.options.enabled,C(this,zt))!==wa(n.enabled,C(this,zt))||Mm(this.options.staleTime,C(this,zt))!==Mm(n.staleTime,C(this,zt)))&&B(this,on,_D).call(this);const i=B(this,on,xD).call(this);s&&(C(this,zt)!==r||wa(this.options.enabled,C(this,zt))!==wa(n.enabled,C(this,zt))||i!==C(this,Bu))&&B(this,on,SD).call(this,i)}getOptimisticResult(e){const n=C(this,ci).getQueryCache().build(C(this,ci),e),r=this.createResult(n,e);return yde(this,r)&&($(this,Us,r),$(this,ng,this.options),$(this,Lf,C(this,zt).state)),r}getCurrentResult(){return C(this,Us)}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,ig).add(e)}getCurrentQuery(){return C(this,zt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=C(this,ci).defaultQueryOptions(e),r=C(this,ci).getQueryCache().build(C(this,ci),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return B(this,on,$y).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),C(this,Us)))}createResult(e,n){var E;const r=C(this,zt),s=this.options,i=C(this,Us),a=C(this,Lf),o=C(this,ng),u=e!==r?e.state:C(this,mw),{state:f}=e;let l={...f},d=!1,m;if(n._optimisticResults){const T=this.hasListeners(),D=!T&&W3(e,n),M=T&&V3(e,r,n,s);(D||M)&&(l={...l,...$W(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,gw))m=C(this,rg);else try{$(this,gw,n.select),m=n.select(l.data),m=bD(i==null?void 0:i.data,m,n),$(this,rg,m),$(this,Ya,null)}catch(T){$(this,Ya,T)}else m=l.data;if(n.placeholderData!==void 0&&m===void 0&&y==="pending"){let T;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData))T=i.data;else if(T=typeof n.placeholderData=="function"?n.placeholderData((E=C(this,sg))==null?void 0:E.state.data,C(this,sg)):n.placeholderData,n.select&&T!==void 0)try{T=n.select(T),$(this,Ya,null)}catch(D){$(this,Ya,D)}T!==void 0&&(y="success",m=bD(i==null?void 0:i.data,T,n),d=!0)}C(this,Ya)&&(p=C(this,Ya),m=C(this,rg),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:iL(e,n),refetch:this.refetch,promise:C(this,zu)};if(this.options.experimental_prefetchInRender){const T=L=>{R.status==="error"?L.reject(R.error):R.data!==void 0&&L.resolve(R.data)},D=()=>{const L=$(this,zu,R.promise=wD());T(L)},M=C(this,zu);switch(M.status){case"pending":e.queryHash===r.queryHash&&T(M);break;case"fulfilled":(R.status==="error"||R.data!==M.value)&&D();break;case"rejected":(R.status!=="error"||R.error!==M.reason)&&D();break}}return R}updateResult(){const e=C(this,Us),n=this.createResult(C(this,zt),this.options);if($(this,Lf,C(this,zt).state),$(this,ng,this.options),C(this,Lf).data!==void 0&&$(this,sg,C(this,zt)),QE(n,e))return;$(this,Us,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!C(this,ig).size)return!0;const a=new Set(i??C(this,ig));return this.options.throwOnError&&a.add("error"),Object.keys(C(this,Us)).some(o=>{const c=o;return C(this,Us)[c]!==e[c]&&a.has(c)})};B(this,on,jW).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&B(this,on,ED).call(this)}},ci=new WeakMap,zt=new WeakMap,mw=new WeakMap,Us=new WeakMap,Lf=new WeakMap,ng=new WeakMap,zu=new WeakMap,Ya=new WeakMap,gw=new WeakMap,rg=new WeakMap,sg=new WeakMap,If=new WeakMap,$f=new WeakMap,Bu=new WeakMap,ig=new WeakMap,on=new WeakSet,$y=function(e){B(this,on,RD).call(this);let n=C(this,zt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Ao)),n},_D=function(){B(this,on,CD).call(this);const e=Mm(this.options.staleTime,C(this,zt));if(Wh||C(this,Us).isStale||!vD(e))return;const r=kW(C(this,Us).dataUpdatedAt,e)+1;$(this,If,setTimeout(()=>{C(this,Us).isStale||this.updateResult()},r))},xD=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(C(this,zt)):this.options.refetchInterval)??!1},SD=function(e){B(this,on,AD).call(this),$(this,Bu,e),!(Wh||wa(this.options.enabled,C(this,zt))===!1||!vD(C(this,Bu))||C(this,Bu)===0)&&$(this,$f,setInterval(()=>{(this.options.refetchIntervalInBackground||sL.isFocused())&&B(this,on,$y).call(this)},C(this,Bu)))},ED=function(){B(this,on,_D).call(this),B(this,on,SD).call(this,B(this,on,xD).call(this))},CD=function(){C(this,If)&&(clearTimeout(C(this,If)),$(this,If,void 0))},AD=function(){C(this,$f)&&(clearInterval(C(this,$f)),$(this,$f,void 0))},RD=function(){const e=C(this,ci).getQueryCache().build(C(this,ci),this.options);if(e===C(this,zt))return;const n=C(this,zt);$(this,zt,e),$(this,mw,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},jW=function(e){Ur.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(C(this,Us))}),C(this,ci).getQueryCache().notify({query:C(this,zt),type:"observerResultsUpdated"})})},dH);function vde(t,e){return wa(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function W3(t,e){return vde(t,e)||t.state.data!==void 0&&PD(t,e,e.refetchOnMount)}function PD(t,e,n){if(wa(e.enabled,t)!==!1){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&iL(t,e)}return!1}function V3(t,e,n,r){return(t!==e||wa(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&iL(t,n)}function iL(t,e){return wa(e.enabled,t)!==!1&&t.isStaleByTime(Mm(e.staleTime,t))}function yde(t,e){return!QE(t.getCurrentResult(),e)}var Uu,Hu,ui,ic,Fc,BS,TD,fH,bde=(fH=class extends _v{constructor(n,r){super();z(this,Fc);z(this,Uu);z(this,Hu);z(this,ui);z(this,ic);$(this,Uu,n),this.setOptions(r),this.bindMethods(),B(this,Fc,BS).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,Uu).defaultMutationOptions(n),QE(this.options,r)||C(this,Uu).getMutationCache().notify({type:"observerOptionsUpdated",mutation:C(this,ui),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Vh(r.mutationKey)!==Vh(this.options.mutationKey)?this.reset():((s=C(this,ui))==null?void 0:s.state.status)==="pending"&&C(this,ui).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=C(this,ui))==null||n.removeObserver(this)}onMutationUpdate(n){B(this,Fc,BS).call(this),B(this,Fc,TD).call(this,n)}getCurrentResult(){return C(this,Hu)}reset(){var n;(n=C(this,ui))==null||n.removeObserver(this),$(this,ui,void 0),B(this,Fc,BS).call(this),B(this,Fc,TD).call(this)}mutate(n,r){var s;return $(this,ic,r),(s=C(this,ui))==null||s.removeObserver(this),$(this,ui,C(this,Uu).getMutationCache().build(C(this,Uu),this.options)),C(this,ui).addObserver(this),C(this,ui).execute(n)}},Uu=new WeakMap,Hu=new WeakMap,ui=new WeakMap,ic=new WeakMap,Fc=new WeakSet,BS=function(){var r;const n=((r=C(this,ui))==null?void 0:r.state)??FW();$(this,Hu,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},TD=function(n){Ur.batch(()=>{var r,s,i,a,o,c,u,f;if(C(this,ic)&&this.hasListeners()){const l=C(this,Hu).variables,d=C(this,Hu).context;(n==null?void 0:n.type)==="success"?((s=(r=C(this,ic)).onSuccess)==null||s.call(r,n.data,l,d),(a=(i=C(this,ic)).onSettled)==null||a.call(i,n.data,null,l,d)):(n==null?void 0:n.type)==="error"&&((c=(o=C(this,ic)).onError)==null||c.call(o,n.error,l,d),(f=(u=C(this,ic)).onSettled)==null||f.call(u,void 0,n.error,l,d))}this.listeners.forEach(l=>{l(C(this,Hu))})})},fH),zW=_.createContext(void 0),BW=t=>{const e=_.useContext(zW);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},wde=({client:t,children:e})=>(_.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),P.jsx(zW.Provider,{value:t,children:e})),UW=_.createContext(!1),_de=()=>_.useContext(UW);UW.Provider;function xde(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Sde=_.createContext(xde()),Ede=()=>_.useContext(Sde);function HW(t,e){return typeof t=="function"?t(...e):!!t}function kD(){}var Cde=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},Ade=t=>{_.useEffect(()=>{t.clearReset()},[t])},Rde=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||HW(n,[t.error,r])),Pde=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)))},Tde=(t,e)=>t.isLoading&&t.isFetching&&!e,kde=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,q3=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function Dde(t,e,n){var l,d,m,p,h;const r=BW(),s=_de(),i=Ede(),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",Pde(a),Cde(a,i),Ade(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(Ur.batchCalls(y)):kD;return c.updateResult(),g},[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),_.useEffect(()=>{c.setOptions(a)},[a,c]),kde(a,u))throw q3(a,c,i);if(Rde({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&&!Wh&&Tde(u,s)){const y=o?q3(a,c,i):(h=r.getQueryCache().get(a.queryHash))==null?void 0:h.promise;y==null||y.catch(kD).finally(()=>{c.updateResult()})}return a.notifyOnChangeProps?u:c.trackResult(u)}function WW(t,e){return Dde(t,gde)}function Nde(t,e){const n=BW(),[r]=_.useState(()=>new bde(n,t));_.useEffect(()=>{r.setOptions(t)},[r,t]);const s=_.useSyncExternalStore(_.useCallback(a=>r.subscribe(Ur.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=_.useCallback((a,o)=>{r.mutate(a,o).catch(kD)},[r]);if(s.error&&HW(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}class Uo{constructor(e=[]){He(this,"segments",[]);this.segments=e}key(){return this.segments}get(){return this.segments}}class Fd extends Uo{params(e){return new Uo([...this.segments,e])}}class Mde extends Uo{id(e){return new Fd([...this.segments,e?String(e):void 0])}}class Ode extends Uo{ids(...e){return new Fd([...this.segments,...e.length?[e.map(n=>String(n))]:[]])}}class Lde extends Uo{action(e){if(["one","report"].includes(e))return new Mde([...this.segments,e]);if(e==="many")return new Ode([...this.segments,e]);if(["list","infinite"].includes(e))return new Fd([...this.segments,e]);throw new Error("Invalid action type")}}class Ide extends Uo{resource(e){return new Lde([...this.segments,e])}mutation(e){return new Fd([...e==="custom"?this.segments:[this.segments[0]],e])}}class $de extends Uo{action(e){return new Fd([...this.segments,e])}}class Fde extends Uo{action(e){return new Fd([...this.segments,e])}}class jde extends Uo{resource(e){return new Fde([...this.segments,e])}}class zde extends Uo{action(e){return new Fd([...this.segments,e])}}class Bde extends Uo{resource(e){return new zde([...this.segments,e])}action(e){return new Fd([...this.segments,e])}}class Ude extends Uo{data(e){return new Ide(["data",e||"default"])}auth(){return new $de(["auth"])}access(){return new jde(["access"])}audit(){return new Bde(["audit"])}}const Hde=()=>new Ude([]),VW=()=>Hde,qW=t=>{const e=VW(),{getProfile:n}=TW();return WW({queryKey:e().auth().action("profile").get(),queryFn:n,...t})},Wde=t=>{const e=VW(),{check:n}=TW();return WW({queryKey:e().auth().action("check").get(),queryFn:n,retry:!1,...t})};function Vde(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 Tn(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,qde(s,...e)]}function qde(...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 Gde(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function n_(...t){return e=>t.forEach(n=>Gde(n,e))}function tt(...t){return _.useCallback(n_(...t),t)}var Ra=_.forwardRef((t,e)=>{const{children:n,...r}=t,s=_.Children.toArray(n),i=s.find(Kde);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(DD,{...r,ref:e,children:_.isValidElement(a)?_.cloneElement(a,void 0,o):null})}return P.jsx(DD,{...r,ref:e,children:n})});Ra.displayName="Slot";var DD=_.forwardRef((t,e)=>{const{children:n,...r}=t;if(_.isValidElement(n)){const s=Xde(n);return _.cloneElement(n,{...Yde(r,n.props),ref:e?n_(e,s):s})}return _.Children.count(n)>1?_.Children.only(null):null});DD.displayName="SlotClone";var oL=({children:t})=>P.jsx(P.Fragment,{children:t});function Kde(t){return _.isValidElement(t)&&t.type===oL}function Yde(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 Xde(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 Xc(t){const e=t+"CollectionProvider",[n,r]=Tn(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(Ra,{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(Ra,{[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 Ut(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 sr({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,s]=Qde({defaultProp:e,onChange:n}),i=t!==void 0,a=i?t:r,o=Ut(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 Qde({defaultProp:t,onChange:e}){const n=_.useState(t),[r]=n,s=_.useRef(r),i=Ut(e);return _.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}var Jde=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],De=Jde.reduce((t,e)=>{const n=_.forwardRef((r,s)=>{const{asChild:i,...a}=r,o=i?Ra: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 Wb(t,e){t&&Ns.flushSync(()=>t.dispatchEvent(e))}var Ln=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{};function Zde(t,e){return _.useReducer((n,r)=>e[n][r]??n,t)}var Hn=t=>{const{present:e,children:n}=t,r=efe(e),s=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),i=tt(r.ref,tfe(s));return typeof n=="function"||r.isPresent?_.cloneElement(s,{ref:i}):null};Hn.displayName="Presence";function efe(t){const[e,n]=_.useState(),r=_.useRef({}),s=_.useRef(t),i=_.useRef("none"),a=t?"mounted":"unmounted",[o,c]=Zde(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const u=Qx(r.current);i.current=o==="mounted"?u:"none"},[o]),Ln(()=>{const u=r.current,f=s.current;if(f!==t){const d=i.current,m=Qx(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]),Ln(()=>{if(e){const u=l=>{const m=Qx(r.current).includes(l.animationName);l.target===e&&m&&Ns.flushSync(()=>c("ANIMATION_END"))},f=l=>{l.target===e&&(i.current=Qx(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 Qx(t){return(t==null?void 0:t.animationName)||"none"}function tfe(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 nfe=X0.useId||(()=>{}),rfe=0;function Vr(t){const[e,n]=_.useState(nfe());return Ln(()=>{n(r=>r??String(rfe++))},[t]),e?`radix-${e}`:""}var aL="Collapsible",[sfe,GW]=Tn(aL),[ife,lL]=sfe(aL),KW=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:a,...o}=t,[c=!1,u]=sr({prop:r,defaultProp:s,onChange:a});return P.jsx(ife,{scope:n,disabled:i,contentId:Vr(),open:c,onOpenToggle:_.useCallback(()=>u(f=>!f),[u]),children:P.jsx(De.div,{"data-state":uL(c),"data-disabled":i?"":void 0,...o,ref:e})})});KW.displayName=aL;var YW="CollapsibleTrigger",XW=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,s=lL(YW,n);return P.jsx(De.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":uL(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:e,onClick:me(t.onClick,s.onOpenToggle)})});XW.displayName=YW;var cL="CollapsibleContent",QW=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=lL(cL,t.__scopeCollapsible);return P.jsx(Hn,{present:n||s.open,children:({present:i})=>P.jsx(ofe,{...r,ref:e,present:i})})});QW.displayName=cL;var ofe=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=t,a=lL(cL,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)},[]),Ln(()=>{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(De.div,{"data-state":uL(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 uL(t){return t?"open":"closed"}var afe=KW,lfe=XW,cfe=QW,ufe=_.createContext(void 0);function Ma(t){const e=_.useContext(ufe);return t||e||"ltr"}var Qc="Accordion",dfe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[dL,ffe,hfe]=Xc(Qc),[OC,RHe]=Tn(Qc,[hfe,GW]),fL=GW(),pfe=se.forwardRef((t,e)=>{const{type:n,...r}=t,s=r,i=r;return P.jsx(dL.Provider,{scope:t.__scopeAccordion,children:n==="multiple"?P.jsx(yfe,{...i,ref:e}):P.jsx(vfe,{...s,ref:e})})});pfe.displayName=Qc;var[JW,mfe]=OC(Qc),[ZW,gfe]=OC(Qc,{collapsible:!1}),vfe=se.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:i=!1,...a}=t,[o,c]=sr({prop:n,defaultProp:r,onChange:s});return P.jsx(JW,{scope:t.__scopeAccordion,value:o?[o]:[],onItemOpen:c,onItemClose:se.useCallback(()=>i&&c(""),[i,c]),children:P.jsx(ZW,{scope:t.__scopeAccordion,collapsible:i,children:P.jsx(eV,{...a,ref:e})})})}),yfe=se.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=t,[a=[],o]=sr({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(JW,{scope:t.__scopeAccordion,value:a,onItemOpen:c,onItemClose:u,children:P.jsx(ZW,{scope:t.__scopeAccordion,collapsible:!0,children:P.jsx(eV,{...i,ref:e})})})}),[bfe,LC]=OC(Qc),eV=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=ffe(n),l=Ma(s)==="ltr",d=me(t.onKeyDown,m=>{var E;if(!dfe.includes(m.key))return;const p=m.target,h=u().filter(T=>{var D;return!((D=T.ref.current)!=null&&D.disabled)}),y=h.findIndex(T=>T.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)},k=()=>{v=y-1,v<w&&(v=x)};switch(m.key){case"Home":v=w;break;case"End":v=x;break;case"ArrowRight":i==="horizontal"&&(l?A():k());break;case"ArrowDown":i==="vertical"&&A();break;case"ArrowLeft":i==="horizontal"&&(l?k():A());break;case"ArrowUp":i==="vertical"&&k();break}const R=v%g;(E=h[R].ref.current)==null||E.focus()});return P.jsx(bfe,{scope:n,disabled:r,direction:s,orientation:i,children:P.jsx(dL.Slot,{scope:n,children:P.jsx(De.div,{...a,"data-orientation":i,ref:c,onKeyDown:r?void 0:d})})})}),ZE="AccordionItem",[wfe,hL]=OC(ZE),tV=se.forwardRef((t,e)=>{const{__scopeAccordion:n,value:r,...s}=t,i=LC(ZE,n),a=mfe(ZE,n),o=fL(n),c=Vr(),u=r&&a.value.includes(r)||!1,f=i.disabled||t.disabled;return P.jsx(wfe,{scope:n,open:u,disabled:f,triggerId:c,children:P.jsx(afe,{"data-orientation":i.orientation,"data-state":aV(u),...o,...s,ref:e,disabled:f,open:u,onOpenChange:l=>{l?a.onItemOpen(r):a.onItemClose(r)}})})});tV.displayName=ZE;var nV="AccordionHeader",rV=se.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=LC(Qc,n),i=hL(nV,n);return P.jsx(De.h3,{"data-orientation":s.orientation,"data-state":aV(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:e})});rV.displayName=nV;var ND="AccordionTrigger",sV=se.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=LC(Qc,n),i=hL(ND,n),a=gfe(ND,n),o=fL(n);return P.jsx(dL.ItemSlot,{scope:n,children:P.jsx(lfe,{"aria-disabled":i.open&&!a.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...o,...r,ref:e})})});sV.displayName=ND;var iV="AccordionContent",oV=se.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=LC(Qc,n),i=hL(iV,n),a=fL(n);return P.jsx(cfe,{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}})});oV.displayName=iV;function aV(t){return t?"open":"closed"}var _fe=tV,xfe=rV,lV=sV,cV=oV;/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Sfe=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),uV=(...t)=>t.filter((e,n,r)=>!!e&&r.indexOf(e)===n).join(" ");/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/var Efe={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Cfe=_.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...o},c)=>_.createElement("svg",{ref:c,...Efe,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:uV("lucide",s),...o},[...a.map(([u,f])=>_.createElement(u,f)),...Array.isArray(i)?i:[i]]));/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const es=(t,e)=>{const n=_.forwardRef(({className:r,...s},i)=>_.createElement(Cfe,{ref:i,iconNode:e,className:uV(`lucide-${Sfe(t)}`,r),...s}));return n.displayName=`${t}`,n};/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Afe=es("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const r_=es("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const IC=es("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const pL=es("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const s_=es("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Rfe=es("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Pfe=es("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Tfe=es("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const $C=es("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const kfe=es("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Dfe=es("Loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Nfe=es("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Mfe=es("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ofe=es("Package2",[["path",{d:"M3 9h18v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9Z",key:"1ront0"}],["path",{d:"m3 9 2.45-4.9A2 2 0 0 1 7.24 3h9.52a2 2 0 0 1 1.8 1.1L21 9",key:"19h2x1"}],["path",{d:"M12 3v6",key:"1holv5"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Lfe=es("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ife=es("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const $fe=es("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const mL=es("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function dV(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=dV(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function hp(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=dV(t))&&(r&&(r+=" "),r+=e);return r}const gL="-",Ffe=t=>{const e=zfe(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{const o=a.split(gL);return o[0]===""&&o.length!==1&&o.shift(),fV(o,e)||jfe(a)},getConflictingClassGroupIds:(a,o)=>{const c=n[a]||[];return o&&r[a]?[...c,...r[a]]:c}}},fV=(t,e)=>{var a;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),s=r?fV(t.slice(1),r):void 0;if(s)return s;if(e.validators.length===0)return;const i=t.join(gL);return(a=e.validators.find(({validator:o})=>o(i)))==null?void 0:a.classGroupId},G3=/^\[(.+)\]$/,jfe=t=>{if(G3.test(t)){const e=G3.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},zfe=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return Ufe(Object.entries(t.classGroups),n).forEach(([i,a])=>{MD(a,r,i,e)}),r},MD=(t,e,n,r)=>{t.forEach(s=>{if(typeof s=="string"){const i=s===""?e:K3(e,s);i.classGroupId=n;return}if(typeof s=="function"){if(Bfe(s)){MD(s(r),e,n,r);return}e.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,a])=>{MD(a,K3(e,i),n,r)})})},K3=(t,e)=>{let n=t;return e.split(gL).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Bfe=t=>t.isThemeGetter,Ufe=(t,e)=>e?t.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,o])=>[e+a,o])):i);return[n,s]}):t,Hfe=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const s=(i,a)=>{n.set(i,a),e++,e>t&&(e=0,r=n,n=new Map)};return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=r.get(i))!==void 0)return s(i,a),a},set(i,a){n.has(i)?n.set(i,a):s(i,a)}}},hV="!",Wfe=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,s=e[0],i=e.length,a=o=>{const c=[];let u=0,f=0,l;for(let y=0;y<o.length;y++){let g=o[y];if(u===0){if(g===s&&(r||o.slice(y,y+i)===e)){c.push(o.slice(f,y)),f=y+i;continue}if(g==="/"){l=y;continue}}g==="["?u++:g==="]"&&u--}const d=c.length===0?o:o.substring(f),m=d.startsWith(hV),p=m?d.substring(1):d,h=l&&l>f?l-f:void 0;return{modifiers:c,hasImportantModifier:m,baseClassName:p,maybePostfixModifierPosition:h}};return n?o=>n({className:o,parseClassName:a}):a},Vfe=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},qfe=t=>({cache:Hfe(t.cacheSize),parseClassName:Wfe(t),...Ffe(t)}),Gfe=/\s+/,Kfe=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=e,i=[],a=t.trim().split(Gfe);let o="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{modifiers:f,hasImportantModifier:l,baseClassName:d,maybePostfixModifierPosition:m}=n(u);let p=!!m,h=r(p?d.substring(0,m):d);if(!h){if(!p){o=u+(o.length>0?" "+o:o);continue}if(h=r(d),!h){o=u+(o.length>0?" "+o:o);continue}p=!1}const y=Vfe(f).join(":"),g=l?y+hV:y,v=g+h;if(i.includes(v))continue;i.push(v);const w=s(h,p);for(let x=0;x<w.length;++x){const A=w[x];i.push(g+A)}o=u+(o.length>0?" "+o:o)}return o};function Yfe(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=pV(e))&&(r&&(r+=" "),r+=n);return r}const pV=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=pV(t[r]))&&(n&&(n+=" "),n+=e);return n};function Xfe(t,...e){let n,r,s,i=a;function a(c){const u=e.reduce((f,l)=>l(f),t());return n=qfe(u),r=n.cache.get,s=n.cache.set,i=o,o(c)}function o(c){const u=r(c);if(u)return u;const f=Kfe(c,n);return s(c,f),f}return function(){return i(Yfe.apply(null,arguments))}}const Fn=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},mV=/^\[(?:([a-z-]+):)?(.+)\]$/i,Qfe=/^\d+\/\d+$/,Jfe=new Set(["px","full","screen"]),Zfe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ehe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,the=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,nhe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,rhe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Hl=t=>Om(t)||Jfe.has(t)||Qfe.test(t),pu=t=>xv(t,"length",dhe),Om=t=>!!t&&!Number.isNaN(Number(t)),JP=t=>xv(t,"number",Om),my=t=>!!t&&Number.isInteger(Number(t)),she=t=>t.endsWith("%")&&Om(t.slice(0,-1)),St=t=>mV.test(t),mu=t=>Zfe.test(t),ihe=new Set(["length","size","percentage"]),ohe=t=>xv(t,ihe,gV),ahe=t=>xv(t,"position",gV),lhe=new Set(["image","url"]),che=t=>xv(t,lhe,hhe),uhe=t=>xv(t,"",fhe),gy=()=>!0,xv=(t,e,n)=>{const r=mV.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},dhe=t=>ehe.test(t)&&!the.test(t),gV=()=>!1,fhe=t=>nhe.test(t),hhe=t=>rhe.test(t),phe=()=>{const t=Fn("colors"),e=Fn("spacing"),n=Fn("blur"),r=Fn("brightness"),s=Fn("borderColor"),i=Fn("borderRadius"),a=Fn("borderSpacing"),o=Fn("borderWidth"),c=Fn("contrast"),u=Fn("grayscale"),f=Fn("hueRotate"),l=Fn("invert"),d=Fn("gap"),m=Fn("gradientColorStops"),p=Fn("gradientColorStopPositions"),h=Fn("inset"),y=Fn("margin"),g=Fn("opacity"),v=Fn("padding"),w=Fn("saturate"),x=Fn("scale"),A=Fn("sepia"),k=Fn("skew"),R=Fn("space"),E=Fn("translate"),T=()=>["auto","contain","none"],D=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",St,e],L=()=>[St,e],I=()=>["",Hl,pu],F=()=>["auto",Om,St],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Y=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],H=()=>["start","end","center","between","around","evenly","stretch"],ee=()=>["","0",St],re=()=>["auto","avoid","all","avoid-page","page","left","right","column"],X=()=>[Om,St];return{cacheSize:500,separator:":",theme:{colors:[gy],spacing:[Hl,pu],blur:["none","",mu,St],brightness:X(),borderColor:[t],borderRadius:["none","","full",mu,St],borderSpacing:L(),borderWidth:I(),contrast:X(),grayscale:ee(),hueRotate:X(),invert:ee(),gap:L(),gradientColorStops:[t],gradientColorStopPositions:[she,pu],inset:M(),margin:M(),opacity:X(),padding:L(),saturate:X(),scale:X(),sepia:ee(),skew:X(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",St]}],container:["container"],columns:[{columns:[mu]}],"break-after":[{"break-after":re()}],"break-before":[{"break-before":re()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...U(),St]}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",my,St]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",St]}],grow:[{grow:ee()}],shrink:[{shrink:ee()}],order:[{order:["first","last","none",my,St]}],"grid-cols":[{"grid-cols":[gy]}],"col-start-end":[{col:["auto",{span:["full",my,St]},St]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[gy]}],"row-start-end":[{row:["auto",{span:[my,St]},St]}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",St]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",St]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...H()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...H(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...H(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",St,e]}],"min-w":[{"min-w":[St,e,"min","max","fit"]}],"max-w":[{"max-w":[St,e,"none","full","min","max","fit","prose",{screen:[mu]},mu]}],h:[{h:[St,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[St,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[St,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[St,e,"auto","min","max","fit"]}],"font-size":[{text:["base",mu,pu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",JP]}],"font-family":[{font:[gy]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",St]}],"line-clamp":[{"line-clamp":["none",Om,JP]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Hl,St]}],"list-image":[{"list-image":["none",St]}],"list-style-type":[{list:["none","disc","decimal",St]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Hl,pu]}],"underline-offset":[{"underline-offset":["auto",Hl,St]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",St]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",St]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...U(),ahe]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ohe]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},che]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...Y(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:Y()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...Y()]}],"outline-offset":[{"outline-offset":[Hl,St]}],"outline-w":[{outline:[Hl,pu]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:I()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[Hl,pu]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",mu,uhe]}],"shadow-color":[{shadow:[gy]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",mu,St]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[l]}],saturate:[{saturate:[w]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[l]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",St]}],duration:[{duration:X()}],ease:[{ease:["linear","in","out","in-out",St]}],delay:[{delay:X()}],animate:[{animate:["none","spin","ping","pulse","bounce",St]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[my,St]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",St]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",St]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",St]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Hl,pu,JP]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},mhe=Xfe(phe);function ce(...t){return mhe(hp(t))}const ghe=_.forwardRef(({className:t,...e},n)=>P.jsx(_fe,{ref:n,className:ce("border-b",t),...e}));ghe.displayName="AccordionItem";const vhe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsx(xfe,{className:"flex",children:P.jsxs(lV,{ref:r,className:ce("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",t),...n,children:[e,P.jsx(IC,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));vhe.displayName=lV.displayName;const yhe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsx(cV,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:P.jsx("div",{className:ce("pb-4 pt-0",t),children:e})}));yhe.displayName=cV.displayName;const Y3=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,X3=hp,Ho=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return X3(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=e,a=Object.keys(s).map(u=>{const f=n==null?void 0:n[u],l=i==null?void 0:i[u];if(f===null)return null;const d=Y3(f)||Y3(l);return s[u][d]}),o=n&&Object.entries(n).reduce((u,f)=>{let[l,d]=f;return d===void 0||(u[l]=d),u},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,f)=>{let{class:l,className:d,...m}=f;return Object.entries(m).every(p=>{let[h,y]=p;return Array.isArray(y)?y.includes({...i,...o}[h]):{...i,...o}[h]===y})?[...u,l,d]:u},[]);return X3(t,a,c,n==null?void 0:n.class,n==null?void 0:n.className)},bhe=Ho("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),whe=_.forwardRef(({className:t,variant:e,...n},r)=>P.jsx("div",{ref:r,role:"alert",className:ce(bhe({variant:e}),t),...n}));whe.displayName="Alert";const _he=_.forwardRef(({className:t,...e},n)=>P.jsx("h5",{ref:n,className:ce("mb-1 font-medium leading-none tracking-tight",t),...e}));_he.displayName="AlertTitle";const xhe=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:ce("text-sm [&_p]:leading-relaxed",t),...e}));xhe.displayName="AlertDescription";function vV(t,e=globalThis==null?void 0:globalThis.document){const n=Ut(t);_.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var She="DismissableLayer",OD="dismissableLayer.update",Ehe="dismissableLayer.pointerDownOutside",Che="dismissableLayer.focusOutside",Q3,yV=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Jc=_.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,onDismiss:o,...c}=t,u=_.useContext(yV),[f,l]=_.useState(null),d=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=_.useState({}),p=tt(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=Rhe(R=>{const E=R.target,T=[...u.branches].some(D=>D.contains(E));!x||T||(s==null||s(R),a==null||a(R),R.defaultPrevented||o==null||o())},d),k=Phe(R=>{const E=R.target;[...u.branches].some(D=>D.contains(E))||(i==null||i(R),a==null||a(R),R.defaultPrevented||o==null||o())},d);return vV(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&&(Q3=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),J3(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=Q3)}},[f,d,n,u]),_.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),J3())},[f,u]),_.useEffect(()=>{const R=()=>m({});return document.addEventListener(OD,R),()=>document.removeEventListener(OD,R)},[]),P.jsx(De.div,{...c,ref:p,style:{pointerEvents:w?x?"auto":"none":void 0,...t.style},onFocusCapture:me(t.onFocusCapture,k.onFocusCapture),onBlurCapture:me(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:me(t.onPointerDownCapture,A.onPointerDownCapture)})});Jc.displayName=She;var Ahe="DismissableLayerBranch",bV=_.forwardRef((t,e)=>{const n=_.useContext(yV),r=_.useRef(null),s=tt(e,r);return _.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),P.jsx(De.div,{...t,ref:s})});bV.displayName=Ahe;function Rhe(t,e=globalThis==null?void 0:globalThis.document){const n=Ut(t),r=_.useRef(!1),s=_.useRef(()=>{});return _.useEffect(()=>{const i=o=>{if(o.target&&!r.current){let c=function(){wV(Ehe,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 Phe(t,e=globalThis==null?void 0:globalThis.document){const n=Ut(t),r=_.useRef(!1);return _.useEffect(()=>{const s=i=>{i.target&&!r.current&&wV(Che,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 J3(){const t=new CustomEvent(OD);document.dispatchEvent(t)}function wV(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?Wb(s,i):s.dispatchEvent(i)}var The=Jc,khe=bV,ZP="focusScope.autoFocusOnMount",eT="focusScope.autoFocusOnUnmount",Z3={bubbles:!1,cancelable:!0},Dhe="FocusScope",i_=_.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=t,[o,c]=_.useState(null),u=Ut(s),f=Ut(i),l=_.useRef(null),d=tt(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:bu(l.current,{select:!0})},y=function(w){if(m.paused||!o)return;const x=w.relatedTarget;x!==null&&(o.contains(x)||bu(l.current,{select:!0}))},g=function(w){if(document.activeElement===document.body)for(const A of w)A.removedNodes.length>0&&bu(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){tz.add(m);const h=document.activeElement;if(!o.contains(h)){const g=new CustomEvent(ZP,Z3);o.addEventListener(ZP,u),o.dispatchEvent(g),g.defaultPrevented||(Nhe($he(_V(o)),{select:!0}),document.activeElement===h&&bu(o))}return()=>{o.removeEventListener(ZP,u),setTimeout(()=>{const g=new CustomEvent(eT,Z3);o.addEventListener(eT,f),o.dispatchEvent(g),g.defaultPrevented||bu(h??document.body,{select:!0}),o.removeEventListener(eT,f),tz.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]=Mhe(v);w&&x?!h.shiftKey&&g===x?(h.preventDefault(),n&&bu(w,{select:!0})):h.shiftKey&&g===w&&(h.preventDefault(),n&&bu(x,{select:!0})):g===v&&h.preventDefault()}},[n,r,m.paused]);return P.jsx(De.div,{tabIndex:-1,...a,ref:d,onKeyDown:p})});i_.displayName=Dhe;function Nhe(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(bu(r,{select:e}),document.activeElement!==n)return}function Mhe(t){const e=_V(t),n=ez(e,t),r=ez(e.reverse(),t);return[n,r]}function _V(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 ez(t,e){for(const n of t)if(!Ohe(n,{upTo:e}))return n}function Ohe(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 Lhe(t){return t instanceof HTMLInputElement&&"select"in t}function bu(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&Lhe(t)&&e&&t.select()}}var tz=Ihe();function Ihe(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=nz(t,e),t.unshift(e)},remove(e){var n;t=nz(t,e),(n=t[0])==null||n.resume()}}}function nz(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function $he(t){return t.filter(e=>e.tagName!=="A")}var Fhe="Portal",Sv=_.forwardRef((t,e)=>{var o;const{container:n,...r}=t,[s,i]=_.useState(!1);Ln(()=>i(!0),[]);const a=n||s&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?t_.createPortal(P.jsx(De.div,{...r,ref:e}),a):null});Sv.displayName=Fhe;var tT=0;function FC(){_.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??rz()),document.body.insertAdjacentElement("beforeend",t[1]??rz()),tT++,()=>{tT===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),tT--}},[])}function rz(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}var fr=function(){return fr=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},fr.apply(this,arguments)};function jC(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n}function vL(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,i;r<s;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var Lm="right-scroll-bar-position",Im="width-before-scroll-bar",jhe="with-scroll-bars-hidden",zhe="--removed-body-scroll-bar-size";function nT(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function Bhe(t,e){var n=_.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=e,n.facade}var Uhe=typeof window<"u"?_.useLayoutEffect:_.useEffect,sz=new WeakMap;function yL(t,e){var n=Bhe(null,function(r){return t.forEach(function(s){return nT(s,r)})});return Uhe(function(){var r=sz.get(n);if(r){var s=new Set(r),i=new Set(t),a=n.current;s.forEach(function(o){i.has(o)||nT(o,null)}),i.forEach(function(o){s.has(o)||nT(o,a)})}sz.set(n,t)},[t]),n}function Hhe(t){return t}function Whe(t,e){e===void 0&&(e=Hhe);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(i){var a=e(i,r);return n.push(a),function(){n=n.filter(function(o){return o!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(o){return i(o)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var o=n;n=[],o.forEach(i),a=n}var c=function(){var f=a;a=[],f.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(f){a.push(f),u()},filter:function(f){return a=a.filter(f),n}}}};return s}function bL(t){t===void 0&&(t={});var e=Whe(null);return e.options=fr({async:!0,ssr:!1},t),e}var xV=function(t){var e=t.sideCar,n=jC(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return _.createElement(r,fr({},n))};xV.isSideCarExport=!0;function wL(t,e){return t.useMedium(e),xV}var SV=bL(),rT=function(){},zC=_.forwardRef(function(t,e){var n=_.useRef(null),r=_.useState({onScrollCapture:rT,onWheelCapture:rT,onTouchMoveCapture:rT}),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=jC(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=d,A=yL([n,e]),k=fr(fr({},w),s);return _.createElement(_.Fragment,null,f&&_.createElement(x,{sideCar:SV,removeScrollBar:u,shards:l,noIsolation:m,inert:p,setCallbacks:i,allowPinchZoom:!!h,lockRef:n,gapMode:v}),a?_.cloneElement(_.Children.only(o),fr(fr({},k),{ref:A})):_.createElement(g,fr({},k,{className:c,ref:A}),o))});zC.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};zC.classNames={fullWidth:Im,zeroRight:Lm};var Vhe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function qhe(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=Vhe();return e&&t.setAttribute("nonce",e),t}function Ghe(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function Khe(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var Yhe=function(){var t=0,e=null;return{add:function(n){t==0&&(e=qhe())&&(Ghe(e,n),Khe(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Xhe=function(){var t=Yhe();return function(e,n){_.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},BC=function(){var t=Xhe(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},Qhe={left:0,top:0,right:0,gap:0},sT=function(t){return parseInt(t||"",10)||0},Jhe=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],s=e[t==="padding"?"paddingRight":"marginRight"];return[sT(n),sT(r),sT(s)]},Zhe=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Qhe;var e=Jhe(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},epe=BC(),$m="data-scroll-locked",tpe=function(t,e,n,r){var s=t.left,i=t.top,a=t.right,o=t.gap;return n===void 0&&(n="margin"),`
|
||
.`.concat(jhe,` {
|
||
overflow: hidden `).concat(r,`;
|
||
padding-right: `).concat(o,"px ").concat(r,`;
|
||
}
|
||
body[`).concat($m,`] {
|
||
overflow: hidden `).concat(r,`;
|
||
overscroll-behavior: contain;
|
||
`).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
|
||
padding-left: `.concat(s,`px;
|
||
padding-top: `).concat(i,`px;
|
||
padding-right: `).concat(a,`px;
|
||
margin-left:0;
|
||
margin-top:0;
|
||
margin-right: `).concat(o,"px ").concat(r,`;
|
||
`),n==="padding"&&"padding-right: ".concat(o,"px ").concat(r,";")].filter(Boolean).join(""),`
|
||
}
|
||
|
||
.`).concat(Lm,` {
|
||
right: `).concat(o,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(Im,` {
|
||
margin-right: `).concat(o,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(Lm," .").concat(Lm,` {
|
||
right: 0 `).concat(r,`;
|
||
}
|
||
|
||
.`).concat(Im," .").concat(Im,` {
|
||
margin-right: 0 `).concat(r,`;
|
||
}
|
||
|
||
body[`).concat($m,`] {
|
||
`).concat(zhe,": ").concat(o,`px;
|
||
}
|
||
`)},iz=function(){var t=parseInt(document.body.getAttribute($m)||"0",10);return isFinite(t)?t:0},npe=function(){_.useEffect(function(){return document.body.setAttribute($m,(iz()+1).toString()),function(){var t=iz()-1;t<=0?document.body.removeAttribute($m):document.body.setAttribute($m,t.toString())}},[])},_L=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;npe();var i=_.useMemo(function(){return Zhe(s)},[s]);return _.createElement(epe,{styles:tpe(i,!e,s,n?"":"!important")})},LD=!1;if(typeof window<"u")try{var Jx=Object.defineProperty({},"passive",{get:function(){return LD=!0,!0}});window.addEventListener("test",Jx,Jx),window.removeEventListener("test",Jx,Jx)}catch{LD=!1}var $p=LD?{passive:!1}:!1,rpe=function(t){return t.tagName==="TEXTAREA"},EV=function(t,e){var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!rpe(t)&&n[e]==="visible")},spe=function(t){return EV(t,"overflowY")},ipe=function(t){return EV(t,"overflowX")},oz=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=CV(t,r);if(s){var i=AV(t,r),a=i[1],o=i[2];if(a>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ope=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},ape=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},CV=function(t,e){return t==="v"?spe(e):ipe(e)},AV=function(t,e){return t==="v"?ope(e):ape(e)},lpe=function(t,e){return t==="h"&&e==="rtl"?-1:1},cpe=function(t,e,n,r,s){var i=lpe(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=AV(t,o),p=m[0],h=m[1],y=m[2],g=h-y-i*p;(p||g)&&CV(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},Zx=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},az=function(t){return[t.deltaX,t.deltaY]},lz=function(t){return t&&"current"in t?t.current:t},upe=function(t,e){return t[0]===e[0]&&t[1]===e[1]},dpe=function(t){return`
|
||
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
||
`)},fpe=0,Fp=[];function hpe(t){var e=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),s=_.useState(fpe++)[0],i=_.useState(BC)[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=vL([t.lockRef.current],(t.shards||[]).map(lz),!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)return!a.current.allowPinchZoom;var g=Zx(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,k=h.target,R=Math.abs(w)>Math.abs(x)?"h":"v";if("touches"in h&&R==="h"&&k.type==="range")return!1;var E=oz(R,k);if(!E)return!0;if(E?A=R:(A=R==="v"?"h":"v",E=oz(R,k)),!E)return!1;if(!r.current&&"changedTouches"in h&&(w||x)&&(r.current=A),!A)return!0;var T=r.current||A;return cpe(T,y,h,T==="h"?w:x)},[]),c=_.useCallback(function(h){var y=h;if(!(!Fp.length||Fp[Fp.length-1]!==i)){var g="deltaY"in y?az(y):Zx(y),v=e.current.filter(function(A){return A.name===y.type&&(A.target===y.target||y.target===A.shadowParent)&&upe(A.delta,g)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var w=(a.current.shards||[]).map(lz).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:ppe(g)};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(x){return x!==w})},1)},[]),f=_.useCallback(function(h){n.current=Zx(h),r.current=void 0},[]),l=_.useCallback(function(h){u(h.type,az(h),h.target,o(h,t.lockRef.current))},[]),d=_.useCallback(function(h){u(h.type,Zx(h),h.target,o(h,t.lockRef.current))},[]);_.useEffect(function(){return Fp.push(i),t.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:d}),document.addEventListener("wheel",c,$p),document.addEventListener("touchmove",c,$p),document.addEventListener("touchstart",f,$p),function(){Fp=Fp.filter(function(h){return h!==i}),document.removeEventListener("wheel",c,$p),document.removeEventListener("touchmove",c,$p),document.removeEventListener("touchstart",f,$p)}},[]);var m=t.removeScrollBar,p=t.inert;return _.createElement(_.Fragment,null,p?_.createElement(i,{styles:dpe(s)}):null,m?_.createElement(_L,{gapMode:t.gapMode}):null)}function ppe(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const mpe=wL(SV,hpe);var o_=_.forwardRef(function(t,e){return _.createElement(zC,fr({},t,{ref:e,sideCar:mpe}))});o_.classNames=zC.classNames;var gpe=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},jp=new WeakMap,eS=new WeakMap,tS={},iT=0,RV=function(t){return t&&(t.host||RV(t.parentNode))},vpe=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=RV(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},ype=function(t,e,n,r){var s=vpe(e,Array.isArray(t)?t:[t]);tS[n]||(tS[n]=new WeakMap);var i=tS[n],a=[],o=new Set,c=new Set(s),u=function(l){!l||o.has(l)||(o.add(l),u(l.parentNode))};s.forEach(u);var f=function(l){!l||c.has(l)||Array.prototype.forEach.call(l.children,function(d){if(o.has(d))f(d);else try{var m=d.getAttribute(r),p=m!==null&&m!=="false",h=(jp.get(d)||0)+1,y=(i.get(d)||0)+1;jp.set(d,h),i.set(d,y),a.push(d),h===1&&p&&eS.set(d,!0),y===1&&d.setAttribute(n,"true"),p||d.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",d,g)}})};return f(e),o.clear(),iT++,function(){a.forEach(function(l){var d=jp.get(l)-1,m=i.get(l)-1;jp.set(l,d),i.set(l,m),d||(eS.has(l)||l.removeAttribute(r),eS.delete(l)),m||l.removeAttribute(n)}),iT--,iT||(jp=new WeakMap,jp=new WeakMap,eS=new WeakMap,tS={})}},Ev=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=gpe(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),ype(r,s,n,"aria-hidden")):function(){return null}},xL="Dialog",[PV,TV]=Tn(xL),[bpe,Oa]=PV(xL),kV=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]=sr({prop:r,defaultProp:s,onChange:i});return P.jsx(bpe,{scope:e,triggerRef:o,contentRef:c,contentId:Vr(),titleId:Vr(),descriptionId:Vr(),open:u,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(l=>!l),[f]),modal:a,children:n})};kV.displayName=xL;var DV="DialogTrigger",NV=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Oa(DV,n),i=tt(e,s.triggerRef);return P.jsx(De.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":CL(s.open),...r,ref:i,onClick:me(t.onClick,s.onOpenToggle)})});NV.displayName=DV;var SL="DialogPortal",[wpe,MV]=PV(SL,{forceMount:void 0}),OV=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=Oa(SL,e);return P.jsx(wpe,{scope:e,forceMount:n,children:_.Children.map(r,a=>P.jsx(Hn,{present:n||i.open,children:P.jsx(Sv,{asChild:!0,container:s,children:a})}))})};OV.displayName=SL;var e1="DialogOverlay",LV=_.forwardRef((t,e)=>{const n=MV(e1,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Oa(e1,t.__scopeDialog);return i.modal?P.jsx(Hn,{present:r||i.open,children:P.jsx(_pe,{...s,ref:e})}):null});LV.displayName=e1;var _pe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Oa(e1,n);return P.jsx(o_,{as:Ra,allowPinchZoom:!0,shards:[s.contentRef],children:P.jsx(De.div,{"data-state":CL(s.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),qh="DialogContent",IV=_.forwardRef((t,e)=>{const n=MV(qh,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Oa(qh,t.__scopeDialog);return P.jsx(Hn,{present:r||i.open,children:i.modal?P.jsx(xpe,{...s,ref:e}):P.jsx(Spe,{...s,ref:e})})});IV.displayName=qh;var xpe=_.forwardRef((t,e)=>{const n=Oa(qh,t.__scopeDialog),r=_.useRef(null),s=tt(e,n.contentRef,r);return _.useEffect(()=>{const i=r.current;if(i)return Ev(i)},[]),P.jsx($V,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:me(t.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:me(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&i.preventDefault()}),onFocusOutside:me(t.onFocusOutside,i=>i.preventDefault())})}),Spe=_.forwardRef((t,e)=>{const n=Oa(qh,t.__scopeDialog),r=_.useRef(!1),s=_.useRef(!1);return P.jsx($V,{...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()}})}),$V=_.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=t,o=Oa(qh,n),c=_.useRef(null),u=tt(e,c);return FC(),P.jsxs(P.Fragment,{children:[P.jsx(i_,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:P.jsx(Jc,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":CL(o.open),...a,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),P.jsxs(P.Fragment,{children:[P.jsx(Cpe,{titleId:o.titleId}),P.jsx(Rpe,{contentRef:c,descriptionId:o.descriptionId})]})]})}),EL="DialogTitle",FV=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Oa(EL,n);return P.jsx(De.h2,{id:s.titleId,...r,ref:e})});FV.displayName=EL;var jV="DialogDescription",zV=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Oa(jV,n);return P.jsx(De.p,{id:s.descriptionId,...r,ref:e})});zV.displayName=jV;var BV="DialogClose",UV=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Oa(BV,n);return P.jsx(De.button,{type:"button",...r,ref:e,onClick:me(t.onClick,()=>s.onOpenChange(!1))})});UV.displayName=BV;function CL(t){return t?"open":"closed"}var HV="DialogTitleWarning",[Epe,WV]=Vde(HV,{contentName:qh,titleName:EL,docsSlug:"dialog"}),Cpe=({titleId:t})=>{const e=WV(HV),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},Ape="DialogDescriptionWarning",Rpe=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${WV(Ape).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},AL=kV,RL=NV,PL=OV,a_=LV,l_=IV,c_=FV,u_=zV,d_=UV,VV="AlertDialog",[Ppe,PHe]=Tn(VV,[TV]),Zc=TV(),qV=t=>{const{__scopeAlertDialog:e,...n}=t,r=Zc(e);return P.jsx(AL,{...r,...n,modal:!0})};qV.displayName=VV;var Tpe="AlertDialogTrigger",GV=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Zc(n);return P.jsx(RL,{...s,...r,ref:e})});GV.displayName=Tpe;var kpe="AlertDialogPortal",KV=t=>{const{__scopeAlertDialog:e,...n}=t,r=Zc(e);return P.jsx(PL,{...r,...n})};KV.displayName=kpe;var Dpe="AlertDialogOverlay",YV=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Zc(n);return P.jsx(a_,{...s,...r,ref:e})});YV.displayName=Dpe;var Fm="AlertDialogContent",[Npe,Mpe]=Ppe(Fm),XV=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...s}=t,i=Zc(n),a=_.useRef(null),o=tt(e,a),c=_.useRef(null);return P.jsx(Epe,{contentName:Fm,titleName:QV,docsSlug:"alert-dialog",children:P.jsx(Npe,{scope:n,cancelRef:c,children:P.jsxs(l_,{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(oL,{children:r}),P.jsx(Lpe,{contentRef:a})]})})})});XV.displayName=Fm;var QV="AlertDialogTitle",JV=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Zc(n);return P.jsx(c_,{...s,...r,ref:e})});JV.displayName=QV;var ZV="AlertDialogDescription",e6=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Zc(n);return P.jsx(u_,{...s,...r,ref:e})});e6.displayName=ZV;var Ope="AlertDialogAction",t6=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Zc(n);return P.jsx(d_,{...s,...r,ref:e})});t6.displayName=Ope;var n6="AlertDialogCancel",r6=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:s}=Mpe(n6,n),i=Zc(n),a=tt(e,s);return P.jsx(d_,{...i,...r,ref:a})});r6.displayName=n6;var Lpe=({contentRef:t})=>{const e=`\`${Fm}\` requires a description for the component to be accessible for screen reader users.
|
||
|
||
You can add a description to the \`${Fm}\` by passing a \`${ZV}\` 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 \`${Fm}\`. 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},Ipe=qV,$pe=GV,Fpe=KV,s6=YV,i6=XV,o6=t6,a6=r6,l6=JV,c6=e6;const Vb=Ho("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"}}),Ci=_.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...s},i)=>{const a=r?Ra:"button";return P.jsx(a,{className:ce(Vb({variant:e,size:n,className:t})),ref:i,...s})});Ci.displayName="Button";const u6=Ipe,THe=$pe,jpe=Fpe,d6=_.forwardRef(({className:t,...e},n)=>P.jsx(s6,{className:ce("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));d6.displayName=s6.displayName;const TL=_.forwardRef(({className:t,...e},n)=>P.jsxs(jpe,{children:[P.jsx(d6,{}),P.jsx(i6,{ref:n,className:ce("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})]}));TL.displayName=i6.displayName;const kL=({className:t,...e})=>P.jsx("div",{className:ce("flex flex-col space-y-2 text-center sm:text-left",t),...e});kL.displayName="AlertDialogHeader";const DL=({className:t,...e})=>P.jsx("div",{className:ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});DL.displayName="AlertDialogFooter";const NL=_.forwardRef(({className:t,...e},n)=>P.jsx(l6,{ref:n,className:ce("text-lg font-semibold",t),...e}));NL.displayName=l6.displayName;const ML=_.forwardRef(({className:t,...e},n)=>P.jsx(c6,{ref:n,className:ce("text-sm text-muted-foreground",t),...e}));ML.displayName=c6.displayName;const OL=_.forwardRef(({className:t,...e},n)=>P.jsx(o6,{ref:n,className:ce(Vb(),t),...e}));OL.displayName=o6.displayName;const LL=_.forwardRef(({className:t,...e},n)=>P.jsx(a6,{ref:n,className:ce(Vb({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));LL.displayName=a6.displayName;const zpe=({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])},f6=_.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 zpe({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:ce("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)}})});f6.displayName="AutosizeTextarea";var IL="Avatar",[Bpe,kHe]=Tn(IL),[Upe,h6]=Bpe(IL),p6=_.forwardRef((t,e)=>{const{__scopeAvatar:n,...r}=t,[s,i]=_.useState("idle");return P.jsx(Upe,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:i,children:P.jsx(De.span,{...r,ref:e})})});p6.displayName=IL;var m6="AvatarImage",g6=_.forwardRef((t,e)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s=()=>{},...i}=t,a=h6(m6,n),o=Hpe(r),c=Ut(u=>{s(u),a.onImageLoadingStatusChange(u)});return Ln(()=>{o!=="idle"&&c(o)},[o,c]),o==="loaded"?P.jsx(De.img,{...i,ref:e,src:r}):null});g6.displayName=m6;var v6="AvatarFallback",y6=_.forwardRef((t,e)=>{const{__scopeAvatar:n,delayMs:r,...s}=t,i=h6(v6,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(De.span,{...s,ref:e}):null});y6.displayName=v6;function Hpe(t){const[e,n]=_.useState("idle");return Ln(()=>{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 b6=p6,w6=g6,_6=y6;const Wpe=_.forwardRef(({className:t,...e},n)=>P.jsx(b6,{ref:n,className:ce("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...e}));Wpe.displayName=b6.displayName;const Vpe=_.forwardRef(({className:t,...e},n)=>P.jsx(w6,{ref:n,className:ce("aspect-square h-full w-full",t),...e}));Vpe.displayName=w6.displayName;const qpe=_.forwardRef(({className:t,...e},n)=>P.jsx(_6,{ref:n,className:ce("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...e}));qpe.displayName=_6.displayName;const Gpe=Ho("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 Kpe({className:t,variant:e,...n}){return P.jsx("div",{className:ce(Gpe({variant:e}),t),...n})}const mt=t=>typeof t=="string",vy=()=>{let t,e;const n=new Promise((r,s)=>{t=r,e=s});return n.resolve=t,n.reject=e,n},cz=t=>t==null?"":""+t,Ype=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},Xpe=/###/g,uz=t=>t&&t.indexOf("###")>-1?t.replace(Xpe,"."):t,dz=t=>!t||mt(t),mb=(t,e,n)=>{const r=mt(e)?e.split("."):e;let s=0;for(;s<r.length-1;){if(dz(t))return{};const i=uz(r[s]);!t[i]&&n&&(t[i]=new n),Object.prototype.hasOwnProperty.call(t,i)?t=t[i]:t={},++s}return dz(t)?{}:{obj:t,k:uz(r[s])}},fz=(t,e,n)=>{const{obj:r,k:s}=mb(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=mb(t,a,Object);for(;o.obj===void 0&&a.length;)i=`${a[a.length-1]}.${i}`,a=a.slice(0,a.length-1),o=mb(t,a,Object),o&&o.obj&&typeof o.obj[`${o.k}.${i}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${i}`]=n},Qpe=(t,e,n,r)=>{const{obj:s,k:i}=mb(t,e,Object);s[i]=s[i]||[],s[i].push(n)},t1=(t,e)=>{const{obj:n,k:r}=mb(t,e);if(n)return n[r]},Jpe=(t,e,n)=>{const r=t1(t,n);return r!==void 0?r:t1(e,n)},x6=(t,e,n)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?mt(t[r])||t[r]instanceof String||mt(e[r])||e[r]instanceof String?n&&(t[r]=e[r]):x6(t[r],e[r],n):t[r]=e[r]);return t},zp=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Zpe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const eme=t=>mt(t)?t.replace(/[&<>"'\/]/g,e=>Zpe[e]):t;class tme{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 nme=[" ",",","?","!",";"],rme=new tme(20),sme=(t,e,n)=>{e=e||"",n=n||"";const r=nme.filter(a=>e.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const s=rme.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},ID=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<r.length;){if(!s||typeof s!="object")return;let a,o="";for(let c=i;c<r.length;++c)if(c!==i&&(o+=n),o+=r[c],a=s[o],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&c<r.length-1)continue;i+=c-i+1;break}s=a}return s},n1=t=>t&&t.replace("_","-"),ime={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 r1{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||ime,this.options=n,this.debug=n.debug}log(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,r,s){return s&&!this.debug?null:(mt(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new r1(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new r1(this.logger,e)}}var hl=new r1;class UC{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(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<n;s++)r[s-1]=arguments[s];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(a=>{let[o,c]=a;for(let u=0;u<c;u++)o(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(a=>{let[o,c]=a;for(let u=0;u<c;u++)o.apply(o,[e,...r])})}}class hz extends UC{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,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):mt(r)&&i?o.push(...r.split(i)):o.push(r)));const c=t1(this.data,o);return!c&&!n&&!r&&e.indexOf(".")>-1&&(e=o[0],n=o[1],r=o.slice(2).join(".")),c||!a||!mt(r)?c:ID(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),fz(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)(mt(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=t1(this.data,o)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?x6(c,r,i):c={...c,...r},fz(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 S6={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 pz={};class s1 extends UC{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Ype(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=hl.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&&!sme(e,r,s);if(a&&!o){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:mt(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:mt(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=!mt(d)&&typeof d!="boolean"&&typeof d!="number";if(v&&d&&w&&y.indexOf(h)<0&&!(mt(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?[]:{},k=x?p:m;for(const R in d)if(Object.prototype.hasOwnProperty.call(d,R)){const E=`${k}${i}${R}`;A[R]=this.translate(E,{...n,joinArrays:!1,ns:o}),A[R]===E&&(A[R]=d[R])}d=A}}else if(v&&mt(g)&&Array.isArray(d))d=d.join(g),d&&(d=this.extendTranslation(d,e,n,r));else{let x=!1,A=!1;const k=n.count!==void 0&&!mt(n.count),R=s1.hasDefaultValue(n),E=k?this.pluralResolver.getSuffix(u,n.count,n):"",T=n.ordinal&&k?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",D=k&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),M=D&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${E}`]||n[`defaultValue${T}`]||n.defaultValue;!this.isValidLookup(d)&&R&&(x=!0,d=M),this.isValidLookup(d)||(A=!0,d=a);const I=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&A?void 0:d,F=R&&M!==d&&this.options.updateMissing;if(A||x||F){if(this.logger.log(F?"updateKey":"missingKey",u,c,a,F?M: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<Y.length;H++)U.push(Y[H]);else this.options.saveMissingTo==="all"?U=this.languageUtils.toResolveHierarchy(n.lng||this.language):U.push(n.lng||this.language);const W=(H,ee,re)=>{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&&k?U.forEach(H=>{const ee=this.pluralResolver.getSuffixes(H,n);D&&n[`defaultValue${this.options.pluralSeparator}zero`]&&ee.indexOf(`${this.options.pluralSeparator}zero`)<0&&ee.push(`${this.options.pluralSeparator}zero`),ee.forEach(re=>{W([H],a+re,n[`defaultValue${re}`]||M)})}):W(U,a,M))}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=mt(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&&!mt(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;f<m&&(r.nest=!1)}!r.lng&&this.options.compatibilityAPI!=="v1"&&s&&s.res&&(r.lng=this.language||s.usedLng),r.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var d=arguments.length,m=new Array(d),p=0;p<d;p++)m[p]=arguments[p];return i&&i[0]===m[0]&&!r.context?(a.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${n[0]}`),null):a.translate(...m,n)},r)),r.interpolation&&this.interpolator.reset()}const o=r.postProcess||this.options.postProcess,c=mt(o)?[o]:o;return e!=null&&c&&c.length&&r.applyPostProcessor!==!1&&(e=S6.handle(c,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,s,i,a,o;return mt(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&&!mt(n.count),m=d&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),p=n.context!==void 0&&(mt(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,!pz[`${h[0]}-${y}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(o)&&(pz[`${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`,k=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(v.push(f+x),n.ordinal&&x.indexOf(k)===0&&v.push(f+x.replace(k,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(k)===0&&v.push(R+x.replace(k,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&&!mt(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 oT=t=>t.charAt(0).toUpperCase()+t.slice(1);class mz{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=hl.create("languageUtils")}getScriptPartFromCode(e){if(e=n1(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=n1(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(mt(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]=oT(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]=oT(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=oT(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)),mt(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 mt(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))):mt(e)&&i(this.formatLanguageCode(e)),r.forEach(a=>{s.indexOf(a)<0&&i(this.formatLanguageCode(a))}),s}}let ome=[{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}],ame={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 lme=["v1","v2","v3"],cme=["v4"],gz={zero:0,one:1,two:2,few:3,many:4,other:5},ume=()=>{const t={};return ome.forEach(e=>{e.lngs.forEach(n=>{t[n]={numbers:e.nr,plurals:ame[e.fc]}})}),t};class dme{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=hl.create("pluralResolver"),(!this.options.compatibilityJSON||cme.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=ume(),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=n1(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)=>gz[s]-gz[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!lme.includes(this.options.compatibilityJSON)}}const vz=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=Jpe(t,e,n);return!i&&s&&mt(n)&&(i=ID(t,n,r),i===void 0&&(i=ID(e,n,r))),i},aT=t=>t.replace(/\$/g,"$$$$");class fme{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=hl.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:eme,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=i?zp(i):a||"{{",this.suffix=o?zp(o):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=f?"":l||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=d?zp(d):m||zp("$t("),this.nestingSuffix=p?zp(p):h||zp(")"),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=vz(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(vz(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=>aT(m)},{regex:this.regexp,safeValue:m=>this.escapeValue?aT(this.escape(m)):aT(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=mt(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!mt(a)&&!this.useRawValueToEscape&&(a=cz(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&&!mt(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&&!mt(i))return i;mt(i)||(i=cz(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 hme=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}},Bp=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(n1(r),s),e[a]=o),o(n)}};class pme{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=hl.create("formatter"),this.options=e,this.formats={number:Bp((n,r)=>{const s=new Intl.NumberFormat(n,{...r});return i=>s.format(i)}),currency:Bp((n,r)=>{const s=new Intl.NumberFormat(n,{...r,style:"currency"});return i=>s.format(i)}),datetime:Bp((n,r)=>{const s=new Intl.DateTimeFormat(n,{...r});return i=>s.format(i)}),relativetime:Bp((n,r)=>{const s=new Intl.RelativeTimeFormat(n,{...r});return i=>s.format(i,r.range||"day")}),list:Bp((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()]=Bp(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}=hme(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 mme=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class gme extends UC{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=hl.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=>{Qpe(c.loaded,[i],a),mme(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.maxRetries){setTimeout(()=>{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();mt(e)&&(e=this.languageUtils.toResolveHierarchy(e)),mt(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 yz=()=>({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]),mt(t[1])&&(e.defaultValue=t[1]),mt(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}}),bz=t=>(mt(t.ns)&&(t.ns=[t.ns]),mt(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),mt(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),nS=()=>{},vme=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class qb extends UC{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=bz(e),this.services={},this.logger=hl,this.modules={external:[]},vme(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&&(mt(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const s=yz();this.options={...s,...this.options,...bz(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?hl.init(i(this.modules.logger),this.options):hl.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:typeof Intl<"u"&&(f=pme);const l=new mz(this.options);this.store=new hz(this.options.resources,this.options);const d=this.services;d.logger=hl,d.resourceStore=this.store,d.languageUtils=l,d.pluralResolver=new dme(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 fme(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new gme(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;y<p;y++)h[y-1]=arguments[y];e.emit(m,...h)}),this.modules.languageDetector&&(d.languageDetector=i(this.modules.languageDetector),d.languageDetector.init&&d.languageDetector.init(d,this.options.detection,this.options)),this.modules.i18nFormat&&(d.i18nFormat=i(this.modules.i18nFormat),d.i18nFormat.init&&d.i18nFormat.init(this)),this.translator=new s1(this.services,this.options),this.translator.on("*",function(m){for(var p=arguments.length,h=new Array(p>1?p-1:0),y=1;y<p;y++)h[y-1]=arguments[y];e.emit(m,...h)}),this.modules.external.forEach(m=>{m.init&&m.init(this)})}if(this.format=this.options.interpolation.format,r||(r=nS),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=vy(),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]:nS;const s=mt(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=vy();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=nS),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"&&S6.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<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(e,n){var r=this;this.isLanguageChangingTo=e;const s=vy();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=mt(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<u;l++)f[l-2]=arguments[l];c=s.options.overloadTranslationOptionHandler([a,o].concat(f))}else c={...o};c.lng=c.lng||i.lng,c.lngs=c.lngs||i.lngs,c.ns=c.ns||i.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||r||i.keyPrefix);const d=s.options.keySeparator||".";let m;return c.keyPrefix&&Array.isArray(a)?m=a.map(p=>`${c.keyPrefix}${d}${p}`):m=c.keyPrefix?`${c.keyPrefix}${d}${a}`:a,s.t(m,c)};return mt(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=vy();return this.options.ns?(mt(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=vy();mt(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 mz(yz());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 qb(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nS;const r=e.forkResourceStore;r&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},i=new qb(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 hz(this.store.data,s),i.services.resourceStore=i.store),i.translator=new s1(i.services,s),i.translator.on("*",function(o){for(var c=arguments.length,u=new Array(c>1?c-1:0),f=1;f<c;f++)u[f-1]=arguments[f];i.emit(o,...u)}),i.init(s,n),i.translator.options=s,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ps=qb.createInstance();ps.createInstance=qb.createInstance;ps.createInstance;ps.dir;ps.init;ps.loadResources;ps.reloadResources;ps.use;ps.changeLanguage;ps.getFixedT;const ft=ps.t;ps.exists;ps.setDefaultNamespace;ps.hasLoadedNamespace;ps.loadNamespaces;ps.loadLanguages;const yme=_.forwardRef(({...t},e)=>P.jsx("nav",{ref:e,"aria-label":ft("common.breadcrumb"),...t}));yme.displayName="Breadcrumb";const bme=_.forwardRef(({className:t,...e},n)=>P.jsx("ol",{ref:n,className:ce("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",t),...e}));bme.displayName="BreadcrumbList";const wme=_.forwardRef(({className:t,...e},n)=>P.jsx("li",{ref:n,className:ce("inline-flex items-center gap-1.5",t),...e}));wme.displayName="BreadcrumbItem";const _me=_.forwardRef(({asChild:t,className:e,...n},r)=>{const s=t?Ra:"a";return P.jsx(s,{ref:r,className:ce("transition-colors hover:text-foreground",e),...n})});_me.displayName="BreadcrumbLink";const xme=_.forwardRef(({className:t,...e},n)=>P.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:ce("font-normal text-foreground",t),...e}));xme.displayName="BreadcrumbPage";function Yt(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 lo(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function qs(t,e){const n=Yt(t);return isNaN(e)?lo(t,NaN):(e&&n.setDate(n.getDate()+e),n)}function Pa(t,e){const n=Yt(t);if(isNaN(e))return lo(t,NaN);if(!e)return n;const r=n.getDate(),s=lo(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 $L=6048e5,Sme=864e5;let Eme={};function f_(){return Eme}function xl(t,e){var o,c,u,f;const n=f_(),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=Yt(t),i=s.getDay(),a=(i<r?7:0)+i-r;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function Gh(t){return xl(t,{weekStartsOn:1})}function E6(t){const e=Yt(t),n=e.getFullYear(),r=lo(t,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const s=Gh(r),i=lo(t,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const a=Gh(i);return e.getTime()>=s.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function lv(t){const e=Yt(t);return e.setHours(0,0,0,0),e}function i1(t){const e=Yt(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 pl(t,e){const n=lv(t),r=lv(e),s=+n-i1(n),i=+r-i1(r);return Math.round((s-i)/Sme)}function Cme(t){const e=E6(t),n=lo(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),Gh(n)}function $D(t,e){const n=e*7;return qs(t,n)}function Ame(t,e){return Pa(t,e*12)}function Rme(t){let e;return t.forEach(function(n){const r=Yt(n);(e===void 0||e<r||isNaN(Number(r)))&&(e=r)}),e||new Date(NaN)}function Pme(t){let e;return t.forEach(n=>{const r=Yt(n);(!e||e>r||isNaN(+r))&&(e=r)}),e||new Date(NaN)}function yi(t,e){const n=lv(t),r=lv(e);return+n==+r}function FL(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function Tme(t){if(!FL(t)&&typeof t!="number")return!1;const e=Yt(t);return!isNaN(Number(e))}function Gb(t,e){const n=Yt(t),r=Yt(e),s=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return s*12+i}function kme(t,e,n){const r=xl(t,n),s=xl(e,n),i=+r-i1(r),a=+s-i1(s);return Math.round((i-a)/$L)}function jL(t){const e=Yt(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function Ai(t){const e=Yt(t);return e.setDate(1),e.setHours(0,0,0,0),e}function C6(t){const e=Yt(t),n=lo(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}function zL(t,e){var o,c,u,f;const n=f_(),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=Yt(t),i=s.getDay(),a=(i<r?-7:0)+6-(i-r);return s.setDate(s.getDate()+a),s.setHours(23,59,59,999),s}function A6(t){return zL(t,{weekStartsOn:1})}const Dme={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Nme=(t,e,n)=>{let r;const s=Dme[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 $o(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const Mme={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ome={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Lme={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ime={date:$o({formats:Mme,defaultWidth:"full"}),time:$o({formats:Ome,defaultWidth:"full"}),dateTime:$o({formats:Lme,defaultWidth:"full"})},$me={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Fme=(t,e,n,r)=>$me[t];function Ar(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 jme={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},zme={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Bme={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"]},Ume={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"]},Hme={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"}},Wme={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"}},Vme=(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"},qme={ordinalNumber:Vme,era:Ar({values:jme,defaultWidth:"wide"}),quarter:Ar({values:zme,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Ar({values:Bme,defaultWidth:"wide"}),day:Ar({values:Ume,defaultWidth:"wide"}),dayPeriod:Ar({values:Hme,defaultWidth:"wide",formattingValues:Wme,defaultFormattingWidth:"wide"})};function Rr(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)?Kme(o,l=>l.test(a)):Gme(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 Gme(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Kme(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function HC(t){return(e,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 Yme=/^(\d+)(th|st|nd|rd)?/i,Xme=/\d+/i,Qme={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]},Zme={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ege={any:[/1/i,/2/i,/3/i,/4/i]},tge={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},nge={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]},rge={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},sge={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]},ige={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},oge={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}},age={ordinalNumber:HC({matchPattern:Yme,parsePattern:Xme,valueCallback:t=>parseInt(t,10)}),era:Rr({matchPatterns:Qme,defaultMatchWidth:"wide",parsePatterns:Jme,defaultParseWidth:"any"}),quarter:Rr({matchPatterns:Zme,defaultMatchWidth:"wide",parsePatterns:ege,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Rr({matchPatterns:tge,defaultMatchWidth:"wide",parsePatterns:nge,defaultParseWidth:"any"}),day:Rr({matchPatterns:rge,defaultMatchWidth:"wide",parsePatterns:sge,defaultParseWidth:"any"}),dayPeriod:Rr({matchPatterns:ige,defaultMatchWidth:"any",parsePatterns:oge,defaultParseWidth:"any"})},BL={code:"en-US",formatDistance:Nme,formatLong:Ime,formatRelative:Fme,localize:qme,match:age,options:{weekStartsOn:0,firstWeekContainsDate:1}};function lge(t){const e=Yt(t);return pl(e,C6(e))+1}function R6(t){const e=Yt(t),n=+Gh(e)-+Cme(e);return Math.round(n/$L)+1}function P6(t,e){var f,l,d,m;const n=Yt(t),r=n.getFullYear(),s=f_(),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=lo(t,0);a.setFullYear(r+1,0,i),a.setHours(0,0,0,0);const o=xl(a,e),c=lo(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 cge(t,e){var o,c,u,f;const n=f_(),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=P6(t,e),i=lo(t,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),xl(i,e)}function T6(t,e){const n=Yt(t),r=+xl(n,e)-+cge(n,e);return Math.round(r/$L)+1}function fn(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const gu={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)}},Up={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wz={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 gu.y(t,e)},Y:function(t,e,n,r){const s=P6(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=E6(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 gu.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=T6(t,r);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):fn(s,e.length)},I:function(t,e,n){const r=R6(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"}):gu.d(t,e)},D:function(t,e,n){const r=lge(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=Up.noon:r===0?s=Up.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=Up.evening:r>=12?s=Up.afternoon:r>=4?s=Up.morning:s=Up.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 gu.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):gu.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"}):gu.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):gu.s(t,e)},S:function(t,e){return gu.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return xz(r);case"XXXX":case"XX":return hf(r);case"XXXXX":case"XXX":default:return hf(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return xz(r);case"xxxx":case"xx":return hf(r);case"xxxxx":case"xxx":default:return hf(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+_z(r,":");case"OOOO":default:return"GMT"+hf(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+_z(r,":");case"zzzz":default:return"GMT"+hf(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 _z(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 xz(t,e){return t%60===0?(t>0?"-":"+")+fn(Math.abs(t)/60,2):hf(t,e)}function hf(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 Sz=(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"})}},k6=(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"})}},uge=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return Sz(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}}",Sz(r,e)).replace("{{time}}",k6(s,e))},dge={p:k6,P:uge},fge=/^D+$/,hge=/^Y+$/,pge=["D","DD","YY","YYYY"];function mge(t){return fge.test(t)}function gge(t){return hge.test(t)}function vge(t,e,n){const r=yge(t,e,n);if(console.warn(r),pge.includes(t))throw new RangeError(r)}function yge(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 bge=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,wge=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,_ge=/^'([^]*?)'?$/,xge=/''/g,Sge=/[a-zA-Z]/;function pp(t,e,n){var f,l,d,m,p,h,y,g;const r=f_(),s=(n==null?void 0:n.locale)??r.locale??BL,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=Yt(t);if(!Tme(o))throw new RangeError("Invalid time value");let c=e.match(wge).map(v=>{const w=v[0];if(w==="p"||w==="P"){const x=dge[w];return x(v,s.formatLong)}return v}).join("").match(bge).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const w=v[0];if(w==="'")return{isToken:!1,value:Ege(v)};if(wz[w])return{isToken:!0,value:v};if(w.match(Sge))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)&&gge(w)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&mge(w))&&vge(w,e,String(t));const x=wz[w[0]];return x(o,w,s.localize,u)}).join("")}function Ege(t){const e=t.match(_ge);return e?e[1].replace(xge,"'"):t}function Cge(t){const e=Yt(t),n=e.getFullYear(),r=e.getMonth(),s=lo(t,0);return s.setFullYear(n,r+1,0),s.setHours(0,0,0,0),s.getDate()}function Age(t){return Math.trunc(+Yt(t)/1e3)}function Rge(t){const e=Yt(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(0,0,0,0),e}function Pge(t,e){return kme(Rge(t),Ai(t),e)+1}function FD(t,e){const n=Yt(t),r=Yt(e);return n.getTime()>r.getTime()}function D6(t,e){const n=Yt(t),r=Yt(e);return+n<+r}function UL(t,e){const n=Yt(t),r=Yt(e);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function Tge(t,e){const n=Yt(t),r=Yt(e);return n.getFullYear()===r.getFullYear()}function lT(t,e){return qs(t,-e)}function cT(t,e){const n=Yt(t),r=n.getFullYear(),s=n.getDate(),i=lo(t,0);i.setFullYear(r,e,15),i.setHours(0,0,0,0);const a=Cge(i);return n.setMonth(e,Math.min(s,a)),n}function Ez(t,e){const n=Yt(t);return isNaN(+n)?lo(t,NaN):(n.setFullYear(e),n)}const kge={lessThanXSeconds:{one:"menys d'un segon",eleven:"menys d'onze segons",other:"menys de {{count}} segons"},xSeconds:{one:"1 segon",other:"{{count}} segons"},halfAMinute:"mig minut",lessThanXMinutes:{one:"menys d'un minut",eleven:"menys d'onze minuts",other:"menys de {{count}} minuts"},xMinutes:{one:"1 minut",other:"{{count}} minuts"},aboutXHours:{one:"aproximadament una hora",other:"aproximadament {{count}} hores"},xHours:{one:"1 hora",other:"{{count}} hores"},xDays:{one:"1 dia",other:"{{count}} dies"},aboutXWeeks:{one:"aproximadament una setmana",other:"aproximadament {{count}} setmanes"},xWeeks:{one:"1 setmana",other:"{{count}} setmanes"},aboutXMonths:{one:"aproximadament un mes",other:"aproximadament {{count}} mesos"},xMonths:{one:"1 mes",other:"{{count}} mesos"},aboutXYears:{one:"aproximadament un any",other:"aproximadament {{count}} anys"},xYears:{one:"1 any",other:"{{count}} anys"},overXYears:{one:"més d'un any",eleven:"més d'onze anys",other:"més de {{count}} anys"},almostXYears:{one:"gairebé un any",other:"gairebé {{count}} anys"}},Dge=(t,e,n)=>{let r;const s=kge[t];return typeof s=="string"?r=s:e===1?r=s.one:e===11&&s.eleven?r=s.eleven:r=s.other.replace("{{count}}",String(e)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"en "+r:"fa "+r:r},Nge={full:"EEEE, d 'de' MMMM y",long:"d 'de' MMMM y",medium:"d MMM y",short:"dd/MM/y"},Mge={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Oge={full:"{{date}} 'a les' {{time}}",long:"{{date}} 'a les' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Lge={date:$o({formats:Nge,defaultWidth:"full"}),time:$o({formats:Mge,defaultWidth:"full"}),dateTime:$o({formats:Oge,defaultWidth:"full"})},Ige={lastWeek:"'el' eeee 'passat a la' LT",yesterday:"'ahir a la' p",today:"'avui a la' p",tomorrow:"'demà a la' p",nextWeek:"eeee 'a la' p",other:"P"},$ge={lastWeek:"'el' eeee 'passat a les' p",yesterday:"'ahir a les' p",today:"'avui a les' p",tomorrow:"'demà a les' p",nextWeek:"eeee 'a les' p",other:"P"},Fge=(t,e,n,r)=>e.getHours()!==1?$ge[t]:Ige[t],jge={narrow:["aC","dC"],abbreviated:["a. de C.","d. de C."],wide:["abans de Crist","després de Crist"]},zge={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1r trimestre","2n trimestre","3r trimestre","4t trimestre"]},Bge={narrow:["GN","FB","MÇ","AB","MG","JN","JL","AG","ST","OC","NV","DS"],abbreviated:["gen.","febr.","març","abr.","maig","juny","jul.","ag.","set.","oct.","nov.","des."],wide:["gener","febrer","març","abril","maig","juny","juliol","agost","setembre","octubre","novembre","desembre"]},Uge={narrow:["dg.","dl.","dt.","dm.","dj.","dv.","ds."],short:["dg.","dl.","dt.","dm.","dj.","dv.","ds."],abbreviated:["dg.","dl.","dt.","dm.","dj.","dv.","ds."],wide:["diumenge","dilluns","dimarts","dimecres","dijous","divendres","dissabte"]},Hge={narrow:{am:"am",pm:"pm",midnight:"mitjanit",noon:"migdia",morning:"matí",afternoon:"tarda",evening:"vespre",night:"nit"},abbreviated:{am:"a.m.",pm:"p.m.",midnight:"mitjanit",noon:"migdia",morning:"matí",afternoon:"tarda",evening:"vespre",night:"nit"},wide:{am:"ante meridiem",pm:"post meridiem",midnight:"mitjanit",noon:"migdia",morning:"matí",afternoon:"tarda",evening:"vespre",night:"nit"}},Wge={narrow:{am:"am",pm:"pm",midnight:"de la mitjanit",noon:"del migdia",morning:"del matí",afternoon:"de la tarda",evening:"del vespre",night:"de la nit"},abbreviated:{am:"AM",pm:"PM",midnight:"de la mitjanit",noon:"del migdia",morning:"del matí",afternoon:"de la tarda",evening:"del vespre",night:"de la nit"},wide:{am:"ante meridiem",pm:"post meridiem",midnight:"de la mitjanit",noon:"del migdia",morning:"del matí",afternoon:"de la tarda",evening:"del vespre",night:"de la nit"}},Vge=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"r";case 2:return n+"n";case 3:return n+"r";case 4:return n+"t"}return n+"è"},qge={ordinalNumber:Vge,era:Ar({values:jge,defaultWidth:"wide"}),quarter:Ar({values:zge,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Ar({values:Bge,defaultWidth:"wide"}),day:Ar({values:Uge,defaultWidth:"wide"}),dayPeriod:Ar({values:Hge,defaultWidth:"wide",formattingValues:Wge,defaultFormattingWidth:"wide"})},Gge=/^(\d+)(è|r|n|r|t)?/i,Kge=/\d+/i,Yge={narrow:/^(aC|dC)/i,abbreviated:/^(a. de C.|d. de C.)/i,wide:/^(abans de Crist|despr[eé]s de Crist)/i},Xge={narrow:[/^aC/i,/^dC/i],abbreviated:[/^(a. de C.)/i,/^(d. de C.)/i],wide:[/^(abans de Crist)/i,/^(despr[eé]s de Crist)/i]},Qge={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](è|r|n|r|t)? trimestre/i},Jge={any:[/1/i,/2/i,/3/i,/4/i]},Zge={narrow:/^(GN|FB|MÇ|AB|MG|JN|JL|AG|ST|OC|NV|DS)/i,abbreviated:/^(gen.|febr.|març|abr.|maig|juny|jul.|ag.|set.|oct.|nov.|des.)/i,wide:/^(gener|febrer|març|abril|maig|juny|juliol|agost|setembre|octubre|novembre|desembre)/i},eve={narrow:[/^GN/i,/^FB/i,/^MÇ/i,/^AB/i,/^MG/i,/^JN/i,/^JL/i,/^AG/i,/^ST/i,/^OC/i,/^NV/i,/^DS/i],abbreviated:[/^gen./i,/^febr./i,/^març/i,/^abr./i,/^maig/i,/^juny/i,/^jul./i,/^ag./i,/^set./i,/^oct./i,/^nov./i,/^des./i],wide:[/^gener/i,/^febrer/i,/^març/i,/^abril/i,/^maig/i,/^juny/i,/^juliol/i,/^agost/i,/^setembre/i,/^octubre/i,/^novembre/i,/^desembre/i]},tve={narrow:/^(dg\.|dl\.|dt\.|dm\.|dj\.|dv\.|ds\.)/i,short:/^(dg\.|dl\.|dt\.|dm\.|dj\.|dv\.|ds\.)/i,abbreviated:/^(dg\.|dl\.|dt\.|dm\.|dj\.|dv\.|ds\.)/i,wide:/^(diumenge|dilluns|dimarts|dimecres|dijous|divendres|dissabte)/i},nve={narrow:[/^dg./i,/^dl./i,/^dt./i,/^dm./i,/^dj./i,/^dv./i,/^ds./i],abbreviated:[/^dg./i,/^dl./i,/^dt./i,/^dm./i,/^dj./i,/^dv./i,/^ds./i],wide:[/^diumenge/i,/^dilluns/i,/^dimarts/i,/^dimecres/i,/^dijous/i,/^divendres/i,/^disssabte/i]},rve={narrow:/^(a|p|mn|md|(del|de la) (matí|tarda|vespre|nit))/i,abbreviated:/^([ap]\.?\s?m\.?|mitjanit|migdia|(del|de la) (matí|tarda|vespre|nit))/i,wide:/^(ante meridiem|post meridiem|mitjanit|migdia|(del|de la) (matí|tarda|vespre|nit))/i},sve={any:{am:/^a/i,pm:/^p/i,midnight:/^mitjanit/i,noon:/^migdia/i,morning:/matí/i,afternoon:/tarda/i,evening:/vespre/i,night:/nit/i}},ive={ordinalNumber:HC({matchPattern:Gge,parsePattern:Kge,valueCallback:t=>parseInt(t,10)}),era:Rr({matchPatterns:Yge,defaultMatchWidth:"wide",parsePatterns:Xge,defaultParseWidth:"wide"}),quarter:Rr({matchPatterns:Qge,defaultMatchWidth:"wide",parsePatterns:Jge,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Rr({matchPatterns:Zge,defaultMatchWidth:"wide",parsePatterns:eve,defaultParseWidth:"wide"}),day:Rr({matchPatterns:tve,defaultMatchWidth:"wide",parsePatterns:nve,defaultParseWidth:"wide"}),dayPeriod:Rr({matchPatterns:rve,defaultMatchWidth:"wide",parsePatterns:sve,defaultParseWidth:"any"})},ove={code:"ca",formatDistance:Dge,formatLong:Lge,formatRelative:Fge,localize:qge,match:ive,options:{weekStartsOn:1,firstWeekContainsDate:4}},ave={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},lve=(t,e,n)=>{let r;const s=ave[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?"en "+r:"hace "+r:r},cve={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},uve={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},dve={full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},fve={date:$o({formats:cve,defaultWidth:"full"}),time:$o({formats:uve,defaultWidth:"full"}),dateTime:$o({formats:dve,defaultWidth:"full"})},hve={lastWeek:"'el' eeee 'pasado a la' p",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},pve={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},mve=(t,e,n,r)=>e.getHours()!==1?pve[t]:hve[t],gve={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},vve={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},yve={narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},bve={narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sá"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},wve={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},_ve={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},xve=(t,e)=>Number(t)+"º",Sve={ordinalNumber:xve,era:Ar({values:gve,defaultWidth:"wide"}),quarter:Ar({values:vve,defaultWidth:"wide",argumentCallback:t=>Number(t)-1}),month:Ar({values:yve,defaultWidth:"wide"}),day:Ar({values:bve,defaultWidth:"wide"}),dayPeriod:Ar({values:wve,defaultWidth:"wide",formattingValues:_ve,defaultFormattingWidth:"wide"})},Eve=/^(\d+)(º)?/i,Cve=/\d+/i,Ave={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},Rve={any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},Pve={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},Tve={any:[/1/i,/2/i,/3/i,/4/i]},kve={narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},Dve={narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},Nve={narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},Mve={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},Ove={narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},Lve={any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},Ive={ordinalNumber:HC({matchPattern:Eve,parsePattern:Cve,valueCallback:function(t){return parseInt(t,10)}}),era:Rr({matchPatterns:Ave,defaultMatchWidth:"wide",parsePatterns:Rve,defaultParseWidth:"any"}),quarter:Rr({matchPatterns:Pve,defaultMatchWidth:"wide",parsePatterns:Tve,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Rr({matchPatterns:kve,defaultMatchWidth:"wide",parsePatterns:Dve,defaultParseWidth:"any"}),day:Rr({matchPatterns:Nve,defaultMatchWidth:"wide",parsePatterns:Mve,defaultParseWidth:"any"}),dayPeriod:Rr({matchPatterns:Ove,defaultMatchWidth:"any",parsePatterns:Lve,defaultParseWidth:"any"})},$ve={code:"es",formatDistance:lve,formatLong:fve,formatRelative:mve,localize:Sve,match:Ive,options:{weekStartsOn:1,firstWeekContainsDate:1}},Fve={lessThanXSeconds:{one:"moins d’une seconde",other:"moins de {{count}} secondes"},xSeconds:{one:"1 seconde",other:"{{count}} secondes"},halfAMinute:"30 secondes",lessThanXMinutes:{one:"moins d’une minute",other:"moins de {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"environ 1 heure",other:"environ {{count}} heures"},xHours:{one:"1 heure",other:"{{count}} heures"},xDays:{one:"1 jour",other:"{{count}} jours"},aboutXWeeks:{one:"environ 1 semaine",other:"environ {{count}} semaines"},xWeeks:{one:"1 semaine",other:"{{count}} semaines"},aboutXMonths:{one:"environ 1 mois",other:"environ {{count}} mois"},xMonths:{one:"1 mois",other:"{{count}} mois"},aboutXYears:{one:"environ 1 an",other:"environ {{count}} ans"},xYears:{one:"1 an",other:"{{count}} ans"},overXYears:{one:"plus d’un an",other:"plus de {{count}} ans"},almostXYears:{one:"presqu’un an",other:"presque {{count}} ans"}},jve=(t,e,n)=>{let r;const s=Fve[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",String(e)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"dans "+r:"il y a "+r:r},zve={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},Bve={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Uve={full:"{{date}} 'à' {{time}}",long:"{{date}} 'à' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Hve={date:$o({formats:zve,defaultWidth:"full"}),time:$o({formats:Bve,defaultWidth:"full"}),dateTime:$o({formats:Uve,defaultWidth:"full"})},Wve={lastWeek:"eeee 'dernier à' p",yesterday:"'hier à' p",today:"'aujourd’hui à' p",tomorrow:"'demain à' p'",nextWeek:"eeee 'prochain à' p",other:"P"},Vve=(t,e,n,r)=>Wve[t],qve={narrow:["av. J.-C","ap. J.-C"],abbreviated:["av. J.-C","ap. J.-C"],wide:["avant Jésus-Christ","après Jésus-Christ"]},Gve={narrow:["T1","T2","T3","T4"],abbreviated:["1er trim.","2ème trim.","3ème trim.","4ème trim."],wide:["1er trimestre","2ème trimestre","3ème trimestre","4ème trimestre"]},Kve={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],wide:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"]},Yve={narrow:["D","L","M","M","J","V","S"],short:["di","lu","ma","me","je","ve","sa"],abbreviated:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],wide:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},Xve={narrow:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"mat.",afternoon:"ap.m.",evening:"soir",night:"mat."},abbreviated:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"matin",afternoon:"après-midi",evening:"soir",night:"matin"},wide:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"du matin",afternoon:"de l’après-midi",evening:"du soir",night:"du matin"}},Qve=(t,e)=>{const n=Number(t),r=e==null?void 0:e.unit;if(n===0)return"0";const s=["year","week","hour","minute","second"];let i;return n===1?i=r&&s.includes(r)?"ère":"er":i="ème",n+i},Jve=["MMM","MMMM"],Zve={preprocessor:(t,e)=>t.getDate()===1||!e.some(r=>r.isToken&&Jve.includes(r.value))?e:e.map(r=>r.isToken&&r.value==="do"?{isToken:!0,value:"d"}:r),ordinalNumber:Qve,era:Ar({values:qve,defaultWidth:"wide"}),quarter:Ar({values:Gve,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Ar({values:Kve,defaultWidth:"wide"}),day:Ar({values:Yve,defaultWidth:"wide"}),dayPeriod:Ar({values:Xve,defaultWidth:"wide"})},eye=/^(\d+)(ième|ère|ème|er|e)?/i,tye=/\d+/i,nye={narrow:/^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,abbreviated:/^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,wide:/^(avant Jésus-Christ|après Jésus-Christ)/i},rye={any:[/^av/i,/^ap/i]},sye={narrow:/^T?[1234]/i,abbreviated:/^[1234](er|ème|e)? trim\.?/i,wide:/^[1234](er|ème|e)? trimestre/i},iye={any:[/1/i,/2/i,/3/i,/4/i]},oye={narrow:/^[jfmasond]/i,abbreviated:/^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,wide:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i},aye={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,/^av/i,/^ma/i,/^juin/i,/^juil/i,/^ao/i,/^s/i,/^o/i,/^n/i,/^d/i]},lye={narrow:/^[lmjvsd]/i,short:/^(di|lu|ma|me|je|ve|sa)/i,abbreviated:/^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,wide:/^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i},cye={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^di/i,/^lu/i,/^ma/i,/^me/i,/^je/i,/^ve/i,/^sa/i]},uye={narrow:/^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,any:/^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i},dye={any:{am:/^a/i,pm:/^p/i,midnight:/^min/i,noon:/^mid/i,morning:/mat/i,afternoon:/ap/i,evening:/soir/i,night:/nuit/i}},fye={ordinalNumber:HC({matchPattern:eye,parsePattern:tye,valueCallback:t=>parseInt(t)}),era:Rr({matchPatterns:nye,defaultMatchWidth:"wide",parsePatterns:rye,defaultParseWidth:"any"}),quarter:Rr({matchPatterns:sye,defaultMatchWidth:"wide",parsePatterns:iye,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Rr({matchPatterns:oye,defaultMatchWidth:"wide",parsePatterns:aye,defaultParseWidth:"any"}),day:Rr({matchPatterns:lye,defaultMatchWidth:"wide",parsePatterns:cye,defaultParseWidth:"any"}),dayPeriod:Rr({matchPatterns:uye,defaultMatchWidth:"any",parsePatterns:dye,defaultParseWidth:"any"})},hye={code:"fr",formatDistance:jve,formatLong:Hve,formatRelative:Vve,localize:Zve,match:fye,options:{weekStartsOn:1,firstWeekContainsDate:4}};var dt=function(){return dt=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},dt.apply(this,arguments)};function pye(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n}function N6(t,e,n){for(var r=0,s=e.length,i;r<s;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}function h_(t){return t.mode==="multiple"}function p_(t){return t.mode==="range"}function WC(t){return t.mode==="single"}var mye={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function gye(t,e){return pp(t,"LLLL y",e)}function vye(t,e){return pp(t,"d",e)}function yye(t,e){return pp(t,"LLLL",e)}function bye(t){return"".concat(t)}function wye(t,e){return pp(t,"cccccc",e)}function _ye(t,e){return pp(t,"yyyy",e)}var xye=Object.freeze({__proto__:null,formatCaption:gye,formatDay:vye,formatMonthCaption:yye,formatWeekNumber:bye,formatWeekdayName:wye,formatYearCaption:_ye}),Sye=function(t,e,n){return pp(t,"do MMMM (EEEE)",n)},Eye=function(){return"Month: "},Cye=function(){return"Go to next month"},Aye=function(){return"Go to previous month"},Rye=function(t,e){return pp(t,"cccc",e)},Pye=function(t){return"Week n. ".concat(t)},Tye=function(){return"Year: "},kye=Object.freeze({__proto__:null,labelDay:Sye,labelMonthDropdown:Eye,labelNext:Cye,labelPrevious:Aye,labelWeekNumber:Pye,labelWeekday:Rye,labelYearDropdown:Tye});function Dye(){var t="buttons",e=mye,n=BL,r={},s={},i=1,a={},o=new Date;return{captionLayout:t,classNames:e,formatters:xye,labels:kye,locale:n,modifiersClassNames:r,modifiers:s,numberOfMonths:i,styles:a,today:o,mode:"default"}}function Nye(t){var e=t.fromYear,n=t.toYear,r=t.fromMonth,s=t.toMonth,i=t.fromDate,a=t.toDate;return r?i=Ai(r):e&&(i=new Date(e,0,1)),s?a=jL(s):n&&(a=new Date(n,11,31)),{fromDate:i?lv(i):void 0,toDate:a?lv(a):void 0}}var M6=_.createContext(void 0);function Mye(t){var e,n=t.initialProps,r=Dye(),s=Nye(n),i=s.fromDate,a=s.toDate,o=(e=n.captionLayout)!==null&&e!==void 0?e:r.captionLayout;o!=="buttons"&&(!i||!a)&&(o="buttons");var c;(WC(n)||h_(n)||p_(n))&&(c=n.onSelect);var u=dt(dt(dt({},r),n),{captionLayout:o,classNames:dt(dt({},r.classNames),n.classNames),components:dt({},n.components),formatters:dt(dt({},r.formatters),n.formatters),fromDate:i,labels:dt(dt({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:dt(dt({},r.modifiers),n.modifiers),modifiersClassNames:dt(dt({},r.modifiersClassNames),n.modifiersClassNames),onSelect:c,styles:dt(dt({},r.styles),n.styles),toDate:a});return P.jsx(M6.Provider,{value:u,children:t.children})}function In(){var t=_.useContext(M6);if(!t)throw new Error("useDayPicker must be used within a DayPickerProvider.");return t}function O6(t){var e=In(),n=e.locale,r=e.classNames,s=e.styles,i=e.formatters.formatCaption;return P.jsx("div",{className:r.caption_label,style:s.caption_label,"aria-live":"polite",role:"presentation",id:t.id,children:i(t.displayMonth,{locale:n})})}function Oye(t){return P.jsx("svg",dt({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},t,{children:P.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function L6(t){var e,n,r=t.onChange,s=t.value,i=t.children,a=t.caption,o=t.className,c=t.style,u=In(),f=(n=(e=u.components)===null||e===void 0?void 0:e.IconDropdown)!==null&&n!==void 0?n:Oye;return P.jsxs("div",{className:o,style:c,children:[P.jsx("span",{className:u.classNames.vhidden,children:t["aria-label"]}),P.jsx("select",{name:t.name,"aria-label":t["aria-label"],className:u.classNames.dropdown,style:u.styles.dropdown,value:s,onChange:r,children:i}),P.jsxs("div",{className:u.classNames.caption_label,style:u.styles.caption_label,"aria-hidden":"true",children:[a,P.jsx(f,{className:u.classNames.dropdown_icon,style:u.styles.dropdown_icon})]})]})}function Lye(t){var e,n=In(),r=n.fromDate,s=n.toDate,i=n.styles,a=n.locale,o=n.formatters.formatMonthCaption,c=n.classNames,u=n.components,f=n.labels.labelMonthDropdown;if(!r)return P.jsx(P.Fragment,{});if(!s)return P.jsx(P.Fragment,{});var l=[];if(Tge(r,s))for(var d=Ai(r),m=r.getMonth();m<=s.getMonth();m++)l.push(cT(d,m));else for(var d=Ai(new Date),m=0;m<=11;m++)l.push(cT(d,m));var p=function(y){var g=Number(y.target.value),v=cT(Ai(t.displayMonth),g);t.onChange(v)},h=(e=u==null?void 0:u.Dropdown)!==null&&e!==void 0?e:L6;return P.jsx(h,{name:"months","aria-label":f(),className:c.dropdown_month,style:i.dropdown_month,onChange:p,value:t.displayMonth.getMonth(),caption:o(t.displayMonth,{locale:a}),children:l.map(function(y){return P.jsx("option",{value:y.getMonth(),children:o(y,{locale:a})},y.getMonth())})})}function Iye(t){var e,n=t.displayMonth,r=In(),s=r.fromDate,i=r.toDate,a=r.locale,o=r.styles,c=r.classNames,u=r.components,f=r.formatters.formatYearCaption,l=r.labels.labelYearDropdown,d=[];if(!s)return P.jsx(P.Fragment,{});if(!i)return P.jsx(P.Fragment,{});for(var m=s.getFullYear(),p=i.getFullYear(),h=m;h<=p;h++)d.push(Ez(C6(new Date),h));var y=function(v){var w=Ez(Ai(n),Number(v.target.value));t.onChange(w)},g=(e=u==null?void 0:u.Dropdown)!==null&&e!==void 0?e:L6;return P.jsx(g,{name:"years","aria-label":l(),className:c.dropdown_year,style:o.dropdown_year,onChange:y,value:n.getFullYear(),caption:f(n,{locale:a}),children:d.map(function(v){return P.jsx("option",{value:v.getFullYear(),children:f(v,{locale:a})},v.getFullYear())})})}function $ye(t,e){var n=_.useState(t),r=n[0],s=n[1],i=e===void 0?r:e;return[i,s]}function Fye(t){var e=t.month,n=t.defaultMonth,r=t.today,s=e||n||r||new Date,i=t.toDate,a=t.fromDate,o=t.numberOfMonths,c=o===void 0?1:o;if(i&&Gb(i,s)<0){var u=-1*(c-1);s=Pa(i,u)}return a&&Gb(s,a)<0&&(s=a),Ai(s)}function jye(){var t=In(),e=Fye(t),n=$ye(e,t.month),r=n[0],s=n[1],i=function(a){var o;if(!t.disableNavigation){var c=Ai(a);s(c),(o=t.onMonthChange)===null||o===void 0||o.call(t,c)}};return[r,i]}function zye(t,e){for(var n=e.reverseMonths,r=e.numberOfMonths,s=Ai(t),i=Ai(Pa(s,r)),a=Gb(i,s),o=[],c=0;c<a;c++){var u=Pa(s,c);o.push(u)}return n&&(o=o.reverse()),o}function Bye(t,e){if(!e.disableNavigation){var n=e.toDate,r=e.pagedNavigation,s=e.numberOfMonths,i=s===void 0?1:s,a=r?i:1,o=Ai(t);if(!n)return Pa(o,a);var c=Gb(n,t);if(!(c<i))return Pa(o,a)}}function Uye(t,e){if(!e.disableNavigation){var n=e.fromDate,r=e.pagedNavigation,s=e.numberOfMonths,i=s===void 0?1:s,a=r?i:1,o=Ai(t);if(!n)return Pa(o,-a);var c=Gb(o,n);if(!(c<=0))return Pa(o,-a)}}var I6=_.createContext(void 0);function Hye(t){var e=In(),n=jye(),r=n[0],s=n[1],i=zye(r,e),a=Bye(r,e),o=Uye(r,e),c=function(l){return i.some(function(d){return UL(l,d)})},u=function(l,d){c(l)||(d&&D6(l,d)?s(Pa(l,1+e.numberOfMonths*-1)):s(l))},f={currentMonth:r,displayMonths:i,goToMonth:s,goToDate:u,previousMonth:o,nextMonth:a,isDateDisplayed:c};return P.jsx(I6.Provider,{value:f,children:t.children})}function m_(){var t=_.useContext(I6);if(!t)throw new Error("useNavigation must be used within a NavigationProvider");return t}function Cz(t){var e,n=In(),r=n.classNames,s=n.styles,i=n.components,a=m_().goToMonth,o=function(f){a(Pa(f,t.displayIndex?-t.displayIndex:0))},c=(e=i==null?void 0:i.CaptionLabel)!==null&&e!==void 0?e:O6,u=P.jsx(c,{id:t.id,displayMonth:t.displayMonth});return P.jsxs("div",{className:r.caption_dropdowns,style:s.caption_dropdowns,children:[P.jsx("div",{className:r.vhidden,children:u}),P.jsx(Lye,{onChange:o,displayMonth:t.displayMonth}),P.jsx(Iye,{onChange:o,displayMonth:t.displayMonth})]})}function Wye(t){return P.jsx("svg",dt({width:"16px",height:"16px",viewBox:"0 0 120 120"},t,{children:P.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function Vye(t){return P.jsx("svg",dt({width:"16px",height:"16px",viewBox:"0 0 120 120"},t,{children:P.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var o1=_.forwardRef(function(t,e){var n=In(),r=n.classNames,s=n.styles,i=[r.button_reset,r.button];t.className&&i.push(t.className);var a=i.join(" "),o=dt(dt({},s.button_reset),s.button);return t.style&&Object.assign(o,t.style),P.jsx("button",dt({},t,{ref:e,type:"button",className:a,style:o}))});function qye(t){var e,n,r=In(),s=r.dir,i=r.locale,a=r.classNames,o=r.styles,c=r.labels,u=c.labelPrevious,f=c.labelNext,l=r.components;if(!t.nextMonth&&!t.previousMonth)return P.jsx(P.Fragment,{});var d=u(t.previousMonth,{locale:i}),m=[a.nav_button,a.nav_button_previous].join(" "),p=f(t.nextMonth,{locale:i}),h=[a.nav_button,a.nav_button_next].join(" "),y=(e=l==null?void 0:l.IconRight)!==null&&e!==void 0?e:Vye,g=(n=l==null?void 0:l.IconLeft)!==null&&n!==void 0?n:Wye;return P.jsxs("div",{className:a.nav,style:o.nav,children:[!t.hidePrevious&&P.jsx(o1,{name:"previous-month","aria-label":d,className:m,style:o.nav_button_previous,disabled:!t.previousMonth,onClick:t.onPreviousClick,children:s==="rtl"?P.jsx(y,{className:a.nav_icon,style:o.nav_icon}):P.jsx(g,{className:a.nav_icon,style:o.nav_icon})}),!t.hideNext&&P.jsx(o1,{name:"next-month","aria-label":p,className:h,style:o.nav_button_next,disabled:!t.nextMonth,onClick:t.onNextClick,children:s==="rtl"?P.jsx(g,{className:a.nav_icon,style:o.nav_icon}):P.jsx(y,{className:a.nav_icon,style:o.nav_icon})})]})}function Az(t){var e=In().numberOfMonths,n=m_(),r=n.previousMonth,s=n.nextMonth,i=n.goToMonth,a=n.displayMonths,o=a.findIndex(function(p){return UL(t.displayMonth,p)}),c=o===0,u=o===a.length-1,f=e>1&&(c||!u),l=e>1&&(u||!c),d=function(){r&&i(r)},m=function(){s&&i(s)};return P.jsx(qye,{displayMonth:t.displayMonth,hideNext:f,hidePrevious:l,nextMonth:s,previousMonth:r,onPreviousClick:d,onNextClick:m})}function Gye(t){var e,n=In(),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:O6,u;return s?u=P.jsx(c,{id:t.id,displayMonth:t.displayMonth}):a==="dropdown"?u=P.jsx(Cz,{displayMonth:t.displayMonth,id:t.id}):a==="dropdown-buttons"?u=P.jsxs(P.Fragment,{children:[P.jsx(Cz,{displayMonth:t.displayMonth,displayIndex:t.displayIndex,id:t.id}),P.jsx(Az,{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(Az,{displayMonth:t.displayMonth,id:t.id})]}),P.jsx("div",{className:r.caption,style:i.caption,children:u})}function Kye(t){var e=In(),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 Yye(t,e,n){for(var r=n?Gh(new Date):xl(new Date,{locale:t,weekStartsOn:e}),s=[],i=0;i<7;i++){var a=qs(r,i);s.push(a)}return s}function Xye(){var t=In(),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=Yye(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 Qye(){var t,e=In(),n=e.classNames,r=e.styles,s=e.components,i=(t=s==null?void 0:s.HeadRow)!==null&&t!==void 0?t:Xye;return P.jsx("thead",{style:r.head,className:n.head,children:P.jsx(i,{})})}function Jye(t){var e=In(),n=e.locale,r=e.formatters.formatDay;return P.jsx(P.Fragment,{children:r(t.date,{locale:n})})}var HL=_.createContext(void 0);function Zye(t){if(!h_(t.initialProps)){var e={selected:void 0,modifiers:{disabled:[]}};return P.jsx(HL.Provider,{value:e,children:t.children})}return P.jsx(ebe,{initialProps:t.initialProps,children:t.children})}function ebe(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?N6([],r):[];if(f.selected){var g=y.findIndex(function(v){return yi(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 yi(d,u)});return!!(f&&!l)});var c={selected:r,onDayClick:a,modifiers:o};return P.jsx(HL.Provider,{value:c,children:n})}function WL(){var t=_.useContext(HL);if(!t)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return t}function tbe(t,e){var n=e||{},r=n.from,s=n.to;return r&&s?yi(s,t)&&yi(r,t)?void 0:yi(s,t)?{from:s,to:void 0}:yi(r,t)?void 0:FD(r,t)?{from:t,to:s}:{from:r,to:t}:s?FD(t,s)?{from:s,to:t}:{from:t,to:s}:r?D6(t,r)?{from:t,to:r}:{from:r,to:t}:{from:t,to:void 0}}var VL=_.createContext(void 0);function nbe(t){if(!p_(t.initialProps)){var e={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return P.jsx(VL.Provider,{value:e,children:t.children})}return P.jsx(rbe,{initialProps:t.initialProps,children:t.children})}function rbe(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=tbe(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],yi(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:lT(i,o-1),before:qs(i,o-1)}),i&&a&&f.disabled.push({after:i,before:qs(i,o-1)}),!i&&a&&f.disabled.push({after:lT(a,o-1),before:qs(a,o-1)})),c){if(i&&!a&&(f.disabled.push({before:qs(i,-c+1)}),f.disabled.push({after:qs(i,c-1)})),i&&a){var l=pl(a,i)+1,d=c-l;f.disabled.push({before:lT(i,d)}),f.disabled.push({after:qs(a,d)})}!i&&a&&(f.disabled.push({before:qs(a,-c+1)}),f.disabled.push({after:qs(a,c-1)}))}return P.jsx(VL.Provider,{value:{selected:r,onDayClick:u,modifiers:f},children:n})}function qL(){var t=_.useContext(VL);if(!t)throw new Error("useSelectRange must be used within a SelectRangeProvider");return t}function US(t){return Array.isArray(t)?N6([],t):t!==void 0?[t]:[]}function sbe(t){var e={};return Object.entries(t).forEach(function(n){var r=n[0],s=n[1];e[r]=US(s)}),e}var Ta;(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"})(Ta||(Ta={}));var ibe=Ta.Selected,Wl=Ta.Disabled,obe=Ta.Hidden,abe=Ta.Today,uT=Ta.RangeEnd,dT=Ta.RangeMiddle,fT=Ta.RangeStart,lbe=Ta.Outside;function cbe(t,e,n){var r,s=(r={},r[ibe]=US(t.selected),r[Wl]=US(t.disabled),r[obe]=US(t.hidden),r[abe]=[t.today],r[uT]=[],r[dT]=[],r[fT]=[],r[lbe]=[],r);return t.fromDate&&s[Wl].push({before:t.fromDate}),t.toDate&&s[Wl].push({after:t.toDate}),h_(t)?s[Wl]=s[Wl].concat(e.modifiers[Wl]):p_(t)&&(s[Wl]=s[Wl].concat(n.modifiers[Wl]),s[fT]=n.modifiers[fT],s[dT]=n.modifiers[dT],s[uT]=n.modifiers[uT]),s}var $6=_.createContext(void 0);function ube(t){var e=In(),n=WL(),r=qL(),s=cbe(e,n,r),i=sbe(e.modifiers),a=dt(dt({},s),i);return P.jsx($6.Provider,{value:a,children:t.children})}function F6(){var t=_.useContext($6);if(!t)throw new Error("useModifiers must be used within a ModifiersProvider");return t}function dbe(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function fbe(t){return!!(t&&typeof t=="object"&&"from"in t)}function hbe(t){return!!(t&&typeof t=="object"&&"after"in t)}function pbe(t){return!!(t&&typeof t=="object"&&"before"in t)}function mbe(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function gbe(t,e){var n,r=e.from,s=e.to;if(r&&s){var i=pl(s,r)<0;i&&(n=[s,r],r=n[0],s=n[1]);var a=pl(t,r)>=0&&pl(s,t)>=0;return a}return s?yi(s,t):r?yi(r,t):!1}function vbe(t){return FL(t)}function ybe(t){return Array.isArray(t)&&t.every(FL)}function bbe(t,e){return e.some(function(n){if(typeof n=="boolean")return n;if(vbe(n))return yi(t,n);if(ybe(n))return n.includes(t);if(fbe(n))return gbe(t,n);if(mbe(n))return n.dayOfWeek.includes(t.getDay());if(dbe(n)){var r=pl(n.before,t),s=pl(n.after,t),i=r>0,a=s<0,o=FD(n.before,n.after);return o?a&&i:i||a}return hbe(n)?pl(t,n.after)>0:pbe(n)?pl(n.before,t)>0:typeof n=="function"?n(t):!1})}function GL(t,e,n){var r=Object.keys(e).reduce(function(i,a){var o=e[a];return bbe(t,o)&&i.push(a),i},[]),s={};return r.forEach(function(i){return s[i]=!0}),n&&!UL(t,n)&&(s.outside=!0),s}function wbe(t,e){for(var n=Ai(t[0]),r=jL(t[t.length-1]),s,i,a=n;a<=r;){var o=GL(a,e),c=!o.disabled&&!o.hidden;if(!c){a=qs(a,1);continue}if(o.selected)return a;o.today&&!i&&(i=a),s||(s=a),a=qs(a,1)}return i||s}var _be=365;function j6(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:qs,week:$D,month:Pa,year:Ame,startOfWeek:function(y){return s.ISOWeek?Gh(y):xl(y,{locale:l,weekStartsOn:c})},endOfWeek:function(y){return s.ISOWeek?A6(y):zL(y,{locale:l,weekStartsOn:c})}},m=d[n](t,r==="after"?1:-1);r==="before"&&u?m=Rme([u,m]):r==="after"&&f&&(m=Pme([f,m]));var p=!0;if(i){var h=GL(m,i);p=!h.disabled&&!h.hidden}return p?m:o.count>_be?o.lastFocused:j6(m,{moveBy:n,direction:r,context:s,modifiers:i,retry:dt(dt({},o),{count:o.count+1})})}var z6=_.createContext(void 0);function xbe(t){var e=m_(),n=F6(),r=_.useState(),s=r[0],i=r[1],a=_.useState(),o=a[0],c=a[1],u=wbe(e.displayMonths,n),f=s??(o&&e.isDateDisplayed(o))?o:u,l=function(){c(s),i(void 0)},d=function(y){i(y)},m=In(),p=function(y,g){if(s){var v=j6(s,{moveBy:y,direction:g,context:m,modifiers:n});yi(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(z6.Provider,{value:h,children:t.children})}function KL(){var t=_.useContext(z6);if(!t)throw new Error("useFocusContext must be used within a FocusProvider");return t}function Sbe(t,e){var n=F6(),r=GL(t,n,e);return r}var YL=_.createContext(void 0);function Ebe(t){if(!WC(t.initialProps)){var e={selected:void 0};return P.jsx(YL.Provider,{value:e,children:t.children})}return P.jsx(Cbe,{initialProps:t.initialProps,children:t.children})}function Cbe(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(YL.Provider,{value:s,children:n})}function B6(){var t=_.useContext(YL);if(!t)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return t}function Abe(t,e){var n=In(),r=B6(),s=WL(),i=qL(),a=KL(),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(W){var H,ee,re,X;WC(n)?(H=r.onDayClick)===null||H===void 0||H.call(r,t,e,W):h_(n)?(ee=s.onDayClick)===null||ee===void 0||ee.call(s,t,e,W):p_(n)?(re=i.onDayClick)===null||re===void 0||re.call(i,t,e,W):(X=n.onDayClick)===null||X===void 0||X.call(n,t,e,W)},x=function(W){var H;d(t),(H=n.onDayFocus)===null||H===void 0||H.call(n,t,e,W)},A=function(W){var H;l(),(H=n.onDayBlur)===null||H===void 0||H.call(n,t,e,W)},k=function(W){var H;(H=n.onDayMouseEnter)===null||H===void 0||H.call(n,t,e,W)},R=function(W){var H;(H=n.onDayMouseLeave)===null||H===void 0||H.call(n,t,e,W)},E=function(W){var H;(H=n.onDayPointerEnter)===null||H===void 0||H.call(n,t,e,W)},T=function(W){var H;(H=n.onDayPointerLeave)===null||H===void 0||H.call(n,t,e,W)},D=function(W){var H;(H=n.onDayTouchCancel)===null||H===void 0||H.call(n,t,e,W)},M=function(W){var H;(H=n.onDayTouchEnd)===null||H===void 0||H.call(n,t,e,W)},L=function(W){var H;(H=n.onDayTouchMove)===null||H===void 0||H.call(n,t,e,W)},I=function(W){var H;(H=n.onDayTouchStart)===null||H===void 0||H.call(n,t,e,W)},F=function(W){var H;(H=n.onDayKeyUp)===null||H===void 0||H.call(n,t,e,W)},U=function(W){var H;switch(W.key){case"ArrowLeft":W.preventDefault(),W.stopPropagation(),n.dir==="rtl"?o():c();break;case"ArrowRight":W.preventDefault(),W.stopPropagation(),n.dir==="rtl"?c():o();break;case"ArrowDown":W.preventDefault(),W.stopPropagation(),u();break;case"ArrowUp":W.preventDefault(),W.stopPropagation(),f();break;case"PageUp":W.preventDefault(),W.stopPropagation(),W.shiftKey?h():m();break;case"PageDown":W.preventDefault(),W.stopPropagation(),W.shiftKey?y():p();break;case"Home":W.preventDefault(),W.stopPropagation(),g();break;case"End":W.preventDefault(),W.stopPropagation(),v();break}(H=n.onDayKeyDown)===null||H===void 0||H.call(n,t,e,W)},Y={onClick:w,onFocus:x,onBlur:A,onKeyDown:U,onKeyUp:F,onMouseEnter:k,onMouseLeave:R,onPointerEnter:E,onPointerLeave:T,onTouchCancel:D,onTouchEnd:M,onTouchMove:L,onTouchStart:I};return Y}function Rbe(){var t=In(),e=B6(),n=WL(),r=qL(),s=WC(t)?e.selected:h_(t)?n.selected:p_(t)?r.selected:void 0;return s}function Pbe(t){return Object.values(Ta).includes(t)}function Tbe(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(Pbe(r)){var i=t.classNames["day_".concat(r)];i&&n.push(i)}}),n}function kbe(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 Dbe(t,e,n){var r,s,i,a=In(),o=KL(),c=Sbe(t,e),u=Abe(t,c),f=Rbe(),l=!!(a.onDayClick||a.mode!=="default");_.useEffect(function(){var k;c.outside||o.focusedDay&&l&&yi(o.focusedDay,t)&&((k=n.current)===null||k===void 0||k.focus())},[o.focusedDay,t,n,l,c.outside]);var d=Tbe(a,c).join(" "),m=kbe(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:Jye,y=P.jsx(h,{date:t,displayMonth:e,activeModifiers:c}),g={style:m,className:d,children:y,role:"gridcell"},v=o.focusTarget&&yi(o.focusTarget,t)&&!c.outside,w=o.focusedDay&&yi(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 Nbe(t){var e=_.useRef(null),n=Dbe(t.date,t.displayMonth,e);return n.isHidden?P.jsx("div",{role:"gridcell"}):n.isButton?P.jsx(o1,dt({name:"day",ref:e},n.buttonProps)):P.jsx("div",dt({},n.divProps))}function Mbe(t){var e=t.number,n=t.dates,r=In(),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(o1,{name:"week-number","aria-label":l,className:a.weeknumber,style:i.weeknumber,onClick:d,children:f})}function Obe(t){var e,n,r=In(),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:Nbe,u=(n=o==null?void 0:o.WeekNumber)!==null&&n!==void 0?n:Mbe,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})},Age(l))})]})}function Rz(t,e,n){for(var r=n!=null&&n.ISOWeek?A6(e):zL(e,n),s=n!=null&&n.ISOWeek?Gh(t):xl(t,n),i=pl(r,s),a=[],o=0;o<=i;o++)a.push(qs(s,o));var c=a.reduce(function(u,f){var l=n!=null&&n.ISOWeek?R6(f):T6(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 Lbe(t,e){var n=Rz(Ai(t),jL(t),e);if(e!=null&&e.useFixedWeeks){var r=Pge(t,e);if(r<6){var s=n[n.length-1],i=s.dates[s.dates.length-1],a=$D(i,6-r),o=Rz($D(i,1),a,e);n.push.apply(n,o)}}return n}function Ibe(t){var e,n,r,s=In(),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=Lbe(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:Qye,y=(n=f==null?void 0:f.Row)!==null&&n!==void 0?n:Obe,g=(r=f==null?void 0:f.Footer)!==null&&r!==void 0?r:Kye;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 $be(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var Fbe=$be()?_.useLayoutEffect:_.useEffect,hT=!1,jbe=0;function Pz(){return"react-day-picker-".concat(++jbe)}function zbe(t){var e,n=t??(hT?Pz():null),r=_.useState(n),s=r[0],i=r[1];return Fbe(function(){s===null&&i(Pz())},[]),_.useEffect(function(){hT===!1&&(hT=!0)},[]),(e=t??s)!==null&&e!==void 0?e:void 0}function Bbe(t){var e,n,r=In(),s=r.dir,i=r.classNames,a=r.styles,o=r.components,c=m_().displayMonths,u=zbe(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:Gye;return P.jsxs("div",{className:l.join(" "),style:d,children:[P.jsx(y,{id:u,displayMonth:t.displayMonth,displayIndex:t.displayIndex}),P.jsx(Ibe,{id:f,"aria-labelledby":u,displayMonth:t.displayMonth})]},t.displayIndex)}function Ube(t){var e=In(),n=e.classNames,r=e.styles;return P.jsx("div",{className:n.months,style:r.months,children:t.children})}function Hbe(t){var e,n,r=t.initialProps,s=In(),i=KL(),a=m_(),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:Ube;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(Bbe,{displayIndex:h,displayMonth:p},h)})})}))}function Wbe(t){var e=t.children,n=pye(t,["children"]);return P.jsx(Mye,{initialProps:n,children:P.jsx(Hye,{children:P.jsx(Ebe,{initialProps:n,children:P.jsx(Zye,{initialProps:n,children:P.jsx(nbe,{initialProps:n,children:P.jsx(ube,{children:P.jsx(xbe,{children:e})})})})})})})}function Vbe(t){return P.jsx(Wbe,dt({},t,{children:P.jsx(Hbe,{initialProps:t})}))}function U6({className:t,classNames:e,showOutsideDays:n=!0,...r}){return P.jsx(Vbe,{showOutsideDays:n,className:ce("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:ce(Vb({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:ce(Vb({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(pL,{className:"w-4 h-4"}),IconRight:()=>P.jsx(s_,{className:"w-4 h-4"})},...r})}U6.displayName="Calendar";const H6=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:ce("rounded-md border bg-card text-card-foreground shadow",t),...e}));H6.displayName="Card";const W6=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:ce("flex flex-col space-y-1.5 p-6",t),...e}));W6.displayName="CardHeader";const V6=_.forwardRef(({className:t,...e},n)=>P.jsx("h3",{ref:n,className:ce("font-semibold leading-none tracking-tight",t),...e}));V6.displayName="CardTitle";const q6=_.forwardRef(({className:t,...e},n)=>P.jsx("p",{ref:n,className:ce("text-sm text-muted-foreground",t),...e}));q6.displayName="CardDescription";const G6=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:ce("p-6 pt-0",t),...e}));G6.displayName="CardContent";const K6=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:ce("flex items-center p-6 pt-0",t),...e}));K6.displayName="CardFooter";var qbe=Array.isArray,Gbe=qbe,Kbe=typeof yr=="object"&&yr&&yr.Object===Object&&yr,Ybe=Kbe,Xbe=Ybe,Qbe=typeof self=="object"&&self&&self.Object===Object&&self,Jbe=Xbe||Qbe||Function("return this")(),VC=Jbe,Zbe=VC,ewe=Zbe.Symbol,XL=ewe,Tz=XL,Y6=Object.prototype,twe=Y6.hasOwnProperty,nwe=Y6.toString,yy=Tz?Tz.toStringTag:void 0;function rwe(t){var e=twe.call(t,yy),n=t[yy];try{t[yy]=void 0;var r=!0}catch{}var s=nwe.call(t);return r&&(e?t[yy]=n:delete t[yy]),s}var swe=rwe,iwe=Object.prototype,owe=iwe.toString;function awe(t){return owe.call(t)}var lwe=awe,kz=XL,cwe=swe,uwe=lwe,dwe="[object Null]",fwe="[object Undefined]",Dz=kz?kz.toStringTag:void 0;function hwe(t){return t==null?t===void 0?fwe:dwe:Dz&&Dz in Object(t)?cwe(t):uwe(t)}var QL=hwe;function pwe(t){return t!=null&&typeof t=="object"}var X6=pwe,mwe=QL,gwe=X6,vwe="[object Symbol]";function ywe(t){return typeof t=="symbol"||gwe(t)&&mwe(t)==vwe}var bwe=ywe;function wwe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var g_=wwe,_we=QL,xwe=g_,Swe="[object AsyncFunction]",Ewe="[object Function]",Cwe="[object GeneratorFunction]",Awe="[object Proxy]";function Rwe(t){if(!xwe(t))return!1;var e=_we(t);return e==Ewe||e==Cwe||e==Swe||e==Awe}var Pwe=Rwe,Twe=VC,kwe=Twe["__core-js_shared__"],Dwe=kwe,pT=Dwe,Nz=function(){var t=/[^.]+$/.exec(pT&&pT.keys&&pT.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Nwe(t){return!!Nz&&Nz in t}var Mwe=Nwe,Owe=Function.prototype,Lwe=Owe.toString;function Iwe(t){if(t!=null){try{return Lwe.call(t)}catch{}try{return t+""}catch{}}return""}var $we=Iwe,Fwe=Pwe,jwe=Mwe,zwe=g_,Bwe=$we,Uwe=/[\\^$.*+?()[\]{}|]/g,Hwe=/^\[object .+?Constructor\]$/,Wwe=Function.prototype,Vwe=Object.prototype,qwe=Wwe.toString,Gwe=Vwe.hasOwnProperty,Kwe=RegExp("^"+qwe.call(Gwe).replace(Uwe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ywe(t){if(!zwe(t)||jwe(t))return!1;var e=Fwe(t)?Kwe:Hwe;return e.test(Bwe(t))}var Xwe=Ywe;function Qwe(t,e){return t==null?void 0:t[e]}var Jwe=Qwe,Zwe=Xwe,e0e=Jwe;function t0e(t,e){var n=e0e(t,e);return Zwe(n)?n:void 0}var Q6=t0e,n0e=Q6,r0e=n0e(Object,"create"),qC=r0e,Mz=qC;function s0e(){this.__data__=Mz?Mz(null):{},this.size=0}var i0e=s0e;function o0e(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var a0e=o0e,l0e=qC,c0e="__lodash_hash_undefined__",u0e=Object.prototype,d0e=u0e.hasOwnProperty;function f0e(t){var e=this.__data__;if(l0e){var n=e[t];return n===c0e?void 0:n}return d0e.call(e,t)?e[t]:void 0}var h0e=f0e,p0e=qC,m0e=Object.prototype,g0e=m0e.hasOwnProperty;function v0e(t){var e=this.__data__;return p0e?e[t]!==void 0:g0e.call(e,t)}var y0e=v0e,b0e=qC,w0e="__lodash_hash_undefined__";function _0e(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=b0e&&e===void 0?w0e:e,this}var x0e=_0e,S0e=i0e,E0e=a0e,C0e=h0e,A0e=y0e,R0e=x0e;function Cv(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Cv.prototype.clear=S0e;Cv.prototype.delete=E0e;Cv.prototype.get=C0e;Cv.prototype.has=A0e;Cv.prototype.set=R0e;var P0e=Cv;function T0e(){this.__data__=[],this.size=0}var k0e=T0e;function D0e(t,e){return t===e||t!==t&&e!==e}var N0e=D0e,M0e=N0e;function O0e(t,e){for(var n=t.length;n--;)if(M0e(t[n][0],e))return n;return-1}var GC=O0e,L0e=GC,I0e=Array.prototype,$0e=I0e.splice;function F0e(t){var e=this.__data__,n=L0e(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():$0e.call(e,n,1),--this.size,!0}var j0e=F0e,z0e=GC;function B0e(t){var e=this.__data__,n=z0e(e,t);return n<0?void 0:e[n][1]}var U0e=B0e,H0e=GC;function W0e(t){return H0e(this.__data__,t)>-1}var V0e=W0e,q0e=GC;function G0e(t,e){var n=this.__data__,r=q0e(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var K0e=G0e,Y0e=k0e,X0e=j0e,Q0e=U0e,J0e=V0e,Z0e=K0e;function Av(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Av.prototype.clear=Y0e;Av.prototype.delete=X0e;Av.prototype.get=Q0e;Av.prototype.has=J0e;Av.prototype.set=Z0e;var e_e=Av,t_e=Q6,n_e=VC,r_e=t_e(n_e,"Map"),s_e=r_e,Oz=P0e,i_e=e_e,o_e=s_e;function a_e(){this.size=0,this.__data__={hash:new Oz,map:new(o_e||i_e),string:new Oz}}var l_e=a_e;function c_e(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var u_e=c_e,d_e=u_e;function f_e(t,e){var n=t.__data__;return d_e(e)?n[typeof e=="string"?"string":"hash"]:n.map}var KC=f_e,h_e=KC;function p_e(t){var e=h_e(this,t).delete(t);return this.size-=e?1:0,e}var m_e=p_e,g_e=KC;function v_e(t){return g_e(this,t).get(t)}var y_e=v_e,b_e=KC;function w_e(t){return b_e(this,t).has(t)}var __e=w_e,x_e=KC;function S_e(t,e){var n=x_e(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var E_e=S_e,C_e=l_e,A_e=m_e,R_e=y_e,P_e=__e,T_e=E_e;function Rv(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Rv.prototype.clear=C_e;Rv.prototype.delete=A_e;Rv.prototype.get=R_e;Rv.prototype.has=P_e;Rv.prototype.set=T_e;var k_e=Rv,J6=k_e,D_e="Expected a function";function JL(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(D_e);var n=function(){var r=arguments,s=e?e.apply(this,r):r[0],i=n.cache;if(i.has(s))return i.get(s);var a=t.apply(this,r);return n.cache=i.set(s,a)||i,a};return n.cache=new(JL.Cache||J6),n}JL.Cache=J6;var N_e=JL,M_e=N_e,O_e=500;function L_e(t){var e=M_e(t,function(r){return n.size===O_e&&n.clear(),r}),n=e.cache;return e}var I_e=L_e,$_e=I_e,F_e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,j_e=/\\(\\)?/g;$_e(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(F_e,function(n,r,s,i){e.push(s?i.replace(j_e,"$1"):r||n)}),e});var Lz=XL,Iz=Lz?Lz.prototype:void 0;Iz&&Iz.toString;var z_e=QL,B_e=Gbe,U_e=X6,H_e="[object String]";function W_e(t){return typeof t=="string"||!B_e(t)&&U_e(t)&&z_e(t)==H_e}var V_e=W_e;const q_e=Od(V_e);var Sn={};/**
|
||
* @license React
|
||
* react-is.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var ZL=Symbol.for("react.element"),eI=Symbol.for("react.portal"),YC=Symbol.for("react.fragment"),XC=Symbol.for("react.strict_mode"),QC=Symbol.for("react.profiler"),JC=Symbol.for("react.provider"),ZC=Symbol.for("react.context"),G_e=Symbol.for("react.server_context"),eA=Symbol.for("react.forward_ref"),tA=Symbol.for("react.suspense"),nA=Symbol.for("react.suspense_list"),rA=Symbol.for("react.memo"),sA=Symbol.for("react.lazy"),K_e=Symbol.for("react.offscreen"),Z6;Z6=Symbol.for("react.module.reference");function Wo(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case ZL:switch(t=t.type,t){case YC:case QC:case XC:case tA:case nA:return t;default:switch(t=t&&t.$$typeof,t){case G_e:case ZC:case eA:case sA:case rA:case JC:return t;default:return e}}case eI:return e}}}Sn.ContextConsumer=ZC;Sn.ContextProvider=JC;Sn.Element=ZL;Sn.ForwardRef=eA;Sn.Fragment=YC;Sn.Lazy=sA;Sn.Memo=rA;Sn.Portal=eI;Sn.Profiler=QC;Sn.StrictMode=XC;Sn.Suspense=tA;Sn.SuspenseList=nA;Sn.isAsyncMode=function(){return!1};Sn.isConcurrentMode=function(){return!1};Sn.isContextConsumer=function(t){return Wo(t)===ZC};Sn.isContextProvider=function(t){return Wo(t)===JC};Sn.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===ZL};Sn.isForwardRef=function(t){return Wo(t)===eA};Sn.isFragment=function(t){return Wo(t)===YC};Sn.isLazy=function(t){return Wo(t)===sA};Sn.isMemo=function(t){return Wo(t)===rA};Sn.isPortal=function(t){return Wo(t)===eI};Sn.isProfiler=function(t){return Wo(t)===QC};Sn.isStrictMode=function(t){return Wo(t)===XC};Sn.isSuspense=function(t){return Wo(t)===tA};Sn.isSuspenseList=function(t){return Wo(t)===nA};Sn.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===YC||t===QC||t===XC||t===tA||t===nA||t===K_e||typeof t=="object"&&t!==null&&(t.$$typeof===sA||t.$$typeof===rA||t.$$typeof===JC||t.$$typeof===ZC||t.$$typeof===eA||t.$$typeof===Z6||t.getModuleId!==void 0)};Sn.typeOf=Wo;var rS=function(e){return q_e(e)&&e.indexOf("%")===e.length-1},Y_e=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},mT=function(e,n){for(var r=arguments.length,s=new Array(r>2?r-2:0),i=2;i<r;i++)s[i-2]=arguments[i]},X_e=VC,Q_e=function(){return X_e.Date.now()},J_e=Q_e,Z_e=/\s/;function exe(t){for(var e=t.length;e--&&Z_e.test(t.charAt(e)););return e}var txe=exe,nxe=txe,rxe=/^\s+/;function sxe(t){return t&&t.slice(0,nxe(t)+1).replace(rxe,"")}var ixe=sxe,oxe=ixe,$z=g_,axe=bwe,Fz=NaN,lxe=/^[-+]0x[0-9a-f]+$/i,cxe=/^0b[01]+$/i,uxe=/^0o[0-7]+$/i,dxe=parseInt;function fxe(t){if(typeof t=="number")return t;if(axe(t))return Fz;if($z(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=$z(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=oxe(t);var n=cxe.test(t);return n||uxe.test(t)?dxe(t.slice(2),n?2:8):lxe.test(t)?Fz:+t}var hxe=fxe,pxe=g_,gT=J_e,jz=hxe,mxe="Expected a function",gxe=Math.max,vxe=Math.min;function yxe(t,e,n){var r,s,i,a,o,c,u=0,f=!1,l=!1,d=!0;if(typeof t!="function")throw new TypeError(mxe);e=jz(e)||0,pxe(n)&&(f=!!n.leading,l="maxWait"in n,i=l?gxe(jz(n.maxWait)||0,e):i,d="trailing"in n?!!n.trailing:d);function m(k){var R=r,E=s;return r=s=void 0,u=k,a=t.apply(E,R),a}function p(k){return u=k,o=setTimeout(g,e),f?m(k):a}function h(k){var R=k-c,E=k-u,T=e-R;return l?vxe(T,i-E):T}function y(k){var R=k-c,E=k-u;return c===void 0||R>=e||R<0||l&&E>=i}function g(){var k=gT();if(y(k))return v(k);o=setTimeout(g,h(k))}function v(k){return o=void 0,d&&r?m(k):(r=s=void 0,a)}function w(){o!==void 0&&clearTimeout(o),u=0,r=c=s=o=void 0}function x(){return o===void 0?a:v(gT())}function A(){var k=gT(),R=y(k);if(r=arguments,s=this,c=k,R){if(o===void 0)return p(c);if(l)return clearTimeout(o),o=setTimeout(g,e),m(c)}return o===void 0&&(o=setTimeout(g,e)),a}return A.cancel=w,A.flush=x,A}var bxe=yxe,wxe=bxe,_xe=g_,xxe="Expected a function";function Sxe(t,e,n){var r=!0,s=!0;if(typeof t!="function")throw new TypeError(xxe);return _xe(n)&&(r="leading"in n?!!n.leading:r,s="trailing"in n?!!n.trailing:s),wxe(t,e,{leading:r,maxWait:e,trailing:s})}var Exe=Sxe;const Cxe=Od(Exe);function Kb(t){"@babel/helpers - typeof";return Kb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kb(t)}function zz(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function sS(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?zz(Object(n),!0).forEach(function(r){Axe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):zz(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Axe(t,e,n){return e=Rxe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rxe(t){var e=Pxe(t,"string");return Kb(e)=="symbol"?e:e+""}function Pxe(t,e){if(Kb(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Kb(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Txe(t,e){return Mxe(t)||Nxe(t,e)||Dxe(t,e)||kxe()}function kxe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dxe(t,e){if(t){if(typeof t=="string")return Bz(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 Bz(t,e)}}function Bz(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Nxe(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,s,i,a,o=[],c=!0,u=!1;try{if(i=(n=n.call(t)).next,e!==0)for(;!(c=(r=i.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(f){u=!0,s=f}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw s}}return o}}function Mxe(t){if(Array.isArray(t))return t}var Oxe=_.forwardRef(function(t,e){var n=t.aspect,r=t.initialDimension,s=r===void 0?{width:-1,height:-1}:r,i=t.width,a=i===void 0?"100%":i,o=t.height,c=o===void 0?"100%":o,u=t.minWidth,f=u===void 0?0:u,l=t.minHeight,d=t.maxHeight,m=t.children,p=t.debounce,h=p===void 0?0:p,y=t.id,g=t.className,v=t.onResize,w=t.style,x=w===void 0?{}:w,A=_.useRef(null),k=_.useRef();k.current=v,_.useImperativeHandle(e,function(){return Object.defineProperty(A.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),A.current},configurable:!0})});var R=_.useState({containerWidth:s.width,containerHeight:s.height}),E=Txe(R,2),T=E[0],D=E[1],M=_.useCallback(function(I,F){D(function(U){var Y=Math.round(I),W=Math.round(F);return U.containerWidth===Y&&U.containerHeight===W?U:{containerWidth:Y,containerHeight:W}})},[]);_.useEffect(function(){var I=function(ee){var re,X=ee[0].contentRect,G=X.width,K=X.height;M(G,K),(re=k.current)===null||re===void 0||re.call(k,G,K)};h>0&&(I=Cxe(I,h,{trailing:!0,leading:!1}));var F=new ResizeObserver(I),U=A.current.getBoundingClientRect(),Y=U.width,W=U.height;return M(Y,W),F.observe(A.current),function(){F.disconnect()}},[M,h]);var L=_.useMemo(function(){var I=T.containerWidth,F=T.containerHeight;if(I<0||F<0)return null;mT(rS(a)||rS(c),`The width(%s) and height(%s) are both fixed numbers,
|
||
maybe you don't need to use a ResponsiveContainer.`,a,c),mT(!n||n>0,"The aspect(%s) must be greater than zero.",n);var U=rS(a)?I:a,Y=rS(c)?F:c;n&&n>0&&(U?Y=U/n:Y&&(U=Y*n),d&&Y>d&&(Y=d)),mT(U>0||Y>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
||
please check the style of container, or the props width(%s) and height(%s),
|
||
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
||
height and width.`,U,Y,a,c,f,l,n);var W=!Array.isArray(m)&&Y_e(m.type).endsWith("Chart");return se.Children.map(m,function(H){return se.isValidElement(H)?_.cloneElement(H,sS({width:U,height:Y},W?{style:sS({height:"100%",width:"100%",maxHeight:Y,maxWidth:U},H.props.style)}:{})):H})},[n,m,c,d,l,f,T,a]);return se.createElement("div",{id:y?"".concat(y):void 0,className:hp("recharts-responsive-container",g),style:sS(sS({},x),{},{width:a,height:c,minWidth:f,minHeight:l,maxHeight:d}),ref:A},L)}),Lxe="Invariant failed";function Rn(t,e){if(!t)throw new Error(Lxe)}const Ixe={light:"",dark:".dark"},e8=_.createContext(null);function t8(){const t=_.useContext(e8);if(!t)throw new Error("useChart must be used within a <ChartContainer />");return t}const $xe=_.forwardRef(({id:t,className:e,children:n,config:r,...s},i)=>{const a=_.useId(),o=`chart-${t||a.replace(/:/g,"")}`;return P.jsx(e8.Provider,{value:{config:r},children:P.jsxs("div",{"data-chart":o,ref:i,className:ce("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",e),...s,children:[P.jsx(Fxe,{id:o,config:r}),P.jsx(Oxe,{children:n})]})})});$xe.displayName="Chart";const Fxe=({id:t,config:e})=>{const n=Object.entries(e).filter(([r,s])=>s.theme||s.color);return n.length?P.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(Ixe).map(([r,s])=>`
|
||
${s} [data-chart=${t}] {
|
||
${n.map(([i,a])=>{var c;const o=((c=a.theme)==null?void 0:c[r])||a.color;return o?` --color-${i}: ${o};`:null}).join(`
|
||
`)}
|
||
}
|
||
`).join(`
|
||
`)}}):null},jxe=_.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}=t8(),h=_.useMemo(()=>{var A;if(s||!(e!=null&&e.length))return null;const[g]=e,v=`${d||g.dataKey||g.name||"value"}`,w=jD(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:ce("font-medium",c),children:o(x,e)}):x?P.jsx("div",{className:ce("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:ce("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=jD(p,g,w),A=f||g.payload.fill||g.color;return P.jsx("div",{className:ce("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:ce("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:ce("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)})})]})});jxe.displayName="ChartTooltip";const zxe=_.forwardRef(({className:t,hideIcon:e=!1,payload:n,verticalAlign:r="bottom",nameKey:s},i)=>{const{config:a}=t8();return n!=null&&n.length?P.jsx("div",{ref:i,className:ce("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=jD(a,o,c);return P.jsxs("div",{className:ce("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});zxe.displayName="ChartLegend";function jD(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 Pv(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 v_(t){const[e,n]=_.useState(void 0);return Ln(()=>{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 tI="Checkbox",[Bxe,DHe]=Tn(tI),[Uxe,Hxe]=Bxe(tI),n8=_.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]=sr({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(Uxe,{scope:n,state:y,disabled:o,children:[P.jsx(De.button,{type:"button",role:"checkbox","aria-checked":Lh(y)?"mixed":y,"aria-required":a,"data-state":i8(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=>Lh(x)?!0:!x),h&&(p.current=w.isPropagationStopped(),p.current||w.stopPropagation())})}),h&&P.jsx(Wxe,{control:l,bubbles:!p.current,name:r,value:c,checked:y,required:a,disabled:o,style:{transform:"translateX(-100%)"}})]})});n8.displayName=tI;var r8="CheckboxIndicator",s8=_.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...s}=t,i=Hxe(r8,n);return P.jsx(Hn,{present:r||Lh(i.state)||i.state===!0,children:P.jsx(De.span,{"data-state":i8(i.state),"data-disabled":i.disabled?"":void 0,...s,ref:e,style:{pointerEvents:"none",...t.style}})})});s8.displayName=r8;var Wxe=t=>{const{control:e,checked:n,bubbles:r=!0,...s}=t,i=_.useRef(null),a=Pv(n),o=v_(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=Lh(n),l.call(c,Lh(n)?!1:n),c.dispatchEvent(d)}},[a,n,r]),P.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:Lh(n)?!1:n,...s,tabIndex:-1,ref:i,style:{...t.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Lh(t){return t==="indeterminate"}function i8(t){return Lh(t)?"indeterminate":t?"checked":"unchecked"}var o8=n8,Vxe=s8;const qxe=_.forwardRef(({className:t,...e},n)=>P.jsx(o8,{ref:n,className:ce("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(Vxe,{className:ce("flex items-center justify-center text-current"),children:P.jsx(r_,{className:"h-4 w-4"})})}));qxe.displayName=o8.displayName;var Uz=1,Gxe=.9,Kxe=.8,Yxe=.17,vT=.1,yT=.999,Xxe=.9999,Qxe=.99,Jxe=/[\\\/_+.#"@\[\(\{&]/,Zxe=/[\\\/_+.#"@\[\(\{&]/g,eSe=/[\s-]/,a8=/[\s-]/g;function zD(t,e,n,r,s,i,a){if(i===e.length)return s===t.length?Uz:Qxe;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=zD(t,e,n,r,u+1,i+1,a),l>f&&(u===s?l*=Uz:Jxe.test(t.charAt(u-1))?(l*=Kxe,m=t.slice(s,u-1).match(Zxe),m&&s>0&&(l*=Math.pow(yT,m.length))):eSe.test(t.charAt(u-1))?(l*=Gxe,p=t.slice(s,u-1).match(a8),p&&s>0&&(l*=Math.pow(yT,p.length))):(l*=Yxe,s>0&&(l*=Math.pow(yT,u-s))),t.charAt(u)!==e.charAt(i)&&(l*=Xxe)),(l<vT&&n.charAt(u-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(u-1)!==r.charAt(i))&&(d=zD(t,e,n,r,u+1,i+2,a),d*vT>l&&(l=d*vT)),l>f&&(f=l),u=n.indexOf(c,u+1);return a[o]=f,f}function Hz(t){return t.toLowerCase().replace(a8," ")}function tSe(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,zD(t,e,Hz(t),Hz(e),0,0,{})}function xd(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 Wz(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Kh(...t){return e=>{let n=!1;const r=t.map(s=>{const i=Wz(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():Wz(t[s],null)}}}}function mp(...t){return _.useCallback(Kh(...t),t)}function nSe(t,e){const n=_.createContext(e),r=i=>{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 rSe(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,sSe(s,...e)]}function sSe(...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 a1=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{},iSe=X0.useId||(()=>{});let oSe=0;function Oc(t){const[e,n]=_.useState(iSe());return a1(()=>{n(r=>r??String(oSe++))},[t]),e?`radix-${e}`:""}function Yh(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 aSe({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,s]=lSe({defaultProp:e,onChange:n}),i=t!==void 0,a=i?t:r,o=Yh(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 lSe({defaultProp:t,onChange:e}){const n=_.useState(t),[r]=n,s=_.useRef(r),i=Yh(e);return _.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}var nI=_.forwardRef((t,e)=>{const{children:n,...r}=t,s=_.Children.toArray(n),i=s.find(uSe);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(BD,{...r,ref:e,children:_.isValidElement(a)?_.cloneElement(a,void 0,o):null})}return P.jsx(BD,{...r,ref:e,children:n})});nI.displayName="Slot";var BD=_.forwardRef((t,e)=>{const{children:n,...r}=t;if(_.isValidElement(n)){const s=fSe(n),i=dSe(r,n.props);return n.type!==_.Fragment&&(i.ref=e?Kh(e,s):s),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});BD.displayName="SlotClone";var cSe=({children:t})=>P.jsx(P.Fragment,{children:t});function uSe(t){return _.isValidElement(t)&&t.type===cSe}function dSe(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 fSe(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 hSe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ms=hSe.reduce((t,e)=>{const n=_.forwardRef((r,s)=>{const{asChild:i,...a}=r,o=i?nI: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 pSe(t,e){t&&Ns.flushSync(()=>t.dispatchEvent(e))}function mSe(t,e=globalThis==null?void 0:globalThis.document){const n=Yh(t);_.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",r),()=>e.removeEventListener("keydown",r)},[n,e])}var gSe="DismissableLayer",UD="dismissableLayer.update",vSe="dismissableLayer.pointerDownOutside",ySe="dismissableLayer.focusOutside",Vz,l8=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),c8=_.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,onDismiss:o,...c}=t,u=_.useContext(l8),[f,l]=_.useState(null),d=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=_.useState({}),p=mp(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=_Se(R=>{const E=R.target,T=[...u.branches].some(D=>D.contains(E));!x||T||(s==null||s(R),a==null||a(R),R.defaultPrevented||o==null||o())},d),k=xSe(R=>{const E=R.target;[...u.branches].some(D=>D.contains(E))||(i==null||i(R),a==null||a(R),R.defaultPrevented||o==null||o())},d);return mSe(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&&(Vz=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),qz(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=Vz)}},[f,d,n,u]),_.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),qz())},[f,u]),_.useEffect(()=>{const R=()=>m({});return document.addEventListener(UD,R),()=>document.removeEventListener(UD,R)},[]),P.jsx(ms.div,{...c,ref:p,style:{pointerEvents:w?x?"auto":"none":void 0,...t.style},onFocusCapture:xd(t.onFocusCapture,k.onFocusCapture),onBlurCapture:xd(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:xd(t.onPointerDownCapture,A.onPointerDownCapture)})});c8.displayName=gSe;var bSe="DismissableLayerBranch",wSe=_.forwardRef((t,e)=>{const n=_.useContext(l8),r=_.useRef(null),s=mp(e,r);return _.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),P.jsx(ms.div,{...t,ref:s})});wSe.displayName=bSe;function _Se(t,e=globalThis==null?void 0:globalThis.document){const n=Yh(t),r=_.useRef(!1),s=_.useRef(()=>{});return _.useEffect(()=>{const i=o=>{if(o.target&&!r.current){let c=function(){u8(vSe,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 xSe(t,e=globalThis==null?void 0:globalThis.document){const n=Yh(t),r=_.useRef(!1);return _.useEffect(()=>{const s=i=>{i.target&&!r.current&&u8(ySe,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 qz(){const t=new CustomEvent(UD);document.dispatchEvent(t)}function u8(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?pSe(s,i):s.dispatchEvent(i)}var bT="focusScope.autoFocusOnMount",wT="focusScope.autoFocusOnUnmount",Gz={bubbles:!1,cancelable:!0},SSe="FocusScope",d8=_.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=t,[o,c]=_.useState(null),u=Yh(s),f=Yh(i),l=_.useRef(null),d=mp(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:wu(l.current,{select:!0})},y=function(w){if(m.paused||!o)return;const x=w.relatedTarget;x!==null&&(o.contains(x)||wu(l.current,{select:!0}))},g=function(w){if(document.activeElement===document.body)for(const A of w)A.removedNodes.length>0&&wu(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){Yz.add(m);const h=document.activeElement;if(!o.contains(h)){const g=new CustomEvent(bT,Gz);o.addEventListener(bT,u),o.dispatchEvent(g),g.defaultPrevented||(ESe(TSe(f8(o)),{select:!0}),document.activeElement===h&&wu(o))}return()=>{o.removeEventListener(bT,u),setTimeout(()=>{const g=new CustomEvent(wT,Gz);o.addEventListener(wT,f),o.dispatchEvent(g),g.defaultPrevented||wu(h??document.body,{select:!0}),o.removeEventListener(wT,f),Yz.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]=CSe(v);w&&x?!h.shiftKey&&g===x?(h.preventDefault(),n&&wu(w,{select:!0})):h.shiftKey&&g===w&&(h.preventDefault(),n&&wu(x,{select:!0})):g===v&&h.preventDefault()}},[n,r,m.paused]);return P.jsx(ms.div,{tabIndex:-1,...a,ref:d,onKeyDown:p})});d8.displayName=SSe;function ESe(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(wu(r,{select:e}),document.activeElement!==n)return}function CSe(t){const e=f8(t),n=Kz(e,t),r=Kz(e.reverse(),t);return[n,r]}function f8(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 Kz(t,e){for(const n of t)if(!ASe(n,{upTo:e}))return n}function ASe(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 RSe(t){return t instanceof HTMLInputElement&&"select"in t}function wu(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&RSe(t)&&e&&t.select()}}var Yz=PSe();function PSe(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=Xz(t,e),t.unshift(e)},remove(e){var n;t=Xz(t,e),(n=t[0])==null||n.resume()}}}function Xz(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function TSe(t){return t.filter(e=>e.tagName!=="A")}var kSe="Portal",h8=_.forwardRef((t,e)=>{var o;const{container:n,...r}=t,[s,i]=_.useState(!1);a1(()=>i(!0),[]);const a=n||s&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?t_.createPortal(P.jsx(ms.div,{...r,ref:e}),a):null});h8.displayName=kSe;function DSe(t,e){return _.useReducer((n,r)=>e[n][r]??n,t)}var iA=t=>{const{present:e,children:n}=t,r=NSe(e),s=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),i=mp(r.ref,MSe(s));return typeof n=="function"||r.isPresent?_.cloneElement(s,{ref:i}):null};iA.displayName="Presence";function NSe(t){const[e,n]=_.useState(),r=_.useRef({}),s=_.useRef(t),i=_.useRef("none"),a=t?"mounted":"unmounted",[o,c]=DSe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const u=iS(r.current);i.current=o==="mounted"?u:"none"},[o]),a1(()=>{const u=r.current,f=s.current;if(f!==t){const d=i.current,m=iS(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]),a1(()=>{if(e){let u;const f=e.ownerDocument.defaultView??window,l=m=>{const h=iS(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=iS(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 iS(t){return(t==null?void 0:t.animationName)||"none"}function MSe(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 _T=0;function OSe(){_.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Qz()),document.body.insertAdjacentElement("beforeend",t[1]??Qz()),_T++,()=>{_T===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),_T--}},[])}function Qz(){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 p8=bL(),xT=function(){},oA=_.forwardRef(function(t,e){var n=_.useRef(null),r=_.useState({onScrollCapture:xT,onWheelCapture:xT,onTouchMoveCapture:xT}),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=jC(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=d,A=yL([n,e]),k=fr(fr({},w),s);return _.createElement(_.Fragment,null,f&&_.createElement(x,{sideCar:p8,removeScrollBar:u,shards:l,noIsolation:m,inert:p,setCallbacks:i,allowPinchZoom:!!h,lockRef:n,gapMode:v}),a?_.cloneElement(_.Children.only(o),fr(fr({},k),{ref:A})):_.createElement(g,fr({},k,{className:c,ref:A}),o))});oA.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};oA.classNames={fullWidth:Im,zeroRight:Lm};var HD=!1;if(typeof window<"u")try{var oS=Object.defineProperty({},"passive",{get:function(){return HD=!0,!0}});window.addEventListener("test",oS,oS),window.removeEventListener("test",oS,oS)}catch{HD=!1}var Hp=HD?{passive:!1}:!1,LSe=function(t){return t.tagName==="TEXTAREA"},m8=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!LSe(t)&&n[e]==="visible")},ISe=function(t){return m8(t,"overflowY")},$Se=function(t){return m8(t,"overflowX")},Jz=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=g8(t,r);if(s){var i=v8(t,r),a=i[1],o=i[2];if(a>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},FSe=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},jSe=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},g8=function(t,e){return t==="v"?ISe(e):$Se(e)},v8=function(t,e){return t==="v"?FSe(e):jSe(e)},zSe=function(t,e){return t==="h"&&e==="rtl"?-1:1},BSe=function(t,e,n,r,s){var i=zSe(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=v8(t,o),p=m[0],h=m[1],y=m[2],g=h-y-i*p;(p||g)&&g8(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},aS=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Zz=function(t){return[t.deltaX,t.deltaY]},eB=function(t){return t&&"current"in t?t.current:t},USe=function(t,e){return t[0]===e[0]&&t[1]===e[1]},HSe=function(t){return`
|
||
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
||
`)},WSe=0,Wp=[];function VSe(t){var e=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),s=_.useState(WSe++)[0],i=_.useState(BC)[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=vL([t.lockRef.current],(t.shards||[]).map(eB),!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=aS(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,k=h.target,R=Math.abs(w)>Math.abs(x)?"h":"v";if("touches"in h&&R==="h"&&k.type==="range")return!1;var E=Jz(R,k);if(!E)return!0;if(E?A=R:(A=R==="v"?"h":"v",E=Jz(R,k)),!E)return!1;if(!r.current&&"changedTouches"in h&&(w||x)&&(r.current=A),!A)return!0;var T=r.current||A;return BSe(T,y,h,T==="h"?w:x)},[]),c=_.useCallback(function(h){var y=h;if(!(!Wp.length||Wp[Wp.length-1]!==i)){var g="deltaY"in y?Zz(y):aS(y),v=e.current.filter(function(A){return A.name===y.type&&(A.target===y.target||y.target===A.shadowParent)&&USe(A.delta,g)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var w=(a.current.shards||[]).map(eB).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:qSe(g)};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(x){return x!==w})},1)},[]),f=_.useCallback(function(h){n.current=aS(h),r.current=void 0},[]),l=_.useCallback(function(h){u(h.type,Zz(h),h.target,o(h,t.lockRef.current))},[]),d=_.useCallback(function(h){u(h.type,aS(h),h.target,o(h,t.lockRef.current))},[]);_.useEffect(function(){return Wp.push(i),t.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:d}),document.addEventListener("wheel",c,Hp),document.addEventListener("touchmove",c,Hp),document.addEventListener("touchstart",f,Hp),function(){Wp=Wp.filter(function(h){return h!==i}),document.removeEventListener("wheel",c,Hp),document.removeEventListener("touchmove",c,Hp),document.removeEventListener("touchstart",f,Hp)}},[]);var m=t.removeScrollBar,p=t.inert;return _.createElement(_.Fragment,null,p?_.createElement(i,{styles:HSe(s)}):null,m?_.createElement(_L,{gapMode:t.gapMode}):null)}function qSe(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const GSe=wL(p8,VSe);var y8=_.forwardRef(function(t,e){return _.createElement(oA,fr({},t,{ref:e,sideCar:GSe}))});y8.classNames=oA.classNames;var rI="Dialog",[b8,NHe]=rSe(rI),[KSe,La]=b8(rI),w8=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]=aSe({prop:r,defaultProp:s,onChange:i});return P.jsx(KSe,{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})};w8.displayName=rI;var _8="DialogTrigger",YSe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=La(_8,n),i=mp(e,s.triggerRef);return P.jsx(ms.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":oI(s.open),...r,ref:i,onClick:xd(t.onClick,s.onOpenToggle)})});YSe.displayName=_8;var sI="DialogPortal",[XSe,x8]=b8(sI,{forceMount:void 0}),S8=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=La(sI,e);return P.jsx(XSe,{scope:e,forceMount:n,children:_.Children.map(r,a=>P.jsx(iA,{present:n||i.open,children:P.jsx(h8,{asChild:!0,container:s,children:a})}))})};S8.displayName=sI;var l1="DialogOverlay",E8=_.forwardRef((t,e)=>{const n=x8(l1,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=La(l1,t.__scopeDialog);return i.modal?P.jsx(iA,{present:r||i.open,children:P.jsx(QSe,{...s,ref:e})}):null});E8.displayName=l1;var QSe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=La(l1,n);return P.jsx(y8,{as:nI,allowPinchZoom:!0,shards:[s.contentRef],children:P.jsx(ms.div,{"data-state":oI(s.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Xh="DialogContent",C8=_.forwardRef((t,e)=>{const n=x8(Xh,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=La(Xh,t.__scopeDialog);return P.jsx(iA,{present:r||i.open,children:i.modal?P.jsx(JSe,{...s,ref:e}):P.jsx(ZSe,{...s,ref:e})})});C8.displayName=Xh;var JSe=_.forwardRef((t,e)=>{const n=La(Xh,t.__scopeDialog),r=_.useRef(null),s=mp(e,n.contentRef,r);return _.useEffect(()=>{const i=r.current;if(i)return Ev(i)},[]),P.jsx(A8,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:xd(t.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:xd(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&i.preventDefault()}),onFocusOutside:xd(t.onFocusOutside,i=>i.preventDefault())})}),ZSe=_.forwardRef((t,e)=>{const n=La(Xh,t.__scopeDialog),r=_.useRef(!1),s=_.useRef(!1);return P.jsx(A8,{...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()}})}),A8=_.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=t,o=La(Xh,n),c=_.useRef(null),u=mp(e,c);return OSe(),P.jsxs(P.Fragment,{children:[P.jsx(d8,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:P.jsx(c8,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":oI(o.open),...a,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),P.jsxs(P.Fragment,{children:[P.jsx(rEe,{titleId:o.titleId}),P.jsx(iEe,{contentRef:c,descriptionId:o.descriptionId})]})]})}),iI="DialogTitle",eEe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=La(iI,n);return P.jsx(ms.h2,{id:s.titleId,...r,ref:e})});eEe.displayName=iI;var R8="DialogDescription",tEe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=La(R8,n);return P.jsx(ms.p,{id:s.descriptionId,...r,ref:e})});tEe.displayName=R8;var P8="DialogClose",nEe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=La(P8,n);return P.jsx(ms.button,{type:"button",...r,ref:e,onClick:xd(t.onClick,()=>s.onOpenChange(!1))})});nEe.displayName=P8;function oI(t){return t?"open":"closed"}var T8="DialogTitleWarning",[MHe,k8]=nSe(T8,{contentName:Xh,titleName:iI,docsSlug:"dialog"}),rEe=({titleId:t})=>{const e=k8(T8),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},sEe="DialogDescriptionWarning",iEe=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${k8(sEe).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},oEe=w8,aEe=S8,lEe=E8,cEe=C8,by='[cmdk-group=""]',ST='[cmdk-group-items=""]',uEe='[cmdk-group-heading=""]',D8='[cmdk-item=""]',tB=`${D8}:not([aria-disabled="true"])`,WD="cmdk-item-select",tm="data-value",dEe=(t,e,n)=>tSe(t,e,n),N8=_.createContext(void 0),y_=()=>_.useContext(N8),M8=_.createContext(void 0),aI=()=>_.useContext(M8),O8=_.createContext(void 0),L8=_.forwardRef((t,e)=>{let n=nm(()=>{var G,K;return{search:"",value:(K=(G=t.value)!=null?G:t.defaultValue)!=null?K:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=nm(()=>new Set),s=nm(()=>new Map),i=nm(()=>new Map),a=nm(()=>new Set),o=I8(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),k=xEe();Qh(()=>{if(f!==void 0){let G=f.trim();n.current.value=G,R.emit()}},[f]),Qh(()=>{k(6,I)},[]);let R=_.useMemo(()=>({subscribe:G=>(a.current.add(G),()=>a.current.delete(G)),snapshot:()=>n.current,setState:(G,K,J)=>{var ue,de,ie,be;if(!Object.is(n.current[G],K)){if(n.current[G]=K,G==="search")L(),D(),k(1,M);else if(G==="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(k(7,()=>{var Ae;n.current.selectedItemId=(Ae=F())==null?void 0:Ae.id,R.emit()}),J||k(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(G=>G())}}),[]),E=_.useMemo(()=>({value:(G,K,J)=>{var ue;K!==((ue=i.current.get(G))==null?void 0:ue.value)&&(i.current.set(G,{value:K,keywords:J}),n.current.filtered.items.set(G,T(K,J)),k(2,()=>{D(),R.emit()}))},item:(G,K)=>(r.current.add(G),K&&(s.current.has(K)?s.current.get(K).add(G):s.current.set(K,new Set([G]))),k(3,()=>{L(),D(),n.current.value||M(),R.emit()}),()=>{i.current.delete(G),r.current.delete(G),n.current.filtered.items.delete(G);let J=F();k(4,()=>{L(),(J==null?void 0:J.getAttribute("id"))===G&&M(),R.emit()})}),group:G=>(s.current.has(G)||s.current.set(G,new Set),()=>{i.current.delete(G),s.current.delete(G)}),filter:()=>o.current.shouldFilter,label:c||t["aria-label"],getDisablePointerSelection:()=>o.current.disablePointerSelection,listId:v,inputId:x,labelId:w,listInnerRef:A}),[]);function T(G,K){var J,ue;let de=(ue=(J=o.current)==null?void 0:J.filter)!=null?ue:dEe;return G?de(G,n.current.search,K):0}function D(){if(!n.current.search||o.current.shouldFilter===!1)return;let G=n.current.filtered.items,K=[];n.current.filtered.groups.forEach(ue=>{let de=s.current.get(ue),ie=0;de.forEach(be=>{let Ae=G.get(be);ie=Math.max(Ae,ie)}),K.push([ue,ie])});let J=A.current;U().sort((ue,de)=>{var ie,be;let Ae=ue.getAttribute("id"),_e=de.getAttribute("id");return((ie=G.get(_e))!=null?ie:0)-((be=G.get(Ae))!=null?be:0)}).forEach(ue=>{let de=ue.closest(ST);de?de.appendChild(ue.parentElement===de?ue:ue.closest(`${ST} > *`)):J.appendChild(ue.parentElement===J?ue:ue.closest(`${ST} > *`))}),K.sort((ue,de)=>de[1]-ue[1]).forEach(ue=>{var de;let ie=(de=A.current)==null?void 0:de.querySelector(`${by}[${tm}="${encodeURIComponent(ue[0])}"]`);ie==null||ie.parentElement.appendChild(ie)})}function M(){let G=U().find(J=>J.getAttribute("aria-disabled")!=="true"),K=G==null?void 0:G.getAttribute(tm);R.setState("value",K||void 0)}function L(){var G,K,J,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=(G=i.current.get(ie))==null?void 0:G.value)!=null?K:"",Ae=(ue=(J=i.current.get(ie))==null?void 0:J.keywords)!=null?ue:[],_e=T(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 G,K,J;let ue=F();ue&&(((G=ue.parentElement)==null?void 0:G.firstChild)===ue&&((J=(K=ue.closest(by))==null?void 0:K.querySelector(uEe))==null||J.scrollIntoView({block:"nearest"})),ue.scrollIntoView({block:"nearest"}))}function F(){var G;return(G=A.current)==null?void 0:G.querySelector(`${D8}[aria-selected="true"]`)}function U(){var G;return Array.from(((G=A.current)==null?void 0:G.querySelectorAll(tB))||[])}function Y(G){let K=U()[G];K&&R.setState("value",K.getAttribute(tm))}function W(G){var K;let J=F(),ue=U(),de=ue.findIndex(be=>be===J),ie=ue[de+G];(K=o.current)!=null&&K.loop&&(ie=de+G<0?ue[ue.length-1]:de+G===ue.length?ue[0]:ue[de+G]),ie&&R.setState("value",ie.getAttribute(tm))}function H(G){let K=F(),J=K==null?void 0:K.closest(by),ue;for(;J&&!ue;)J=G>0?wEe(J,by):_Ee(J,by),ue=J==null?void 0:J.querySelector(tB);ue?R.setState("value",ue.getAttribute(tm)):W(G)}let ee=()=>Y(U().length-1),re=G=>{G.preventDefault(),G.metaKey?ee():G.altKey?H(1):W(1)},X=G=>{G.preventDefault(),G.metaKey?Y(0):G.altKey?H(-1):W(-1)};return _.createElement(ms.div,{ref:e,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:G=>{var K;(K=g.onKeyDown)==null||K.call(g,G);let J=G.nativeEvent.isComposing||G.keyCode===229;if(!(G.defaultPrevented||J))switch(G.key){case"n":case"j":{y&&G.ctrlKey&&re(G);break}case"ArrowDown":{re(G);break}case"p":case"k":{y&&G.ctrlKey&&X(G);break}case"ArrowUp":{X(G);break}case"Home":{G.preventDefault(),Y(0);break}case"End":{G.preventDefault(),ee();break}case"Enter":{G.preventDefault();let ue=F();if(ue){let de=new Event(WD);ue.dispatchEvent(de)}}}}},_.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:EEe},c),aA(t,G=>_.createElement(M8.Provider,{value:R},_.createElement(N8.Provider,{value:E},G))))}),fEe=_.forwardRef((t,e)=>{var n,r;let s=Oc(),i=_.useRef(null),a=_.useContext(O8),o=y_(),c=I8(t),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:a==null?void 0:a.forceMount;Qh(()=>{if(!u)return o.item(s,a==null?void 0:a.id)},[u]);let f=$8(s,i,[t.value,t.children,i],t.keywords),l=aI(),d=Ad(k=>k.value&&k.value===f.current),m=Ad(k=>u||o.filter()===!1?!0:k.search?k.filtered.items.get(s)>0:!0);_.useEffect(()=>{let k=i.current;if(!(!k||t.disabled))return k.addEventListener(WD,p),()=>k.removeEventListener(WD,p)},[m,t.onSelect,t.disabled]);function p(){var k,R;h(),(R=(k=c.current).onSelect)==null||R.call(k,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(ms.div,{ref:Kh(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)}),hEe=_.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:s,...i}=t,a=Oc(),o=_.useRef(null),c=_.useRef(null),u=Oc(),f=y_(),l=Ad(m=>s||f.filter()===!1?!0:m.search?m.filtered.groups.has(a):!0);Qh(()=>f.group(a),[]),$8(a,o,[t.value,t.heading,c]);let d=_.useMemo(()=>({id:a,forceMount:s}),[s]);return _.createElement(ms.div,{ref:Kh(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),aA(t,m=>_.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},_.createElement(O8.Provider,{value:d},m))))}),pEe=_.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,s=_.useRef(null),i=Ad(a=>!a.search);return!n&&!i?null:_.createElement(ms.div,{ref:Kh(s,e),...r,"cmdk-separator":"",role:"separator"})}),mEe=_.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,s=t.value!=null,i=aI(),a=Ad(u=>u.search),o=Ad(u=>u.selectedItemId),c=y_();return _.useEffect(()=>{t.value!=null&&i.setState("search",t.value)},[t.value]),_.createElement(ms.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)}})}),gEe=_.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...s}=t,i=_.useRef(null),a=_.useRef(null),o=Ad(u=>u.selectedItemId),c=y_();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(ms.div,{ref:Kh(i,e),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":r,id:c.listId},aA(t,u=>_.createElement("div",{ref:Kh(a,c.listInnerRef),"cmdk-list-sizer":""},u)))}),vEe=_.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:a,...o}=t;return _.createElement(oEe,{open:n,onOpenChange:r},_.createElement(aEe,{container:a},_.createElement(lEe,{"cmdk-overlay":"",className:s}),_.createElement(cEe,{"aria-label":t.label,"cmdk-dialog":"",className:i},_.createElement(L8,{ref:e,...o}))))}),yEe=_.forwardRef((t,e)=>Ad(n=>n.filtered.count===0)?_.createElement(ms.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),bEe=_.forwardRef((t,e)=>{let{progress:n,children:r,label:s="Loading...",...i}=t;return _.createElement(ms.div,{ref:e,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},aA(t,a=>_.createElement("div",{"aria-hidden":!0},a)))}),Ti=Object.assign(L8,{List:gEe,Item:fEe,Input:mEe,Group:hEe,Separator:pEe,Dialog:vEe,Empty:yEe,Loading:bEe});function wEe(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function _Ee(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function I8(t){let e=_.useRef(t);return Qh(()=>{e.current=t}),e}var Qh=typeof window>"u"?_.useEffect:_.useLayoutEffect;function nm(t){let e=_.useRef();return e.current===void 0&&(e.current=t()),e}function Ad(t){let e=aI(),n=()=>t(e.snapshot());return _.useSyncExternalStore(e.subscribe,n,n)}function $8(t,e,n,r=[]){let s=_.useRef(),i=y_();return Qh(()=>{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(tm,o),s.current=o}),s}var xEe=()=>{let[t,e]=_.useState(),n=nm(()=>new Map);return Qh(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,s)=>{n.current.set(r,s),e({})}};function SEe(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function aA({asChild:t,children:e},n){return t&&_.isValidElement(e)?_.cloneElement(SEe(e),{ref:e.ref},n(e.props.children)):n(e)}var EEe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const CEe=AL,AEe=RL,REe=PL,OHe=d_,F8=_.forwardRef(({className:t,...e},n)=>P.jsx(a_,{ref:n,className:ce("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));F8.displayName=a_.displayName;const j8=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(REe,{children:[P.jsx(F8,{}),P.jsxs(l_,{ref:r,className:ce("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(d_,{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(mL,{className:"h-4 w-4"}),P.jsx("span",{className:"sr-only",children:ft("common.close")})]})]})]}));j8.displayName=l_.displayName;const z8=({className:t,...e})=>P.jsx("div",{className:ce("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});z8.displayName="DialogHeader";const B8=({className:t,...e})=>P.jsx("div",{className:ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});B8.displayName="DialogFooter";const U8=_.forwardRef(({className:t,...e},n)=>P.jsx(c_,{ref:n,className:ce("text-lg font-semibold leading-none tracking-tight",t),...e}));U8.displayName=c_.displayName;const H8=_.forwardRef(({className:t,...e},n)=>P.jsx(u_,{ref:n,className:ce("text-sm text-muted-foreground",t),...e}));H8.displayName=u_.displayName;const PEe=_.forwardRef(({className:t,...e},n)=>P.jsx(Ti,{ref:n,className:ce("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));PEe.displayName=Ti.displayName;const TEe=_.forwardRef(({className:t,...e},n)=>P.jsxs("div",{className:"flex items-center px-3 border-b","cmdk-input-wrapper":"",children:[P.jsx(Ife,{className:"w-4 h-4 mr-2 opacity-50 shrink-0"}),P.jsx(Ti.Input,{ref:n,className:ce("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})]}));TEe.displayName=Ti.Input.displayName;const kEe=_.forwardRef(({className:t,...e},n)=>P.jsx(Ti.List,{ref:n,className:ce("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));kEe.displayName=Ti.List.displayName;const DEe=_.forwardRef((t,e)=>P.jsx(Ti.Empty,{ref:e,className:"py-6 text-sm text-center",...t}));DEe.displayName=Ti.Empty.displayName;const NEe=_.forwardRef(({className:t,...e},n)=>P.jsx(Ti.Group,{ref:n,className:ce("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}));NEe.displayName=Ti.Group.displayName;const MEe=_.forwardRef(({className:t,...e},n)=>P.jsx(Ti.Separator,{ref:n,className:ce("-mx-1 h-px bg-border",t),...e}));MEe.displayName=Ti.Separator.displayName;const OEe=_.forwardRef(({className:t,...e},n)=>P.jsx(Ti.Item,{ref:n,className:ce("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}));OEe.displayName=Ti.Item.displayName;const LEe=["top","right","bottom","left"],ml=Math.min,to=Math.max,c1=Math.round,lS=Math.floor,Rd=t=>({x:t,y:t}),IEe={left:"right",right:"left",bottom:"top",top:"bottom"},$Ee={start:"end",end:"start"};function VD(t,e,n){return to(t,ml(e,n))}function Vc(t,e){return typeof t=="function"?t(e):t}function qc(t){return t.split("-")[0]}function Tv(t){return t.split("-")[1]}function lI(t){return t==="x"?"y":"x"}function cI(t){return t==="y"?"height":"width"}function Pd(t){return["top","bottom"].includes(qc(t))?"y":"x"}function uI(t){return lI(Pd(t))}function FEe(t,e,n){n===void 0&&(n=!1);const r=Tv(t),s=uI(t),i=cI(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=u1(a)),[a,u1(a)]}function jEe(t){const e=u1(t);return[qD(t),e,qD(e)]}function qD(t){return t.replace(/start|end/g,e=>$Ee[e])}function zEe(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 BEe(t,e,n,r){const s=Tv(t);let i=zEe(qc(t),n==="start",r);return s&&(i=i.map(a=>a+"-"+s),e&&(i=i.concat(i.map(qD)))),i}function u1(t){return t.replace(/left|right|bottom|top/g,e=>IEe[e])}function UEe(t){return{top:0,right:0,bottom:0,left:0,...t}}function W8(t){return typeof t!="number"?UEe(t):{top:t,right:t,bottom:t,left:t}}function d1(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 nB(t,e,n){let{reference:r,floating:s}=t;const i=Pd(e),a=uI(e),o=cI(a),c=qc(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(Tv(e)){case"start":m[a]-=d*(n&&u?-1:1);break;case"end":m[a]+=d*(n&&u?-1:1);break}return m}const HEe=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}=nB(u,r,c),d=r,m={},p=0;for(let h=0;h<o.length;h++){const{name:y,fn:g}=o[h],{x:v,y:w,data:x,reset:A}=await g({x:f,y:l,initialPlacement:r,placement:d,strategy:s,middlewareData:m,rects:u,platform:a,elements:{reference:t,floating:e}});f=v??f,l=w??l,m={...m,[y]:{...m[y],...x}},A&&p<=50&&(p++,typeof A=="object"&&(A.placement&&(d=A.placement),A.rects&&(u=A.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:s}):A.rects),{x:f,y:l}=nB(u,d,c)),h=-1)}return{x:f,y:l,placement:d,strategy:s,middlewareData:m}};async function Yb(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:a,elements:o,strategy:c}=t,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:l="floating",altBoundary:d=!1,padding:m=0}=Vc(e,t),p=W8(m),y=o[d?l==="floating"?"reference":"floating":l],g=d1(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:u,rootBoundary:f,strategy:c})),v=l==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),x=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},A=d1(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:v,offsetParent:w,strategy:c}):v);return{top:(g.top-A.top+p.top)/x.y,bottom:(A.bottom-g.bottom+p.bottom)/x.y,left:(g.left-A.left+p.left)/x.x,right:(A.right-g.right+p.right)/x.x}}const WEe=t=>({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=W8(f),d={x:n,y:r},m=uI(s),p=cI(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],k=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let R=k?k[w]:0;(!R||!await(a.isElement==null?void 0:a.isElement(k)))&&(R=o.floating[w]||i.floating[p]);const E=x/2-A/2,T=R/2-h[p]/2-1,D=ml(l[g],T),M=ml(l[v],T),L=D,I=R-h[p]-M,F=R/2-h[p]/2+E,U=VD(L,F,I),Y=!c.arrow&&Tv(s)!=null&&F!==U&&i.reference[p]/2-(F<L?D:M)-h[p]/2<0,W=Y?F<L?F-L:F-I:0;return{[m]:d[m]+W,data:{[m]:U,centerOffset:F-U-W,...Y&&{alignmentOffset:W}},reset:Y}}}),VEe=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:s,middlewareData:i,rects:a,initialPlacement:o,platform:c,elements:u}=e,{mainAxis:f=!0,crossAxis:l=!0,fallbackPlacements:d,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...y}=Vc(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=qc(s),v=Pd(o),w=qc(o)===o,x=await(c.isRTL==null?void 0:c.isRTL(u.floating)),A=d||(w||!h?[u1(o)]:jEe(o)),k=p!=="none";!d&&k&&A.push(...BEe(o,h,p,x));const R=[o,...A],E=await Yb(e,y),T=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&T.push(E[g]),l){const F=FEe(s,a,x);T.push(E[F[0]],E[F[1]])}if(D=[...D,{placement:s,overflows:T}],!T.every(F=>F<=0)){var M,L;const F=(((M=i.flip)==null?void 0:M.index)||0)+1,U=R[F];if(U)return{data:{index:F,overflows:D},reset:{placement:U}};let Y=(L=D.filter(W=>W.overflows[0]<=0).sort((W,H)=>W.overflows[1]-H.overflows[1])[0])==null?void 0:L.placement;if(!Y)switch(m){case"bestFit":{var I;const W=(I=D.filter(H=>{if(k){const ee=Pd(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];W&&(Y=W);break}case"initialPlacement":Y=o;break}if(s!==Y)return{reset:{placement:Y}}}return{}}}};function rB(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function sB(t){return LEe.some(e=>t[e]>=0)}const qEe=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 Yb(e,{...s,elementContext:"reference"}),a=rB(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:sB(a)}}}case"escaped":{const i=await Yb(e,{...s,altBoundary:!0}),a=rB(i,n.floating);return{data:{escapedOffsets:a,escaped:sB(a)}}}default:return{}}}}};async function GEe(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=qc(n),o=Tv(n),c=Pd(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 KEe=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 GEe(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}}}}},YEe=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 Yb(e,c),l=Pd(qc(s)),d=lI(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=VD(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=VD(v,p,w)}const h=o.fn({...e,[d]:m,[l]:p});return{...h,data:{x:h.x-n,y:h.y-r}}}}},XEe=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=Pd(s),d=lI(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;m<x?m=x:m>A&&(m=A)}if(u){var g,v;const w=d==="y"?"width":"height",x=["top","left"].includes(qc(s)),A=i.reference[l]-i.floating[w]+(x&&((g=a.offset)==null?void 0:g[l])||0)+(x?0:y.crossAxis),k=i.reference[l]+i.reference[w]+(x?0:((v=a.offset)==null?void 0:v[l])||0)-(x?y.crossAxis:0);p<A?p=A:p>k&&(p=k)}return{[d]:m,[l]:p}}}},QEe=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 Yb(e,o),u=qc(n),f=Tv(n),l=Pd(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=ml(m-c[p],y),w=ml(d-c[h],g),x=!e.middlewareData.shift;let A=v,k=w;if(l?k=f||x?ml(w,g):g:A=f||x?ml(v,y):y,x&&!f){const E=to(c.left,0),T=to(c.right,0),D=to(c.top,0),M=to(c.bottom,0);l?k=d-2*(E!==0||T!==0?E+T:to(c.left,c.right)):A=m-2*(D!==0||M!==0?D+M:to(c.top,c.bottom))}await a({...e,availableWidth:k,availableHeight:A});const R=await s.getDimensions(i.floating);return d!==R.width||m!==R.height?{reset:{rects:!0}}:{}}}};function kv(t){return V8(t)?(t.nodeName||"").toLowerCase():"#document"}function io(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function eu(t){var e;return(e=(V8(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function V8(t){return t instanceof Node||t instanceof io(t).Node}function Sl(t){return t instanceof Element||t instanceof io(t).Element}function El(t){return t instanceof HTMLElement||t instanceof io(t).HTMLElement}function iB(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof io(t).ShadowRoot}function b_(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=ka(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(s)}function JEe(t){return["table","td","th"].includes(kv(t))}function lA(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function dI(t){const e=fI(),n=ka(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 ZEe(t){let e=Td(t);for(;El(e)&&!cv(e);){if(lA(e))return null;if(dI(e))return e;e=Td(e)}return null}function fI(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function cv(t){return["html","body","#document"].includes(kv(t))}function ka(t){return io(t).getComputedStyle(t)}function cA(t){return Sl(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Td(t){if(kv(t)==="html")return t;const e=t.assignedSlot||t.parentNode||iB(t)&&t.host||eu(t);return iB(e)?e.host:e}function q8(t){const e=Td(t);return cv(e)?t.ownerDocument?t.ownerDocument.body:t.body:El(e)&&b_(e)?e:q8(e)}function Xb(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=q8(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),a=io(s);return i?e.concat(a,a.visualViewport||[],b_(s)?s:[],a.frameElement&&n?Xb(a.frameElement):[]):e.concat(s,Xb(s,[],n))}function G8(t){const e=ka(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=c1(n)!==i||c1(r)!==a;return o&&(n=i,r=a),{width:n,height:r,$:o}}function hI(t){return Sl(t)?t:t.contextElement}function jm(t){const e=hI(t);if(!El(e))return Rd(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=G8(e);let a=(i?c1(n.width):n.width)/r,o=(i?c1(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const e1e=Rd(0);function K8(t){const e=io(t);return!fI()||!e.visualViewport?e1e:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function t1e(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==io(t)?!1:e}function Jh(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=hI(t);let a=Rd(1);e&&(r?Sl(r)&&(a=jm(r)):a=jm(t));const o=t1e(i,n,r)?K8(i):Rd(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=io(i),m=r&&Sl(r)?io(r):r;let p=d,h=p.frameElement;for(;h&&r&&m!==p;){const y=jm(h),g=h.getBoundingClientRect(),v=ka(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=io(h),h=p.frameElement}}return d1({width:f,height:l,x:c,y:u})}function n1e(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",a=eu(r),o=e?lA(e.floating):!1;if(r===a||o&&i)return n;let c={scrollLeft:0,scrollTop:0},u=Rd(1);const f=Rd(0),l=El(r);if((l||!l&&!i)&&((kv(r)!=="body"||b_(a))&&(c=cA(r)),El(r))){const d=Jh(r);u=jm(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 r1e(t){return Array.from(t.getClientRects())}function Y8(t){return Jh(eu(t)).left+cA(t).scrollLeft}function s1e(t){const e=eu(t),n=cA(t),r=t.ownerDocument.body,s=to(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=to(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Y8(t);const o=-n.scrollTop;return ka(r).direction==="rtl"&&(a+=to(e.clientWidth,r.clientWidth)-s),{width:s,height:i,x:a,y:o}}function i1e(t,e){const n=io(t),r=eu(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=fI();(!u||u&&e==="fixed")&&(o=s.offsetLeft,c=s.offsetTop)}return{width:i,height:a,x:o,y:c}}function o1e(t,e){const n=Jh(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=El(t)?jm(t):Rd(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 oB(t,e,n){let r;if(e==="viewport")r=i1e(t,n);else if(e==="document")r=s1e(eu(t));else if(Sl(e))r=o1e(e,n);else{const s=K8(t);r={...e,x:e.x-s.x,y:e.y-s.y}}return d1(r)}function X8(t,e){const n=Td(t);return n===e||!Sl(n)||cv(n)?!1:ka(n).position==="fixed"||X8(n,e)}function a1e(t,e){const n=e.get(t);if(n)return n;let r=Xb(t,[],!1).filter(o=>Sl(o)&&kv(o)!=="body"),s=null;const i=ka(t).position==="fixed";let a=i?Td(t):t;for(;Sl(a)&&!cv(a);){const o=ka(a),c=dI(a);!c&&o.position==="fixed"&&(s=null),(i?!c&&!s:!c&&o.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||b_(a)&&!c&&X8(t,a))?r=r.filter(f=>f!==a):s=o,a=Td(a)}return e.set(t,r),r}function l1e(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const a=[...n==="clippingAncestors"?lA(e)?[]:a1e(e,this._c):[].concat(n),r],o=a[0],c=a.reduce((u,f)=>{const l=oB(e,f,s);return u.top=to(l.top,u.top),u.right=ml(l.right,u.right),u.bottom=ml(l.bottom,u.bottom),u.left=to(l.left,u.left),u},oB(e,o,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function c1e(t){const{width:e,height:n}=G8(t);return{width:e,height:n}}function u1e(t,e,n){const r=El(e),s=eu(e),i=n==="fixed",a=Jh(t,!0,i,e);let o={scrollLeft:0,scrollTop:0};const c=Rd(0);if(r||!r&&!i)if((kv(e)!=="body"||b_(s))&&(o=cA(e)),r){const l=Jh(e,!0,i,e);c.x=l.x+e.clientLeft,c.y=l.y+e.clientTop}else s&&(c.x=Y8(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 ET(t){return ka(t).position==="static"}function aB(t,e){return!El(t)||ka(t).position==="fixed"?null:e?e(t):t.offsetParent}function Q8(t,e){const n=io(t);if(lA(t))return n;if(!El(t)){let s=Td(t);for(;s&&!cv(s);){if(Sl(s)&&!ET(s))return s;s=Td(s)}return n}let r=aB(t,e);for(;r&&JEe(r)&&ET(r);)r=aB(r,e);return r&&cv(r)&&ET(r)&&!dI(r)?n:r||ZEe(t)||n}const d1e=async function(t){const e=this.getOffsetParent||Q8,n=this.getDimensions,r=await n(t.floating);return{reference:u1e(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function f1e(t){return ka(t).direction==="rtl"}const h1e={convertOffsetParentRelativeRectToViewportRelativeRect:n1e,getDocumentElement:eu,getClippingRect:l1e,getOffsetParent:Q8,getElementRects:d1e,getClientRects:r1e,getDimensions:c1e,getScale:jm,isElement:Sl,isRTL:f1e};function p1e(t,e){let n=null,r;const s=eu(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=lS(f),p=lS(s.clientWidth-(u+l)),h=lS(s.clientHeight-(f+d)),y=lS(u),v={rootMargin:-m+"px "+-p+"px "+-h+"px "+-y+"px",threshold:to(0,ml(1,c))||1};let w=!0;function x(A){const k=A[0].intersectionRatio;if(k!==c){if(!w)return a();k?a(!1,k):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 m1e(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=hI(t),f=s||i?[...u?Xb(u):[],...Xb(e)]:[];f.forEach(g=>{s&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const l=u&&o?p1e(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?Jh(t):null;c&&y();function y(){const g=Jh(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 g1e=KEe,v1e=YEe,y1e=VEe,b1e=QEe,w1e=qEe,lB=WEe,_1e=XEe,x1e=(t,e,n)=>{const r=new Map,s={platform:h1e,...n},i={...s.platform,_c:r};return HEe(t,e,{...s,platform:i})};var HS=typeof document<"u"?_.useLayoutEffect:_.useEffect;function f1(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(!f1(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)&&!f1(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function J8(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function cB(t,e){const n=J8(t);return Math.round(e*n)/n}function uB(t){const e=_.useRef(t);return HS(()=>{e.current=t}),e}function S1e(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);f1(d,r)||m(r);const[p,h]=_.useState(null),[y,g]=_.useState(null),v=_.useCallback(W=>{W!==k.current&&(k.current=W,h(W))},[]),w=_.useCallback(W=>{W!==R.current&&(R.current=W,g(W))},[]),x=i||p,A=a||y,k=_.useRef(null),R=_.useRef(null),E=_.useRef(f),T=c!=null,D=uB(c),M=uB(s),L=_.useCallback(()=>{if(!k.current||!R.current)return;const W={placement:e,strategy:n,middleware:d};M.current&&(W.platform=M.current),x1e(k.current,R.current,W).then(H=>{const ee={...H,isPositioned:!0};I.current&&!f1(E.current,ee)&&(E.current=ee,Ns.flushSync(()=>{l(ee)}))})},[d,e,n,M]);HS(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,l(W=>({...W,isPositioned:!1})))},[u]);const I=_.useRef(!1);HS(()=>(I.current=!0,()=>{I.current=!1}),[]),HS(()=>{if(x&&(k.current=x),A&&(R.current=A),x&&A){if(D.current)return D.current(x,A,L);L()}},[x,A,L,D,T]);const F=_.useMemo(()=>({reference:k,floating:R,setReference:v,setFloating:w}),[v,w]),U=_.useMemo(()=>({reference:x,floating:A}),[x,A]),Y=_.useMemo(()=>{const W={position:n,left:0,top:0};if(!U.floating)return W;const H=cB(U.floating,f.x),ee=cB(U.floating,f.y);return o?{...W,transform:"translate("+H+"px, "+ee+"px)",...J8(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 E1e=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?lB({element:r.current,padding:s}).fn(n):{}:r?lB({element:r,padding:s}).fn(n):{}}}},C1e=(t,e)=>({...g1e(t),options:[t,e]}),A1e=(t,e)=>({...v1e(t),options:[t,e]}),R1e=(t,e)=>({..._1e(t),options:[t,e]}),P1e=(t,e)=>({...y1e(t),options:[t,e]}),T1e=(t,e)=>({...b1e(t),options:[t,e]}),k1e=(t,e)=>({...w1e(t),options:[t,e]}),D1e=(t,e)=>({...E1e(t),options:[t,e]});var N1e="Arrow",Z8=_.forwardRef((t,e)=>{const{children:n,width:r=10,height:s=5,...i}=t;return P.jsx(De.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"})})});Z8.displayName=N1e;var M1e=Z8,pI="Popper",[eq,Rl]=Tn(pI),[O1e,tq]=eq(pI),nq=t=>{const{__scopePopper:e,children:n}=t,[r,s]=_.useState(null);return P.jsx(O1e,{scope:e,anchor:r,onAnchorChange:s,children:n})};nq.displayName=pI;var rq="PopperAnchor",sq=_.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...s}=t,i=tq(rq,n),a=_.useRef(null),o=tt(e,a);return _.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:P.jsx(De.div,{...s,ref:o})});sq.displayName=rq;var mI="PopperContent",[L1e,I1e]=eq(mI),iq=_.forwardRef((t,e)=>{var ie,be,Ae,_e,Oe,Ne;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=tq(mI,n),[g,v]=_.useState(null),w=tt(e,ye=>v(ye)),[x,A]=_.useState(null),k=v_(x),R=(k==null?void 0:k.width)??0,E=(k==null?void 0:k.height)??0,T=r+(i!=="center"?"-"+i:""),D=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},M=Array.isArray(u)?u:[u],L=M.length>0,I={padding:D,boundary:M.filter(F1e),altBoundary:L},{refs:F,floatingStyles:U,placement:Y,isPositioned:W,middlewareData:H}=S1e({strategy:"fixed",placement:T,whileElementsMounted:(...ye)=>m1e(...ye,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[C1e({mainAxis:s+E,alignmentAxis:a}),c&&A1e({mainAxis:!0,crossAxis:!1,limiter:l==="partial"?R1e():void 0,...I}),c&&P1e({...I}),T1e({...I,apply:({elements:ye,rects:$e,availableWidth:ut,availableHeight:Qe})=>{const{width:yt,height:En}=$e.reference,Xt=ye.floating.style;Xt.setProperty("--radix-popper-available-width",`${ut}px`),Xt.setProperty("--radix-popper-available-height",`${Qe}px`),Xt.setProperty("--radix-popper-anchor-width",`${yt}px`),Xt.setProperty("--radix-popper-anchor-height",`${En}px`)}}),x&&D1e({element:x,padding:o}),j1e({arrowWidth:R,arrowHeight:E}),d&&k1e({strategy:"referenceHidden",...I})]}),[ee,re]=lq(Y),X=Ut(p);Ln(()=>{W&&(X==null||X())},[W,X]);const G=(ie=H.arrow)==null?void 0:ie.x,K=(be=H.arrow)==null?void 0:be.y,J=((Ae=H.arrow)==null?void 0:Ae.centerOffset)!==0,[ue,de]=_.useState();return Ln(()=>{g&&de(window.getComputedStyle(g).zIndex)},[g]),P.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:W?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[(_e=H.transformOrigin)==null?void 0:_e.x,(Oe=H.transformOrigin)==null?void 0:Oe.y].join(" "),...((Ne=H.hide)==null?void 0:Ne.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:P.jsx(L1e,{scope:n,placedSide:ee,onArrowChange:A,arrowX:G,arrowY:K,shouldHideArrow:J,children:P.jsx(De.div,{"data-side":ee,"data-align":re,...h,ref:w,style:{...h.style,animation:W?void 0:"none"}})})})});iq.displayName=mI;var oq="PopperArrow",$1e={top:"bottom",right:"left",bottom:"top",left:"right"},aq=_.forwardRef(function(e,n){const{__scopePopper:r,...s}=e,i=I1e(oq,r),a=$1e[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(M1e,{...s,ref:n,style:{...s.style,display:"block"}})})});aq.displayName=oq;function F1e(t){return t!==null}var j1e=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]=lq(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 lq(t){const[e,n="center"]=t.split("-");return[e,n]}var uA=nq,Dv=sq,w_=iq,__=aq,CT="rovingFocusGroup.onEntryFocus",z1e={bubbles:!1,cancelable:!0},dA="RovingFocusGroup",[GD,cq,B1e]=Xc(dA),[U1e,Pl]=Tn(dA,[B1e]),[H1e,W1e]=U1e(dA),uq=_.forwardRef((t,e)=>P.jsx(GD.Provider,{scope:t.__scopeRovingFocusGroup,children:P.jsx(GD.Slot,{scope:t.__scopeRovingFocusGroup,children:P.jsx(V1e,{...t,ref:e})})}));uq.displayName=dA;var V1e=_.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=Ma(i),[h=null,y]=sr({prop:a,defaultProp:o,onChange:c}),[g,v]=_.useState(!1),w=Ut(u),x=cq(n),A=_.useRef(!1),[k,R]=_.useState(0);return _.useEffect(()=>{const E=d.current;if(E)return E.addEventListener(CT,w),()=>E.removeEventListener(CT,w)},[w]),P.jsx(H1e,{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(De.div,{tabIndex:g||k===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 T=!A.current;if(E.target===E.currentTarget&&T&&!g){const D=new CustomEvent(CT,z1e);if(E.currentTarget.dispatchEvent(D),!D.defaultPrevented){const M=x().filter(Y=>Y.focusable),L=M.find(Y=>Y.active),I=M.find(Y=>Y.id===h),U=[L,I,...M].filter(Boolean).map(Y=>Y.ref.current);hq(U,f)}}A.current=!1}),onBlur:me(t.onBlur,()=>v(!1))})})}),dq="RovingFocusGroupItem",fq=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,...a}=t,o=Vr(),c=i||o,u=W1e(dq,n),f=u.currentTabStopId===c,l=cq(n),{onFocusableItemAdd:d,onFocusableItemRemove:m}=u;return _.useEffect(()=>{if(r)return d(),()=>m()},[r,d,m]),P.jsx(GD.ItemSlot,{scope:n,id:c,focusable:r,active:s,children:P.jsx(De.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=K1e(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?Y1e(g,v+1):g.slice(v+1)}setTimeout(()=>hq(g))}})})})});fq.displayName=dq;var q1e={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function G1e(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function K1e(t,e,n){const r=G1e(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return q1e[r]}function hq(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function Y1e(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var x_=uq,S_=fq,KD=["Enter"," "],X1e=["ArrowDown","PageUp","Home"],pq=["ArrowUp","PageDown","End"],Q1e=[...X1e,...pq],J1e={ltr:[...KD,"ArrowRight"],rtl:[...KD,"ArrowLeft"]},Z1e={ltr:["ArrowLeft"],rtl:["ArrowRight"]},E_="Menu",[Qb,eCe,tCe]=Xc(E_),[gp,C_]=Tn(E_,[tCe,Rl,Pl]),fA=Rl(),mq=Pl(),[nCe,vp]=gp(E_),[rCe,A_]=gp(E_),gq=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:s,onOpenChange:i,modal:a=!0}=t,o=fA(e),[c,u]=_.useState(null),f=_.useRef(!1),l=Ut(i),d=Ma(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(uA,{...o,children:P.jsx(nCe,{scope:e,open:n,onOpenChange:l,content:c,onContentChange:u,children:P.jsx(rCe,{scope:e,onClose:_.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:f,dir:d,modal:a,children:r})})})};gq.displayName=E_;var sCe="MenuAnchor",gI=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=fA(n);return P.jsx(Dv,{...s,...r,ref:e})});gI.displayName=sCe;var vI="MenuPortal",[iCe,vq]=gp(vI,{forceMount:void 0}),yq=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:s}=t,i=vp(vI,e);return P.jsx(iCe,{scope:e,forceMount:n,children:P.jsx(Hn,{present:n||i.open,children:P.jsx(Sv,{asChild:!0,container:s,children:r})})})};yq.displayName=vI;var Fo="MenuContent",[oCe,yI]=gp(Fo),bq=_.forwardRef((t,e)=>{const n=vq(Fo,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=vp(Fo,t.__scopeMenu),a=A_(Fo,t.__scopeMenu);return P.jsx(Qb.Provider,{scope:t.__scopeMenu,children:P.jsx(Hn,{present:r||i.open,children:P.jsx(Qb.Slot,{scope:t.__scopeMenu,children:a.modal?P.jsx(aCe,{...s,ref:e}):P.jsx(lCe,{...s,ref:e})})})})}),aCe=_.forwardRef((t,e)=>{const n=vp(Fo,t.__scopeMenu),r=_.useRef(null),s=tt(e,r);return _.useEffect(()=>{const i=r.current;if(i)return Ev(i)},[]),P.jsx(bI,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:me(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),lCe=_.forwardRef((t,e)=>{const n=vp(Fo,t.__scopeMenu);return P.jsx(bI,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),bI=_.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=vp(Fo,n),g=A_(Fo,n),v=fA(n),w=mq(n),x=eCe(n),[A,k]=_.useState(null),R=_.useRef(null),E=tt(e,R,y.onContentChange),T=_.useRef(0),D=_.useRef(""),M=_.useRef(0),L=_.useRef(null),I=_.useRef("right"),F=_.useRef(0),U=p?o_:_.Fragment,Y=p?{as:Ra,allowPinchZoom:!0}:void 0,W=ee=>{var ie,be;const re=D.current+ee,X=x().filter(Ae=>!Ae.disabled),G=document.activeElement,K=(ie=X.find(Ae=>Ae.ref.current===G))==null?void 0:ie.textValue,J=X.map(Ae=>Ae.textValue),ue=wCe(J,re,K),de=(be=X.find(Ae=>Ae.textValue===ue))==null?void 0:be.ref.current;(function Ae(_e){D.current=_e,window.clearTimeout(T.current),_e!==""&&(T.current=window.setTimeout(()=>Ae(""),1e3))})(re),de&&setTimeout(()=>de.focus())};_.useEffect(()=>()=>window.clearTimeout(T.current),[]),FC();const H=_.useCallback(ee=>{var X,G;return I.current===((X=L.current)==null?void 0:X.side)&&xCe(ee,(G=L.current)==null?void 0:G.area)},[]);return P.jsx(oCe,{scope:n,searchRef:D,onItemEnter:_.useCallback(ee=>{H(ee)&&ee.preventDefault()},[H]),onItemLeave:_.useCallback(ee=>{var re;H(ee)||((re=R.current)==null||re.focus(),k(null))},[H]),onTriggerLeave:_.useCallback(ee=>{H(ee)&&ee.preventDefault()},[H]),pointerGraceTimerRef:M,onPointerGraceIntentChange:_.useCallback(ee=>{L.current=ee},[]),children:P.jsx(U,{...Y,children:P.jsx(i_,{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(x_,{asChild:!0,...w,dir:g.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:k,onEntryFocus:me(c,ee=>{g.isUsingKeyboardRef.current||ee.preventDefault()}),preventScrollOnEntryFocus:!0,children:P.jsx(w_,{role:"menu","aria-orientation":"vertical","data-state":Lq(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,G=ee.ctrlKey||ee.altKey||ee.metaKey,K=ee.key.length===1;X&&(ee.key==="Tab"&&ee.preventDefault(),!G&&K&&W(ee.key));const J=R.current;if(ee.target!==J||!Q1e.includes(ee.key))return;ee.preventDefault();const de=x().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);pq.includes(ee.key)&&de.reverse(),yCe(de)}),onBlur:me(t.onBlur,ee=>{ee.currentTarget.contains(ee.target)||(window.clearTimeout(T.current),D.current="")}),onPointerMove:me(t.onPointerMove,Jb(ee=>{const re=ee.target,X=F.current!==ee.clientX;if(ee.currentTarget.contains(re)&&X){const G=ee.clientX>F.current?"right":"left";I.current=G,F.current=ee.clientX}}))})})})})})})});bq.displayName=Fo;var cCe="MenuGroup",wI=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return P.jsx(De.div,{role:"group",...r,ref:e})});wI.displayName=cCe;var uCe="MenuLabel",wq=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return P.jsx(De.div,{...r,ref:e})});wq.displayName=uCe;var h1="MenuItem",dB="menu.itemSelect",hA=_.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...s}=t,i=_.useRef(null),a=A_(h1,t.__scopeMenu),o=yI(h1,t.__scopeMenu),c=tt(e,i),u=_.useRef(!1),f=()=>{const l=i.current;if(!n&&l){const d=new CustomEvent(dB,{bubbles:!0,cancelable:!0});l.addEventListener(dB,m=>r==null?void 0:r(m),{once:!0}),Wb(l,d),d.defaultPrevented?u.current=!1:a.onClose()}};return P.jsx(_q,{...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===" "||KD.includes(l.key)&&(l.currentTarget.click(),l.preventDefault())})})});hA.displayName=h1;var _q=_.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=t,a=yI(h1,n),o=mq(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(Qb.ItemSlot,{scope:n,disabled:r,textValue:s??d,children:P.jsx(S_,{asChild:!0,...o,focusable:!r,children:P.jsx(De.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,Jb(p=>{r?a.onItemLeave(p):(a.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:me(t.onPointerLeave,Jb(p=>a.onItemLeave(p))),onFocus:me(t.onFocus,()=>l(!0)),onBlur:me(t.onBlur,()=>l(!1))})})})}),dCe="MenuCheckboxItem",xq=_.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...s}=t;return P.jsx(Rq,{scope:t.__scopeMenu,checked:n,children:P.jsx(hA,{role:"menuitemcheckbox","aria-checked":p1(n)?"mixed":n,...s,ref:e,"data-state":xI(n),onSelect:me(s.onSelect,()=>r==null?void 0:r(p1(n)?!0:!n),{checkForDefaultPrevented:!1})})})});xq.displayName=dCe;var Sq="MenuRadioGroup",[fCe,hCe]=gp(Sq,{value:void 0,onValueChange:()=>{}}),Eq=_.forwardRef((t,e)=>{const{value:n,onValueChange:r,...s}=t,i=Ut(r);return P.jsx(fCe,{scope:t.__scopeMenu,value:n,onValueChange:i,children:P.jsx(wI,{...s,ref:e})})});Eq.displayName=Sq;var Cq="MenuRadioItem",Aq=_.forwardRef((t,e)=>{const{value:n,...r}=t,s=hCe(Cq,t.__scopeMenu),i=n===s.value;return P.jsx(Rq,{scope:t.__scopeMenu,checked:i,children:P.jsx(hA,{role:"menuitemradio","aria-checked":i,...r,ref:e,"data-state":xI(i),onSelect:me(r.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,n)},{checkForDefaultPrevented:!1})})})});Aq.displayName=Cq;var _I="MenuItemIndicator",[Rq,pCe]=gp(_I,{checked:!1}),Pq=_.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...s}=t,i=pCe(_I,n);return P.jsx(Hn,{present:r||p1(i.checked)||i.checked===!0,children:P.jsx(De.span,{...s,ref:e,"data-state":xI(i.checked)})})});Pq.displayName=_I;var mCe="MenuSeparator",Tq=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return P.jsx(De.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});Tq.displayName=mCe;var gCe="MenuArrow",kq=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=fA(n);return P.jsx(__,{...s,...r,ref:e})});kq.displayName=gCe;var vCe="MenuSub",[LHe,Dq]=gp(vCe),Fy="MenuSubTrigger",Nq=_.forwardRef((t,e)=>{const n=vp(Fy,t.__scopeMenu),r=A_(Fy,t.__scopeMenu),s=Dq(Fy,t.__scopeMenu),i=yI(Fy,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(gI,{asChild:!0,...u,children:P.jsx(_q,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":Lq(n.open),...t,ref:n_(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,Jb(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,Jb(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===" "||J1e[r.dir].includes(l.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),l.preventDefault())})})})});Nq.displayName=Fy;var Mq="MenuSubContent",Oq=_.forwardRef((t,e)=>{const n=vq(Fo,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=vp(Fo,t.__scopeMenu),a=A_(Fo,t.__scopeMenu),o=Dq(Mq,t.__scopeMenu),c=_.useRef(null),u=tt(e,c);return P.jsx(Qb.Provider,{scope:t.__scopeMenu,children:P.jsx(Hn,{present:r||i.open,children:P.jsx(Qb.Slot,{scope:t.__scopeMenu,children:P.jsx(bI,{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=Z1e[a.dir].includes(f.key);l&&d&&(i.onOpenChange(!1),(m=o.trigger)==null||m.focus(),f.preventDefault())})})})})})});Oq.displayName=Mq;function Lq(t){return t?"open":"closed"}function p1(t){return t==="indeterminate"}function xI(t){return p1(t)?"indeterminate":t?"checked":"unchecked"}function yCe(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function bCe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function wCe(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=bCe(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 _Ce(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;i<e.length;a=i++){const o=e[i].x,c=e[i].y,u=e[a].x,f=e[a].y;c>r!=f>r&&n<(u-o)*(r-c)/(f-c)+o&&(s=!s)}return s}function xCe(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return _Ce(n,e)}function Jb(t){return e=>e.pointerType==="mouse"?t(e):void 0}var SCe=gq,SI=gI,EI=yq,CI=bq,AI=wI,RI=wq,PI=hA,TI=xq,kI=Eq,DI=Aq,NI=Pq,MI=Tq,OI=kq,LI=Nq,II=Oq,Iq="ContextMenu",[ECe,IHe]=Tn(Iq,[C_]),ki=C_(),[$He,$q]=ECe(Iq),Fq="ContextMenuTrigger",CCe=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=t,i=$q(Fq,n),a=ki(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(SI,{...a,virtualRef:c}),P.jsx(De.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:me(t.onContextMenu,d=>{f(),l(d),d.preventDefault()}),onPointerDown:r?t.onPointerDown:me(t.onPointerDown,cS(d=>{f(),u.current=window.setTimeout(()=>l(d),700)})),onPointerMove:r?t.onPointerMove:me(t.onPointerMove,cS(f)),onPointerCancel:r?t.onPointerCancel:me(t.onPointerCancel,cS(f)),onPointerUp:r?t.onPointerUp:me(t.onPointerUp,cS(f))})]})});CCe.displayName=Fq;var ACe="ContextMenuPortal",jq=t=>{const{__scopeContextMenu:e,...n}=t,r=ki(e);return P.jsx(EI,{...r,...n})};jq.displayName=ACe;var zq="ContextMenuContent",Bq=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=$q(zq,n),i=ki(n),a=_.useRef(!1);return P.jsx(CI,{...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)"}})});Bq.displayName=zq;var RCe="ContextMenuGroup",PCe=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=ki(n);return P.jsx(AI,{...s,...r,ref:e})});PCe.displayName=RCe;var TCe="ContextMenuLabel",Uq=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=ki(n);return P.jsx(RI,{...s,...r,ref:e})});Uq.displayName=TCe;var kCe="ContextMenuItem",Hq=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=ki(n);return P.jsx(PI,{...s,...r,ref:e})});Hq.displayName=kCe;var DCe="ContextMenuCheckboxItem",Wq=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=ki(n);return P.jsx(TI,{...s,...r,ref:e})});Wq.displayName=DCe;var NCe="ContextMenuRadioGroup",MCe=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=ki(n);return P.jsx(kI,{...s,...r,ref:e})});MCe.displayName=NCe;var OCe="ContextMenuRadioItem",Vq=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=ki(n);return P.jsx(DI,{...s,...r,ref:e})});Vq.displayName=OCe;var LCe="ContextMenuItemIndicator",qq=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=ki(n);return P.jsx(NI,{...s,...r,ref:e})});qq.displayName=LCe;var ICe="ContextMenuSeparator",Gq=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=ki(n);return P.jsx(MI,{...s,...r,ref:e})});Gq.displayName=ICe;var $Ce="ContextMenuArrow",FCe=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=ki(n);return P.jsx(OI,{...s,...r,ref:e})});FCe.displayName=$Ce;var jCe="ContextMenuSubTrigger",Kq=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=ki(n);return P.jsx(LI,{...s,...r,ref:e})});Kq.displayName=jCe;var zCe="ContextMenuSubContent",Yq=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=ki(n);return P.jsx(II,{...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)"}})});Yq.displayName=zCe;function cS(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var BCe=jq,Xq=Bq,Qq=Uq,Jq=Hq,Zq=Wq,eG=Vq,tG=qq,nG=Gq,rG=Kq,sG=Yq;const UCe=_.forwardRef(({className:t,inset:e,children:n,...r},s)=>P.jsxs(rG,{ref:s,className:ce("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(s_,{className:"ml-auto h-4 w-4"})]}));UCe.displayName=rG.displayName;const HCe=_.forwardRef(({className:t,...e},n)=>P.jsx(sG,{ref:n,className:ce("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}));HCe.displayName=sG.displayName;const WCe=_.forwardRef(({className:t,...e},n)=>P.jsx(BCe,{children:P.jsx(Xq,{ref:n,className:ce("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})}));WCe.displayName=Xq.displayName;const VCe=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(Jq,{ref:r,className:ce("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}));VCe.displayName=Jq.displayName;const qCe=_.forwardRef(({className:t,children:e,checked:n,...r},s)=>P.jsxs(Zq,{ref:s,className:ce("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(tG,{children:P.jsx(r_,{className:"h-4 w-4"})})}),e]}));qCe.displayName=Zq.displayName;const GCe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(eG,{ref:r,className:ce("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(tG,{children:P.jsx($C,{className:"h-2 w-2 fill-current"})})}),e]}));GCe.displayName=eG.displayName;const KCe=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(Qq,{ref:r,className:ce("px-2 py-1.5 text-sm font-semibold text-foreground",e&&"pl-8",t),...n}));KCe.displayName=Qq.displayName;const YCe=_.forwardRef(({className:t,...e},n)=>P.jsx(nG,{ref:n,className:ce("-mx-1 my-1 h-px bg-border",t),...e}));YCe.displayName=nG.displayName;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 fB(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function iG(...t){return e=>{let n=!1;const r=t.map(s=>{const i=fB(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():fB(t[s],null)}}}}function yp(...t){return _.useCallback(iG(...t),t)}function XCe(t,e){const n=_.createContext(e),r=i=>{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 QCe(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,JCe(s,...e)]}function JCe(...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 $I=_.forwardRef((t,e)=>{const{children:n,...r}=t,s=_.Children.toArray(n),i=s.find(eAe);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(YD,{...r,ref:e,children:_.isValidElement(a)?_.cloneElement(a,void 0,o):null})}return P.jsx(YD,{...r,ref:e,children:n})});$I.displayName="Slot";var YD=_.forwardRef((t,e)=>{const{children:n,...r}=t;if(_.isValidElement(n)){const s=nAe(n),i=tAe(r,n.props);return n.type!==_.Fragment&&(i.ref=e?iG(e,s):s),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});YD.displayName="SlotClone";var ZCe=({children:t})=>P.jsx(P.Fragment,{children:t});function eAe(t){return _.isValidElement(t)&&t.type===ZCe}function tAe(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 nAe(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 rAe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],tu=rAe.reduce((t,e)=>{const n=_.forwardRef((r,s)=>{const{asChild:i,...a}=r,o=i?$I: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 sAe(t,e){t&&Ns.flushSync(()=>t.dispatchEvent(e))}var iAe="DismissableLayer",XD="dismissableLayer.update",oAe="dismissableLayer.pointerDownOutside",aAe="dismissableLayer.focusOutside",hB,oG=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),aG=_.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,onDismiss:o,...c}=t,u=_.useContext(oG),[f,l]=_.useState(null),d=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=_.useState({}),p=yp(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=uAe(R=>{const E=R.target,T=[...u.branches].some(D=>D.contains(E));!x||T||(s==null||s(R),a==null||a(R),R.defaultPrevented||o==null||o())},d),k=dAe(R=>{const E=R.target;[...u.branches].some(D=>D.contains(E))||(i==null||i(R),a==null||a(R),R.defaultPrevented||o==null||o())},d);return vV(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&&(hB=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),pB(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=hB)}},[f,d,n,u]),_.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),pB())},[f,u]),_.useEffect(()=>{const R=()=>m({});return document.addEventListener(XD,R),()=>document.removeEventListener(XD,R)},[]),P.jsx(tu.div,{...c,ref:p,style:{pointerEvents:w?x?"auto":"none":void 0,...t.style},onFocusCapture:Sd(t.onFocusCapture,k.onFocusCapture),onBlurCapture:Sd(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Sd(t.onPointerDownCapture,A.onPointerDownCapture)})});aG.displayName=iAe;var lAe="DismissableLayerBranch",cAe=_.forwardRef((t,e)=>{const n=_.useContext(oG),r=_.useRef(null),s=yp(e,r);return _.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),P.jsx(tu.div,{...t,ref:s})});cAe.displayName=lAe;function uAe(t,e=globalThis==null?void 0:globalThis.document){const n=Ut(t),r=_.useRef(!1),s=_.useRef(()=>{});return _.useEffect(()=>{const i=o=>{if(o.target&&!r.current){let c=function(){lG(oAe,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 dAe(t,e=globalThis==null?void 0:globalThis.document){const n=Ut(t),r=_.useRef(!1);return _.useEffect(()=>{const s=i=>{i.target&&!r.current&&lG(aAe,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 pB(){const t=new CustomEvent(XD);document.dispatchEvent(t)}function lG(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?sAe(s,i):s.dispatchEvent(i)}var AT="focusScope.autoFocusOnMount",RT="focusScope.autoFocusOnUnmount",mB={bubbles:!1,cancelable:!0},fAe="FocusScope",cG=_.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=t,[o,c]=_.useState(null),u=Ut(s),f=Ut(i),l=_.useRef(null),d=yp(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(AT,mB);o.addEventListener(AT,u),o.dispatchEvent(g),g.defaultPrevented||(hAe(yAe(uG(o)),{select:!0}),document.activeElement===h&&_u(o))}return()=>{o.removeEventListener(AT,u),setTimeout(()=>{const g=new CustomEvent(RT,mB);o.addEventListener(RT,f),o.dispatchEvent(g),g.defaultPrevented||_u(h??document.body,{select:!0}),o.removeEventListener(RT,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]=pAe(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(tu.div,{tabIndex:-1,...a,ref:d,onKeyDown:p})});cG.displayName=fAe;function hAe(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(_u(r,{select:e}),document.activeElement!==n)return}function pAe(t){const e=uG(t),n=gB(e,t),r=gB(e.reverse(),t);return[n,r]}function uG(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 gB(t,e){for(const n of t)if(!mAe(n,{upTo:e}))return n}function mAe(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 gAe(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&&gAe(t)&&e&&t.select()}}var vB=vAe();function vAe(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=yB(t,e),t.unshift(e)},remove(e){var n;t=yB(t,e),(n=t[0])==null||n.resume()}}}function yB(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function yAe(t){return t.filter(e=>e.tagName!=="A")}var bAe="Portal",dG=_.forwardRef((t,e)=>{var o;const{container:n,...r}=t,[s,i]=_.useState(!1);Ln(()=>i(!0),[]);const a=n||s&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?t_.createPortal(P.jsx(tu.div,{...r,ref:e}),a):null});dG.displayName=bAe;function wAe(t,e){return _.useReducer((n,r)=>e[n][r]??n,t)}var pA=t=>{const{present:e,children:n}=t,r=_Ae(e),s=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),i=yp(r.ref,xAe(s));return typeof n=="function"||r.isPresent?_.cloneElement(s,{ref:i}):null};pA.displayName="Presence";function _Ae(t){const[e,n]=_.useState(),r=_.useRef({}),s=_.useRef(t),i=_.useRef("none"),a=t?"mounted":"unmounted",[o,c]=wAe(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]),Ln(()=>{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]),Ln(()=>{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 xAe(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 PT=0;function SAe(){_.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??bB()),document.body.insertAdjacentElement("beforeend",t[1]??bB()),PT++,()=>{PT===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),PT--}},[])}function bB(){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 fG=bL(),TT=function(){},mA=_.forwardRef(function(t,e){var n=_.useRef(null),r=_.useState({onScrollCapture:TT,onWheelCapture:TT,onTouchMoveCapture:TT}),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=jC(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=d,A=yL([n,e]),k=fr(fr({},w),s);return _.createElement(_.Fragment,null,f&&_.createElement(x,{sideCar:fG,removeScrollBar:u,shards:l,noIsolation:m,inert:p,setCallbacks:i,allowPinchZoom:!!h,lockRef:n,gapMode:v}),a?_.cloneElement(_.Children.only(o),fr(fr({},k),{ref:A})):_.createElement(g,fr({},k,{className:c,ref:A}),o))});mA.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};mA.classNames={fullWidth:Im,zeroRight:Lm};var QD=!1;if(typeof window<"u")try{var dS=Object.defineProperty({},"passive",{get:function(){return QD=!0,!0}});window.addEventListener("test",dS,dS),window.removeEventListener("test",dS,dS)}catch{QD=!1}var Vp=QD?{passive:!1}:!1,EAe=function(t){return t.tagName==="TEXTAREA"},hG=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!EAe(t)&&n[e]==="visible")},CAe=function(t){return hG(t,"overflowY")},AAe=function(t){return hG(t,"overflowX")},wB=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=pG(t,r);if(s){var i=mG(t,r),a=i[1],o=i[2];if(a>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},RAe=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},PAe=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},pG=function(t,e){return t==="v"?CAe(e):AAe(e)},mG=function(t,e){return t==="v"?RAe(e):PAe(e)},TAe=function(t,e){return t==="h"&&e==="rtl"?-1:1},kAe=function(t,e,n,r,s){var i=TAe(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=mG(t,o),p=m[0],h=m[1],y=m[2],g=h-y-i*p;(p||g)&&pG(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]},_B=function(t){return[t.deltaX,t.deltaY]},xB=function(t){return t&&"current"in t?t.current:t},DAe=function(t,e){return t[0]===e[0]&&t[1]===e[1]},NAe=function(t){return`
|
||
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
||
`)},MAe=0,qp=[];function OAe(t){var e=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),s=_.useState(MAe++)[0],i=_.useState(BC)[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=vL([t.lockRef.current],(t.shards||[]).map(xB),!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,k=h.target,R=Math.abs(w)>Math.abs(x)?"h":"v";if("touches"in h&&R==="h"&&k.type==="range")return!1;var E=wB(R,k);if(!E)return!0;if(E?A=R:(A=R==="v"?"h":"v",E=wB(R,k)),!E)return!1;if(!r.current&&"changedTouches"in h&&(w||x)&&(r.current=A),!A)return!0;var T=r.current||A;return kAe(T,y,h,T==="h"?w:x)},[]),c=_.useCallback(function(h){var y=h;if(!(!qp.length||qp[qp.length-1]!==i)){var g="deltaY"in y?_B(y):fS(y),v=e.current.filter(function(A){return A.name===y.type&&(A.target===y.target||y.target===A.shadowParent)&&DAe(A.delta,g)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var w=(a.current.shards||[]).map(xB).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:LAe(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,_B(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 qp.push(i),t.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:d}),document.addEventListener("wheel",c,Vp),document.addEventListener("touchmove",c,Vp),document.addEventListener("touchstart",f,Vp),function(){qp=qp.filter(function(h){return h!==i}),document.removeEventListener("wheel",c,Vp),document.removeEventListener("touchmove",c,Vp),document.removeEventListener("touchstart",f,Vp)}},[]);var m=t.removeScrollBar,p=t.inert;return _.createElement(_.Fragment,null,p?_.createElement(i,{styles:NAe(s)}):null,m?_.createElement(_L,{gapMode:t.gapMode}):null)}function LAe(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const IAe=wL(fG,OAe);var gG=_.forwardRef(function(t,e){return _.createElement(mA,fr({},t,{ref:e,sideCar:IAe}))});gG.classNames=mA.classNames;var FI="Dialog",[vG,FHe]=QCe(FI),[$Ae,Ia]=vG(FI),yG=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]=sr({prop:r,defaultProp:s,onChange:i});return P.jsx($Ae,{scope:e,triggerRef:o,contentRef:c,contentId:Vr(),titleId:Vr(),descriptionId:Vr(),open:u,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(l=>!l),[f]),modal:a,children:n})};yG.displayName=FI;var bG="DialogTrigger",FAe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ia(bG,n),i=yp(e,s.triggerRef);return P.jsx(tu.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":BI(s.open),...r,ref:i,onClick:Sd(t.onClick,s.onOpenToggle)})});FAe.displayName=bG;var jI="DialogPortal",[jAe,wG]=vG(jI,{forceMount:void 0}),_G=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=Ia(jI,e);return P.jsx(jAe,{scope:e,forceMount:n,children:_.Children.map(r,a=>P.jsx(pA,{present:n||i.open,children:P.jsx(dG,{asChild:!0,container:s,children:a})}))})};_G.displayName=jI;var m1="DialogOverlay",xG=_.forwardRef((t,e)=>{const n=wG(m1,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Ia(m1,t.__scopeDialog);return i.modal?P.jsx(pA,{present:r||i.open,children:P.jsx(zAe,{...s,ref:e})}):null});xG.displayName=m1;var zAe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ia(m1,n);return P.jsx(gG,{as:$I,allowPinchZoom:!0,shards:[s.contentRef],children:P.jsx(tu.div,{"data-state":BI(s.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Zh="DialogContent",SG=_.forwardRef((t,e)=>{const n=wG(Zh,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Ia(Zh,t.__scopeDialog);return P.jsx(pA,{present:r||i.open,children:i.modal?P.jsx(BAe,{...s,ref:e}):P.jsx(UAe,{...s,ref:e})})});SG.displayName=Zh;var BAe=_.forwardRef((t,e)=>{const n=Ia(Zh,t.__scopeDialog),r=_.useRef(null),s=yp(e,n.contentRef,r);return _.useEffect(()=>{const i=r.current;if(i)return Ev(i)},[]),P.jsx(EG,{...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())})}),UAe=_.forwardRef((t,e)=>{const n=Ia(Zh,t.__scopeDialog),r=_.useRef(!1),s=_.useRef(!1);return P.jsx(EG,{...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()}})}),EG=_.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=t,o=Ia(Zh,n),c=_.useRef(null),u=yp(e,c);return SAe(),P.jsxs(P.Fragment,{children:[P.jsx(cG,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:P.jsx(aG,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":BI(o.open),...a,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),P.jsxs(P.Fragment,{children:[P.jsx(HAe,{titleId:o.titleId}),P.jsx(VAe,{contentRef:c,descriptionId:o.descriptionId})]})]})}),zI="DialogTitle",CG=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ia(zI,n);return P.jsx(tu.h2,{id:s.titleId,...r,ref:e})});CG.displayName=zI;var AG="DialogDescription",RG=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ia(AG,n);return P.jsx(tu.p,{id:s.descriptionId,...r,ref:e})});RG.displayName=AG;var PG="DialogClose",TG=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ia(PG,n);return P.jsx(tu.button,{type:"button",...r,ref:e,onClick:Sd(t.onClick,()=>s.onOpenChange(!1))})});TG.displayName=PG;function BI(t){return t?"open":"closed"}var kG="DialogTitleWarning",[jHe,DG]=XCe(kG,{contentName:Zh,titleName:zI,docsSlug:"dialog"}),HAe=({titleId:t})=>{const e=DG(kG),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},WAe="DialogDescriptionWarning",VAe=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${DG(WAe).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},qAe=yG,GAe=_G,KAe=xG,YAe=SG,XAe=CG,QAe=RG,JAe=TG;function ZAe(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 NG=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}),R_=()=>{const t=se.useContext(NG);if(!t)throw new Error("useDrawerContext must be used within a Drawer.Root");return t};ZAe(`[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 eRe=24,tRe=typeof window<"u"?_.useLayoutEffect:_.useEffect;function SB(...t){return(...e)=>{for(let n of t)typeof n=="function"&&n(...e)}}function nRe(){return UI(/^Mac/)}function rRe(){return UI(/^iPhone/)}function EB(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function sRe(){return UI(/^iPad/)||nRe()&&navigator.maxTouchPoints>1}function MG(){return rRe()||sRe()}function UI(t){return typeof window<"u"&&window.navigator!=null?t.test(window.navigator.platform):void 0}const kT=typeof document<"u"&&window.visualViewport;function CB(t){let e=window.getComputedStyle(t);return/(auto|scroll)/.test(e.overflow+e.overflowX+e.overflowY)}function OG(t){for(CB(t)&&(t=t.parentElement);t&&!CB(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}const iRe=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let hS=0,DT;function oRe(t={}){let{isDisabled:e}=t;tRe(()=>{if(!e)return hS++,hS===1&&MG()&&(DT=aRe()),()=>{hS--,hS===0&&(DT==null||DT())}},[e])}function aRe(){let t,e=0,n=l=>{t=OG(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<e)&&l.preventDefault(),e=d)},s=l=>{let d=l.target;JD(d)&&d!==document.activeElement&&(l.preventDefault(),d.style.transform="translateY(-2000px)",d.focus(),requestAnimationFrame(()=>{d.style.transform=""}))},i=l=>{let d=l.target;JD(d)&&(d.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{d.style.transform="",kT&&(kT.height<window.innerHeight?requestAnimationFrame(()=>{AB(d)}):kT.addEventListener("resize",()=>AB(d),{once:!0}))}))},a=()=>{window.scrollTo(0,0)},o=window.pageXOffset,c=window.pageYOffset,u=SB(lRe(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let f=SB(wy(document,"touchstart",n,{passive:!1,capture:!0}),wy(document,"touchmove",r,{passive:!1,capture:!0}),wy(document,"touchend",s,{passive:!1,capture:!0}),wy(document,"focus",i,!0),wy(window,"scroll",a));return()=>{u(),f(),window.scrollTo(o,c)}}function lRe(t,e,n){let r=t.style[e];return t.style[e]=n,()=>{t.style[e]=r}}function wy(t,e,n,r){return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}}function AB(t){let e=document.scrollingElement||document.documentElement;for(;t&&t!==e;){let n=OG(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+eRe;i>a&&(n.scrollTop+=s-r)}t=n.parentElement}}function JD(t){return t instanceof HTMLInputElement&&!iRe.has(t.type)||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable}function cRe(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function uRe(...t){return e=>t.forEach(n=>cRe(n,e))}function LG(...t){return _.useCallback(uRe(...t),t)}const IG=new WeakMap;function $r(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&&IG.set(t,r)}function dRe(t,e){if(!t||!(t instanceof HTMLElement))return;let n=IG.get(t);n&&(t.style[e]=n[e])}const Fr=t=>{switch(t){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return t}};function pS(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(", ")[Fr(e)?13:12]):(s=r.match(/^matrix\((.+)\)$/),s?parseFloat(s[1].split(", ")[Fr(e)?5:4]):null)}function fRe(t){return 8*(Math.log(t+1)-2)}function NT(t,e){if(!t)return()=>{};const n=t.style.cssText;return Object.assign(t.style,e),()=>{t.style.cssText=n}}function hRe(...t){return(...e)=>{for(const n of t)typeof n=="function"&&n(...e)}}const er={DURATION:.5,EASE:[.32,.72,0,1]},$G=.4,pRe=.25,mRe=100,FG=8,mS=16,ZD=26,MT="vaul-dragging";function jG(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 gRe({defaultProp:t,onChange:e}){const n=se.useState(t),[r]=n,s=se.useRef(r),i=jG(e);return se.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}function zG({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,s]=gRe({defaultProp:e,onChange:n}),i=t!==void 0,a=i?t:r,o=jG(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 vRe({activeSnapPointProp:t,setActiveSnapPointProp:e,snapPoints:n,drawerRef:r,overlayRef:s,fadeFromIndex:i,onSnapPointChange:a,direction:o="bottom",container:c,snapToSequentialPoint:u}){const[f,l]=zG({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(T=>{const D=typeof T=="string";let M=0;if(D&&(M=parseInt(T,10)),Fr(o)){const I=D?M:d?T*R.height:0;return d?o==="bottom"?R.height-I:-R.height+I:I}const L=D?M:d?T*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 T=(E=g==null?void 0:g.findIndex(D=>D===R))!=null?E:null;a(T),$r(r.current,{transition:`transform ${er.DURATION}s cubic-bezier(${er.EASE.join(",")})`,transform:Fr(o)?`translate3d(0, ${R}px, 0)`:`translate3d(${R}px, 0, 0)`}),g&&T!==g.length-1&&T!==i&&T<i?$r(s.current,{transition:`opacity ${er.DURATION}s cubic-bezier(${er.EASE.join(",")})`,opacity:"0"}):$r(s.current,{transition:`opacity ${er.DURATION}s cubic-bezier(${er.EASE.join(",")})`,opacity:"1"}),l(n==null?void 0:n[Math.max(T,0)])},[r.current,n,g,i,s,l]);se.useEffect(()=>{if(f||t){var R;const E=(R=n==null?void 0:n.findIndex(T=>T===t||T===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:T,dismissible:D}){if(i===void 0)return;const M=o==="bottom"||o==="right"?(v??0)-R:(v??0)+R,L=h===i-1,I=h===0,F=R>0;if(L&&$r(s.current,{transition:`opacity ${er.DURATION}s cubic-bezier(${er.EASE.join(",")})`}),!u&&T>2&&!F){D?E():w(g[0]);return}if(!u&&T>2&&F&&g&&n){w(g[n.length-1]);return}const U=g==null?void 0:g.reduce((W,H)=>typeof W!="number"||typeof H!="number"?W:Math.abs(H-M)<Math.abs(W-M)?H:W),Y=Fr(o)?window.innerHeight:window.innerWidth;if(T>$G&&Math.abs(R)<Y*.4){const W=F?1:-1;if(W>0&&p){w(g[n.length-1]);return}if(I&&W<0&&D&&E(),h===null)return;w(g[h+W]);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")&&E<g[g.length-1]||(o==="top"||o==="left")&&E>g[g.length-1]||$r(r.current,{transform:Fr(o)?`translate3d(0, ${E}px, 0)`:`translate3d(${E}px, 0, 0)`})}function k(R,E){if(!n||typeof h!="number"||!g||i===void 0)return null;const T=h===i-1;if(h>=i&&E)return 0;if(T&&!E)return 1;if(!y&&!T)return null;const M=T?h+1:h-1,L=T?g[M]-g[M-1]:g[M+1]-g[M],I=R/Math.abs(L);return T?1-I:I}return{isLastSnapPoint:p,activeSnapPoint:f,shouldFade:y,getPercentageDragged:k,setActiveSnapPoint:l,activeSnapPointIndex:h,onRelease:x,onDrag:A,snapPointsOffset:g}}const yRe=()=>()=>{};function bRe(){const{direction:t,isOpen:e,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:s}=R_(),i=se.useRef(null),a=_.useMemo(()=>document.body.style.backgroundColor,[]);function o(){return(window.innerWidth-ZD)/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;hRe(r&&!s?NT(document.body,{background:"black"}):yRe,NT(c,{transformOrigin:Fr(t)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${er.DURATION}s`,transitionTimingFunction:`cubic-bezier(${er.EASE.join(",")})`}));const u=NT(c,{borderRadius:`${FG}px`,overflow:"hidden",...Fr(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")},er.DURATION*1e3)}}},[e,n,a])}let _y=null;function wRe({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(EB()&&_y===null&&t&&!i){_y={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(EB()&&_y!==null&&!i){const l=-parseInt(document.body.style.top,10),d=-parseInt(document.body.style.left,10);Object.assign(document.body.style,_y),window.requestAnimationFrame(()=>{if(s&&a!==window.location.href){o(window.location.href);return}window.scrollTo(d,l)}),_y=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 _Re({open:t,onOpenChange:e,children:n,onDrag:r,onRelease:s,snapPoints:i,shouldScaleBackground:a=!1,setBackgroundColorOnScale:o=!0,closeThreshold:c=pRe,scrollLockTimeout:u=mRe,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:k=!0,snapToSequentialPoint:R=!1,preventScrollRestoration:E=!1,repositionInputs:T=!0,onAnimationEnd:D,container:M,autoFocus:L=!1}){var I,F;const[U=!1,Y]=zG({defaultProp:A,prop:t,onChange:Be=>{e==null||e(Be),!Be&&!v&&Me(),setTimeout(()=>{D==null||D(Be)},er.DURATION*1e3),Be&&!y&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),Be||(document.body.style.pointerEvents="auto")}}),[W,H]=se.useState(!1),[ee,re]=se.useState(!1),[X,G]=se.useState(!1),K=se.useRef(null),J=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),Oe=se.useRef(!1),Ne=se.useRef(0),ye=se.useRef(null),$e=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),yt=se.useCallback(Be=>{i&&Be===Z.length-1&&(J.current=new Date)},[]),{activeSnapPoint:En,activeSnapPointIndex:Xt,setActiveSnapPoint:gn,onRelease:Qt,snapPointsOffset:Z,onDrag:fe,shouldFade:ge,getPercentageDragged:Pe}=vRe({snapPoints:i,activeSnapPointProp:m,setActiveSnapPointProp:p,drawerRef:ye,fadeFromIndex:d,overlayRef:K,onSnapPointChange:yt,direction:x,container:M,snapToSequentialPoint:R});oRe({isDisabled:!U||ee||!y||X||!W||!T||!k});const{restorePositionSetting:Me}=wRe({isOpen:U,modal:y,nested:v,hasBeenOpened:W,preventScrollRestoration:E,noBodyStyles:w});function xe(){return(window.innerWidth-ZD)/window.innerWidth}function Te(Be){var it,ot;!f&&!i||ye.current&&!ye.current.contains(Be.target)||($e.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,MG()&&window.addEventListener("touchend",()=>be.current=!1,{once:!0}),Be.target.setPointerCapture(Be.pointerId),_e.current=Fr(x)?Be.pageY:Be.pageX)}function Ye(Be,it){var ot,Et;let nt=Be;const Wt=(ot=window.getSelection())==null?void 0:ot.toString(),At=ye.current?pS(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(J.current&&yn.getTime()-J.current.getTime()<500)return!1;if(At!==null&&(x==="bottom"?At>0:At<0))return!0;if(Wt&&Wt.length>0)return!1;if(yn.getTime()-((Et=ie.current)==null?void 0:Et.getTime())<u&&At===0||it)return ie.current=yn,!1;for(;nt;){if(nt.scrollHeight>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 Pt(Be){if(ye.current&&ee){const it=x==="bottom"||x==="right"?1:-1,ot=(_e.current-(Fr(x)?Be.pageY:Be.pageX))*it,Et=ot>0,nt=i&&!f&&!Et;if(nt&&Xt===0)return;const Wt=Math.abs(ot),At=document.querySelector("[data-vaul-drawer-wrapper]"),yn=x==="bottom"||x==="top"?$e.current:ut.current;let ln=Wt/yn;const cn=Pe(Wt,Et);if(cn!==null&&(ln=cn),nt&&ln>=1||!be.current&&!Ye(Be.target,Et))return;if(ye.current.classList.add(MT),be.current=!0,$r(ye.current,{transition:"none"}),$r(K.current,{transition:"none"}),i&&fe({draggedDistance:ot}),Et&&!i){const hr=fRe(ot),Dn=Math.min(hr*-1,0)*it;$r(ye.current,{transform:Fr(x)?`translate3d(0, ${Dn}px, 0)`:`translate3d(${Dn}px, 0, 0)`});return}const kn=1-ln;if((ge||d&&Xt===d-1)&&(r==null||r(Be,ln),$r(K.current,{opacity:`${kn}`,transition:"none"},!0)),At&&K.current&&a){const hr=Math.min(xe()+ln*(1-xe()),1),Dn=8-ln*8,te=Math.max(0,14-ln*14);$r(At,{borderRadius:`${Dn}px`,transform:Fr(x)?`scale(${hr}) translate3d(0, ${te}px, 0)`:`scale(${hr}) translate3d(${te}px, 0, 0)`,transition:"none"},!0)}if(!i){const hr=Wt*it;$r(ye.current,{transform:Fr(x)?`translate3d(0, ${hr}px, 0)`:`translate3d(${hr}px, 0, 0)`})}}}se.useEffect(()=>{var Be;function it(){if(!ye.current||!T)return;const ot=document.activeElement;if(JD(ot)||Oe.current){var Et;const nt=((Et=window.visualViewport)==null?void 0:Et.height)||0,Wt=window.innerHeight;let At=Wt-nt;const yn=ye.current.getBoundingClientRect().height||0,ln=yn>Wt*.8;Qe.current||(Qe.current=yn);const cn=ye.current.getBoundingClientRect().top;if(Math.abs(Ne.current-At)>60&&(Oe.current=!Oe.current),i&&i.length>0&&Z&&Xt){const kn=Z[Xt]||0;At+=kn}if(Ne.current=At,yn>nt||Oe.current){const kn=ye.current.getBoundingClientRect().height;let hr=kn;kn>nt&&(hr=nt-(ln?cn:ZD)),h?ye.current.style.height=`${kn-Math.max(At,0)}px`:ye.current.style.height=`${Math.max(hr,nt-cn)}px`}else ye.current.style.height=`${Qe.current}px`;i&&i.length>0&&!Oe.current?ye.current.style.bottom="0px":ye.current.style.bottom=`${Math.max(At,0)}px`}}return(Be=window.visualViewport)==null||Be.addEventListener("resize",it),()=>{var ot;return(ot=window.visualViewport)==null?void 0:ot.removeEventListener("resize",it)}},[Xt,i,Z]);function wt(Be){Yn(),g==null||g(),Be||Y(!1),setTimeout(()=>{i&&gn(i[0])},er.DURATION*1e3)}function Ls(){if(!ye.current)return;const Be=document.querySelector("[data-vaul-drawer-wrapper]"),it=pS(ye.current,x);$r(ye.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${er.DURATION}s cubic-bezier(${er.EASE.join(",")})`}),$r(K.current,{transition:`opacity ${er.DURATION}s cubic-bezier(${er.EASE.join(",")})`,opacity:"1"}),a&&it&&it>0&&U&&$r(Be,{borderRadius:`${FG}px`,overflow:"hidden",...Fr(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:`${er.DURATION}s`,transitionTimingFunction:`cubic-bezier(${er.EASE.join(",")})`},!0)}function Yn(){!ee||!ye.current||(ye.current.classList.remove(MT),be.current=!1,re(!1),de.current=new Date)}function gs(Be){if(!ee||!ye.current)return;ye.current.classList.remove(MT),be.current=!1,re(!1),de.current=new Date;const it=pS(ye.current,x);if(!Ye(Be.target,!1)||!it||Number.isNaN(it)||ue.current===null)return;const ot=de.current.getTime()-ue.current.getTime(),Et=_e.current-(Fr(x)?Be.pageY:Be.pageX),nt=Math.abs(Et)/ot;if(nt>.05&&(G(!0),setTimeout(()=>{G(!1)},200)),i){Qt({draggedDistance:Et*(x==="bottom"||x==="right"?1:-1),closeDrawer:wt,velocity:nt,dismissible:f}),s==null||s(Be,!0);return}if(x==="bottom"||x==="right"?Et>0:Et<0){Ls(),s==null||s(Be,!0);return}if(nt>$G){wt(),s==null||s(Be,!1);return}var Wt;const At=Math.min((Wt=ye.current.getBoundingClientRect().height)!=null?Wt:0,window.innerHeight);var yn;const ln=Math.min((yn=ye.current.getBoundingClientRect().width)!=null?yn:0,window.innerWidth),cn=x==="left"||x==="right";if(Math.abs(it)>=(cn?ln:At)*c){wt(),s==null||s(Be,!1);return}s==null||s(Be,!0),Ls()}se.useEffect(()=>(U&&($r(document.documentElement,{scrollBehavior:"auto"}),J.current=new Date),()=>{dRe(document.documentElement,"scrollBehavior")}),[U]);function Ht(Be){const it=Be?(window.innerWidth-mS)/window.innerWidth:1,ot=Be?-16:0;Ae.current&&window.clearTimeout(Ae.current),$r(ye.current,{transition:`transform ${er.DURATION}s cubic-bezier(${er.EASE.join(",")})`,transform:`scale(${it}) translate3d(0, ${ot}px, 0)`}),!Be&&ye.current&&(Ae.current=setTimeout(()=>{const Et=pS(ye.current,x);$r(ye.current,{transition:"none",transform:Fr(x)?`translate3d(0, ${Et}px, 0)`:`translate3d(${Et}px, 0, 0)`})},500))}function an(Be,it){if(it<0)return;const ot=(window.innerWidth-mS)/window.innerWidth,Et=ot+it*(1-ot),nt=-16+it*mS;$r(ye.current,{transform:Fr(x)?`scale(${Et}) translate3d(0, ${nt}px, 0)`:`scale(${Et}) translate3d(${nt}px, 0, 0)`,transition:"none"})}function vn(Be,it){const ot=Fr(x)?window.innerHeight:window.innerWidth,Et=it?(ot-mS)/ot:1,nt=it?-16:0;it&&$r(ye.current,{transition:`transform ${er.DURATION}s cubic-bezier(${er.EASE.join(",")})`,transform:Fr(x)?`scale(${Et}) translate3d(0, ${nt}px, 0)`:`scale(${Et}) translate3d(${nt}px, 0, 0)`})}return se.createElement(qAe,{defaultOpen:A,onOpenChange:Be=>{!f&&!Be||(Be?H(!0):wt(!0),Y(Be))},open:U},se.createElement(NG.Provider,{value:{activeSnapPoint:En,snapPoints:i,setActiveSnapPoint:gn,drawerRef:ye,overlayRef:K,onOpenChange:e,onPress:Te,onRelease:gs,onDrag:Pt,dismissible:f,handleOnly:l,isOpen:U,isDragging:ee,shouldFade:ge,closeDrawer:wt,onNestedDrag:an,onNestedOpenChange:Ht,onNestedRelease:vn,keyboardIsOpen:Oe,modal:y,snapPointsOffset:Z,direction:x,shouldScaleBackground:a,setBackgroundColorOnScale:o,noBodyStyles:w,container:M,autoFocus:L}},n))}const BG=se.forwardRef(function({...t},e){const{overlayRef:n,snapPoints:r,onRelease:s,shouldFade:i,isOpen:a,modal:o}=R_(),c=LG(e,n),u=r&&r.length>0;return o?se.createElement(KAe,{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)});BG.displayName="Drawer.Overlay";const UG=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}=R_(),[v,w]=se.useState(!1),x=LG(s,i),A=se.useRef(null),k=se.useRef(null),R=se.useRef(!1),E=p&&p.length>0;bRe();const T=(M,L,I=0)=>{if(R.current)return!0;const F=Math.abs(M.y),U=Math.abs(M.x),Y=U>F,W=["bottom","right"].includes(L)?1:-1;if(L==="left"||L==="right"){if(!(M.x*W<0)&&U>=0&&U<=I)return Y}else if(!(M.y*W<0)&&F>=0&&F<=I)return!Y;return R.current=!0,!0};se.useEffect(()=>{E&&window.requestAnimationFrame(()=>{w(!0)})},[]);function D(M){A.current=null,R.current=!1,o(M)}return se.createElement(YAe,{"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:M=>{y||(r.onPointerDown==null||r.onPointerDown.call(r,M),A.current={x:M.pageX,y:M.pageY},a(M))},onOpenAutoFocus:M=>{n==null||n(M),g||M.preventDefault()},onPointerDownOutside:M=>{if(t==null||t(M),!l||M.defaultPrevented){M.preventDefault();return}u.current&&(u.current=!1)},onFocusOutside:M=>{if(!l){M.preventDefault();return}},onPointerMove:M=>{if(k.current=M,y||(r.onPointerMove==null||r.onPointerMove.call(r,M),!A.current))return;const L=M.pageY-A.current.y,I=M.pageX-A.current.x,F=M.pointerType==="touch"?10:2;T({x:I,y:L},m,F)?c(M):(Math.abs(I)>F||Math.abs(L)>F)&&(A.current=null)},onPointerUp:M=>{r.onPointerUp==null||r.onPointerUp.call(r,M),A.current=null,R.current=!1,o(M)},onPointerOut:M=>{r.onPointerOut==null||r.onPointerOut.call(r,M),D(k.current)},onContextMenu:M=>{r.onContextMenu==null||r.onContextMenu.call(r,M),D(k.current)}})});UG.displayName="Drawer.Content";const xRe=250,SRe=120,ERe=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}=R_(),p=se.useRef(null),h=se.useRef(!1);function y(){if(h.current){w();return}window.setTimeout(()=>{g()},SRe)}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 k=a[A+1];c(k)}function v(){p.current=window.setTimeout(()=>{h.current=!0},xRe)}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))});ERe.displayName="Drawer.Handle";function CRe(t){const e=R_(),{container:n=e.container,...r}=t;return se.createElement(GAe,{container:n,...r})}const Tl={Root:_Re,Content:UG,Overlay:BG,Portal:CRe,Close:JAe,Title:XAe,Description:QAe},ARe=({shouldScaleBackground:t=!0,...e})=>P.jsx(Tl.Root,{shouldScaleBackground:t,...e});ARe.displayName="Drawer";const RRe=Tl.Portal,zHe=Tl.Close,HG=_.forwardRef(({className:t,...e},n)=>P.jsx(Tl.Overlay,{ref:n,className:ce("fixed inset-0 z-50 bg-black/80",t),...e}));HG.displayName=Tl.Overlay.displayName;const PRe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(RRe,{children:[P.jsx(HG,{}),P.jsxs(Tl.Content,{ref:r,className:ce("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]})]}));PRe.displayName="DrawerContent";const TRe=({className:t,...e})=>P.jsx("div",{className:ce("grid gap-1.5 p-4 text-center sm:text-left",t),...e});TRe.displayName="DrawerHeader";const kRe=({className:t,...e})=>P.jsx("div",{className:ce("mt-auto flex flex-col gap-2 p-4",t),...e});kRe.displayName="DrawerFooter";const DRe=_.forwardRef(({className:t,...e},n)=>P.jsx(Tl.Title,{ref:n,className:ce("text-lg font-semibold leading-none tracking-tight",t),...e}));DRe.displayName=Tl.Title.displayName;const NRe=_.forwardRef(({className:t,...e},n)=>P.jsx(Tl.Description,{ref:n,className:ce("text-sm text-muted-foreground",t),...e}));NRe.displayName=Tl.Description.displayName;var HI="DropdownMenu",[MRe,BHe]=Tn(HI,[C_]),ti=C_(),[ORe,WG]=MRe(HI),VG=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:a,modal:o=!0}=t,c=ti(e),u=_.useRef(null),[f=!1,l]=sr({prop:s,defaultProp:i,onChange:a});return P.jsx(ORe,{scope:e,triggerId:Vr(),triggerRef:u,contentId:Vr(),open:f,onOpenChange:l,onOpenToggle:_.useCallback(()=>l(d=>!d),[l]),modal:o,children:P.jsx(SCe,{...c,open:f,onOpenChange:l,dir:r,modal:o,children:n})})};VG.displayName=HI;var qG="DropdownMenuTrigger",GG=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=t,i=WG(qG,n),a=ti(n);return P.jsx(SI,{asChild:!0,...a,children:P.jsx(De.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:n_(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())})})})});GG.displayName=qG;var LRe="DropdownMenuPortal",KG=t=>{const{__scopeDropdownMenu:e,...n}=t,r=ti(e);return P.jsx(EI,{...r,...n})};KG.displayName=LRe;var YG="DropdownMenuContent",XG=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=WG(YG,n),i=ti(n),a=_.useRef(!1);return P.jsx(CI,{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)"}})});XG.displayName=YG;var IRe="DropdownMenuGroup",QG=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=ti(n);return P.jsx(AI,{...s,...r,ref:e})});QG.displayName=IRe;var $Re="DropdownMenuLabel",JG=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=ti(n);return P.jsx(RI,{...s,...r,ref:e})});JG.displayName=$Re;var FRe="DropdownMenuItem",ZG=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=ti(n);return P.jsx(PI,{...s,...r,ref:e})});ZG.displayName=FRe;var jRe="DropdownMenuCheckboxItem",eK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=ti(n);return P.jsx(TI,{...s,...r,ref:e})});eK.displayName=jRe;var zRe="DropdownMenuRadioGroup",BRe=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=ti(n);return P.jsx(kI,{...s,...r,ref:e})});BRe.displayName=zRe;var URe="DropdownMenuRadioItem",tK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=ti(n);return P.jsx(DI,{...s,...r,ref:e})});tK.displayName=URe;var HRe="DropdownMenuItemIndicator",nK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=ti(n);return P.jsx(NI,{...s,...r,ref:e})});nK.displayName=HRe;var WRe="DropdownMenuSeparator",rK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=ti(n);return P.jsx(MI,{...s,...r,ref:e})});rK.displayName=WRe;var VRe="DropdownMenuArrow",qRe=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=ti(n);return P.jsx(OI,{...s,...r,ref:e})});qRe.displayName=VRe;var GRe="DropdownMenuSubTrigger",sK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=ti(n);return P.jsx(LI,{...s,...r,ref:e})});sK.displayName=GRe;var KRe="DropdownMenuSubContent",iK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=ti(n);return P.jsx(II,{...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)"}})});iK.displayName=KRe;var YRe=VG,XRe=GG,QRe=KG,oK=XG,JRe=QG,aK=JG,lK=ZG,cK=eK,uK=tK,dK=nK,fK=rK,hK=sK,pK=iK;const ZRe=YRe,ePe=XRe,tPe=JRe,nPe=_.forwardRef(({className:t,inset:e,children:n,...r},s)=>P.jsxs(hK,{ref:s,className:ce("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(s_,{className:"w-4 h-4 ml-auto"})]}));nPe.displayName=hK.displayName;const rPe=_.forwardRef(({className:t,...e},n)=>P.jsx(pK,{ref:n,className:ce("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}));rPe.displayName=pK.displayName;const mK=_.forwardRef(({className:t,sideOffset:e=4,...n},r)=>P.jsx(QRe,{children:P.jsx(oK,{ref:r,sideOffset:e,className:ce("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})}));mK.displayName=oK.displayName;const eN=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(lK,{ref:r,className:ce("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}));eN.displayName=lK.displayName;const sPe=_.forwardRef(({className:t,children:e,checked:n,...r},s)=>P.jsxs(cK,{ref:s,className:ce("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(dK,{children:P.jsx(r_,{className:"w-4 h-4"})})}),e]}));sPe.displayName=cK.displayName;const iPe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(uK,{ref:r,className:ce("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(dK,{children:P.jsx($C,{className:"w-2 h-2 fill-current"})})}),e]}));iPe.displayName=uK.displayName;const gK=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(aK,{ref:r,className:ce("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));gK.displayName=aK.displayName;const tN=_.forwardRef(({className:t,...e},n)=>P.jsx(fK,{ref:n,className:ce("-mx-1 my-1 h-px bg-muted",t),...e}));tN.displayName=fK.displayName;const oPe=({className:t,...e})=>P.jsx("span",{className:ce("ml-auto text-xs tracking-widest opacity-60",t),...e});oPe.displayName="DropdownMenuShortcut";var P_=t=>t.type==="checkbox",Cf=t=>t instanceof Date,Gs=t=>t==null;const vK=t=>typeof t=="object";var br=t=>!Gs(t)&&!Array.isArray(t)&&vK(t)&&!Cf(t),yK=t=>br(t)&&t.target?P_(t.target)?t.target.checked:t.target.value:t,aPe=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,bK=(t,e)=>t.has(aPe(e)),lPe=t=>{const e=t.constructor&&t.constructor.prototype;return br(e)&&e.hasOwnProperty("isPrototypeOf")},WI=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Zn(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(!(WI&&(t instanceof Blob||r))&&(n||br(t)))if(e=n?[]:{},!n&&!lPe(t))e=t;else for(const s in t)t.hasOwnProperty(s)&&(e[s]=Zn(t[s]));else return t;return e}var T_=t=>Array.isArray(t)?t.filter(Boolean):[],Bn=t=>t===void 0,Ie=(t,e,n)=>{if(!e||!br(t))return n;const r=T_(e.split(/[,[\].]+?/)).reduce((s,i)=>Gs(s)?s:s[i],t);return Bn(r)||r===t?Bn(t[e])?n:t[e]:r},Zi=t=>typeof t=="boolean",VI=t=>/^\w*$/.test(t),wK=t=>T_(t.replace(/["|']|\]/g,"").split(/\.|\[/)),Jt=(t,e,n)=>{let r=-1;const s=VI(e)?[e]:wK(e),i=s.length,a=i-1;for(;++r<i;){const o=s[r];let c=n;if(r!==a){const u=t[o];c=br(u)||Array.isArray(u)?u:isNaN(+s[r+1])?{}:[]}if(o==="__proto__"||o==="constructor"||o==="prototype")return;t[o]=c,t=t[o]}};const g1={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},No={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Vl={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},_K=se.createContext(null),jd=()=>se.useContext(_K),cPe=t=>{const{children:e,...n}=t;return se.createElement(_K.Provider,{value:n},e)};var xK=(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]!==No.all&&(e._proxyFormState[a]=!r||No.all),n&&(n[a]=!0),t[a]}});return s};function uPe(t){const e=jd(),{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(()=>xK(a,n,c.current,!1),[a,n])}var gl=t=>typeof t=="string",SK=(t,e,n,r,s)=>gl(t)?(r&&e.watch.add(t),Ie(n,t,s)):Array.isArray(t)?t.map(i=>(r&&e.watch.add(i),Ie(n,i))):(r&&(e.watchAll=!0),n);function dPe(t){const e=jd(),{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(SK(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 fPe(t){const e=jd(),{name:n,disabled:r,control:s=e.control,shouldUnregister:i}=t,a=bK(s._names.array,n),o=dPe({control:s,name:n,defaultValue:Ie(s._formValues,n,Ie(s._defaultValues,n,t.defaultValue)),exact:!0}),c=uPe({control:s,name:n,exact:!0}),u=se.useRef(t),f=se.useRef(s.register(n,{...t.rules,value:o,...Zi(t.disabled)?{disabled:t.disabled}:{}})),l=se.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ie(c.errors,n)},isDirty:{enumerable:!0,get:()=>!!Ie(c.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Ie(c.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Ie(c.validatingFields,n)},error:{enumerable:!0,get:()=>Ie(c.errors,n)}}),[c,n]),d=se.useCallback(y=>f.current.onChange({target:{value:yK(y),name:n},type:g1.CHANGE}),[n]),m=se.useCallback(()=>f.current.onBlur({target:{value:Ie(s._formValues,n),name:n},type:g1.BLUR}),[n,s._formValues]),p=se.useCallback(y=>{const g=Ie(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,...Zi(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,...Zi(u.current.disabled)?{disabled:u.current.disabled}:{}});const g=(v,w)=>{const x=Ie(s._fields,v);x&&x._f&&(x._f.mount=w)};if(g(n,!0),y){const v=Zn(Ie(s._options.defaultValues,n));Jt(s._defaultValues,n,v),Bn(Ie(s._formValues,n))&&Jt(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 hPe=t=>t.render(fPe(t));var EK=(t,e,n,r,s)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:s||!0}}:{},bi=t=>Array.isArray(t)?t:[t],RB=()=>{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=[]}}},nN=t=>Gs(t)||!vK(t);function Nu(t,e){if(nN(t)||nN(e))return t===e;if(Cf(t)&&Cf(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(Cf(i)&&Cf(a)||br(i)&&br(a)||Array.isArray(i)&&Array.isArray(a)?!Nu(i,a):i!==a)return!1}}return!0}var Ps=t=>br(t)&&!Object.keys(t).length,qI=t=>t.type==="file",_a=t=>typeof t=="function",v1=t=>{if(!WI)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},CK=t=>t.type==="select-multiple",GI=t=>t.type==="radio",pPe=t=>GI(t)||P_(t),OT=t=>v1(t)&&t.isConnected;function mPe(t,e){const n=e.slice(0,-1).length;let r=0;for(;r<n;)t=Bn(t)?r++:t[e[r++]];return t}function gPe(t){for(const e in t)if(t.hasOwnProperty(e)&&!Bn(t[e]))return!1;return!0}function Sr(t,e){const n=Array.isArray(e)?e:VI(e)?[e]:wK(e),r=n.length===1?t:mPe(t,n),s=n.length-1,i=n[s];return r&&delete r[i],s!==0&&(br(r)&&Ps(r)||Array.isArray(r)&&gPe(r))&&Sr(t,n.slice(0,-1)),t}var AK=t=>{for(const e in t)if(_a(t[e]))return!0;return!1};function y1(t,e={}){const n=Array.isArray(t);if(br(t)||n)for(const r in t)Array.isArray(t[r])||br(t[r])&&!AK(t[r])?(e[r]=Array.isArray(t[r])?[]:{},y1(t[r],e[r])):Gs(t[r])||(e[r]=!0);return e}function RK(t,e,n){const r=Array.isArray(t);if(br(t)||r)for(const s in t)Array.isArray(t[s])||br(t[s])&&!AK(t[s])?Bn(e)||nN(n[s])?n[s]=Array.isArray(t[s])?y1(t[s],[]):{...y1(t[s])}:RK(t[s],Gs(e)?{}:e[s],n[s]):n[s]=!Nu(t[s],e[s]);return n}var xy=(t,e)=>RK(t,e,y1(e));const PB={value:!1,isValid:!1},TB={value:!0,isValid:!0};var PK=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&&!Bn(t[0].attributes.value)?Bn(t[0].value)||t[0].value===""?TB:{value:t[0].value,isValid:!0}:TB:PB}return PB},TK=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>Bn(t)?t:e?t===""?NaN:t&&+t:n&&gl(t)?new Date(t):r?r(t):t;const kB={isValid:!1,value:null};var kK=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,kB):kB;function DB(t){const e=t.ref;return qI(e)?e.files:GI(e)?kK(t.refs).value:CK(e)?[...e.selectedOptions].map(({value:n})=>n):P_(e)?PK(t.refs).value:TK(Bn(e.value)?t.ref.value:e.value,t)}var vPe=(t,e,n,r)=>{const s={};for(const i of t){const a=Ie(e,i);a&&Jt(s,i,a._f)}return{criteriaMode:n,names:[...t],fields:s,shouldUseNativeValidation:r}},b1=t=>t instanceof RegExp,Sy=t=>Bn(t)?t:b1(t)?t.source:br(t)?b1(t.value)?t.value.source:t.value:t,Sm=t=>({isOnSubmit:!t||t===No.onSubmit,isOnBlur:t===No.onBlur,isOnChange:t===No.onChange,isOnAll:t===No.all,isOnTouch:t===No.onTouched});const NB="AsyncFunction";var yPe=t=>!!t&&!!t.validate&&!!(_a(t.validate)&&t.validate.constructor.name===NB||br(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===NB)),bPe=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),rN=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const zm=(t,e,n,r)=>{for(const s of n||Object.keys(t)){const i=Ie(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(zm(o,e))break}else if(br(o)&&zm(o,e))break}}};function MB(t,e,n){const r=Ie(t,n);if(r||VI(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const i=s.join("."),a=Ie(e,i),o=Ie(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 wPe=(t,e,n,r)=>{n(t);const{name:s,...i}=t;return Ps(i)||Object.keys(i).length>=Object.keys(e).length||Object.keys(i).find(a=>e[a]===(!r||No.all))},_Pe=(t,e,n)=>!t||!e||t===e||bi(t).some(r=>r&&(n?r===e:r.startsWith(e)||e.startsWith(r))),xPe=(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,SPe=(t,e)=>!T_(Ie(t,e)).length&&Sr(t,e),DK=(t,e,n)=>{const r=bi(Ie(t,n));return Jt(r,"root",e[n]),Jt(t,n,r),t},WS=t=>gl(t);function OB(t,e,n="validate"){if(WS(t)||Array.isArray(t)&&t.every(WS)||Zi(t)&&!t)return{type:n,message:WS(t)?t:"",ref:e}}var Gp=t=>br(t)&&!b1(t)?t:{value:t,message:""},sN=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=Ie(n,h);if(!g||e.has(h))return{};const w=o?o[0]:a,x=L=>{s&&w.reportValidity&&(w.setCustomValidity(Zi(L)?"":L||""),w.reportValidity())},A={},k=GI(a),R=P_(a),E=k||R,T=(y||qI(a))&&Bn(a.value)&&Bn(v)||v1(a)&&a.value===""||v===""||Array.isArray(v)&&!v.length,D=EK.bind(null,h,r,A),M=(L,I,F,U=Vl.maxLength,Y=Vl.minLength)=>{const W=L?I:F;A[h]={type:L?U:Y,message:W,ref:a,...D(L?U:Y,W)}};if(i?!Array.isArray(v)||!v.length:c&&(!E&&(T||Gs(v))||Zi(v)&&!v||R&&!PK(o).isValid||k&&!kK(o).isValid)){const{value:L,message:I}=WS(c)?{value:!!c,message:c}:Gp(c);if(L&&(A[h]={type:Vl.required,message:I,ref:w,...D(Vl.required,I)},!r))return x(I),A}if(!T&&(!Gs(l)||!Gs(d))){let L,I;const F=Gp(d),U=Gp(l);if(!Gs(v)&&!isNaN(v)){const Y=a.valueAsNumber||v&&+v;Gs(F.value)||(L=Y>F.value),Gs(U.value)||(I=Y<U.value)}else{const Y=a.valueAsDate||new Date(v),W=re=>new Date(new Date().toDateString()+" "+re),H=a.type=="time",ee=a.type=="week";gl(F.value)&&v&&(L=H?W(v)>W(F.value):ee?v>F.value:Y>new Date(F.value)),gl(U.value)&&v&&(I=H?W(v)<W(U.value):ee?v<U.value:Y<new Date(U.value))}if((L||I)&&(M(!!L,F.message,U.message,Vl.max,Vl.min),!r))return x(A[h].message),A}if((u||f)&&!T&&(gl(v)||i&&Array.isArray(v))){const L=Gp(u),I=Gp(f),F=!Gs(L.value)&&v.length>+L.value,U=!Gs(I.value)&&v.length<+I.value;if((F||U)&&(M(F,L.message,I.message),!r))return x(A[h].message),A}if(m&&!T&&gl(v)){const{value:L,message:I}=Gp(m);if(b1(L)&&!v.match(L)&&(A[h]={type:Vl.pattern,message:I,ref:a,...D(Vl.pattern,I)},!r))return x(I),A}if(p){if(_a(p)){const L=await p(v,n),I=OB(L,w);if(I&&(A[h]={...I,...D(Vl.validate,I.message)},!r))return x(I.message),A}else if(br(p)){let L={};for(const I in p){if(!Ps(L)&&!r)break;const F=OB(await p[I](v,n),w,I);F&&(L={...F,...D(I,F.message)},x(F.message),r&&(A[h]=L))}if(!Ps(L)&&(A[h]={ref:w,...L},!r))return A}}return x(!0),A};const EPe={mode:No.onSubmit,reValidateMode:No.onChange,shouldFocusError:!0};function CPe(t={}){let e={...EPe,...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=br(e.defaultValues)||br(e.values)?Zn(e.values||e.defaultValues)||{}:{},i=e.shouldUnregister?{}:Zn(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:RB(),state:RB()},m=Sm(e.mode),p=Sm(e.reValidateMode),h=e.criteriaMode===No.all,y=Z=>fe=>{clearTimeout(u),u=setTimeout(Z,fe)},g=async Z=>{if(!e.disabled&&(f.isValid||l.isValid||Z)){const fe=e.resolver?Ps((await T()).errors):await M(r,!0);fe!==n.isValid&&d.state.next({isValid:fe})}},v=(Z,fe)=>{!e.disabled&&(f.isValidating||f.validatingFields||l.isValidating||l.validatingFields)&&((Z||Array.from(o.mount)).forEach(ge=>{ge&&(fe?Jt(n.validatingFields,ge,fe):Sr(n.validatingFields,ge))}),d.state.next({validatingFields:n.validatingFields,isValidating:!Ps(n.validatingFields)}))},w=(Z,fe=[],ge,Pe,Me=!0,xe=!0)=>{if(Pe&&ge&&!e.disabled){if(a.action=!0,xe&&Array.isArray(Ie(r,Z))){const Te=ge(Ie(r,Z),Pe.argA,Pe.argB);Me&&Jt(r,Z,Te)}if(xe&&Array.isArray(Ie(n.errors,Z))){const Te=ge(Ie(n.errors,Z),Pe.argA,Pe.argB);Me&&Jt(n.errors,Z,Te),SPe(n.errors,Z)}if((f.touchedFields||l.touchedFields)&&xe&&Array.isArray(Ie(n.touchedFields,Z))){const Te=ge(Ie(n.touchedFields,Z),Pe.argA,Pe.argB);Me&&Jt(n.touchedFields,Z,Te)}(f.dirtyFields||l.dirtyFields)&&(n.dirtyFields=xy(s,i)),d.state.next({name:Z,isDirty:I(Z,fe),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Jt(i,Z,fe)},x=(Z,fe)=>{Jt(n.errors,Z,fe),d.state.next({errors:n.errors})},A=Z=>{n.errors=Z,d.state.next({errors:n.errors,isValid:!1})},k=(Z,fe,ge,Pe)=>{const Me=Ie(r,Z);if(Me){const xe=Ie(i,Z,Bn(ge)?Ie(s,Z):ge);Bn(xe)||Pe&&Pe.defaultChecked||fe?Jt(i,Z,fe?xe:DB(Me._f)):Y(Z,xe),a.mount&&g()}},R=(Z,fe,ge,Pe,Me)=>{let xe=!1,Te=!1;const Ye={name:Z};if(!e.disabled){if(!ge||Pe){(f.isDirty||l.isDirty)&&(Te=n.isDirty,n.isDirty=Ye.isDirty=I(),xe=Te!==Ye.isDirty);const Pt=Nu(Ie(s,Z),fe);Te=!!Ie(n.dirtyFields,Z),Pt?Sr(n.dirtyFields,Z):Jt(n.dirtyFields,Z,!0),Ye.dirtyFields=n.dirtyFields,xe=xe||(f.dirtyFields||l.dirtyFields)&&Te!==!Pt}if(ge){const Pt=Ie(n.touchedFields,Z);Pt||(Jt(n.touchedFields,Z,ge),Ye.touchedFields=n.touchedFields,xe=xe||(f.touchedFields||l.touchedFields)&&Pt!==ge)}xe&&Me&&d.state.next(Ye)}return xe?Ye:{}},E=(Z,fe,ge,Pe)=>{const Me=Ie(n.errors,Z),xe=(f.isValid||l.isValid)&&Zi(fe)&&n.isValid!==fe;if(e.delayError&&ge?(c=y(()=>x(Z,ge)),c(e.delayError)):(clearTimeout(u),c=null,ge?Jt(n.errors,Z,ge):Sr(n.errors,Z)),(ge?!Nu(Me,ge):Me)||!Ps(Pe)||xe){const Te={...Pe,...xe&&Zi(fe)?{isValid:fe}:{},errors:n.errors,name:Z};n={...n,...Te},d.state.next(Te)}},T=async Z=>{v(Z,!0);const fe=await e.resolver(i,e.context,vPe(Z||o.mount,r,e.criteriaMode,e.shouldUseNativeValidation));return v(Z),fe},D=async Z=>{const{errors:fe}=await T(Z);if(Z)for(const ge of Z){const Pe=Ie(fe,ge);Pe?Jt(n.errors,ge,Pe):Sr(n.errors,ge)}else n.errors=fe;return fe},M=async(Z,fe,ge={valid:!0})=>{for(const Pe in Z){const Me=Z[Pe];if(Me){const{_f:xe,...Te}=Me;if(xe){const Ye=o.array.has(xe.name),Pt=Me._f&&yPe(Me._f);Pt&&f.validatingFields&&v([Pe],!0);const wt=await sN(Me,o.disabled,i,h,e.shouldUseNativeValidation&&!fe,Ye);if(Pt&&f.validatingFields&&v([Pe]),wt[xe.name]&&(ge.valid=!1,fe))break;!fe&&(Ie(wt,xe.name)?Ye?DK(n.errors,wt,xe.name):Jt(n.errors,xe.name,wt[xe.name]):Sr(n.errors,xe.name))}!Ps(Te)&&await M(Te,fe,ge)}}return ge.valid},L=()=>{for(const Z of o.unMount){const fe=Ie(r,Z);fe&&(fe._f.refs?fe._f.refs.every(ge=>!OT(ge)):!OT(fe._f.ref))&&Ae(Z)}o.unMount=new Set},I=(Z,fe)=>!e.disabled&&(Z&&fe&&Jt(i,Z,fe),!Nu(G(),s)),F=(Z,fe,ge)=>SK(Z,o,{...a.mount?i:Bn(fe)?s:gl(Z)?{[Z]:fe}:fe},ge,fe),U=Z=>T_(Ie(a.mount?i:s,Z,e.shouldUnregister?Ie(s,Z,[]):[])),Y=(Z,fe,ge={})=>{const Pe=Ie(r,Z);let Me=fe;if(Pe){const xe=Pe._f;xe&&(!xe.disabled&&Jt(i,Z,TK(fe,xe)),Me=v1(xe.ref)&&Gs(fe)?"":fe,CK(xe.ref)?[...xe.ref.options].forEach(Te=>Te.selected=Me.includes(Te.value)):xe.refs?P_(xe.ref)?xe.refs.length>1?xe.refs.forEach(Te=>(!Te.defaultChecked||!Te.disabled)&&(Te.checked=Array.isArray(Me)?!!Me.find(Ye=>Ye===Te.value):Me===Te.value)):xe.refs[0]&&(xe.refs[0].checked=!!Me):xe.refs.forEach(Te=>Te.checked=Te.value===Me):qI(xe.ref)?xe.ref.value="":(xe.ref.value=Me,xe.ref.type||d.state.next({name:Z,values:Zn(i)})))}(ge.shouldDirty||ge.shouldTouch)&&R(Z,Me,ge.shouldTouch,ge.shouldDirty,!0),ge.shouldValidate&&X(Z)},W=(Z,fe,ge)=>{for(const Pe in fe){const Me=fe[Pe],xe=`${Z}.${Pe}`,Te=Ie(r,xe);(o.array.has(Z)||br(Me)||Te&&!Te._f)&&!Cf(Me)?W(xe,Me,ge):Y(xe,Me,ge)}},H=(Z,fe,ge={})=>{const Pe=Ie(r,Z),Me=o.array.has(Z),xe=Zn(fe);Jt(i,Z,xe),Me?(d.array.next({name:Z,values:Zn(i)}),(f.isDirty||f.dirtyFields||l.isDirty||l.dirtyFields)&&ge.shouldDirty&&d.state.next({name:Z,dirtyFields:xy(s,i),isDirty:I(Z,xe)})):Pe&&!Pe._f&&!Gs(xe)?W(Z,xe,ge):Y(Z,xe,ge),rN(Z,o)&&d.state.next({...n}),d.state.next({name:a.mount?Z:void 0,values:Zn(i)})},ee=async Z=>{a.mount=!0;const fe=Z.target;let ge=fe.name,Pe=!0;const Me=Ie(r,ge),xe=Te=>{Pe=Number.isNaN(Te)||Cf(Te)&&isNaN(Te.getTime())||Nu(Te,Ie(i,ge,Te))};if(Me){let Te,Ye;const Pt=fe.type?DB(Me._f):yK(Z),wt=Z.type===g1.BLUR||Z.type===g1.FOCUS_OUT,Ls=!bPe(Me._f)&&!e.resolver&&!Ie(n.errors,ge)&&!Me._f.deps||xPe(wt,Ie(n.touchedFields,ge),n.isSubmitted,p,m),Yn=rN(ge,o,wt);Jt(i,ge,Pt),wt?(Me._f.onBlur&&Me._f.onBlur(Z),c&&c(0)):Me._f.onChange&&Me._f.onChange(Z);const gs=R(ge,Pt,wt),Ht=!Ps(gs)||Yn;if(!wt&&d.state.next({name:ge,type:Z.type,values:Zn(i)}),Ls)return(f.isValid||l.isValid)&&(e.mode==="onBlur"?wt&&g():wt||g()),Ht&&d.state.next({name:ge,...Yn?{}:gs});if(!wt&&Yn&&d.state.next({...n}),e.resolver){const{errors:an}=await T([ge]);if(xe(Pt),Pe){const vn=MB(n.errors,r,ge),Be=MB(an,r,vn.name||ge);Te=Be.error,ge=Be.name,Ye=Ps(an)}}else v([ge],!0),Te=(await sN(Me,o.disabled,i,h,e.shouldUseNativeValidation))[ge],v([ge]),xe(Pt),Pe&&(Te?Ye=!1:(f.isValid||l.isValid)&&(Ye=await M(r,!0)));Pe&&(Me._f.deps&&X(Me._f.deps),E(ge,Ye,Te,gs))}},re=(Z,fe)=>{if(Ie(n.errors,fe)&&Z.focus)return Z.focus(),1},X=async(Z,fe={})=>{let ge,Pe;const Me=bi(Z);if(e.resolver){const xe=await D(Bn(Z)?Z:Me);ge=Ps(xe),Pe=Z?!Me.some(Te=>Ie(xe,Te)):ge}else Z?(Pe=(await Promise.all(Me.map(async xe=>{const Te=Ie(r,xe);return await M(Te&&Te._f?{[xe]:Te}:Te)}))).every(Boolean),!(!Pe&&!n.isValid)&&g()):Pe=ge=await M(r);return d.state.next({...!gl(Z)||(f.isValid||l.isValid)&&ge!==n.isValid?{}:{name:Z},...e.resolver||!Z?{isValid:ge}:{},errors:n.errors}),fe.shouldFocus&&!Pe&&zm(r,re,Z?Me:o.mount),Pe},G=Z=>{const fe={...a.mount?i:s};return Bn(Z)?fe:gl(Z)?Ie(fe,Z):Z.map(ge=>Ie(fe,ge))},K=(Z,fe)=>({invalid:!!Ie((fe||n).errors,Z),isDirty:!!Ie((fe||n).dirtyFields,Z),error:Ie((fe||n).errors,Z),isValidating:!!Ie(n.validatingFields,Z),isTouched:!!Ie((fe||n).touchedFields,Z)}),J=Z=>{Z&&bi(Z).forEach(fe=>Sr(n.errors,fe)),d.state.next({errors:Z?n.errors:{}})},ue=(Z,fe,ge)=>{const Pe=(Ie(r,Z,{_f:{}})._f||{}).ref,Me=Ie(n.errors,Z)||{},{ref:xe,message:Te,type:Ye,...Pt}=Me;Jt(n.errors,Z,{...Pt,...fe,ref:Pe}),d.state.next({name:Z,errors:n.errors,isValid:!1}),ge&&ge.shouldFocus&&Pe&&Pe.focus&&Pe.focus()},de=(Z,fe)=>_a(Z)?d.state.subscribe({next:ge=>Z(F(void 0,fe),ge)}):F(Z,fe,!0),ie=Z=>d.state.subscribe({next:fe=>{_Pe(Z.name,fe.name,Z.exact)&&wPe(fe,Z.formState||f,Xt,Z.reRenderRoot)&&Z.callback({values:{...i},...n,...fe})}}).unsubscribe,be=Z=>(a.mount=!0,l={...l,...Z.formState},ie({...Z,formState:l})),Ae=(Z,fe={})=>{for(const ge of Z?bi(Z):o.mount)o.mount.delete(ge),o.array.delete(ge),fe.keepValue||(Sr(r,ge),Sr(i,ge)),!fe.keepError&&Sr(n.errors,ge),!fe.keepDirty&&Sr(n.dirtyFields,ge),!fe.keepTouched&&Sr(n.touchedFields,ge),!fe.keepIsValidating&&Sr(n.validatingFields,ge),!e.shouldUnregister&&!fe.keepDefaultValue&&Sr(s,ge);d.state.next({values:Zn(i)}),d.state.next({...n,...fe.keepDirty?{isDirty:I()}:{}}),!fe.keepIsValid&&g()},_e=({disabled:Z,name:fe})=>{(Zi(Z)&&a.mount||Z||o.disabled.has(fe))&&(Z?o.disabled.add(fe):o.disabled.delete(fe))},Oe=(Z,fe={})=>{let ge=Ie(r,Z);const Pe=Zi(fe.disabled)||Zi(e.disabled);return Jt(r,Z,{...ge||{},_f:{...ge&&ge._f?ge._f:{ref:{name:Z}},name:Z,mount:!0,...fe}}),o.mount.add(Z),ge?_e({disabled:Zi(fe.disabled)?fe.disabled:e.disabled,name:Z}):k(Z,!0,fe.value),{...Pe?{disabled:fe.disabled||e.disabled}:{},...e.progressive?{required:!!fe.required,min:Sy(fe.min),max:Sy(fe.max),minLength:Sy(fe.minLength),maxLength:Sy(fe.maxLength),pattern:Sy(fe.pattern)}:{},name:Z,onChange:ee,onBlur:ee,ref:Me=>{if(Me){Oe(Z,fe),ge=Ie(r,Z);const xe=Bn(Me.value)&&Me.querySelectorAll&&Me.querySelectorAll("input,select,textarea")[0]||Me,Te=pPe(xe),Ye=ge._f.refs||[];if(Te?Ye.find(Pt=>Pt===xe):xe===ge._f.ref)return;Jt(r,Z,{_f:{...ge._f,...Te?{refs:[...Ye.filter(OT),xe,...Array.isArray(Ie(s,Z))?[{}]:[]],ref:{type:xe.type,name:Z}}:{ref:xe}}}),k(Z,!1,void 0,xe)}else ge=Ie(r,Z,{}),ge._f&&(ge._f.mount=!1),(e.shouldUnregister||fe.shouldUnregister)&&!(bK(o.array,Z)&&a.action)&&o.unMount.add(Z)}}},Ne=()=>e.shouldFocusError&&zm(r,re,o.mount),ye=Z=>{Zi(Z)&&(d.state.next({disabled:Z}),zm(r,(fe,ge)=>{const Pe=Ie(r,ge);Pe&&(fe.disabled=Pe._f.disabled||Z,Array.isArray(Pe._f.refs)&&Pe._f.refs.forEach(Me=>{Me.disabled=Pe._f.disabled||Z}))},0,!1))},$e=(Z,fe)=>async ge=>{let Pe;ge&&(ge.preventDefault&&ge.preventDefault(),ge.persist&&ge.persist());let Me=Zn(i);if(d.state.next({isSubmitting:!0}),e.resolver){const{errors:xe,values:Te}=await T();n.errors=xe,Me=Te}else await M(r);if(o.disabled.size)for(const xe of o.disabled)Jt(Me,xe,void 0);if(Sr(n.errors,"root"),Ps(n.errors)){d.state.next({errors:{}});try{await Z(Me,ge)}catch(xe){Pe=xe}}else fe&&await fe({...n.errors},ge),Ne(),setTimeout(Ne);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ps(n.errors)&&!Pe,submitCount:n.submitCount+1,errors:n.errors}),Pe)throw Pe},ut=(Z,fe={})=>{Ie(r,Z)&&(Bn(fe.defaultValue)?H(Z,Zn(Ie(s,Z))):(H(Z,fe.defaultValue),Jt(s,Z,Zn(fe.defaultValue))),fe.keepTouched||Sr(n.touchedFields,Z),fe.keepDirty||(Sr(n.dirtyFields,Z),n.isDirty=fe.defaultValue?I(Z,Zn(Ie(s,Z))):I()),fe.keepError||(Sr(n.errors,Z),f.isValid&&g()),d.state.next({...n}))},Qe=(Z,fe={})=>{const ge=Z?Zn(Z):s,Pe=Zn(ge),Me=Ps(Z),xe=Me?s:Pe;if(fe.keepDefaultValues||(s=ge),!fe.keepValues){if(fe.keepDirtyValues){const Te=new Set([...o.mount,...Object.keys(xy(s,i))]);for(const Ye of Array.from(Te))Ie(n.dirtyFields,Ye)?Jt(xe,Ye,Ie(i,Ye)):H(Ye,Ie(xe,Ye))}else{if(WI&&Bn(Z))for(const Te of o.mount){const Ye=Ie(r,Te);if(Ye&&Ye._f){const Pt=Array.isArray(Ye._f.refs)?Ye._f.refs[0]:Ye._f.ref;if(v1(Pt)){const wt=Pt.closest("form");if(wt){wt.reset();break}}}}for(const Te of o.mount)H(Te,Ie(xe,Te))}i=Zn(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:Me?!1:fe.keepDirty?n.isDirty:!!(fe.keepDefaultValues&&!Nu(Z,s)),isSubmitted:fe.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Me?{}:fe.keepDirtyValues?fe.keepDefaultValues&&i?xy(s,i):n.dirtyFields:fe.keepDefaultValues&&Z?xy(s,Z):fe.keepDirty?n.dirtyFields:{},touchedFields:fe.keepTouched?n.touchedFields:{},errors:fe.keepErrors?n.errors:{},isSubmitSuccessful:fe.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},yt=(Z,fe)=>Qe(_a(Z)?Z(i):Z,fe),En=(Z,fe={})=>{const ge=Ie(r,Z),Pe=ge&&ge._f;if(Pe){const Me=Pe.refs?Pe.refs[0]:Pe.ref;Me.focus&&(Me.focus(),fe.shouldSelect&&_a(Me.select)&&Me.select())}},Xt=Z=>{n={...n,...Z}},Qt={control:{register:Oe,unregister:Ae,getFieldState:K,handleSubmit:$e,setError:ue,_subscribe:ie,_runSchema:T,_getWatch:F,_getDirty:I,_setValid:g,_setFieldArray:w,_setDisabledField:_e,_setErrors:A,_getFieldArray:U,_reset:Qe,_resetDefaultValues:()=>_a(e.defaultValues)&&e.defaultValues().then(Z=>{yt(Z,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(Z){a=Z},get _defaultValues(){return s},get _names(){return o},set _names(Z){o=Z},get _formState(){return n},get _options(){return e},set _options(Z){e={...e,...Z}}},subscribe:be,trigger:X,register:Oe,handleSubmit:$e,watch:de,setValue:H,getValues:G,reset:yt,resetField:ut,clearErrors:J,unregister:Ae,setError:ue,setFocus:En,getFieldState:K};return{...Qt,formControl:Qt}}var vu=()=>{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)})},LT=(t,e,n={})=>n.shouldFocus||Bn(n.shouldFocus)?n.focusName||`${t}.${Bn(n.focusIndex)?e:n.focusIndex}.`:"",IT=(t,e)=>[...t,...bi(e)],$T=t=>Array.isArray(t)?t.map(()=>{}):void 0;function FT(t,e,n){return[...t.slice(0,e),...bi(n),...t.slice(e)]}var jT=(t,e,n)=>Array.isArray(t)?(Bn(t[n])&&(t[n]=void 0),t.splice(n,0,t.splice(e,1)[0]),t):[],zT=(t,e)=>[...bi(e),...bi(t)];function APe(t,e){let n=0;const r=[...t];for(const s of e)r.splice(s-n,1),n++;return T_(r).length?r:[]}var BT=(t,e)=>Bn(e)?[]:APe(t,bi(e).sort((n,r)=>n-r)),UT=(t,e,n)=>{[t[e],t[n]]=[t[n],t[e]]},LB=(t,e,n)=>(t[e]=n,t);function UHe(t){const e=jd(),{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(vu)),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:k,name:R})=>{if(R===l.current||!R){const E=Ie(k,l.current);Array.isArray(E)&&(c(E),u.current=E.map(vu))}}}).unsubscribe,[n]);const m=se.useCallback(k=>{d.current=!0,n._setFieldArray(r,k)},[n,r]),p=(k,R)=>{const E=bi(Zn(k)),T=IT(n._getFieldArray(r),E);n._names.focus=LT(r,T.length-1,R),u.current=IT(u.current,E.map(vu)),m(T),c(T),n._setFieldArray(r,T,IT,{argA:$T(k)})},h=(k,R)=>{const E=bi(Zn(k)),T=zT(n._getFieldArray(r),E);n._names.focus=LT(r,0,R),u.current=zT(u.current,E.map(vu)),m(T),c(T),n._setFieldArray(r,T,zT,{argA:$T(k)})},y=k=>{const R=BT(n._getFieldArray(r),k);u.current=BT(u.current,k),m(R),c(R),!Array.isArray(Ie(n._fields,r))&&Jt(n._fields,r,void 0),n._setFieldArray(r,R,BT,{argA:k})},g=(k,R,E)=>{const T=bi(Zn(R)),D=FT(n._getFieldArray(r),k,T);n._names.focus=LT(r,k,E),u.current=FT(u.current,k,T.map(vu)),m(D),c(D),n._setFieldArray(r,D,FT,{argA:k,argB:$T(R)})},v=(k,R)=>{const E=n._getFieldArray(r);UT(E,k,R),UT(u.current,k,R),m(E),c(E),n._setFieldArray(r,E,UT,{argA:k,argB:R},!1)},w=(k,R)=>{const E=n._getFieldArray(r);jT(E,k,R),jT(u.current,k,R),m(E),c(E),n._setFieldArray(r,E,jT,{argA:k,argB:R},!1)},x=(k,R)=>{const E=Zn(R),T=LB(n._getFieldArray(r),k,E);u.current=[...T].map((D,M)=>!D||M===k?vu():u.current[M]),m(T),c([...T]),n._setFieldArray(r,T,LB,{argA:k,argB:E},!0,!1)},A=k=>{const R=bi(Zn(k));u.current=R.map(vu),m([...R]),c([...R]),n._setFieldArray(r,[...R],E=>E,{},!0,!1)};return se.useEffect(()=>{if(n._state.action=!1,rN(r,n._names)&&n._subjects.state.next({...n._formState}),d.current&&(!Sm(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!Sm(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([r]).then(k=>{const R=Ie(k.errors,r),E=Ie(n._formState.errors,r);(E?!R&&E.type||R&&(E.type!==R.type||E.message!==R.message):R&&R.type)&&(R?Jt(n._formState.errors,r,R):Sr(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const k=Ie(n._fields,r);k&&k._f&&!(Sm(n._options.reValidateMode).isOnSubmit&&Sm(n._options.mode).isOnSubmit)&&sN(k,n._names.disabled,n._formValues,n._options.criteriaMode===No.all,n._options.shouldUseNativeValidation,!0).then(R=>!Ps(R)&&n._subjects.state.next({errors:DK(n._formState.errors,R,r)}))}n._subjects.state.next({name:r,values:Zn(n._formValues)}),n._names.focus&&zm(n._fields,(k,R)=>{if(n._names.focus&&R.startsWith(n._names.focus)&&k.focus)return k.focus(),1}),n._names.focus="",n._setValid(),d.current=!1},[o,r,n]),se.useEffect(()=>(!Ie(n._formValues,r)&&n._setFieldArray(r),()=>{const k=(R,E)=>{const T=Ie(n._fields,R);T&&T._f&&(T._f.mount=E)};n._options.shouldUnregister||i?n.unregister(r):k(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((k,R)=>({...k,[s]:u.current[R]||vu()})),[o,s])}}function RPe(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:CPe(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&&!Nu(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&&!Ps(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=xK(r,i),e.current}var PPe="Label",NK=_.forwardRef((t,e)=>P.jsx(De.label,{...t,ref:e,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=t.onMouseDown)==null||s.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));NK.displayName=PPe;var MK=NK;const TPe=Ho("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),OK=_.forwardRef(({className:t,...e},n)=>P.jsx(MK,{ref:n,className:ce(TPe(),t),...e}));OK.displayName=MK.displayName;const kPe=cPe,LK=_.createContext({}),KI=({...t})=>P.jsx(LK.Provider,{value:{name:t.name},children:P.jsx(hPe,{...t},t.name)}),Nv=()=>{const t=_.useContext(LK),e=_.useContext(IK),{getFieldState:n,formState:r}=jd(),s=n(t.name,r);if(!t)throw new Error("useFormField should be used within <FormField>");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}},IK=_.createContext({}),gA=_.forwardRef(({className:t,...e},n)=>{const r=_.useId();return P.jsx(IK.Provider,{value:{id:r},children:P.jsx("div",{ref:n,className:ce("space-y-2",t),...e})})});gA.displayName="FormItem";const $K=_.forwardRef(({className:t,...e},n)=>{const{error:r,formItemId:s}=Nv();return P.jsx(OK,{ref:n,className:ce(r&&"text-destructive",t),htmlFor:s,...e})});$K.displayName="FormLabel";const vA=_.forwardRef(({...t},e)=>{const{error:n,formItemId:r,formDescriptionId:s,formMessageId:i}=Nv();return P.jsx(Ra,{ref:e,id:r,"aria-describedby":n?`${s} ${i}`:`${s}`,"aria-invalid":!!n,...t})});vA.displayName="FormControl";const yA=_.forwardRef(({className:t,...e},n)=>{const{formDescriptionId:r}=Nv();return P.jsx("p",{ref:n,id:r,className:ce("text-[0.8rem] text-muted-foreground",t),...e})});yA.displayName="FormDescription";const FK=_.forwardRef(({className:t,children:e,...n},r)=>{const{error:s,formMessageId:i}=Nv(),a=s?String((s==null?void 0:s.message)??""):e;return a?P.jsx("p",{ref:r,id:i,className:ce("text-[0.8rem] font-medium text-destructive",t),...n,children:a}):null});FK.displayName="FormMessage";var HT,jK="HoverCard",[zK,HHe]=Tn(jK,[Rl]),YI=Rl(),[WHe,XI]=zK(jK),BK="HoverCardTrigger",DPe=_.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,s=XI(BK,n),i=YI(n);return P.jsx(Dv,{asChild:!0,...i,children:P.jsx(De.a,{"data-state":s.open?"open":"closed",...r,ref:e,onPointerEnter:me(t.onPointerEnter,_1(s.onOpen)),onPointerLeave:me(t.onPointerLeave,_1(s.onClose)),onFocus:me(t.onFocus,s.onOpen),onBlur:me(t.onBlur,s.onClose),onTouchStart:me(t.onTouchStart,a=>a.preventDefault())})})});DPe.displayName=BK;var NPe="HoverCardPortal",[VHe,MPe]=zK(NPe,{forceMount:void 0}),w1="HoverCardContent",UK=_.forwardRef((t,e)=>{const n=MPe(w1,t.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=t,i=XI(w1,t.__scopeHoverCard);return P.jsx(Hn,{present:r||i.open,children:P.jsx(OPe,{"data-state":i.open?"open":"closed",...s,onPointerEnter:me(t.onPointerEnter,_1(i.onOpen)),onPointerLeave:me(t.onPointerLeave,_1(i.onClose)),ref:e})})});UK.displayName=w1;var OPe=_.forwardRef((t,e)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,...o}=t,c=XI(w1,n),u=YI(n),f=_.useRef(null),l=tt(e,f),[d,m]=_.useState(!1);return _.useEffect(()=>{if(d){const p=document.body;return HT=p.style.userSelect||p.style.webkitUserSelect,p.style.userSelect="none",p.style.webkitUserSelect="none",()=>{p.style.userSelect=HT,p.style.webkitUserSelect=HT}}},[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&&$Pe(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(w_,{...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)"}})})}),LPe="HoverCardArrow",IPe=_.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,s=YI(n);return P.jsx(__,{...s,...r,ref:e})});IPe.displayName=LPe;function _1(t){return e=>e.pointerType==="touch"?void 0:t()}function $Pe(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 HK=UK;const FPe=_.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},s)=>P.jsx(HK,{ref:s,align:e,sideOffset:n,className:ce("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}));FPe.displayName=HK.displayName;const jPe=_.forwardRef(({className:t,type:e,...n},r)=>P.jsx("input",{type:e,className:ce("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}));jPe.displayName="Input";var bA="Menubar",[iN,zPe,BPe]=Xc(bA),[WK,qHe]=Tn(bA,[BPe,Pl]),Di=C_(),VK=Pl(),[UPe,qK]=WK(bA),GK=_.forwardRef((t,e)=>{const{__scopeMenubar:n,value:r,onValueChange:s,defaultValue:i,loop:a=!0,dir:o,...c}=t,u=Ma(o),f=VK(n),[l="",d]=sr({prop:r,onChange:s,defaultProp:i}),[m,p]=_.useState(null);return P.jsx(UPe,{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(iN.Provider,{scope:n,children:P.jsx(iN.Slot,{scope:n,children:P.jsx(x_,{asChild:!0,...f,orientation:"horizontal",loop:a,dir:u,currentTabStopId:m,onCurrentTabStopIdChange:p,children:P.jsx(De.div,{role:"menubar",...c,ref:e})})})})})});GK.displayName=bA;var HPe="MenubarMenu",[GHe,KK]=WK(HPe),oN="MenubarTrigger",YK=_.forwardRef((t,e)=>{const{__scopeMenubar:n,disabled:r=!1,...s}=t,i=VK(n),a=Di(n),o=qK(oN,n),c=KK(oN,n),u=_.useRef(null),f=tt(e,u,c.triggerRef),[l,d]=_.useState(!1),m=o.value===c.value;return P.jsx(iN.ItemSlot,{scope:n,value:c.value,disabled:r,children:P.jsx(S_,{asChild:!0,...i,focusable:!r,tabStopId:c.value,children:P.jsx(SI,{asChild:!0,...a,children:P.jsx(De.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))})})})})});YK.displayName=oN;var WPe="MenubarPortal",XK=t=>{const{__scopeMenubar:e,...n}=t,r=Di(e);return P.jsx(EI,{...r,...n})};XK.displayName=WPe;var aN="MenubarContent",QK=_.forwardRef((t,e)=>{const{__scopeMenubar:n,align:r="start",...s}=t,i=Di(n),a=qK(aN,n),o=KK(aN,n),c=zPe(n),u=_.useRef(!1);return P.jsx(CI,{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?iTe(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)"}})});QK.displayName=aN;var VPe="MenubarGroup",qPe=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Di(n);return P.jsx(AI,{...s,...r,ref:e})});qPe.displayName=VPe;var GPe="MenubarLabel",JK=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Di(n);return P.jsx(RI,{...s,...r,ref:e})});JK.displayName=GPe;var KPe="MenubarItem",ZK=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Di(n);return P.jsx(PI,{...s,...r,ref:e})});ZK.displayName=KPe;var YPe="MenubarCheckboxItem",e7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Di(n);return P.jsx(TI,{...s,...r,ref:e})});e7.displayName=YPe;var XPe="MenubarRadioGroup",QPe=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Di(n);return P.jsx(kI,{...s,...r,ref:e})});QPe.displayName=XPe;var JPe="MenubarRadioItem",t7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Di(n);return P.jsx(DI,{...s,...r,ref:e})});t7.displayName=JPe;var ZPe="MenubarItemIndicator",n7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Di(n);return P.jsx(NI,{...s,...r,ref:e})});n7.displayName=ZPe;var eTe="MenubarSeparator",r7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Di(n);return P.jsx(MI,{...s,...r,ref:e})});r7.displayName=eTe;var tTe="MenubarArrow",nTe=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Di(n);return P.jsx(OI,{...s,...r,ref:e})});nTe.displayName=tTe;var rTe="MenubarSubTrigger",s7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Di(n);return P.jsx(LI,{"data-radix-menubar-subtrigger":"",...s,...r,ref:e})});s7.displayName=rTe;var sTe="MenubarSubContent",i7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Di(n);return P.jsx(II,{...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)"}})});i7.displayName=sTe;function iTe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var o7=GK,a7=YK,oTe=XK,l7=QK,c7=JK,u7=ZK,d7=e7,f7=t7,h7=n7,p7=r7,m7=s7,g7=i7;const aTe=_.forwardRef(({className:t,...e},n)=>P.jsx(o7,{ref:n,className:ce("flex h-10 items-center space-x-1 rounded-md border bg-background p-1",t),...e}));aTe.displayName=o7.displayName;const lTe=_.forwardRef(({className:t,...e},n)=>P.jsx(a7,{ref:n,className:ce("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}));lTe.displayName=a7.displayName;const cTe=_.forwardRef(({className:t,inset:e,children:n,...r},s)=>P.jsxs(m7,{ref:s,className:ce("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(s_,{className:"ml-auto h-4 w-4"})]}));cTe.displayName=m7.displayName;const uTe=_.forwardRef(({className:t,...e},n)=>P.jsx(g7,{ref:n,className:ce("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}));uTe.displayName=g7.displayName;const dTe=_.forwardRef(({className:t,align:e="start",alignOffset:n=-4,sideOffset:r=8,...s},i)=>P.jsx(oTe,{children:P.jsx(l7,{ref:i,align:e,alignOffset:n,sideOffset:r,className:ce("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})}));dTe.displayName=l7.displayName;const fTe=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(u7,{ref:r,className:ce("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}));fTe.displayName=u7.displayName;const hTe=_.forwardRef(({className:t,children:e,checked:n,...r},s)=>P.jsxs(d7,{ref:s,className:ce("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(h7,{children:P.jsx(r_,{className:"h-4 w-4"})})}),e]}));hTe.displayName=d7.displayName;const pTe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(f7,{ref:r,className:ce("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(h7,{children:P.jsx($C,{className:"h-2 w-2 fill-current"})})}),e]}));pTe.displayName=f7.displayName;const mTe=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(c7,{ref:r,className:ce("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));mTe.displayName=c7.displayName;const gTe=_.forwardRef(({className:t,...e},n)=>P.jsx(p7,{ref:n,className:ce("-mx-1 my-1 h-px bg-muted",t),...e}));gTe.displayName=p7.displayName;var vTe="VisuallyHidden",k_=_.forwardRef((t,e)=>P.jsx(De.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));k_.displayName=vTe;var v7=k_,Mv="NavigationMenu",[QI,y7,yTe]=Xc(Mv),[lN,bTe,wTe]=Xc(Mv),[JI,KHe]=Tn(Mv,[yTe,wTe]),[_Te,Vo]=JI(Mv),[xTe,STe]=JI(Mv),b7=_.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,T=>d(T)),p=Ma(u),h=_.useRef(0),y=_.useRef(0),g=_.useRef(0),[v,w]=_.useState(!0),[x="",A]=sr({prop:r,onChange:T=>{const D=T!=="",M=o>0;D?(window.clearTimeout(g.current),M&&w(!1)):(window.clearTimeout(g.current),g.current=window.setTimeout(()=>w(!0),o)),s==null||s(T)},defaultProp:i}),k=_.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>A(""),150)},[A]),R=_.useCallback(T=>{window.clearTimeout(y.current),A(T)},[A]),E=_.useCallback(T=>{x===T?window.clearTimeout(y.current):h.current=window.setTimeout(()=>{window.clearTimeout(y.current),A(T)},a)},[x,A,a]);return _.useEffect(()=>()=>{window.clearTimeout(h.current),window.clearTimeout(y.current),window.clearTimeout(g.current)},[]),P.jsx(_7,{scope:n,isRootMenu:!0,value:x,dir:p,orientation:c,rootNavigationMenu:l,onTriggerEnter:T=>{window.clearTimeout(h.current),v?E(T):R(T)},onTriggerLeave:()=>{window.clearTimeout(h.current),k()},onContentEnter:()=>window.clearTimeout(y.current),onContentLeave:k,onItemSelect:T=>{A(D=>D===T?"":T)},onItemDismiss:()=>A(""),children:P.jsx(De.nav,{"aria-label":"Main","data-orientation":c,dir:p,...f,ref:m})})});b7.displayName=Mv;var w7="NavigationMenuSub",ETe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:s,defaultValue:i,orientation:a="horizontal",...o}=t,c=Vo(w7,n),[u="",f]=sr({prop:r,onChange:s,defaultProp:i});return P.jsx(_7,{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(De.div,{"data-orientation":a,...o,ref:e})})});ETe.displayName=w7;var _7=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(_Te,{scope:e,isRootMenu:n,rootNavigationMenu:r,value:o,previousValue:Pv(o),baseId:Vr(),dir:s,orientation:i,viewport:p,onViewportChange:h,indicatorTrack:v,onIndicatorTrackChange:w,onTriggerEnter:Ut(f),onTriggerLeave:Ut(l),onContentEnter:Ut(d),onContentLeave:Ut(m),onItemSelect:Ut(c),onItemDismiss:Ut(u),onViewportContentChange:_.useCallback((x,A)=>{g(k=>(k.set(x,A),new Map(k)))},[]),onViewportContentRemove:_.useCallback(x=>{g(A=>A.has(x)?(A.delete(x),new Map(A)):A)},[]),children:P.jsx(QI.Provider,{scope:e,children:P.jsx(xTe,{scope:e,items:y,children:a})})})},x7="NavigationMenuList",S7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=Vo(x7,n),i=P.jsx(De.ul,{"data-orientation":s.orientation,...r,ref:e});return P.jsx(De.div,{style:{position:"relative"},ref:s.onIndicatorTrackChange,children:P.jsx(QI.Slot,{scope:n,children:s.isRootMenu?P.jsx(D7,{asChild:!0,children:i}):i})})});S7.displayName=x7;var E7="NavigationMenuItem",[CTe,C7]=JI(E7),ATe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,...s}=t,i=Vr(),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=uN(o.current);h.length&&t$(p==="start"?h:h.reverse())}},[]),m=_.useCallback(()=>{if(o.current){const p=uN(o.current);p.length&&(f.current=OTe(p))}},[]);return P.jsx(CTe,{scope:n,value:a,triggerRef:c,contentRef:o,focusProxyRef:u,wasEscapeCloseRef:l,onEntryKeyDown:d,onFocusProxyEnter:d,onRootContentClose:m,onContentFocusOutside:m,children:P.jsx(De.li,{...s,ref:e})})});ATe.displayName=E7;var cN="NavigationMenuTrigger",A7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,disabled:r,...s}=t,i=Vo(cN,t.__scopeNavigationMenu),a=C7(cN,t.__scopeNavigationMenu),o=_.useRef(null),c=tt(o,a.triggerRef,e),u=M7(i.baseId,a.value),f=O7(i.baseId,a.value),l=_.useRef(!1),d=_.useRef(!1),m=a.value===i.value;return P.jsxs(P.Fragment,{children:[P.jsx(QI.ItemSlot,{scope:n,value:a.value,children:P.jsx(N7,{asChild:!0,children:P.jsx(De.button,{id:u,disabled:r,"data-disabled":r?"":void 0,"data-state":n$(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,x1(()=>{r||d.current||a.wasEscapeCloseRef.current||l.current||(i.onTriggerEnter(a.value),l.current=!0)})),onPointerLeave:me(t.onPointerLeave,x1(()=>{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(v7,{"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})]})]})});A7.displayName=cN;var RTe="NavigationMenuLink",IB="navigationMenu.linkSelect",PTe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,active:r,onSelect:s,...i}=t;return P.jsx(N7,{asChild:!0,children:P.jsx(De.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(IB,{bubbles:!0,cancelable:!0});if(o.addEventListener(IB,u=>s==null?void 0:s(u),{once:!0}),Wb(o,c),!c.defaultPrevented&&!a.metaKey){const u=new CustomEvent(VS,{bubbles:!0,cancelable:!0});Wb(o,u)}},{checkForDefaultPrevented:!1})})})});PTe.displayName=RTe;var ZI="NavigationMenuIndicator",R7=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Vo(ZI,t.__scopeNavigationMenu),i=!!s.value;return s.indicatorTrack?t_.createPortal(P.jsx(Hn,{present:n||i,children:P.jsx(TTe,{...r,ref:e})}),s.indicatorTrack):null});R7.displayName=ZI;var TTe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=Vo(ZI,n),i=y7(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 dN(a,d),dN(s.indicatorTrack,d),c?P.jsx(De.div,{"aria-hidden":!0,"data-state":l?"visible":"hidden","data-orientation":s.orientation,...r,ref:e,style:{position:"absolute",...f?{left:0,width:c.size+"px",transform:`translateX(${c.offset}px)`}:{top:0,height:c.size+"px",transform:`translateY(${c.offset}px)`},...r.style}}):null}),uv="NavigationMenuContent",P7=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Vo(uv,t.__scopeNavigationMenu),i=C7(uv,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(kTe,{forceMount:n,...c,ref:a}):P.jsx(Hn,{present:n||o,children:P.jsx(T7,{"data-state":n$(o),...c,ref:a,onPointerEnter:me(t.onPointerEnter,s.onContentEnter),onPointerLeave:me(t.onPointerLeave,x1(s.onContentLeave)),style:{pointerEvents:!o&&s.isRootMenu?"none":void 0,...c.style}})})});P7.displayName=uv;var kTe=_.forwardRef((t,e)=>{const n=Vo(uv,t.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:s}=n;return Ln(()=>{r(t.value,{ref:e,...t})},[t,e,r]),Ln(()=>()=>s(t.value),[t.value,s]),null}),VS="navigationMenu.rootContentDismiss",T7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:s,focusProxyRef:i,wasEscapeCloseRef:a,onRootContentClose:o,onContentFocusOutside:c,...u}=t,f=Vo(uv,n),l=_.useRef(null),d=tt(l,e),m=M7(f.baseId,r),p=O7(f.baseId,r),h=y7(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(VS,x),()=>w.removeEventListener(VS,x)}},[f.isRootMenu,t.value,s,g,o]);const v=_.useMemo(()=>{const x=h().map(D=>D.value);f.dir==="rtl"&&x.reverse();const A=x.indexOf(f.value),k=x.indexOf(f.previousValue),R=r===f.value,E=k===x.indexOf(r);if(!R&&!E)return y.current;const T=(()=>{if(A!==k){if(R&&k!==-1)return A>k?"from-end":"from-start";if(E&&A!==-1)return A>k?"to-start":"to-end"}return null})();return y.current=T,T},[f.previousValue,f.value,f.dir,h,r]);return P.jsx(D7,{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(VS,{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 T;return(T=E.ref.current)==null?void 0:T.contains(x)}),k=f.isRootMenu&&((R=f.viewport)==null?void 0:R.contains(x));(A||k||!f.isRootMenu)&&w.preventDefault()}),onKeyDown:me(t.onKeyDown,w=>{var k;const x=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!x){const R=uN(w.currentTarget),E=document.activeElement,T=R.findIndex(L=>L===E),M=w.shiftKey?R.slice(0,T).reverse():R.slice(T+1,R.length);t$(M)?w.preventDefault():(k=i.current)==null||k.focus()}}),onEscapeKeyDown:me(t.onEscapeKeyDown,w=>{a.current=!0})})})}),e$="NavigationMenuViewport",k7=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=!!Vo(e$,t.__scopeNavigationMenu).value;return P.jsx(Hn,{present:n||i,children:P.jsx(DTe,{...r,ref:e})})});k7.displayName=e$;var DTe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,children:r,...s}=t,i=Vo(e$,n),a=tt(e,i.onViewportChange),o=STe(uv,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 dN(f,()=>{f&&u({width:f.offsetWidth,height:f.offsetHeight})}),P.jsx(De.div,{"data-state":n$(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,x1(i.onContentLeave)),children:Array.from(o.items).map(([g,{ref:v,forceMount:w,...x}])=>{const A=h===g;return P.jsx(Hn,{present:w||A,children:P.jsx(T7,{...x,ref:n_(v,k=>{A&&k&&l(k)})})},g)})})}),NTe="FocusGroup",D7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=Vo(NTe,n);return P.jsx(lN.Provider,{scope:n,children:P.jsx(lN.Slot,{scope:n,children:P.jsx(De.div,{dir:s.dir,...r,ref:e})})})}),$B=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],MTe="FocusGroupItem",N7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=bTe(n),i=Vo(MTe,n);return P.jsx(lN.ItemSlot,{scope:n,children:P.jsx(De.button,{...r,ref:e,onKeyDown:me(t.onKeyDown,a=>{if(["Home","End",...$B].includes(a.key)){let c=s().map(l=>l.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&c.reverse(),$B.includes(a.key)){const l=c.indexOf(a.currentTarget);c=c.slice(l+1)}setTimeout(()=>t$(c)),a.preventDefault()}})})})});function uN(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 t$(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}function OTe(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 dN(t,e){const n=Ut(e);Ln(()=>{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 n$(t){return t?"open":"closed"}function M7(t,e){return`${t}-trigger-${e}`}function O7(t,e){return`${t}-content-${e}`}function x1(t){return e=>e.pointerType==="mouse"?t(e):void 0}var L7=b7,I7=S7,$7=A7,F7=R7,j7=P7,z7=k7;const LTe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(L7,{ref:r,className:ce("relative z-10 flex max-w-max flex-1 items-center justify-center",t),...n,children:[e,P.jsx(B7,{})]}));LTe.displayName=L7.displayName;const ITe=_.forwardRef(({className:t,...e},n)=>P.jsx(I7,{ref:n,className:ce("group flex flex-1 list-none items-center justify-center space-x-1",t),...e}));ITe.displayName=I7.displayName;const $Te=Ho("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"),FTe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs($7,{ref:r,className:ce($Te(),"group",t),...n,children:[e," ",P.jsx(IC,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));FTe.displayName=$7.displayName;const jTe=_.forwardRef(({className:t,...e},n)=>P.jsx(j7,{ref:n,className:ce("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}));jTe.displayName=j7.displayName;const B7=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{className:ce("absolute left-0 top-full flex justify-center"),children:P.jsx(z7,{className:ce("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})}));B7.displayName=z7.displayName;const zTe=_.forwardRef(({className:t,...e},n)=>P.jsx(F7,{ref:n,className:ce("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"})}));zTe.displayName=F7.displayName;var BTe=typeof window>"u",fN=BTe?se.useEffect:se.useLayoutEffect,UTe=0,FB=()=>++UTe,jB=!1;function HTe(){let[t,e]=se.useState(jB?FB:void 0);return fN(()=>{t===void 0&&e(FB()),jB=!0},[]),t===void 0?t:`rwb-${t.toString(32)}`}function WTe(){return se.useMemo(()=>"useId"in se?se.useId:HTe,[])()}var hN="__wrap_b",gb="__wrap_n",zB="__wrap_o",U7=(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<c;)u=Math.round((o+c)/2),s(u),r.clientHeight===a?c=u:o=u;s(c*e+i*(1-e))}n.__wrap_o||typeof ResizeObserver<"u"&&(n.__wrap_o=new ResizeObserver(()=>{self.__wrap_b(0,+n.dataset.brr,n)})).observe(r)},VTe=U7.toString(),qTe='(self.CSS&&CSS.supports("text-wrap","balance")?1:2)',GTe=(t,e,n="")=>(n&&(n=`self.${gb}!=1&&${n}`),se.createElement("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:(t?"":`self.${gb}=self.${gb}||${qTe};self.${hN}=${VTe};`)+n},nonce:e})),KTe=se.createContext({preferNative:!0,hasProvider:!1});se.forwardRef(({ratio:t=1,preferNative:e,nonce:n,children:r,as:s,...i},a)=>{let o=WTe(),c=se.useRef(),u=se.useContext(KTe),f=e??u.preferNative,l=s||"span";return se.useImperativeHandle(a,()=>c.current,[]),fN(()=>{f&&self[gb]===1||c.current&&(self[hN]=U7)(0,t,c.current)},[r,f,t]),fN(()=>{if(!(f&&self[gb]===1))return()=>{if(!c.current)return;let d=c.current[zB];d&&(d.disconnect(),delete c.current[zB])}},[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),GTe(u.hasProvider,n,`self.${hN}("${o}",${t})`))});var YTe="Separator",BB="horizontal",XTe=["horizontal","vertical"],H7=_.forwardRef((t,e)=>{const{decorative:n,orientation:r=BB,...s}=t,i=QTe(r)?r:BB,o=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return P.jsx(De.div,{"data-orientation":i,...o,...s,ref:e})});H7.displayName=YTe;function QTe(t){return XTe.includes(t)}var W7=H7;const JTe=_.forwardRef(({className:t,orientation:e="horizontal",decorative:n=!0,...r},s)=>P.jsx(W7,{ref:s,decorative:n,orientation:e,className:ce("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));JTe.displayName=W7.displayName;const ZTe=_.forwardRef(({className:t,...e},n)=>P.jsx("ul",{ref:n,className:ce("flex flex-row items-center gap-1",t),...e}));ZTe.displayName="PaginationContent";const eke=_.forwardRef(({className:t,...e},n)=>P.jsx("li",{ref:n,className:ce("",t),...e}));eke.displayName="PaginationItem";var r$="Popover",[V7,YHe]=Tn(r$,[Rl]),D_=Rl(),[tke,zd]=V7(r$),q7=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!1}=t,o=D_(e),c=_.useRef(null),[u,f]=_.useState(!1),[l=!1,d]=sr({prop:r,defaultProp:s,onChange:i});return P.jsx(uA,{...o,children:P.jsx(tke,{scope:e,contentId:Vr(),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})})};q7.displayName=r$;var G7="PopoverAnchor",nke=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=zd(G7,n),i=D_(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:o}=s;return _.useEffect(()=>(a(),()=>o()),[a,o]),P.jsx(Dv,{...i,...r,ref:e})});nke.displayName=G7;var K7="PopoverTrigger",Y7=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=zd(K7,n),i=D_(n),a=tt(e,s.triggerRef),o=P.jsx(De.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":e9(s.open),...r,ref:a,onClick:me(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?o:P.jsx(Dv,{asChild:!0,...i,children:o})});Y7.displayName=K7;var s$="PopoverPortal",[rke,ske]=V7(s$,{forceMount:void 0}),X7=t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=zd(s$,e);return P.jsx(rke,{scope:e,forceMount:n,children:P.jsx(Hn,{present:n||i.open,children:P.jsx(Sv,{asChild:!0,container:s,children:r})})})};X7.displayName=s$;var dv="PopoverContent",Q7=_.forwardRef((t,e)=>{const n=ske(dv,t.__scopePopover),{forceMount:r=n.forceMount,...s}=t,i=zd(dv,t.__scopePopover);return P.jsx(Hn,{present:r||i.open,children:i.modal?P.jsx(ike,{...s,ref:e}):P.jsx(oke,{...s,ref:e})})});Q7.displayName=dv;var ike=_.forwardRef((t,e)=>{const n=zd(dv,t.__scopePopover),r=_.useRef(null),s=tt(e,r),i=_.useRef(!1);return _.useEffect(()=>{const a=r.current;if(a)return Ev(a)},[]),P.jsx(o_,{as:Ra,allowPinchZoom:!0,children:P.jsx(J7,{...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})})})}),oke=_.forwardRef((t,e)=>{const n=zd(dv,t.__scopePopover),r=_.useRef(!1),s=_.useRef(!1);return P.jsx(J7,{...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()}})}),J7=_.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=zd(dv,n),m=D_(n);return FC(),P.jsx(i_,{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(w_,{"data-state":e9(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)"}})})})}),Z7="PopoverClose",ake=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=zd(Z7,n);return P.jsx(De.button,{type:"button",...r,ref:e,onClick:me(t.onClick,()=>s.onOpenChange(!1))})});ake.displayName=Z7;var lke="PopoverArrow",cke=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=D_(n);return P.jsx(__,{...s,...r,ref:e})});cke.displayName=lke;function e9(t){return t?"open":"closed"}var uke=q7,dke=Y7,fke=X7,t9=Q7;const hke=uke,pke=dke,n9=_.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},s)=>P.jsx(fke,{children:P.jsx(t9,{ref:s,align:e,sideOffset:n,className:ce("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));n9.displayName=t9.displayName;var i$="Progress",o$=100,[mke,XHe]=Tn(i$),[gke,vke]=mke(i$),r9=_.forwardRef((t,e)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:i=yke,...a}=t;(s||s===0)&&!UB(s)&&console.error(bke(`${s}`,"Progress"));const o=UB(s)?s:o$;r!==null&&!HB(r,o)&&console.error(wke(`${r}`,"Progress"));const c=HB(r,o)?r:null,u=S1(c)?i(c,o):void 0;return P.jsx(gke,{scope:n,value:c,max:o,children:P.jsx(De.div,{"aria-valuemax":o,"aria-valuemin":0,"aria-valuenow":S1(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":o9(c,o),"data-value":c??void 0,"data-max":o,...a,ref:e})})});r9.displayName=i$;var s9="ProgressIndicator",i9=_.forwardRef((t,e)=>{const{__scopeProgress:n,...r}=t,s=vke(s9,n);return P.jsx(De.div,{"data-state":o9(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:e})});i9.displayName=s9;function yke(t,e){return`${Math.round(t/e*100)}%`}function o9(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function S1(t){return typeof t=="number"}function UB(t){return S1(t)&&!isNaN(t)&&t>0}function HB(t,e){return S1(t)&&!isNaN(t)&&t<=e&&t>=0}function bke(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${o$}\`.`}function wke(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 ${o$} if no \`max\` prop is set)
|
||
- \`null\` or \`undefined\` if the progress is indeterminate.
|
||
|
||
Defaulting to \`null\`.`}var a9=r9,_ke=i9;const xke=_.forwardRef(({className:t,value:e,...n},r)=>P.jsx(a9,{ref:r,className:ce("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...n,children:P.jsx(_ke,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));xke.displayName=a9.displayName;var a$="Radio",[Ske,l9]=Tn(a$),[Eke,Cke]=Ske(a$),c9=_.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(Eke,{scope:n,checked:s,disabled:a,children:[P.jsx(De.button,{type:"button",role:"radio","aria-checked":s,"data-state":f9(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(Ake,{control:f,bubbles:!m.current,name:r,value:o,checked:s,required:i,disabled:a,style:{transform:"translateX(-100%)"}})]})});c9.displayName=a$;var u9="RadioIndicator",d9=_.forwardRef((t,e)=>{const{__scopeRadio:n,forceMount:r,...s}=t,i=Cke(u9,n);return P.jsx(Hn,{present:r||i.checked,children:P.jsx(De.span,{"data-state":f9(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:e})})});d9.displayName=u9;var Ake=t=>{const{control:e,checked:n,bubbles:r=!0,...s}=t,i=_.useRef(null),a=Pv(n),o=v_(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 f9(t){return t?"checked":"unchecked"}var Rke=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],l$="RadioGroup",[Pke,QHe]=Tn(l$,[Pl,l9]),h9=Pl(),p9=l9(),[Tke,kke]=Pke(l$),m9=_.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=h9(n),p=Ma(u),[h,y]=sr({prop:i,defaultProp:s,onChange:l});return P.jsx(Tke,{scope:n,name:r,required:a,disabled:o,value:h,onValueChange:y,children:P.jsx(x_,{asChild:!0,...m,orientation:c,dir:p,loop:f,children:P.jsx(De.div,{role:"radiogroup","aria-required":a,"aria-orientation":c,"data-disabled":o?"":void 0,dir:p,...d,ref:e})})})});m9.displayName=l$;var g9="RadioGroupItem",v9=_.forwardRef((t,e)=>{const{__scopeRadioGroup:n,disabled:r,...s}=t,i=kke(g9,n),a=i.disabled||r,o=h9(n),c=p9(n),u=_.useRef(null),f=tt(e,u),l=i.value===s.value,d=_.useRef(!1);return _.useEffect(()=>{const m=h=>{Rke.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(S_,{asChild:!0,...o,focusable:!a,active:l,children:P.jsx(c9,{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())})})})});v9.displayName=g9;var Dke="RadioGroupIndicator",y9=_.forwardRef((t,e)=>{const{__scopeRadioGroup:n,...r}=t,s=p9(n);return P.jsx(d9,{...s,...r,ref:e})});y9.displayName=Dke;var b9=m9,w9=v9,Nke=y9;const Mke=_.forwardRef(({className:t,...e},n)=>P.jsx(b9,{className:ce("grid gap-2",t),...e,ref:n}));Mke.displayName=b9.displayName;const Oke=_.forwardRef(({className:t,...e},n)=>P.jsx(w9,{ref:n,className:ce("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:P.jsx(Nke,{className:"flex items-center justify-center",children:P.jsx($C,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Oke.displayName=w9.displayName;const{createElement:fv,createContext:Lke,forwardRef:_9,useCallback:li,useContext:x9,useEffect:Ih,useImperativeHandle:S9,useLayoutEffect:Ike,useMemo:$ke,useRef:mi,useState:Bm}=X0,WB=X0[`useId${Math.random()}`.slice(0,5)],Fke=Ike,wA=Lke(null);wA.displayName="PanelGroupContext";const $h=Fke,jke=typeof WB=="function"?WB:()=>null;let zke=0;function c$(t=null){const e=jke(),n=mi(t||e||null);return n.current===null&&(n.current=""+zke++),t??n.current}function E9({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=x9(wA);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:k,reevaluatePanelConstraints:R,registerPanel:E,resizePanel:T,unregisterPanel:D}=y,M=c$(a),L=mi({callbacks:{onCollapse:u,onExpand:f,onResize:l},constraints:{collapsedSize:n,collapsible:r,defaultSize:s,maxSize:o,minSize:c},id:M,idIsFromProps:a!==void 0,order:d});mi({didLogMissingDefaultSizeWarning:!1}),$h(()=>{const{callbacks:F,constraints:U}=L.current,Y={...U};L.current.id=M,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)}),$h(()=>{const F=L.current;return E(F),()=>{D(F)}},[d,M,E,D]),S9(i,()=>({collapse:()=>{g(L.current)},expand:F=>{v(L.current,F)},getId(){return M},getSize(){return w(L.current)},isCollapsed(){return k(L.current)},isExpanded(){return!k(L.current)},resize:F=>{T(L.current,F)}}),[g,v,w,k,M,T]);const I=x(L.current,s);return fv(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":M,"data-panel-size":parseFloat(""+I.flexGrow).toFixed(1)})}const Bke=_9((t,e)=>fv(E9,{...t,forwardedRef:e}));E9.displayName="Panel";Bke.displayName="forwardRef(Panel)";let pN=null,Af=null;function Uke(t,e){if(e){const n=(e&T9)!==0,r=(e&k9)!==0,s=(e&D9)!==0,i=(e&N9)!==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 Hke(){Af!==null&&(document.head.removeChild(Af),pN=null,Af=null)}function WT(t,e){const n=Uke(t,e);pN!==n&&(pN=n,Af===null&&(Af=document.createElement("style"),document.head.appendChild(Af)),Af.innerHTML=`*{cursor: ${n}!important;}`)}function C9(t){return t.type==="keydown"}function A9(t){return t.type.startsWith("pointer")}function R9(t){return t.type.startsWith("mouse")}function _A(t){if(A9(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(R9(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function Wke(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Vke(t,e,n){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function qke(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:GB(t),b:GB(e)};let r;for(;n.a.at(-1)===n.b.at(-1);)t=n.a.pop(),e=n.b.pop(),r=t;Tt(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:qB(VB(n.a)),b:qB(VB(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 Gke=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Kke(t){var e;const n=getComputedStyle((e=P9(t))!==null&&e!==void 0?e:t).display;return n==="flex"||n==="inline-flex"}function Yke(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||Kke(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"||Gke.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function VB(t){let e=t.length;for(;e--;){const n=t[e];if(Tt(n,"Missing node"),Yke(n))return n}return null}function qB(t){return t&&Number(getComputedStyle(t).zIndex)||0}function GB(t){const e=[];for(;t;)e.push(t),t=P9(t);return e}function P9(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const T9=1,k9=2,D9=4,N9=8,Xke=Wke()==="coarse";let Ea=[],Zb=!1,Mu=new Map,xA=new Map;const ew=new Set;function Qke(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),ew.add(o),E1(),function(){var f;xA.delete(t),ew.delete(o);const l=(f=Mu.get(a))!==null&&f!==void 0?f:1;if(Mu.set(a,l-1),E1(),l===1&&Mu.delete(a),Ea.includes(o)){const d=Ea.indexOf(o);d>=0&&Ea.splice(d,1),d$()}}}function KB(t){const{target:e}=t,{x:n,y:r}=_A(t);Zb=!0,u$({target:e,x:n,y:r}),E1(),Ea.length>0&&(C1("down",t),t.preventDefault(),t.stopPropagation())}function Ey(t){const{x:e,y:n}=_A(t);if(t.buttons===0&&(Zb=!1,C1("up",t)),!Zb){const{target:r}=t;u$({target:r,x:e,y:n})}C1("move",t),d$(),Ea.length>0&&t.preventDefault()}function Kp(t){const{target:e}=t,{x:n,y:r}=_A(t);xA.clear(),Zb=!1,Ea.length>0&&t.preventDefault(),C1("up",t),u$({target:e,x:n,y:r}),d$(),E1()}function u$({target:t,x:e,y:n}){Ea.splice(0);let r=null;t instanceof HTMLElement&&(r=t),ew.forEach(s=>{const{element:i,hitAreaMargins:a}=s,o=i.getBoundingClientRect(),{bottom:c,left:u,right:f,top:l}=o,d=Xke?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)&&qke(r,i)>0){let p=r,h=!1;for(;p&&!p.contains(i);){if(Vke(p.getBoundingClientRect(),o)){h=!0;break}p=p.parentElement}if(h)return}Ea.push(s)}})}function VT(t,e){xA.set(t,e)}function d$(){let t=!1,e=!1;Ea.forEach(r=>{const{direction:s}=r;s==="horizontal"?t=!0:e=!0});let n=0;xA.forEach(r=>{n|=r}),t&&e?WT("intersection",n):t?WT("horizontal",n):e?WT("vertical",n):Hke()}function E1(){Mu.forEach((t,e)=>{const{body:n}=e;n.removeEventListener("contextmenu",Kp),n.removeEventListener("pointerdown",KB),n.removeEventListener("pointerleave",Ey),n.removeEventListener("pointermove",Ey)}),window.removeEventListener("pointerup",Kp),window.removeEventListener("pointercancel",Kp),ew.size>0&&(Zb?(Ea.length>0&&Mu.forEach((t,e)=>{const{body:n}=e;t>0&&(n.addEventListener("contextmenu",Kp),n.addEventListener("pointerleave",Ey),n.addEventListener("pointermove",Ey))}),window.addEventListener("pointerup",Kp),window.addEventListener("pointercancel",Kp)):Mu.forEach((t,e)=>{const{body:n}=e;t>0&&(n.addEventListener("pointerdown",KB,{capture:!0}),n.addEventListener("pointermove",Ey))}))}function C1(t,e){ew.forEach(n=>{const{setResizeHandlerState:r}=n,s=Ea.includes(n);r(t,s,e)})}function Jke(){const[t,e]=Bm(0);return li(()=>e(n=>n+1),[])}function Tt(t,e){if(!t)throw console.error(e),Error(e)}const f$=10;function ep(t,e,n=f$){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function kc(t,e,n=f$){return ep(t,e,n)===0}function Ji(t,e,n){return ep(t,e,n)===0}function Zke(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++){const s=t[r],i=e[r];if(!Ji(s,i,n))return!1}return!0}function Em({panelConstraints:t,panelIndex:e,size:n}){const r=t[e];Tt(r!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:s=0,collapsible:i,maxSize:a=100,minSize:o=0}=r;if(ep(n,o)<0)if(i){const c=(s+o)/2;ep(n,c)<0?n=s:n=o}else n=o;return n=Math.min(a,n),n=parseFloat(n.toFixed(f$)),n}function jy({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:r,prevLayout:s,trigger:i}){if(Ji(t,0))return e;const a=[...e],[o,c]=r;Tt(o!=null,"Invalid first pivot index"),Tt(c!=null,"Invalid second pivot index");let u=0;if(i==="keyboard"){{const l=t<0?c:o,d=n[l];Tt(d,`Panel constraints not found for index ${l}`);const{collapsedSize:m=0,collapsible:p,minSize:h=0}=d;if(p){const y=e[l];if(Tt(y!=null,`Previous layout not found for panel index ${l}`),Ji(y,m)){const g=h-y;ep(g,Math.abs(t))>0&&(t=t<0?0-g:g)}}}{const l=t<0?o:c,d=n[l];Tt(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(Tt(y!=null,`Previous layout not found for panel index ${l}`),Ji(y,h)){const g=y-m;ep(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];Tt(h!=null,`Previous layout not found for panel index ${d}`);const g=Em({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<n.length;){const m=Math.abs(t)-Math.abs(u),p=e[d];Tt(p!=null,`Previous layout not found for panel index ${d}`);const h=p-m,y=Em({panelConstraints:n,panelIndex:d,size:h});if(!Ji(p,y)&&(u+=p-y,a[d]=y,u.toPrecision(3).localeCompare(Math.abs(t).toPrecision(3),void 0,{numeric:!0})>=0))break;t<0?d--:d++}}if(Zke(s,a))return s;{const l=t<0?c:o,d=e[l];Tt(d!=null,`Previous layout not found for panel index ${l}`);const m=d+u,p=Em({panelConstraints:n,panelIndex:l,size:m});if(a[l]=p,!Ji(p,m)){let h=m-p,g=t<0?c:o;for(;g>=0&&g<n.length;){const v=a[g];Tt(v!=null,`Previous layout not found for panel index ${g}`);const w=v+h,x=Em({panelConstraints:n,panelIndex:g,size:w});if(Ji(v,x)||(h-=x-v,a[g]=x),Ji(h,0))break;t>0?g--:g++}}}const f=a.reduce((l,d)=>d+l,0);return Ji(f,100)?a:s}function eDe({layout:t,panelsArray:e,pivotIndices:n}){let r=0,s=100,i=0,a=0;const o=n[0];Tt(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 tw(t,e=document){return Array.from(e.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${t}"]`))}function M9(t,e,n=document){const s=tw(t,n).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===e);return s??null}function O9(t,e,n){const r=M9(t,e,n);return r!=null?[r,r+1]:[-1,-1]}function L9(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 SA(t,e=document){const n=e.querySelector(`[data-panel-resize-handle-id="${t}"]`);return n||null}function tDe(t,e,n,r=document){var s,i,a,o;const c=SA(e,r),u=tw(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 nDe({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:r,panelDataArray:s,panelGroupElement:i,setLayout:a}){mi({didWarnAboutMissingResizeHandle:!1}),$h(()=>{if(!i)return;const o=tw(n,i);for(let c=0;c<s.length-1;c++){const{valueMax:u,valueMin:f,valueNow:l}=eDe({layout:r,panelsArray:s,pivotIndices:[c,c+1]}),d=o[c];if(d!=null){const m=s[c];Tt(m,`No panel data found for index "${c}"`),d.setAttribute("aria-controls",m.id),d.setAttribute("aria-valuemax",""+Math.round(u)),d.setAttribute("aria-valuemin",""+Math.round(f)),d.setAttribute("aria-valuenow",l!=null?""+Math.round(l):"")}}return()=>{o.forEach((c,u)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[n,r,s,i]),Ih(()=>{if(!i)return;const o=e.current;Tt(o,"Eager values not found");const{panelDataArray:c}=o,u=L9(n,i);Tt(u!=null,`No group found for id "${n}"`);const f=tw(n,i);Tt(f,`No resize handles found for group id "${n}"`);const l=f.map(d=>{const m=d.getAttribute("data-panel-resize-handle-id");Tt(m,"Resize handle element has no handle id attribute");const[p,h]=tDe(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];Tt(w,`No panel data found for index ${v}`);const x=r[v],{collapsedSize:A=0,collapsible:k,minSize:R=0}=w.constraints;if(x!=null&&k){const E=jy({delta:Ji(x,A)?R-A:A-x,initialLayout:r,panelConstraints:c.map(T=>T.constraints),pivotIndices:O9(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 YB(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function I9(t,e){const n=t==="horizontal",{x:r,y:s}=_A(e);return n?r:s}function rDe(t,e,n,r,s){const i=n==="horizontal",a=SA(e,s);Tt(a,`No resize handle element found for id "${e}"`);const o=a.getAttribute("data-panel-group-id");Tt(o,"Resize handle element has no group id attribute");let{initialCursorPosition:c}=r;const u=I9(n,t),f=L9(o,s);Tt(f,`No group element found for id "${o}"`);const l=f.getBoundingClientRect(),d=i?l.width:l.height;return(u-c)/d*100}function sDe(t,e,n,r,s,i){if(C9(t)){const a=n==="horizontal";let o=0;t.shiftKey?o=100:s!=null?o=s:o=10;let c=0;switch(t.key){case"ArrowDown":c=a?0:o;break;case"ArrowLeft":c=a?-o:0;break;case"ArrowRight":c=a?o:0;break;case"ArrowUp":c=a?0:-o;break;case"End":c=100;break;case"Home":c=-100;break}return c}else return r==null?0:rDe(t,e,n,r,i)}function iDe({panelDataArray:t}){const e=Array(t.length),n=t.map(i=>i.constraints);let r=0,s=100;for(let i=0;i<t.length;i++){const a=n[i];Tt(a,`Panel constraints not found for index ${i}`);const{defaultSize:o}=a;o!=null&&(r++,e[i]=o,s-=o)}for(let i=0;i<t.length;i++){const a=n[i];Tt(a,`Panel constraints not found for index ${i}`);const{defaultSize:o}=a;if(o!=null)continue;const c=t.length-r,u=s/c;r++,e[i]=u,s-=u}return e}function Yp(t,e,n){e.forEach((r,s)=>{const i=t[s];Tt(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||kc(l,u))&&!kc(r,u)&&m(),d&&(l==null||!kc(l,u))&&kc(r,u)&&d())}})}function gS(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}function oDe({defaultSize:t,dragState:e,layout:n,panelData:r,panelIndex:s,precision:i=3}){const a=n[s];let o;return a==null?o=t!=null?t.toPrecision(i):"1":r.length===1?o="1":o=a.toPrecision(i),{flexBasis:0,flexGrow:o,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function aDe(t,e=10){let n=null;return(...s)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...s)},e)}}function XB(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 $9(t){return`react-resizable-panels:${t}`}function F9(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 j9(t,e){try{const n=$9(t),r=e.getItem(n);if(r){const s=JSON.parse(r);if(typeof s=="object"&&s!=null)return s}}catch{}return null}function lDe(t,e,n){var r,s;const i=(r=j9(t,n))!==null&&r!==void 0?r:{},a=F9(e);return(s=i[a])!==null&&s!==void 0?s:null}function cDe(t,e,n,r,s){var i;const a=$9(t),o=F9(e),c=(i=j9(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 QB({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(!Ji(r,100))for(let i=0;i<e.length;i++){const a=n[i];Tt(a!=null,`No layout data found for index ${i}`);const o=100/r*a;n[i]=o}let s=0;for(let i=0;i<e.length;i++){const a=n[i];Tt(a!=null,`No layout data found for index ${i}`);const o=Em({panelConstraints:e,panelIndex:i,size:a});a!=o&&(s+=a-o,n[i]=o)}if(!Ji(s,0))for(let i=0;i<e.length;i++){const a=n[i];Tt(a!=null,`No layout data found for index ${i}`);const o=a+s,c=Em({panelConstraints:e,panelIndex:i,size:o});if(a!==c&&(s-=c-a,n[i]=c,Ji(s,0)))break}return n}const uDe=100,zy={getItem:t=>(XB(zy),zy.getItem(t)),setItem:(t,e)=>{XB(zy),zy.setItem(t,e)}},JB={};function z9({autoSaveId:t=null,children:e,className:n="",direction:r,forwardedRef:s,id:i=null,onLayout:a=null,keyboardResizeBy:o=null,storage:c=zy,style:u,tagName:f="div",...l}){const d=c$(i),m=mi(null),[p,h]=Bm(null),[y,g]=Bm([]),v=Jke(),w=mi({}),x=mi(new Map),A=mi(0),k=mi({autoSaveId:t,direction:r,dragState:p,id:d,keyboardResizeBy:o,onLayout:a,storage:c}),R=mi({layout:y,panelDataArray:[],panelDataArrayChanged:!1});mi({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),S9(s,()=>({getId:()=>k.current.id,getLayout:()=>{const{layout:K}=R.current;return K},setLayout:K=>{const{onLayout:J}=k.current,{layout:ue,panelDataArray:de}=R.current,ie=QB({layout:K,panelConstraints:de.map(be=>be.constraints)});YB(ue,ie)||(g(ie),R.current.layout=ie,J&&J(ie),Yp(de,ie,w.current))}}),[]),$h(()=>{k.current.autoSaveId=t,k.current.direction=r,k.current.dragState=p,k.current.id=d,k.current.onLayout=a,k.current.storage=c}),nDe({committedValuesRef:k,eagerValuesRef:R,groupId:d,layout:y,panelDataArray:R.current.panelDataArray,setLayout:g,panelGroupElement:m.current}),Ih(()=>{const{panelDataArray:K}=R.current;if(t){if(y.length===0||y.length!==K.length)return;let J=JB[t];J==null&&(J=aDe(cDe,uDe),JB[t]=J);const ue=[...K],de=new Map(x.current);J(t,ue,de,y,c)}},[t,y,c]),Ih(()=>{});const E=li(K=>{const{onLayout:J}=k.current,{layout:ue,panelDataArray:de}=R.current;if(K.constraints.collapsible){const ie=de.map(Oe=>Oe.constraints),{collapsedSize:be=0,panelSize:Ae,pivotIndices:_e}=lf(de,K,ue);if(Tt(Ae!=null,`Panel size not found for panel "${K.id}"`),!kc(Ae,be)){x.current.set(K.id,Ae);const Ne=rm(de,K)===de.length-1?Ae-be:be-Ae,ye=jy({delta:Ne,initialLayout:ue,panelConstraints:ie,pivotIndices:_e,prevLayout:ue,trigger:"imperative-api"});gS(ue,ye)||(g(ye),R.current.layout=ye,J&&J(ye),Yp(de,ye,w.current))}}},[]),T=li((K,J)=>{const{onLayout:ue}=k.current,{layout:de,panelDataArray:ie}=R.current;if(K.constraints.collapsible){const be=ie.map($e=>$e.constraints),{collapsedSize:Ae=0,panelSize:_e=0,minSize:Oe=0,pivotIndices:Ne}=lf(ie,K,de),ye=J??Oe;if(kc(_e,Ae)){const $e=x.current.get(K.id),ut=$e!=null&&$e>=ye?$e:ye,yt=rm(ie,K)===ie.length-1?_e-ut:ut-_e,En=jy({delta:yt,initialLayout:de,panelConstraints:be,pivotIndices:Ne,prevLayout:de,trigger:"imperative-api"});gS(de,En)||(g(En),R.current.layout=En,ue&&ue(En),Yp(ie,En,w.current))}}},[]),D=li(K=>{const{layout:J,panelDataArray:ue}=R.current,{panelSize:de}=lf(ue,K,J);return Tt(de!=null,`Panel size not found for panel "${K.id}"`),de},[]),M=li((K,J)=>{const{panelDataArray:ue}=R.current,de=rm(ue,K);return oDe({defaultSize:J,dragState:p,layout:y,panelData:ue,panelIndex:de})},[p,y]),L=li(K=>{const{layout:J,panelDataArray:ue}=R.current,{collapsedSize:de=0,collapsible:ie,panelSize:be}=lf(ue,K,J);return Tt(be!=null,`Panel size not found for panel "${K.id}"`),ie===!0&&kc(be,de)},[]),I=li(K=>{const{layout:J,panelDataArray:ue}=R.current,{collapsedSize:de=0,collapsible:ie,panelSize:be}=lf(ue,K,J);return Tt(be!=null,`Panel size not found for panel "${K.id}"`),!ie||ep(be,de)>0},[]),F=li(K=>{const{panelDataArray:J}=R.current;J.push(K),J.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]);$h(()=>{if(R.current.panelDataArrayChanged){R.current.panelDataArrayChanged=!1;const{autoSaveId:K,onLayout:J,storage:ue}=k.current,{layout:de,panelDataArray:ie}=R.current;let be=null;if(K){const _e=lDe(K,ie,ue);_e&&(x.current=new Map(Object.entries(_e.expandToSizes)),be=_e.layout)}be==null&&(be=iDe({panelDataArray:ie}));const Ae=QB({layout:be,panelConstraints:ie.map(_e=>_e.constraints)});YB(de,Ae)||(g(Ae),R.current.layout=Ae,J&&J(Ae),Yp(ie,Ae,w.current))}}),$h(()=>{const K=R.current;return()=>{K.layout=[]}},[]);const U=li(K=>function(ue){ue.preventDefault();const de=m.current;if(!de)return()=>null;const{direction:ie,dragState:be,id:Ae,keyboardResizeBy:_e,onLayout:Oe}=k.current,{layout:Ne,panelDataArray:ye}=R.current,{initialLayout:$e}=be??{},ut=O9(Ae,K,de);let Qe=sDe(ue,K,ie,be,_e,de);const yt=ie==="horizontal";document.dir==="rtl"&&yt&&(Qe=-Qe);const En=ye.map(Qt=>Qt.constraints),Xt=jy({delta:Qe,initialLayout:$e??Ne,panelConstraints:En,pivotIndices:ut,prevLayout:Ne,trigger:C9(ue)?"keyboard":"mouse-or-touch"}),gn=!gS(Ne,Xt);(A9(ue)||R9(ue))&&A.current!=Qe&&(A.current=Qe,gn?VT(K,0):yt?VT(K,Qe<0?T9:k9):VT(K,Qe<0?D9:N9)),gn&&(g(Xt),R.current.layout=Xt,Oe&&Oe(Xt),Yp(ye,Xt,w.current))},[]),Y=li((K,J)=>{const{onLayout:ue}=k.current,{layout:de,panelDataArray:ie}=R.current,be=ie.map($e=>$e.constraints),{panelSize:Ae,pivotIndices:_e}=lf(ie,K,de);Tt(Ae!=null,`Panel size not found for panel "${K.id}"`);const Ne=rm(ie,K)===ie.length-1?Ae-J:J-Ae,ye=jy({delta:Ne,initialLayout:de,panelConstraints:be,pivotIndices:_e,prevLayout:de,trigger:"imperative-api"});gS(de,ye)||(g(ye),R.current.layout=ye,ue&&ue(ye),Yp(ie,ye,w.current))},[]),W=li((K,J)=>{const{layout:ue,panelDataArray:de}=R.current,{collapsedSize:ie=0,collapsible:be}=J,{collapsedSize:Ae=0,collapsible:_e,maxSize:Oe=100,minSize:Ne=0}=K.constraints,{panelSize:ye}=lf(de,K,ue);ye!=null&&(be&&_e&&kc(ye,ie)?kc(ie,Ae)||Y(K,Ae):ye<Ne?Y(K,Ne):ye>Oe&&Y(K,Oe))},[Y]),H=li((K,J)=>{const{direction:ue}=k.current,{layout:de}=R.current;if(!m.current)return;const ie=SA(K,m.current);Tt(ie,`Drag handle element not found for id "${K}"`);const be=I9(ue,J);h({dragHandleId:K,dragHandleRect:ie.getBoundingClientRect(),initialCursorPosition:be,initialLayout:de})},[]),ee=li(()=>{h(null)},[]),re=li(K=>{const{panelDataArray:J}=R.current,ue=rm(J,K);ue>=0&&(J.splice(ue,1),delete w.current[K.id],R.current.panelDataArrayChanged=!0,v())},[v]),X=$ke(()=>({collapsePanel:E,direction:r,dragState:p,expandPanel:T,getPanelSize:D,getPanelStyle:M,groupId:d,isPanelCollapsed:L,isPanelExpanded:I,reevaluatePanelConstraints:W,registerPanel:F,registerResizeHandle:U,resizePanel:Y,startDragging:H,stopDragging:ee,unregisterPanel:re,panelGroupElement:m.current}),[E,p,r,T,D,M,d,L,I,W,F,U,Y,H,ee,re]),G={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return fv(wA.Provider,{value:X},fv(f,{...l,children:e,className:n,id:i,ref:m,style:{...G,...u},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":d}))}const dDe=_9((t,e)=>fv(z9,{...t,forwardedRef:e}));z9.displayName="PanelGroup";dDe.displayName="forwardRef(PanelGroup)";function rm(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function lf(t,e,n){const r=rm(t,e),i=r===t.length-1?[r-1,r]:[r,r+1],a=n[r];return{...e.constraints,panelSize:a,pivotIndices:i}}function fDe({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:r}){Ih(()=>{if(t||n==null||r==null)return;const s=SA(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");Tt(o,`No group element found for id "${o}"`);const c=tw(o,r),u=M9(o,e,r);Tt(u!==null,`No resize element found for id "${e}"`);const f=a.shiftKey?u>0?u-1:c.length-1:u+1<c.length?u+1:0;c[f].focus();break}}};return s.addEventListener("keydown",i),()=>{s.removeEventListener("keydown",i)}},[r,t,e,n])}function hDe({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=mi(null),h=mi({onDragging:a});Ih(()=>{h.current.onDragging=a});const y=x9(wA);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:k}=y,R=c$(s),[E,T]=Bm("inactive"),[D,M]=Bm(!1),[L,I]=Bm(null),F=mi({state:E});$h(()=>{F.current.state=E}),Ih(()=>{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 Ih(()=>{if(n||L==null)return;const H=p.current;return Tt(H,"Element ref not attached"),Qke(R,H,g,{coarse:U,fine:Y},(re,X,G)=>{if(X)switch(re){case"down":{T("drag"),x(R,G);const{onDragging:K}=h.current;K&&K(!0);break}case"move":{const{state:K}=F.current;K!=="drag"&&T("hover"),L(G);break}case"up":{T("hover"),A();const{onDragging:K}=h.current;K&&K(!1);break}}else T("inactive")})},[U,g,n,Y,w,R,L,x,A]),fDe({disabled:n,handleId:R,resizeHandler:L,panelGroupElement:k}),fv(f,{...l,children:t,className:e,id:s,onBlur:()=>{M(!1),i==null||i()},onFocus:()=>{M(!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":D?"keyboard":void 0,"data-resize-handle-state":E,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":R})}hDe.displayName="PanelResizeHandle";function nw(t,[e,n]){return Math.min(n,Math.max(e,t))}function pDe(t,e){return _.useReducer((n,r)=>e[n][r]??n,t)}var h$="ScrollArea",[B9,JHe]=Tn(h$),[mDe,qo]=B9(h$),U9=_.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,k]=_.useState(!1),[R,E]=_.useState(!1),T=tt(e,M=>c(M)),D=Ma(s);return P.jsx(mDe,{scope:n,type:r,dir:D,scrollHideDelay:i,scrollArea:o,viewport:u,onViewportChange:f,content:l,onContentChange:d,scrollbarX:m,onScrollbarXChange:p,scrollbarXEnabled:A,onScrollbarXEnabledChange:k,scrollbarY:h,onScrollbarYChange:y,scrollbarYEnabled:R,onScrollbarYEnabledChange:E,onCornerWidthChange:v,onCornerHeightChange:x,children:P.jsx(De.div,{dir:D,...a,ref:T,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":w+"px",...t.style}})})});U9.displayName=h$;var H9="ScrollAreaViewport",W9=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,nonce:s,...i}=t,a=qo(H9,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(De.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})})]})});W9.displayName=H9;var kl="ScrollAreaScrollbar",p$=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=qo(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(gDe,{...r,ref:e,forceMount:n}):s.type==="scroll"?P.jsx(vDe,{...r,ref:e,forceMount:n}):s.type==="auto"?P.jsx(V9,{...r,ref:e,forceMount:n}):s.type==="always"?P.jsx(m$,{...r,ref:e}):null});p$.displayName=kl;var gDe=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=qo(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(Hn,{present:n||i,children:P.jsx(V9,{"data-state":i?"visible":"hidden",...r,ref:e})})}),vDe=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=qo(kl,t.__scopeScrollArea),i=t.orientation==="horizontal",a=CA(()=>c("SCROLL_END"),100),[o,c]=pDe("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(Hn,{present:n||o!=="hidden",children:P.jsx(m$,{"data-state":o==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:me(t.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:me(t.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),V9=_.forwardRef((t,e)=>{const n=qo(kl,t.__scopeScrollArea),{forceMount:r,...s}=t,[i,a]=_.useState(!1),o=t.orientation==="horizontal",c=CA(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,f=n.viewport.offsetHeight<n.viewport.scrollHeight;a(o?u:f)}},10);return hv(n.viewport,c),hv(n.content,c),P.jsx(Hn,{present:r||i,children:P.jsx(m$,{"data-state":i?"visible":"hidden",...s,ref:e})})}),m$=_.forwardRef((t,e)=>{const{orientation:n="vertical",...r}=t,s=qo(kl,t.__scopeScrollArea),i=_.useRef(null),a=_.useRef(0),[o,c]=_.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=X9(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 SDe(d,a.current,o,m)}return n==="horizontal"?P.jsx(yDe,{...f,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const d=s.viewport.scrollLeft,m=ZB(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(bDe,{...f,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const d=s.viewport.scrollTop,m=ZB(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}),yDe=_.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=qo(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(G9,{"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":EA(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),J9(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:R1(a.paddingLeft),paddingEnd:R1(a.paddingRight)}})}})}),bDe=_.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=qo(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(G9,{"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":EA(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),J9(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:R1(a.paddingTop),paddingEnd:R1(a.paddingBottom)}})}})}),[wDe,q9]=B9(kl),G9=_.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=qo(kl,n),[p,h]=_.useState(null),y=tt(e,T=>h(T)),g=_.useRef(null),v=_.useRef(""),w=m.viewport,x=r.content-r.viewport,A=Ut(f),k=Ut(c),R=CA(l,10);function E(T){if(g.current){const D=T.clientX-g.current.left,M=T.clientY-g.current.top;u({x:D,y:M})}}return _.useEffect(()=>{const T=D=>{const M=D.target;(p==null?void 0:p.contains(M))&&A(D,x)};return document.addEventListener("wheel",T,{passive:!1}),()=>document.removeEventListener("wheel",T,{passive:!1})},[w,p,x,A]),_.useEffect(k,[r,k]),hv(p,R),hv(m.content,R),P.jsx(wDe,{scope:n,scrollbar:p,hasThumb:s,onThumbChange:Ut(i),onThumbPointerUp:Ut(a),onThumbPositionChange:k,onThumbPointerDown:Ut(o),children:P.jsx(De.div,{...d,ref:y,style:{position:"absolute",...d.style},onPointerDown:me(t.onPointerDown,T=>{T.button===0&&(T.target.setPointerCapture(T.pointerId),g.current=p.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),E(T))}),onPointerMove:me(t.onPointerMove,E),onPointerUp:me(t.onPointerUp,T=>{const D=T.target;D.hasPointerCapture(T.pointerId)&&D.releasePointerCapture(T.pointerId),document.body.style.webkitUserSelect=v.current,m.viewport&&(m.viewport.style.scrollBehavior=""),g.current=null})})})}),A1="ScrollAreaThumb",K9=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=q9(A1,t.__scopeScrollArea);return P.jsx(Hn,{present:n||s.hasThumb,children:P.jsx(_De,{ref:e,...r})})}),_De=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...s}=t,i=qo(A1,n),a=q9(A1,n),{onThumbPositionChange:o}=a,c=tt(e,l=>a.onThumbChange(l)),u=_.useRef(),f=CA(()=>{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=EDe(l,o);u.current=m,o()}};return o(),l.addEventListener("scroll",d),()=>l.removeEventListener("scroll",d)}},[i.viewport,f,o]),P.jsx(De.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)})});K9.displayName=A1;var g$="ScrollAreaCorner",Y9=_.forwardRef((t,e)=>{const n=qo(g$,t.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?P.jsx(xDe,{...t,ref:e}):null});Y9.displayName=g$;var xDe=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,...r}=t,s=qo(g$,n),[i,a]=_.useState(0),[o,c]=_.useState(0),u=!!(i&&o);return hv(s.scrollbarX,()=>{var l;const f=((l=s.scrollbarX)==null?void 0:l.offsetHeight)||0;s.onCornerHeightChange(f),c(f)}),hv(s.scrollbarY,()=>{var l;const f=((l=s.scrollbarY)==null?void 0:l.offsetWidth)||0;s.onCornerWidthChange(f),a(f)}),u?P.jsx(De.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 R1(t){return t?parseInt(t,10):0}function X9(t,e){const n=t/e;return isNaN(n)?0:n}function EA(t){const e=X9(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function SDe(t,e,n,r="ltr"){const s=EA(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 Q9([c,u],l)(t)}function ZB(t,e,n="ltr"){const r=EA(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=nw(t,c);return Q9([0,a],[0,o])(u)}function Q9(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 J9(t,e){return t>0&&t<e}var EDe=(t,e=()=>{})=>{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 CA(t,e){const n=Ut(t),r=_.useRef(0);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),_.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function hv(t,e){const n=Ut(e);Ln(()=>{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 Z9=U9,CDe=W9,ADe=Y9;const RDe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(Z9,{ref:r,className:ce("relative overflow-hidden",t),...n,children:[P.jsx(CDe,{className:"h-full w-full rounded-[inherit]",children:e}),P.jsx(eY,{}),P.jsx(ADe,{})]}));RDe.displayName=Z9.displayName;const eY=_.forwardRef(({className:t,orientation:e="vertical",...n},r)=>P.jsx(p$,{ref:r,orientation:e,className:ce("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...n,children:P.jsx(K9,{className:"relative flex-1 rounded-full bg-border"})}));eY.displayName=p$.displayName;var PDe=[" ","Enter","ArrowUp","ArrowDown"],TDe=[" ","Enter"],N_="Select",[AA,RA,kDe]=Xc(N_),[Ov,ZHe]=Tn(N_,[kDe,Rl]),PA=Rl(),[DDe,Bd]=Ov(N_),[NDe,MDe]=Ov(N_),tY=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=PA(e),[h,y]=_.useState(null),[g,v]=_.useState(null),[w,x]=_.useState(!1),A=Ma(u),[k=!1,R]=sr({prop:r,defaultProp:s,onChange:i}),[E,T]=sr({prop:a,defaultProp:o,onChange:c}),D=_.useRef(null),M=h?!!h.closest("form"):!0,[L,I]=_.useState(new Set),F=Array.from(L).map(U=>U.props.value).join(";");return P.jsx(uA,{...p,children:P.jsxs(DDe,{required:m,scope:e,trigger:h,onTriggerChange:y,valueNode:g,onValueNodeChange:v,valueNodeHasChildren:w,onValueNodeHasChildrenChange:x,contentId:Vr(),value:E,onValueChange:T,open:k,onOpenChange:R,dir:A,triggerPointerDownPosRef:D,disabled:d,children:[P.jsx(AA.Provider,{scope:e,children:P.jsx(NDe,{scope:t.__scopeSelect,onNativeOptionAdd:_.useCallback(U=>{I(Y=>new Set(Y).add(U))},[]),onNativeOptionRemove:_.useCallback(U=>{I(Y=>{const W=new Set(Y);return W.delete(U),W})},[]),children:n})}),M?P.jsxs(AY,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:l,value:E,onChange:U=>T(U.target.value),disabled:d,children:[E===void 0?P.jsx("option",{value:""}):null,Array.from(L)]},F):null]})})};tY.displayName=N_;var nY="SelectTrigger",rY=_.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...s}=t,i=PA(n),a=Bd(nY,n),o=a.disabled||r,c=tt(e,a.onTriggerChange),u=RA(n),[f,l,d]=RY(p=>{const h=u().filter(v=>!v.disabled),y=h.find(v=>v.value===a.value),g=PY(h,p,y);g!==void 0&&a.onValueChange(g.value)}),m=()=>{o||(a.onOpenChange(!0),d())};return P.jsx(Dv,{asChild:!0,...i,children:P.jsx(De.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":CY(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===" ")&&PDe.includes(p.key)&&(m(),p.preventDefault())})})})});rY.displayName=nY;var sY="SelectValue",iY=_.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:a="",...o}=t,c=Bd(sY,n),{onValueNodeHasChildrenChange:u}=c,f=i!==void 0,l=tt(e,c.onValueNodeChange);return Ln(()=>{u(f)},[u,f]),P.jsx(De.span,{...o,ref:l,style:{pointerEvents:"none"},children:CY(c.value)?P.jsx(P.Fragment,{children:a}):i})});iY.displayName=sY;var ODe="SelectIcon",oY=_.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...s}=t;return P.jsx(De.span,{"aria-hidden":!0,...s,ref:e,children:r||"▼"})});oY.displayName=ODe;var LDe="SelectPortal",aY=t=>P.jsx(Sv,{asChild:!0,...t});aY.displayName=LDe;var tp="SelectContent",lY=_.forwardRef((t,e)=>{const n=Bd(tp,t.__scopeSelect),[r,s]=_.useState();if(Ln(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?Ns.createPortal(P.jsx(cY,{scope:t.__scopeSelect,children:P.jsx(AA.Slot,{scope:t.__scopeSelect,children:P.jsx("div",{children:t.children})})}),i):null}return P.jsx(uY,{...t,ref:e})});lY.displayName=tp;var Ql=10,[cY,Ud]=Ov(tp),IDe="SelectContentImpl",uY=_.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(tp,n),[w,x]=_.useState(null),[A,k]=_.useState(null),R=tt(e,ie=>x(ie)),[E,T]=_.useState(null),[D,M]=_.useState(null),L=RA(n),[I,F]=_.useState(!1),U=_.useRef(!1);_.useEffect(()=>{if(w)return Ev(w)},[w]),FC();const Y=_.useCallback(ie=>{const[be,...Ae]=L().map(Ne=>Ne.ref.current),[_e]=Ae.slice(-1),Oe=document.activeElement;for(const Ne of ie)if(Ne===Oe||(Ne==null||Ne.scrollIntoView({block:"nearest"}),Ne===be&&A&&(A.scrollTop=0),Ne===_e&&A&&(A.scrollTop=A.scrollHeight),Ne==null||Ne.focus(),document.activeElement!==Oe))return},[L,A]),W=_.useCallback(()=>Y([E,w]),[Y,E,w]);_.useEffect(()=>{I&&W()},[I,W]);const{onOpenChange:H,triggerPointerDownPosRef:ee}=v;_.useEffect(()=>{if(w){let ie={x:0,y:0};const be=_e=>{var Oe,Ne;ie={x:Math.abs(Math.round(_e.pageX)-(((Oe=ee.current)==null?void 0:Oe.x)??0)),y:Math.abs(Math.round(_e.pageY)-(((Ne=ee.current)==null?void 0:Ne.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]=RY(ie=>{const be=L().filter(Oe=>!Oe.disabled),Ae=be.find(Oe=>Oe.ref.current===document.activeElement),_e=PY(be,ie,Ae);_e&&setTimeout(()=>_e.ref.current.focus())}),G=_.useCallback((ie,be,Ae)=>{const _e=!U.current&&!Ae;(v.value!==void 0&&v.value===be||_e)&&(T(ie),_e&&(U.current=!0))},[v.value]),K=_.useCallback(()=>w==null?void 0:w.focus(),[w]),J=_.useCallback((ie,be,Ae)=>{const _e=!U.current&&!Ae;(v.value!==void 0&&v.value===be||_e)&&M(ie)},[v.value]),ue=r==="popper"?mN:dY,de=ue===mN?{side:o,sideOffset:c,align:u,alignOffset:f,arrowPadding:l,collisionBoundary:d,collisionPadding:m,sticky:p,hideWhenDetached:h,avoidCollisions:y}:{};return P.jsx(cY,{scope:n,content:w,viewport:A,onViewportChange:k,itemRefCallback:G,selectedItem:E,onItemLeave:K,itemTextRefCallback:J,focusSelectedItem:W,selectedItemText:D,position:r,isPositioned:I,searchRef:re,children:P.jsx(o_,{as:Ra,allowPinchZoom:!0,children:P.jsx(i_,{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(Oe=>!Oe.disabled).map(Oe=>Oe.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(_e=_e.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const Oe=ie.target,Ne=_e.indexOf(Oe);_e=_e.slice(Ne+1)}setTimeout(()=>Y(_e)),ie.preventDefault()}})})})})})})});uY.displayName=IDe;var $De="SelectItemAlignedPosition",dY=_.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...s}=t,i=Bd(tp,n),a=Ud(tp,n),[o,c]=_.useState(null),[u,f]=_.useState(null),l=tt(e,R=>f(R)),d=RA(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(),T=i.valueNode.getBoundingClientRect(),D=g.getBoundingClientRect();if(i.dir!=="rtl"){const Oe=D.left-E.left,Ne=T.left-Oe,ye=R.left-Ne,$e=R.width+ye,ut=Math.max($e,E.width),Qe=window.innerWidth-Ql,yt=nw(Ne,[Ql,Qe-ut]);o.style.minWidth=$e+"px",o.style.left=yt+"px"}else{const Oe=E.right-D.right,Ne=window.innerWidth-T.right-Oe,ye=window.innerWidth-R.right-Ne,$e=R.width+ye,ut=Math.max($e,E.width),Qe=window.innerWidth-Ql,yt=nw(Ne,[Ql,Qe-ut]);o.style.minWidth=$e+"px",o.style.right=yt+"px"}const M=d(),L=window.innerHeight-Ql*2,I=h.scrollHeight,F=window.getComputedStyle(u),U=parseInt(F.borderTopWidth,10),Y=parseInt(F.paddingTop,10),W=parseInt(F.borderBottomWidth,10),H=parseInt(F.paddingBottom,10),ee=U+Y+I+H+W,re=Math.min(y.offsetHeight*5,ee),X=window.getComputedStyle(h),G=parseInt(X.paddingTop,10),K=parseInt(X.paddingBottom,10),J=R.top+R.height/2-Ql,ue=L-J,de=y.offsetHeight/2,ie=y.offsetTop+de,be=U+Y+ie,Ae=ee-be;if(be<=J){const Oe=y===M[M.length-1].ref.current;o.style.bottom="0px";const Ne=u.clientHeight-h.offsetTop-h.offsetHeight,ye=Math.max(ue,de+(Oe?K:0)+Ne+W),$e=be+ye;o.style.height=$e+"px"}else{const Oe=y===M[0].ref.current;o.style.top="0px";const ye=Math.max(J,U+h.offsetTop+(Oe?G:0)+de)+Ae;o.style.height=ye+"px",h.scrollTop=be-J+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]);Ln(()=>w(),[w]);const[x,A]=_.useState();Ln(()=>{u&&A(window.getComputedStyle(u).zIndex)},[u]);const k=_.useCallback(R=>{R&&p.current===!0&&(w(),v==null||v(),p.current=!1)},[w,v]);return P.jsx(jDe,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:m,onScrollButtonChange:k,children:P.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:x},children:P.jsx(De.div,{...s,ref:l,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});dY.displayName=$De;var FDe="SelectPopperPosition",mN=_.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Ql,...i}=t,a=PA(n);return P.jsx(w_,{...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)"}})});mN.displayName=FDe;var[jDe,v$]=Ov(tp,{}),gN="SelectViewport",fY=_.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...s}=t,i=Ud(gN,n),a=v$(gN,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(AA.Slot,{scope:n,children:P.jsx(De.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(g<p){const v=g+m,w=Math.min(p,v),x=v-w;l.style.height=w+"px",l.style.bottom==="0px"&&(f.scrollTop=x>0?x:0,l.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});fY.displayName=gN;var hY="SelectGroup",[zDe,BDe]=Ov(hY),UDe=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=Vr();return P.jsx(zDe,{scope:n,id:s,children:P.jsx(De.div,{role:"group","aria-labelledby":s,...r,ref:e})})});UDe.displayName=hY;var pY="SelectLabel",mY=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=BDe(pY,n);return P.jsx(De.div,{id:s.id,...r,ref:e})});mY.displayName=pY;var P1="SelectItem",[HDe,gY]=Ov(P1),vY=_.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...a}=t,o=Bd(P1,n),c=Ud(P1,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=Vr(),y=()=>{s||(o.onValueChange(r),o.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return P.jsx(HDe,{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(AA.ItemSlot,{scope:n,value:r,disabled:s,textValue:f,children:P.jsx(De.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===" "||(TDe.includes(g.key)&&y(),g.key===" "&&g.preventDefault())})})})})});vY.displayName=P1;var By="SelectItemText",yY=_.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:s,...i}=t,a=Bd(By,n),o=Ud(By,n),c=gY(By,n),u=MDe(By,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 Ln(()=>(h(p),()=>y(p)),[h,y,p]),P.jsxs(P.Fragment,{children:[P.jsx(De.span,{id:c.textId,...i,ref:d}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Ns.createPortal(i.children,a.valueNode):null]})});yY.displayName=By;var bY="SelectItemIndicator",wY=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return gY(bY,n).isSelected?P.jsx(De.span,{"aria-hidden":!0,...r,ref:e}):null});wY.displayName=bY;var vN="SelectScrollUpButton",_Y=_.forwardRef((t,e)=>{const n=Ud(vN,t.__scopeSelect),r=v$(vN,t.__scopeSelect),[s,i]=_.useState(!1),a=tt(e,r.onScrollButtonChange);return Ln(()=>{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(SY,{...t,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop-c.offsetHeight)}}):null});_Y.displayName=vN;var yN="SelectScrollDownButton",xY=_.forwardRef((t,e)=>{const n=Ud(yN,t.__scopeSelect),r=v$(yN,t.__scopeSelect),[s,i]=_.useState(!1),a=tt(e,r.onScrollButtonChange);return Ln(()=>{if(n.viewport&&n.isPositioned){let o=function(){const u=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)<u;i(f)};const c=n.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),s?P.jsx(SY,{...t,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop+c.offsetHeight)}}):null});xY.displayName=yN;var SY=_.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=t,i=Ud("SelectScrollButton",n),a=_.useRef(null),o=RA(n),c=_.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return _.useEffect(()=>()=>c(),[c]),Ln(()=>{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(De.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()})})}),WDe="SelectSeparator",EY=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return P.jsx(De.div,{"aria-hidden":!0,...r,ref:e})});EY.displayName=WDe;var bN="SelectArrow",VDe=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=PA(n),i=Bd(bN,n),a=Ud(bN,n);return i.open&&a.position==="popper"?P.jsx(__,{...s,...r,ref:e}):null});VDe.displayName=bN;function CY(t){return t===""||t===void 0}var AY=_.forwardRef((t,e)=>{const{value:n,...r}=t,s=_.useRef(null),i=tt(e,s),a=Pv(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(k_,{asChild:!0,children:P.jsx("select",{...r,ref:i,defaultValue:n})})});AY.displayName="BubbleSelect";function RY(t){const e=Ut(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 PY(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=qDe(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 qDe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var GDe=tY,TY=rY,KDe=iY,YDe=oY,XDe=aY,kY=lY,QDe=fY,DY=mY,NY=vY,JDe=yY,ZDe=wY,MY=_Y,OY=xY,LY=EY;const e5e=GDe,t5e=KDe,eNe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(TY,{ref:r,className:ce("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm 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(YDe,{asChild:!0,children:P.jsx(IC,{className:"h-4 w-4 opacity-50"})})]}));eNe.displayName=TY.displayName;const IY=_.forwardRef(({className:t,...e},n)=>P.jsx(MY,{ref:n,className:ce("flex cursor-default items-center justify-center py-1",t),...e,children:P.jsx(Rfe,{className:"h-4 w-4"})}));IY.displayName=MY.displayName;const $Y=_.forwardRef(({className:t,...e},n)=>P.jsx(OY,{ref:n,className:ce("flex cursor-default items-center justify-center py-1",t),...e,children:P.jsx(IC,{className:"h-4 w-4"})}));$Y.displayName=OY.displayName;const tNe=_.forwardRef(({className:t,children:e,position:n="popper",...r},s)=>P.jsx(XDe,{children:P.jsxs(kY,{ref:s,className:ce("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:[P.jsx(IY,{}),P.jsx(QDe,{className:ce("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),P.jsx($Y,{})]})}));tNe.displayName=kY.displayName;const nNe=_.forwardRef(({className:t,...e},n)=>P.jsx(DY,{ref:n,className:ce("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));nNe.displayName=DY.displayName;const rNe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(NY,{ref:r,className:ce("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(ZDe,{children:P.jsx(r_,{className:"h-4 w-4"})})}),P.jsx(JDe,{children:e})]}));rNe.displayName=NY.displayName;const sNe=_.forwardRef(({className:t,...e},n)=>P.jsx(LY,{ref:n,className:ce("-mx-1 my-1 h-px bg-muted",t),...e}));sNe.displayName=LY.displayName;const iNe=AL,oNe=RL,aNe=PL,FY=_.forwardRef(({className:t,...e},n)=>P.jsx(a_,{className:ce("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));FY.displayName=a_.displayName;const lNe=Ho("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"}}),jY=_.forwardRef(({side:t="right",className:e,children:n,...r},s)=>P.jsxs(aNe,{children:[P.jsx(FY,{}),P.jsxs(l_,{ref:s,className:ce(lNe({side:t}),e),...r,children:[n,P.jsxs(d_,{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(mL,{className:"h-4 w-4"}),P.jsx("span",{className:"sr-only",children:ft("common.close")})]})]})]}));jY.displayName=l_.displayName;const cNe=_.forwardRef(({className:t,...e},n)=>P.jsx(c_,{ref:n,className:ce("text-lg font-semibold text-foreground",t),...e}));cNe.displayName=c_.displayName;const uNe=_.forwardRef(({className:t,...e},n)=>P.jsx(u_,{ref:n,className:ce("text-sm text-muted-foreground",t),...e}));uNe.displayName=u_.displayName;var zY=["PageUp","PageDown"],BY=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],UY={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Lv="Slider",[wN,dNe,fNe]=Xc(Lv),[HY,n5e]=Tn(Lv,[fNe]),[hNe,TA]=HY(Lv),WY=_.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"?pNe:mNe,[w=[],x]=sr({prop:f,defaultProp:u,onChange:D=>{var L;(L=[...h.current][y.current])==null||L.focus(),l(D)}}),A=_.useRef(w);function k(D){const M=wNe(w,D);T(D,M)}function R(D){T(D,y.current)}function E(){const D=A.current[y.current];w[y.current]!==D&&d(w)}function T(D,M,{commit:L}={commit:!1}){const I=ENe(i),F=CNe(Math.round((D-r)/i)*i+r,I),U=nw(F,[r,s]);x((Y=[])=>{const W=yNe(Y,U,M);if(SNe(W,c*i)){y.current=W.indexOf(U);const H=String(W)!==String(Y);return H&&L&&d(W),H?W:Y}else return Y})}return P.jsx(hNe,{scope:t.__scopeSlider,name:n,disabled:o,min:r,max:s,valueIndexToChangeRef:y,thumbs:h.current,values:w,orientation:a,children:P.jsx(wN.Provider,{scope:t.__scopeSlider,children:P.jsx(wN.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:k,onSlideMove:o?void 0:R,onSlideEnd:o?void 0:E,onHomeKeyDown:()=>!o&&T(r,0,{commit:!0}),onEndKeyDown:()=>!o&&T(s,w.length-1,{commit:!0}),onStepKeyDown:({event:D,direction:M})=>{if(!o){const F=zY.includes(D.key)||D.shiftKey&&BY.includes(D.key)?10:1,U=y.current,Y=w[U],W=i*F*M;T(Y+W,U,{commit:!0})}}})})})})});WY.displayName=Lv;var[VY,qY]=HY(Lv,{startEdge:"left",endEdge:"right",size:"width",direction:1}),pNe=_.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=Ma(s),y=h==="ltr",g=y&&!i||!y&&i;function v(w){const x=p.current||l.getBoundingClientRect(),A=[0,x.width],R=y$(A,g?[n,r]:[r,n]);return p.current=x,R(w-x.left)}return P.jsx(VY,{scope:t.__scopeSlider,startEdge:g?"left":"right",endEdge:g?"right":"left",direction:g?1:-1,size:"width",children:P.jsx(GY,{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=UY[g?"from-left":"from-right"].includes(w.key);u==null||u({event:w,direction:A?-1:1})}})})}),mNe=_.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=y$(g,m?[r,n]:[n,r]);return d.current=y,w(h-y.top)}return P.jsx(VY,{scope:t.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:P.jsx(GY,{"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=UY[m?"from-bottom":"from-top"].includes(h.key);c==null||c({event:h,direction:g?-1:1})}})})}),GY=_.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:o,onStepKeyDown:c,...u}=t,f=TA(Lv,n);return P.jsx(De.span,{...u,ref:e,onKeyDown:me(t.onKeyDown,l=>{l.key==="Home"?(a(l),l.preventDefault()):l.key==="End"?(o(l),l.preventDefault()):zY.concat(BY).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))})})}),KY="SliderTrack",YY=_.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=TA(KY,n);return P.jsx(De.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:e})});YY.displayName=KY;var _N="SliderRange",XY=_.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=TA(_N,n),i=qY(_N,n),a=_.useRef(null),o=tt(e,a),c=s.values.length,u=s.values.map(d=>JY(d,s.min,s.max)),f=c>1?Math.min(...u):0,l=100-Math.max(...u);return P.jsx(De.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:o,style:{...t.style,[i.startEdge]:f+"%",[i.endEdge]:l+"%"}})});XY.displayName=_N;var xN="SliderThumb",QY=_.forwardRef((t,e)=>{const n=dNe(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(gNe,{...t,ref:i,index:a})}),gNe=_.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:s,...i}=t,a=TA(xN,n),o=qY(xN,n),[c,u]=_.useState(null),f=tt(e,v=>u(v)),l=c?!!c.closest("form"):!0,d=v_(c),m=a.values[r],p=m===void 0?0:JY(m,a.min,a.max),h=bNe(r,a.values.length),y=d==null?void 0:d[o.size],g=y?_Ne(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(wN.ItemSlot,{scope:t.__scopeSlider,children:P.jsx(De.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(vNe,{name:s??(a.name?a.name+(a.values.length>1?"[]":""):void 0),value:m},r)]})});QY.displayName=xN;var vNe=t=>{const{value:e,...n}=t,r=_.useRef(null),s=Pv(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 yNe(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}function JY(t,e,n){const i=100/(n-e)*(t-e);return nw(i,[0,100])}function bNe(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function wNe(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 _Ne(t,e,n){const r=t/2,i=y$([0,50],[0,r]);return(r-i(e)*n)*n}function xNe(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function SNe(t,e){if(e>0){const n=xNe(t);return Math.min(...n)>=e}return!0}function y$(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 ENe(t){return(String(t).split(".")[1]||"").length}function CNe(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var ZY=WY,ANe=YY,RNe=XY,PNe=QY;const TNe=_.forwardRef(({className:t,...e},n)=>P.jsxs(ZY,{ref:n,className:ce("relative flex w-full touch-none select-none items-center",t),...e,children:[P.jsx(ANe,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:P.jsx(RNe,{className:"absolute h-full bg-primary"})}),P.jsx(PNe,{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"})]}));TNe.displayName=ZY.displayName;var b$="Switch",[kNe,r5e]=Tn(b$),[DNe,NNe]=kNe(b$),eX=_.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]=sr({prop:s,defaultProp:i,onChange:u});return P.jsxs(DNe,{scope:n,checked:y,disabled:o,children:[P.jsx(De.button,{type:"button",role:"switch","aria-checked":y,"aria-required":a,"data-state":rX(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(MNe,{control:l,bubbles:!p.current,name:r,value:c,checked:y,required:a,disabled:o,style:{transform:"translateX(-100%)"}})]})});eX.displayName=b$;var tX="SwitchThumb",nX=_.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,s=NNe(tX,n);return P.jsx(De.span,{"data-state":rX(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:e})});nX.displayName=tX;var MNe=t=>{const{control:e,checked:n,bubbles:r=!0,...s}=t,i=_.useRef(null),a=Pv(n),o=v_(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 rX(t){return t?"checked":"unchecked"}var sX=eX,ONe=nX;const LNe=_.forwardRef(({className:t,...e},n)=>P.jsx(sX,{className:ce("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(ONe,{className:ce("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));LNe.displayName=sX.displayName;const INe=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{className:"relative w-full overflow-auto",children:P.jsx("table",{ref:n,className:ce("w-full caption-bottom text-sm",t),...e})}));INe.displayName="Table";const $Ne=_.forwardRef(({className:t,...e},n)=>P.jsx("thead",{ref:n,className:ce("[&_tr]:border-b",t),...e}));$Ne.displayName="TableHeader";const FNe=_.forwardRef(({className:t,...e},n)=>P.jsx("tbody",{ref:n,className:ce("[&_tr:last-child]:border-0",t),...e}));FNe.displayName="TableBody";const jNe=_.forwardRef(({className:t,...e},n)=>P.jsx("tfoot",{ref:n,className:ce("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));jNe.displayName="TableFooter";const zNe=_.forwardRef(({className:t,...e},n)=>P.jsx("tr",{ref:n,className:ce("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...e}));zNe.displayName="TableRow";const BNe=_.forwardRef(({className:t,...e},n)=>P.jsx("th",{ref:n,className:ce("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...e}));BNe.displayName="TableHead";const UNe=_.forwardRef(({className:t,...e},n)=>P.jsx("td",{ref:n,className:ce("py-2 px-4 align-middle [&:has([role=checkbox])]:pr-0",t),...e}));UNe.displayName="TableCell";const HNe=_.forwardRef(({className:t,...e},n)=>P.jsx("caption",{ref:n,className:ce("mt-4 text-sm text-muted-foreground",t),...e}));HNe.displayName="TableCaption";var w$="Tabs",[WNe,s5e]=Tn(w$,[Pl]),iX=Pl(),[VNe,_$]=WNe(w$),oX=_.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:a="horizontal",dir:o,activationMode:c="automatic",...u}=t,f=Ma(o),[l,d]=sr({prop:r,onChange:s,defaultProp:i});return P.jsx(VNe,{scope:n,baseId:Vr(),value:l,onValueChange:d,orientation:a,dir:f,activationMode:c,children:P.jsx(De.div,{dir:f,"data-orientation":a,...u,ref:e})})});oX.displayName=w$;var aX="TabsList",lX=_.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...s}=t,i=_$(aX,n),a=iX(n);return P.jsx(x_,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:P.jsx(De.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:e})})});lX.displayName=aX;var cX="TabsTrigger",uX=_.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=t,a=_$(cX,n),o=iX(n),c=hX(a.baseId,r),u=pX(a.baseId,r),f=r===a.value;return P.jsx(S_,{asChild:!0,...o,focusable:!s,active:f,children:P.jsx(De.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)})})})});uX.displayName=cX;var dX="TabsContent",fX=_.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...a}=t,o=_$(dX,n),c=hX(o.baseId,r),u=pX(o.baseId,r),f=r===o.value,l=_.useRef(f);return _.useEffect(()=>{const d=requestAnimationFrame(()=>l.current=!1);return()=>cancelAnimationFrame(d)},[]),P.jsx(Hn,{present:s||f,children:({present:d})=>P.jsx(De.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})})});fX.displayName=dX;function hX(t,e){return`${t}-trigger-${e}`}function pX(t,e){return`${t}-content-${e}`}var qNe=oX,mX=lX,gX=uX,vX=fX;const i5e=qNe,GNe=_.forwardRef(({className:t,...e},n)=>P.jsx(mX,{ref:n,className:ce("inline-flex h-9 items-center justify-center rounded-lg bg-accent p-1 text-muted-foreground",t),...e}));GNe.displayName=mX.displayName;const KNe=_.forwardRef(({className:t,...e},n)=>P.jsx(gX,{ref:n,className:ce("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}));KNe.displayName=gX.displayName;const YNe=_.forwardRef(({className:t,...e},n)=>P.jsx(vX,{ref:n,className:ce("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));YNe.displayName=vX.displayName;const yX=_.forwardRef(({className:t,...e},n)=>P.jsx("textarea",{className:ce("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}));yX.displayName="Textarea";var x$="ToastProvider",[S$,XNe,QNe]=Xc("Toast"),[bX,o5e]=Tn("Toast",[QNe]),[JNe,kA]=bX(x$),wX=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 \`${x$}\`. Expected non-empty \`string\`.`),P.jsx(S$.Provider,{scope:e,children:P.jsx(JNe,{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})})};wX.displayName=x$;var _X="ToastViewport",ZNe=["F8"],SN="toast.viewportPause",EN="toast.viewportResume",xX=_.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=ZNe,label:s="Notifications ({hotkey})",...i}=t,a=kA(_X,n),o=XNe(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 k=new CustomEvent(SN);g.dispatchEvent(k),a.isClosePausedRef.current=!0}},w=()=>{if(a.isClosePausedRef.current){const k=new CustomEvent(EN);g.dispatchEvent(k),a.isClosePausedRef.current=!1}},x=k=>{!y.contains(k.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,...fMe(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,k,R;const w=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!w){const E=document.activeElement,T=v.shiftKey;if(v.target===y&&T){(A=u.current)==null||A.focus();return}const L=h({tabbingDirection:T?"backwards":"forwards"}),I=L.findIndex(F=>F===E);qT(L.slice(I+1))?v.preventDefault():T?(k=u.current)==null||k.focus():(R=f.current)==null||R.focus()}};return y.addEventListener("keydown",g),()=>y.removeEventListener("keydown",g)}},[o,h]),P.jsxs(khe,{ref:c,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:p?void 0:"none"},children:[p&&P.jsx(CN,{ref:u,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"forwards"});qT(y)}}),P.jsx(S$.Slot,{scope:n,children:P.jsx(De.ol,{tabIndex:-1,...i,ref:d})}),p&&P.jsx(CN,{ref:f,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"backwards"});qT(y)}})]})});xX.displayName=_X;var SX="ToastFocusProxy",CN=_.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=t,i=kA(SX,n);return P.jsx(k_,{"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()}})});CN.displayName=SX;var DA="Toast",eMe="toast.swipeStart",tMe="toast.swipeMove",nMe="toast.swipeCancel",rMe="toast.swipeEnd",EX=_.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...a}=t,[o=!0,c]=sr({prop:r,defaultProp:s,onChange:i});return P.jsx(Hn,{present:n||o,children:P.jsx(oMe,{open:o,...a,ref:e,onClose:()=>c(!1),onPause:Ut(t.onPause),onResume:Ut(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)})})})});EX.displayName=DA;var[sMe,iMe]=bX(DA,{onClose(){}}),oMe=_.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=kA(DA,n),[y,g]=_.useState(null),v=tt(e,F=>g(F)),w=_.useRef(null),x=_.useRef(null),A=s||h.duration,k=_.useRef(0),R=_.useRef(A),E=_.useRef(0),{onToastAdd:T,onToastRemove:D}=h,M=Ut(()=>{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),k.current=new Date().getTime(),E.current=window.setTimeout(M,F))},[M]);_.useEffect(()=>{const F=h.viewport;if(F){const U=()=>{L(R.current),u==null||u()},Y=()=>{const W=new Date().getTime()-k.current;R.current=R.current-W,window.clearTimeout(E.current),c==null||c()};return F.addEventListener(SN,Y),F.addEventListener(EN,U),()=>{F.removeEventListener(SN,Y),F.removeEventListener(EN,U)}}},[h.viewport,A,c,u,L]),_.useEffect(()=>{i&&!h.isClosePausedRef.current&&L(A)},[i,A,h.isClosePausedRef,L]),_.useEffect(()=>(T(),()=>D()),[T,D]);const I=_.useMemo(()=>y?DX(y):null,[y]);return h.viewport?P.jsxs(P.Fragment,{children:[I&&P.jsx(aMe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:I}),P.jsx(sMe,{scope:n,onClose:M,children:Ns.createPortal(P.jsx(S$.ItemSlot,{scope:n,children:P.jsx(The,{asChild:!0,onEscapeKeyDown:me(o,()=>{h.isFocusedToastEscapeKeyDownRef.current||M(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:P.jsx(De.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,M()))}),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,W=!!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),G=F.pointerType==="touch"?10:2,K={x:re,y:X},J={originalEvent:F,delta:K};W?(x.current=K,vS(tMe,l,J,{discrete:!1})):e4(K,h.swipeDirection,G)?(x.current=K,vS(eMe,f,J,{discrete:!1}),F.target.setPointerCapture(F.pointerId)):(Math.abs(U)>G||Math.abs(Y)>G)&&(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 W=F.currentTarget,H={originalEvent:F,delta:U};e4(U,h.swipeDirection,h.swipeThreshold)?vS(rMe,m,H,{discrete:!0}):vS(nMe,d,H,{discrete:!0}),W.addEventListener("click",ee=>ee.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),aMe=t=>{const{__scopeToast:e,children:n,...r}=t,s=kA(DA,e),[i,a]=_.useState(!1),[o,c]=_.useState(!1);return uMe(()=>a(!0)),_.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),o?null:P.jsx(Sv,{asChild:!0,children:P.jsx(k_,{...r,children:i&&P.jsxs(P.Fragment,{children:[s.label," ",n]})})})},lMe="ToastTitle",CX=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return P.jsx(De.div,{...r,ref:e})});CX.displayName=lMe;var cMe="ToastDescription",AX=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return P.jsx(De.div,{...r,ref:e})});AX.displayName=cMe;var RX="ToastAction",PX=_.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?P.jsx(kX,{altText:n,asChild:!0,children:P.jsx(E$,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${RX}\`. Expected non-empty \`string\`.`),null)});PX.displayName=RX;var TX="ToastClose",E$=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,s=iMe(TX,n);return P.jsx(kX,{asChild:!0,children:P.jsx(De.button,{type:"button",...r,ref:e,onClick:me(t.onClick,s.onClose)})})});E$.displayName=TX;var kX=_.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...s}=t;return P.jsx(De.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function DX(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),dMe(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(...DX(r))}}),e}function vS(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?Wb(s,i):s.dispatchEvent(i)}var e4=(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 uMe(t=()=>{}){const e=Ut(t);Ln(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function dMe(t){return t.nodeType===t.ELEMENT_NODE}function fMe(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 qT(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var hMe=wX,NX=xX,MX=EX,OX=CX,LX=AX,IX=PX,$X=E$;const pMe=hMe,FX=_.forwardRef(({className:t,...e},n)=>P.jsx(NX,{ref:n,className:ce("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));FX.displayName=NX.displayName;const mMe=Ho("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"}}),jX=_.forwardRef(({className:t,variant:e,...n},r)=>P.jsx(MX,{ref:r,className:ce(mMe({variant:e}),t),...n}));jX.displayName=MX.displayName;const gMe=_.forwardRef(({className:t,...e},n)=>P.jsx(IX,{ref:n,className:ce("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors 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}));gMe.displayName=IX.displayName;const zX=_.forwardRef(({className:t,...e},n)=>P.jsx($X,{ref:n,className:ce("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(mL,{className:"w-4 h-4"})}));zX.displayName=$X.displayName;const BX=_.forwardRef(({className:t,...e},n)=>P.jsx(OX,{ref:n,className:ce("text-sm font-semibold",t),...e}));BX.displayName=OX.displayName;const UX=_.forwardRef(({className:t,...e},n)=>P.jsx(LX,{ref:n,className:ce("text-sm opacity-90",t),...e}));UX.displayName=LX.displayName;const vMe=3,yMe=1e6;let GT=0;function bMe(){return GT=(GT+1)%Number.MAX_SAFE_INTEGER,GT.toString()}const KT=new Map,t4=t=>{if(KT.has(t))return;const e=setTimeout(()=>{KT.delete(t),vb({type:"REMOVE_TOAST",toastId:t})},yMe);KT.set(t,e)},wMe=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,vMe)};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?t4(n):t.toasts.forEach(r=>{t4(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)}}},qS=[];let GS={toasts:[]};function vb(t){GS=wMe(GS,t),qS.forEach(e=>{e(GS)})}function _Me({...t}){const e=bMe(),n=s=>vb({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>vb({type:"DISMISS_TOAST",toastId:e});return vb({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:n}}function HX(){const[t,e]=_.useState(GS);return _.useEffect(()=>(qS.push(e),()=>{const n=qS.indexOf(e);n>-1&&qS.splice(n,1)}),[t]),{...t,toast:_Me,dismiss:n=>vb({type:"DISMISS_TOAST",toastId:n})}}function WX(){const{toasts:t}=HX();return P.jsxs(pMe,{swipeDirection:"down",children:[t.map(function({id:e,title:n,description:r,action:s,...i}){return P.jsxs(jX,{...i,children:[P.jsxs("div",{className:"grid gap-1",children:[n&&P.jsx(BX,{children:n}),r&&P.jsx(UX,{children:r})]}),s,P.jsx(zX,{})]},e)}),P.jsx(FX,{className:"bottom-0 w-auto mx-auto sm:bottom-0 sm:left-0 sm:right-0"})]})}var xMe="Toggle",C$=_.forwardRef((t,e)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:s,...i}=t,[a=!1,o]=sr({prop:n,onChange:s,defaultProp:r});return P.jsx(De.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)})})});C$.displayName=xMe;var VX=C$;const qX=Ho("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"}}),SMe=_.forwardRef(({className:t,variant:e,size:n,...r},s)=>P.jsx(VX,{ref:s,className:ce(qX({variant:e,size:n,className:t})),...r}));SMe.displayName=VX.displayName;var Iv="ToggleGroup",[GX,a5e]=Tn(Iv,[Pl]),KX=Pl(),A$=se.forwardRef((t,e)=>{const{type:n,...r}=t;if(n==="single"){const s=r;return P.jsx(EMe,{...s,ref:e})}if(n==="multiple"){const s=r;return P.jsx(CMe,{...s,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${Iv}\``)});A$.displayName=Iv;var[YX,XX]=GX(Iv),EMe=se.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=t,[a,o]=sr({prop:n,defaultProp:r,onChange:s});return P.jsx(YX,{scope:t.__scopeToggleGroup,type:"single",value:a?[a]:[],onItemActivate:o,onItemDeactivate:se.useCallback(()=>o(""),[o]),children:P.jsx(QX,{...i,ref:e})})}),CMe=se.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=t,[a=[],o]=sr({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(YX,{scope:t.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:c,onItemDeactivate:u,children:P.jsx(QX,{...i,ref:e})})});A$.displayName=Iv;var[AMe,RMe]=GX(Iv),QX=se.forwardRef((t,e)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:s=!0,orientation:i,dir:a,loop:o=!0,...c}=t,u=KX(n),f=Ma(a),l={role:"group",dir:f,...c};return P.jsx(AMe,{scope:n,rovingFocus:s,disabled:r,children:s?P.jsx(x_,{asChild:!0,...u,orientation:i,dir:f,loop:o,children:P.jsx(De.div,{...l,ref:e})}):P.jsx(De.div,{...l,ref:e})})}),T1="ToggleGroupItem",JX=se.forwardRef((t,e)=>{const n=XX(T1,t.__scopeToggleGroup),r=RMe(T1,t.__scopeToggleGroup),s=KX(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(S_,{asChild:!0,...s,focusable:!a,active:i,ref:c,children:P.jsx(n4,{...o,ref:e})}):P.jsx(n4,{...o,ref:e})});JX.displayName=T1;var n4=se.forwardRef((t,e)=>{const{__scopeToggleGroup:n,value:r,...s}=t,i=XX(T1,n),a={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},o=i.type==="single"?a:void 0;return P.jsx(C$,{...o,...s,ref:e,onPressedChange:c=>{c?i.onItemActivate(r):i.onItemDeactivate(r)}})}),ZX=A$,eQ=JX;const tQ=_.createContext({size:"default",variant:"default"}),PMe=_.forwardRef(({className:t,variant:e,size:n,children:r,...s},i)=>P.jsx(ZX,{ref:i,className:ce("flex items-center justify-center gap-1",t),...s,children:P.jsx(tQ.Provider,{value:{variant:e,size:n},children:r})}));PMe.displayName=ZX.displayName;const TMe=_.forwardRef(({className:t,children:e,variant:n,size:r,...s},i)=>{const a=_.useContext(tQ);return P.jsx(eQ,{ref:i,className:ce(qX({variant:a.variant||n,size:a.size||r}),t),...s,children:e})});TMe.displayName=eQ.displayName;var[NA,l5e]=Tn("Tooltip",[Rl]),MA=Rl(),nQ="TooltipProvider",kMe=700,AN="tooltip.open",[DMe,R$]=NA(nQ),rQ=t=>{const{__scopeTooltip:e,delayDuration:n=kMe,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(DMe,{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})};rQ.displayName=nQ;var OA="Tooltip",[NMe,LA]=NA(OA),sQ=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s=!1,onOpenChange:i,disableHoverableContent:a,delayDuration:o}=t,c=R$(OA,t.__scopeTooltip),u=MA(e),[f,l]=_.useState(null),d=Vr(),m=_.useRef(0),p=a??c.disableHoverableContent,h=o??c.delayDuration,y=_.useRef(!1),[g=!1,v]=sr({prop:r,defaultProp:s,onChange:R=>{R?(c.onOpen(),document.dispatchEvent(new CustomEvent(AN))):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]),k=_.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(uA,{...u,children:P.jsx(NMe,{scope:e,contentId:d,open:g,stateAttribute:w,trigger:f,onTriggerChange:l,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayed?k():x()},[c.isOpenDelayed,k,x]),onTriggerLeave:_.useCallback(()=>{p?A():window.clearTimeout(m.current)},[A,p]),onOpen:x,onClose:A,disableHoverableContent:p,children:n})})};sQ.displayName=OA;var RN="TooltipTrigger",iQ=_.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=LA(RN,n),i=R$(RN,n),a=MA(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(Dv,{asChild:!0,...a,children:P.jsx(De.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)})})});iQ.displayName=RN;var MMe="TooltipPortal",[c5e,OMe]=NA(MMe,{forceMount:void 0}),pv="TooltipContent",oQ=_.forwardRef((t,e)=>{const n=OMe(pv,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,a=LA(pv,t.__scopeTooltip);return P.jsx(Hn,{present:r||a.open,children:a.disableHoverableContent?P.jsx(aQ,{side:s,...i,ref:e}):P.jsx(LMe,{side:s,...i,ref:e})})}),LMe=_.forwardRef((t,e)=>{const n=LA(pv,t.__scopeTooltip),r=R$(pv,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=jMe(g,y.getBoundingClientRect()),w=zMe(g,v),x=BMe(h.getBoundingClientRect()),A=HMe([...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=!UMe(g,a);v?d():w&&(d(),u())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[c,f,a,u,d]),P.jsx(aQ,{...t,ref:i})}),[IMe,$Me]=NA(OA,{isInside:!1}),aQ=_.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:a,...o}=t,c=LA(pv,n),u=MA(n),{onClose:f}=c;return _.useEffect(()=>(document.addEventListener(AN,f),()=>document.removeEventListener(AN,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(w_,{"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(oL,{children:r}),P.jsx(IMe,{scope:n,isInside:!0,children:P.jsx(v7,{id:c.contentId,role:"tooltip",children:s||r})})]})})});oQ.displayName=pv;var lQ="TooltipArrow",FMe=_.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=MA(n);return $Me(lQ,n).isInside?null:P.jsx(__,{...s,...r,ref:e})});FMe.displayName=lQ;function jMe(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 zMe(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 BMe(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 UMe(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;i<e.length;a=i++){const o=e[i].x,c=e[i].y,u=e[a].x,f=e[a].y;c>r!=f>r&&n<(u-o)*(r-c)/(f-c)+o&&(s=!s)}return s}function HMe(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),WMe(e)}function WMe(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const s=t[r];for(;e.length>=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 VMe=rQ,qMe=sQ,GMe=iQ,cQ=oQ;const KMe=VMe,u5e=qMe,d5e=GMe,YMe=_.forwardRef(({className:t,sideOffset:e=4,...n},r)=>P.jsx(cQ,{ref:r,sideOffset:e,className:ce("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));YMe.displayName=cQ.displayName;/**
|
||
* @remix-run/router v1.23.0
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function Gn(){return Gn=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Gn.apply(this,arguments)}var Er;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(Er||(Er={}));const r4="popstate";function XMe(t){t===void 0&&(t={});function e(r,s){let{pathname:i,search:a,hash:o}=r.location;return rw("",{pathname:i,search:a,hash:o},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:np(s)}return JMe(e,n,null,t)}function Nt(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function mv(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function QMe(){return Math.random().toString(36).substr(2,8)}function s4(t,e){return{usr:t.state,key:t.key,idx:e}}function rw(t,e,n,r){return n===void 0&&(n=null),Gn({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Hd(e):e,{state:n,key:e&&e.key||r||QMe()})}function np(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Hd(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function JMe(t,e,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,a=s.history,o=Er.Pop,c=null,u=f();u==null&&(u=0,a.replaceState(Gn({},a.state,{idx:u}),""));function f(){return(a.state||{idx:null}).idx}function l(){o=Er.Pop;let y=f(),g=y==null?null:y-u;u=y,c&&c({action:o,location:h.location,delta:g})}function d(y,g){o=Er.Push;let v=rw(h.location,y,g);u=f()+1;let w=s4(v,u),x=h.createHref(v);try{a.pushState(w,"",x)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;s.location.assign(x)}i&&c&&c({action:o,location:h.location,delta:1})}function m(y,g){o=Er.Replace;let v=rw(h.location,y,g);u=f();let w=s4(v,u),x=h.createHref(v);a.replaceState(w,"",x),i&&c&&c({action:o,location:h.location,delta:0})}function p(y){let g=s.location.origin!=="null"?s.location.origin:s.location.href,v=typeof y=="string"?y:np(y);return v=v.replace(/ $/,"%20"),Nt(g,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,g)}let h={get action(){return o},get location(){return t(s,a)},listen(y){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(r4,l),c=y,()=>{s.removeEventListener(r4,l),c=null}},createHref(y){return e(s,y)},createURL:p,encodeLocation(y){let g=p(y);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:d,replace:m,go(y){return a.go(y)}};return h}var hn;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(hn||(hn={}));const ZMe=new Set(["lazy","caseSensitive","path","id","index","children"]);function eOe(t){return t.index===!0}function k1(t,e,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),t.map((s,i)=>{let a=[...n,String(i)],o=typeof s.id=="string"?s.id:a.join("-");if(Nt(s.index!==!0||!s.children,"Cannot specify children on an index route"),Nt(!r[o],'Found a route id collision on id "'+o+`". Route id's must be globally unique within Data Router usages`),eOe(s)){let c=Gn({},s,e(s),{id:o});return r[o]=c,c}else{let c=Gn({},s,e(s),{id:o,children:void 0});return r[o]=c,s.children&&(c.children=k1(s.children,e,a,r)),c}})}function vf(t,e,n){return n===void 0&&(n="/"),KS(t,e,n,!1)}function KS(t,e,n,r){let s=typeof e=="string"?Hd(e):e,i=kd(s.pathname||"/",n);if(i==null)return null;let a=uQ(t);nOe(a);let o=null;for(let c=0;o==null&&c<a.length;++c){let u=hOe(i);o=dOe(a[c],u,r)}return o}function tOe(t,e){let{route:n,pathname:r,params:s}=t;return{id:n.id,pathname:r,params:s,data:e[n.id],handle:n.handle}}function uQ(t,e,n,r){e===void 0&&(e=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(i,a,o)=>{let c={relativePath:o===void 0?i.path||"":o,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};c.relativePath.startsWith("/")&&(Nt(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=Lc([r,c.relativePath]),f=n.concat(c);i.children&&i.children.length>0&&(Nt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),uQ(i.children,e,f,u)),!(i.path==null&&!i.index)&&e.push({path:u,score:cOe(u,i.index),routesMeta:f})};return t.forEach((i,a)=>{var o;if(i.path===""||!((o=i.path)!=null&&o.includes("?")))s(i,a);else for(let c of dQ(i.path))s(i,a,c)}),e}function dQ(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let a=dQ(r.join("/")),o=[];return o.push(...a.map(c=>c===""?i:[i,c].join("/"))),s&&o.push(...a),o.map(c=>t.startsWith("/")&&c===""?"/":c)}function nOe(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:uOe(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const rOe=/^:[\w-]+$/,sOe=3,iOe=2,oOe=1,aOe=10,lOe=-2,i4=t=>t==="*";function cOe(t,e){let n=t.split("/"),r=n.length;return n.some(i4)&&(r+=lOe),e&&(r+=iOe),n.filter(s=>!i4(s)).reduce((s,i)=>s+(rOe.test(i)?sOe:i===""?oOe:aOe),r)}function uOe(t,e){return t.length===e.length&&t.slice(0,-1).every((r,s)=>r===e[s])?t[t.length-1]-e[e.length-1]:0}function dOe(t,e,n){n===void 0&&(n=!1);let{routesMeta:r}=t,s={},i="/",a=[];for(let o=0;o<r.length;++o){let c=r[o],u=o===r.length-1,f=i==="/"?e:e.slice(i.length)||"/",l=o4({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},f),d=c.route;if(!l&&u&&n&&!r[r.length-1].route.index&&(l=o4({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},f)),!l)return null;Object.assign(s,l.params),a.push({params:s,pathname:Lc([i,l.pathname]),pathnameBase:gOe(Lc([i,l.pathnameBase])),route:d}),l.pathnameBase!=="/"&&(i=Lc([i,l.pathnameBase]))}return a}function o4(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=fOe(t.path,t.caseSensitive,t.end),s=e.match(n);if(!s)return null;let i=s[0],a=i.replace(/(.)\/+$/,"$1"),o=s.slice(1);return{params:r.reduce((u,f,l)=>{let{paramName:d,isOptional:m}=f;if(d==="*"){let h=o[l]||"";a=i.slice(0,i.length-h.length).replace(/(.)\/+$/,"$1")}const p=o[l];return m&&!p?u[d]=void 0:u[d]=(p||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:a,pattern:t}}function fOe(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),mv(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],s="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,c)=>(r.push({paramName:o,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),s+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":t!==""&&t!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),r]}function hOe(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return mv(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function kd(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function pOe(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:s=""}=typeof t=="string"?Hd(t):t;return{pathname:n?n.startsWith("/")?n:mOe(n,e):e,search:vOe(r),hash:yOe(s)}}function mOe(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function YT(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function fQ(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function IA(t,e){let n=fQ(t);return e?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function $A(t,e,n,r){r===void 0&&(r=!1);let s;typeof t=="string"?s=Hd(t):(s=Gn({},t),Nt(!s.pathname||!s.pathname.includes("?"),YT("?","pathname","search",s)),Nt(!s.pathname||!s.pathname.includes("#"),YT("#","pathname","hash",s)),Nt(!s.search||!s.search.includes("#"),YT("#","search","hash",s)));let i=t===""||s.pathname==="",a=i?"/":s.pathname,o;if(a==null)o=n;else{let l=e.length-1;if(!r&&a.startsWith("..")){let d=a.split("/");for(;d[0]==="..";)d.shift(),l-=1;s.pathname=d.join("/")}o=l>=0?e[l]:"/"}let c=pOe(s,o),u=a&&a!=="/"&&a.endsWith("/"),f=(i||a===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||f)&&(c.pathname+="/"),c}const Lc=t=>t.join("/").replace(/\/\/+/g,"/"),gOe=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),vOe=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,yOe=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class D1{constructor(e,n,r,s){s===void 0&&(s=!1),this.status=e,this.statusText=n||"",this.internal=s,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function sw(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const hQ=["post","put","patch","delete"],bOe=new Set(hQ),wOe=["get",...hQ],_Oe=new Set(wOe),xOe=new Set([301,302,303,307,308]),SOe=new Set([307,308]),XT={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},EOe={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},sm={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},P$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,COe=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),pQ="remix-router-transitions";function AOe(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",r=!n;Nt(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let s;if(t.mapRouteProperties)s=t.mapRouteProperties;else if(t.detectErrorBoundary){let te=t.detectErrorBoundary;s=oe=>({hasErrorBoundary:te(oe)})}else s=COe;let i={},a=k1(t.routes,s,void 0,i),o,c=t.basename||"/",u=t.dataStrategy||kOe,f=t.patchRoutesOnNavigation,l=Gn({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},t.future),d=null,m=new Set,p=null,h=null,y=null,g=t.hydrationData!=null,v=vf(a,t.history.location,c),w=!1,x=null;if(v==null&&!f){let te=hi(404,{pathname:t.history.location.pathname}),{matches:oe,route:he}=v4(a);v=oe,x={[he.id]:te}}v&&!t.hydrationData&&cn(v,a,t.history.location.pathname).active&&(v=null);let A;if(v)if(v.some(te=>te.route.lazy))A=!1;else if(!v.some(te=>te.route.loader))A=!0;else if(l.v7_partialHydration){let te=t.hydrationData?t.hydrationData.loaderData:null,oe=t.hydrationData?t.hydrationData.errors:null;if(oe){let he=v.findIndex(Ce=>oe[Ce.route.id]!==void 0);A=v.slice(0,he+1).every(Ce=>!TN(Ce.route,te,oe))}else A=v.every(he=>!TN(he.route,te,oe))}else A=t.hydrationData!=null;else if(A=!1,v=[],l.v7_partialHydration){let te=cn(null,a,t.history.location.pathname);te.active&&te.matches&&(w=!0,v=te.matches)}let k,R={historyAction:t.history.action,location:t.history.location,matches:v,initialized:A,navigation:XT,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||x,fetchers:new Map,blockers:new Map},E=Er.Pop,T=!1,D,M=!1,L=new Map,I=null,F=!1,U=!1,Y=[],W=new Set,H=new Map,ee=0,re=-1,X=new Map,G=new Set,K=new Map,J=new Map,ue=new Set,de=new Map,ie=new Map,be;function Ae(){if(d=t.history.listen(te=>{let{action:oe,location:he,delta:Ce}=te;if(be){be(),be=void 0;return}mv(ie.size===0||Ce!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Le=ot({currentLocation:R.location,nextLocation:he,historyAction:oe});if(Le&&Ce!=null){let Ge=new Promise(st=>{be=st});t.history.go(Ce*-1),it(Le,{state:"blocked",location:he,proceed(){it(Le,{state:"proceeding",proceed:void 0,reset:void 0,location:he}),Ge.then(()=>t.history.go(Ce))},reset(){let st=new Map(R.blockers);st.set(Le,sm),Ne({blockers:st})}});return}return Qe(oe,he)}),n){WOe(e,L);let te=()=>VOe(e,L);e.addEventListener("pagehide",te),I=()=>e.removeEventListener("pagehide",te)}return R.initialized||Qe(Er.Pop,R.location,{initialHydration:!0}),k}function _e(){d&&d(),I&&I(),m.clear(),D&&D.abort(),R.fetchers.forEach((te,oe)=>wt(oe)),R.blockers.forEach((te,oe)=>Be(oe))}function Oe(te){return m.add(te),()=>m.delete(te)}function Ne(te,oe){oe===void 0&&(oe={}),R=Gn({},R,te);let he=[],Ce=[];l.v7_fetcherPersist&&R.fetchers.forEach((Le,Ge)=>{Le.state==="idle"&&(ue.has(Ge)?Ce.push(Ge):he.push(Ge))}),ue.forEach(Le=>{!R.fetchers.has(Le)&&!H.has(Le)&&Ce.push(Le)}),[...m].forEach(Le=>Le(R,{deletedFetchers:Ce,viewTransitionOpts:oe.viewTransitionOpts,flushSync:oe.flushSync===!0})),l.v7_fetcherPersist?(he.forEach(Le=>R.fetchers.delete(Le)),Ce.forEach(Le=>wt(Le))):Ce.forEach(Le=>ue.delete(Le))}function ye(te,oe,he){var Ce,Le;let{flushSync:Ge}=he===void 0?{}:he,st=R.actionData!=null&&R.navigation.formMethod!=null&&ya(R.navigation.formMethod)&&R.navigation.state==="loading"&&((Ce=te.state)==null?void 0:Ce._isRedirect)!==!0,Ue;oe.actionData?Object.keys(oe.actionData).length>0?Ue=oe.actionData:Ue=null:st?Ue=R.actionData:Ue=null;let Xe=oe.loaderData?m4(R.loaderData,oe.loaderData,oe.matches||[],oe.errors):R.loaderData,Ve=R.blockers;Ve.size>0&&(Ve=new Map(Ve),Ve.forEach((It,Tr)=>Ve.set(Tr,sm)));let Ze=T===!0||R.navigation.formMethod!=null&&ya(R.navigation.formMethod)&&((Le=te.state)==null?void 0:Le._isRedirect)!==!0;o&&(a=o,o=void 0),F||E===Er.Pop||(E===Er.Push?t.history.push(te,te.state):E===Er.Replace&&t.history.replace(te,te.state));let gt;if(E===Er.Pop){let It=L.get(R.location.pathname);It&&It.has(te.pathname)?gt={currentLocation:R.location,nextLocation:te}:L.has(te.pathname)&&(gt={currentLocation:te,nextLocation:R.location})}else if(M){let It=L.get(R.location.pathname);It?It.add(te.pathname):(It=new Set([te.pathname]),L.set(R.location.pathname,It)),gt={currentLocation:R.location,nextLocation:te}}Ne(Gn({},oe,{actionData:Ue,loaderData:Xe,historyAction:E,location:te,initialized:!0,navigation:XT,revalidation:"idle",restoreScrollPosition:ln(te,oe.matches||R.matches),preventScrollReset:Ze,blockers:Ve}),{viewTransitionOpts:gt,flushSync:Ge===!0}),E=Er.Pop,T=!1,M=!1,F=!1,U=!1,Y=[]}async function $e(te,oe){if(typeof te=="number"){t.history.go(te);return}let he=PN(R.location,R.matches,c,l.v7_prependBasename,te,l.v7_relativeSplatPath,oe==null?void 0:oe.fromRouteId,oe==null?void 0:oe.relative),{path:Ce,submission:Le,error:Ge}=a4(l.v7_normalizeFormMethod,!1,he,oe),st=R.location,Ue=rw(R.location,Ce,oe&&oe.state);Ue=Gn({},Ue,t.history.encodeLocation(Ue));let Xe=oe&&oe.replace!=null?oe.replace:void 0,Ve=Er.Push;Xe===!0?Ve=Er.Replace:Xe===!1||Le!=null&&ya(Le.formMethod)&&Le.formAction===R.location.pathname+R.location.search&&(Ve=Er.Replace);let Ze=oe&&"preventScrollReset"in oe?oe.preventScrollReset===!0:void 0,gt=(oe&&oe.flushSync)===!0,It=ot({currentLocation:st,nextLocation:Ue,historyAction:Ve});if(It){it(It,{state:"blocked",location:Ue,proceed(){it(It,{state:"proceeding",proceed:void 0,reset:void 0,location:Ue}),$e(te,oe)},reset(){let Tr=new Map(R.blockers);Tr.set(It,sm),Ne({blockers:Tr})}});return}return await Qe(Ve,Ue,{submission:Le,pendingError:Ge,preventScrollReset:Ze,replace:oe&&oe.replace,enableViewTransition:oe&&oe.viewTransition,flushSync:gt})}function ut(){if(xe(),Ne({revalidation:"loading"}),R.navigation.state!=="submitting"){if(R.navigation.state==="idle"){Qe(R.historyAction,R.location,{startUninterruptedRevalidation:!0});return}Qe(E||R.historyAction,R.navigation.location,{overrideNavigation:R.navigation,enableViewTransition:M===!0})}}async function Qe(te,oe,he){D&&D.abort(),D=null,E=te,F=(he&&he.startUninterruptedRevalidation)===!0,yn(R.location,R.matches),T=(he&&he.preventScrollReset)===!0,M=(he&&he.enableViewTransition)===!0;let Ce=o||a,Le=he&&he.overrideNavigation,Ge=he!=null&&he.initialHydration&&R.matches&&R.matches.length>0&&!w?R.matches:vf(Ce,oe,c),st=(he&&he.flushSync)===!0;if(Ge&&R.initialized&&!U&&IOe(R.location,oe)&&!(he&&he.submission&&ya(he.submission.formMethod))){ye(oe,{matches:Ge},{flushSync:st});return}let Ue=cn(Ge,Ce,oe.pathname);if(Ue.active&&Ue.matches&&(Ge=Ue.matches),!Ge){let{error:bn,notFoundMatches:qt,route:Wn}=Et(oe.pathname);ye(oe,{matches:qt,loaderData:{},errors:{[Wn.id]:bn}},{flushSync:st});return}D=new AbortController;let Xe=Xp(t.history,oe,D.signal,he&&he.submission),Ve;if(he&&he.pendingError)Ve=[yf(Ge).route.id,{type:hn.error,error:he.pendingError}];else if(he&&he.submission&&ya(he.submission.formMethod)){let bn=await yt(Xe,oe,he.submission,Ge,Ue.active,{replace:he.replace,flushSync:st});if(bn.shortCircuited)return;if(bn.pendingActionResult){let[qt,Wn]=bn.pendingActionResult;if(eo(Wn)&&sw(Wn.error)&&Wn.error.status===404){D=null,ye(oe,{matches:bn.matches,loaderData:{},errors:{[qt]:Wn.error}});return}}Ge=bn.matches||Ge,Ve=bn.pendingActionResult,Le=QT(oe,he.submission),st=!1,Ue.active=!1,Xe=Xp(t.history,Xe.url,Xe.signal)}let{shortCircuited:Ze,matches:gt,loaderData:It,errors:Tr}=await En(Xe,oe,Ge,Ue.active,Le,he&&he.submission,he&&he.fetcherSubmission,he&&he.replace,he&&he.initialHydration===!0,st,Ve);Ze||(D=null,ye(oe,Gn({matches:gt||Ge},g4(Ve),{loaderData:It,errors:Tr})))}async function yt(te,oe,he,Ce,Le,Ge){Ge===void 0&&(Ge={}),xe();let st=UOe(oe,he);if(Ne({navigation:st},{flushSync:Ge.flushSync===!0}),Le){let Ve=await kn(Ce,oe.pathname,te.signal);if(Ve.type==="aborted")return{shortCircuited:!0};if(Ve.type==="error"){let Ze=yf(Ve.partialMatches).route.id;return{matches:Ve.partialMatches,pendingActionResult:[Ze,{type:hn.error,error:Ve.error}]}}else if(Ve.matches)Ce=Ve.matches;else{let{notFoundMatches:Ze,error:gt,route:It}=Et(oe.pathname);return{matches:Ze,pendingActionResult:[It.id,{type:hn.error,error:gt}]}}}let Ue,Xe=Uy(Ce,oe);if(!Xe.route.action&&!Xe.route.lazy)Ue={type:hn.error,error:hi(405,{method:te.method,pathname:oe.pathname,routeId:Xe.route.id})};else if(Ue=(await Pe("action",R,te,[Xe],Ce,null))[Xe.route.id],te.signal.aborted)return{shortCircuited:!0};if(Rf(Ue)){let Ve;return Ge&&Ge.replace!=null?Ve=Ge.replace:Ve=f4(Ue.response.headers.get("Location"),new URL(te.url),c)===R.location.pathname+R.location.search,await ge(te,Ue,!0,{submission:he,replace:Ve}),{shortCircuited:!0}}if(hd(Ue))throw hi(400,{type:"defer-action"});if(eo(Ue)){let Ve=yf(Ce,Xe.route.id);return(Ge&&Ge.replace)!==!0&&(E=Er.Push),{matches:Ce,pendingActionResult:[Ve.route.id,Ue]}}return{matches:Ce,pendingActionResult:[Xe.route.id,Ue]}}async function En(te,oe,he,Ce,Le,Ge,st,Ue,Xe,Ve,Ze){let gt=Le||QT(oe,Ge),It=Ge||st||b4(gt),Tr=!F&&(!l.v7_partialHydration||!Xe);if(Ce){if(Tr){let Vn=Xt(Ze);Ne(Gn({navigation:gt},Vn!==void 0?{actionData:Vn}:{}),{flushSync:Ve})}let Ft=await kn(he,oe.pathname,te.signal);if(Ft.type==="aborted")return{shortCircuited:!0};if(Ft.type==="error"){let Vn=yf(Ft.partialMatches).route.id;return{matches:Ft.partialMatches,loaderData:{},errors:{[Vn]:Ft.error}}}else if(Ft.matches)he=Ft.matches;else{let{error:Vn,notFoundMatches:ru,route:Qd}=Et(oe.pathname);return{matches:ru,loaderData:{},errors:{[Qd.id]:Vn}}}}let bn=o||a,[qt,Wn]=c4(t.history,R,he,It,oe,l.v7_partialHydration&&Xe===!0,l.v7_skipActionErrorRevalidation,U,Y,W,ue,K,G,bn,c,Ze);if(nt(Ft=>!(he&&he.some(Vn=>Vn.route.id===Ft))||qt&&qt.some(Vn=>Vn.route.id===Ft)),re=++ee,qt.length===0&&Wn.length===0){let Ft=Ht();return ye(oe,Gn({matches:he,loaderData:{},errors:Ze&&eo(Ze[1])?{[Ze[0]]:Ze[1].error}:null},g4(Ze),Ft?{fetchers:new Map(R.fetchers)}:{}),{flushSync:Ve}),{shortCircuited:!0}}if(Tr){let Ft={};if(!Ce){Ft.navigation=gt;let Vn=Xt(Ze);Vn!==void 0&&(Ft.actionData=Vn)}Wn.length>0&&(Ft.fetchers=gn(Wn)),Ne(Ft,{flushSync:Ve})}Wn.forEach(Ft=>{Yn(Ft.key),Ft.controller&&H.set(Ft.key,Ft.controller)});let nu=()=>Wn.forEach(Ft=>Yn(Ft.key));D&&D.signal.addEventListener("abort",nu);let{loaderResults:Fa,fetcherResults:Go}=await Me(R,he,qt,Wn,te);if(te.signal.aborted)return{shortCircuited:!0};D&&D.signal.removeEventListener("abort",nu),Wn.forEach(Ft=>H.delete(Ft.key));let Is=yS(Fa);if(Is)return await ge(te,Is.result,!0,{replace:Ue}),{shortCircuited:!0};if(Is=yS(Go),Is)return G.add(Is.key),await ge(te,Is.result,!0,{replace:Ue}),{shortCircuited:!0};let{loaderData:Wv,errors:Kd}=p4(R,he,Fa,Ze,Wn,Go,de);de.forEach((Ft,Vn)=>{Ft.subscribe(ru=>{(ru||Ft.done)&&de.delete(Vn)})}),l.v7_partialHydration&&Xe&&R.errors&&(Kd=Gn({},R.errors,Kd));let Nl=Ht(),Yd=an(re),Xd=Nl||Yd||Wn.length>0;return Gn({matches:he,loaderData:Wv,errors:Kd},Xd?{fetchers:new Map(R.fetchers)}:{})}function Xt(te){if(te&&!eo(te[1]))return{[te[0]]:te[1].data};if(R.actionData)return Object.keys(R.actionData).length===0?null:R.actionData}function gn(te){return te.forEach(oe=>{let he=R.fetchers.get(oe.key),Ce=Cy(void 0,he?he.data:void 0);R.fetchers.set(oe.key,Ce)}),new Map(R.fetchers)}function Qt(te,oe,he,Ce){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Yn(te);let Le=(Ce&&Ce.flushSync)===!0,Ge=o||a,st=PN(R.location,R.matches,c,l.v7_prependBasename,he,l.v7_relativeSplatPath,oe,Ce==null?void 0:Ce.relative),Ue=vf(Ge,st,c),Xe=cn(Ue,Ge,st);if(Xe.active&&Xe.matches&&(Ue=Xe.matches),!Ue){Ye(te,oe,hi(404,{pathname:st}),{flushSync:Le});return}let{path:Ve,submission:Ze,error:gt}=a4(l.v7_normalizeFormMethod,!0,st,Ce);if(gt){Ye(te,oe,gt,{flushSync:Le});return}let It=Uy(Ue,Ve),Tr=(Ce&&Ce.preventScrollReset)===!0;if(Ze&&ya(Ze.formMethod)){Z(te,oe,Ve,It,Ue,Xe.active,Le,Tr,Ze);return}K.set(te,{routeId:oe,path:Ve}),fe(te,oe,Ve,It,Ue,Xe.active,Le,Tr,Ze)}async function Z(te,oe,he,Ce,Le,Ge,st,Ue,Xe){xe(),K.delete(te);function Ve(ir){if(!ir.route.action&&!ir.route.lazy){let Ml=hi(405,{method:Xe.formMethod,pathname:he,routeId:oe});return Ye(te,oe,Ml,{flushSync:st}),!0}return!1}if(!Ge&&Ve(Ce))return;let Ze=R.fetchers.get(te);Te(te,HOe(Xe,Ze),{flushSync:st});let gt=new AbortController,It=Xp(t.history,he,gt.signal,Xe);if(Ge){let ir=await kn(Le,new URL(It.url).pathname,It.signal,te);if(ir.type==="aborted")return;if(ir.type==="error"){Ye(te,oe,ir.error,{flushSync:st});return}else if(ir.matches){if(Le=ir.matches,Ce=Uy(Le,he),Ve(Ce))return}else{Ye(te,oe,hi(404,{pathname:he}),{flushSync:st});return}}H.set(te,gt);let Tr=ee,qt=(await Pe("action",R,It,[Ce],Le,te))[Ce.route.id];if(It.signal.aborted){H.get(te)===gt&&H.delete(te);return}if(l.v7_fetcherPersist&&ue.has(te)){if(Rf(qt)||eo(qt)){Te(te,xu(void 0));return}}else{if(Rf(qt))if(H.delete(te),re>Tr){Te(te,xu(void 0));return}else return G.add(te),Te(te,Cy(Xe)),ge(It,qt,!1,{fetcherSubmission:Xe,preventScrollReset:Ue});if(eo(qt)){Ye(te,oe,qt.error);return}}if(hd(qt))throw hi(400,{type:"defer-action"});let Wn=R.navigation.location||R.location,nu=Xp(t.history,Wn,gt.signal),Fa=o||a,Go=R.navigation.state!=="idle"?vf(Fa,R.navigation.location,c):R.matches;Nt(Go,"Didn't find any matches after fetcher action");let Is=++ee;X.set(te,Is);let Wv=Cy(Xe,qt.data);R.fetchers.set(te,Wv);let[Kd,Nl]=c4(t.history,R,Go,Xe,Wn,!1,l.v7_skipActionErrorRevalidation,U,Y,W,ue,K,G,Fa,c,[Ce.route.id,qt]);Nl.filter(ir=>ir.key!==te).forEach(ir=>{let Ml=ir.key,Vv=R.fetchers.get(Ml),q_=Cy(void 0,Vv?Vv.data:void 0);R.fetchers.set(Ml,q_),Yn(Ml),ir.controller&&H.set(Ml,ir.controller)}),Ne({fetchers:new Map(R.fetchers)});let Yd=()=>Nl.forEach(ir=>Yn(ir.key));gt.signal.addEventListener("abort",Yd);let{loaderResults:Xd,fetcherResults:Ft}=await Me(R,Go,Kd,Nl,nu);if(gt.signal.aborted)return;gt.signal.removeEventListener("abort",Yd),X.delete(te),H.delete(te),Nl.forEach(ir=>H.delete(ir.key));let Vn=yS(Xd);if(Vn)return ge(nu,Vn.result,!1,{preventScrollReset:Ue});if(Vn=yS(Ft),Vn)return G.add(Vn.key),ge(nu,Vn.result,!1,{preventScrollReset:Ue});let{loaderData:ru,errors:Qd}=p4(R,Go,Xd,void 0,Nl,Ft,de);if(R.fetchers.has(te)){let ir=xu(qt.data);R.fetchers.set(te,ir)}an(Is),R.navigation.state==="loading"&&Is>re?(Nt(E,"Expected pending action"),D&&D.abort(),ye(R.navigation.location,{matches:Go,loaderData:ru,errors:Qd,fetchers:new Map(R.fetchers)})):(Ne({errors:Qd,loaderData:m4(R.loaderData,ru,Go,Qd),fetchers:new Map(R.fetchers)}),U=!1)}async function fe(te,oe,he,Ce,Le,Ge,st,Ue,Xe){let Ve=R.fetchers.get(te);Te(te,Cy(Xe,Ve?Ve.data:void 0),{flushSync:st});let Ze=new AbortController,gt=Xp(t.history,he,Ze.signal);if(Ge){let qt=await kn(Le,new URL(gt.url).pathname,gt.signal,te);if(qt.type==="aborted")return;if(qt.type==="error"){Ye(te,oe,qt.error,{flushSync:st});return}else if(qt.matches)Le=qt.matches,Ce=Uy(Le,he);else{Ye(te,oe,hi(404,{pathname:he}),{flushSync:st});return}}H.set(te,Ze);let It=ee,bn=(await Pe("loader",R,gt,[Ce],Le,te))[Ce.route.id];if(hd(bn)&&(bn=await T$(bn,gt.signal,!0)||bn),H.get(te)===Ze&&H.delete(te),!gt.signal.aborted){if(ue.has(te)){Te(te,xu(void 0));return}if(Rf(bn))if(re>It){Te(te,xu(void 0));return}else{G.add(te),await ge(gt,bn,!1,{preventScrollReset:Ue});return}if(eo(bn)){Ye(te,oe,bn.error);return}Nt(!hd(bn),"Unhandled fetcher deferred data"),Te(te,xu(bn.data))}}async function ge(te,oe,he,Ce){let{submission:Le,fetcherSubmission:Ge,preventScrollReset:st,replace:Ue}=Ce===void 0?{}:Ce;oe.response.headers.has("X-Remix-Revalidate")&&(U=!0);let Xe=oe.response.headers.get("Location");Nt(Xe,"Expected a Location header on the redirect Response"),Xe=f4(Xe,new URL(te.url),c);let Ve=rw(R.location,Xe,{_isRedirect:!0});if(n){let qt=!1;if(oe.response.headers.has("X-Remix-Reload-Document"))qt=!0;else if(P$.test(Xe)){const Wn=t.history.createURL(Xe);qt=Wn.origin!==e.location.origin||kd(Wn.pathname,c)==null}if(qt){Ue?e.location.replace(Xe):e.location.assign(Xe);return}}D=null;let Ze=Ue===!0||oe.response.headers.has("X-Remix-Replace")?Er.Replace:Er.Push,{formMethod:gt,formAction:It,formEncType:Tr}=R.navigation;!Le&&!Ge&>&&It&&Tr&&(Le=b4(R.navigation));let bn=Le||Ge;if(SOe.has(oe.response.status)&&bn&&ya(bn.formMethod))await Qe(Ze,Ve,{submission:Gn({},bn,{formAction:Xe}),preventScrollReset:st||T,enableViewTransition:he?M:void 0});else{let qt=QT(Ve,Le);await Qe(Ze,Ve,{overrideNavigation:qt,fetcherSubmission:Ge,preventScrollReset:st||T,enableViewTransition:he?M:void 0})}}async function Pe(te,oe,he,Ce,Le,Ge){let st,Ue={};try{st=await DOe(u,te,oe,he,Ce,Le,Ge,i,s)}catch(Xe){return Ce.forEach(Ve=>{Ue[Ve.route.id]={type:hn.error,error:Xe}}),Ue}for(let[Xe,Ve]of Object.entries(st))if($Oe(Ve)){let Ze=Ve.result;Ue[Xe]={type:hn.redirect,response:OOe(Ze,he,Xe,Le,c,l.v7_relativeSplatPath)}}else Ue[Xe]=await MOe(Ve);return Ue}async function Me(te,oe,he,Ce,Le){let Ge=te.matches,st=Pe("loader",te,Le,he,oe,null),Ue=Promise.all(Ce.map(async Ze=>{if(Ze.matches&&Ze.match&&Ze.controller){let It=(await Pe("loader",te,Xp(t.history,Ze.path,Ze.controller.signal),[Ze.match],Ze.matches,Ze.key))[Ze.match.route.id];return{[Ze.key]:It}}else return Promise.resolve({[Ze.key]:{type:hn.error,error:hi(404,{pathname:Ze.path})}})})),Xe=await st,Ve=(await Ue).reduce((Ze,gt)=>Object.assign(Ze,gt),{});return await Promise.all([zOe(oe,Xe,Le.signal,Ge,te.loaderData),BOe(oe,Ve,Ce)]),{loaderResults:Xe,fetcherResults:Ve}}function xe(){U=!0,Y.push(...nt()),K.forEach((te,oe)=>{H.has(oe)&&W.add(oe),Yn(oe)})}function Te(te,oe,he){he===void 0&&(he={}),R.fetchers.set(te,oe),Ne({fetchers:new Map(R.fetchers)},{flushSync:(he&&he.flushSync)===!0})}function Ye(te,oe,he,Ce){Ce===void 0&&(Ce={});let Le=yf(R.matches,oe);wt(te),Ne({errors:{[Le.route.id]:he},fetchers:new Map(R.fetchers)},{flushSync:(Ce&&Ce.flushSync)===!0})}function Pt(te){return J.set(te,(J.get(te)||0)+1),ue.has(te)&&ue.delete(te),R.fetchers.get(te)||EOe}function wt(te){let oe=R.fetchers.get(te);H.has(te)&&!(oe&&oe.state==="loading"&&X.has(te))&&Yn(te),K.delete(te),X.delete(te),G.delete(te),l.v7_fetcherPersist&&ue.delete(te),W.delete(te),R.fetchers.delete(te)}function Ls(te){let oe=(J.get(te)||0)-1;oe<=0?(J.delete(te),ue.add(te),l.v7_fetcherPersist||wt(te)):J.set(te,oe),Ne({fetchers:new Map(R.fetchers)})}function Yn(te){let oe=H.get(te);oe&&(oe.abort(),H.delete(te))}function gs(te){for(let oe of te){let he=Pt(oe),Ce=xu(he.data);R.fetchers.set(oe,Ce)}}function Ht(){let te=[],oe=!1;for(let he of G){let Ce=R.fetchers.get(he);Nt(Ce,"Expected fetcher: "+he),Ce.state==="loading"&&(G.delete(he),te.push(he),oe=!0)}return gs(te),oe}function an(te){let oe=[];for(let[he,Ce]of X)if(Ce<te){let Le=R.fetchers.get(he);Nt(Le,"Expected fetcher: "+he),Le.state==="loading"&&(Yn(he),X.delete(he),oe.push(he))}return gs(oe),oe.length>0}function vn(te,oe){let he=R.blockers.get(te)||sm;return ie.get(te)!==oe&&ie.set(te,oe),he}function Be(te){R.blockers.delete(te),ie.delete(te)}function it(te,oe){let he=R.blockers.get(te)||sm;Nt(he.state==="unblocked"&&oe.state==="blocked"||he.state==="blocked"&&oe.state==="blocked"||he.state==="blocked"&&oe.state==="proceeding"||he.state==="blocked"&&oe.state==="unblocked"||he.state==="proceeding"&&oe.state==="unblocked","Invalid blocker state transition: "+he.state+" -> "+oe.state);let Ce=new Map(R.blockers);Ce.set(te,oe),Ne({blockers:Ce})}function ot(te){let{currentLocation:oe,nextLocation:he,historyAction:Ce}=te;if(ie.size===0)return;ie.size>1&&mv(!1,"A router only supports one blocker at a time");let Le=Array.from(ie.entries()),[Ge,st]=Le[Le.length-1],Ue=R.blockers.get(Ge);if(!(Ue&&Ue.state==="proceeding")&&st({currentLocation:oe,nextLocation:he,historyAction:Ce}))return Ge}function Et(te){let oe=hi(404,{pathname:te}),he=o||a,{matches:Ce,route:Le}=v4(he);return nt(),{notFoundMatches:Ce,route:Le,error:oe}}function nt(te){let oe=[];return de.forEach((he,Ce)=>{(!te||te(Ce))&&(he.cancel(),oe.push(Ce),de.delete(Ce))}),oe}function Wt(te,oe,he){if(p=te,y=oe,h=he||null,!g&&R.navigation===XT){g=!0;let Ce=ln(R.location,R.matches);Ce!=null&&Ne({restoreScrollPosition:Ce})}return()=>{p=null,y=null,h=null}}function At(te,oe){return h&&h(te,oe.map(Ce=>tOe(Ce,R.loaderData)))||te.key}function yn(te,oe){if(p&&y){let he=At(te,oe);p[he]=y()}}function ln(te,oe){if(p){let he=At(te,oe),Ce=p[he];if(typeof Ce=="number")return Ce}return null}function cn(te,oe,he){if(f)if(te){if(Object.keys(te[0].params).length>0)return{active:!0,matches:KS(oe,he,c,!0)}}else return{active:!0,matches:KS(oe,he,c,!0)||[]};return{active:!1,matches:null}}async function kn(te,oe,he,Ce){if(!f)return{type:"success",matches:te};let Le=te;for(;;){let Ge=o==null,st=o||a,Ue=i;try{await f({signal:he,path:oe,matches:Le,fetcherKey:Ce,patch:(Ze,gt)=>{he.aborted||d4(Ze,gt,st,Ue,s)}})}catch(Ze){return{type:"error",error:Ze,partialMatches:Le}}finally{Ge&&!he.aborted&&(a=[...a])}if(he.aborted)return{type:"aborted"};let Xe=vf(st,oe,c);if(Xe)return{type:"success",matches:Xe};let Ve=KS(st,oe,c,!0);if(!Ve||Le.length===Ve.length&&Le.every((Ze,gt)=>Ze.route.id===Ve[gt].route.id))return{type:"success",matches:null};Le=Ve}}function hr(te){i={},o=k1(te,s,void 0,i)}function Dn(te,oe){let he=o==null;d4(te,oe,o||a,i,s),he&&(a=[...a],Ne({}))}return k={get basename(){return c},get future(){return l},get state(){return R},get routes(){return a},get window(){return e},initialize:Ae,subscribe:Oe,enableScrollRestoration:Wt,navigate:$e,fetch:Qt,revalidate:ut,createHref:te=>t.history.createHref(te),encodeLocation:te=>t.history.encodeLocation(te),getFetcher:Pt,deleteFetcher:Ls,dispose:_e,getBlocker:vn,deleteBlocker:Be,patchRoutes:Dn,_internalFetchControllers:H,_internalActiveDeferreds:de,_internalSetRoutes:hr},k}function ROe(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function PN(t,e,n,r,s,i,a,o){let c,u;if(a){c=[];for(let l of e)if(c.push(l),l.route.id===a){u=l;break}}else c=e,u=e[e.length-1];let f=$A(s||".",IA(c,i),kd(t.pathname,n)||t.pathname,o==="path");if(s==null&&(f.search=t.search,f.hash=t.hash),(s==null||s===""||s===".")&&u){let l=k$(f.search);if(u.route.index&&!l)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&l){let d=new URLSearchParams(f.search),m=d.getAll("index");d.delete("index"),m.filter(h=>h).forEach(h=>d.append("index",h));let p=d.toString();f.search=p?"?"+p:""}}return r&&n!=="/"&&(f.pathname=f.pathname==="/"?n:Lc([n,f.pathname])),np(f)}function a4(t,e,n,r){if(!r||!ROe(r))return{path:n};if(r.formMethod&&!jOe(r.formMethod))return{path:n,error:hi(405,{method:r.formMethod})};let s=()=>({path:n,error:hi(400,{type:"invalid-body"})}),i=r.formMethod||"get",a=t?i.toUpperCase():i.toLowerCase(),o=vQ(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ya(a))return s();let d=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((m,p)=>{let[h,y]=p;return""+m+h+"="+y+`
|
||
`},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:o,formEncType:r.formEncType,formData:void 0,json:void 0,text:d}}}else if(r.formEncType==="application/json"){if(!ya(a))return s();try{let d=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:o,formEncType:r.formEncType,formData:void 0,json:d,text:void 0}}}catch{return s()}}}Nt(typeof FormData=="function","FormData is not available in this environment");let c,u;if(r.formData)c=kN(r.formData),u=r.formData;else if(r.body instanceof FormData)c=kN(r.body),u=r.body;else if(r.body instanceof URLSearchParams)c=r.body,u=h4(c);else if(r.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(r.body),u=h4(c)}catch{return s()}let f={formMethod:a,formAction:o,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(ya(f.formMethod))return{path:n,submission:f};let l=Hd(n);return e&&l.search&&k$(l.search)&&c.append("index",""),l.search="?"+c,{path:np(l),submission:f}}function l4(t,e,n){n===void 0&&(n=!1);let r=t.findIndex(s=>s.route.id===e);return r>=0?t.slice(0,n?r+1:r):t}function c4(t,e,n,r,s,i,a,o,c,u,f,l,d,m,p,h){let y=h?eo(h[1])?h[1].error:h[1].data:void 0,g=t.createURL(e.location),v=t.createURL(s),w=n;i&&e.errors?w=l4(n,Object.keys(e.errors)[0],!0):h&&eo(h[1])&&(w=l4(n,h[0]));let x=h?h[1].statusCode:void 0,A=a&&x&&x>=400,k=w.filter((E,T)=>{let{route:D}=E;if(D.lazy)return!0;if(D.loader==null)return!1;if(i)return TN(D,e.loaderData,e.errors);if(POe(e.loaderData,e.matches[T],E)||c.some(I=>I===E.route.id))return!0;let M=e.matches[T],L=E;return u4(E,Gn({currentUrl:g,currentParams:M.params,nextUrl:v,nextParams:L.params},r,{actionResult:y,actionStatus:x,defaultShouldRevalidate:A?!1:o||g.pathname+g.search===v.pathname+v.search||g.search!==v.search||mQ(M,L)}))}),R=[];return l.forEach((E,T)=>{if(i||!n.some(F=>F.route.id===E.routeId)||f.has(T))return;let D=vf(m,E.path,p);if(!D){R.push({key:T,routeId:E.routeId,path:E.path,matches:null,match:null,controller:null});return}let M=e.fetchers.get(T),L=Uy(D,E.path),I=!1;d.has(T)?I=!1:u.has(T)?(u.delete(T),I=!0):M&&M.state!=="idle"&&M.data===void 0?I=o:I=u4(L,Gn({currentUrl:g,currentParams:e.matches[e.matches.length-1].params,nextUrl:v,nextParams:n[n.length-1].params},r,{actionResult:y,actionStatus:x,defaultShouldRevalidate:A?!1:o})),I&&R.push({key:T,routeId:E.routeId,path:E.path,matches:D,match:L,controller:new AbortController})}),[k,R]}function TN(t,e,n){if(t.lazy)return!0;if(!t.loader)return!1;let r=e!=null&&e[t.id]!==void 0,s=n!=null&&n[t.id]!==void 0;return!r&&s?!1:typeof t.loader=="function"&&t.loader.hydrate===!0?!0:!r&&!s}function POe(t,e,n){let r=!e||n.route.id!==e.route.id,s=t[n.route.id]===void 0;return r||s}function mQ(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function u4(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}function d4(t,e,n,r,s){var i;let a;if(t){let u=r[t];Nt(u,"No route found to patch children into: routeId = "+t),u.children||(u.children=[]),a=u.children}else a=n;let o=e.filter(u=>!a.some(f=>gQ(u,f))),c=k1(o,s,[t||"_","patch",String(((i=a)==null?void 0:i.length)||"0")],r);a.push(...c)}function gQ(t,e){return"id"in t&&"id"in e&&t.id===e.id?!0:t.index===e.index&&t.path===e.path&&t.caseSensitive===e.caseSensitive?(!t.children||t.children.length===0)&&(!e.children||e.children.length===0)?!0:t.children.every((n,r)=>{var s;return(s=e.children)==null?void 0:s.some(i=>gQ(n,i))}):!1}async function TOe(t,e,n){if(!t.lazy)return;let r=await t.lazy();if(!t.lazy)return;let s=n[t.id];Nt(s,"No route found in manifest");let i={};for(let a in r){let c=s[a]!==void 0&&a!=="hasErrorBoundary";mv(!c,'Route "'+s.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!c&&!ZMe.has(a)&&(i[a]=r[a])}Object.assign(s,i),Object.assign(s,Gn({},e(s),{lazy:void 0}))}async function kOe(t){let{matches:e}=t,n=e.filter(s=>s.shouldLoad);return(await Promise.all(n.map(s=>s.resolve()))).reduce((s,i,a)=>Object.assign(s,{[n[a].route.id]:i}),{})}async function DOe(t,e,n,r,s,i,a,o,c,u){let f=i.map(m=>m.route.lazy?TOe(m.route,c,o):void 0),l=i.map((m,p)=>{let h=f[p],y=s.some(v=>v.route.id===m.route.id);return Gn({},m,{shouldLoad:y,resolve:async v=>(v&&r.method==="GET"&&(m.route.lazy||m.route.loader)&&(y=!0),y?NOe(e,r,m,h,v,u):Promise.resolve({type:hn.data,result:void 0}))})}),d=await t({matches:l,request:r,params:i[0].params,fetcherKey:a,context:u});try{await Promise.all(f)}catch{}return d}async function NOe(t,e,n,r,s,i){let a,o,c=u=>{let f,l=new Promise((p,h)=>f=h);o=()=>f(),e.signal.addEventListener("abort",o);let d=p=>typeof u!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+t+'" [routeId: '+n.route.id+"]"))):u({request:e,params:n.params,context:i},...p!==void 0?[p]:[]),m=(async()=>{try{return{type:"data",result:await(s?s(h=>d(h)):d())}}catch(p){return{type:"error",result:p}}})();return Promise.race([m,l])};try{let u=n.route[t];if(r)if(u){let f,[l]=await Promise.all([c(u).catch(d=>{f=d}),r]);if(f!==void 0)throw f;a=l}else if(await r,u=n.route[t],u)a=await c(u);else if(t==="action"){let f=new URL(e.url),l=f.pathname+f.search;throw hi(405,{method:e.method,pathname:l,routeId:n.route.id})}else return{type:hn.data,result:void 0};else if(u)a=await c(u);else{let f=new URL(e.url),l=f.pathname+f.search;throw hi(404,{pathname:l})}Nt(a.result!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(u){return{type:hn.error,result:u}}finally{o&&e.signal.removeEventListener("abort",o)}return a}async function MOe(t){let{result:e,type:n}=t;if(yQ(e)){let l;try{let d=e.headers.get("Content-Type");d&&/\bapplication\/json\b/.test(d)?e.body==null?l=null:l=await e.json():l=await e.text()}catch(d){return{type:hn.error,error:d}}return n===hn.error?{type:hn.error,error:new D1(e.status,e.statusText,l),statusCode:e.status,headers:e.headers}:{type:hn.data,data:l,statusCode:e.status,headers:e.headers}}if(n===hn.error){if(y4(e)){var r,s;if(e.data instanceof Error){var i,a;return{type:hn.error,error:e.data,statusCode:(i=e.init)==null?void 0:i.status,headers:(a=e.init)!=null&&a.headers?new Headers(e.init.headers):void 0}}return{type:hn.error,error:new D1(((r=e.init)==null?void 0:r.status)||500,void 0,e.data),statusCode:sw(e)?e.status:void 0,headers:(s=e.init)!=null&&s.headers?new Headers(e.init.headers):void 0}}return{type:hn.error,error:e,statusCode:sw(e)?e.status:void 0}}if(FOe(e)){var o,c;return{type:hn.deferred,deferredData:e,statusCode:(o=e.init)==null?void 0:o.status,headers:((c=e.init)==null?void 0:c.headers)&&new Headers(e.init.headers)}}if(y4(e)){var u,f;return{type:hn.data,data:e.data,statusCode:(u=e.init)==null?void 0:u.status,headers:(f=e.init)!=null&&f.headers?new Headers(e.init.headers):void 0}}return{type:hn.data,data:e}}function OOe(t,e,n,r,s,i){let a=t.headers.get("Location");if(Nt(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!P$.test(a)){let o=r.slice(0,r.findIndex(c=>c.route.id===n)+1);a=PN(new URL(e.url),o,s,!0,a,i),t.headers.set("Location",a)}return t}function f4(t,e,n){if(P$.test(t)){let r=t,s=r.startsWith("//")?new URL(e.protocol+r):new URL(r),i=kd(s.pathname,n)!=null;if(s.origin===e.origin&&i)return s.pathname+s.search+s.hash}return t}function Xp(t,e,n,r){let s=t.createURL(vQ(e)).toString(),i={signal:n};if(r&&ya(r.formMethod)){let{formMethod:a,formEncType:o}=r;i.method=a.toUpperCase(),o==="application/json"?(i.headers=new Headers({"Content-Type":o}),i.body=JSON.stringify(r.json)):o==="text/plain"?i.body=r.text:o==="application/x-www-form-urlencoded"&&r.formData?i.body=kN(r.formData):i.body=r.formData}return new Request(s,i)}function kN(t){let e=new URLSearchParams;for(let[n,r]of t.entries())e.append(n,typeof r=="string"?r:r.name);return e}function h4(t){let e=new FormData;for(let[n,r]of t.entries())e.append(n,r);return e}function LOe(t,e,n,r,s){let i={},a=null,o,c=!1,u={},f=n&&eo(n[1])?n[1].error:void 0;return t.forEach(l=>{if(!(l.route.id in e))return;let d=l.route.id,m=e[d];if(Nt(!Rf(m),"Cannot handle redirect results in processLoaderData"),eo(m)){let p=m.error;f!==void 0&&(p=f,f=void 0),a=a||{};{let h=yf(t,d);a[h.route.id]==null&&(a[h.route.id]=p)}i[d]=void 0,c||(c=!0,o=sw(m.error)?m.error.status:500),m.headers&&(u[d]=m.headers)}else hd(m)?(r.set(d,m.deferredData),i[d]=m.deferredData.data,m.statusCode!=null&&m.statusCode!==200&&!c&&(o=m.statusCode),m.headers&&(u[d]=m.headers)):(i[d]=m.data,m.statusCode&&m.statusCode!==200&&!c&&(o=m.statusCode),m.headers&&(u[d]=m.headers))}),f!==void 0&&n&&(a={[n[0]]:f},i[n[0]]=void 0),{loaderData:i,errors:a,statusCode:o||200,loaderHeaders:u}}function p4(t,e,n,r,s,i,a){let{loaderData:o,errors:c}=LOe(e,n,r,a);return s.forEach(u=>{let{key:f,match:l,controller:d}=u,m=i[f];if(Nt(m,"Did not find corresponding fetcher result"),!(d&&d.signal.aborted))if(eo(m)){let p=yf(t.matches,l==null?void 0:l.route.id);c&&c[p.route.id]||(c=Gn({},c,{[p.route.id]:m.error})),t.fetchers.delete(f)}else if(Rf(m))Nt(!1,"Unhandled fetcher revalidation redirect");else if(hd(m))Nt(!1,"Unhandled fetcher deferred data");else{let p=xu(m.data);t.fetchers.set(f,p)}}),{loaderData:o,errors:c}}function m4(t,e,n,r){let s=Gn({},e);for(let i of n){let a=i.route.id;if(e.hasOwnProperty(a)?e[a]!==void 0&&(s[a]=e[a]):t[a]!==void 0&&i.route.loader&&(s[a]=t[a]),r&&r.hasOwnProperty(a))break}return s}function g4(t){return t?eo(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function yf(t,e){return(e?t.slice(0,t.findIndex(r=>r.route.id===e)+1):[...t]).reverse().find(r=>r.route.hasErrorBoundary===!0)||t[0]}function v4(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function hi(t,e){let{pathname:n,routeId:r,method:s,type:i,message:a}=e===void 0?{}:e,o="Unknown Server Error",c="Unknown @remix-run/router error";return t===400?(o="Bad Request",s&&n&&r?c="You made a "+s+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?c="defer() is not supported in actions":i==="invalid-body"&&(c="Unable to encode submission body")):t===403?(o="Forbidden",c='Route "'+r+'" does not match URL "'+n+'"'):t===404?(o="Not Found",c='No route matches URL "'+n+'"'):t===405&&(o="Method Not Allowed",s&&n&&r?c="You made a "+s.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":s&&(c='Invalid request method "'+s.toUpperCase()+'"')),new D1(t||500,o,new Error(c),!0)}function yS(t){let e=Object.entries(t);for(let n=e.length-1;n>=0;n--){let[r,s]=e[n];if(Rf(s))return{key:r,result:s}}}function vQ(t){let e=typeof t=="string"?Hd(t):t;return np(Gn({},e,{hash:""}))}function IOe(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function $Oe(t){return yQ(t.result)&&xOe.has(t.result.status)}function hd(t){return t.type===hn.deferred}function eo(t){return t.type===hn.error}function Rf(t){return(t&&t.type)===hn.redirect}function y4(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function FOe(t){let e=t;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function yQ(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function jOe(t){return _Oe.has(t.toLowerCase())}function ya(t){return bOe.has(t.toLowerCase())}async function zOe(t,e,n,r,s){let i=Object.entries(e);for(let a=0;a<i.length;a++){let[o,c]=i[a],u=t.find(d=>(d==null?void 0:d.route.id)===o);if(!u)continue;let f=r.find(d=>d.route.id===u.route.id),l=f!=null&&!mQ(f,u)&&(s&&s[u.route.id])!==void 0;hd(c)&&l&&await T$(c,n,!1).then(d=>{d&&(e[o]=d)})}}async function BOe(t,e,n){for(let r=0;r<n.length;r++){let{key:s,routeId:i,controller:a}=n[r],o=e[s];t.find(u=>(u==null?void 0:u.route.id)===i)&&hd(o)&&(Nt(a,"Expected an AbortController for revalidating fetcher deferred result"),await T$(o,a.signal,!0).then(u=>{u&&(e[s]=u)}))}}async function T$(t,e,n){if(n===void 0&&(n=!1),!await t.deferredData.resolveData(e)){if(n)try{return{type:hn.data,data:t.deferredData.unwrappedData}}catch(s){return{type:hn.error,error:s}}return{type:hn.data,data:t.deferredData.data}}}function k$(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function Uy(t,e){let n=typeof e=="string"?Hd(e).search:e.search;if(t[t.length-1].route.index&&k$(n||""))return t[t.length-1];let r=fQ(t);return r[r.length-1]}function b4(t){let{formMethod:e,formAction:n,formEncType:r,text:s,formData:i,json:a}=t;if(!(!e||!n||!r)){if(s!=null)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:void 0,text:s};if(i!=null)return{formMethod:e,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(a!==void 0)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function QT(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function UOe(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function Cy(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function HOe(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function xu(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function WOe(t,e){try{let n=t.sessionStorage.getItem(pQ);if(n){let r=JSON.parse(n);for(let[s,i]of Object.entries(r||{}))i&&Array.isArray(i)&&e.set(s,new Set(i||[]))}}catch{}}function VOe(t,e){if(e.size>0){let n={};for(let[r,s]of e)n[r]=[...s];try{t.sessionStorage.setItem(pQ,JSON.stringify(n))}catch(r){mv(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
|
||
* React Router v6.30.0
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function gv(){return gv=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},gv.apply(this,arguments)}const FA=_.createContext(null),bQ=_.createContext(null),Wd=_.createContext(null),D$=_.createContext(null),Dl=_.createContext({outlet:null,matches:[],isDataRoute:!1}),wQ=_.createContext(null);function qOe(t,e){let{relative:n}=e===void 0?{}:e;$v()||Nt(!1);let{basename:r,navigator:s}=_.useContext(Wd),{hash:i,pathname:a,search:o}=xQ(t,{relative:n}),c=a;return r!=="/"&&(c=a==="/"?r:Lc([r,a])),s.createHref({pathname:c,search:o,hash:i})}function $v(){return _.useContext(D$)!=null}function Vd(){return $v()||Nt(!1),_.useContext(D$).location}function _Q(t){_.useContext(Wd).static||_.useLayoutEffect(t)}function Fv(){let{isDataRoute:t}=_.useContext(Dl);return t?iLe():GOe()}function GOe(){$v()||Nt(!1);let t=_.useContext(FA),{basename:e,future:n,navigator:r}=_.useContext(Wd),{matches:s}=_.useContext(Dl),{pathname:i}=Vd(),a=JSON.stringify(IA(s,n.v7_relativeSplatPath)),o=_.useRef(!1);return _Q(()=>{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=$A(u,JSON.parse(a),i,f.relative==="path");t==null&&e!=="/"&&(l.pathname=l.pathname==="/"?e:Lc([e,l.pathname])),(f.replace?r.replace:r.push)(l,f.state,f)},[e,r,a,i,t])}const KOe=_.createContext(null);function YOe(t){let e=_.useContext(Dl).outlet;return e&&_.createElement(KOe.Provider,{value:t},e)}function f5e(){let{matches:t}=_.useContext(Dl),e=t[t.length-1];return e?e.params:{}}function xQ(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=_.useContext(Wd),{matches:s}=_.useContext(Dl),{pathname:i}=Vd(),a=JSON.stringify(IA(s,r.v7_relativeSplatPath));return _.useMemo(()=>$A(t,JSON.parse(a),i,n==="path"),[t,a,i,n])}function XOe(t,e,n,r){$v()||Nt(!1);let{navigator:s,static:i}=_.useContext(Wd),{matches:a}=_.useContext(Dl),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:vf(t,{pathname:m});return tLe(p&&p.map(y=>Object.assign({},y,{params:Object.assign({},c,y.params),pathname:Lc([u,s.encodeLocation?s.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?u:Lc([u,s.encodeLocation?s.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,n,r)}function QOe(){let t=rLe(),e=sw(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 JOe=_.createElement(QOe,null);class ZOe 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(Dl.Provider,{value:this.props.routeContext},_.createElement(wQ.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function eLe(t){let{routeContext:e,match:n,children:r}=t,s=_.useContext(FA);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),_.createElement(Dl.Provider,{value:e},r)}function tLe(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<a.length;f++){let l=a[f];if((l.route.HydrateFallback||l.route.hydrateFallbackElement)&&(u=f),l.route.id){let{loaderData:d,errors:m}=n,p=l.route.loader&&d[l.route.id]===void 0&&(!m||m[l.route.id]===void 0);if(l.route.lazy||p){c=!0,u>=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||JOe,c&&(u<0&&d===0?(oLe("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(eLe,{match:l,routeContext:{outlet:f,matches:g,isDataRoute:n!=null},children:w})};return n&&(l.route.ErrorBoundary||l.route.errorElement||d===0)?_.createElement(ZOe,{location:n.location,revalidation:n.revalidation,component:h,error:m,children:v(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):v()},null)}var SQ=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(SQ||{}),EQ=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}(EQ||{});function CQ(t){let e=_.useContext(FA);return e||Nt(!1),e}function AQ(t){let e=_.useContext(bQ);return e||Nt(!1),e}function nLe(t){let e=_.useContext(Dl);return e||Nt(!1),e}function RQ(t){let e=nLe(),n=e.matches[e.matches.length-1];return n.route.id||Nt(!1),n.route.id}function rLe(){var t;let e=_.useContext(wQ),n=AQ(),r=RQ();return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}let sLe=0;function h5e(t){let{router:e,basename:n}=CQ(),r=AQ(),[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:gv({},c,{pathname:kd(c.pathname,n)||c.pathname}),nextLocation:gv({},u,{pathname:kd(u.pathname,n)||u.pathname}),historyAction:f})},[n,t]);return _.useEffect(()=>{let o=String(++sLe);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):sm}function iLe(){let{router:t}=CQ(SQ.UseNavigateStable),e=RQ(EQ.UseNavigateStable),n=_.useRef(!1);return _Q(()=>{n.current=!0}),_.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?t.navigate(s):t.navigate(s,gv({fromRouteId:e},i)))},[t,e])}const w4={};function oLe(t,e,n){w4[t]||(w4[t]=!0)}function aLe(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 PQ(t){let{to:e,replace:n,state:r,relative:s}=t;$v()||Nt(!1);let{future:i,static:a}=_.useContext(Wd),{matches:o}=_.useContext(Dl),{pathname:c}=Vd(),u=Fv(),f=$A(e,IA(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 bS(t){return YOe(t.context)}function lLe(t){let{basename:e="/",children:n=null,location:r,navigationType:s=Er.Pop,navigator:i,static:a=!1,future:o}=t;$v()&&Nt(!1);let c=e.replace(/^\/*/,"/"),u=_.useMemo(()=>({basename:c,navigator:i,static:a,future:gv({v7_relativeSplatPath:!1},o)}),[c,o,i,a]);typeof r=="string"&&(r=Hd(r));let{pathname:f="/",search:l="",hash:d="",state:m=null,key:p="default"}=r,h=_.useMemo(()=>{let y=kd(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(Wd.Provider,{value:u},_.createElement(D$.Provider,{children:n,value:h}))}new Promise(()=>{});function cLe(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.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function iw(){return iw=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},iw.apply(this,arguments)}function uLe(t,e){if(t==null)return{};var n={},r=Object.keys(t),s,i;for(i=0;i<r.length;i++)s=r[i],!(e.indexOf(s)>=0)&&(n[s]=t[s]);return n}function dLe(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function fLe(t,e){return t.button===0&&(!e||e==="_self")&&!dLe(t)}function DN(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 hLe(t,e){let n=DN(t);return e&&e.forEach((r,s)=>{n.has(s)||e.getAll(s).forEach(i=>{n.append(s,i)})}),n}const pLe=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],mLe="6";try{window.__reactRouterVersion=mLe}catch{}function gLe(t,e){return AOe({basename:e==null?void 0:e.basename,future:iw({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:XMe({window:e==null?void 0:e.window}),hydrationData:(e==null?void 0:e.hydrationData)||vLe(),routes:t,mapRouteProperties:cLe,dataStrategy:e==null?void 0:e.dataStrategy,patchRoutesOnNavigation:e==null?void 0:e.patchRoutesOnNavigation,window:e==null?void 0:e.window}).initialize()}function vLe(){var t;let e=(t=window)==null?void 0:t.__staticRouterHydrationData;return e&&e.errors&&(e=iw({},e,{errors:yLe(e.errors)})),e}function yLe(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 D1(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 bLe=_.createContext({isTransitioning:!1}),wLe=_.createContext(new Map),_Le="startTransition",_4=X0[_Le],xLe="flushSync",x4=Jue[xLe];function SLe(t){_4?_4(t):t()}function Ay(t){x4?x4(t):t()}class ELe{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 CLe(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?SLe(E):E()},[g]),w=_.useCallback((E,T)=>{let{deletedFetchers:D,flushSync:M,viewTransitionOpts:L}=T;E.fetchers.forEach((F,U)=>{F.data!==void 0&&y.current.set(U,F.data)}),D.forEach(F=>y.current.delete(F));let I=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!L||I){M?Ay(()=>i(E)):v(()=>i(E));return}if(M){Ay(()=>{d&&(f&&f.resolve(),d.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:L.currentLocation,nextLocation:L.nextLocation})});let F=n.window.document.startViewTransition(()=>{Ay(()=>i(E))});F.finished.finally(()=>{Ay(()=>{l(void 0),m(void 0),o(void 0),u({isTransitioning:!1})})}),Ay(()=>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 ELe)},[c]),_.useEffect(()=>{if(f&&a&&n.window){let E=a,T=f.promise,D=n.window.document.startViewTransition(async()=>{v(()=>i(E)),await T});D.finished.finally(()=>{l(void 0),m(void 0),o(void 0),u({isTransitioning:!1})}),m(D)}},[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,T,D)=>n.navigate(E,{state:T,preventScrollReset:D==null?void 0:D.preventScrollReset}),replace:(E,T,D)=>n.navigate(E,{replace:!0,state:T,preventScrollReset:D==null?void 0:D.preventScrollReset})}),[n]),A=n.basename||"/",k=_.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(()=>aLe(r,n.future),[r,n.future]),_.createElement(_.Fragment,null,_.createElement(FA.Provider,{value:k},_.createElement(bQ.Provider,{value:s},_.createElement(wLe.Provider,{value:y.current},_.createElement(bLe.Provider,{value:c},_.createElement(lLe,{basename:A,location:s.location,navigationType:s.historyAction,navigator:x,future:R},s.initialized||n.future.v7_partialHydration?_.createElement(ALe,{routes:n.routes,future:n.future,state:s}):e))))),null)}const ALe=_.memo(RLe);function RLe(t){let{routes:e,future:n,state:r}=t;return XOe(e,void 0,r,n)}const PLe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",TLe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,bf=_.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=uLe(e,pLe),{basename:m}=_.useContext(Wd),p,h=!1;if(typeof u=="string"&&TLe.test(u)&&(p=u,PLe))try{let w=new URL(window.location.href),x=u.startsWith("//")?new URL(w.protocol+u):new URL(u),A=kd(x.pathname,m);x.origin===w.origin&&A!=null?u=A+x.search+x.hash:h=!0}catch{}let y=qOe(u,{relative:s}),g=kLe(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",iw({},d,{href:p||y,onClick:h||i?r:v,ref:n,target:c}))});var S4;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(S4||(S4={}));var E4;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(E4||(E4={}));function kLe(t,e){let{target:n,replace:r,state:s,preventScrollReset:i,relative:a,viewTransition:o}=e===void 0?{}:e,c=Fv(),u=Vd(),f=xQ(t,{relative:a});return _.useCallback(l=>{if(fLe(l,n)){l.preventDefault();let d=r!==void 0?r:np(u)===np(f);c(t,{replace:d,state:s,preventScrollReset:i,relative:a,viewTransition:o})}},[u,c,f,r,s,n,t,i,a,o])}function DLe(t){let e=_.useRef(DN(t)),n=_.useRef(!1),r=Vd(),s=_.useMemo(()=>hLe(r.search,n.current?null:e.current),[r.search]),i=Fv(),a=_.useCallback((o,c)=>{const u=DN(typeof o=="function"?o(s):o);n.current=!0,i("?"+u,c)},[i,s]);return[s,a]}const TQ=({isOpen:t,onCancel:e,onConfirm:n,title:r,description:s,cancelLabel:i,confirmLabel:a})=>P.jsx(u6,{open:t,children:P.jsxs(TL,{children:[P.jsxs(kL,{children:[P.jsx(NL,{children:r}),P.jsx(ML,{children:s})]}),P.jsxs(DL,{children:[P.jsx(LL,{children:P.jsx(bf,{to:"#",onClick:e,children:i})}),P.jsx(OL,{children:P.jsx(bf,{to:"#",onClick:n,children:a})})]})]})}),NLe=t=>{const[e,n]=_.useState(!1),[r,s]=_.useState({title:"Título",description:"Descripción",cancelLabel:ft("common.no"),confirmLabel:ft("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(TQ,{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 kQ={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),k=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 T=this.clone();T.$_terms.alterations=T.$_terms.alterations||[];for(const D in E){const M=E[D];o(typeof M=="function","Alteration adjuster for",D,"must be a function"),T.$_terms.alterations.push({target:D,adjuster:M})}return T.$_temp.ruleset=!1,T}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,T){return this._default("default",E,T)}description(E){return o(E&&typeof E=="string","Description must be a non-empty string"),this.$_setFlag("description",E)}empty(E){const T=this.clone();return E!==void 0&&(E=T.$_compile(E,{override:!1})),T.$_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,T={}){return o(E!==void 0,"Missing example"),d.assertOptions(T,["override"]),this._inner("examples",E,{single:!0,override:T.override})}external(E,T){return typeof E=="object"&&(o(!T,"Cannot combine options with description"),T=E.description,E=E.method),o(typeof E=="function","Method must be a function"),o(T===void 0||T&&typeof T=="string","Description must be a non-empty string"),this._inner("externals",{method:E,description:T},{single:!0})}failover(E,T){return this._default("failover",E,T)}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 T of E)o(T&&typeof T=="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 T=this.clone();return T._preferences=d.preferences(T._preferences,E),T}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 T=this.clone(),D=E!==void 0&&!E;return T._preferences=d.preferences(T._preferences,{convert:D}),T}strip(E=!0){return this.$_setFlag("result",E?"strip":void 0)}tag(...E){o(E.length,"Missing tags");for(const T of E)o(T&&typeof T=="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 T=this.allow(...E);return T.$_setFlag("only",!!T._valids,{clone:!1}),T}when(E,T){const D=this.clone();D.$_terms.whens||(D.$_terms.whens=[]);const M=m.when(D,E,T);if(!["any","link"].includes(D.type)){const L=M.is?[M]:M.switch;for(const I of L)o(!I.then||I.then.type==="any"||I.then.type===D.type,"Cannot combine",D.type,"with",I.then&&I.then.type),o(!I.otherwise||I.otherwise.type==="any"||I.otherwise.type===D.type,"Cannot combine",D.type,"with",I.otherwise&&I.otherwise.type)}return D.$_terms.whens.push(M),D.$_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 T=this.clone();return T._cache=E||l.provider.provision(),T.$_temp.ruleset=!1,T}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 T=this.clone();if(this.type==="any"&&E.type!=="any"){const D=E.clone();for(const M of Object.keys(T))M!=="type"&&(D[M]=T[M]);T=D}T._ids.concat(E._ids),T._refs.register(E,w.toSibling),T._preferences=T._preferences?d.preferences(T._preferences,E._preferences):E._preferences,T._valids=k.merge(T._valids,E._valids,E._invalids),T._invalids=k.merge(T._invalids,E._invalids,E._valids);for(const D of E._singleRules.keys())T._singleRules.has(D)&&(T._rules=T._rules.filter(M=>M.keep||M.name!==D),T._singleRules.delete(D));for(const D of E._rules)E._definition.rules[D.method].multi||T._singleRules.set(D.name,D),T._rules.push(D);if(T._flags.empty&&E._flags.empty){T._flags.empty=T._flags.empty.concat(E._flags.empty);const D=Object.assign({},E._flags);delete D.empty,f(T._flags,D)}else if(E._flags.empty){T._flags.empty=E._flags.empty;const D=Object.assign({},E._flags);delete D.empty,f(T._flags,D)}else f(T._flags,E._flags);for(const D in E.$_terms){const M=E.$_terms[D];M?T.$_terms[D]?T.$_terms[D]=T.$_terms[D].concat(M):T.$_terms[D]=M.slice():T.$_terms[D]||(T.$_terms[D]=M)}return this.$_root._tracer&&this.$_root._tracer._combine(T,[this,E]),T.$_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,T){o(!this._inRuleset(),"Cannot fork inside a ruleset");let D=this;for(let M of[].concat(E))M=Array.isArray(M)?M:M.split("."),D=D._ids.fork(M,T,D);return D.$_temp.ruleset=!1,D}rule(E){const T=this._definition;d.assertOptions(E,Object.keys(T.modifiers)),o(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const D=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;o(D>=0&&D<this._rules.length,"Cannot apply rules to empty ruleset");const M=this.clone();for(let L=D;L<M._rules.length;++L){const I=M._rules[L],F=c(I);for(const U in E)T.modifiers[U](F,E[U]),o(F.name===I.name,"Cannot change rule name");M._rules[L]=F,M._singleRules.get(F.name)===I&&M._singleRules.set(F.name,F)}return M.$_temp.ruleset=!1,M.$_mutateRebuild()}get ruleset(){o(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const E=this.clone();return E.$_temp.ruleset=E._rules.length,E}get $(){return this.ruleset}tailor(E){E=[].concat(E),o(!this._inRuleset(),"Cannot tailor inside a ruleset");let T=this;if(this.$_terms.alterations)for(const{target:D,adjuster:M}of this.$_terms.alterations)E.includes(D)&&(T=M(T),o(d.isSchema(T),"Alteration adjuster for",D,"failed to return a schema object"));return T=T.$_modify({each:D=>D.tailor(E),ref:!1}),T.$_temp.ruleset=!1,T.$_mutateRebuild()}tracer(){return x.location?x.location(this):this}validate(E,T){return A.entry(E,this,T)}validateAsync(E,T){return A.entryAsync(E,this,T)}$_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 T=Object.assign({},E);T._resolve=[],T.method=T.method||T.name;const D=this._definition.rules[T.method],M=T.args;o(D,"Unknown rule",T.method);const L=this.clone();if(M){o(Object.keys(M).length===1||Object.keys(M).length===this._definition.rules[T.name].args.length,"Invalid rule definition for",this.type,T.name);for(const I in M){let F=M[I];if(D.argsByName){const U=D.argsByName.get(I);if(U.ref&&d.isResolvable(F))T._resolve.push(I),L.$_mutateRegister(F);else if(U.normalize&&(F=U.normalize(F),M[I]=F),U.assert){const Y=d.validateArg(F,I,U);o(!Y,Y,"or reference")}}F!==void 0?M[I]=F:delete M[I]}}return D.multi||(L._ruleRemove(T.name,{clone:!1}),L._singleRules.set(T.name,T)),L.$_temp.ruleset===!1&&(L.$_temp.ruleset=null),D.priority?L._rules.unshift(T):L._rules.push(T),L}$_compile(E,T){return m.schema(this.$_root,E,T)}$_createError(E,T,D,M,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,T,D,F,U,M,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,T,D,M){(D=Object.assign({},D)).abortEarly=!0,D._externals=!1,T.snapshot();const L=!A.validate(E,this,T,D,M).errors;return T.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:T,name:D,path:M,key:L})=>{const I=this._definition[T][D]&&this._definition[T][D].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:T,key:D}={}){this._refs.register(E,T),this._ids.register(E,{key:D})}$_property(E){return this._definition.properties[E]}$_reach(E){return this._ids.reach(E)}$_rootReferences(){return this._refs.roots()}$_setFlag(E,T,D={}){o(E[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const M=this._definition.flags[E]||{};if(u(T,M.default)&&(T=void 0),u(T,this._flags[E]))return this;const L=D.clone!==!1?this.clone():this;return T!==void 0?(L._flags[E]=T,L.$_mutateRegister(T)):delete L._flags[E],E[0]!=="_"&&(L.$_temp.ruleset=!1),L}$_parent(E,...T){return this[E][d.symbols.parent].call(this,...T)}$_validate(E,T,D){return A.validate(E,this,T,D)}_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 T in this.$_terms)E.$_terms[T]=this.$_terms[T]?this.$_terms[T].slice():null;E.$_super={};for(const T in this.$_super)E.$_super[T]=this._super[T].bind(E);return E}_bare(){const E=this.clone();E._reset();const T=E._definition.terms;for(const D in T){const M=T[D];E.$_terms[D]=M.init}return E.$_mutateRebuild()}_default(E,T,D={}){return d.assertOptions(D,"literal"),o(T!==void 0,"Missing",E,"value"),o(typeof T=="function"||!D.literal,"Only function value supports literal option"),typeof T=="function"&&D.literal&&(T={[d.symbols.literal]:!0,literal:T}),this.$_setFlag(E,T)}_generate(E,T,D){if(!this.$_terms.whens)return{schema:this};const M=[],L=[];for(let U=0;U<this.$_terms.whens.length;++U){const Y=this.$_terms.whens[U];if(Y.concat){M.push(Y.concat),L.push(`${U}.concat`);continue}const W=Y.ref?Y.ref.resolve(E,T,D):E,H=Y.is?[Y]:Y.switch,ee=L.length;for(let re=0;re<H.length;++re){const{is:X,then:G,otherwise:K}=H[re],J=`${U}${Y.switch?"."+re:""}`;if(X.$_match(W,T.nest(X,`${J}.is`),D)){if(G){const ue=T.localize([...T.path,`${J}.then`],T.ancestors,T.schemas),{schema:de,id:ie}=G._generate(E,ue,D);M.push(de),L.push(`${J}.then${ie?`(${ie})`:""}`);break}}else if(K){const ue=T.localize([...T.path,`${J}.otherwise`],T.ancestors,T.schemas),{schema:de,id:ie}=K._generate(E,ue,D);M.push(de),L.push(`${J}.otherwise${ie?`(${ie})`:""}`);break}}if(Y.break&&L.length>ee)break}const I=L.join(", ");if(T.mainstay.tracer.debug(T,"rule","when",I),!I)return{schema:this};if(!T.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,T,D));for(const U of M)F=F.concat(U);return this.$_root._tracer&&this.$_root._tracer._combine(F,[this,...M]),this.$_temp.whens[I]=F,{schema:F,id:I}}_inner(E,T,D={}){o(!this._inRuleset(),`Cannot set ${E} inside a ruleset`);const M=this.clone();return M.$_terms[E]&&!D.override||(M.$_terms[E]=[]),D.single?M.$_terms[E].push(T):M.$_terms[E].push(...T),M.$_temp.ruleset=!1,M}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(E,T={}){if(!this._singleRules.has(E))return this;const D=T.clone!==!1?this.clone():this;D._singleRules.delete(E);const M=[];for(let L=0;L<D._rules.length;++L){const I=D._rules[L];I.name!==E||I.keep?M.push(I):D._inRuleset()&&L<D.$_temp.ruleset&&--D.$_temp.ruleset}return D._rules=M,D}_values(E,T){d.verifyFlat(E,T.slice(1,-1));const D=this.clone(),M=E[0]===d.symbols.override;if(M&&(E=E.slice(1)),!D[T]&&E.length?D[T]=new k:M&&(D[T]=E.length?new k:null,D.$_mutateRebuild()),!D[T])return D;M&&D[T].override();for(const L of E){o(L!==void 0,"Cannot call allow/valid/invalid with undefined"),o(L!==d.symbols.override,"Override must be the first value");const I=T==="_invalids"?"_valids":"_invalids";D[I]&&(D[I].remove(L),D[I].length||(o(T==="_valids"||!D._flags.only,"Setting invalid value",L,"leaves schema rejecting all values due to previous valid rule"),D[I]=null)),D[T].add(L,D._refs)}return D}}};R.Base.prototype[d.symbols.any]={version:d.version,compile:m.compile,root:"$_root"},R.Base.prototype.isImmutable=!0,R.Base.prototype.deny=R.Base.prototype.invalid,R.Base.prototype.disallow=R.Base.prototype.invalid,R.Base.prototype.equal=R.Base.prototype.valid,R.Base.prototype.exist=R.Base.prototype.required,R.Base.prototype.not=R.Base.prototype.invalid,R.Base.prototype.options=R.Base.prototype.prefs,R.Base.prototype.preferences=R.Base.prototype.prefs,s.exports=new R.Base},8652:(s,i,a)=>{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<p;case">=":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<m.switch.length;++h){const y=m.switch[h],g=h===m.switch.length-1;c.assertOptions(y,g?["is","then","otherwise"]:["is","then"]),o(y.is!==void 0,'Switch statement missing "is"'),o(y.then!==void 0,'Switch statement missing "then"');const v={is:l.$_compile(y.is),then:l.$_compile(y.then)};if(u.isRef(y.is)||c.isSchema(y.is)||(v.is=v.is.required()),g){o(m.otherwise===void 0||y.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');const w=m.otherwise!==void 0?m.otherwise:y.otherwise;w!==void 0&&(o(p.break===void 0,"Cannot specify both otherwise and break"),v.otherwise=l.$_compile(w))}p.switch.push(v)}return p},f.condition=function(l,d){for(const m of["then","otherwise"])d[m]===void 0?delete d[m]:d[m]=l.$_compile(d[m]);return d}},6354:(s,i,a)=>{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 T=E.method;if(T===void 0&&(T=function(){return this.$_addRule(R)}),T&&(o(!h[R],"Rule conflict in",g.type,R),h[R]=T),o(!x[R],"Rule conflict in",g.type,R),x[R]=E,E.alias){const D=[].concat(E.alias);for(const M of D)h[M]=E.method}E.args&&(E.argsByName=new Map,E.args=E.args.map(D=>(typeof D=="string"&&(D={name:D}),o(!E.argsByName.has(D.name),"Duplicated argument name",D.name),u.isSchema(D.assert)&&(D.assert=D.assert.strict().label(D.name)),E.argsByName.set(D.name,D),D)))}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 T=function(D){return this.rule({[R]:D})};h[R]=T,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 k=Object.assign({},v.manifest,g.manifest);return k.build=l.build(g.manifest&&g.manifest.build,v.manifest&&v.manifest.build),g.manifest=k,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(...k){return o(!k.length||["alternatives","link","object"].includes(A),"The",A,"type does not allow arguments"),w.generate(this,w.types[A],k)};for(const A of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])x[A]=function(...k){return this.any()[A](...k)};Object.assign(x,w.methods);for(const A in w.aliases){const k=w.aliases[A];x[A]=x[k]}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,...k){w.assert(x,A,!0,k)},attempt:(x,A,...k)=>w.assert(x,A,!1,k),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 k of A._types){const R=x(A[k]());o(f.isSchema(R),"modifier must return a valid schema object"),A[k]=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 k of x){typeof k=="function"&&(k=k(A)),this.assert(k,v.extension);const R=w.expandExtension(k,A);for(const E of R){o(A[E.type]===void 0||A._types.has(E.type),"Cannot override name",E.type);const T=E.base||this.any(),D=m.type(T,E);A._types.add(E.type),A[E.type]=function(...M){return w.generate(this,D,M)}}}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,k,R){const E=R[0]instanceof Error||typeof R[0]=="string"?R[0]:null,T=E!==null?R[1]:R[0],D=A.validate(x,f.preferences({errors:{stack:!0}},T||{}));let M=D.error;if(!M)return D.value;if(E instanceof Error)throw E;const L=k&&typeof M.annotate=="function"?M.annotate():M.message;throw M instanceof d.ValidationError==0&&(M=c(M)),M.message=E?`${E} ${L}`:L,M},w.generate=function(x,A,k){return o(x,"Must be invoked on a Joi instance."),A.$_root=x,A._definition.args&&k.length?A._definition.args(A,...k):A},w.expandExtension=function(x,A){if(typeof x.type=="string")return[x];const k=[];for(const R of A._types)if(x.type.test(R)){const E=Object.assign({},x);E.type=R,E.base=A[R](),k.push(E)}return k},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<l._rules.length;++p){const h=l._rules[p],y=f.scan(h.args,{source:"rules",name:h.name},d);if(y!==void 0){m=m||l.clone();const g=Object.assign({},h);g.args=y,m._rules[p]=g,m._singleRules.get(h.name)===h&&m._singleRules.set(h.name,g)}}for(const p in l.$_terms){if(p[0]==="_")continue;const h=f.scan(l.$_terms[p],{source:"terms",name:p},d);h!==void 0&&(m=m||l.clone(),m.$_terms[p]=h)}return m},f.scan=function(l,d,m,p,h){const y=p||[];if(l===null||typeof l!="object")return;let g;if(Array.isArray(l)){for(let v=0;v<l.length;++v){const w=d.source==="terms"&&d.name==="keys"&&l[v].key,x=f.scan(l[v],d,m,[v,...y],w);x!==void 0&&(g=g||l.slice(),g[v]=x)}return g}if(m.schema!==!1&&c.isSchema(l)||m.ref!==!1&&u.isRef(l)){const v=m.each(l,{...d,path:y,key:h});return v===l?void 0:v}for(const v in l){if(v[0]==="_")continue;const w=f.scan(l[v],d,m,[v,...y],h);w!==void 0&&(g=g||Object.assign({},l),g[v]=w)}return g}},6133:(s,i,a)=>{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<l.length;++h){const y=l[h];let g=p.get(y);g||(g=new Map,p.set(y,g)),p=g}p[f.value]=d}get(l){const d=this.node(l);if(d)return d[f.value]}node(l){if(this._values)return c(this._values,l,{iterables:!0})}override(l,d){if(!this._values)return;const m=l.slice(0,-1),p=l[l.length-1],h=c(this._values,m,{iterables:!0});d?h.set(p,d):h&&h.delete(p)}}},3328:(s,i,a)=>{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]!=="{",k=A?"}":"}}",R=x.indexOf(k);if(R===-1||x[1]==="{"){v.push(`{${p.decode(x)}`);continue}let E=x.slice(A?0:1,R);const T=E[0]===":";T&&(E=E.slice(1));const D=this._ref(p.decode(E),{raw:A,wrapped:T});v.push(D),typeof D!="string"&&(g=!0);const M=x.slice(R+k.length);M&&v.push(p.decode(M))}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 k=this._part(A,h,y,g,v,w),R=p.stringify(k,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 k=m.create(A,this._settings);return v.push(k),R=>{const E=k.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<h.length;++v){const w=h[v];if(w==="{"){let x="";for(;v+1<h.length&&h[v+1]==="{";)x+="{",++v;y.push(g),g=x}else g+=w}return y.push(g),y},p.wrap=function(h,y){return y?y.length===1?`${y}${h}${y}`:`${y[0]}${h}${y[1]}`:h},p.stringify=function(h,y,g,v,w,x={}){const A=typeof h,k=v&&v.errors&&v.errors.wrap||{};let R=!1;if(m.isRef(h)&&h.render&&(R=h.in,h=h.resolve(y,g,v,w,{in:h.in,...x})),h===null)return"null";if(A==="string")return p.wrap(h,x.arrayItems&&k.string);if(A==="number"||A==="function"||A==="symbol")return h.toString();if(A!=="object")return JSON.stringify(h);if(h instanceof Date)return p.Template.date(h,v);if(h instanceof Map){const T=[];for(const[D,M]of h.entries())T.push(`${D.toString()} -> ${M.toString()}`);h=T}if(!Array.isArray(h))return h.toString();const E=[];for(const T of h)E.push(p.stringify(T,y,g,v,w,{arrayItems:!0,...x}));return p.wrap(E.join(", "),!R&&k.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 k=d.template(y,A[0],h,g,v)||d.template(y,A[1],h,g,v);return k?k.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 k=[],R=[];for(let T=0;T<g.$_terms.matches.length;++T){const D=g.$_terms.matches[T],M=w.nest(D.schema,`match.${T}`);M.snapshot();const L=D.schema.$_validate(h,M,x);L.errors?(R.push(L.errors),M.restore()):(k.push(L.value),M.commit())}if(k.length===0)return{errors:v("alternatives.any",{details:R.map(T=>d.details(T,{override:!1}))})};if(g._flags.match==="one")return k.length===1?{value:k[0]}:{errors:v("alternatives.one")};if(k.length!==g.$_terms.matches.length)return{errors:v("alternatives.all",{details:R.map(T=>d.details(T,{override:!1}))})};const E=T=>T.$_terms.matches.some(D=>D.schema.type==="object"||D.schema.type==="alternatives"&&E(D.schema));return E(g)?{value:k.reduce((T,D)=>c(T,D,{mergeArrays:!1}))}:{value:k[k.length-1]}}const A=[];for(let k=0;k<g.$_terms.matches.length;++k){const R=g.$_terms.matches[k];if(R.schema){const D=w.nest(R.schema,`match.${k}`);D.snapshot();const M=R.schema.$_validate(h,D,x);if(!M.errors)return D.commit(),M;D.restore(),A.push({schema:R.schema,reports:M.errors});continue}const E=R.ref?R.ref.resolve(h,w,x):h,T=R.is?[R]:R.switch;for(let D=0;D<T.length;++D){const M=T[D],{is:L,then:I,otherwise:F}=M,U=`match.${k}${R.switch?"."+D:""}`;if(L.$_match(E,w.nest(L,`${U}.is`),x)){if(I)return I.$_validate(h,w.nest(I,`${U}.then`),x)}else if(F)return F.$_validate(h,w.nest(F,`${U}.otherwise`),x)}}return p.errors(A,y)},rules:{conditional:{method(h,y){o(!this._flags._endedSwitch,"Unreachable condition"),o(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),o(y.break===void 0,"Cannot use break option with alternatives conditional");const g=this.clone(),v=l.when(g,h,y),w=v.is?[v]:v.switch;for(const x of w)if(x.then&&x.otherwise){g.$_setFlag("_endedSwitch",!0,{clone:!1});break}return g.$_terms.matches.push(v),g.$_mutateRebuild()}},match:{method(h){if(o(["any","one","all"].includes(h),"Invalid alternatives match mode",h),h!=="any")for(const y of this.$_terms.matches)o(y.schema,"Cannot combine match mode",h,"with conditional rules");return this.$_setFlag("match",h)}},try:{method(...h){o(h.length,"Missing alternative schemas"),f.verifyFlat(h,"try"),o(!this._flags._endedSwitch,"Unreachable condition");const y=this.clone();for(const g of h)y.$_terms.matches.push({schema:y.$_compile(g)});return y.$_mutateRebuild()}}},overrides:{label(h){return this.$_parent("label",h).$_modify({each:(y,g)=>g.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:k,otherwise:R}=g;h=v?h.try(v):w?h.conditional(w,{is:x,then:k,not:A,otherwise:R,switch:g.switch}):h.conditional(x,{then:k,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 k=x[0];if(k instanceof d.Report==0)return p.unmatched(h,y);if(k.state.path.length!==g.path.length){w.push({type:A.type,report:k});continue}if(k.code==="any.only"){for(const T of k.local.valids)v.add(T);continue}const[R,E]=k.code.split(".");E!=="base"?w.push({type:A.type,report:k}):k.code==="object.base"?v.add(k.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;A<p.length;++A){const k=h.localize([...h.path,A],w,v);if(v.$_match(p[A],k,y))return p}const x=v._flags.label;return x?g("array.hasKnown",{patternLabel:x}):g("array.hasUnknown",null)},multi:!0},items:{method(...p){l.verifyFlat(p,"items");const h=this.$_addRule("items");for(let y=0;y<p.length;++y){const g=l.tryWithPath(()=>this.$_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(),k=[...h.$_terms._inclusions,...x],R=!p[l.symbols.arraySingle];delete p[l.symbols.arraySingle];const E=w();let T=p.length;for(let D=0;D<T;++D){const M=p[D];let L=!1,I=!1;const F=R?D:new Number(D),U=[...g.path,F];if(!h._flags.sparse&&M===void 0){if(E.push(y("array.sparse",{key:F,path:U,pos:D,value:void 0},g.localize(U))),v.abortEarly)return E;A.shift();continue}const Y=[p,...g.ancestors];for(const re of h.$_terms._exclusions)if(re.$_match(M,g.localize(U,Y,re),v,{presence:"ignore"})){if(E.push(y("array.excludes",{pos:D,value:M},g.localize(U))),v.abortEarly)return E;L=!0,A.shift();break}if(L)continue;if(h.$_terms.ordered.length){if(A.length){const re=A.shift(),X=re.$_validate(M,g.localize(U,Y,re),v);if(X.errors){if(E.push(...X.errors),v.abortEarly)return E}else if(re._flags.result==="strip")m.fastSplice(p,D),--D,--T;else{if(!h._flags.sparse&&X.value===void 0){if(E.push(y("array.sparse",{key:F,path:U,pos:D,value:void 0},g.localize(U))),v.abortEarly)return E;continue}p[D]=X.value}continue}if(!h.$_terms.items.length){if(E.push(y("array.orderedLength",{pos:D,limit:h.$_terms.ordered.length})),v.abortEarly)return E;break}}const W=[];let H=x.length;for(let re=0;re<H;++re){const X=g.localize(U,Y,x[re]);X.snapshot();const G=x[re].$_validate(M,X,v);if(W[re]=G,!G.errors){if(X.commit(),p[D]=G.value,I=!0,m.fastSplice(x,re),--re,--H,!h._flags.sparse&&G.value===void 0&&(E.push(y("array.sparse",{key:F,path:U,pos:D,value:void 0},g.localize(U))),v.abortEarly))return E;break}X.restore()}if(I)continue;const ee=v.stripUnknown&&!!v.stripUnknown.arrays||!1;H=k.length;for(const re of k){let X;const G=x.indexOf(re);if(G!==-1)X=W[G];else{const K=g.localize(U,Y,re);if(K.snapshot(),X=re.$_validate(M,K,v),!X.errors){K.commit(),re._flags.result==="strip"?(m.fastSplice(p,D),--D,--T):h._flags.sparse||X.value!==void 0?p[D]=X.value:(E.push(y("array.sparse",{key:F,path:U,pos:D,value:void 0},g.localize(U))),L=!0),I=!0;break}K.restore()}if(H===1){if(ee){m.fastSplice(p,D),--D,--T,I=!0;break}if(E.push(...X.errors),v.abortEarly)return E;L=!0;break}}if(!L&&(h.$_terms._inclusions.length||h.$_terms._requireds.length)&&!I){if(ee){m.fastSplice(p,D),--D,--T;continue}if(E.push(y("array.includes",{pos:D,value:M},g.localize(U))),v.abortEarly)return E}}return x.length&&m.fillMissedErrors(h,E,x,p,g,v),A.length&&(m.fillOrderedErrors(h,E,A,p,g,v),E.length||m.fillDefault(A,p,g,v)),E.length?E:p},priority:!0,manifest:!1},length:{method(p){return this.$_addRule({name:"length",args:{limit:p},operator:"="})},validate:(p,h,{limit:y},{name:g,operator:v,args:w})=>l.compare(p.length,y,v)?p:h.error("array."+g,{limit:w.limit,value:p}),args:[{name:"limit",ref:!0,assert:l.limit,message:"must be a positive integer"}]},max:{method(p){return this.$_addRule({name:"max",method:"length",args:{limit:p},operator:"<="})}},min:{method(p){return this.$_addRule({name:"min",method:"length",args:{limit:p},operator:">="})}},ordered:{method(...p){l.verifyFlat(p,"ordered");const h=this.$_addRule("items");for(let y=0;y<p.length;++y){const g=l.tryWithPath(()=>this.$_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 k=0;k<p.length;++k)if(p[k]!==x[k])return h("array.sort",{order:w.order,by:w.by?w.by.key:"value"});return p},convert:!0},sparse:{method(p){const h=p===void 0||!!p;return this._flags.sparse===h?this:(h?this.clone():this.$_addRule("items")).$_setFlag("sparse",h,{clone:!1})}},unique:{method(p,h={}){o(!p||typeof p=="function"||typeof p=="string","comparator must be a function or a string"),l.assertOptions(h,["ignoreUndefined","separator"]);const y={name:"unique",args:{options:h,comparator:p}};if(p)if(typeof p=="string"){const g=l.default(h.separator,".");y.path=g?p.split(g):[p]}else y.comparator=p;return this.$_addRule(y)},validate(p,{state:h,error:y,schema:g},{comparator:v,options:w},{comparator:x,path:A}){const k={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),bigint:Object.create(null),object:new Map,function:new Map,custom:new Map},R=x||c,E=w.ignoreUndefined;for(let T=0;T<p.length;++T){const D=A?u(p[T],A):p[T],M=x?k.custom:k[typeof D];if(o(M,"Failed to find unique map container for type",typeof D),M instanceof Map){const L=M.entries();let I;for(;!(I=L.next()).done;)if(R(I.value[0],D)){const F=h.localize([...h.path,T],[p,...h.ancestors]),U={pos:T,value:p[T],dupePos:I.value[1],dupeValue:p[I.value[1]]};return A&&(U.path=v),y("array.unique",U,F)}M.set(D,T)}else{if((!E||D!==void 0)&&M[D]!==void 0){const L={pos:T,value:p[T],dupePos:M[D],dupeValue:p[M[D]]};return A&&(L.path=v),y("array.unique",L,h.localize([...h.path,T],[p,...h.ancestors]))}M[D]=T}}return p},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(p,h)=>new 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 k of y){const R=k._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],k=[h,...y.ancestors],R=A.$_validate(void 0,y.localize(y.path,k,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<p.length;)p[y++]=p[y];--p.length},m.validateSingle=function(p,h){(p.type==="array"||p._flags._arrayItems)&&(o(!h._flags.single,"Cannot specify array item with single rule enabled"),h.$_setFlag("_arrayItems",!0,{clone:!1}))},m.sort=function(p,h,y,g,v){const w=y.order==="ascending"?1:-1,x=-1*w,A=w,k=(R,E)=>{let T=m.compare(R,E,x,A);if(T!==null||(y.by&&(R=y.by.resolve(R,g,v),E=y.by.resolve(E,g,v)),T=m.compare(R,E,x,A),T!==null))return T;const D=typeof R;if(D!==typeof E)throw p.$_createError("array.sort.mismatching",h,null,g,v);if(D!=="number"&&D!=="string")throw p.$_createError("array.sort.unsupported",h,{type:D},g,v);return D==="number"?(R-E)*w:R<E?x:A};try{return{value:h.slice().sort(k)}}catch(R){return{errors:R}}},m.compare=function(p,h,y,g){return p===h?0:p===void 0?1:h===void 0?-1:p===null?g:h===null?y:null}},4937:(s,i,a)=>{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;p<d.length;++p){const h=d[p];o(h!==void 0,"Cannot call truthy with undefined"),m.$_terms.truthy.add(h)}return m}},falsy:{method(...d){u.verifyFlat(d,"falsy");const m=this.clone();m.$_terms.falsy=m.$_terms.falsy||new f;for(let p=0;p<d.length;++p){const h=d[p];o(h!==void 0,"Cannot call falsy with undefined"),m.$_terms.falsy.add(h)}return m}},sensitive:{method(d=!0){return this.$_setFlag("sensitive",d)}}},cast:{number:{from:l.isBool,to:(d,m)=>d?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:k}){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,k);const R=[];if(w.$_terms.renames&&!g.rename(w,v,A,k,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 T=[v,...A.ancestors];for(const D of w.$_terms.keys){const M=D.key,L=v[M];E.delete(M);const I=A.localize([...A.path,M],T,D),F=D.schema.$_validate(L,I,k);if(F.errors){if(k.abortEarly)return{value:v,errors:F.errors};F.value!==void 0&&(v[M]=F.value),R.push(...F.errors)}else D.schema._flags.result==="strip"||F.value===void 0&&L!==void 0?delete v[M]:F.value!==void 0&&(v[M]=F.value)}}if(E.size||w._flags._hasPatternMatch){const T=g.unknown(w,v,E,R,A,k);if(T)return T}if(w.$_terms.dependencies)for(const T of w.$_terms.dependencies){if(T.key!==null&&g.isPresent(T.options)(T.key.resolve(v,A,k,null,{shadow:!1}))===!1)continue;const D=g.dependencies[T.rel](w,T,v,A,k);if(D){const M=w.$_createError(D.code,v,D.context,A,k);if(k.abortEarly)return{value:v,errors:M};R.push(M)}}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:k,schema:R,message:E}){const T=k.resolve(v,A,x),D=h.isRef(k)?k.absolute(A):[];return R.$_match(T,A.localize(D,[v,...A.ancestors],R),x)?v:w("object.assert",{subject:k,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:k,args:R})=>d.compare(Object.keys(v).length,x,k)?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 k=this.clone();k.$_terms.patterns=k.$_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)),k.$_mutateRegister(R.matches),k.$_setFlag("_hasPatternMatch",!0,{clone:!1})),x.fallthrough&&(R.fallthrough=!0),k.$_terms.patterns.push(R),k.$_mutateRegister(w),k}},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 k of A.$_terms.renames)c(k.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:k,options:R}of w.dependencies)v=g.dependency(v,x,A,k,R);if(w.patterns)for(const{regex:x,schema:A,rule:k,fallthrough:R,matches:E}of w.patterns)v=v.pattern(x||A,k,{fallthrough:R,matches:E});if(w.renames)for(const{from:x,to:A,options:k}of w.renames)v=v.rename(x,A,k);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,k){c(x===null||typeof x=="string",w,"key must be a strings"),k||(k=A.length>1&&typeof A[A.length-1]=="object"?A.pop():{}),d.assertOptions(k,["separator","isPresent"]),A=[].concat(A);const R=d.default(k.separator,"."),E=[];for(const D of A)c(typeof D=="string",w,"peers must be strings"),E.push(m.ref(D,{separator:R,ancestor:0,prefix:!1}));x!==null&&(x=m.ref(x,{separator:R,ancestor:0,prefix:!1}));const T=v.clone();return T.$_terms.dependencies=T.$_terms.dependencies||[],T.$_terms.dependencies.push(new g.Dependency(w,x,E,A,k)),T},g.dependencies={and(v,w,x,A,k){const R=[],E=[],T=w.peers.length,D=g.isPresent(w.options);for(const M of w.peers)D(M.resolve(x,A,k,null,{shadow:!1}))===!1?R.push(M.key):E.push(M.key);if(R.length!==T&&E.length!==T)return{code:"object.and",context:{present:E,presentWithLabels:g.keysToLabels(v,E),missing:R,missingWithLabels:g.keysToLabels(v,R)}}},nand(v,w,x,A,k){const R=[],E=g.isPresent(w.options);for(const M of w.peers)E(M.resolve(x,A,k,null,{shadow:!1}))&&R.push(M.key);if(R.length!==w.peers.length)return;const T=w.paths[0],D=w.paths.slice(1);return{code:"object.nand",context:{main:T,mainWithLabel:g.keysToLabels(v,T),peers:D,peersWithLabels:g.keysToLabels(v,D)}}},or(v,w,x,A,k){const R=g.isPresent(w.options);for(const E of w.peers)if(R(E.resolve(x,A,k,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:w.paths,peersWithLabels:g.keysToLabels(v,w.paths)}}},oxor(v,w,x,A,k){const R=[],E=g.isPresent(w.options);for(const D of w.peers)E(D.resolve(x,A,k,null,{shadow:!1}))&&R.push(D.key);if(!R.length||R.length===1)return;const T={peers:w.paths,peersWithLabels:g.keysToLabels(v,w.paths)};return T.present=R,T.presentWithLabels=g.keysToLabels(v,R),{code:"object.oxor",context:T}},with(v,w,x,A,k){const R=g.isPresent(w.options);for(const E of w.peers)if(R(E.resolve(x,A,k,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,k){const R=g.isPresent(w.options);for(const E of w.peers)if(R(E.resolve(x,A,k,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,k){const R=[],E=g.isPresent(w.options);for(const D of w.peers)E(D.resolve(x,A,k,null,{shadow:!1}))&&R.push(D.key);if(R.length===1)return;const T={peers:w.paths,peersWithLabels:g.keysToLabels(v,w.paths)};return R.length===0?{code:"object.missing",context:T}:(T.present=R,T.presentWithLabels=g.keysToLabels(v,R),{code:"object.xor",context:T})}},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,k){const R={};for(const E of v.$_terms.renames){const T=[],D=typeof E.from!="string";if(D)for(const M in w){if(w[M]===void 0&&E.options.ignoreUndefined||M===E.to)continue;const L=E.from.exec(M);L&&T.push({from:M,to:E.to,match:L})}else!Object.prototype.hasOwnProperty.call(w,E.from)||w[E.from]===void 0&&E.options.ignoreUndefined||T.push(E);for(const M of T){const L=M.from;let I=M.to;if(I instanceof y&&(I=I.render(w,x,A,M.match)),L!==I){if(!E.options.multiple&&R[I]&&(k.push(v.$_createError("object.rename.multiple",w,{from:L,to:I,pattern:D},x,A)),A.abortEarly)||Object.prototype.hasOwnProperty.call(w,I)&&!E.options.override&&!R[I]&&(k.push(v.$_createError("object.rename.override",w,{from:L,to:I,pattern:D},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,k,R){if(v.$_terms.patterns){let E=!1;const T=v.$_terms.patterns.map(M=>{if(M.matches)return E=!0,[]}),D=[w,...k.ancestors];for(const M of x){const L=w[M],I=[...k.path,M];for(let F=0;F<v.$_terms.patterns.length;++F){const U=v.$_terms.patterns[F];if(U.regex){const H=U.regex.test(M);if(k.mainstay.tracer.debug(k,"rule",`pattern.${F}`,H?"pass":"error"),!H)continue}else if(!U.schema.$_match(M,k.nest(U.schema,`pattern.${F}`),R))continue;x.delete(M);const Y=k.localize(I,D,{schema:U.rule,key:M}),W=U.rule.$_validate(L,Y,R);if(W.errors){if(R.abortEarly)return{value:w,errors:W.errors};A.push(...W.errors)}if(U.matches&&T[F].push(M),w[M]=W.value,!U.fallthrough)break}}if(E)for(let M=0;M<T.length;++M){const L=T[M];if(!L)continue;const I=v.$_terms.patterns[M].matches,F=k.localize(k.path,D,I),U=I.$_validate(L,F,R);if(U.errors){const Y=p.details(U.errors,{override:!1});Y.matches=L;const W=v.$_createError("object.pattern.match",w,Y,k,R);if(R.abortEarly)return{value:w,errors:W};A.push(W)}}}if(x.size&&(v.$_terms.keys||v.$_terms.patterns)){if(R.stripUnknown&&v._flags.unknown===void 0||R.skipFunctions){const E=!(!R.stripUnknown||R.stripUnknown!==!0&&!R.stripUnknown.objects);for(const T of x)E?(delete w[T],x.delete(T)):typeof w[T]=="function"&&x.delete(T)}if(!d.default(v._flags.unknown,R.allowUnknown))for(const E of x){const T=k.localize([...k.path,E],[]),D=v.$_createError("object.unknown",w[E],{child:E},T,R,{flags:!1});if(R.abortEarly)return{value:w,errors:D};A.push(D)}}},g.Dependency=class{constructor(v,w,x,A,k){this.rel=v,this.key=w,this.peers=x,this.paths=A,this.options=k}describe(){const v={rel:this.rel,peers:this.paths};return this.key!==null&&(v.key=this.key.key),this.peers[0].separator!=="."&&(v.options={...v.options,separator:this.peers[0].separator}),this.options.isPresent&&(v.options={...v.options,isPresent:this.options.isPresent}),v}},g.Keys=class extends Array{concat(v){const w=this.slice(),x=new Map;for(let A=0;A<w.length;++A)x.set(w[A].key,A);for(const A of v){const k=A.key,R=x.get(k);R!==void 0?w[R]={key:k,schema:w[R].schema.concat(A.schema)}:w.push(A)}return w}}},8785:(s,i,a)=>{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||l<Number.MIN_SAFE_INTEGER)&&(h.errors=m("number.unsafe")),h},rules:{compare:{method:!1,validate:(l,d,{limit:m},{name:p,operator:h,args:y})=>u.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 k=v.$_getRule("case");k&&(g=k.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 T of v.$_terms.replacements)g=g.replace(T.pattern,T.replacement);const E=v.$_getRule("hex");if(E&&E.args.options.byteAligned&&g.length%2!=0&&(g=`0${g}`),v.$_getRule("isoDate")){const T=y.isoDate(g);T&&(g=T)}if(v._flags.truncate){const T=v.$_getRule("max");if(T){let D=T.args.limit;if(h.isResolvable(D)&&(D=D.resolve(g,w,x),!h.limit(D)))return{value:g,errors:v.$_createError("any.ref",D,{ref:T.args.limit,arg:"limit",reason:"must be a positive integer"},w,x)};g=g.slice(0,D)}}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 k=g.charAt(w)*A;x+=k-9*(k>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 k=w.multiple?g.split(x):[g],R=[];for(const E of k)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 k=new Set;for(let R=0;R<A.length;++R){const E=A[R];o(typeof E=="string","version at position "+R+" must be a string");const T=y.guidVersions[E.toLowerCase()];o(T,"version at position "+R+" must be one of "+Object.keys(y.guidVersions).join(", ")),o(!k.has(T),"version at position "+R+" must not be a duplicate"),v+=T,k.add(T)}}o(y.guidSeparators.has(g.separator),'separator must be one of true, false, "-", or ":"');const w=g.separator===void 0?"[:-]?":g.separator===!0?"[:-]":g.separator===!1?"[]?":`\\${g.separator}`,x=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${w})[0-9A-F]{4}\\2?[${v||"0-9A-F"}][0-9A-F]{3}\\2?[${v?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:g},regex:x})},validate(g,v,w,{regex:x}){const A=x.exec(g);return A?y.guidBrackets[A[1]]!==A[A.length-1]?v.error("string.guid"):g:v.error("string.guid")}},hex:{method(g={}){return h.assertOptions(g,["byteAligned","prefix"]),g={byteAligned:!1,prefix:!1,...g},o(typeof g.byteAligned=="boolean","byteAligned must be boolean"),o(typeof g.prefix=="boolean"||g.prefix==="optional",'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:g}})},validate:(g,v,{options:w})=>(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:k,args:R}){const E=!x&&g.length;return h.compare(E,w,k)?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:k}){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:k,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 k=w.value;const R=[];for(const E of x.externals){const T=E.state.path,D=E.schema.type==="link"?x.links.get(E.schema):null;let M,L,I=k;const F=T.length?[k]:[],U=T.length?f(h,T):h;if(T.length){M=T[T.length-1];let Y=k;for(const W of T.slice(0,-1))Y=Y[W],F.unshift(Y);L=F[0],I=L[M]}try{const Y=(H,ee)=>(D||E.schema).$_createError(H,I,ee,E.state,v),W=await E.method(I,{schema:E.schema,linked:D,state:E.state,prefs:g,original:U,error:Y,errorsArray:p.errorsArray,warn:(H,ee)=>x.warnings.push((D||E.schema).$_createError(H,I,ee,E.state,v)),message:(H,ee)=>(D||E.schema).$_createError("external",I,ee,E.state,v,{messages:H})});if(W===void 0||W===I)continue;if(W instanceof d.Report){if(x.tracer.log(E.schema,E.state,"rule","external","error"),R.push(W),v.abortEarly)break;continue}if(Array.isArray(W)&&W[l.symbols.errors]){if(x.tracer.log(E.schema,E.state,"rule","external","error"),R.push(...W),v.abortEarly)break;continue}L?(x.tracer.value(E.state,"rule",I,W,"external"),L[M]=W):(x.tracer.value(E.state,"rule",k,W,"external"),k=W)}catch(Y){throw v.errors.label&&(Y.message+=` (${E.label})`),Y}}if(w.value=k,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,k=new p.Mainstay(v,x,A),R=y._ids._schemaChain?[{schema:y}]:null,E=new m([],[],{mainstay:k,schemas:R}),T=i.validate(h,y,E,g);w&&y.$_root.untrace();const D=d.process(T.errors,h,g);return{value:T.value,error:D,mainstay:k}},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 D=y._cache.get(h);if(g.mainstay.tracer.debug(g,"validate","cached",!!D),D)return D}const x=(D,M,L)=>y.$_createError(D,h,M,L||g,v),A={original:h,prefs:v,schema:y,state:g,error:x,errorsArray:p.errorsArray,warn:(D,M,L)=>g.mainstay.warnings.push(x(D,M,L)),message:(D,M)=>y.$_createError("custom",h,M,g,v,{messages:D})};g.mainstay.tracer.entry(y,g);const k=y._definition;if(k.prepare&&h!==void 0&&v.convert){const D=k.prepare(h,A);if(D){if(g.mainstay.tracer.value(g,"prepare",h,D.value),D.errors)return p.finalize(D.value,[].concat(D.errors),A);h=D.value}}if(k.coerce&&h!==void 0&&v.convert&&(!k.coerce.from||k.coerce.from.includes(typeof h))){const D=k.coerce.method(h,A);if(D){if(g.mainstay.tracer.value(g,"coerced",h,D.value),D.errors)return p.finalize(D.value,[].concat(D.errors),A);h=D.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 T=[];if(y._valids){const D=y._valids.get(h,g,v,y._flags.insensitive);if(D)return v.convert&&(g.mainstay.tracer.value(g,"valids",h,D.value),h=D.value),g.mainstay.tracer.filter(y,g,"valid",D),p.finalize(h,null,A);if(y._flags.only){const M=y.$_createError("any.only",h,{valids:y._valids.values({display:!0})},g,v);if(v.abortEarly)return p.finalize(h,[M],A);T.push(M)}}if(y._invalids){const D=y._invalids.get(h,g,v,y._flags.insensitive);if(D){g.mainstay.tracer.filter(y,g,"invalid",D);const M=y.$_createError("any.invalid",h,{invalids:y._invalids.values({display:!0})},g,v);if(v.abortEarly)return p.finalize(h,[M],A);T.push(M)}}if(k.validate){const D=k.validate(h,A);if(D&&(g.mainstay.tracer.value(g,"base",h,D.value),h=D.value,D.errors)){if(!Array.isArray(D.errors))return T.push(D.errors),p.finalize(h,T,A);if(D.errors.length)return T.push(...D.errors),p.finalize(h,T,A)}}return y._rules.length?p.rules(h,T,A):p.finalize(h,T,A)},p.rules=function(h,y,g){const{schema:v,state:w,prefs:x}=g;for(const A of v._rules){const k=v._definition.rules[A.method];if(k.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 D of A._resolve){const M=k.argsByName.get(D),L=E[D].resolve(h,w,x),I=M.normalize?M.normalize(L):L,F=l.validateArg(I,null,M);if(F){R=v.$_createError("any.ref",L,{arg:D,ref:E[D],reason:F},w,x);break}E[D]=I}}R=R||k.validate(h,g,E,A);const T=p.rule(R,A);if(T.errors){if(w.mainstay.tracer.log(v,w,"rule",A.name,"error"),A.warn){w.mainstay.warnings.push(...T.errors);continue}if(x.abortEarly)return p.finalize(h,T.errors,g);y.push(...T.errors)}else w.mainstay.tracer.log(v,w,"rule",A.name,"pass"),w.mainstay.tracer.value(w,"rule",h,T.value,A.name),h=T.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 k=p.default("failover",void 0,y,g);k!==void 0&&(w.mainstay.tracer.value(w,"failover",h,k),h=k,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 k of y)o(k instanceof Error||k instanceof d.Report,"error() must return an Error object")}else y=[v._flags.error];if(h===void 0){const k=p.default("default",h,y,g);w.mainstay.tracer.value(w,"default",h,k),h=k}if(v._flags.cast&&h!==void 0){const k=v._definition.cast[v._flags.cast];if(k.from(h)){const R=k.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:k}of v.$_terms.externals)w.mainstay.externals.push({method:k,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,k=w._flags[h];if(A.noDefaults||k===void 0)return y;if(x.mainstay.tracer.log(w,x,"rule",h,"full"),!k)return k;if(typeof k=="function"){const R=k.length?[c(x.ancestors[0]),v]:[];try{return k(...R)}catch(E){return void g.push(w.$_createError(`any.${h}`,null,{error:E},x,A))}}return typeof k!="object"?k:k[l.symbols.literal]?k.literal:l.isResolvable(k)?k.resolve(y,x,A):c(k)},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<p.length-1;++g){const v=p[g];typeof y[v]!="object"&&(y[v]={}),y=y[v]}y[p[p.length-1]]=h}},375:(s,i,a)=>{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<f.length;++R)if(!p(f[R],l[R],d,m))return!1;return!0}for(const R of f)for(const E of l)if(p(R,E,d,m))return!0}else if(u===o.set){if(f.size!==l.size)return!1;if(!c.isSetSimpleEqual(f,l)){const R=new Set(Set.prototype.values.call(l));for(const E of Set.prototype.values.call(f)){if(R.delete(E))continue;let T=!1;for(const D of R)if(p(E,D,d,m)){R.delete(D),T=!0;break}if(!T)return!1}}}else if(u===o.map){if(f.size!==l.size)return!1;for(const[R,E]of Map.prototype.entries.call(f))if(E===void 0&&!Map.prototype.has.call(l,R)||!p(E,Map.prototype.get.call(l,R),d,m))return!1}else if(u===o.error&&(f.name!==l.name||f.message!==l.message))return!1;const w=h(f),x=h(l);if((f!==w||l!==x)&&!p(w,x,d,m))return!1;const A=g(f);if(!d.part&&A.length!==g(l).length&&!d.skip)return!1;let k=0;for(const R of A)if(d.skip&&d.skip.includes(R))l[R]===void 0&&++k;else if(!y(l,R)||!p(f[R],l[R],d,m))return!1;if(!d.part&&A.length-k!==g(l).length)return!1;if(d.symbols!==!1){const R=v(f),E=new Set(v(l));for(const T of R){if(!d.skip||!d.skip.includes(T)){if(y(f,T)){if(!y(l,T)||!p(f[T],l[T],d,m))return!1}else if(y(l,T))return!1}E.delete(T)}for(const T of E)if(y(l,T))return!1}return!0},c.SeenEntry=class{constructor(u,f){this.obj=u,this.ref=f}isSame(u,f){return this.obj===u&&this.ref===f}}},7916:(s,i,a)=>{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<a.length;++c){const u=a.charCodeAt(c);i.isSafe(u)?o+=a[c]:o+=i.escapeHtmlChar(u)}return o},i.escapeHtmlChar=function(a){return i.namedHtml.get(a)||(a>=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<d.length;++h)l.push(c(d[h],{symbols:m.symbols}));return l}const p=u.keys(d,m);for(let h=0;h<p.length;++h){const y=p[h];if(y==="__proto__"||!Object.prototype.propertyIsEnumerable.call(d,y))continue;const g=d[y];if(g&&typeof g=="object"){if(l[y]===g)continue;!l[y]||typeof l[y]!="object"||Array.isArray(l[y])!==Array.isArray(g)||g instanceof Date||g instanceof RegExp?l[y]=c(g,{symbols:m.symbols}):f.merge(l[y],g,m)}else(g!=null||m.nullOverride)&&(l[y]=g)}return l}},9621:(s,i,a)=>{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<m.length;++h){let y=m[h];const g=l.iterables&&c.iterables(p);if(Array.isArray(p)||g==="set"){const v=Number(y);Number.isInteger(v)&&(y=v<0?p.length+v:v)}if(!p||typeof p=="function"&&l.functions===!1||!g&&p[y]===void 0){o(!l.strict||h+1===m.length,"Missing segment",y,"in reach path ",f),o(typeof p=="object"||l.functions===!0||typeof p!="function","Invalid segment",y,"in reach path ",f),p=l.default;break}p=g?g==="set"?[...p][y]:p.get(y):p[y]}return p},c.iterables=function(u){return u instanceof Set?"set":u instanceof Map?"map":void 0}},8761:s=>{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;l<this._items.length;++l)this._items[l].seq=l;const f=this._sort();return o(f,"merge created a dependencies error"),this.nodes}sort(){const u=this._sort();return o(u,"sort created a dependencies error"),this.nodes}_sort(){const u={},f=Object.create(null),l=Object.create(null);for(const y of this._items){const g=y.seq,v=y.group;l[v]=l[v]||[],l[v].push(g),u[g]=y.before;for(const w of y.after)f[w]=f[w]||[],f[w].push(g)}for(const y in u){const g=[];for(const v in u[y]){const w=u[y][v];l[w]=l[w]||[],g.push(...l[w])}u[y]=g}for(const y in f)if(l[y])for(const g of l[y])u[g].push(...f[y]);const d={};for(const y in u){const g=u[y];for(const v of g)d[v]=d[v]||[],d[v].push(y)}const m={},p=[];for(let y=0;y<this._items.length;++y){let g=y;if(d[y]){g=null;for(let v=0;v<this._items.length;++v){if(m[v]===!0)continue;d[v]||(d[v]=[]);const w=d[v].length;let x=0;for(let A=0;A<w;++A)m[d[v][A]]&&++x;if(x===w){g=v;break}}}g!==null&&(m[g]=!0,p.push(g))}if(p.length!==this._items.length)return!1;const h={};for(const y of this._items)h[y.seq]=y;this._items=[],this.nodes=[];for(const y of p){const g=h[y];this.nodes.push(g.node),this._items.push(g)}return!0}},c.mergeSort=(u,f)=>u.sort===f.sort?0:u.sort<f.sort?-1:1},5380:(s,i,a)=>{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.length<d)return c.code("DOMAIN_SEGMENTS_COUNT");if(l.maxDomainSegments&&m.length>l.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;h<m.length;++h){const y=m[h];if(!y.length)return c.code("DOMAIN_EMPTY_SEGMENT");if(y.length>63)return c.code("DOMAIN_LONG_SEGMENT");if(h<m.length-1){if(!u.domainSegmentRx.test(y))return c.code("DOMAIN_INVALID_CHARS")}else if(!u.tldSegmentRx.test(y))return c.code("DOMAIN_INVALID_TLDS_CHARS")}return null},i.isValid=function(f,l){return!i.analyze(f,l)},u.punycode=function(f){f.includes("%")&&(f=f.replace(/%/g,"%25"));try{return new u.URL(`http://${f}`).host}catch{return f}}},1745:(s,i,a)=>{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<l.length;++p)o(typeof l[p]=="string","options.version must only contain strings"),l[p]=l[p].toLowerCase(),o(["ipv4","ipv6","ipvfuture"].includes(l[p]),"options.version contains unknown version "+l[p]+" - must be one of ipv4, ipv6, ipvfuture");l=Array.from(new Set(l));const d=`(?:${l.map(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,k="::(?:"+w+":){5}"+x,R="(?:"+w+")?::(?:"+w+":){4}"+x,E="(?:(?:"+w+":){0,1}"+w+")?::(?:"+w+":){3}"+x,T="(?:(?:"+w+":){0,2}"+w+")?::(?:"+w+":){2}"+x,D="(?:(?:"+w+":){0,3}"+w+")?::"+w+":"+x,M="(?:(?:"+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+"|"+k+"|"+R+"|"+E+"|"+T+"|"+D+"|"+M+"|"+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+")",W="(?:"+F+"@)?"+Y+"(?::\\d*)?",H="(?:"+F+"@)?("+Y+")(?::\\d*)?",ee=g+"*",re=g+"+",X="(?:\\/"+ee+")*",G="\\/(?:"+re+X+")?",K=re+X,J="["+m+h+p+"@]+"+X,ue="(?:\\/\\/\\/"+ee+X+")";return f.hierPart="(?:(?:\\/\\/"+W+X+")|"+G+"|"+K+"|"+ue+")",f.hierPartCapture="(?:(?:\\/\\/"+H+X+")|"+G+"|"+K+")",f.relativeRef="(?:(?:\\/\\/"+W+X+")|"+G+"|"+J+"|)",f.relativeRefCapture="(?:(?:\\/\\/"+H+X+")|"+G+"|"+J+"|)",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<g.length;++w){const x=g[w];o(x instanceof RegExp||typeof x=="string","scheme at position "+w+" must be a RegExp or String"),x instanceof RegExp?v.push(x.source.toString()):(o(l.schemeRegex.test(x),"scheme at position "+w+" must be a valid scheme"),v.push(c(x)))}p=v.join("|")}const h="(?:"+(p?"(?:"+p+")":l.scheme)+":"+(f.domain?l.hierPartCapture:l.hierPart)+")",y=f.allowRelative?"(?:"+h+"|"+m+")":h;return u.wrap(y+d,p)},u.wrap=function(f,l){return{raw:f=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${f}`,regex:new RegExp(`^${f}$`),scheme:l}},u.uriRegex=u.createRegex({}),i.regex=function(f={}){return f.scheme||f.allowRelative||f.relativeOnly||f.allowQuerySquareBrackets||f.domain?u.createRegex(f):u.uriRegex}},1447:(s,i)=>{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;h<o.length;++h){const y=o[h];m?(l+=y,y===m&&(m=!1)):y in a.literals&&!d?(l+=y,m=a.literals[y]):y!==","||d?(l+=y,y==="("?++d:y===")"&&--d):p()}p()}return f=f.map(l=>new 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<c.length-1;)if(u.includes(c[f])){const l=c[f],d=a.evaluate(c[f-1],o),m=a.evaluate(c[f+1],o);c.splice(f,2);const p=a.calculate(l,d,m);c[f-1]=p===0?0:p}else f+=2}),a.evaluate(c[0],o)}},i.Parser.prototype[a.symbol]=!0,a.reference=function(o){return function(c){return c&&c[o]!==void 0?c[o]:null}},a.evaluate=function(o,c){return o===null?null:typeof o=="function"?o(c):o[a.symbol]?o.evaluate(c):o},a.single=function(o,c){if(o==="!")return!c;const u=-c;return u===0?0:u},a.calculate=function(o,c,u){if(o==="??")return a.exists(c)?c:u;if(typeof c=="string"||typeof u=="string"){if(o==="+")return(c=a.exists(c)?c:"")+(a.exists(u)?u:"")}else switch(o){case"^":return Math.pow(c,u);case"*":return c*u;case"/":return c/u;case"%":return c%u;case"+":return c+u;case"-":return c-u}switch(o){case"<":return c<u;case"<=":return c<=u;case">":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})})(kQ);var MLe=kQ.exports;const dr=Od(MLe);class Ca{constructor(e){He(this,"_object");He(this,"_error");He(this,"isSuccess");He(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 Ca({isSuccess:!0,object:e})}static fail(e){return new Ca({isSuccess:!1,error:e})}static combine(e){for(const n of e)if(n.isFailure)return n;return Ca.ok()}}class nc{static validate(e,n,r={}){if(!dr.isSchema(e))throw new OLe("Rule provided is not a valid Joi schema!");const s={abortEarly:!1,errors:{wrap:{label:"{}"}},...r},i=e.validate(n,s);return i.error?Ca.fail(i.error):Ca.ok(i.value)}static validateFnc(e){return(n,r)=>{const s=e(n);return s.isSuccess?n:r.message({custom:s.error.message})}}}He(nc,"RULE_NOT_NULL_OR_UNDEFINED",dr.any().required().invalid(null)),He(nc,"RULE_ALLOW_NULL_OR_UNDEFINED",dr.any().optional().valid(null)),He(nc,"RULE_ALLOW_NULL",dr.any().valid(null)),He(nc,"RULE_ALLOW_EMPTY",dr.any().optional().valid(null,"")),He(nc,"RULE_IS_TYPE_STRING",dr.string()),He(nc,"RULE_IS_TYPE_NUMBER",dr.number());class OLe extends Error{}class N$ extends Error{constructor(n,r,s={}){super(r);He(this,"code");He(this,"payload",{});this.name=this.constructor.name,this.code=n,this.payload=s,Object.setPrototypeOf(this,N$.prototype)}}const J1=class J1 extends N${static create(e,n,r){return new J1(e,n,r)}};He(J1,"INVALID_INPUT_DATA","INVALID_INPUT_DATA");let ow=J1;function DQ(t,e="",n){return ow.create(t,e,n)}var NQ={};(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;c<i.length;c++){var u=i[c];if(!e.call(r,u)||!o(n[u],r[u]))return!1}return!0}})(NQ);class MQ{constructor(e){He(this,"props");this.props=typeof e=="object"?Object.freeze(e):e}get value(){return this.props}equals(e){return e==null||e.props===void 0?!1:NQ.shallowEqual(this.props,e.props)}}class p5e extends dr.ValidationError{}class m5e extends dr.ValidationError{}class LLe extends MQ{constructor(){super(...arguments);He(this,"isNull",()=>this.props===null)}}class g5e extends dr.ValidationError{}class v5e extends dr.ValidationError{}class y5e extends dr.ValidationError{}class b5e extends dr.ValidationError{}class w5e extends dr.ValidationError{}const JT={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"},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"}},Tu=class Tu extends LLe{constructor(){super(...arguments);He(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=dr.alternatives(nc.RULE_ALLOW_EMPTY.default(""),dr.string().uppercase().valid(...Object.keys(JT)).label(String(r.label)));return nc.validate(s,n)}static createFromCode(n,r={}){const s={...r,label:r.label?r.label:"current_code"},i=Tu.validate(n,s);return i.isFailure?Ca.fail(DQ(ow.INVALID_INPUT_DATA,i.error.message,s)):Ca.ok(new Tu(JT[i.object]))}static createDefaultCode(){return Tu.createFromCode(Tu.DEFAULT_CURRENCY_CODE)}isEmpty(){return this.isNull()||this.props===void 0}toPrimitive(){return this.toString()}};He(Tu,"DEFAULT_CURRENCY_CODE","EUR"),He(Tu,"CURRENCIES",JT);let N1=Tu;class _5e extends dr.ValidationError{}var ILe={defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},$Le={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 yb(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?yb=function(e){return typeof e}:yb=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yb(t)}function C4(t){return FLe(t)||jLe(t)||zLe(t)||BLe()}function FLe(t){if(Array.isArray(t))return t}function jLe(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function zLe(t,e){if(t){if(typeof t=="string")return A4(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 A4(t,e)}}function A4(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function BLe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ULe={normalizePrecision:function(e){var n=e.reduce(function(r,s){return Math.max(r.getPrecision(),s.getPrecision())});return e.map(function(r){return r.getPrecision()!==n?r.convertPrecision(n):r})},minimum:function(e){var n=C4(e),r=n[0],s=n.slice(1),i=r;return s.forEach(function(a){i=i.lessThan(a)?i:a}),i},maximum:function(e){var n=C4(e),r=n[0],s=n.slice(1),i=r;return s.forEach(function(a){i=i.greaterThan(a)?i:a}),i}};function OQ(t){return!isNaN(parseInt(t))&&isFinite(t)}function HLe(t){return OQ(t)&&t<=100&&t>=0}function WLe(t){return t.length>0&&t.every(function(e){return e>=0})&&t.some(function(e){return e>0})}function R4(t){return t%2===0}function P4(t){return OQ(t)&&!Number.isInteger(t)}function VLe(){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 Ry(t){return Math.abs(t)%1===.5}function qLe(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),GLe(s,e.headers),s.send()})}function GLe(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 Hy(t){return typeof t>"u"}function LQ(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",n={};return Object.entries(t).forEach(function(r){if(yb(r[1])==="object"){var s=LQ(r[1]);Object.entries(s).forEach(function(i){n[r[0]+e+i[0]]=i[1]})}else n[r[0]]=r[1]}),n}function KLe(t){return!!t&&(yb(t)==="object"||typeof t=="function")&&typeof t.then=="function"}function IQ(){var t=function(r,s){var i=function(c){return Math.pow(10,VLe(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 Ry(r)&&R4(s)?s-1:s},HALF_EVEN:function(r){var s=Math.round(r);return Ry(r)?R4(s)?s:s-1:s},HALF_UP:function(r){return Math.round(r)},HALF_DOWN:function(r){return Ry(r)?Math.floor(r):Math.round(r)},HALF_TOWARDS_ZERO:function(r){return Ry(r)?Math.sign(r)*Math.floor(Math.abs(r)):Math.round(r)},HALF_AWAY_FROM_ZERO:function(r){return Ry(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 P4(r)||P4(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 YLe=IQ();function XLe(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!Hy(r)}):[]},getMinimumFractionDigits:function(){var r=function(i){return i==="."};return Hy(this.getMatches().find(r))?0:this.getMatches()[YLe.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 Hy(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!Hy(this.getMatches().find(function(r){return r===","}))}}}function QLe(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 qLe(e(t.endpoint,{from:s,to:i}),{headers:t.headers})};return{getExchangeRate:function(s,i){return(KLe(t.endpoint)?t.endpoint:n(s,i)).then(function(a){return LQ(a)[e(t.propertyPath,{from:s,to:i})]})}}}function aw(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!t)throw new n(e)}function JLe(t){aw(HLe(t),"You must provide a numeric value between 0 and 100.",RangeError)}function ZLe(t){aw(WLe(t),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function ZT(t){aw(Number.isInteger(t),"You must provide an integer.",TypeError)}var jn=IQ(),eIe=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;ZT(r),ZT(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){aw(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;ZT(p);var y=this.getPrecision(),g=p>y,v=g?jn.multiply:jn.divide,w=g?[p,y]:[y,p],x=Math.pow(10,jn.subtract.apply(jn,w));return l.call(this,{amount:jn.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:jn.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:jn.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:jn.round(jn.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:jn.round(jn.divide(this.getAmount(),p),h)})},percentage:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return JLe(p),this.multiply(jn.divide(p,100),h)},allocate:function(p){var h=this;ZLe(p);for(var y=p.reduce(function(x,A){return jn.add(x,A)}),g=this.getAmount(),v=p.map(function(x){var A=Math.floor(jn.divide(jn.multiply(h.getAmount(),x),y));return g=jn.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=jn.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,k=A===void 0?f.headers:A,R=y.roundingMode,E=R===void 0?c:R,T=Object.assign({},{endpoint:v,propertyPath:x,headers:k,roundingMode:E});return QLe(T).getExchangeRate(this.getCurrency(),p).then(function(D){return aw(!Hy(D),'No rate was found for the destination currency "'.concat(p,'".'),TypeError),l.call(h,{amount:jn.round(jn.multiply(h.getAmount(),parseFloat(D)),T.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()},lessThanOrEqual:function(p){d.call(this,p);var h=t.normalizePrecision([this,p]);return h[0].getAmount()<=h[1].getAmount()},greaterThan: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 jn.modulo(this.getAmount(),Math.pow(10,i))!==0},hasCents:function(){return jn.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=XLe(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 jn.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 jn.divide(jn.round(jn.multiply(this.toUnit(),y),h),y)},toObject:function(){return{amount:r,currency:s,precision:i}},toJSON:function(){return this.toObject()}}},wS=Object.assign(eIe,ILe,$Le,ULe),M1={exports:{}};/**
|
||
* @license
|
||
* Lodash <https://lodash.com/>
|
||
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
||
* Released under MIT license <https://lodash.com/license>
|
||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||
*/M1.exports;(function(t,e){(function(){var n,r="4.17.21",s=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",o="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",u=500,f="__lodash_placeholder__",l=1,d=2,m=4,p=1,h=2,y=1,g=2,v=4,w=8,x=16,A=32,k=64,R=128,E=256,T=512,D=30,M="...",L=800,I=16,F=1,U=2,Y=3,W=1/0,H=9007199254740991,ee=17976931348623157e292,re=NaN,X=4294967295,G=X-1,K=X>>>1,J=[["ary",R],["bind",y],["bindKey",g],["curry",w],["curryRight",x],["flip",T],["partial",A],["partialRight",k],["rearg",E]],ue="[object Arguments]",de="[object Array]",ie="[object AsyncFunction]",be="[object Boolean]",Ae="[object Date]",_e="[object DOMException]",Oe="[object Error]",Ne="[object Function]",ye="[object GeneratorFunction]",$e="[object Map]",ut="[object Number]",Qe="[object Null]",yt="[object Object]",En="[object Promise]",Xt="[object Proxy]",gn="[object RegExp]",Qt="[object Set]",Z="[object String]",fe="[object Symbol]",ge="[object Undefined]",Pe="[object WeakMap]",Me="[object WeakSet]",xe="[object ArrayBuffer]",Te="[object DataView]",Ye="[object Float32Array]",Pt="[object Float64Array]",wt="[object Int8Array]",Ls="[object Int16Array]",Yn="[object Int32Array]",gs="[object Uint8Array]",Ht="[object Uint8ClampedArray]",an="[object Uint16Array]",vn="[object Uint32Array]",Be=/\b__p \+= '';/g,it=/\b(__p \+=) '' \+/g,ot=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Et=/&(?:amp|lt|gt|quot|#39);/g,nt=/[&<>"']/g,Wt=RegExp(Et.source),At=RegExp(nt.source),yn=/<%-([\s\S]+?)%>/g,ln=/<%([\s\S]+?)%>/g,cn=/<%=([\s\S]+?)%>/g,kn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hr=/^\w*$/,Dn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(te.source),he=/^\s+/,Ce=/\s/,Le=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ge=/\{\n\/\* \[wrapped with (.+)\] \*/,st=/,? & /,Ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Xe=/[()=,{}\[\]\/\s]/,Ve=/\\(\\)?/g,Ze=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,gt=/\w*$/,It=/^[-+]0x[0-9a-f]+$/i,Tr=/^0b[01]+$/i,bn=/^\[object .+?Constructor\]$/,qt=/^0o[0-7]+$/i,Wn=/^(?:0|[1-9]\d*)$/,nu=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Fa=/($^)/,Go=/['\n\r\u2028\u2029\\]/g,Is="\\ud800-\\udfff",Wv="\\u0300-\\u036f",Kd="\\ufe20-\\ufe2f",Nl="\\u20d0-\\u20ff",Yd=Wv+Kd+Nl,Xd="\\u2700-\\u27bf",Ft="a-z\\xdf-\\xf6\\xf8-\\xff",Vn="\\xac\\xb1\\xd7\\xf7",ru="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Qd="\\u2000-\\u206f",ir=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ml="A-Z\\xc0-\\xd6\\xd8-\\xde",Vv="\\ufe0e\\ufe0f",q_=Vn+ru+Qd+ir,pR="['’]",Ete="["+Is+"]",c2="["+q_+"]",G_="["+Yd+"]",u2="\\d+",Cte="["+Xd+"]",d2="["+Ft+"]",f2="[^"+Is+q_+u2+Xd+Ft+Ml+"]",mR="\\ud83c[\\udffb-\\udfff]",Ate="(?:"+G_+"|"+mR+")",h2="[^"+Is+"]",gR="(?:\\ud83c[\\udde6-\\uddff]){2}",vR="[\\ud800-\\udbff][\\udc00-\\udfff]",xp="["+Ml+"]",p2="\\u200d",m2="(?:"+d2+"|"+f2+")",Rte="(?:"+xp+"|"+f2+")",g2="(?:"+pR+"(?:d|ll|m|re|s|t|ve))?",v2="(?:"+pR+"(?:D|LL|M|RE|S|T|VE))?",y2=Ate+"?",b2="["+Vv+"]?",Pte="(?:"+p2+"(?:"+[h2,gR,vR].join("|")+")"+b2+y2+")*",Tte="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",kte="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",w2=b2+y2+Pte,Dte="(?:"+[Cte,gR,vR].join("|")+")"+w2,Nte="(?:"+[h2+G_+"?",G_,gR,vR,Ete].join("|")+")",Mte=RegExp(pR,"g"),Ote=RegExp(G_,"g"),yR=RegExp(mR+"(?="+mR+")|"+Nte+w2,"g"),Lte=RegExp([xp+"?"+d2+"+"+g2+"(?="+[c2,xp,"$"].join("|")+")",Rte+"+"+v2+"(?="+[c2,xp+m2,"$"].join("|")+")",xp+"?"+m2+"+"+g2,xp+"+"+v2,kte,Tte,u2,Dte].join("|"),"g"),Ite=RegExp("["+p2+Is+Yd+Vv+"]"),$te=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Fte=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],jte=-1,$n={};$n[Ye]=$n[Pt]=$n[wt]=$n[Ls]=$n[Yn]=$n[gs]=$n[Ht]=$n[an]=$n[vn]=!0,$n[ue]=$n[de]=$n[xe]=$n[be]=$n[Te]=$n[Ae]=$n[Oe]=$n[Ne]=$n[$e]=$n[ut]=$n[yt]=$n[gn]=$n[Qt]=$n[Z]=$n[Pe]=!1;var Nn={};Nn[ue]=Nn[de]=Nn[xe]=Nn[Te]=Nn[be]=Nn[Ae]=Nn[Ye]=Nn[Pt]=Nn[wt]=Nn[Ls]=Nn[Yn]=Nn[$e]=Nn[ut]=Nn[yt]=Nn[gn]=Nn[Qt]=Nn[Z]=Nn[fe]=Nn[gs]=Nn[Ht]=Nn[an]=Nn[vn]=!0,Nn[Oe]=Nn[Ne]=Nn[Pe]=!1;var zte={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Bte={"&":"&","<":"<",">":">",'"':""","'":"'"},Ute={"&":"&","<":"<",">":">",""":'"',"'":"'"},Hte={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Wte=parseFloat,Vte=parseInt,_2=typeof yr=="object"&&yr&&yr.Object===Object&&yr,qte=typeof self=="object"&&self&&self.Object===Object&&self,ts=_2||qte||Function("return this")(),bR=e&&!e.nodeType&&e,Jd=bR&&!0&&t&&!t.nodeType&&t,x2=Jd&&Jd.exports===bR,wR=x2&&_2.process,fo=function(){try{var ae=Jd&&Jd.require&&Jd.require("util").types;return ae||wR&&wR.binding&&wR.binding("util")}catch{}}(),S2=fo&&fo.isArrayBuffer,E2=fo&&fo.isDate,C2=fo&&fo.isMap,A2=fo&&fo.isRegExp,R2=fo&&fo.isSet,P2=fo&&fo.isTypedArray;function Ni(ae,we,pe){switch(pe.length){case 0:return ae.call(we);case 1:return ae.call(we,pe[0]);case 2:return ae.call(we,pe[0],pe[1]);case 3:return ae.call(we,pe[0],pe[1],pe[2])}return ae.apply(we,pe)}function Gte(ae,we,pe,We){for(var vt=-1,tn=ae==null?0:ae.length;++vt<tn;){var kr=ae[vt];we(We,kr,pe(kr),ae)}return We}function ho(ae,we){for(var pe=-1,We=ae==null?0:ae.length;++pe<We&&we(ae[pe],pe,ae)!==!1;);return ae}function Kte(ae,we){for(var pe=ae==null?0:ae.length;pe--&&we(ae[pe],pe,ae)!==!1;);return ae}function T2(ae,we){for(var pe=-1,We=ae==null?0:ae.length;++pe<We;)if(!we(ae[pe],pe,ae))return!1;return!0}function su(ae,we){for(var pe=-1,We=ae==null?0:ae.length,vt=0,tn=[];++pe<We;){var kr=ae[pe];we(kr,pe,ae)&&(tn[vt++]=kr)}return tn}function K_(ae,we){var pe=ae==null?0:ae.length;return!!pe&&Sp(ae,we,0)>-1}function _R(ae,we,pe){for(var We=-1,vt=ae==null?0:ae.length;++We<vt;)if(pe(we,ae[We]))return!0;return!1}function qn(ae,we){for(var pe=-1,We=ae==null?0:ae.length,vt=Array(We);++pe<We;)vt[pe]=we(ae[pe],pe,ae);return vt}function iu(ae,we){for(var pe=-1,We=we.length,vt=ae.length;++pe<We;)ae[vt+pe]=we[pe];return ae}function xR(ae,we,pe,We){var vt=-1,tn=ae==null?0:ae.length;for(We&&tn&&(pe=ae[++vt]);++vt<tn;)pe=we(pe,ae[vt],vt,ae);return pe}function Yte(ae,we,pe,We){var vt=ae==null?0:ae.length;for(We&&vt&&(pe=ae[--vt]);vt--;)pe=we(pe,ae[vt],vt,ae);return pe}function SR(ae,we){for(var pe=-1,We=ae==null?0:ae.length;++pe<We;)if(we(ae[pe],pe,ae))return!0;return!1}var Xte=ER("length");function Qte(ae){return ae.split("")}function Jte(ae){return ae.match(Ue)||[]}function k2(ae,we,pe){var We;return pe(ae,function(vt,tn,kr){if(we(vt,tn,kr))return We=tn,!1}),We}function Y_(ae,we,pe,We){for(var vt=ae.length,tn=pe+(We?1:-1);We?tn--:++tn<vt;)if(we(ae[tn],tn,ae))return tn;return-1}function Sp(ae,we,pe){return we===we?une(ae,we,pe):Y_(ae,D2,pe)}function Zte(ae,we,pe,We){for(var vt=pe-1,tn=ae.length;++vt<tn;)if(We(ae[vt],we))return vt;return-1}function D2(ae){return ae!==ae}function N2(ae,we){var pe=ae==null?0:ae.length;return pe?AR(ae,we)/pe:re}function ER(ae){return function(we){return we==null?n:we[ae]}}function CR(ae){return function(we){return ae==null?n:ae[we]}}function M2(ae,we,pe,We,vt){return vt(ae,function(tn,kr,Cn){pe=We?(We=!1,tn):we(pe,tn,kr,Cn)}),pe}function ene(ae,we){var pe=ae.length;for(ae.sort(we);pe--;)ae[pe]=ae[pe].value;return ae}function AR(ae,we){for(var pe,We=-1,vt=ae.length;++We<vt;){var tn=we(ae[We]);tn!==n&&(pe=pe===n?tn:pe+tn)}return pe}function RR(ae,we){for(var pe=-1,We=Array(ae);++pe<ae;)We[pe]=we(pe);return We}function tne(ae,we){return qn(we,function(pe){return[pe,ae[pe]]})}function O2(ae){return ae&&ae.slice(0,F2(ae)+1).replace(he,"")}function Mi(ae){return function(we){return ae(we)}}function PR(ae,we){return qn(we,function(pe){return ae[pe]})}function qv(ae,we){return ae.has(we)}function L2(ae,we){for(var pe=-1,We=ae.length;++pe<We&&Sp(we,ae[pe],0)>-1;);return pe}function I2(ae,we){for(var pe=ae.length;pe--&&Sp(we,ae[pe],0)>-1;);return pe}function nne(ae,we){for(var pe=ae.length,We=0;pe--;)ae[pe]===we&&++We;return We}var rne=CR(zte),sne=CR(Bte);function ine(ae){return"\\"+Hte[ae]}function one(ae,we){return ae==null?n:ae[we]}function Ep(ae){return Ite.test(ae)}function ane(ae){return $te.test(ae)}function lne(ae){for(var we,pe=[];!(we=ae.next()).done;)pe.push(we.value);return pe}function TR(ae){var we=-1,pe=Array(ae.size);return ae.forEach(function(We,vt){pe[++we]=[vt,We]}),pe}function $2(ae,we){return function(pe){return ae(we(pe))}}function ou(ae,we){for(var pe=-1,We=ae.length,vt=0,tn=[];++pe<We;){var kr=ae[pe];(kr===we||kr===f)&&(ae[pe]=f,tn[vt++]=pe)}return tn}function X_(ae){var we=-1,pe=Array(ae.size);return ae.forEach(function(We){pe[++we]=We}),pe}function cne(ae){var we=-1,pe=Array(ae.size);return ae.forEach(function(We){pe[++we]=[We,We]}),pe}function une(ae,we,pe){for(var We=pe-1,vt=ae.length;++We<vt;)if(ae[We]===we)return We;return-1}function dne(ae,we,pe){for(var We=pe+1;We--;)if(ae[We]===we)return We;return We}function Cp(ae){return Ep(ae)?hne(ae):Xte(ae)}function Ko(ae){return Ep(ae)?pne(ae):Qte(ae)}function F2(ae){for(var we=ae.length;we--&&Ce.test(ae.charAt(we)););return we}var fne=CR(Ute);function hne(ae){for(var we=yR.lastIndex=0;yR.test(ae);)++we;return we}function pne(ae){return ae.match(yR)||[]}function mne(ae){return ae.match(Lte)||[]}var gne=function ae(we){we=we==null?ts:Ap.defaults(ts.Object(),we,Ap.pick(ts,Fte));var pe=we.Array,We=we.Date,vt=we.Error,tn=we.Function,kr=we.Math,Cn=we.Object,kR=we.RegExp,vne=we.String,po=we.TypeError,Q_=pe.prototype,yne=tn.prototype,Rp=Cn.prototype,J_=we["__core-js_shared__"],Z_=yne.toString,un=Rp.hasOwnProperty,bne=0,j2=function(){var b=/[^.]+$/.exec(J_&&J_.keys&&J_.keys.IE_PROTO||"");return b?"Symbol(src)_1."+b:""}(),ex=Rp.toString,wne=Z_.call(Cn),_ne=ts._,xne=kR("^"+Z_.call(un).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tx=x2?we.Buffer:n,au=we.Symbol,nx=we.Uint8Array,z2=tx?tx.allocUnsafe:n,rx=$2(Cn.getPrototypeOf,Cn),B2=Cn.create,U2=Rp.propertyIsEnumerable,sx=Q_.splice,H2=au?au.isConcatSpreadable:n,Gv=au?au.iterator:n,Zd=au?au.toStringTag:n,ix=function(){try{var b=sf(Cn,"defineProperty");return b({},"",{}),b}catch{}}(),Sne=we.clearTimeout!==ts.clearTimeout&&we.clearTimeout,Ene=We&&We.now!==ts.Date.now&&We.now,Cne=we.setTimeout!==ts.setTimeout&&we.setTimeout,ox=kr.ceil,ax=kr.floor,DR=Cn.getOwnPropertySymbols,Ane=tx?tx.isBuffer:n,W2=we.isFinite,Rne=Q_.join,Pne=$2(Cn.keys,Cn),Dr=kr.max,vs=kr.min,Tne=We.now,kne=we.parseInt,V2=kr.random,Dne=Q_.reverse,NR=sf(we,"DataView"),Kv=sf(we,"Map"),MR=sf(we,"Promise"),Pp=sf(we,"Set"),Yv=sf(we,"WeakMap"),Xv=sf(Cn,"create"),lx=Yv&&new Yv,Tp={},Nne=of(NR),Mne=of(Kv),One=of(MR),Lne=of(Pp),Ine=of(Yv),cx=au?au.prototype:n,Qv=cx?cx.valueOf:n,q2=cx?cx.toString:n;function V(b){if(or(b)&&!bt(b)&&!(b instanceof $t)){if(b instanceof mo)return b;if(un.call(b,"__wrapped__"))return GF(b)}return new mo(b)}var kp=function(){function b(){}return function(S){if(!Xn(S))return{};if(B2)return B2(S);b.prototype=S;var N=new b;return b.prototype=n,N}}();function ux(){}function mo(b,S){this.__wrapped__=b,this.__actions__=[],this.__chain__=!!S,this.__index__=0,this.__values__=n}V.templateSettings={escape:yn,evaluate:ln,interpolate:cn,variable:"",imports:{_:V}},V.prototype=ux.prototype,V.prototype.constructor=V,mo.prototype=kp(ux.prototype),mo.prototype.constructor=mo;function $t(b){this.__wrapped__=b,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=X,this.__views__=[]}function $ne(){var b=new $t(this.__wrapped__);return b.__actions__=ri(this.__actions__),b.__dir__=this.__dir__,b.__filtered__=this.__filtered__,b.__iteratees__=ri(this.__iteratees__),b.__takeCount__=this.__takeCount__,b.__views__=ri(this.__views__),b}function Fne(){if(this.__filtered__){var b=new $t(this);b.__dir__=-1,b.__filtered__=!0}else b=this.clone(),b.__dir__*=-1;return b}function jne(){var b=this.__wrapped__.value(),S=this.__dir__,N=bt(b),O=S<0,j=N?b.length:0,q=Qre(0,j,this.__views__),Q=q.start,ne=q.end,le=ne-Q,Se=O?ne:Q-1,Ee=this.__iteratees__,Re=Ee.length,Fe=0,Je=vs(le,this.__takeCount__);if(!N||!O&&j==le&&Je==le)return gF(b,this.__actions__);var lt=[];e:for(;le--&&Fe<Je;){Se+=S;for(var Ct=-1,ct=b[Se];++Ct<Re;){var Dt=Ee[Ct],jt=Dt.iteratee,Ii=Dt.type,js=jt(ct);if(Ii==U)ct=js;else if(!js){if(Ii==F)continue e;break e}}lt[Fe++]=ct}return lt}$t.prototype=kp(ux.prototype),$t.prototype.constructor=$t;function ef(b){var S=-1,N=b==null?0:b.length;for(this.clear();++S<N;){var O=b[S];this.set(O[0],O[1])}}function zne(){this.__data__=Xv?Xv(null):{},this.size=0}function Bne(b){var S=this.has(b)&&delete this.__data__[b];return this.size-=S?1:0,S}function Une(b){var S=this.__data__;if(Xv){var N=S[b];return N===c?n:N}return un.call(S,b)?S[b]:n}function Hne(b){var S=this.__data__;return Xv?S[b]!==n:un.call(S,b)}function Wne(b,S){var N=this.__data__;return this.size+=this.has(b)?0:1,N[b]=Xv&&S===n?c:S,this}ef.prototype.clear=zne,ef.prototype.delete=Bne,ef.prototype.get=Une,ef.prototype.has=Hne,ef.prototype.set=Wne;function Ol(b){var S=-1,N=b==null?0:b.length;for(this.clear();++S<N;){var O=b[S];this.set(O[0],O[1])}}function Vne(){this.__data__=[],this.size=0}function qne(b){var S=this.__data__,N=dx(S,b);if(N<0)return!1;var O=S.length-1;return N==O?S.pop():sx.call(S,N,1),--this.size,!0}function Gne(b){var S=this.__data__,N=dx(S,b);return N<0?n:S[N][1]}function Kne(b){return dx(this.__data__,b)>-1}function Yne(b,S){var N=this.__data__,O=dx(N,b);return O<0?(++this.size,N.push([b,S])):N[O][1]=S,this}Ol.prototype.clear=Vne,Ol.prototype.delete=qne,Ol.prototype.get=Gne,Ol.prototype.has=Kne,Ol.prototype.set=Yne;function Ll(b){var S=-1,N=b==null?0:b.length;for(this.clear();++S<N;){var O=b[S];this.set(O[0],O[1])}}function Xne(){this.size=0,this.__data__={hash:new ef,map:new(Kv||Ol),string:new ef}}function Qne(b){var S=Sx(this,b).delete(b);return this.size-=S?1:0,S}function Jne(b){return Sx(this,b).get(b)}function Zne(b){return Sx(this,b).has(b)}function ere(b,S){var N=Sx(this,b),O=N.size;return N.set(b,S),this.size+=N.size==O?0:1,this}Ll.prototype.clear=Xne,Ll.prototype.delete=Qne,Ll.prototype.get=Jne,Ll.prototype.has=Zne,Ll.prototype.set=ere;function tf(b){var S=-1,N=b==null?0:b.length;for(this.__data__=new Ll;++S<N;)this.add(b[S])}function tre(b){return this.__data__.set(b,c),this}function nre(b){return this.__data__.has(b)}tf.prototype.add=tf.prototype.push=tre,tf.prototype.has=nre;function Yo(b){var S=this.__data__=new Ol(b);this.size=S.size}function rre(){this.__data__=new Ol,this.size=0}function sre(b){var S=this.__data__,N=S.delete(b);return this.size=S.size,N}function ire(b){return this.__data__.get(b)}function ore(b){return this.__data__.has(b)}function are(b,S){var N=this.__data__;if(N instanceof Ol){var O=N.__data__;if(!Kv||O.length<s-1)return O.push([b,S]),this.size=++N.size,this;N=this.__data__=new Ll(O)}return N.set(b,S),this.size=N.size,this}Yo.prototype.clear=rre,Yo.prototype.delete=sre,Yo.prototype.get=ire,Yo.prototype.has=ore,Yo.prototype.set=are;function G2(b,S){var N=bt(b),O=!N&&af(b),j=!N&&!O&&fu(b),q=!N&&!O&&!j&&Op(b),Q=N||O||j||q,ne=Q?RR(b.length,vne):[],le=ne.length;for(var Se in b)(S||un.call(b,Se))&&!(Q&&(Se=="length"||j&&(Se=="offset"||Se=="parent")||q&&(Se=="buffer"||Se=="byteLength"||Se=="byteOffset")||jl(Se,le)))&&ne.push(Se);return ne}function K2(b){var S=b.length;return S?b[WR(0,S-1)]:n}function lre(b,S){return Ex(ri(b),nf(S,0,b.length))}function cre(b){return Ex(ri(b))}function OR(b,S,N){(N!==n&&!Xo(b[S],N)||N===n&&!(S in b))&&Il(b,S,N)}function Jv(b,S,N){var O=b[S];(!(un.call(b,S)&&Xo(O,N))||N===n&&!(S in b))&&Il(b,S,N)}function dx(b,S){for(var N=b.length;N--;)if(Xo(b[N][0],S))return N;return-1}function ure(b,S,N,O){return lu(b,function(j,q,Q){S(O,j,N(j),Q)}),O}function Y2(b,S){return b&&za(S,qr(S),b)}function dre(b,S){return b&&za(S,ii(S),b)}function Il(b,S,N){S=="__proto__"&&ix?ix(b,S,{configurable:!0,enumerable:!0,value:N,writable:!0}):b[S]=N}function LR(b,S){for(var N=-1,O=S.length,j=pe(O),q=b==null;++N<O;)j[N]=q?n:mP(b,S[N]);return j}function nf(b,S,N){return b===b&&(N!==n&&(b=b<=N?b:N),S!==n&&(b=b>=S?b:S)),b}function go(b,S,N,O,j,q){var Q,ne=S&l,le=S&d,Se=S&m;if(N&&(Q=j?N(b,O,j,q):N(b)),Q!==n)return Q;if(!Xn(b))return b;var Ee=bt(b);if(Ee){if(Q=Zre(b),!ne)return ri(b,Q)}else{var Re=ys(b),Fe=Re==Ne||Re==ye;if(fu(b))return bF(b,ne);if(Re==yt||Re==ue||Fe&&!j){if(Q=le||Fe?{}:FF(b),!ne)return le?Ure(b,dre(Q,b)):Bre(b,Y2(Q,b))}else{if(!Nn[Re])return j?b:{};Q=ese(b,Re,ne)}}q||(q=new Yo);var Je=q.get(b);if(Je)return Je;q.set(b,Q),hj(b)?b.forEach(function(ct){Q.add(go(ct,S,N,ct,b,q))}):dj(b)&&b.forEach(function(ct,Dt){Q.set(Dt,go(ct,S,N,Dt,b,q))});var lt=Se?le?tP:eP:le?ii:qr,Ct=Ee?n:lt(b);return ho(Ct||b,function(ct,Dt){Ct&&(Dt=ct,ct=b[Dt]),Jv(Q,Dt,go(ct,S,N,Dt,b,q))}),Q}function fre(b){var S=qr(b);return function(N){return X2(N,b,S)}}function X2(b,S,N){var O=N.length;if(b==null)return!O;for(b=Cn(b);O--;){var j=N[O],q=S[j],Q=b[j];if(Q===n&&!(j in b)||!q(Q))return!1}return!0}function Q2(b,S,N){if(typeof b!="function")throw new po(a);return iy(function(){b.apply(n,N)},S)}function Zv(b,S,N,O){var j=-1,q=K_,Q=!0,ne=b.length,le=[],Se=S.length;if(!ne)return le;N&&(S=qn(S,Mi(N))),O?(q=_R,Q=!1):S.length>=s&&(q=qv,Q=!1,S=new tf(S));e:for(;++j<ne;){var Ee=b[j],Re=N==null?Ee:N(Ee);if(Ee=O||Ee!==0?Ee:0,Q&&Re===Re){for(var Fe=Se;Fe--;)if(S[Fe]===Re)continue e;le.push(Ee)}else q(S,Re,O)||le.push(Ee)}return le}var lu=EF(ja),J2=EF($R,!0);function hre(b,S){var N=!0;return lu(b,function(O,j,q){return N=!!S(O,j,q),N}),N}function fx(b,S,N){for(var O=-1,j=b.length;++O<j;){var q=b[O],Q=S(q);if(Q!=null&&(ne===n?Q===Q&&!Li(Q):N(Q,ne)))var ne=Q,le=q}return le}function pre(b,S,N,O){var j=b.length;for(N=xt(N),N<0&&(N=-N>j?0:j+N),O=O===n||O>j?j:xt(O),O<0&&(O+=j),O=N>O?0:mj(O);N<O;)b[N++]=S;return b}function Z2(b,S){var N=[];return lu(b,function(O,j,q){S(O,j,q)&&N.push(O)}),N}function ns(b,S,N,O,j){var q=-1,Q=b.length;for(N||(N=nse),j||(j=[]);++q<Q;){var ne=b[q];S>0&&N(ne)?S>1?ns(ne,S-1,N,O,j):iu(j,ne):O||(j[j.length]=ne)}return j}var IR=CF(),eF=CF(!0);function ja(b,S){return b&&IR(b,S,qr)}function $R(b,S){return b&&eF(b,S,qr)}function hx(b,S){return su(S,function(N){return zl(b[N])})}function rf(b,S){S=uu(S,b);for(var N=0,O=S.length;b!=null&&N<O;)b=b[Ba(S[N++])];return N&&N==O?b:n}function tF(b,S,N){var O=S(b);return bt(b)?O:iu(O,N(b))}function $s(b){return b==null?b===n?ge:Qe:Zd&&Zd in Cn(b)?Xre(b):cse(b)}function FR(b,S){return b>S}function mre(b,S){return b!=null&&un.call(b,S)}function gre(b,S){return b!=null&&S in Cn(b)}function vre(b,S,N){return b>=vs(S,N)&&b<Dr(S,N)}function jR(b,S,N){for(var O=N?_R:K_,j=b[0].length,q=b.length,Q=q,ne=pe(q),le=1/0,Se=[];Q--;){var Ee=b[Q];Q&&S&&(Ee=qn(Ee,Mi(S))),le=vs(Ee.length,le),ne[Q]=!N&&(S||j>=120&&Ee.length>=120)?new tf(Q&&Ee):n}Ee=b[0];var Re=-1,Fe=ne[0];e:for(;++Re<j&&Se.length<le;){var Je=Ee[Re],lt=S?S(Je):Je;if(Je=N||Je!==0?Je:0,!(Fe?qv(Fe,lt):O(Se,lt,N))){for(Q=q;--Q;){var Ct=ne[Q];if(!(Ct?qv(Ct,lt):O(b[Q],lt,N)))continue e}Fe&&Fe.push(lt),Se.push(Je)}}return Se}function yre(b,S,N,O){return ja(b,function(j,q,Q){S(O,N(j),q,Q)}),O}function ey(b,S,N){S=uu(S,b),b=UF(b,S);var O=b==null?b:b[Ba(yo(S))];return O==null?n:Ni(O,b,N)}function nF(b){return or(b)&&$s(b)==ue}function bre(b){return or(b)&&$s(b)==xe}function wre(b){return or(b)&&$s(b)==Ae}function ty(b,S,N,O,j){return b===S?!0:b==null||S==null||!or(b)&&!or(S)?b!==b&&S!==S:_re(b,S,N,O,ty,j)}function _re(b,S,N,O,j,q){var Q=bt(b),ne=bt(S),le=Q?de:ys(b),Se=ne?de:ys(S);le=le==ue?yt:le,Se=Se==ue?yt:Se;var Ee=le==yt,Re=Se==yt,Fe=le==Se;if(Fe&&fu(b)){if(!fu(S))return!1;Q=!0,Ee=!1}if(Fe&&!Ee)return q||(q=new Yo),Q||Op(b)?LF(b,S,N,O,j,q):Kre(b,S,le,N,O,j,q);if(!(N&p)){var Je=Ee&&un.call(b,"__wrapped__"),lt=Re&&un.call(S,"__wrapped__");if(Je||lt){var Ct=Je?b.value():b,ct=lt?S.value():S;return q||(q=new Yo),j(Ct,ct,N,O,q)}}return Fe?(q||(q=new Yo),Yre(b,S,N,O,j,q)):!1}function xre(b){return or(b)&&ys(b)==$e}function zR(b,S,N,O){var j=N.length,q=j,Q=!O;if(b==null)return!q;for(b=Cn(b);j--;){var ne=N[j];if(Q&&ne[2]?ne[1]!==b[ne[0]]:!(ne[0]in b))return!1}for(;++j<q;){ne=N[j];var le=ne[0],Se=b[le],Ee=ne[1];if(Q&&ne[2]){if(Se===n&&!(le in b))return!1}else{var Re=new Yo;if(O)var Fe=O(Se,Ee,le,b,S,Re);if(!(Fe===n?ty(Ee,Se,p|h,O,Re):Fe))return!1}}return!0}function rF(b){if(!Xn(b)||sse(b))return!1;var S=zl(b)?xne:bn;return S.test(of(b))}function Sre(b){return or(b)&&$s(b)==gn}function Ere(b){return or(b)&&ys(b)==Qt}function Cre(b){return or(b)&&kx(b.length)&&!!$n[$s(b)]}function sF(b){return typeof b=="function"?b:b==null?oi:typeof b=="object"?bt(b)?aF(b[0],b[1]):oF(b):Aj(b)}function BR(b){if(!sy(b))return Pne(b);var S=[];for(var N in Cn(b))un.call(b,N)&&N!="constructor"&&S.push(N);return S}function Are(b){if(!Xn(b))return lse(b);var S=sy(b),N=[];for(var O in b)O=="constructor"&&(S||!un.call(b,O))||N.push(O);return N}function UR(b,S){return b<S}function iF(b,S){var N=-1,O=si(b)?pe(b.length):[];return lu(b,function(j,q,Q){O[++N]=S(j,q,Q)}),O}function oF(b){var S=rP(b);return S.length==1&&S[0][2]?zF(S[0][0],S[0][1]):function(N){return N===b||zR(N,b,S)}}function aF(b,S){return iP(b)&&jF(S)?zF(Ba(b),S):function(N){var O=mP(N,b);return O===n&&O===S?gP(N,b):ty(S,O,p|h)}}function px(b,S,N,O,j){b!==S&&IR(S,function(q,Q){if(j||(j=new Yo),Xn(q))Rre(b,S,Q,N,px,O,j);else{var ne=O?O(aP(b,Q),q,Q+"",b,S,j):n;ne===n&&(ne=q),OR(b,Q,ne)}},ii)}function Rre(b,S,N,O,j,q,Q){var ne=aP(b,N),le=aP(S,N),Se=Q.get(le);if(Se){OR(b,N,Se);return}var Ee=q?q(ne,le,N+"",b,S,Q):n,Re=Ee===n;if(Re){var Fe=bt(le),Je=!Fe&&fu(le),lt=!Fe&&!Je&&Op(le);Ee=le,Fe||Je||lt?bt(ne)?Ee=ne:pr(ne)?Ee=ri(ne):Je?(Re=!1,Ee=bF(le,!0)):lt?(Re=!1,Ee=wF(le,!0)):Ee=[]:oy(le)||af(le)?(Ee=ne,af(ne)?Ee=gj(ne):(!Xn(ne)||zl(ne))&&(Ee=FF(le))):Re=!1}Re&&(Q.set(le,Ee),j(Ee,le,O,q,Q),Q.delete(le)),OR(b,N,Ee)}function lF(b,S){var N=b.length;if(N)return S+=S<0?N:0,jl(S,N)?b[S]:n}function cF(b,S,N){S.length?S=qn(S,function(q){return bt(q)?function(Q){return rf(Q,q.length===1?q[0]:q)}:q}):S=[oi];var O=-1;S=qn(S,Mi(at()));var j=iF(b,function(q,Q,ne){var le=qn(S,function(Se){return Se(q)});return{criteria:le,index:++O,value:q}});return ene(j,function(q,Q){return zre(q,Q,N)})}function Pre(b,S){return uF(b,S,function(N,O){return gP(b,O)})}function uF(b,S,N){for(var O=-1,j=S.length,q={};++O<j;){var Q=S[O],ne=rf(b,Q);N(ne,Q)&&ny(q,uu(Q,b),ne)}return q}function Tre(b){return function(S){return rf(S,b)}}function HR(b,S,N,O){var j=O?Zte:Sp,q=-1,Q=S.length,ne=b;for(b===S&&(S=ri(S)),N&&(ne=qn(b,Mi(N)));++q<Q;)for(var le=0,Se=S[q],Ee=N?N(Se):Se;(le=j(ne,Ee,le,O))>-1;)ne!==b&&sx.call(ne,le,1),sx.call(b,le,1);return b}function dF(b,S){for(var N=b?S.length:0,O=N-1;N--;){var j=S[N];if(N==O||j!==q){var q=j;jl(j)?sx.call(b,j,1):GR(b,j)}}return b}function WR(b,S){return b+ax(V2()*(S-b+1))}function kre(b,S,N,O){for(var j=-1,q=Dr(ox((S-b)/(N||1)),0),Q=pe(q);q--;)Q[O?q:++j]=b,b+=N;return Q}function VR(b,S){var N="";if(!b||S<1||S>H)return N;do S%2&&(N+=b),S=ax(S/2),S&&(b+=b);while(S);return N}function Rt(b,S){return lP(BF(b,S,oi),b+"")}function Dre(b){return K2(Lp(b))}function Nre(b,S){var N=Lp(b);return Ex(N,nf(S,0,N.length))}function ny(b,S,N,O){if(!Xn(b))return b;S=uu(S,b);for(var j=-1,q=S.length,Q=q-1,ne=b;ne!=null&&++j<q;){var le=Ba(S[j]),Se=N;if(le==="__proto__"||le==="constructor"||le==="prototype")return b;if(j!=Q){var Ee=ne[le];Se=O?O(Ee,le,ne):n,Se===n&&(Se=Xn(Ee)?Ee:jl(S[j+1])?[]:{})}Jv(ne,le,Se),ne=ne[le]}return b}var fF=lx?function(b,S){return lx.set(b,S),b}:oi,Mre=ix?function(b,S){return ix(b,"toString",{configurable:!0,enumerable:!1,value:yP(S),writable:!0})}:oi;function Ore(b){return Ex(Lp(b))}function vo(b,S,N){var O=-1,j=b.length;S<0&&(S=-S>j?0:j+S),N=N>j?j:N,N<0&&(N+=j),j=S>N?0:N-S>>>0,S>>>=0;for(var q=pe(j);++O<j;)q[O]=b[O+S];return q}function Lre(b,S){var N;return lu(b,function(O,j,q){return N=S(O,j,q),!N}),!!N}function mx(b,S,N){var O=0,j=b==null?O:b.length;if(typeof S=="number"&&S===S&&j<=K){for(;O<j;){var q=O+j>>>1,Q=b[q];Q!==null&&!Li(Q)&&(N?Q<=S:Q<S)?O=q+1:j=q}return j}return qR(b,S,oi,N)}function qR(b,S,N,O){var j=0,q=b==null?0:b.length;if(q===0)return 0;S=N(S);for(var Q=S!==S,ne=S===null,le=Li(S),Se=S===n;j<q;){var Ee=ax((j+q)/2),Re=N(b[Ee]),Fe=Re!==n,Je=Re===null,lt=Re===Re,Ct=Li(Re);if(Q)var ct=O||lt;else Se?ct=lt&&(O||Fe):ne?ct=lt&&Fe&&(O||!Je):le?ct=lt&&Fe&&!Je&&(O||!Ct):Je||Ct?ct=!1:ct=O?Re<=S:Re<S;ct?j=Ee+1:q=Ee}return vs(q,G)}function hF(b,S){for(var N=-1,O=b.length,j=0,q=[];++N<O;){var Q=b[N],ne=S?S(Q):Q;if(!N||!Xo(ne,le)){var le=ne;q[j++]=Q===0?0:Q}}return q}function pF(b){return typeof b=="number"?b:Li(b)?re:+b}function Oi(b){if(typeof b=="string")return b;if(bt(b))return qn(b,Oi)+"";if(Li(b))return q2?q2.call(b):"";var S=b+"";return S=="0"&&1/b==-1/0?"-0":S}function cu(b,S,N){var O=-1,j=K_,q=b.length,Q=!0,ne=[],le=ne;if(N)Q=!1,j=_R;else if(q>=s){var Se=S?null:qre(b);if(Se)return X_(Se);Q=!1,j=qv,le=new tf}else le=S?[]:ne;e:for(;++O<q;){var Ee=b[O],Re=S?S(Ee):Ee;if(Ee=N||Ee!==0?Ee:0,Q&&Re===Re){for(var Fe=le.length;Fe--;)if(le[Fe]===Re)continue e;S&&le.push(Re),ne.push(Ee)}else j(le,Re,N)||(le!==ne&&le.push(Re),ne.push(Ee))}return ne}function GR(b,S){return S=uu(S,b),b=UF(b,S),b==null||delete b[Ba(yo(S))]}function mF(b,S,N,O){return ny(b,S,N(rf(b,S)),O)}function gx(b,S,N,O){for(var j=b.length,q=O?j:-1;(O?q--:++q<j)&&S(b[q],q,b););return N?vo(b,O?0:q,O?q+1:j):vo(b,O?q+1:0,O?j:q)}function gF(b,S){var N=b;return N instanceof $t&&(N=N.value()),xR(S,function(O,j){return j.func.apply(j.thisArg,iu([O],j.args))},N)}function KR(b,S,N){var O=b.length;if(O<2)return O?cu(b[0]):[];for(var j=-1,q=pe(O);++j<O;)for(var Q=b[j],ne=-1;++ne<O;)ne!=j&&(q[j]=Zv(q[j]||Q,b[ne],S,N));return cu(ns(q,1),S,N)}function vF(b,S,N){for(var O=-1,j=b.length,q=S.length,Q={};++O<j;){var ne=O<q?S[O]:n;N(Q,b[O],ne)}return Q}function YR(b){return pr(b)?b:[]}function XR(b){return typeof b=="function"?b:oi}function uu(b,S){return bt(b)?b:iP(b,S)?[b]:qF(sn(b))}var Ire=Rt;function du(b,S,N){var O=b.length;return N=N===n?O:N,!S&&N>=O?b:vo(b,S,N)}var yF=Sne||function(b){return ts.clearTimeout(b)};function bF(b,S){if(S)return b.slice();var N=b.length,O=z2?z2(N):new b.constructor(N);return b.copy(O),O}function QR(b){var S=new b.constructor(b.byteLength);return new nx(S).set(new nx(b)),S}function $re(b,S){var N=S?QR(b.buffer):b.buffer;return new b.constructor(N,b.byteOffset,b.byteLength)}function Fre(b){var S=new b.constructor(b.source,gt.exec(b));return S.lastIndex=b.lastIndex,S}function jre(b){return Qv?Cn(Qv.call(b)):{}}function wF(b,S){var N=S?QR(b.buffer):b.buffer;return new b.constructor(N,b.byteOffset,b.length)}function _F(b,S){if(b!==S){var N=b!==n,O=b===null,j=b===b,q=Li(b),Q=S!==n,ne=S===null,le=S===S,Se=Li(S);if(!ne&&!Se&&!q&&b>S||q&&Q&&le&&!ne&&!Se||O&&Q&&le||!N&&le||!j)return 1;if(!O&&!q&&!Se&&b<S||Se&&N&&j&&!O&&!q||ne&&N&&j||!Q&&j||!le)return-1}return 0}function zre(b,S,N){for(var O=-1,j=b.criteria,q=S.criteria,Q=j.length,ne=N.length;++O<Q;){var le=_F(j[O],q[O]);if(le){if(O>=ne)return le;var Se=N[O];return le*(Se=="desc"?-1:1)}}return b.index-S.index}function xF(b,S,N,O){for(var j=-1,q=b.length,Q=N.length,ne=-1,le=S.length,Se=Dr(q-Q,0),Ee=pe(le+Se),Re=!O;++ne<le;)Ee[ne]=S[ne];for(;++j<Q;)(Re||j<q)&&(Ee[N[j]]=b[j]);for(;Se--;)Ee[ne++]=b[j++];return Ee}function SF(b,S,N,O){for(var j=-1,q=b.length,Q=-1,ne=N.length,le=-1,Se=S.length,Ee=Dr(q-ne,0),Re=pe(Ee+Se),Fe=!O;++j<Ee;)Re[j]=b[j];for(var Je=j;++le<Se;)Re[Je+le]=S[le];for(;++Q<ne;)(Fe||j<q)&&(Re[Je+N[Q]]=b[j++]);return Re}function ri(b,S){var N=-1,O=b.length;for(S||(S=pe(O));++N<O;)S[N]=b[N];return S}function za(b,S,N,O){var j=!N;N||(N={});for(var q=-1,Q=S.length;++q<Q;){var ne=S[q],le=O?O(N[ne],b[ne],ne,N,b):n;le===n&&(le=b[ne]),j?Il(N,ne,le):Jv(N,ne,le)}return N}function Bre(b,S){return za(b,sP(b),S)}function Ure(b,S){return za(b,IF(b),S)}function vx(b,S){return function(N,O){var j=bt(N)?Gte:ure,q=S?S():{};return j(N,b,at(O,2),q)}}function Dp(b){return Rt(function(S,N){var O=-1,j=N.length,q=j>1?N[j-1]:n,Q=j>2?N[2]:n;for(q=b.length>3&&typeof q=="function"?(j--,q):n,Q&&Fs(N[0],N[1],Q)&&(q=j<3?n:q,j=1),S=Cn(S);++O<j;){var ne=N[O];ne&&b(S,ne,O,q)}return S})}function EF(b,S){return function(N,O){if(N==null)return N;if(!si(N))return b(N,O);for(var j=N.length,q=S?j:-1,Q=Cn(N);(S?q--:++q<j)&&O(Q[q],q,Q)!==!1;);return N}}function CF(b){return function(S,N,O){for(var j=-1,q=Cn(S),Q=O(S),ne=Q.length;ne--;){var le=Q[b?ne:++j];if(N(q[le],le,q)===!1)break}return S}}function Hre(b,S,N){var O=S&y,j=ry(b);function q(){var Q=this&&this!==ts&&this instanceof q?j:b;return Q.apply(O?N:this,arguments)}return q}function AF(b){return function(S){S=sn(S);var N=Ep(S)?Ko(S):n,O=N?N[0]:S.charAt(0),j=N?du(N,1).join(""):S.slice(1);return O[b]()+j}}function Np(b){return function(S){return xR(Ej(Sj(S).replace(Mte,"")),b,"")}}function ry(b){return function(){var S=arguments;switch(S.length){case 0:return new b;case 1:return new b(S[0]);case 2:return new b(S[0],S[1]);case 3:return new b(S[0],S[1],S[2]);case 4:return new b(S[0],S[1],S[2],S[3]);case 5:return new b(S[0],S[1],S[2],S[3],S[4]);case 6:return new b(S[0],S[1],S[2],S[3],S[4],S[5]);case 7:return new b(S[0],S[1],S[2],S[3],S[4],S[5],S[6])}var N=kp(b.prototype),O=b.apply(N,S);return Xn(O)?O:N}}function Wre(b,S,N){var O=ry(b);function j(){for(var q=arguments.length,Q=pe(q),ne=q,le=Mp(j);ne--;)Q[ne]=arguments[ne];var Se=q<3&&Q[0]!==le&&Q[q-1]!==le?[]:ou(Q,le);if(q-=Se.length,q<N)return DF(b,S,yx,j.placeholder,n,Q,Se,n,n,N-q);var Ee=this&&this!==ts&&this instanceof j?O:b;return Ni(Ee,this,Q)}return j}function RF(b){return function(S,N,O){var j=Cn(S);if(!si(S)){var q=at(N,3);S=qr(S),N=function(ne){return q(j[ne],ne,j)}}var Q=b(S,N,O);return Q>-1?j[q?S[Q]:Q]:n}}function PF(b){return Fl(function(S){var N=S.length,O=N,j=mo.prototype.thru;for(b&&S.reverse();O--;){var q=S[O];if(typeof q!="function")throw new po(a);if(j&&!Q&&xx(q)=="wrapper")var Q=new mo([],!0)}for(O=Q?O:N;++O<N;){q=S[O];var ne=xx(q),le=ne=="wrapper"?nP(q):n;le&&oP(le[0])&&le[1]==(R|w|A|E)&&!le[4].length&&le[9]==1?Q=Q[xx(le[0])].apply(Q,le[3]):Q=q.length==1&&oP(q)?Q[ne]():Q.thru(q)}return function(){var Se=arguments,Ee=Se[0];if(Q&&Se.length==1&&bt(Ee))return Q.plant(Ee).value();for(var Re=0,Fe=N?S[Re].apply(this,Se):Ee;++Re<N;)Fe=S[Re].call(this,Fe);return Fe}})}function yx(b,S,N,O,j,q,Q,ne,le,Se){var Ee=S&R,Re=S&y,Fe=S&g,Je=S&(w|x),lt=S&T,Ct=Fe?n:ry(b);function ct(){for(var Dt=arguments.length,jt=pe(Dt),Ii=Dt;Ii--;)jt[Ii]=arguments[Ii];if(Je)var js=Mp(ct),$i=nne(jt,js);if(O&&(jt=xF(jt,O,j,Je)),q&&(jt=SF(jt,q,Q,Je)),Dt-=$i,Je&&Dt<Se){var mr=ou(jt,js);return DF(b,S,yx,ct.placeholder,N,jt,mr,ne,le,Se-Dt)}var Qo=Re?N:this,Ul=Fe?Qo[b]:b;return Dt=jt.length,ne?jt=use(jt,ne):lt&&Dt>1&&jt.reverse(),Ee&&le<Dt&&(jt.length=le),this&&this!==ts&&this instanceof ct&&(Ul=Ct||ry(Ul)),Ul.apply(Qo,jt)}return ct}function TF(b,S){return function(N,O){return yre(N,b,S(O),{})}}function bx(b,S){return function(N,O){var j;if(N===n&&O===n)return S;if(N!==n&&(j=N),O!==n){if(j===n)return O;typeof N=="string"||typeof O=="string"?(N=Oi(N),O=Oi(O)):(N=pF(N),O=pF(O)),j=b(N,O)}return j}}function JR(b){return Fl(function(S){return S=qn(S,Mi(at())),Rt(function(N){var O=this;return b(S,function(j){return Ni(j,O,N)})})})}function wx(b,S){S=S===n?" ":Oi(S);var N=S.length;if(N<2)return N?VR(S,b):S;var O=VR(S,ox(b/Cp(S)));return Ep(S)?du(Ko(O),0,b).join(""):O.slice(0,b)}function Vre(b,S,N,O){var j=S&y,q=ry(b);function Q(){for(var ne=-1,le=arguments.length,Se=-1,Ee=O.length,Re=pe(Ee+le),Fe=this&&this!==ts&&this instanceof Q?q:b;++Se<Ee;)Re[Se]=O[Se];for(;le--;)Re[Se++]=arguments[++ne];return Ni(Fe,j?N:this,Re)}return Q}function kF(b){return function(S,N,O){return O&&typeof O!="number"&&Fs(S,N,O)&&(N=O=n),S=Bl(S),N===n?(N=S,S=0):N=Bl(N),O=O===n?S<N?1:-1:Bl(O),kre(S,N,O,b)}}function _x(b){return function(S,N){return typeof S=="string"&&typeof N=="string"||(S=bo(S),N=bo(N)),b(S,N)}}function DF(b,S,N,O,j,q,Q,ne,le,Se){var Ee=S&w,Re=Ee?Q:n,Fe=Ee?n:Q,Je=Ee?q:n,lt=Ee?n:q;S|=Ee?A:k,S&=~(Ee?k:A),S&v||(S&=-4);var Ct=[b,S,j,Je,Re,lt,Fe,ne,le,Se],ct=N.apply(n,Ct);return oP(b)&&HF(ct,Ct),ct.placeholder=O,WF(ct,b,S)}function ZR(b){var S=kr[b];return function(N,O){if(N=bo(N),O=O==null?0:vs(xt(O),292),O&&W2(N)){var j=(sn(N)+"e").split("e"),q=S(j[0]+"e"+(+j[1]+O));return j=(sn(q)+"e").split("e"),+(j[0]+"e"+(+j[1]-O))}return S(N)}}var qre=Pp&&1/X_(new Pp([,-0]))[1]==W?function(b){return new Pp(b)}:_P;function NF(b){return function(S){var N=ys(S);return N==$e?TR(S):N==Qt?cne(S):tne(S,b(S))}}function $l(b,S,N,O,j,q,Q,ne){var le=S&g;if(!le&&typeof b!="function")throw new po(a);var Se=O?O.length:0;if(Se||(S&=-97,O=j=n),Q=Q===n?Q:Dr(xt(Q),0),ne=ne===n?ne:xt(ne),Se-=j?j.length:0,S&k){var Ee=O,Re=j;O=j=n}var Fe=le?n:nP(b),Je=[b,S,N,O,j,Ee,Re,q,Q,ne];if(Fe&&ase(Je,Fe),b=Je[0],S=Je[1],N=Je[2],O=Je[3],j=Je[4],ne=Je[9]=Je[9]===n?le?0:b.length:Dr(Je[9]-Se,0),!ne&&S&(w|x)&&(S&=-25),!S||S==y)var lt=Hre(b,S,N);else S==w||S==x?lt=Wre(b,S,ne):(S==A||S==(y|A))&&!j.length?lt=Vre(b,S,N,O):lt=yx.apply(n,Je);var Ct=Fe?fF:HF;return WF(Ct(lt,Je),b,S)}function MF(b,S,N,O){return b===n||Xo(b,Rp[N])&&!un.call(O,N)?S:b}function OF(b,S,N,O,j,q){return Xn(b)&&Xn(S)&&(q.set(S,b),px(b,S,n,OF,q),q.delete(S)),b}function Gre(b){return oy(b)?n:b}function LF(b,S,N,O,j,q){var Q=N&p,ne=b.length,le=S.length;if(ne!=le&&!(Q&&le>ne))return!1;var Se=q.get(b),Ee=q.get(S);if(Se&&Ee)return Se==S&&Ee==b;var Re=-1,Fe=!0,Je=N&h?new tf:n;for(q.set(b,S),q.set(S,b);++Re<ne;){var lt=b[Re],Ct=S[Re];if(O)var ct=Q?O(Ct,lt,Re,S,b,q):O(lt,Ct,Re,b,S,q);if(ct!==n){if(ct)continue;Fe=!1;break}if(Je){if(!SR(S,function(Dt,jt){if(!qv(Je,jt)&&(lt===Dt||j(lt,Dt,N,O,q)))return Je.push(jt)})){Fe=!1;break}}else if(!(lt===Ct||j(lt,Ct,N,O,q))){Fe=!1;break}}return q.delete(b),q.delete(S),Fe}function Kre(b,S,N,O,j,q,Q){switch(N){case Te:if(b.byteLength!=S.byteLength||b.byteOffset!=S.byteOffset)return!1;b=b.buffer,S=S.buffer;case xe:return!(b.byteLength!=S.byteLength||!q(new nx(b),new nx(S)));case be:case Ae:case ut:return Xo(+b,+S);case Oe:return b.name==S.name&&b.message==S.message;case gn:case Z:return b==S+"";case $e:var ne=TR;case Qt:var le=O&p;if(ne||(ne=X_),b.size!=S.size&&!le)return!1;var Se=Q.get(b);if(Se)return Se==S;O|=h,Q.set(b,S);var Ee=LF(ne(b),ne(S),O,j,q,Q);return Q.delete(b),Ee;case fe:if(Qv)return Qv.call(b)==Qv.call(S)}return!1}function Yre(b,S,N,O,j,q){var Q=N&p,ne=eP(b),le=ne.length,Se=eP(S),Ee=Se.length;if(le!=Ee&&!Q)return!1;for(var Re=le;Re--;){var Fe=ne[Re];if(!(Q?Fe in S:un.call(S,Fe)))return!1}var Je=q.get(b),lt=q.get(S);if(Je&<)return Je==S&<==b;var Ct=!0;q.set(b,S),q.set(S,b);for(var ct=Q;++Re<le;){Fe=ne[Re];var Dt=b[Fe],jt=S[Fe];if(O)var Ii=Q?O(jt,Dt,Fe,S,b,q):O(Dt,jt,Fe,b,S,q);if(!(Ii===n?Dt===jt||j(Dt,jt,N,O,q):Ii)){Ct=!1;break}ct||(ct=Fe=="constructor")}if(Ct&&!ct){var js=b.constructor,$i=S.constructor;js!=$i&&"constructor"in b&&"constructor"in S&&!(typeof js=="function"&&js instanceof js&&typeof $i=="function"&&$i instanceof $i)&&(Ct=!1)}return q.delete(b),q.delete(S),Ct}function Fl(b){return lP(BF(b,n,XF),b+"")}function eP(b){return tF(b,qr,sP)}function tP(b){return tF(b,ii,IF)}var nP=lx?function(b){return lx.get(b)}:_P;function xx(b){for(var S=b.name+"",N=Tp[S],O=un.call(Tp,S)?N.length:0;O--;){var j=N[O],q=j.func;if(q==null||q==b)return j.name}return S}function Mp(b){var S=un.call(V,"placeholder")?V:b;return S.placeholder}function at(){var b=V.iteratee||bP;return b=b===bP?sF:b,arguments.length?b(arguments[0],arguments[1]):b}function Sx(b,S){var N=b.__data__;return rse(S)?N[typeof S=="string"?"string":"hash"]:N.map}function rP(b){for(var S=qr(b),N=S.length;N--;){var O=S[N],j=b[O];S[N]=[O,j,jF(j)]}return S}function sf(b,S){var N=one(b,S);return rF(N)?N:n}function Xre(b){var S=un.call(b,Zd),N=b[Zd];try{b[Zd]=n;var O=!0}catch{}var j=ex.call(b);return O&&(S?b[Zd]=N:delete b[Zd]),j}var sP=DR?function(b){return b==null?[]:(b=Cn(b),su(DR(b),function(S){return U2.call(b,S)}))}:xP,IF=DR?function(b){for(var S=[];b;)iu(S,sP(b)),b=rx(b);return S}:xP,ys=$s;(NR&&ys(new NR(new ArrayBuffer(1)))!=Te||Kv&&ys(new Kv)!=$e||MR&&ys(MR.resolve())!=En||Pp&&ys(new Pp)!=Qt||Yv&&ys(new Yv)!=Pe)&&(ys=function(b){var S=$s(b),N=S==yt?b.constructor:n,O=N?of(N):"";if(O)switch(O){case Nne:return Te;case Mne:return $e;case One:return En;case Lne:return Qt;case Ine:return Pe}return S});function Qre(b,S,N){for(var O=-1,j=N.length;++O<j;){var q=N[O],Q=q.size;switch(q.type){case"drop":b+=Q;break;case"dropRight":S-=Q;break;case"take":S=vs(S,b+Q);break;case"takeRight":b=Dr(b,S-Q);break}}return{start:b,end:S}}function Jre(b){var S=b.match(Ge);return S?S[1].split(st):[]}function $F(b,S,N){S=uu(S,b);for(var O=-1,j=S.length,q=!1;++O<j;){var Q=Ba(S[O]);if(!(q=b!=null&&N(b,Q)))break;b=b[Q]}return q||++O!=j?q:(j=b==null?0:b.length,!!j&&kx(j)&&jl(Q,j)&&(bt(b)||af(b)))}function Zre(b){var S=b.length,N=new b.constructor(S);return S&&typeof b[0]=="string"&&un.call(b,"index")&&(N.index=b.index,N.input=b.input),N}function FF(b){return typeof b.constructor=="function"&&!sy(b)?kp(rx(b)):{}}function ese(b,S,N){var O=b.constructor;switch(S){case xe:return QR(b);case be:case Ae:return new O(+b);case Te:return $re(b,N);case Ye:case Pt:case wt:case Ls:case Yn:case gs:case Ht:case an:case vn:return wF(b,N);case $e:return new O;case ut:case Z:return new O(b);case gn:return Fre(b);case Qt:return new O;case fe:return jre(b)}}function tse(b,S){var N=S.length;if(!N)return b;var O=N-1;return S[O]=(N>1?"& ":"")+S[O],S=S.join(N>2?", ":" "),b.replace(Le,`{
|
||
/* [wrapped with `+S+`] */
|
||
`)}function nse(b){return bt(b)||af(b)||!!(H2&&b&&b[H2])}function jl(b,S){var N=typeof b;return S=S??H,!!S&&(N=="number"||N!="symbol"&&Wn.test(b))&&b>-1&&b%1==0&&b<S}function Fs(b,S,N){if(!Xn(N))return!1;var O=typeof S;return(O=="number"?si(N)&&jl(S,N.length):O=="string"&&S in N)?Xo(N[S],b):!1}function iP(b,S){if(bt(b))return!1;var N=typeof b;return N=="number"||N=="symbol"||N=="boolean"||b==null||Li(b)?!0:hr.test(b)||!kn.test(b)||S!=null&&b in Cn(S)}function rse(b){var S=typeof b;return S=="string"||S=="number"||S=="symbol"||S=="boolean"?b!=="__proto__":b===null}function oP(b){var S=xx(b),N=V[S];if(typeof N!="function"||!(S in $t.prototype))return!1;if(b===N)return!0;var O=nP(N);return!!O&&b===O[0]}function sse(b){return!!j2&&j2 in b}var ise=J_?zl:SP;function sy(b){var S=b&&b.constructor,N=typeof S=="function"&&S.prototype||Rp;return b===N}function jF(b){return b===b&&!Xn(b)}function zF(b,S){return function(N){return N==null?!1:N[b]===S&&(S!==n||b in Cn(N))}}function ose(b){var S=Px(b,function(O){return N.size===u&&N.clear(),O}),N=S.cache;return S}function ase(b,S){var N=b[1],O=S[1],j=N|O,q=j<(y|g|R),Q=O==R&&N==w||O==R&&N==E&&b[7].length<=S[8]||O==(R|E)&&S[7].length<=S[8]&&N==w;if(!(q||Q))return b;O&y&&(b[2]=S[2],j|=N&y?0:v);var ne=S[3];if(ne){var le=b[3];b[3]=le?xF(le,ne,S[4]):ne,b[4]=le?ou(b[3],f):S[4]}return ne=S[5],ne&&(le=b[5],b[5]=le?SF(le,ne,S[6]):ne,b[6]=le?ou(b[5],f):S[6]),ne=S[7],ne&&(b[7]=ne),O&R&&(b[8]=b[8]==null?S[8]:vs(b[8],S[8])),b[9]==null&&(b[9]=S[9]),b[0]=S[0],b[1]=j,b}function lse(b){var S=[];if(b!=null)for(var N in Cn(b))S.push(N);return S}function cse(b){return ex.call(b)}function BF(b,S,N){return S=Dr(S===n?b.length-1:S,0),function(){for(var O=arguments,j=-1,q=Dr(O.length-S,0),Q=pe(q);++j<q;)Q[j]=O[S+j];j=-1;for(var ne=pe(S+1);++j<S;)ne[j]=O[j];return ne[S]=N(Q),Ni(b,this,ne)}}function UF(b,S){return S.length<2?b:rf(b,vo(S,0,-1))}function use(b,S){for(var N=b.length,O=vs(S.length,N),j=ri(b);O--;){var q=S[O];b[O]=jl(q,N)?j[q]:n}return b}function aP(b,S){if(!(S==="constructor"&&typeof b[S]=="function")&&S!="__proto__")return b[S]}var HF=VF(fF),iy=Cne||function(b,S){return ts.setTimeout(b,S)},lP=VF(Mre);function WF(b,S,N){var O=S+"";return lP(b,tse(O,dse(Jre(O),N)))}function VF(b){var S=0,N=0;return function(){var O=Tne(),j=I-(O-N);if(N=O,j>0){if(++S>=L)return arguments[0]}else S=0;return b.apply(n,arguments)}}function Ex(b,S){var N=-1,O=b.length,j=O-1;for(S=S===n?O:S;++N<S;){var q=WR(N,j),Q=b[q];b[q]=b[N],b[N]=Q}return b.length=S,b}var qF=ose(function(b){var S=[];return b.charCodeAt(0)===46&&S.push(""),b.replace(Dn,function(N,O,j,q){S.push(j?q.replace(Ve,"$1"):O||N)}),S});function Ba(b){if(typeof b=="string"||Li(b))return b;var S=b+"";return S=="0"&&1/b==-1/0?"-0":S}function of(b){if(b!=null){try{return Z_.call(b)}catch{}try{return b+""}catch{}}return""}function dse(b,S){return ho(J,function(N){var O="_."+N[0];S&N[1]&&!K_(b,O)&&b.push(O)}),b.sort()}function GF(b){if(b instanceof $t)return b.clone();var S=new mo(b.__wrapped__,b.__chain__);return S.__actions__=ri(b.__actions__),S.__index__=b.__index__,S.__values__=b.__values__,S}function fse(b,S,N){(N?Fs(b,S,N):S===n)?S=1:S=Dr(xt(S),0);var O=b==null?0:b.length;if(!O||S<1)return[];for(var j=0,q=0,Q=pe(ox(O/S));j<O;)Q[q++]=vo(b,j,j+=S);return Q}function hse(b){for(var S=-1,N=b==null?0:b.length,O=0,j=[];++S<N;){var q=b[S];q&&(j[O++]=q)}return j}function pse(){var b=arguments.length;if(!b)return[];for(var S=pe(b-1),N=arguments[0],O=b;O--;)S[O-1]=arguments[O];return iu(bt(N)?ri(N):[N],ns(S,1))}var mse=Rt(function(b,S){return pr(b)?Zv(b,ns(S,1,pr,!0)):[]}),gse=Rt(function(b,S){var N=yo(S);return pr(N)&&(N=n),pr(b)?Zv(b,ns(S,1,pr,!0),at(N,2)):[]}),vse=Rt(function(b,S){var N=yo(S);return pr(N)&&(N=n),pr(b)?Zv(b,ns(S,1,pr,!0),n,N):[]});function yse(b,S,N){var O=b==null?0:b.length;return O?(S=N||S===n?1:xt(S),vo(b,S<0?0:S,O)):[]}function bse(b,S,N){var O=b==null?0:b.length;return O?(S=N||S===n?1:xt(S),S=O-S,vo(b,0,S<0?0:S)):[]}function wse(b,S){return b&&b.length?gx(b,at(S,3),!0,!0):[]}function _se(b,S){return b&&b.length?gx(b,at(S,3),!0):[]}function xse(b,S,N,O){var j=b==null?0:b.length;return j?(N&&typeof N!="number"&&Fs(b,S,N)&&(N=0,O=j),pre(b,S,N,O)):[]}function KF(b,S,N){var O=b==null?0:b.length;if(!O)return-1;var j=N==null?0:xt(N);return j<0&&(j=Dr(O+j,0)),Y_(b,at(S,3),j)}function YF(b,S,N){var O=b==null?0:b.length;if(!O)return-1;var j=O-1;return N!==n&&(j=xt(N),j=N<0?Dr(O+j,0):vs(j,O-1)),Y_(b,at(S,3),j,!0)}function XF(b){var S=b==null?0:b.length;return S?ns(b,1):[]}function Sse(b){var S=b==null?0:b.length;return S?ns(b,W):[]}function Ese(b,S){var N=b==null?0:b.length;return N?(S=S===n?1:xt(S),ns(b,S)):[]}function Cse(b){for(var S=-1,N=b==null?0:b.length,O={};++S<N;){var j=b[S];O[j[0]]=j[1]}return O}function QF(b){return b&&b.length?b[0]:n}function Ase(b,S,N){var O=b==null?0:b.length;if(!O)return-1;var j=N==null?0:xt(N);return j<0&&(j=Dr(O+j,0)),Sp(b,S,j)}function Rse(b){var S=b==null?0:b.length;return S?vo(b,0,-1):[]}var Pse=Rt(function(b){var S=qn(b,YR);return S.length&&S[0]===b[0]?jR(S):[]}),Tse=Rt(function(b){var S=yo(b),N=qn(b,YR);return S===yo(N)?S=n:N.pop(),N.length&&N[0]===b[0]?jR(N,at(S,2)):[]}),kse=Rt(function(b){var S=yo(b),N=qn(b,YR);return S=typeof S=="function"?S:n,S&&N.pop(),N.length&&N[0]===b[0]?jR(N,n,S):[]});function Dse(b,S){return b==null?"":Rne.call(b,S)}function yo(b){var S=b==null?0:b.length;return S?b[S-1]:n}function Nse(b,S,N){var O=b==null?0:b.length;if(!O)return-1;var j=O;return N!==n&&(j=xt(N),j=j<0?Dr(O+j,0):vs(j,O-1)),S===S?dne(b,S,j):Y_(b,D2,j,!0)}function Mse(b,S){return b&&b.length?lF(b,xt(S)):n}var Ose=Rt(JF);function JF(b,S){return b&&b.length&&S&&S.length?HR(b,S):b}function Lse(b,S,N){return b&&b.length&&S&&S.length?HR(b,S,at(N,2)):b}function Ise(b,S,N){return b&&b.length&&S&&S.length?HR(b,S,n,N):b}var $se=Fl(function(b,S){var N=b==null?0:b.length,O=LR(b,S);return dF(b,qn(S,function(j){return jl(j,N)?+j:j}).sort(_F)),O});function Fse(b,S){var N=[];if(!(b&&b.length))return N;var O=-1,j=[],q=b.length;for(S=at(S,3);++O<q;){var Q=b[O];S(Q,O,b)&&(N.push(Q),j.push(O))}return dF(b,j),N}function cP(b){return b==null?b:Dne.call(b)}function jse(b,S,N){var O=b==null?0:b.length;return O?(N&&typeof N!="number"&&Fs(b,S,N)?(S=0,N=O):(S=S==null?0:xt(S),N=N===n?O:xt(N)),vo(b,S,N)):[]}function zse(b,S){return mx(b,S)}function Bse(b,S,N){return qR(b,S,at(N,2))}function Use(b,S){var N=b==null?0:b.length;if(N){var O=mx(b,S);if(O<N&&Xo(b[O],S))return O}return-1}function Hse(b,S){return mx(b,S,!0)}function Wse(b,S,N){return qR(b,S,at(N,2),!0)}function Vse(b,S){var N=b==null?0:b.length;if(N){var O=mx(b,S,!0)-1;if(Xo(b[O],S))return O}return-1}function qse(b){return b&&b.length?hF(b):[]}function Gse(b,S){return b&&b.length?hF(b,at(S,2)):[]}function Kse(b){var S=b==null?0:b.length;return S?vo(b,1,S):[]}function Yse(b,S,N){return b&&b.length?(S=N||S===n?1:xt(S),vo(b,0,S<0?0:S)):[]}function Xse(b,S,N){var O=b==null?0:b.length;return O?(S=N||S===n?1:xt(S),S=O-S,vo(b,S<0?0:S,O)):[]}function Qse(b,S){return b&&b.length?gx(b,at(S,3),!1,!0):[]}function Jse(b,S){return b&&b.length?gx(b,at(S,3)):[]}var Zse=Rt(function(b){return cu(ns(b,1,pr,!0))}),eie=Rt(function(b){var S=yo(b);return pr(S)&&(S=n),cu(ns(b,1,pr,!0),at(S,2))}),tie=Rt(function(b){var S=yo(b);return S=typeof S=="function"?S:n,cu(ns(b,1,pr,!0),n,S)});function nie(b){return b&&b.length?cu(b):[]}function rie(b,S){return b&&b.length?cu(b,at(S,2)):[]}function sie(b,S){return S=typeof S=="function"?S:n,b&&b.length?cu(b,n,S):[]}function uP(b){if(!(b&&b.length))return[];var S=0;return b=su(b,function(N){if(pr(N))return S=Dr(N.length,S),!0}),RR(S,function(N){return qn(b,ER(N))})}function ZF(b,S){if(!(b&&b.length))return[];var N=uP(b);return S==null?N:qn(N,function(O){return Ni(S,n,O)})}var iie=Rt(function(b,S){return pr(b)?Zv(b,S):[]}),oie=Rt(function(b){return KR(su(b,pr))}),aie=Rt(function(b){var S=yo(b);return pr(S)&&(S=n),KR(su(b,pr),at(S,2))}),lie=Rt(function(b){var S=yo(b);return S=typeof S=="function"?S:n,KR(su(b,pr),n,S)}),cie=Rt(uP);function uie(b,S){return vF(b||[],S||[],Jv)}function die(b,S){return vF(b||[],S||[],ny)}var fie=Rt(function(b){var S=b.length,N=S>1?b[S-1]:n;return N=typeof N=="function"?(b.pop(),N):n,ZF(b,N)});function ej(b){var S=V(b);return S.__chain__=!0,S}function hie(b,S){return S(b),b}function Cx(b,S){return S(b)}var pie=Fl(function(b){var S=b.length,N=S?b[0]:0,O=this.__wrapped__,j=function(q){return LR(q,b)};return S>1||this.__actions__.length||!(O instanceof $t)||!jl(N)?this.thru(j):(O=O.slice(N,+N+(S?1:0)),O.__actions__.push({func:Cx,args:[j],thisArg:n}),new mo(O,this.__chain__).thru(function(q){return S&&!q.length&&q.push(n),q}))});function mie(){return ej(this)}function gie(){return new mo(this.value(),this.__chain__)}function vie(){this.__values__===n&&(this.__values__=pj(this.value()));var b=this.__index__>=this.__values__.length,S=b?n:this.__values__[this.__index__++];return{done:b,value:S}}function yie(){return this}function bie(b){for(var S,N=this;N instanceof ux;){var O=GF(N);O.__index__=0,O.__values__=n,S?j.__wrapped__=O:S=O;var j=O;N=N.__wrapped__}return j.__wrapped__=b,S}function wie(){var b=this.__wrapped__;if(b instanceof $t){var S=b;return this.__actions__.length&&(S=new $t(this)),S=S.reverse(),S.__actions__.push({func:Cx,args:[cP],thisArg:n}),new mo(S,this.__chain__)}return this.thru(cP)}function _ie(){return gF(this.__wrapped__,this.__actions__)}var xie=vx(function(b,S,N){un.call(b,N)?++b[N]:Il(b,N,1)});function Sie(b,S,N){var O=bt(b)?T2:hre;return N&&Fs(b,S,N)&&(S=n),O(b,at(S,3))}function Eie(b,S){var N=bt(b)?su:Z2;return N(b,at(S,3))}var Cie=RF(KF),Aie=RF(YF);function Rie(b,S){return ns(Ax(b,S),1)}function Pie(b,S){return ns(Ax(b,S),W)}function Tie(b,S,N){return N=N===n?1:xt(N),ns(Ax(b,S),N)}function tj(b,S){var N=bt(b)?ho:lu;return N(b,at(S,3))}function nj(b,S){var N=bt(b)?Kte:J2;return N(b,at(S,3))}var kie=vx(function(b,S,N){un.call(b,N)?b[N].push(S):Il(b,N,[S])});function Die(b,S,N,O){b=si(b)?b:Lp(b),N=N&&!O?xt(N):0;var j=b.length;return N<0&&(N=Dr(j+N,0)),Dx(b)?N<=j&&b.indexOf(S,N)>-1:!!j&&Sp(b,S,N)>-1}var Nie=Rt(function(b,S,N){var O=-1,j=typeof S=="function",q=si(b)?pe(b.length):[];return lu(b,function(Q){q[++O]=j?Ni(S,Q,N):ey(Q,S,N)}),q}),Mie=vx(function(b,S,N){Il(b,N,S)});function Ax(b,S){var N=bt(b)?qn:iF;return N(b,at(S,3))}function Oie(b,S,N,O){return b==null?[]:(bt(S)||(S=S==null?[]:[S]),N=O?n:N,bt(N)||(N=N==null?[]:[N]),cF(b,S,N))}var Lie=vx(function(b,S,N){b[N?0:1].push(S)},function(){return[[],[]]});function Iie(b,S,N){var O=bt(b)?xR:M2,j=arguments.length<3;return O(b,at(S,4),N,j,lu)}function $ie(b,S,N){var O=bt(b)?Yte:M2,j=arguments.length<3;return O(b,at(S,4),N,j,J2)}function Fie(b,S){var N=bt(b)?su:Z2;return N(b,Tx(at(S,3)))}function jie(b){var S=bt(b)?K2:Dre;return S(b)}function zie(b,S,N){(N?Fs(b,S,N):S===n)?S=1:S=xt(S);var O=bt(b)?lre:Nre;return O(b,S)}function Bie(b){var S=bt(b)?cre:Ore;return S(b)}function Uie(b){if(b==null)return 0;if(si(b))return Dx(b)?Cp(b):b.length;var S=ys(b);return S==$e||S==Qt?b.size:BR(b).length}function Hie(b,S,N){var O=bt(b)?SR:Lre;return N&&Fs(b,S,N)&&(S=n),O(b,at(S,3))}var Wie=Rt(function(b,S){if(b==null)return[];var N=S.length;return N>1&&Fs(b,S[0],S[1])?S=[]:N>2&&Fs(S[0],S[1],S[2])&&(S=[S[0]]),cF(b,ns(S,1),[])}),Rx=Ene||function(){return ts.Date.now()};function Vie(b,S){if(typeof S!="function")throw new po(a);return b=xt(b),function(){if(--b<1)return S.apply(this,arguments)}}function rj(b,S,N){return S=N?n:S,S=b&&S==null?b.length:S,$l(b,R,n,n,n,n,S)}function sj(b,S){var N;if(typeof S!="function")throw new po(a);return b=xt(b),function(){return--b>0&&(N=S.apply(this,arguments)),b<=1&&(S=n),N}}var dP=Rt(function(b,S,N){var O=y;if(N.length){var j=ou(N,Mp(dP));O|=A}return $l(b,O,S,N,j)}),ij=Rt(function(b,S,N){var O=y|g;if(N.length){var j=ou(N,Mp(ij));O|=A}return $l(S,O,b,N,j)});function oj(b,S,N){S=N?n:S;var O=$l(b,w,n,n,n,n,n,S);return O.placeholder=oj.placeholder,O}function aj(b,S,N){S=N?n:S;var O=$l(b,x,n,n,n,n,n,S);return O.placeholder=aj.placeholder,O}function lj(b,S,N){var O,j,q,Q,ne,le,Se=0,Ee=!1,Re=!1,Fe=!0;if(typeof b!="function")throw new po(a);S=bo(S)||0,Xn(N)&&(Ee=!!N.leading,Re="maxWait"in N,q=Re?Dr(bo(N.maxWait)||0,S):q,Fe="trailing"in N?!!N.trailing:Fe);function Je(mr){var Qo=O,Ul=j;return O=j=n,Se=mr,Q=b.apply(Ul,Qo),Q}function lt(mr){return Se=mr,ne=iy(Dt,S),Ee?Je(mr):Q}function Ct(mr){var Qo=mr-le,Ul=mr-Se,Rj=S-Qo;return Re?vs(Rj,q-Ul):Rj}function ct(mr){var Qo=mr-le,Ul=mr-Se;return le===n||Qo>=S||Qo<0||Re&&Ul>=q}function Dt(){var mr=Rx();if(ct(mr))return jt(mr);ne=iy(Dt,Ct(mr))}function jt(mr){return ne=n,Fe&&O?Je(mr):(O=j=n,Q)}function Ii(){ne!==n&&yF(ne),Se=0,O=le=j=ne=n}function js(){return ne===n?Q:jt(Rx())}function $i(){var mr=Rx(),Qo=ct(mr);if(O=arguments,j=this,le=mr,Qo){if(ne===n)return lt(le);if(Re)return yF(ne),ne=iy(Dt,S),Je(le)}return ne===n&&(ne=iy(Dt,S)),Q}return $i.cancel=Ii,$i.flush=js,$i}var qie=Rt(function(b,S){return Q2(b,1,S)}),Gie=Rt(function(b,S,N){return Q2(b,bo(S)||0,N)});function Kie(b){return $l(b,T)}function Px(b,S){if(typeof b!="function"||S!=null&&typeof S!="function")throw new po(a);var N=function(){var O=arguments,j=S?S.apply(this,O):O[0],q=N.cache;if(q.has(j))return q.get(j);var Q=b.apply(this,O);return N.cache=q.set(j,Q)||q,Q};return N.cache=new(Px.Cache||Ll),N}Px.Cache=Ll;function Tx(b){if(typeof b!="function")throw new po(a);return function(){var S=arguments;switch(S.length){case 0:return!b.call(this);case 1:return!b.call(this,S[0]);case 2:return!b.call(this,S[0],S[1]);case 3:return!b.call(this,S[0],S[1],S[2])}return!b.apply(this,S)}}function Yie(b){return sj(2,b)}var Xie=Ire(function(b,S){S=S.length==1&&bt(S[0])?qn(S[0],Mi(at())):qn(ns(S,1),Mi(at()));var N=S.length;return Rt(function(O){for(var j=-1,q=vs(O.length,N);++j<q;)O[j]=S[j].call(this,O[j]);return Ni(b,this,O)})}),fP=Rt(function(b,S){var N=ou(S,Mp(fP));return $l(b,A,n,S,N)}),cj=Rt(function(b,S){var N=ou(S,Mp(cj));return $l(b,k,n,S,N)}),Qie=Fl(function(b,S){return $l(b,E,n,n,n,S)});function Jie(b,S){if(typeof b!="function")throw new po(a);return S=S===n?S:xt(S),Rt(b,S)}function Zie(b,S){if(typeof b!="function")throw new po(a);return S=S==null?0:Dr(xt(S),0),Rt(function(N){var O=N[S],j=du(N,0,S);return O&&iu(j,O),Ni(b,this,j)})}function eoe(b,S,N){var O=!0,j=!0;if(typeof b!="function")throw new po(a);return Xn(N)&&(O="leading"in N?!!N.leading:O,j="trailing"in N?!!N.trailing:j),lj(b,S,{leading:O,maxWait:S,trailing:j})}function toe(b){return rj(b,1)}function noe(b,S){return fP(XR(S),b)}function roe(){if(!arguments.length)return[];var b=arguments[0];return bt(b)?b:[b]}function soe(b){return go(b,m)}function ioe(b,S){return S=typeof S=="function"?S:n,go(b,m,S)}function ooe(b){return go(b,l|m)}function aoe(b,S){return S=typeof S=="function"?S:n,go(b,l|m,S)}function loe(b,S){return S==null||X2(b,S,qr(S))}function Xo(b,S){return b===S||b!==b&&S!==S}var coe=_x(FR),uoe=_x(function(b,S){return b>=S}),af=nF(function(){return arguments}())?nF:function(b){return or(b)&&un.call(b,"callee")&&!U2.call(b,"callee")},bt=pe.isArray,doe=S2?Mi(S2):bre;function si(b){return b!=null&&kx(b.length)&&!zl(b)}function pr(b){return or(b)&&si(b)}function foe(b){return b===!0||b===!1||or(b)&&$s(b)==be}var fu=Ane||SP,hoe=E2?Mi(E2):wre;function poe(b){return or(b)&&b.nodeType===1&&!oy(b)}function moe(b){if(b==null)return!0;if(si(b)&&(bt(b)||typeof b=="string"||typeof b.splice=="function"||fu(b)||Op(b)||af(b)))return!b.length;var S=ys(b);if(S==$e||S==Qt)return!b.size;if(sy(b))return!BR(b).length;for(var N in b)if(un.call(b,N))return!1;return!0}function goe(b,S){return ty(b,S)}function voe(b,S,N){N=typeof N=="function"?N:n;var O=N?N(b,S):n;return O===n?ty(b,S,n,N):!!O}function hP(b){if(!or(b))return!1;var S=$s(b);return S==Oe||S==_e||typeof b.message=="string"&&typeof b.name=="string"&&!oy(b)}function yoe(b){return typeof b=="number"&&W2(b)}function zl(b){if(!Xn(b))return!1;var S=$s(b);return S==Ne||S==ye||S==ie||S==Xt}function uj(b){return typeof b=="number"&&b==xt(b)}function kx(b){return typeof b=="number"&&b>-1&&b%1==0&&b<=H}function Xn(b){var S=typeof b;return b!=null&&(S=="object"||S=="function")}function or(b){return b!=null&&typeof b=="object"}var dj=C2?Mi(C2):xre;function boe(b,S){return b===S||zR(b,S,rP(S))}function woe(b,S,N){return N=typeof N=="function"?N:n,zR(b,S,rP(S),N)}function _oe(b){return fj(b)&&b!=+b}function xoe(b){if(ise(b))throw new vt(i);return rF(b)}function Soe(b){return b===null}function Eoe(b){return b==null}function fj(b){return typeof b=="number"||or(b)&&$s(b)==ut}function oy(b){if(!or(b)||$s(b)!=yt)return!1;var S=rx(b);if(S===null)return!0;var N=un.call(S,"constructor")&&S.constructor;return typeof N=="function"&&N instanceof N&&Z_.call(N)==wne}var pP=A2?Mi(A2):Sre;function Coe(b){return uj(b)&&b>=-9007199254740991&&b<=H}var hj=R2?Mi(R2):Ere;function Dx(b){return typeof b=="string"||!bt(b)&&or(b)&&$s(b)==Z}function Li(b){return typeof b=="symbol"||or(b)&&$s(b)==fe}var Op=P2?Mi(P2):Cre;function Aoe(b){return b===n}function Roe(b){return or(b)&&ys(b)==Pe}function Poe(b){return or(b)&&$s(b)==Me}var Toe=_x(UR),koe=_x(function(b,S){return b<=S});function pj(b){if(!b)return[];if(si(b))return Dx(b)?Ko(b):ri(b);if(Gv&&b[Gv])return lne(b[Gv]());var S=ys(b),N=S==$e?TR:S==Qt?X_:Lp;return N(b)}function Bl(b){if(!b)return b===0?b:0;if(b=bo(b),b===W||b===-1/0){var S=b<0?-1:1;return S*ee}return b===b?b:0}function xt(b){var S=Bl(b),N=S%1;return S===S?N?S-N:S:0}function mj(b){return b?nf(xt(b),0,X):0}function bo(b){if(typeof b=="number")return b;if(Li(b))return re;if(Xn(b)){var S=typeof b.valueOf=="function"?b.valueOf():b;b=Xn(S)?S+"":S}if(typeof b!="string")return b===0?b:+b;b=O2(b);var N=Tr.test(b);return N||qt.test(b)?Vte(b.slice(2),N?2:8):It.test(b)?re:+b}function gj(b){return za(b,ii(b))}function Doe(b){return b?nf(xt(b),-9007199254740991,H):b===0?b:0}function sn(b){return b==null?"":Oi(b)}var Noe=Dp(function(b,S){if(sy(S)||si(S)){za(S,qr(S),b);return}for(var N in S)un.call(S,N)&&Jv(b,N,S[N])}),vj=Dp(function(b,S){za(S,ii(S),b)}),Nx=Dp(function(b,S,N,O){za(S,ii(S),b,O)}),Moe=Dp(function(b,S,N,O){za(S,qr(S),b,O)}),Ooe=Fl(LR);function Loe(b,S){var N=kp(b);return S==null?N:Y2(N,S)}var Ioe=Rt(function(b,S){b=Cn(b);var N=-1,O=S.length,j=O>2?S[2]:n;for(j&&Fs(S[0],S[1],j)&&(O=1);++N<O;)for(var q=S[N],Q=ii(q),ne=-1,le=Q.length;++ne<le;){var Se=Q[ne],Ee=b[Se];(Ee===n||Xo(Ee,Rp[Se])&&!un.call(b,Se))&&(b[Se]=q[Se])}return b}),$oe=Rt(function(b){return b.push(n,OF),Ni(yj,n,b)});function Foe(b,S){return k2(b,at(S,3),ja)}function joe(b,S){return k2(b,at(S,3),$R)}function zoe(b,S){return b==null?b:IR(b,at(S,3),ii)}function Boe(b,S){return b==null?b:eF(b,at(S,3),ii)}function Uoe(b,S){return b&&ja(b,at(S,3))}function Hoe(b,S){return b&&$R(b,at(S,3))}function Woe(b){return b==null?[]:hx(b,qr(b))}function Voe(b){return b==null?[]:hx(b,ii(b))}function mP(b,S,N){var O=b==null?n:rf(b,S);return O===n?N:O}function qoe(b,S){return b!=null&&$F(b,S,mre)}function gP(b,S){return b!=null&&$F(b,S,gre)}var Goe=TF(function(b,S,N){S!=null&&typeof S.toString!="function"&&(S=ex.call(S)),b[S]=N},yP(oi)),Koe=TF(function(b,S,N){S!=null&&typeof S.toString!="function"&&(S=ex.call(S)),un.call(b,S)?b[S].push(N):b[S]=[N]},at),Yoe=Rt(ey);function qr(b){return si(b)?G2(b):BR(b)}function ii(b){return si(b)?G2(b,!0):Are(b)}function Xoe(b,S){var N={};return S=at(S,3),ja(b,function(O,j,q){Il(N,S(O,j,q),O)}),N}function Qoe(b,S){var N={};return S=at(S,3),ja(b,function(O,j,q){Il(N,j,S(O,j,q))}),N}var Joe=Dp(function(b,S,N){px(b,S,N)}),yj=Dp(function(b,S,N,O){px(b,S,N,O)}),Zoe=Fl(function(b,S){var N={};if(b==null)return N;var O=!1;S=qn(S,function(q){return q=uu(q,b),O||(O=q.length>1),q}),za(b,tP(b),N),O&&(N=go(N,l|d|m,Gre));for(var j=S.length;j--;)GR(N,S[j]);return N});function eae(b,S){return bj(b,Tx(at(S)))}var tae=Fl(function(b,S){return b==null?{}:Pre(b,S)});function bj(b,S){if(b==null)return{};var N=qn(tP(b),function(O){return[O]});return S=at(S),uF(b,N,function(O,j){return S(O,j[0])})}function nae(b,S,N){S=uu(S,b);var O=-1,j=S.length;for(j||(j=1,b=n);++O<j;){var q=b==null?n:b[Ba(S[O])];q===n&&(O=j,q=N),b=zl(q)?q.call(b):q}return b}function rae(b,S,N){return b==null?b:ny(b,S,N)}function sae(b,S,N,O){return O=typeof O=="function"?O:n,b==null?b:ny(b,S,N,O)}var wj=NF(qr),_j=NF(ii);function iae(b,S,N){var O=bt(b),j=O||fu(b)||Op(b);if(S=at(S,4),N==null){var q=b&&b.constructor;j?N=O?new q:[]:Xn(b)?N=zl(q)?kp(rx(b)):{}:N={}}return(j?ho:ja)(b,function(Q,ne,le){return S(N,Q,ne,le)}),N}function oae(b,S){return b==null?!0:GR(b,S)}function aae(b,S,N){return b==null?b:mF(b,S,XR(N))}function lae(b,S,N,O){return O=typeof O=="function"?O:n,b==null?b:mF(b,S,XR(N),O)}function Lp(b){return b==null?[]:PR(b,qr(b))}function cae(b){return b==null?[]:PR(b,ii(b))}function uae(b,S,N){return N===n&&(N=S,S=n),N!==n&&(N=bo(N),N=N===N?N:0),S!==n&&(S=bo(S),S=S===S?S:0),nf(bo(b),S,N)}function dae(b,S,N){return S=Bl(S),N===n?(N=S,S=0):N=Bl(N),b=bo(b),vre(b,S,N)}function fae(b,S,N){if(N&&typeof N!="boolean"&&Fs(b,S,N)&&(S=N=n),N===n&&(typeof S=="boolean"?(N=S,S=n):typeof b=="boolean"&&(N=b,b=n)),b===n&&S===n?(b=0,S=1):(b=Bl(b),S===n?(S=b,b=0):S=Bl(S)),b>S){var O=b;b=S,S=O}if(N||b%1||S%1){var j=V2();return vs(b+j*(S-b+Wte("1e-"+((j+"").length-1))),S)}return WR(b,S)}var hae=Np(function(b,S,N){return S=S.toLowerCase(),b+(N?xj(S):S)});function xj(b){return vP(sn(b).toLowerCase())}function Sj(b){return b=sn(b),b&&b.replace(nu,rne).replace(Ote,"")}function pae(b,S,N){b=sn(b),S=Oi(S);var O=b.length;N=N===n?O:nf(xt(N),0,O);var j=N;return N-=S.length,N>=0&&b.slice(N,j)==S}function mae(b){return b=sn(b),b&&At.test(b)?b.replace(nt,sne):b}function gae(b){return b=sn(b),b&&oe.test(b)?b.replace(te,"\\$&"):b}var vae=Np(function(b,S,N){return b+(N?"-":"")+S.toLowerCase()}),yae=Np(function(b,S,N){return b+(N?" ":"")+S.toLowerCase()}),bae=AF("toLowerCase");function wae(b,S,N){b=sn(b),S=xt(S);var O=S?Cp(b):0;if(!S||O>=S)return b;var j=(S-O)/2;return wx(ax(j),N)+b+wx(ox(j),N)}function _ae(b,S,N){b=sn(b),S=xt(S);var O=S?Cp(b):0;return S&&O<S?b+wx(S-O,N):b}function xae(b,S,N){b=sn(b),S=xt(S);var O=S?Cp(b):0;return S&&O<S?wx(S-O,N)+b:b}function Sae(b,S,N){return N||S==null?S=0:S&&(S=+S),kne(sn(b).replace(he,""),S||0)}function Eae(b,S,N){return(N?Fs(b,S,N):S===n)?S=1:S=xt(S),VR(sn(b),S)}function Cae(){var b=arguments,S=sn(b[0]);return b.length<3?S:S.replace(b[1],b[2])}var Aae=Np(function(b,S,N){return b+(N?"_":"")+S.toLowerCase()});function Rae(b,S,N){return N&&typeof N!="number"&&Fs(b,S,N)&&(S=N=n),N=N===n?X:N>>>0,N?(b=sn(b),b&&(typeof S=="string"||S!=null&&!pP(S))&&(S=Oi(S),!S&&Ep(b))?du(Ko(b),0,N):b.split(S,N)):[]}var Pae=Np(function(b,S,N){return b+(N?" ":"")+vP(S)});function Tae(b,S,N){return b=sn(b),N=N==null?0:nf(xt(N),0,b.length),S=Oi(S),b.slice(N,N+S.length)==S}function kae(b,S,N){var O=V.templateSettings;N&&Fs(b,S,N)&&(S=n),b=sn(b),S=Nx({},S,O,MF);var j=Nx({},S.imports,O.imports,MF),q=qr(j),Q=PR(j,q),ne,le,Se=0,Ee=S.interpolate||Fa,Re="__p += '",Fe=kR((S.escape||Fa).source+"|"+Ee.source+"|"+(Ee===cn?Ze:Fa).source+"|"+(S.evaluate||Fa).source+"|$","g"),Je="//# sourceURL="+(un.call(S,"sourceURL")?(S.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++jte+"]")+`
|
||
`;b.replace(Fe,function(ct,Dt,jt,Ii,js,$i){return jt||(jt=Ii),Re+=b.slice(Se,$i).replace(Go,ine),Dt&&(ne=!0,Re+=`' +
|
||
__e(`+Dt+`) +
|
||
'`),js&&(le=!0,Re+=`';
|
||
`+js+`;
|
||
__p += '`),jt&&(Re+=`' +
|
||
((__t = (`+jt+`)) == null ? '' : __t) +
|
||
'`),Se=$i+ct.length,ct}),Re+=`';
|
||
`;var lt=un.call(S,"variable")&&S.variable;if(!lt)Re=`with (obj) {
|
||
`+Re+`
|
||
}
|
||
`;else if(Xe.test(lt))throw new vt(o);Re=(le?Re.replace(Be,""):Re).replace(it,"$1").replace(ot,"$1;"),Re="function("+(lt||"obj")+`) {
|
||
`+(lt?"":`obj || (obj = {});
|
||
`)+"var __t, __p = ''"+(ne?", __e = _.escape":"")+(le?`, __j = Array.prototype.join;
|
||
function print() { __p += __j.call(arguments, '') }
|
||
`:`;
|
||
`)+Re+`return __p
|
||
}`;var Ct=Cj(function(){return tn(q,Je+"return "+Re).apply(n,Q)});if(Ct.source=Re,hP(Ct))throw Ct;return Ct}function Dae(b){return sn(b).toLowerCase()}function Nae(b){return sn(b).toUpperCase()}function Mae(b,S,N){if(b=sn(b),b&&(N||S===n))return O2(b);if(!b||!(S=Oi(S)))return b;var O=Ko(b),j=Ko(S),q=L2(O,j),Q=I2(O,j)+1;return du(O,q,Q).join("")}function Oae(b,S,N){if(b=sn(b),b&&(N||S===n))return b.slice(0,F2(b)+1);if(!b||!(S=Oi(S)))return b;var O=Ko(b),j=I2(O,Ko(S))+1;return du(O,0,j).join("")}function Lae(b,S,N){if(b=sn(b),b&&(N||S===n))return b.replace(he,"");if(!b||!(S=Oi(S)))return b;var O=Ko(b),j=L2(O,Ko(S));return du(O,j).join("")}function Iae(b,S){var N=D,O=M;if(Xn(S)){var j="separator"in S?S.separator:j;N="length"in S?xt(S.length):N,O="omission"in S?Oi(S.omission):O}b=sn(b);var q=b.length;if(Ep(b)){var Q=Ko(b);q=Q.length}if(N>=q)return b;var ne=N-Cp(O);if(ne<1)return O;var le=Q?du(Q,0,ne).join(""):b.slice(0,ne);if(j===n)return le+O;if(Q&&(ne+=le.length-ne),pP(j)){if(b.slice(ne).search(j)){var Se,Ee=le;for(j.global||(j=kR(j.source,sn(gt.exec(j))+"g")),j.lastIndex=0;Se=j.exec(Ee);)var Re=Se.index;le=le.slice(0,Re===n?ne:Re)}}else if(b.indexOf(Oi(j),ne)!=ne){var Fe=le.lastIndexOf(j);Fe>-1&&(le=le.slice(0,Fe))}return le+O}function $ae(b){return b=sn(b),b&&Wt.test(b)?b.replace(Et,fne):b}var Fae=Np(function(b,S,N){return b+(N?" ":"")+S.toUpperCase()}),vP=AF("toUpperCase");function Ej(b,S,N){return b=sn(b),S=N?n:S,S===n?ane(b)?mne(b):Jte(b):b.match(S)||[]}var Cj=Rt(function(b,S){try{return Ni(b,n,S)}catch(N){return hP(N)?N:new vt(N)}}),jae=Fl(function(b,S){return ho(S,function(N){N=Ba(N),Il(b,N,dP(b[N],b))}),b});function zae(b){var S=b==null?0:b.length,N=at();return b=S?qn(b,function(O){if(typeof O[1]!="function")throw new po(a);return[N(O[0]),O[1]]}):[],Rt(function(O){for(var j=-1;++j<S;){var q=b[j];if(Ni(q[0],this,O))return Ni(q[1],this,O)}})}function Bae(b){return fre(go(b,l))}function yP(b){return function(){return b}}function Uae(b,S){return b==null||b!==b?S:b}var Hae=PF(),Wae=PF(!0);function oi(b){return b}function bP(b){return sF(typeof b=="function"?b:go(b,l))}function Vae(b){return oF(go(b,l))}function qae(b,S){return aF(b,go(S,l))}var Gae=Rt(function(b,S){return function(N){return ey(N,b,S)}}),Kae=Rt(function(b,S){return function(N){return ey(b,N,S)}});function wP(b,S,N){var O=qr(S),j=hx(S,O);N==null&&!(Xn(S)&&(j.length||!O.length))&&(N=S,S=b,b=this,j=hx(S,qr(S)));var q=!(Xn(N)&&"chain"in N)||!!N.chain,Q=zl(b);return ho(j,function(ne){var le=S[ne];b[ne]=le,Q&&(b.prototype[ne]=function(){var Se=this.__chain__;if(q||Se){var Ee=b(this.__wrapped__),Re=Ee.__actions__=ri(this.__actions__);return Re.push({func:le,args:arguments,thisArg:b}),Ee.__chain__=Se,Ee}return le.apply(b,iu([this.value()],arguments))})}),b}function Yae(){return ts._===this&&(ts._=_ne),this}function _P(){}function Xae(b){return b=xt(b),Rt(function(S){return lF(S,b)})}var Qae=JR(qn),Jae=JR(T2),Zae=JR(SR);function Aj(b){return iP(b)?ER(Ba(b)):Tre(b)}function ele(b){return function(S){return b==null?n:rf(b,S)}}var tle=kF(),nle=kF(!0);function xP(){return[]}function SP(){return!1}function rle(){return{}}function sle(){return""}function ile(){return!0}function ole(b,S){if(b=xt(b),b<1||b>H)return[];var N=X,O=vs(b,X);S=at(S),b-=X;for(var j=RR(O,S);++N<b;)S(N);return j}function ale(b){return bt(b)?qn(b,Ba):Li(b)?[b]:ri(qF(sn(b)))}function lle(b){var S=++bne;return sn(b)+S}var cle=bx(function(b,S){return b+S},0),ule=ZR("ceil"),dle=bx(function(b,S){return b/S},1),fle=ZR("floor");function hle(b){return b&&b.length?fx(b,oi,FR):n}function ple(b,S){return b&&b.length?fx(b,at(S,2),FR):n}function mle(b){return N2(b,oi)}function gle(b,S){return N2(b,at(S,2))}function vle(b){return b&&b.length?fx(b,oi,UR):n}function yle(b,S){return b&&b.length?fx(b,at(S,2),UR):n}var ble=bx(function(b,S){return b*S},1),wle=ZR("round"),_le=bx(function(b,S){return b-S},0);function xle(b){return b&&b.length?AR(b,oi):0}function Sle(b,S){return b&&b.length?AR(b,at(S,2)):0}return V.after=Vie,V.ary=rj,V.assign=Noe,V.assignIn=vj,V.assignInWith=Nx,V.assignWith=Moe,V.at=Ooe,V.before=sj,V.bind=dP,V.bindAll=jae,V.bindKey=ij,V.castArray=roe,V.chain=ej,V.chunk=fse,V.compact=hse,V.concat=pse,V.cond=zae,V.conforms=Bae,V.constant=yP,V.countBy=xie,V.create=Loe,V.curry=oj,V.curryRight=aj,V.debounce=lj,V.defaults=Ioe,V.defaultsDeep=$oe,V.defer=qie,V.delay=Gie,V.difference=mse,V.differenceBy=gse,V.differenceWith=vse,V.drop=yse,V.dropRight=bse,V.dropRightWhile=wse,V.dropWhile=_se,V.fill=xse,V.filter=Eie,V.flatMap=Rie,V.flatMapDeep=Pie,V.flatMapDepth=Tie,V.flatten=XF,V.flattenDeep=Sse,V.flattenDepth=Ese,V.flip=Kie,V.flow=Hae,V.flowRight=Wae,V.fromPairs=Cse,V.functions=Woe,V.functionsIn=Voe,V.groupBy=kie,V.initial=Rse,V.intersection=Pse,V.intersectionBy=Tse,V.intersectionWith=kse,V.invert=Goe,V.invertBy=Koe,V.invokeMap=Nie,V.iteratee=bP,V.keyBy=Mie,V.keys=qr,V.keysIn=ii,V.map=Ax,V.mapKeys=Xoe,V.mapValues=Qoe,V.matches=Vae,V.matchesProperty=qae,V.memoize=Px,V.merge=Joe,V.mergeWith=yj,V.method=Gae,V.methodOf=Kae,V.mixin=wP,V.negate=Tx,V.nthArg=Xae,V.omit=Zoe,V.omitBy=eae,V.once=Yie,V.orderBy=Oie,V.over=Qae,V.overArgs=Xie,V.overEvery=Jae,V.overSome=Zae,V.partial=fP,V.partialRight=cj,V.partition=Lie,V.pick=tae,V.pickBy=bj,V.property=Aj,V.propertyOf=ele,V.pull=Ose,V.pullAll=JF,V.pullAllBy=Lse,V.pullAllWith=Ise,V.pullAt=$se,V.range=tle,V.rangeRight=nle,V.rearg=Qie,V.reject=Fie,V.remove=Fse,V.rest=Jie,V.reverse=cP,V.sampleSize=zie,V.set=rae,V.setWith=sae,V.shuffle=Bie,V.slice=jse,V.sortBy=Wie,V.sortedUniq=qse,V.sortedUniqBy=Gse,V.split=Rae,V.spread=Zie,V.tail=Kse,V.take=Yse,V.takeRight=Xse,V.takeRightWhile=Qse,V.takeWhile=Jse,V.tap=hie,V.throttle=eoe,V.thru=Cx,V.toArray=pj,V.toPairs=wj,V.toPairsIn=_j,V.toPath=ale,V.toPlainObject=gj,V.transform=iae,V.unary=toe,V.union=Zse,V.unionBy=eie,V.unionWith=tie,V.uniq=nie,V.uniqBy=rie,V.uniqWith=sie,V.unset=oae,V.unzip=uP,V.unzipWith=ZF,V.update=aae,V.updateWith=lae,V.values=Lp,V.valuesIn=cae,V.without=iie,V.words=Ej,V.wrap=noe,V.xor=oie,V.xorBy=aie,V.xorWith=lie,V.zip=cie,V.zipObject=uie,V.zipObjectDeep=die,V.zipWith=fie,V.entries=wj,V.entriesIn=_j,V.extend=vj,V.extendWith=Nx,wP(V,V),V.add=cle,V.attempt=Cj,V.camelCase=hae,V.capitalize=xj,V.ceil=ule,V.clamp=uae,V.clone=soe,V.cloneDeep=ooe,V.cloneDeepWith=aoe,V.cloneWith=ioe,V.conformsTo=loe,V.deburr=Sj,V.defaultTo=Uae,V.divide=dle,V.endsWith=pae,V.eq=Xo,V.escape=mae,V.escapeRegExp=gae,V.every=Sie,V.find=Cie,V.findIndex=KF,V.findKey=Foe,V.findLast=Aie,V.findLastIndex=YF,V.findLastKey=joe,V.floor=fle,V.forEach=tj,V.forEachRight=nj,V.forIn=zoe,V.forInRight=Boe,V.forOwn=Uoe,V.forOwnRight=Hoe,V.get=mP,V.gt=coe,V.gte=uoe,V.has=qoe,V.hasIn=gP,V.head=QF,V.identity=oi,V.includes=Die,V.indexOf=Ase,V.inRange=dae,V.invoke=Yoe,V.isArguments=af,V.isArray=bt,V.isArrayBuffer=doe,V.isArrayLike=si,V.isArrayLikeObject=pr,V.isBoolean=foe,V.isBuffer=fu,V.isDate=hoe,V.isElement=poe,V.isEmpty=moe,V.isEqual=goe,V.isEqualWith=voe,V.isError=hP,V.isFinite=yoe,V.isFunction=zl,V.isInteger=uj,V.isLength=kx,V.isMap=dj,V.isMatch=boe,V.isMatchWith=woe,V.isNaN=_oe,V.isNative=xoe,V.isNil=Eoe,V.isNull=Soe,V.isNumber=fj,V.isObject=Xn,V.isObjectLike=or,V.isPlainObject=oy,V.isRegExp=pP,V.isSafeInteger=Coe,V.isSet=hj,V.isString=Dx,V.isSymbol=Li,V.isTypedArray=Op,V.isUndefined=Aoe,V.isWeakMap=Roe,V.isWeakSet=Poe,V.join=Dse,V.kebabCase=vae,V.last=yo,V.lastIndexOf=Nse,V.lowerCase=yae,V.lowerFirst=bae,V.lt=Toe,V.lte=koe,V.max=hle,V.maxBy=ple,V.mean=mle,V.meanBy=gle,V.min=vle,V.minBy=yle,V.stubArray=xP,V.stubFalse=SP,V.stubObject=rle,V.stubString=sle,V.stubTrue=ile,V.multiply=ble,V.nth=Mse,V.noConflict=Yae,V.noop=_P,V.now=Rx,V.pad=wae,V.padEnd=_ae,V.padStart=xae,V.parseInt=Sae,V.random=fae,V.reduce=Iie,V.reduceRight=$ie,V.repeat=Eae,V.replace=Cae,V.result=nae,V.round=wle,V.runInContext=ae,V.sample=jie,V.size=Uie,V.snakeCase=Aae,V.some=Hie,V.sortedIndex=zse,V.sortedIndexBy=Bse,V.sortedIndexOf=Use,V.sortedLastIndex=Hse,V.sortedLastIndexBy=Wse,V.sortedLastIndexOf=Vse,V.startCase=Pae,V.startsWith=Tae,V.subtract=_le,V.sum=xle,V.sumBy=Sle,V.template=kae,V.times=ole,V.toFinite=Bl,V.toInteger=xt,V.toLength=mj,V.toLower=Dae,V.toNumber=bo,V.toSafeInteger=Doe,V.toString=sn,V.toUpper=Nae,V.trim=Mae,V.trimEnd=Oae,V.trimStart=Lae,V.truncate=Iae,V.unescape=$ae,V.uniqueId=lle,V.upperCase=Fae,V.upperFirst=vP,V.each=tj,V.eachRight=nj,V.first=QF,wP(V,function(){var b={};return ja(V,function(S,N){un.call(V.prototype,N)||(b[N]=S)}),b}(),{chain:!1}),V.VERSION=r,ho(["bind","bindKey","curry","curryRight","partial","partialRight"],function(b){V[b].placeholder=V}),ho(["drop","take"],function(b,S){$t.prototype[b]=function(N){N=N===n?1:Dr(xt(N),0);var O=this.__filtered__&&!S?new $t(this):this.clone();return O.__filtered__?O.__takeCount__=vs(N,O.__takeCount__):O.__views__.push({size:vs(N,X),type:b+(O.__dir__<0?"Right":"")}),O},$t.prototype[b+"Right"]=function(N){return this.reverse()[b](N).reverse()}}),ho(["filter","map","takeWhile"],function(b,S){var N=S+1,O=N==F||N==Y;$t.prototype[b]=function(j){var q=this.clone();return q.__iteratees__.push({iteratee:at(j,3),type:N}),q.__filtered__=q.__filtered__||O,q}}),ho(["head","last"],function(b,S){var N="take"+(S?"Right":"");$t.prototype[b]=function(){return this[N](1).value()[0]}}),ho(["initial","tail"],function(b,S){var N="drop"+(S?"":"Right");$t.prototype[b]=function(){return this.__filtered__?new $t(this):this[N](1)}}),$t.prototype.compact=function(){return this.filter(oi)},$t.prototype.find=function(b){return this.filter(b).head()},$t.prototype.findLast=function(b){return this.reverse().find(b)},$t.prototype.invokeMap=Rt(function(b,S){return typeof b=="function"?new $t(this):this.map(function(N){return ey(N,b,S)})}),$t.prototype.reject=function(b){return this.filter(Tx(at(b)))},$t.prototype.slice=function(b,S){b=xt(b);var N=this;return N.__filtered__&&(b>0||S<0)?new $t(N):(b<0?N=N.takeRight(-b):b&&(N=N.drop(b)),S!==n&&(S=xt(S),N=S<0?N.dropRight(-S):N.take(S-b)),N)},$t.prototype.takeRightWhile=function(b){return this.reverse().takeWhile(b).reverse()},$t.prototype.toArray=function(){return this.take(X)},ja($t.prototype,function(b,S){var N=/^(?:filter|find|map|reject)|While$/.test(S),O=/^(?:head|last)$/.test(S),j=V[O?"take"+(S=="last"?"Right":""):S],q=O||/^find/.test(S);j&&(V.prototype[S]=function(){var Q=this.__wrapped__,ne=O?[1]:arguments,le=Q instanceof $t,Se=ne[0],Ee=le||bt(Q),Re=function(Dt){var jt=j.apply(V,iu([Dt],ne));return O&&Fe?jt[0]:jt};Ee&&N&&typeof Se=="function"&&Se.length!=1&&(le=Ee=!1);var Fe=this.__chain__,Je=!!this.__actions__.length,lt=q&&!Fe,Ct=le&&!Je;if(!q&&Ee){Q=Ct?Q:new $t(this);var ct=b.apply(Q,ne);return ct.__actions__.push({func:Cx,args:[Re],thisArg:n}),new mo(ct,Fe)}return lt&&Ct?b.apply(this,ne):(ct=this.thru(Re),lt?O?ct.value()[0]:ct.value():ct)})}),ho(["pop","push","shift","sort","splice","unshift"],function(b){var S=Q_[b],N=/^(?:push|sort|unshift)$/.test(b)?"tap":"thru",O=/^(?:pop|shift)$/.test(b);V.prototype[b]=function(){var j=arguments;if(O&&!this.__chain__){var q=this.value();return S.apply(bt(q)?q:[],j)}return this[N](function(Q){return S.apply(bt(Q)?Q:[],j)})}}),ja($t.prototype,function(b,S){var N=V[S];if(N){var O=N.name+"";un.call(Tp,O)||(Tp[O]=[]),Tp[O].push({name:S,func:N})}}),Tp[yx(n,g).name]=[{name:"wrapper",func:n}],$t.prototype.clone=$ne,$t.prototype.reverse=Fne,$t.prototype.value=jne,V.prototype.at=pie,V.prototype.chain=mie,V.prototype.commit=gie,V.prototype.next=vie,V.prototype.plant=bie,V.prototype.reverse=wie,V.prototype.toJSON=V.prototype.valueOf=V.prototype.value=_ie,V.prototype.first=V.prototype.head,Gv&&(V.prototype[Gv]=yie),V},Ap=gne();Jd?((Jd.exports=Ap)._=Ap,bR._=Ap):ts._=Ap}).call(yr)})(M1,M1.exports);var tIe=M1.exports;const nIe=({amount:t,scale:e})=>{const n=10**e;return Number(t)/n},x5e=t=>{const e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${e}-${n}-${r}`},ek={locale:"es-ES"},Qp={amount:null,currencyCode:N1.DEFAULT_CURRENCY_CODE,scale:2},ar=class ar extends MQ{constructor(n,r,s){super(n);He(this,"_isNull");He(this,"_options");He(this,"isEmpty",()=>this.isNull());He(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(r),this._options=Object.freeze(s)}static validate(n,r){const s=dr.any().optional().valid(null),i=dr.number().label(r.label?r.label:"amount"),a=dr.alternatives(s,i);return nc.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=Qp,r=ek){if(n===null)throw new Error("InvalidParams: props params is missing");const{amount:s=Qp.amount,currencyCode:i=Qp.currencyCode,scale:a=Qp.scale}=n||{},o=ar.validate(s,r);if(o.isFailure)return Ca.fail(DQ(ow.INVALID_INPUT_DATA,o.error.message,r));const c=ar.sanitize(o.object),u=i,f=wS({amount:Number(c),currency:u,precision:a}).setLocale(r.locale);return Ca.ok(new this(f,tIe.isNull(c),r))}static createFromFormattedValue(n,r,s=ar.DEFAULT_SCALE,i={locale:ek.locale}){if(n===null||n==="")return ar.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)),ar.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 Ca.ok(new ar(n,!1,ek))}static normalizeScale(n){return wS.normalizePrecision(n.map(r=>r.props)).map(r=>ar.createFromDinero(r).object)}static minimum(n){return ar.createFromDinero(wS.minimum(n.map(r=>r.props))).object}static maximum(n){return ar.createFromDinero(wS.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:nIe({amount:n,scale:r}));const i=Math.pow(10,r);return(Number(n)/i).toFixed(r)}toString(){return ar._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?ar.create({amount:null,scale:n,currencyCode:this.getCurrency().code}).object:ar.createFromDinero(this.props.convertPrecision(n,r)).object}getCurrency(){return N1.createFromCode(this.props.getCurrency()).object}getLocale(){return this.props.getLocale()}add(n){return ar.createFromDinero(this.props.add(n.props)).object}subtract(n){return ar.createFromDinero(this.props.subtract(n.props)).object}multiply(n,r){return ar.createFromDinero(this.props.multiply(n,r)).object}divide(n,r){return ar.createFromDinero(this.props.divide(n,r)).object}percentage(n,r){return ar.createFromDinero(this.props.percentage(n,r)).object}allocate(n){return this.props.allocate(n).map(r=>ar.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()}};He(ar,"DEFAULT_SCALE",Qp.scale),He(ar,"DEFAULT_CURRENCY_CODE",Qp.currencyCode);let O1=ar;class S5e extends dr.ValidationError{}class E5e extends dr.ValidationError{}const bb=0,M$=10,NN=1,$Q=9999,FQ=_.createContext(void 0),rIe=({dataSource:t,children:e})=>P.jsx(FQ.Provider,{value:t,children:e}),C5e=[5,10,15,30,50,75,100],jQ=(t=bb,e=M$)=>{const[n,r]=_.useState({pageIndex:t,pageSize:e});return[n,i=>{const a=i;return a.pageIndex<bb&&(a.pageIndex=bb),(i.pageSize<NN||i.pageSize>$Q)&&(a.pageSize=NN),r(o=>({...o,pageIndex:i.pageIndex,pageSize:i.pageSize})),a}]},sIe=(t=bb,e=M$)=>{const[n,r]=DLe(),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<t&&(d=t),d},[s,t]),o=_.useMemo(()=>{const l=parseInt(i??"",10);let d=isNaN(l)?e:l;return(d<NN||d>$Q)&&(d=e),d},[i,e]),[c,u]=jQ(a,o);return[c,l=>{const d=u(l);r({page_index:String(d.pageIndex),page_size:String(d.pageSize)})}]},iIe=({syncWithLocation:t=!0,initialPageIndex:e,initialPageSize:n})=>{const[r,s]=sIe(),[i,a]=jQ(e,n);return t?[r,s]:[i,a]},oIe=_.createContext(null),A5e=({syncWithLocation:t=!0,initialGlobalFilter:e=[],initialPageIndex:n,initialPageSize:r,children:s})=>{const[i,a]=iIe({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(oIe.Provider,{value:{pagination:i,setPagination:a,sorting:u,setSorting:f,globalFilter:o,setGlobalFilter:c,resetGlobalFilter:d,isFiltered:l},children:s})},aIe=se.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:ce("flex items-center gap-2",t),...e}));aIe.displayName="ButtonGroup";const lIe=({label:t=ft("common.cancel"),...e})=>P.jsx(Ci,{type:"button",variant:"secondary",...e,children:t});lIe.displayName="CancelButton";const cIe=Ho("",{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"}}),zQ=se.forwardRef(({className:t,label:e,size:n,icon:r,children:s,...i},a)=>{const o=!!r;return P.jsxs(Ci,{ref:a,size:n,className:ce(o?"gap-1":"",t),...i,children:[o&&P.jsx(r,{className:ce(cIe({size:n}))}),P.jsx(P.Fragment,{children:e||s})]})});zQ.displayName="CustomButton";const uIe=({label:t=ft("common.submit"),...e})=>P.jsx(zQ,{type:"submit",label:t,variant:"default",...e});uIe.displayName="SubmitButton";const dIe=Ho("p-6",{variants:{variant:{full:"w-full",boxed:"container max-w-3xl lg:max-w-5xl mx-auto"}},defaultVariants:{variant:"full"}}),fIe=({className:t,as:e="article",variant:n,...r})=>P.jsx(e,{className:ce(dIe({variant:n,className:t})),...r});fIe.displayName="Container";const hIe=()=>{const t=Fv();return P.jsxs(Ci,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:()=>t(-1),children:[P.jsx(pL,{className:"w-4 h-4"}),P.jsx("span",{className:"sr-only",children:ft("common.back")})]})};function pIe(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return _.useMemo(()=>r=>{e.forEach(s=>s(r))},e)}const jA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function jv(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function O$(t){return"nodeType"in t}function ni(t){var e,n;return t?jv(t)?t:O$(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function L$(t){const{Document:e}=ni(t);return t instanceof e}function M_(t){return jv(t)?!1:t instanceof ni(t).HTMLElement}function BQ(t){return t instanceof ni(t).SVGElement}function zv(t){return t?jv(t)?t.document:O$(t)?L$(t)?t:M_(t)||BQ(t)?t.ownerDocument:document:document:document}const Da=jA?_.useLayoutEffect:_.useEffect;function zA(t){const e=_.useRef(t);return Da(()=>{e.current=t}),_.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return e.current==null?void 0:e.current(...r)},[])}function mIe(){const t=_.useRef(null),e=_.useCallback((r,s)=>{t.current=setInterval(r,s)},[]),n=_.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function lw(t,e){e===void 0&&(e=[t]);const n=_.useRef(t);return Da(()=>{n.current!==t&&(n.current=t)},e),n}function O_(t,e){const n=_.useRef();return _.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function L1(t){const e=zA(t),n=_.useRef(null),r=_.useCallback(s=>{s!==n.current&&(e==null||e(s,n.current)),n.current=s},[]);return[n,r]}function I1(t){const e=_.useRef();return _.useEffect(()=>{e.current=t},[t]),e.current}let tk={};function L_(t,e){return _.useMemo(()=>{if(e)return e;const n=tk[t]==null?0:tk[t]+1;return tk[t]=n,t+"-"+n},[t,e])}function UQ(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((i,a)=>{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 Um=UQ(1),$1=UQ(-1);function gIe(t){return"clientX"in t&&"clientY"in t}function BA(t){if(!t)return!1;const{KeyboardEvent:e}=ni(t.target);return e&&t instanceof e}function vIe(t){if(!t)return!1;const{TouchEvent:e}=ni(t.target);return e&&t instanceof e}function F1(t){if(vIe(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 gIe(t)?{x:t.clientX,y:t.clientY}:null}const rp=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[rp.Translate.toString(t),rp.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),T4="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function yIe(t){return t.matches(T4)?t:t.querySelector(T4)}const bIe={display:"none"};function wIe(t){let{id:e,value:n}=t;return se.createElement("div",{id:e,style:bIe},n)}function _Ie(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 xIe(){const[t,e]=_.useState("");return{announce:_.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const HQ=_.createContext(null);function SIe(t){const e=_.useContext(HQ);_.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function EIe(){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 CIe={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.
|
||
`},AIe={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 RIe(t){let{announcements:e=AIe,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=CIe}=t;const{announce:i,announcement:a}=xIe(),o=L_("DndLiveRegion"),[c,u]=_.useState(!1);if(_.useEffect(()=>{u(!0)},[]),SIe(_.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(wIe,{id:r,value:s.draggable}),se.createElement(_Ie,{id:o,announcement:a}));return n?Ns.createPortal(f,n):f}var Br;(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"})(Br||(Br={}));function j1(){}function R5e(t,e){return _.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function P5e(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return _.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const Na=Object.freeze({x:0,y:0});function PIe(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function TIe(t,e){const n=F1(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 kIe(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function DIe(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function NIe(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function k4(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 T5e=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=k4(e,e.left,e.top),i=[];for(const a of r){const{id:o}=a,c=n.get(o);if(c){const u=PIe(k4(c),s);i.push({id:o,data:{droppableContainer:a,value:u}})}}return i.sort(kIe)};function MIe(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<s&&n<i){const c=e.width*e.height,u=t.width*t.height,f=a*o,l=f/(c+u-f);return Number(l.toFixed(4))}return 0}const OIe=t=>{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=MIe(o,e);c>0&&s.push({id:a,data:{droppableContainer:i,value:c}})}}return s.sort(DIe)};function LIe(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function WQ(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:Na}function IIe(t){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i<r;i++)s[i-1]=arguments[i];return s.reduce((a,o)=>({...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 $Ie=IIe(1);function VQ(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function FIe(t,e,n){const r=VQ(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 jIe={ignoreTransform:!1};function Bv(t,e){e===void 0&&(e=jIe);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:u,transformOrigin:f}=ni(t).getComputedStyle(t);u&&(n=FIe(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 D4(t){return Bv(t,{ignoreTransform:!0})}function zIe(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function BIe(t,e){return e===void 0&&(e=ni(t).getComputedStyle(t)),e.position==="fixed"}function UIe(t,e){e===void 0&&(e=ni(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 I$(t,e){const n=[];function r(s){if(e!=null&&n.length>=e||!s)return n;if(L$(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!M_(s)||BQ(s)||n.includes(s))return n;const i=ni(t).getComputedStyle(s);return s!==t&&UIe(s,i)&&n.push(s),BIe(s,i)?n:r(s.parentNode)}return t?r(t):n}function qQ(t){const[e]=I$(t,1);return e??null}function nk(t){return!jA||!t?null:jv(t)?t:O$(t)?L$(t)||t===zv(t).scrollingElement?window:M_(t)?t:null:null}function GQ(t){return jv(t)?t.scrollX:t.scrollLeft}function KQ(t){return jv(t)?t.scrollY:t.scrollTop}function MN(t){return{x:GQ(t),y:KQ(t)}}var Qr;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Qr||(Qr={}));function YQ(t){return!jA||!t?!1:t===document.scrollingElement}function XQ(t){const e={x:0,y:0},n=YQ(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 HIe={x:.2,y:.2};function WIe(t,e,n,r,s){let{top:i,left:a,right:o,bottom:c}=n;r===void 0&&(r=10),s===void 0&&(s=HIe);const{isTop:u,isBottom:f,isLeft:l,isRight:d}=XQ(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=Qr.Backward,p.y=r*Math.abs((e.top+h.height-i)/h.height)):!f&&c>=e.bottom-h.height&&(m.y=Qr.Forward,p.y=r*Math.abs((e.bottom-h.height-c)/h.height)),!d&&o>=e.right-h.width?(m.x=Qr.Forward,p.x=r*Math.abs((e.right-h.width-o)/h.width)):!l&&a<=e.left+h.width&&(m.x=Qr.Backward,p.x=r*Math.abs((e.left+h.width-a)/h.width)),{direction:m,speed:p}}function VIe(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 QQ(t){return t.reduce((e,n)=>Um(e,MN(n)),Na)}function qIe(t){return t.reduce((e,n)=>e+GQ(n),0)}function GIe(t){return t.reduce((e,n)=>e+KQ(n),0)}function JQ(t,e){if(e===void 0&&(e=Bv),!t)return;const{top:n,left:r,bottom:s,right:i}=e(t);qQ(t)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const KIe=[["x",["left","right"],qIe],["y",["top","bottom"],GIe]];class $${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=I$(n),s=QQ(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,a,o]of KIe)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 wb{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 YIe(t){const{EventTarget:e}=ni(t);return t instanceof e?t:zv(t)}function rk(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 To;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(To||(To={}));function N4(t){t.preventDefault()}function XIe(t){t.stopPropagation()}var rn;(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"})(rn||(rn={}));const ZQ={start:[rn.Space,rn.Enter],cancel:[rn.Esc],end:[rn.Space,rn.Enter,rn.Tab]},QIe=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case rn.Right:return{...n,x:n.x+25};case rn.Left:return{...n,x:n.x-25};case rn.Down:return{...n,y:n.y+25};case rn.Up:return{...n,y:n.y-25}}};class eJ{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 wb(zv(n)),this.windowListeners=new wb(ni(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(To.Resize,this.handleCancel),this.windowListeners.add(To.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(To.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&JQ(r),n(Na)}handleKeyDown(e){if(BA(e)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=ZQ,coordinateGetter:a=QIe,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=$1(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:k}=XQ(h),R=VIe(h),E={x:Math.min(y===rn.Right?R.right-R.width/2:R.right,Math.max(y===rn.Right?R.left:R.left+R.width/2,l.x)),y:Math.min(y===rn.Down?R.bottom-R.height/2:R.bottom,Math.max(y===rn.Down?R.top:R.top+R.height/2,l.y))},T=y===rn.Right&&!v||y===rn.Left&&!w,D=y===rn.Down&&!x||y===rn.Up&&!g;if(T&&E.x!==l.x){const M=h.scrollLeft+d.x,L=y===rn.Right&&M<=A.x||y===rn.Left&&M>=k.x;if(L&&!d.y){h.scrollTo({left:M,behavior:o});return}L?m.x=h.scrollLeft-M:m.x=y===rn.Right?h.scrollLeft-A.x:h.scrollLeft-k.x,m.x&&h.scrollBy({left:-m.x,behavior:o});break}else if(D&&E.y!==l.y){const M=h.scrollTop+d.y,L=y===rn.Down&&M<=A.y||y===rn.Up&&M>=k.y;if(L&&!d.x){h.scrollTo({top:M,behavior:o});return}L?m.y=h.scrollTop-M:m.y=y===rn.Down?h.scrollTop-A.y:h.scrollTop-k.y,m.y&&h.scrollBy({top:-m.y,behavior:o});break}}this.handleMove(e,Um($1(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()}}eJ.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=ZQ,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 M4(t){return!!(t&&"distance"in t)}function O4(t){return!!(t&&"delay"in t)}class F${constructor(e,n,r){var s;r===void 0&&(r=YIe(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=zv(a),this.documentListeners=new wb(this.document),this.listeners=new wb(r),this.windowListeners=new wb(ni(a)),this.initialCoordinates=(s=F1(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(To.Resize,this.handleCancel),this.windowListeners.add(To.DragStart,N4),this.windowListeners.add(To.VisibilityChange,this.handleCancel),this.windowListeners.add(To.ContextMenu,N4),this.documentListeners.add(To.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(O4(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(M4(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(To.Click,XIe,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(To.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=F1(e))!=null?n:Na,u=$1(s,c);if(!r&&o){if(M4(o)){if(o.tolerance!=null&&rk(u,o.tolerance))return this.handleCancel();if(rk(u,o.distance))return this.handleStart()}if(O4(o)&&rk(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===rn.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const JIe={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class tJ extends F${constructor(e){const{event:n}=e,r=zv(n.target);super(e,JIe,r)}}tJ.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 ZIe={move:{name:"mousemove"},end:{name:"mouseup"}};var ON;(function(t){t[t.RightClick=2]="RightClick"})(ON||(ON={}));class e$e extends F${constructor(e){super(e,ZIe,zv(e.event.target))}}e$e.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===ON.RightClick?!1:(r==null||r({event:n}),!0)}}];const sk={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class t$e extends F${constructor(e){super(e,sk)}static setup(){return window.addEventListener(sk.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(sk.move.name,e)};function e(){}}}t$e.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 _b;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(_b||(_b={}));var z1;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(z1||(z1={}));function n$e(t){let{acceleration:e,activator:n=_b.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:a=5,order:o=z1.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:f,delta:l,threshold:d}=t;const m=s$e({delta:l,disabled:!i}),[p,h]=mIe(),y=_.useRef({x:0,y:0}),g=_.useRef({x:0,y:0}),v=_.useMemo(()=>{switch(n){case _b.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case _b.DraggableRect:return s}},[n,s,c]),w=_.useRef(null),x=_.useCallback(()=>{const k=w.current;if(!k)return;const R=y.current.x*g.current.x,E=y.current.y*g.current.y;k.scrollBy(R,E)},[]),A=_.useMemo(()=>o===z1.TreeOrder?[...u].reverse():u,[o,u]);_.useEffect(()=>{if(!i||!u.length||!v){h();return}for(const k of A){if((r==null?void 0:r(k))===!1)continue;const R=u.indexOf(k),E=f[R];if(!E)continue;const{direction:T,speed:D}=WIe(k,E,v,e,d);for(const M of["x","y"])m[M][T[M]]||(D[M]=0,T[M]=0);if(D.x>0||D.y>0){h(),w.current=k,p(x,a),y.current=D,g.current=T;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 r$e={x:{[Qr.Backward]:!1,[Qr.Forward]:!1},y:{[Qr.Backward]:!1,[Qr.Forward]:!1}};function s$e(t){let{delta:e,disabled:n}=t;const r=I1(e);return O_(s=>{if(n||!r||!s)return r$e;const i={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[Qr.Backward]:s.x[Qr.Backward]||i.x===-1,[Qr.Forward]:s.x[Qr.Forward]||i.x===1},y:{[Qr.Backward]:s.y[Qr.Backward]||i.y===-1,[Qr.Forward]:s.y[Qr.Forward]||i.y===1}}},[n,e,r])}function i$e(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return O_(s=>{var i;return e==null?null:(i=r??s)!=null?i:null},[r,e])}function o$e(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 cw;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(cw||(cw={}));var LN;(function(t){t.Optimized="optimized"})(LN||(LN={}));const L4=new Map;function a$e(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=lw(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=O_(g=>{if(l&&!n)return L4;if(!g||g===L4||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 $$(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 cw.Always:return!1;case cw.BeforeDragging:return n;default:return!n}}}function j$(t,e){return O_(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function l$e(t,e){return j$(t,e)}function c$e(t){let{callback:e,disabled:n}=t;const r=zA(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 UA(t){let{callback:e,disabled:n}=t;const r=zA(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 u$e(t){return new $$(Bv(t),t)}function I4(t,e,n){e===void 0&&(e=u$e);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=c$e({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=UA({callback:i});return Da(()=>{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 d$e(t){const e=j$(t);return WQ(t,e)}const $4=[];function f$e(t){const e=_.useRef(t),n=O_(r=>t?r&&r!==$4&&t&&e.current&&t.parentNode===e.current.parentNode?r:I$(t):$4,[t]);return _.useEffect(()=>{e.current=t},[t]),n}function h$e(t){const[e,n]=_.useState(null),r=_.useRef(t),s=_.useCallback(i=>{const a=nk(i.target);a&&n(o=>o?(o.set(a,MN(a)),new Map(o)):null)},[]);return _.useEffect(()=>{const i=r.current;if(t!==i){a(i);const o=t.map(c=>{const u=nk(c);return u?(u.addEventListener("scroll",s,{passive:!0}),[u,MN(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=nk(c);u==null||u.removeEventListener("scroll",s)})}},[s,t]),_.useMemo(()=>t.length?e?Array.from(e.values()).reduce((i,a)=>Um(i,a),Na):QQ(t):Na,[t,e])}function F4(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?$1(t,n.current):Na}function p$e(t){_.useEffect(()=>{if(!jA)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 m$e(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 nJ(t){return _.useMemo(()=>t?zIe(t):null,[t])}const j4=[];function g$e(t,e){e===void 0&&(e=Bv);const[n]=t,r=nJ(n?ni(n):null),[s,i]=_.useState(j4);function a(){i(()=>t.length?t.map(c=>YQ(c)?r:new $$(e(c),c)):j4)}const o=UA({callback:a});return Da(()=>{o==null||o.disconnect(),a(),t.forEach(c=>o==null?void 0:o.observe(c))},[t]),s}function rJ(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return M_(e)?e:t}function v$e(t){let{measure:e}=t;const[n,r]=_.useState(null),s=_.useCallback(u=>{for(const{target:f}of u)if(M_(f)){r(l=>{const d=e(f);return l?{...l,width:d.width,height:d.height}:d});break}},[e]),i=UA({callback:s}),a=_.useCallback(u=>{const f=rJ(u);i==null||i.disconnect(),f&&(i==null||i.observe(f)),r(f?e(f):null)},[e,i]),[o,c]=L1(a);return _.useMemo(()=>({nodeRef:o,rect:n,setRef:c}),[n,o,c])}const y$e=[{sensor:tJ,options:{}},{sensor:eJ,options:{}}],b$e={current:{}},YS={draggable:{measure:D4},droppable:{measure:D4,strategy:cw.WhileDragging,frequency:LN.Optimized},dragOverlay:{measure:Bv}};class xb 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 w$e={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new xb,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:j1},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:YS,measureDroppableContainers:j1,windowRect:null,measuringScheduled:!1},sJ={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:j1,draggableNodes:new Map,over:null,measureDroppableContainers:j1},I_=_.createContext(sJ),iJ=_.createContext(w$e);function _$e(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new xb}}}function x$e(t,e){switch(e.type){case Br.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case Br.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 Br.DragEnd:case Br.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Br.RegisterDroppable:{const{element:n}=e,{id:r}=n,s=new xb(t.droppable.containers);return s.set(r,n),{...t,droppable:{...t.droppable,containers:s}}}case Br.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 xb(t.droppable.containers);return a.set(n,{...i,disabled:s}),{...t,droppable:{...t.droppable,containers:a}}}case Br.UnregisterDroppable:{const{id:n,key:r}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const i=new xb(t.droppable.containers);return i.delete(n),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function S$e(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:s}=_.useContext(I_),i=I1(r),a=I1(n==null?void 0:n.id);return _.useEffect(()=>{if(!e&&!r&&i&&a!=null){if(!BA(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=yIe(f);if(l){l.focus();break}}})}},[r,e,s,a,i]),null}function oJ(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((s,i)=>i({transform:s,...r}),n):n}function E$e(t){return _.useMemo(()=>({draggable:{...YS.draggable,...t==null?void 0:t.draggable},droppable:{...YS.droppable,...t==null?void 0:t.droppable},dragOverlay:{...YS.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 C$e(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;Da(()=>{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=WQ(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=qQ(u);d&&d.scrollBy({top:l.y,left:l.x})}},[e,a,o,r,n])}const HA=_.createContext({...Na,scaleX:1,scaleY:1});var Pu;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Pu||(Pu={}));const k5e=_.memo(function(e){var n,r,s,i;let{id:a,accessibility:o,autoScroll:c=!0,children:u,sensors:f=y$e,collisionDetection:l=OIe,measuring:d,modifiers:m,...p}=e;const h=_.useReducer(x$e,void 0,_$e),[y,g]=h,[v,w]=EIe(),[x,A]=_.useState(Pu.Uninitialized),k=x===Pu.Initialized,{draggable:{active:R,nodes:E,translate:T},droppable:{containers:D}}=y,M=R!=null?E.get(R):null,L=_.useRef({initial:null,translated:null}),I=_.useMemo(()=>{var nt;return R!=null?{id:R,data:(nt=M==null?void 0:M.data)!=null?nt:b$e,rect:L}:null},[R,M]),F=_.useRef(null),[U,Y]=_.useState(null),[W,H]=_.useState(null),ee=lw(p,Object.values(p)),re=L_("DndDescribedBy",a),X=_.useMemo(()=>D.getEnabled(),[D]),G=E$e(d),{droppableRects:K,measureDroppableContainers:J,measuringScheduled:ue}=a$e(X,{dragging:k,dependencies:[T.x,T.y],config:G.droppable}),de=i$e(E,R),ie=_.useMemo(()=>W?F1(W):null,[W]),be=Et(),Ae=l$e(de,G.draggable.measure);C$e({activeNode:R!=null?E.get(R):null,config:be.layoutShiftCompensation,initialRect:Ae,measure:G.draggable.measure});const _e=I4(de,G.draggable.measure,Ae),Oe=I4(de?de.parentElement:null),Ne=_.useRef({activatorEvent:null,active:null,activeNode:de,collisionRect:null,collisions:null,droppableRects:K,draggableNodes:E,draggingNode:null,draggingNodeRect:null,droppableContainers:D,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ye=D.getNodeFor((n=Ne.current.over)==null?void 0:n.id),$e=v$e({measure:G.dragOverlay.measure}),ut=(r=$e.nodeRef.current)!=null?r:de,Qe=k?(s=$e.rect)!=null?s:_e:null,yt=!!($e.nodeRef.current&&$e.rect),En=d$e(yt?null:_e),Xt=nJ(ut?ni(ut):null),gn=f$e(k?ye??de:null),Qt=g$e(gn),Z=oJ(m,{transform:{x:T.x-En.x,y:T.y-En.y,scaleX:1,scaleY:1},activatorEvent:W,active:I,activeNodeRect:_e,containerNodeRect:Oe,draggingNodeRect:Qe,over:Ne.current.over,overlayNodeRect:$e.rect,scrollableAncestors:gn,scrollableAncestorRects:Qt,windowRect:Xt}),fe=ie?Um(ie,T):null,ge=h$e(gn),Pe=F4(ge),Me=F4(ge,[_e]),xe=Um(Z,Pe),Te=Qe?$Ie(Qe,Z):null,Ye=I&&Te?l({active:I,collisionRect:Te,droppableRects:K,droppableContainers:X,pointerCoordinates:fe}):null,Pt=NIe(Ye,"id"),[wt,Ls]=_.useState(null),Yn=yt?Z:Um(Z,Me),gs=LIe(Yn,(i=wt==null?void 0:wt.rect)!=null?i:null,_e),Ht=_.useRef(null),an=_.useCallback((nt,Wt)=>{let{sensor:At,options:yn}=Wt;if(F.current==null)return;const ln=E.get(F.current);if(!ln)return;const cn=nt.nativeEvent,kn=new At({active:F.current,activeNode:ln,event:cn,options:yn,context:Ne,onAbort(Dn){if(!E.get(Dn))return;const{onDragAbort:oe}=ee.current,he={id:Dn};oe==null||oe(he),v({type:"onDragAbort",event:he})},onPending(Dn,te,oe,he){if(!E.get(Dn))return;const{onDragPending:Le}=ee.current,Ge={id:Dn,constraint:te,initialCoordinates:oe,offset:he};Le==null||Le(Ge),v({type:"onDragPending",event:Ge})},onStart(Dn){const te=F.current;if(te==null)return;const oe=E.get(te);if(!oe)return;const{onDragStart:he}=ee.current,Ce={activatorEvent:cn,active:{id:te,data:oe.data,rect:L}};Ns.unstable_batchedUpdates(()=>{he==null||he(Ce),A(Pu.Initializing),g({type:Br.DragStart,initialCoordinates:Dn,active:te}),v({type:"onDragStart",event:Ce}),Y(Ht.current),H(cn)})},onMove(Dn){g({type:Br.DragMove,coordinates:Dn})},onEnd:hr(Br.DragEnd),onCancel:hr(Br.DragCancel)});Ht.current=kn;function hr(Dn){return async function(){const{active:oe,collisions:he,over:Ce,scrollAdjustedTranslate:Le}=Ne.current;let Ge=null;if(oe&&Le){const{cancelDrop:st}=ee.current;Ge={activatorEvent:cn,active:oe,collisions:he,delta:Le,over:Ce},Dn===Br.DragEnd&&typeof st=="function"&&await Promise.resolve(st(Ge))&&(Dn=Br.DragCancel)}F.current=null,Ns.unstable_batchedUpdates(()=>{g({type:Dn}),A(Pu.Uninitialized),Ls(null),Y(null),H(null),Ht.current=null;const st=Dn===Br.DragEnd?"onDragEnd":"onDragCancel";if(Ge){const Ue=ee.current[st];Ue==null||Ue(Ge),v({type:st,event:Ge})}})}}},[E]),vn=_.useCallback((nt,Wt)=>(At,yn)=>{const ln=At.nativeEvent,cn=E.get(yn);if(F.current!==null||!cn||ln.dndKit||ln.defaultPrevented)return;const kn={active:cn};nt(At,Wt.options,kn)===!0&&(ln.dndKit={capturedBy:Wt.sensor},F.current=yn,an(At,Wt))},[E,an]),Be=o$e(f,vn);p$e(f),Da(()=>{_e&&x===Pu.Initializing&&A(Pu.Initialized)},[_e,x]),_.useEffect(()=>{const{onDragMove:nt}=ee.current,{active:Wt,activatorEvent:At,collisions:yn,over:ln}=Ne.current;if(!Wt||!At)return;const cn={active:Wt,activatorEvent:At,collisions:yn,delta:{x:xe.x,y:xe.y},over:ln};Ns.unstable_batchedUpdates(()=>{nt==null||nt(cn),v({type:"onDragMove",event:cn})})},[xe.x,xe.y]),_.useEffect(()=>{const{active:nt,activatorEvent:Wt,collisions:At,droppableContainers:yn,scrollAdjustedTranslate:ln}=Ne.current;if(!nt||F.current==null||!Wt||!ln)return;const{onDragOver:cn}=ee.current,kn=yn.get(Pt),hr=kn&&kn.rect.current?{id:kn.id,rect:kn.rect.current,data:kn.data,disabled:kn.disabled}:null,Dn={active:nt,activatorEvent:Wt,collisions:At,delta:{x:ln.x,y:ln.y},over:hr};Ns.unstable_batchedUpdates(()=>{Ls(hr),cn==null||cn(Dn),v({type:"onDragOver",event:Dn})})},[Pt]),Da(()=>{Ne.current={activatorEvent:W,active:I,activeNode:de,collisionRect:Te,collisions:Ye,droppableRects:K,draggableNodes:E,draggingNode:ut,draggingNodeRect:Qe,droppableContainers:D,over:wt,scrollableAncestors:gn,scrollAdjustedTranslate:xe},L.current={initial:Qe,translated:Te}},[I,de,Ye,Te,E,ut,Qe,K,D,wt,gn,xe]),n$e({...be,delta:T,draggingRect:Te,pointerCoordinates:fe,scrollableAncestors:gn,scrollableAncestorRects:Qt});const it=_.useMemo(()=>({active:I,activeNode:de,activeNodeRect:_e,activatorEvent:W,collisions:Ye,containerNodeRect:Oe,dragOverlay:$e,draggableNodes:E,droppableContainers:D,droppableRects:K,over:wt,measureDroppableContainers:J,scrollableAncestors:gn,scrollableAncestorRects:Qt,measuringConfiguration:G,measuringScheduled:ue,windowRect:Xt}),[I,de,_e,W,Ye,Oe,$e,E,D,K,wt,J,gn,Qt,G,ue,Xt]),ot=_.useMemo(()=>({activatorEvent:W,activators:Be,active:I,activeNodeRect:_e,ariaDescribedById:{draggable:re},dispatch:g,draggableNodes:E,over:wt,measureDroppableContainers:J}),[W,Be,I,_e,g,re,E,wt,J]);return se.createElement(HQ.Provider,{value:w},se.createElement(I_.Provider,{value:ot},se.createElement(iJ.Provider,{value:it},se.createElement(HA.Provider,{value:gs},u)),se.createElement(S$e,{disabled:(o==null?void 0:o.restoreFocus)===!1})),se.createElement(RIe,{...o,hiddenTextDescribedById:re}));function Et(){const nt=(U==null?void 0:U.autoScrollEnabled)===!1,Wt=typeof c=="object"?c.enabled===!1:c===!1,At=k&&!nt&&!Wt;return typeof c=="object"?{...c,enabled:At}:{enabled:At}}}),A$e=_.createContext(null),z4="button",R$e="Draggable";function P$e(t){let{id:e,data:n,disabled:r=!1,attributes:s}=t;const i=L_(R$e),{activators:a,activatorEvent:o,active:c,activeNodeRect:u,ariaDescribedById:f,draggableNodes:l,over:d}=_.useContext(I_),{role:m=z4,roleDescription:p="draggable",tabIndex:h=0}=s??{},y=(c==null?void 0:c.id)===e,g=_.useContext(y?HA:A$e),[v,w]=L1(),[x,A]=L1(),k=m$e(a,e),R=lw(n);Da(()=>(l.set(e,{id:e,key:i,node:v,activatorNode:x,data:R}),()=>{const T=l.get(e);T&&T.key===i&&l.delete(e)}),[l,e]);const E=_.useMemo(()=>({role:m,tabIndex:h,"aria-disabled":r,"aria-pressed":y&&m===z4?!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:k,node:v,over:d,setNodeRef:w,setActivatorNodeRef:A,transform:g}}function aJ(){return _.useContext(iJ)}const T$e="Droppable",k$e={timeout:25};function D$e(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:s}=t;const i=L_(T$e),{active:a,dispatch:o,over:c,measureDroppableContainers:u}=_.useContext(I_),f=_.useRef({disabled:n}),l=_.useRef(!1),d=_.useRef(null),m=_.useRef(null),{disabled:p,updateMeasurementsFor:h,timeout:y}={...k$e,...s},g=lw(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=UA({callback:v,disabled:p||!a}),x=_.useCallback((E,T)=>{w&&(T&&(w.unobserve(T),l.current=!1),E&&w.observe(E))},[w]),[A,k]=L1(x),R=lw(e);return _.useEffect(()=>{!w||!A.current||(w.disconnect(),l.current=!1,w.observe(A.current))},[A,w]),_.useEffect(()=>(o({type:Br.RegisterDroppable,element:{id:r,key:i,disabled:n,node:A,rect:d,data:R}}),()=>o({type:Br.UnregisterDroppable,key:i,id:r})),[r]),_.useEffect(()=>{n!==f.current.disabled&&(o({type:Br.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:k}}function N$e(t){let{animation:e,children:n}=t;const[r,s]=_.useState(null),[i,a]=_.useState(null),o=I1(n);return!n&&!r&&o&&s(o),Da(()=>{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 M$e={x:0,y:0,scaleX:1,scaleY:1};function O$e(t){let{children:e}=t;return se.createElement(I_.Provider,{value:sJ},se.createElement(HA.Provider,{value:M$e},e))}const L$e={position:"fixed",touchAction:"none"},I$e=t=>BA(t)?"transform 250ms ease":void 0,$$e=_.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:s,children:i,className:a,rect:o,style:c,transform:u,transition:f=I$e}=t;if(!o)return null;const l=s?u:{...u,scaleX:1,scaleY:1},d={...L$e,width:o.width,height:o.height,top:o.top,left:o.left,transform:rp.Transform.toString(l),transformOrigin:s&&r?TIe(r,o):void 0,transition:typeof f=="function"?f(r):f,...c};return se.createElement(n,{className:a,style:d,ref:e},i)}),F$e=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)}},j$e=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:rp.Transform.toString(e)},{transform:rp.Transform.toString(n)}]},z$e={duration:250,easing:"ease",keyframes:j$e,sideEffects:F$e({styles:{active:{opacity:"0"}}})};function B$e(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:s}=t;return zA((i,a)=>{if(e===null)return;const o=n.get(i);if(!o)return;const c=o.node.current;if(!c)return;const u=rJ(a);if(!u)return;const{transform:f}=ni(a).getComputedStyle(a),l=VQ(f);if(!l)return;const d=typeof e=="function"?e:U$e(e);return JQ(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 U$e(t){const{duration:e,easing:n,sideEffects:r,keyframes:s}={...z$e,...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 B4=0;function H$e(t){return _.useMemo(()=>{if(t!=null)return B4++,B4},[t])}const D5e=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}=aJ(),k=_.useContext(HA),R=H$e(l==null?void 0:l.id),E=oJ(a,{activatorEvent:f,active:l,activeNodeRect:d,containerNodeRect:m,draggingNodeRect:y.rect,over:g,overlayNodeRect:y.rect,scrollableAncestors:w,scrollableAncestorRects:x,transform:k,windowRect:A}),T=j$(d),D=B$e({config:r,draggableNodes:p,droppableContainers:h,measuringConfiguration:v}),M=T?y.setRef:void 0;return se.createElement(O$e,null,se.createElement(N$e,{animation:D},l&&R?se.createElement($$e,{key:R,id:l.id,ref:M,as:o,activatorEvent:f,adjustScale:e,className:c,transition:i,rect:T,style:{zIndex:u,...s},transform:E},n):null))});function lJ(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function W$e(t,e){return t.reduce((n,r,s)=>{const i=e.get(r);return i&&(n[s]=i),n},Array(t.length))}function _S(t){return t!==null&&t>=0}function V$e(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function q$e(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const cJ=t=>{let{rects:e,activeIndex:n,overIndex:r,index:s}=t;const i=lJ(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}},xS={scaleX:1,scaleY:1},N5e=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:n<a?u.top+u.height-(o.top+o.height):u.top-o.top,...xS}:null}const c=G$e(i,s,n);return s>n&&s<=a?{x:0,y:-o.height-c,...xS}:s<n&&s>=a?{x:0,y:o.height+c,...xS}:{x:0,y:0,...xS}};function G$e(t,e,n){const r=t[e],s=t[e-1],i=t[e+1];return r?n<e?s?r.top-(s.top+s.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const uJ="Sortable",dJ=se.createContext({activeIndex:-1,containerId:uJ,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:cJ,disabled:{draggable:!1,droppable:!1}});function M5e(t){let{children:e,id:n,items:r,strategy:s=cJ,disabled:i=!1}=t;const{active:a,dragOverlay:o,droppableRects:c,over:u,measureDroppableContainers:f}=aJ(),l=L_(uJ,n),d=o.rect!==null,m=_.useMemo(()=>r.map(k=>typeof k=="object"&&"id"in k?k.id:k),[r]),p=a!=null,h=a?m.indexOf(a.id):-1,y=u?m.indexOf(u.id):-1,g=_.useRef(m),v=!V$e(m,g.current),w=y!==-1&&h===-1||v,x=q$e(i);Da(()=>{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:W$e(m,c),strategy:s}),[h,l,x.draggable,x.droppable,w,m,y,c,d,s]);return se.createElement(dJ.Provider,{value:A},e)}const K$e=t=>{let{id:e,items:n,activeIndex:r,overIndex:s}=t;return lJ(n,r,s).indexOf(e)},Y$e=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},X$e={duration:200,easing:"ease"},fJ="transform",Q$e=rp.Transition.toString({property:fJ,duration:0,easing:"linear"}),J$e={roleDescription:"sortable"};function Z$e(t){let{disabled:e,index:n,node:r,rect:s}=t;const[i,a]=_.useState(null),o=_.useRef(n);return Da(()=>{if(!e&&n!==o.current&&r.current){const c=s.current;if(c){const u=Bv(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 O5e(t){let{animateLayoutChanges:e=Y$e,attributes:n,disabled:r,data:s,getNewIndex:i=K$e,id:a,strategy:o,resizeObserverConfig:c,transition:u=X$e}=t;const{items:f,containerId:l,activeIndex:d,disabled:m,disableTransforms:p,sortedRects:h,overIndex:y,useDragOverlay:g,strategy:v}=_.useContext(dJ),w=e2e(r,m),x=f.indexOf(a),A=_.useMemo(()=>({sortable:{containerId:l,index:x,items:f},...s}),[l,s,x,f]),k=_.useMemo(()=>f.slice(f.indexOf(a)),[f,a]),{rect:R,node:E,isOver:T,setNodeRef:D}=D$e({id:a,data:A,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:k,...c}}),{active:M,activatorEvent:L,activeNodeRect:I,attributes:F,setNodeRef:U,listeners:Y,isDragging:W,over:H,setActivatorNodeRef:ee,transform:re}=P$e({id:a,data:A,attributes:{...J$e,...n},disabled:w.draggable}),X=pIe(D,U),G=!!M,K=G&&!p&&_S(d)&&_S(y),J=!g&&W,ue=J&&K?re:null,ie=K?ue??(o??v)({rects:h,activeNodeRect:I,activeIndex:d,overIndex:y,index:x}):null,be=_S(d)&&_S(y)?i({id:a,items:f,activeIndex:d,overIndex:y}):x,Ae=M==null?void 0:M.id,_e=_.useRef({activeId:Ae,items:f,newIndex:be,containerId:l}),Oe=f!==_e.current.items,Ne=e({active:M,containerId:l,isDragging:W,isSorting:G,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=Z$e({disabled:!Ne,index:x,node:E,rect:R});return _.useEffect(()=>{G&&_e.current.newIndex!==be&&(_e.current.newIndex=be),l!==_e.current.containerId&&(_e.current.containerId=l),f!==_e.current.items&&(_e.current.items=f)},[G,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:M,activeIndex:d,attributes:F,data:A,rect:R,index:x,newIndex:be,items:f,isOver:T,isSorting:G,isDragging:W,listeners:Y,node:E,overIndex:y,over:H,setNodeRef:X,setActivatorNodeRef:ee,setDroppableNodeRef:D,setDraggableNodeRef:U,transform:ye??ie,transition:$e()};function $e(){if(ye||Oe&&_e.current.newIndex===x)return Q$e;if(!(J&&!BA(L)||!u)&&(G||Ne))return rp.Transition.toString({...u,property:fJ})}}function e2e(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}}rn.Down,rn.Right,rn.Up,rn.Left;const hJ=({title:t=ft("components.error_overlay.title"),subtitle:e=void 0,description:n=void 0,errorMessage:r=void 0})=>{const s=Fv();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(hIe,{}),P.jsxs(Ci,{onClick:()=>s("/"),children:[P.jsx(kfe,{className:"w-4 h-4 mr-2"})," ",ft("components.error_overlay.go_home")]})]})]})})};hJ.displayName="ErrorOverlay";var Zt=function(){return Zt=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Zt.apply(this,arguments)};function z$(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n}function zi(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,i;r<s;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var Cl=function(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")},t2e={k:1e3,m:1e6,b:1e9},n2e=function(t,e){e===void 0&&(e=".");var n=new RegExp("(\\d+(".concat(Cl(e),"\\d*)?)([kmb])$"),"i"),r=t.match(n);if(r){var s=r[1],i=r[3],a=t2e[i.toLowerCase()];return Number(s.replace(e,"."))*a}},r2e=function(t,e){e===void 0&&(e=",");var n=new RegExp(Cl(e),"g");return t.replace(n,"")},s2e=function(t,e){var n=Cl(e.join("")),r=new RegExp("[^\\d".concat(n,"]"),"gi");return t.replace(r,"")},ik=function(t){var e=t.value,n=t.groupSeparator,r=n===void 0?",":n,s=t.decimalSeparator,i=s===void 0?".":s,a=t.allowDecimals,o=a===void 0?!0:a,c=t.decimalsLimit,u=c===void 0?2:c,f=t.allowNegativeValue,l=f===void 0?!0:f,d=t.disableAbbreviations,m=d===void 0?!1:d,p=t.prefix,h=p===void 0?"":p,y=t.transformRawValue,g=y===void 0?function(re){return re}:y,v=g(e);if(v==="-")return v;var w=m?[]:["k","m","b"],x=new RegExp("((^|\\D)-\\d)|(-".concat(Cl(h),")")),A=x.test(v),k=RegExp("(\\d+)-?".concat(Cl(h))).exec(e)||[],R=k[0],E=k[1],T=h?R?v.replace(R,"").concat(E):v.replace(h,""):v,D=r2e(T,r),M=s2e(D,zi([r,i],w,!0)),L=M;if(!m){if(w.some(function(re){return re===M.toLowerCase().replace(i,"")}))return"";var I=n2e(M,i);I&&(L=String(I))}var F=A&&l?"-":"";if(i&&L.includes(i)){var U=M.split(i),Y=U[0],W=U[1],H=u&&W?W.slice(0,u):W,ee=o?"".concat(i).concat(H):"";return"".concat(F).concat(Y).concat(ee)}return"".concat(F).concat(L)},i2e=function(t,e,n){if(n!==void 0&&t.length>1){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},pJ=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},Py=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!=="."?o2e(e,n,u):e;n&&n!=="-"&&f.startsWith(n)&&(f="0"+f);var l=r||{},d=l.locale,m=l.currency,p=z$(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=a2e(g,t),w=pJ(v,Zt({},t)),x=e.slice(-1)===n?n:"",A=f.match(RegExp("\\d+\\.(\\d+)"))||[],k=A[1];return s===void 0&&k&&n&&(v.includes(n)?v=v.replace(RegExp("(\\d+)(".concat(Cl(n),")(\\d+)"),"g"),"$1$2".concat(k)):w&&!c?v=v.replace(w,"".concat(n).concat(k).concat(w)):v="".concat(v).concat(n).concat(k)),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("")},o2e=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},a2e=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"?zi(zi([],c,!0),[n],!1):[n,d]:l==="currency"?n?c:zi(zi([],c,!0),[d],!1):l==="group"?o?c:zi(zi([],c,!0),[r!==void 0?r:d],!1):l==="decimal"?i!==void 0&&i===0?c:zi(zi([],c,!0),[s!==void 0?s:d],!1):l==="fraction"?zi(zi([],c,!0),[i!==void 0?d.slice(0,i):d],!1):zi(zi([],c,!0),[d],!1)},[""]).join("")},l2e={currencySymbol:"",groupSeparator:"",decimalSeparator:"",prefix:"",suffix:""},c2e=function(t){var e=t||{},n=e.locale,r=e.currency,s=z$(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},l2e)},U4=function(t){return RegExp(/\d/,"gi").test(t)},u2e=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.length<n)for(;a.length<n;)a+="0";else a=a.slice(0,n);return"".concat(s).concat(e).concat(a)},d2e=function(t){var e=t.selectionStart,n=t.value,r=t.lastKeyStroke,s=t.stateValue,i=t.groupSeparator,a=e,o=n;if(s&&a){var c=n.split("");return r==="Backspace"&&s[a]===i&&(c.splice(a-1,1),a-=1),r==="Delete"&&s[a]===i&&(c.splice(a,1),a+=1),o=c.join(""),{modifiedValue:o,cursorPosition:a}}return{modifiedValue:o,cursorPosition:e}},mJ=_.forwardRef(function(t,e){var n=t.allowDecimals,r=n===void 0?!0:n,s=t.allowNegativeValue,i=s===void 0?!0:s,a=t.id,o=t.name,c=t.className,u=t.customInput,f=t.decimalsLimit,l=t.defaultValue,d=t.disabled,m=d===void 0?!1:d,p=t.maxLength,h=t.value,y=t.onValueChange,g=t.fixedDecimalLength,v=t.placeholder,w=t.decimalScale,x=t.prefix,A=t.suffix,k=t.intlConfig,R=t.step,E=t.min,T=t.max,D=t.disableGroupSeparators,M=D===void 0?!1:D,L=t.disableAbbreviations,I=L===void 0?!1:L,F=t.decimalSeparator,U=t.groupSeparator,Y=t.onChange,W=t.onFocus,H=t.onBlur,ee=t.onKeyDown,re=t.onKeyUp,X=t.transformRawValue,G=t.formatValueOnBlur,K=G===void 0?!0:G,J=z$(t,["allowDecimals","allowNegativeValue","id","name","className","customInput","decimalsLimit","defaultValue","disabled","maxLength","value","onValueChange","fixedDecimalLength","placeholder","decimalScale","prefix","suffix","intlConfig","step","min","max","disableGroupSeparators","disableAbbreviations","decimalSeparator","groupSeparator","onChange","onFocus","onBlur","onKeyDown","onKeyUp","transformRawValue","formatValueOnBlur"]);if(F&&U4(F))throw new Error("decimalSeparator cannot be a number");if(U&&U4(U))throw new Error("groupSeparator cannot be a number");var ue=_.useMemo(function(){return c2e(k)},[k]),de=F||ue.decimalSeparator||"",ie=U||ue.groupSeparator||"";if(de&&ie&&de===ie&&M===!1)throw new Error("decimalSeparator cannot be the same as groupSeparator");var be={decimalSeparator:de,groupSeparator:ie,disableGroupSeparators:M,intlConfig:k,prefix:x||ue.prefix,suffix:A},Ae={decimalSeparator:de,groupSeparator:ie,allowDecimals:r,decimalsLimit:f||g||2,allowNegativeValue:i,disableAbbreviations:I,prefix:x||ue.prefix,transformRawValue:X},_e=_.useState(function(){return l!=null?Py(Zt(Zt({},be),{decimalScale:w,value:String(l)})):h!=null?Py(Zt(Zt({},be),{decimalScale:w,value:String(h)})):""}),Oe=_e[0],Ne=_e[1],ye=_.useState(!1),$e=ye[0],ut=ye[1],Qe=_.useState(0),yt=Qe[0],En=Qe[1],Xt=_.useState(0),gn=Xt[0],Qt=Xt[1],Z=_.useState(null),fe=Z[0],ge=Z[1],Pe=_.useRef(null);_.useImperativeHandle(e,function(){return Pe.current});var Me=function(Ht,an){ut(!0);var vn=d2e({selectionStart:an,value:Ht,lastKeyStroke:fe,stateValue:Oe,groupSeparator:ie}),Be=vn.modifiedValue,it=vn.cursorPosition,ot=ik(Zt({value:Be},Ae));if(!(p&&ot.replace(/-/g,"").length>p)){if(ot===""||ot==="-"||ot===de){y&&y(void 0,o,{float:null,formatted:"",value:""}),Ne(ot),En(1);return}var Et=de?ot.replace(de,"."):ot,nt=parseFloat(Et),Wt=Py(Zt({value:ot},be));if(it!=null){var At=it+(Wt.length-Ht.length);At=At<=0?x?x.length:0:At,En(At),Qt(gn+1)}if(Ne(Wt),y){var yn={float:nt,formatted:Wt,value:ot};y(ot,o,yn)}}},xe=function(Ht){var an=Ht.target,vn=an.value,Be=an.selectionStart;Me(vn,Be),Y&&Y(Ht)},Te=function(Ht){return W&&W(Ht),Oe?Oe.length:0},Ye=function(Ht){var an=Ht.target.value,vn=ik(Zt({value:an},Ae));if(vn==="-"||vn===de||!vn){Ne(""),H&&H(Ht);return}var Be=i2e(vn,de,g),it=u2e(Be,de,w!==void 0?w:g),ot=de?it.replace(de,"."):it,Et=parseFloat(ot),nt=Py(Zt(Zt({},be),{value:it}));y&&K&&y(it,o,{float:Et,formatted:nt,value:it}),Ne(nt),H&&H(Ht)},Pt=function(Ht){var an=Ht.key;if(ge(an),R&&(an==="ArrowUp"||an==="ArrowDown")){Ht.preventDefault(),En(Oe.length);var vn=h!=null?String(h):void 0,Be=de&&vn?vn.replace(de,"."):vn,it=parseFloat(Be??ik(Zt({value:Oe},Ae)))||0,ot=an==="ArrowUp"?it+R:it-R;if(E!==void 0&&ot<Number(E)||!i&&ot<0||T!==void 0&&ot>Number(T))return;var Et=String(R).includes(".")?Number(String(R).split(".")[1].length):void 0;Me(String(Et?ot.toFixed(Et):ot).replace(".",de))}ee&&ee(Ht)},wt=function(Ht){var an=Ht.key,vn=Ht.currentTarget.selectionStart;if(an!=="ArrowUp"&&an!=="ArrowDown"&&Oe!=="-"){var Be=pJ(Oe,{groupSeparator:ie,decimalSeparator:de});if(Be&&vn&&vn>Oe.length-Be.length&&Pe.current){var it=Oe.length-Be.length;Pe.current.setSelectionRange(it,it)}}re&&re(Ht)};_.useEffect(function(){h==null&&l==null&&Ne("")},[l,h]),_.useEffect(function(){$e&&Oe!=="-"&&Pe.current&&document.activeElement===Pe.current&&Pe.current.setSelectionRange(yt,yt)},[Oe,yt,Pe,$e,gn]);var Ls=function(){return h!=null&&Oe!=="-"&&(!de||Oe!==de)?Py(Zt(Zt({},be),{decimalScale:$e?void 0:w,value:String(h)})):Oe},Yn=Zt({type:"text",inputMode:"decimal",id:a,name:o,className:c,onChange:xe,onBlur:Ye,onFocus:Te,onKeyDown:Pt,onKeyUp:wt,placeholder:v,disabled:m,value:Ls(),ref:Pe},J);if(u){var gs=u;return se.createElement(gs,Zt({},Yn))}return se.createElement("input",Zt({},Yn))});mJ.displayName="CurrencyInput";const WA=_.forwardRef(({children:t,...e},n)=>{var i;const{error:r}=Nv();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=ft("common.required_field"))),P.jsx(FK,{ref:n,...e,children:s})});WA.displayName="FormErrorMessage";const VA=se.forwardRef(({label:t,hint:e,required:n,...r},s)=>{const{error:i}=Nv(),a=e||(n?ft("common.required"):""),o=i?"text-destructive font-semibold":"";return P.jsxs($K,{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})]})});VA.displayName="FormLabel";const f2e=Ho("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"}}),h2e=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}=jd(),[y,g]=_.useState(""),v={input:w=>{if(w==null||typeof w!="object")return w;const x=O1.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:k}=A??{value:null};g(k??"");const R=O1.createFromFormattedValue(k,d.code,l);if(R.isFailure)throw R.error;return R.object.toObject()}};return P.jsx(KI,{defaultValue:c,control:h,name:e,disabled:o,rules:u,render:({field:w})=>{const x=v.input(w.value),A=o||w.disabled,k=!!((u==null?void 0:u.required)??!1);return P.jsxs(gA,{className:ce(a,"space-y-3"),children:[n&&P.jsx(VA,{label:n,hint:r,required:k}),P.jsx(vA,{children:P.jsx(mJ,{intlConfig:{locale:m.code,useGrouping:!0},name:w.name,ref:w.ref,onBlur:w.onBlur,disabled:A,readOnly:f,className:ce(f2e({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,T)=>w.onChange(v.output(R,E,T))})}),s&&P.jsx(yA,{children:s}),P.jsx(WA,{})]})}})};h2e.displayName="FormCurrencyField";var p2e={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 m2e=Od(p2e);var g2e=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function H4(t){var e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=t.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(e.name=n[1],(m2e[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(g2e),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 v2e=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,y2e=/^\s*$/,b2e=Object.create(null);function gJ(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(gJ,"")+"</"+e.name+">";case"comment":return t+"<!--"+e.comment+"-->"}}var w2e={parse:function(t,e){e||(e={}),e.components||(e.components=b2e);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(v2e,function(c,u){if(a){if(c!=="</"+n.name+">")return;a=!1}var f,l=c.charAt(1)!=="/",d=c.startsWith("<!--"),m=u+c.length,p=t.charAt(m);if(d){var h=H4(c);return i<0?(r.push(h),r):((f=s[i]).children.push(h),r)}if(l&&(i++,(n=H4(c)).type==="tag"&&e.components[n.name]&&(n.type="component",a=!0),n.voidElement||a||!p||p==="<"||n.children.push({type:"text",content:t.slice(m,t.indexOf("<",m))}),i===0&&r.push(n),(f=s[i-1])&&f.children.push(n),s[i]=n),(!l||n.voidElement)&&(i>-1&&(n.voidElement||n.name===c.slice(2,-1))&&(i--,n=i===-1?r:s[i]),!a&&p!=="<"&&p)){f=i===-1?r:s[i].children;var y=t.indexOf("<",m),g=t.slice(m,y===-1?void 0:y);y2e.test(g)&&(g=" "),(y>-1&&i+f.length>=0||g!==" ")&&f.push({type:"text",content:g})}}),r},stringify:function(t){return t.reduce(function(e,n){return e+gJ("",n)},"")}};const XS=(t,e,n,r)=>{var i,a,o,c;const s=[n,{code:e,...r||{}}];if((a=(i=t==null?void 0:t.services)==null?void 0:i.logger)!=null&&a.forward)return t.services.logger.forward(s,"warn","react-i18next::",!0);jo(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),(c=(o=t==null?void 0:t.services)==null?void 0:o.logger)!=null&&c.warn?t.services.logger.warn(...s):console!=null&&console.warn&&console.warn(...s)},W4={},uw=(t,e,n,r)=>{jo(n)&&W4[n]||(jo(n)&&(W4[n]=new Date),XS(t,e,n,r))},vJ=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},IN=(t,e,n)=>{t.loadNamespaces(e,vJ(t,n))},V4=(t,e,n,r)=>{if(jo(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return IN(t,n,r);n.forEach(s=>{t.options.ns.indexOf(s)<0&&t.options.ns.push(s)}),t.loadLanguages(e,vJ(t,r))},_2e=(t,e,n={})=>!e.languages||!e.languages.length?(uw(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:n.lng,precheck:(r,s)=>{var i;if(((i=n.bindI18n)==null?void 0:i.indexOf("languageChanging"))>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!s(r.isLanguageChangingTo,t))return!1}}),jo=t=>typeof t=="string",Pf=t=>typeof t=="object"&&t!==null,x2e=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,S2e={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},E2e=t=>S2e[t],C2e=t=>t.replace(x2e,E2e);let $N={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:C2e};const A2e=(t={})=>{$N={...$N,...t}},yJ=()=>$N;let bJ;const R2e=t=>{bJ=t},B$=()=>bJ,ok=(t,e)=>{var r;if(!t)return!1;const n=((r=t.props)==null?void 0:r.children)??t.children;return e?n.length>0:!!n},ak=t=>{var n,r;if(!t)return[];const e=((n=t.props)==null?void 0:n.children)??t.children;return(r=t.props)!=null&&r.i18nIsDynamicList?Cm(e):e},P2e=t=>Array.isArray(t)&&t.every(_.isValidElement),Cm=t=>Array.isArray(t)?t:[t],T2e=(t,e)=>{const n={...e};return n.props=Object.assign(t.props,e.props),n},wJ=(t,e,n,r)=>{if(!t)return"";let s="";const i=Cm(t),a=e!=null&&e.transSupportBasicHtmlNodes?e.transKeepBasicHtmlNodesFor??[]:[];return i.forEach((o,c)=>{if(jo(o)){s+=`${o}`;return}if(_.isValidElement(o)){const{props:u,type:f}=o,l=Object.keys(u).length,d=a.indexOf(f)>-1,m=u.children;if(!m&&d&&!l){s+=`<${f}/>`;return}if(!m&&(!d||l)||u.i18nIsDynamicList){s+=`<${c}></${c}>`;return}if(d&&l===1&&jo(m)){s+=`<${f}>${m}</${f}>`;return}const p=wJ(m,e,n,r);s+=`<${c}>${p}</${c}>`;return}if(o===null){XS(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:r});return}if(Pf(o)){const{format:u,...f}=o,l=Object.keys(f);if(l.length===1){const d=u?`${l[0]}, ${u}`:l[0];s+=`{{${d}}}`;return}XS(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:r,child:o});return}XS(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:r,child:o})}),s},k2e=(t,e,n,r,s,i)=>{if(e==="")return[];const a=r.transKeepBasicHtmlNodesFor||[],o=e&&new RegExp(a.map(y=>`<${y}`).join("|")).test(e);if(!t&&!o&&!i)return[e];const c={},u=y=>{Cm(y).forEach(v=>{jo(v)||(ok(v)?u(ak(v)):Pf(v)&&!_.isValidElement(v)&&Object.assign(c,v))})};u(t);const f=w2e.parse(`<0>${e}</0>`),l={...c,...s},d=(y,g,v)=>{var A;const w=ak(y),x=p(w,g.children,v);return P2e(w)&&x.length===0||(A=y.props)!=null&&A.i18nIsDynamicList?w:x},m=(y,g,v,w,x)=>{y.dummy?(y.children=g,v.push(_.cloneElement(y,{key:w},x?void 0:g))):v.push(..._.Children.map([y],A=>{const k={...A.props};return delete k.i18nIsDynamicList,_.createElement(A.type,{...k,key:w,ref:A.ref},x?null:g)}))},p=(y,g,v)=>{const w=Cm(y);return Cm(g).reduce((A,k,R)=>{var T,D;const E=((D=(T=k.children)==null?void 0:T[0])==null?void 0:D.content)&&n.services.interpolator.interpolate(k.children[0].content,l,n.language);if(k.type==="tag"){let M=w[parseInt(k.name,10)];v.length===1&&!M&&(M=v[0][k.name]),M||(M={});const L=Object.keys(k.attrs).length!==0?T2e({props:k.attrs},M):M,I=_.isValidElement(L),F=I&&ok(k,!0)&&!k.voidElement,U=o&&Pf(L)&&L.dummy&&!I,Y=Pf(t)&&Object.hasOwnProperty.call(t,k.name);if(jo(L)){const W=n.services.interpolator.interpolate(L,l,n.language);A.push(W)}else if(ok(L)||F){const W=d(L,k,v);m(L,W,A,R)}else if(U){const W=p(w,k.children,v);m(L,W,A,R)}else if(Number.isNaN(parseFloat(k.name)))if(Y){const W=d(L,k,v);m(L,W,A,R,k.voidElement)}else if(r.transSupportBasicHtmlNodes&&a.indexOf(k.name)>-1)if(k.voidElement)A.push(_.createElement(k.name,{key:`${k.name}-${R}`}));else{const W=p(w,k.children,v);A.push(_.createElement(k.name,{key:`${k.name}-${R}`},W))}else if(k.voidElement)A.push(`<${k.name} />`);else{const W=p(w,k.children,v);A.push(`<${k.name}>${W}</${k.name}>`)}else if(Pf(L)&&!I){const W=k.children[0]?E:null;W&&A.push(W)}else m(L,E,A,R,k.children.length!==1||!E)}else if(k.type==="text"){const M=r.transWrapTextNodes,L=i?r.unescape(n.services.interpolator.interpolate(k.content,l,n.language)):n.services.interpolator.interpolate(k.content,l,n.language);M?A.push(_.createElement(M,{key:`${k.name}-${R}`},L)):A.push(L)}return A},[])},h=p([{dummy:!0,children:t||[]}],f,Cm(t||[]));return ak(h[0])},_J=(t,e,n)=>{const r=t.key||e,s=_.cloneElement(t,{key:r});if(!s.props||!s.props.children||n.indexOf(`${e}/>`)<0&&n.indexOf(`${e} />`)<0)return s;function i(){return _.createElement(_.Fragment,null,s)}return _.createElement(i,{key:r})},D2e=(t,e)=>t.map((n,r)=>_J(n,r,e)),N2e=(t,e)=>{const n={};return Object.keys(t).forEach(r=>{Object.assign(n,{[r]:_J(t[r],r,e)})}),n},M2e=(t,e,n,r)=>t?Array.isArray(t)?D2e(t,e):Pf(t)?N2e(t,e):(uw(n,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:r}),null):null;function O2e({children:t,count:e,parent:n,i18nKey:r,context:s,tOptions:i={},values:a,defaults:o,components:c,ns:u,i18n:f,t:l,shouldUnescape:d,...m}){var L,I,F,U,Y,W;const p=f||B$();if(!p)return uw(p,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:r}),t;const h=l||p.t.bind(p)||(H=>H),y={...yJ(),...(L=p.options)==null?void 0:L.react};let g=u||h.ns||((I=p.options)==null?void 0:I.defaultNS);g=jo(g)?[g]:g||["translation"];const v=wJ(t,y,p,r),w=o||v||y.transEmptyNodeValue||r,{hashTransKey:x}=y,A=r||(x?x(v||w):v||w);(U=(F=p.options)==null?void 0:F.interpolation)!=null&&U.defaultVariables&&(a=a&&Object.keys(a).length>0?{...a,...p.options.interpolation.defaultVariables}:{...p.options.interpolation.defaultVariables});const k=a||e!==void 0&&!((W=(Y=p.options)==null?void 0:Y.interpolation)!=null&&W.alwaysFormat)||!t?i.interpolation:{interpolation:{...i.interpolation,prefix:"#$?",suffix:"?$#"}},R={...i,context:s||i.context,count:e,...a,...k,defaultValue:w,ns:g},E=A?h(A,R):w,T=M2e(c,E,p,r),D=k2e(T||t,E,p,y,R,d),M=n??y.defaultTransParent;return M?_.createElement(M,m,D):D}const L2e={type:"3rdParty",init(t){A2e(t.options.react),R2e(t)}},U$=_.createContext();class I2e{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function q4({children:t,count:e,parent:n,i18nKey:r,context:s,tOptions:i={},values:a,defaults:o,components:c,ns:u,i18n:f,t:l,shouldUnescape:d,...m}){var v;const{i18n:p,defaultNS:h}=_.useContext(U$)||{},y=f||p||B$(),g=l||(y==null?void 0:y.t.bind(y));return O2e({children:t,count:e,parent:n,i18nKey:r,context:s,tOptions:i,values:a,defaults:o,components:c,ns:u||(g==null?void 0:g.ns)||h||((v=y==null?void 0:y.options)==null?void 0:v.defaultNS),i18n:y,t:l,shouldUnescape:d,...m})}const $2e=(t,e)=>{const n=_.useRef();return _.useEffect(()=>{n.current=t},[t,e]),n.current},xJ=(t,e,n,r)=>t.getFixedT(e,n,r),F2e=(t,e,n,r)=>_.useCallback(xJ(t,e,n,r),[t,e,n,r]),SJ=(t,e={})=>{var x,A,k,R;const{i18n:n}=e,{i18n:r,defaultNS:s}=_.useContext(U$)||{},i=n||r||B$();if(i&&!i.reportNamespaces&&(i.reportNamespaces=new I2e),!i){uw(i,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const E=(D,M)=>jo(M)?M:Pf(M)&&jo(M.defaultValue)?M.defaultValue:Array.isArray(D)?D[D.length-1]:D,T=[E,{},!1];return T.t=E,T.i18n={},T.ready=!1,T}(x=i.options.react)!=null&&x.wait&&uw(i,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...yJ(),...i.options.react,...e},{useSuspense:o,keyPrefix:c}=a;let u=s||((A=i.options)==null?void 0:A.defaultNS);u=jo(u)?[u]:u||["translation"],(R=(k=i.reportNamespaces).addUsedNamespaces)==null||R.call(k,u);const f=(i.isInitialized||i.initializedStoreOnce)&&u.every(E=>_2e(E,i,a)),l=F2e(i,e.lng||null,a.nsMode==="fallback"?u:u[0],c),d=()=>l,m=()=>xJ(i,e.lng||null,a.nsMode==="fallback"?u:u[0],c),[p,h]=_.useState(d);let y=u.join();e.lng&&(y=`${e.lng}${y}`);const g=$2e(y),v=_.useRef(!0);_.useEffect(()=>{const{bindI18n:E,bindI18nStore:T}=a;v.current=!0,!f&&!o&&(e.lng?V4(i,e.lng,u,()=>{v.current&&h(m)}):IN(i,u,()=>{v.current&&h(m)})),f&&g&&g!==y&&v.current&&h(m);const D=()=>{v.current&&h(m)};return E&&(i==null||i.on(E,D)),T&&(i==null||i.store.on(T,D)),()=>{v.current=!1,i&&(E==null||E.split(" ").forEach(M=>i.off(M,D))),T&&i&&T.split(" ").forEach(M=>i.store.off(M,D))}},[i,y]),_.useEffect(()=>{v.current&&f&&h(d)},[i,c,f]);const w=[p,i,f];if(w.t=p,w.i18n=i,w.ready=f,f||!f&&!o)return w;throw new Promise(E=>{e.lng?V4(i,e.lng,u,()=>E()):IN(i,u,()=>E())})};function j2e({i18n:t,defaultNS:e,children:n}){const r=_.useMemo(()=>({i18n:t,defaultNS:e}),[t,e]);return _.createElement(U$.Provider,{value:r},n)}const G4={ca:ove,en:BL,es:$ve,fr:hye},L5e=_.forwardRef((t,e)=>{const{label:n,placeholder:r,hint:s,description:i,required:a,disabled:o,className:c,name:u}=t,{control:f}=jd(),{i18n:l}=SJ(),d=(l.resolvedLanguage??l.language).split("-")[0],m=G4[d]??G4.es,[p,h]=_.useState(!1);return P.jsx(KI,{control:f,disabled:o,name:u,rules:{required:a},render:({field:y})=>P.jsxs(gA,{ref:e,className:ce(c,"flex flex-col space-y-3"),children:[n&&P.jsx(VA,{label:n,hint:s,required:a}),P.jsxs(hke,{open:p,onOpenChange:h,children:[P.jsx(pke,{asChild:!0,children:P.jsx(vA,{children:P.jsxs(Ci,{disabled:o,variant:"ghost",className:ce("pl-3 text-left font-normal","border border-input ",!y.value&&"text-muted-foreground"),children:[y.value?new Date(y.value).toLocaleDateString(d):r||P.jsx("span",{children:ft("common.pick_date")}),P.jsx(Afe,{className:ce("w-4 h-4 ml-auto disabled:opacity-50 ",o?"text-foreground":"text-ring")})]})})}),P.jsxs(n9,{className:"w-auto p-0",align:"start",children:[P.jsx(U6,{className:"bg-background",mode:"single",locale:m,captionLayout:"buttons",defaultMonth:y.value,selected:new Date(y.value),onSelect:g=>{y.onChange(g),h(!1)},disabled:g=>g<new Date("1980-01-01"),weekStartsOn:1,fixedWeeks:!0,fromYear:2024,toYear:new Date().getFullYear()+1,initialFocus:!0}),P.jsx("div",{className:"p-2 border-t",children:P.jsx(Ci,{type:"button",variant:"ghost",size:"sm",className:"w-full",disabled:o,onClick:()=>{y.onChange(new Date),h(!1)},children:ft("common.today")})})]})]}),i&&P.jsx(yA,{children:i}),P.jsx(WA,{})]})})}),z2e=se.forwardRef(({className:t,title:e,description:n,actions:r,footerActions:s,children:i},a)=>{const o=se.useId(),c=_.useMemo(()=>e||n||r,[e,n,r]);return P.jsxs(H6,{id:o,className:ce(c?"":"pt-6",t),ref:a,children:[c&&P.jsxs(W6,{className:"flex flex-row flex-wrap items-center justify-between sm:flex-nowrap",children:[P.jsxs("div",{children:[e&&P.jsx(V6,{className:"text-lg leading-normal",children:e}),n&&P.jsx(q6,{className:"leading-loose",children:n})]}),r&&P.jsx("div",{className:"flex-shrink-0",children:r})]}),P.jsx(G6,{className:"grid items-start gap-6",children:i}),s&&P.jsx(K6,{className:"px-6 py-4 border-t",style:{borderStyle:"inherit"},children:s})]})});z2e.displayName="FormGroup";const K4=Ho("",{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"}}),B2e=({name:t,label:e,hint:n,placeholder:r,description:s,required:i,className:a,autoSize:o,variant:c,...u})=>{const{control:f}=jd();return P.jsx(KI,{control:f,name:t,rules:{required:i},render:({field:l,fieldState:d})=>P.jsxs(gA,{className:ce(a,"flex flex-col space-y-3"),children:[e&&P.jsx(VA,{label:e,hint:n,required:i}),P.jsx(vA,{className:"grow",children:o?P.jsx(f6,{placeholder:r,className:ce(d.error?"border-destructive focus-visible:ring-destructive":"","resize-y",K4({variant:c,className:a})),...u,...l}):P.jsx(yX,{placeholder:r,className:ce(d.error?"border-destructive focus-visible:ring-destructive":"","resize-y",K4({variant:c,className:a})),...u,...l})}),s&&P.jsx(yA,{children:s}),P.jsx(WA,{})]})})},U2e=({className:t,children:e})=>P.jsx(Gee,{children:P.jsx("div",{className:ce("flex flex-col w-full min-h-screen",t),children:e})});U2e.displayName="Layout";const H2e=({className:t,children:e})=>P.jsxs(P.Fragment,{children:[P.jsx("main",{className:ce("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(WX,{})]});H2e.displayName="LayoutContent";const Y4=(t,e,n)=>{if(t&&"reportValidity"in t){const r=Ie(n,e);t.setCustomValidity(r&&r.message||""),t.reportValidity()}},EJ=(t,e)=>{for(const n in e.fields){const r=e.fields[n];r&&r.ref&&"reportValidity"in r.ref?Y4(r.ref,n,t):r.refs&&r.refs.forEach(s=>Y4(s,n,t))}},W2e=(t,e)=>{e.shouldUseNativeValidation&&EJ(t,e);const n={};for(const r in t){const s=Ie(e.fields,r),i=Object.assign(t[r]||{},{ref:s&&s.ref});if(V2e(e.names||Object.keys(t),r)){const a=Object.assign({},Ie(n,r));Jt(a,"root",i),Jt(n,r,a)}else Jt(n,r,i)}return n},V2e=(t,e)=>t.some(n=>n.startsWith(e+"."));var q2e=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:W2e((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]=EK(p,l,d,m.type,y?[].concat(y,m.message):m.message)}return d},{}):{}),i)}:(i.shouldUseNativeValidation&&EJ({},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)}}},CJ={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),k=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 T=this.clone();T.$_terms.alterations=T.$_terms.alterations||[];for(const D in E){const M=E[D];o(typeof M=="function","Alteration adjuster for",D,"must be a function"),T.$_terms.alterations.push({target:D,adjuster:M})}return T.$_temp.ruleset=!1,T}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,T){return this._default("default",E,T)}description(E){return o(E&&typeof E=="string","Description must be a non-empty string"),this.$_setFlag("description",E)}empty(E){const T=this.clone();return E!==void 0&&(E=T.$_compile(E,{override:!1})),T.$_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,T={}){return o(E!==void 0,"Missing example"),d.assertOptions(T,["override"]),this._inner("examples",E,{single:!0,override:T.override})}external(E,T){return typeof E=="object"&&(o(!T,"Cannot combine options with description"),T=E.description,E=E.method),o(typeof E=="function","Method must be a function"),o(T===void 0||T&&typeof T=="string","Description must be a non-empty string"),this._inner("externals",{method:E,description:T},{single:!0})}failover(E,T){return this._default("failover",E,T)}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 T of E)o(T&&typeof T=="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 T=this.clone();return T._preferences=d.preferences(T._preferences,E),T}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 T=this.clone(),D=E!==void 0&&!E;return T._preferences=d.preferences(T._preferences,{convert:D}),T}strip(E=!0){return this.$_setFlag("result",E?"strip":void 0)}tag(...E){o(E.length,"Missing tags");for(const T of E)o(T&&typeof T=="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 T=this.allow(...E);return T.$_setFlag("only",!!T._valids,{clone:!1}),T}when(E,T){const D=this.clone();D.$_terms.whens||(D.$_terms.whens=[]);const M=m.when(D,E,T);if(!["any","link"].includes(D.type)){const L=M.is?[M]:M.switch;for(const I of L)o(!I.then||I.then.type==="any"||I.then.type===D.type,"Cannot combine",D.type,"with",I.then&&I.then.type),o(!I.otherwise||I.otherwise.type==="any"||I.otherwise.type===D.type,"Cannot combine",D.type,"with",I.otherwise&&I.otherwise.type)}return D.$_terms.whens.push(M),D.$_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 T=this.clone();return T._cache=E||l.provider.provision(),T.$_temp.ruleset=!1,T}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 T=this.clone();if(this.type==="any"&&E.type!=="any"){const D=E.clone();for(const M of Object.keys(T))M!=="type"&&(D[M]=T[M]);T=D}T._ids.concat(E._ids),T._refs.register(E,w.toSibling),T._preferences=T._preferences?d.preferences(T._preferences,E._preferences):E._preferences,T._valids=k.merge(T._valids,E._valids,E._invalids),T._invalids=k.merge(T._invalids,E._invalids,E._valids);for(const D of E._singleRules.keys())T._singleRules.has(D)&&(T._rules=T._rules.filter(M=>M.keep||M.name!==D),T._singleRules.delete(D));for(const D of E._rules)E._definition.rules[D.method].multi||T._singleRules.set(D.name,D),T._rules.push(D);if(T._flags.empty&&E._flags.empty){T._flags.empty=T._flags.empty.concat(E._flags.empty);const D=Object.assign({},E._flags);delete D.empty,f(T._flags,D)}else if(E._flags.empty){T._flags.empty=E._flags.empty;const D=Object.assign({},E._flags);delete D.empty,f(T._flags,D)}else f(T._flags,E._flags);for(const D in E.$_terms){const M=E.$_terms[D];M?T.$_terms[D]?T.$_terms[D]=T.$_terms[D].concat(M):T.$_terms[D]=M.slice():T.$_terms[D]||(T.$_terms[D]=M)}return this.$_root._tracer&&this.$_root._tracer._combine(T,[this,E]),T.$_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,T){o(!this._inRuleset(),"Cannot fork inside a ruleset");let D=this;for(let M of[].concat(E))M=Array.isArray(M)?M:M.split("."),D=D._ids.fork(M,T,D);return D.$_temp.ruleset=!1,D}rule(E){const T=this._definition;d.assertOptions(E,Object.keys(T.modifiers)),o(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const D=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;o(D>=0&&D<this._rules.length,"Cannot apply rules to empty ruleset");const M=this.clone();for(let L=D;L<M._rules.length;++L){const I=M._rules[L],F=c(I);for(const U in E)T.modifiers[U](F,E[U]),o(F.name===I.name,"Cannot change rule name");M._rules[L]=F,M._singleRules.get(F.name)===I&&M._singleRules.set(F.name,F)}return M.$_temp.ruleset=!1,M.$_mutateRebuild()}get ruleset(){o(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const E=this.clone();return E.$_temp.ruleset=E._rules.length,E}get $(){return this.ruleset}tailor(E){E=[].concat(E),o(!this._inRuleset(),"Cannot tailor inside a ruleset");let T=this;if(this.$_terms.alterations)for(const{target:D,adjuster:M}of this.$_terms.alterations)E.includes(D)&&(T=M(T),o(d.isSchema(T),"Alteration adjuster for",D,"failed to return a schema object"));return T=T.$_modify({each:D=>D.tailor(E),ref:!1}),T.$_temp.ruleset=!1,T.$_mutateRebuild()}tracer(){return x.location?x.location(this):this}validate(E,T){return A.entry(E,this,T)}validateAsync(E,T){return A.entryAsync(E,this,T)}$_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 T=Object.assign({},E);T._resolve=[],T.method=T.method||T.name;const D=this._definition.rules[T.method],M=T.args;o(D,"Unknown rule",T.method);const L=this.clone();if(M){o(Object.keys(M).length===1||Object.keys(M).length===this._definition.rules[T.name].args.length,"Invalid rule definition for",this.type,T.name);for(const I in M){let F=M[I];if(D.argsByName){const U=D.argsByName.get(I);if(U.ref&&d.isResolvable(F))T._resolve.push(I),L.$_mutateRegister(F);else if(U.normalize&&(F=U.normalize(F),M[I]=F),U.assert){const Y=d.validateArg(F,I,U);o(!Y,Y,"or reference")}}F!==void 0?M[I]=F:delete M[I]}}return D.multi||(L._ruleRemove(T.name,{clone:!1}),L._singleRules.set(T.name,T)),L.$_temp.ruleset===!1&&(L.$_temp.ruleset=null),D.priority?L._rules.unshift(T):L._rules.push(T),L}$_compile(E,T){return m.schema(this.$_root,E,T)}$_createError(E,T,D,M,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,T,D,F,U,M,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,T,D,M){(D=Object.assign({},D)).abortEarly=!0,D._externals=!1,T.snapshot();const L=!A.validate(E,this,T,D,M).errors;return T.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:T,name:D,path:M,key:L})=>{const I=this._definition[T][D]&&this._definition[T][D].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:T,key:D}={}){this._refs.register(E,T),this._ids.register(E,{key:D})}$_property(E){return this._definition.properties[E]}$_reach(E){return this._ids.reach(E)}$_rootReferences(){return this._refs.roots()}$_setFlag(E,T,D={}){o(E[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const M=this._definition.flags[E]||{};if(u(T,M.default)&&(T=void 0),u(T,this._flags[E]))return this;const L=D.clone!==!1?this.clone():this;return T!==void 0?(L._flags[E]=T,L.$_mutateRegister(T)):delete L._flags[E],E[0]!=="_"&&(L.$_temp.ruleset=!1),L}$_parent(E,...T){return this[E][d.symbols.parent].call(this,...T)}$_validate(E,T,D){return A.validate(E,this,T,D)}_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 T in this.$_terms)E.$_terms[T]=this.$_terms[T]?this.$_terms[T].slice():null;E.$_super={};for(const T in this.$_super)E.$_super[T]=this._super[T].bind(E);return E}_bare(){const E=this.clone();E._reset();const T=E._definition.terms;for(const D in T){const M=T[D];E.$_terms[D]=M.init}return E.$_mutateRebuild()}_default(E,T,D={}){return d.assertOptions(D,"literal"),o(T!==void 0,"Missing",E,"value"),o(typeof T=="function"||!D.literal,"Only function value supports literal option"),typeof T=="function"&&D.literal&&(T={[d.symbols.literal]:!0,literal:T}),this.$_setFlag(E,T)}_generate(E,T,D){if(!this.$_terms.whens)return{schema:this};const M=[],L=[];for(let U=0;U<this.$_terms.whens.length;++U){const Y=this.$_terms.whens[U];if(Y.concat){M.push(Y.concat),L.push(`${U}.concat`);continue}const W=Y.ref?Y.ref.resolve(E,T,D):E,H=Y.is?[Y]:Y.switch,ee=L.length;for(let re=0;re<H.length;++re){const{is:X,then:G,otherwise:K}=H[re],J=`${U}${Y.switch?"."+re:""}`;if(X.$_match(W,T.nest(X,`${J}.is`),D)){if(G){const ue=T.localize([...T.path,`${J}.then`],T.ancestors,T.schemas),{schema:de,id:ie}=G._generate(E,ue,D);M.push(de),L.push(`${J}.then${ie?`(${ie})`:""}`);break}}else if(K){const ue=T.localize([...T.path,`${J}.otherwise`],T.ancestors,T.schemas),{schema:de,id:ie}=K._generate(E,ue,D);M.push(de),L.push(`${J}.otherwise${ie?`(${ie})`:""}`);break}}if(Y.break&&L.length>ee)break}const I=L.join(", ");if(T.mainstay.tracer.debug(T,"rule","when",I),!I)return{schema:this};if(!T.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,T,D));for(const U of M)F=F.concat(U);return this.$_root._tracer&&this.$_root._tracer._combine(F,[this,...M]),this.$_temp.whens[I]=F,{schema:F,id:I}}_inner(E,T,D={}){o(!this._inRuleset(),`Cannot set ${E} inside a ruleset`);const M=this.clone();return M.$_terms[E]&&!D.override||(M.$_terms[E]=[]),D.single?M.$_terms[E].push(T):M.$_terms[E].push(...T),M.$_temp.ruleset=!1,M}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(E,T={}){if(!this._singleRules.has(E))return this;const D=T.clone!==!1?this.clone():this;D._singleRules.delete(E);const M=[];for(let L=0;L<D._rules.length;++L){const I=D._rules[L];I.name!==E||I.keep?M.push(I):D._inRuleset()&&L<D.$_temp.ruleset&&--D.$_temp.ruleset}return D._rules=M,D}_values(E,T){d.verifyFlat(E,T.slice(1,-1));const D=this.clone(),M=E[0]===d.symbols.override;if(M&&(E=E.slice(1)),!D[T]&&E.length?D[T]=new k:M&&(D[T]=E.length?new k:null,D.$_mutateRebuild()),!D[T])return D;M&&D[T].override();for(const L of E){o(L!==void 0,"Cannot call allow/valid/invalid with undefined"),o(L!==d.symbols.override,"Override must be the first value");const I=T==="_invalids"?"_valids":"_invalids";D[I]&&(D[I].remove(L),D[I].length||(o(T==="_valids"||!D._flags.only,"Setting invalid value",L,"leaves schema rejecting all values due to previous valid rule"),D[I]=null)),D[T].add(L,D._refs)}return D}}};R.Base.prototype[d.symbols.any]={version:d.version,compile:m.compile,root:"$_root"},R.Base.prototype.isImmutable=!0,R.Base.prototype.deny=R.Base.prototype.invalid,R.Base.prototype.disallow=R.Base.prototype.invalid,R.Base.prototype.equal=R.Base.prototype.valid,R.Base.prototype.exist=R.Base.prototype.required,R.Base.prototype.not=R.Base.prototype.invalid,R.Base.prototype.options=R.Base.prototype.prefs,R.Base.prototype.preferences=R.Base.prototype.prefs,s.exports=new R.Base},8652:(s,i,a)=>{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<p;case">=":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<m.switch.length;++h){const y=m.switch[h],g=h===m.switch.length-1;c.assertOptions(y,g?["is","then","otherwise"]:["is","then"]),o(y.is!==void 0,'Switch statement missing "is"'),o(y.then!==void 0,'Switch statement missing "then"');const v={is:l.$_compile(y.is),then:l.$_compile(y.then)};if(u.isRef(y.is)||c.isSchema(y.is)||(v.is=v.is.required()),g){o(m.otherwise===void 0||y.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');const w=m.otherwise!==void 0?m.otherwise:y.otherwise;w!==void 0&&(o(p.break===void 0,"Cannot specify both otherwise and break"),v.otherwise=l.$_compile(w))}p.switch.push(v)}return p},f.condition=function(l,d){for(const m of["then","otherwise"])d[m]===void 0?delete d[m]:d[m]=l.$_compile(d[m]);return d}},6354:(s,i,a)=>{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 T=E.method;if(T===void 0&&(T=function(){return this.$_addRule(R)}),T&&(o(!h[R],"Rule conflict in",g.type,R),h[R]=T),o(!x[R],"Rule conflict in",g.type,R),x[R]=E,E.alias){const D=[].concat(E.alias);for(const M of D)h[M]=E.method}E.args&&(E.argsByName=new Map,E.args=E.args.map(D=>(typeof D=="string"&&(D={name:D}),o(!E.argsByName.has(D.name),"Duplicated argument name",D.name),u.isSchema(D.assert)&&(D.assert=D.assert.strict().label(D.name)),E.argsByName.set(D.name,D),D)))}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 T=function(D){return this.rule({[R]:D})};h[R]=T,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 k=Object.assign({},v.manifest,g.manifest);return k.build=l.build(g.manifest&&g.manifest.build,v.manifest&&v.manifest.build),g.manifest=k,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(...k){return o(!k.length||["alternatives","link","object"].includes(A),"The",A,"type does not allow arguments"),w.generate(this,w.types[A],k)};for(const A of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])x[A]=function(...k){return this.any()[A](...k)};Object.assign(x,w.methods);for(const A in w.aliases){const k=w.aliases[A];x[A]=x[k]}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,...k){w.assert(x,A,!0,k)},attempt:(x,A,...k)=>w.assert(x,A,!1,k),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 k of A._types){const R=x(A[k]());o(f.isSchema(R),"modifier must return a valid schema object"),A[k]=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 k of x){typeof k=="function"&&(k=k(A)),this.assert(k,v.extension);const R=w.expandExtension(k,A);for(const E of R){o(A[E.type]===void 0||A._types.has(E.type),"Cannot override name",E.type);const T=E.base||this.any(),D=m.type(T,E);A._types.add(E.type),A[E.type]=function(...M){return w.generate(this,D,M)}}}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,k,R){const E=R[0]instanceof Error||typeof R[0]=="string"?R[0]:null,T=E!==null?R[1]:R[0],D=A.validate(x,f.preferences({errors:{stack:!0}},T||{}));let M=D.error;if(!M)return D.value;if(E instanceof Error)throw E;const L=k&&typeof M.annotate=="function"?M.annotate():M.message;throw M instanceof d.ValidationError==0&&(M=c(M)),M.message=E?`${E} ${L}`:L,M},w.generate=function(x,A,k){return o(x,"Must be invoked on a Joi instance."),A.$_root=x,A._definition.args&&k.length?A._definition.args(A,...k):A},w.expandExtension=function(x,A){if(typeof x.type=="string")return[x];const k=[];for(const R of A._types)if(x.type.test(R)){const E=Object.assign({},x);E.type=R,E.base=A[R](),k.push(E)}return k},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<l._rules.length;++p){const h=l._rules[p],y=f.scan(h.args,{source:"rules",name:h.name},d);if(y!==void 0){m=m||l.clone();const g=Object.assign({},h);g.args=y,m._rules[p]=g,m._singleRules.get(h.name)===h&&m._singleRules.set(h.name,g)}}for(const p in l.$_terms){if(p[0]==="_")continue;const h=f.scan(l.$_terms[p],{source:"terms",name:p},d);h!==void 0&&(m=m||l.clone(),m.$_terms[p]=h)}return m},f.scan=function(l,d,m,p,h){const y=p||[];if(l===null||typeof l!="object")return;let g;if(Array.isArray(l)){for(let v=0;v<l.length;++v){const w=d.source==="terms"&&d.name==="keys"&&l[v].key,x=f.scan(l[v],d,m,[v,...y],w);x!==void 0&&(g=g||l.slice(),g[v]=x)}return g}if(m.schema!==!1&&c.isSchema(l)||m.ref!==!1&&u.isRef(l)){const v=m.each(l,{...d,path:y,key:h});return v===l?void 0:v}for(const v in l){if(v[0]==="_")continue;const w=f.scan(l[v],d,m,[v,...y],h);w!==void 0&&(g=g||Object.assign({},l),g[v]=w)}return g}},6133:(s,i,a)=>{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<l.length;++h){const y=l[h];let g=p.get(y);g||(g=new Map,p.set(y,g)),p=g}p[f.value]=d}get(l){const d=this.node(l);if(d)return d[f.value]}node(l){if(this._values)return c(this._values,l,{iterables:!0})}override(l,d){if(!this._values)return;const m=l.slice(0,-1),p=l[l.length-1],h=c(this._values,m,{iterables:!0});d?h.set(p,d):h&&h.delete(p)}}},3328:(s,i,a)=>{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]!=="{",k=A?"}":"}}",R=x.indexOf(k);if(R===-1||x[1]==="{"){v.push(`{${p.decode(x)}`);continue}let E=x.slice(A?0:1,R);const T=E[0]===":";T&&(E=E.slice(1));const D=this._ref(p.decode(E),{raw:A,wrapped:T});v.push(D),typeof D!="string"&&(g=!0);const M=x.slice(R+k.length);M&&v.push(p.decode(M))}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 k=this._part(A,h,y,g,v,w),R=p.stringify(k,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 k=m.create(A,this._settings);return v.push(k),R=>{const E=k.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<h.length;++v){const w=h[v];if(w==="{"){let x="";for(;v+1<h.length&&h[v+1]==="{";)x+="{",++v;y.push(g),g=x}else g+=w}return y.push(g),y},p.wrap=function(h,y){return y?y.length===1?`${y}${h}${y}`:`${y[0]}${h}${y[1]}`:h},p.stringify=function(h,y,g,v,w,x={}){const A=typeof h,k=v&&v.errors&&v.errors.wrap||{};let R=!1;if(m.isRef(h)&&h.render&&(R=h.in,h=h.resolve(y,g,v,w,{in:h.in,...x})),h===null)return"null";if(A==="string")return p.wrap(h,x.arrayItems&&k.string);if(A==="number"||A==="function"||A==="symbol")return h.toString();if(A!=="object")return JSON.stringify(h);if(h instanceof Date)return p.Template.date(h,v);if(h instanceof Map){const T=[];for(const[D,M]of h.entries())T.push(`${D.toString()} -> ${M.toString()}`);h=T}if(!Array.isArray(h))return h.toString();const E=[];for(const T of h)E.push(p.stringify(T,y,g,v,w,{arrayItems:!0,...x}));return p.wrap(E.join(", "),!R&&k.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 k=d.template(y,A[0],h,g,v)||d.template(y,A[1],h,g,v);return k?k.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 k=[],R=[];for(let T=0;T<g.$_terms.matches.length;++T){const D=g.$_terms.matches[T],M=w.nest(D.schema,`match.${T}`);M.snapshot();const L=D.schema.$_validate(h,M,x);L.errors?(R.push(L.errors),M.restore()):(k.push(L.value),M.commit())}if(k.length===0)return{errors:v("alternatives.any",{details:R.map(T=>d.details(T,{override:!1}))})};if(g._flags.match==="one")return k.length===1?{value:k[0]}:{errors:v("alternatives.one")};if(k.length!==g.$_terms.matches.length)return{errors:v("alternatives.all",{details:R.map(T=>d.details(T,{override:!1}))})};const E=T=>T.$_terms.matches.some(D=>D.schema.type==="object"||D.schema.type==="alternatives"&&E(D.schema));return E(g)?{value:k.reduce((T,D)=>c(T,D,{mergeArrays:!1}))}:{value:k[k.length-1]}}const A=[];for(let k=0;k<g.$_terms.matches.length;++k){const R=g.$_terms.matches[k];if(R.schema){const D=w.nest(R.schema,`match.${k}`);D.snapshot();const M=R.schema.$_validate(h,D,x);if(!M.errors)return D.commit(),M;D.restore(),A.push({schema:R.schema,reports:M.errors});continue}const E=R.ref?R.ref.resolve(h,w,x):h,T=R.is?[R]:R.switch;for(let D=0;D<T.length;++D){const M=T[D],{is:L,then:I,otherwise:F}=M,U=`match.${k}${R.switch?"."+D:""}`;if(L.$_match(E,w.nest(L,`${U}.is`),x)){if(I)return I.$_validate(h,w.nest(I,`${U}.then`),x)}else if(F)return F.$_validate(h,w.nest(F,`${U}.otherwise`),x)}}return p.errors(A,y)},rules:{conditional:{method(h,y){o(!this._flags._endedSwitch,"Unreachable condition"),o(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),o(y.break===void 0,"Cannot use break option with alternatives conditional");const g=this.clone(),v=l.when(g,h,y),w=v.is?[v]:v.switch;for(const x of w)if(x.then&&x.otherwise){g.$_setFlag("_endedSwitch",!0,{clone:!1});break}return g.$_terms.matches.push(v),g.$_mutateRebuild()}},match:{method(h){if(o(["any","one","all"].includes(h),"Invalid alternatives match mode",h),h!=="any")for(const y of this.$_terms.matches)o(y.schema,"Cannot combine match mode",h,"with conditional rules");return this.$_setFlag("match",h)}},try:{method(...h){o(h.length,"Missing alternative schemas"),f.verifyFlat(h,"try"),o(!this._flags._endedSwitch,"Unreachable condition");const y=this.clone();for(const g of h)y.$_terms.matches.push({schema:y.$_compile(g)});return y.$_mutateRebuild()}}},overrides:{label(h){return this.$_parent("label",h).$_modify({each:(y,g)=>g.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:k,otherwise:R}=g;h=v?h.try(v):w?h.conditional(w,{is:x,then:k,not:A,otherwise:R,switch:g.switch}):h.conditional(x,{then:k,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 k=x[0];if(k instanceof d.Report==0)return p.unmatched(h,y);if(k.state.path.length!==g.path.length){w.push({type:A.type,report:k});continue}if(k.code==="any.only"){for(const T of k.local.valids)v.add(T);continue}const[R,E]=k.code.split(".");E!=="base"?w.push({type:A.type,report:k}):k.code==="object.base"?v.add(k.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;A<p.length;++A){const k=h.localize([...h.path,A],w,v);if(v.$_match(p[A],k,y))return p}const x=v._flags.label;return x?g("array.hasKnown",{patternLabel:x}):g("array.hasUnknown",null)},multi:!0},items:{method(...p){l.verifyFlat(p,"items");const h=this.$_addRule("items");for(let y=0;y<p.length;++y){const g=l.tryWithPath(()=>this.$_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(),k=[...h.$_terms._inclusions,...x],R=!p[l.symbols.arraySingle];delete p[l.symbols.arraySingle];const E=w();let T=p.length;for(let D=0;D<T;++D){const M=p[D];let L=!1,I=!1;const F=R?D:new Number(D),U=[...g.path,F];if(!h._flags.sparse&&M===void 0){if(E.push(y("array.sparse",{key:F,path:U,pos:D,value:void 0},g.localize(U))),v.abortEarly)return E;A.shift();continue}const Y=[p,...g.ancestors];for(const re of h.$_terms._exclusions)if(re.$_match(M,g.localize(U,Y,re),v,{presence:"ignore"})){if(E.push(y("array.excludes",{pos:D,value:M},g.localize(U))),v.abortEarly)return E;L=!0,A.shift();break}if(L)continue;if(h.$_terms.ordered.length){if(A.length){const re=A.shift(),X=re.$_validate(M,g.localize(U,Y,re),v);if(X.errors){if(E.push(...X.errors),v.abortEarly)return E}else if(re._flags.result==="strip")m.fastSplice(p,D),--D,--T;else{if(!h._flags.sparse&&X.value===void 0){if(E.push(y("array.sparse",{key:F,path:U,pos:D,value:void 0},g.localize(U))),v.abortEarly)return E;continue}p[D]=X.value}continue}if(!h.$_terms.items.length){if(E.push(y("array.orderedLength",{pos:D,limit:h.$_terms.ordered.length})),v.abortEarly)return E;break}}const W=[];let H=x.length;for(let re=0;re<H;++re){const X=g.localize(U,Y,x[re]);X.snapshot();const G=x[re].$_validate(M,X,v);if(W[re]=G,!G.errors){if(X.commit(),p[D]=G.value,I=!0,m.fastSplice(x,re),--re,--H,!h._flags.sparse&&G.value===void 0&&(E.push(y("array.sparse",{key:F,path:U,pos:D,value:void 0},g.localize(U))),v.abortEarly))return E;break}X.restore()}if(I)continue;const ee=v.stripUnknown&&!!v.stripUnknown.arrays||!1;H=k.length;for(const re of k){let X;const G=x.indexOf(re);if(G!==-1)X=W[G];else{const K=g.localize(U,Y,re);if(K.snapshot(),X=re.$_validate(M,K,v),!X.errors){K.commit(),re._flags.result==="strip"?(m.fastSplice(p,D),--D,--T):h._flags.sparse||X.value!==void 0?p[D]=X.value:(E.push(y("array.sparse",{key:F,path:U,pos:D,value:void 0},g.localize(U))),L=!0),I=!0;break}K.restore()}if(H===1){if(ee){m.fastSplice(p,D),--D,--T,I=!0;break}if(E.push(...X.errors),v.abortEarly)return E;L=!0;break}}if(!L&&(h.$_terms._inclusions.length||h.$_terms._requireds.length)&&!I){if(ee){m.fastSplice(p,D),--D,--T;continue}if(E.push(y("array.includes",{pos:D,value:M},g.localize(U))),v.abortEarly)return E}}return x.length&&m.fillMissedErrors(h,E,x,p,g,v),A.length&&(m.fillOrderedErrors(h,E,A,p,g,v),E.length||m.fillDefault(A,p,g,v)),E.length?E:p},priority:!0,manifest:!1},length:{method(p){return this.$_addRule({name:"length",args:{limit:p},operator:"="})},validate:(p,h,{limit:y},{name:g,operator:v,args:w})=>l.compare(p.length,y,v)?p:h.error("array."+g,{limit:w.limit,value:p}),args:[{name:"limit",ref:!0,assert:l.limit,message:"must be a positive integer"}]},max:{method(p){return this.$_addRule({name:"max",method:"length",args:{limit:p},operator:"<="})}},min:{method(p){return this.$_addRule({name:"min",method:"length",args:{limit:p},operator:">="})}},ordered:{method(...p){l.verifyFlat(p,"ordered");const h=this.$_addRule("items");for(let y=0;y<p.length;++y){const g=l.tryWithPath(()=>this.$_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 k=0;k<p.length;++k)if(p[k]!==x[k])return h("array.sort",{order:w.order,by:w.by?w.by.key:"value"});return p},convert:!0},sparse:{method(p){const h=p===void 0||!!p;return this._flags.sparse===h?this:(h?this.clone():this.$_addRule("items")).$_setFlag("sparse",h,{clone:!1})}},unique:{method(p,h={}){o(!p||typeof p=="function"||typeof p=="string","comparator must be a function or a string"),l.assertOptions(h,["ignoreUndefined","separator"]);const y={name:"unique",args:{options:h,comparator:p}};if(p)if(typeof p=="string"){const g=l.default(h.separator,".");y.path=g?p.split(g):[p]}else y.comparator=p;return this.$_addRule(y)},validate(p,{state:h,error:y,schema:g},{comparator:v,options:w},{comparator:x,path:A}){const k={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),bigint:Object.create(null),object:new Map,function:new Map,custom:new Map},R=x||c,E=w.ignoreUndefined;for(let T=0;T<p.length;++T){const D=A?u(p[T],A):p[T],M=x?k.custom:k[typeof D];if(o(M,"Failed to find unique map container for type",typeof D),M instanceof Map){const L=M.entries();let I;for(;!(I=L.next()).done;)if(R(I.value[0],D)){const F=h.localize([...h.path,T],[p,...h.ancestors]),U={pos:T,value:p[T],dupePos:I.value[1],dupeValue:p[I.value[1]]};return A&&(U.path=v),y("array.unique",U,F)}M.set(D,T)}else{if((!E||D!==void 0)&&M[D]!==void 0){const L={pos:T,value:p[T],dupePos:M[D],dupeValue:p[M[D]]};return A&&(L.path=v),y("array.unique",L,h.localize([...h.path,T],[p,...h.ancestors]))}M[D]=T}}return p},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(p,h)=>new 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 k of y){const R=k._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],k=[h,...y.ancestors],R=A.$_validate(void 0,y.localize(y.path,k,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<p.length;)p[y++]=p[y];--p.length},m.validateSingle=function(p,h){(p.type==="array"||p._flags._arrayItems)&&(o(!h._flags.single,"Cannot specify array item with single rule enabled"),h.$_setFlag("_arrayItems",!0,{clone:!1}))},m.sort=function(p,h,y,g,v){const w=y.order==="ascending"?1:-1,x=-1*w,A=w,k=(R,E)=>{let T=m.compare(R,E,x,A);if(T!==null||(y.by&&(R=y.by.resolve(R,g,v),E=y.by.resolve(E,g,v)),T=m.compare(R,E,x,A),T!==null))return T;const D=typeof R;if(D!==typeof E)throw p.$_createError("array.sort.mismatching",h,null,g,v);if(D!=="number"&&D!=="string")throw p.$_createError("array.sort.unsupported",h,{type:D},g,v);return D==="number"?(R-E)*w:R<E?x:A};try{return{value:h.slice().sort(k)}}catch(R){return{errors:R}}},m.compare=function(p,h,y,g){return p===h?0:p===void 0?1:h===void 0?-1:p===null?g:h===null?y:null}},4937:(s,i,a)=>{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;p<d.length;++p){const h=d[p];o(h!==void 0,"Cannot call truthy with undefined"),m.$_terms.truthy.add(h)}return m}},falsy:{method(...d){u.verifyFlat(d,"falsy");const m=this.clone();m.$_terms.falsy=m.$_terms.falsy||new f;for(let p=0;p<d.length;++p){const h=d[p];o(h!==void 0,"Cannot call falsy with undefined"),m.$_terms.falsy.add(h)}return m}},sensitive:{method(d=!0){return this.$_setFlag("sensitive",d)}}},cast:{number:{from:l.isBool,to:(d,m)=>d?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:k}){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,k);const R=[];if(w.$_terms.renames&&!g.rename(w,v,A,k,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 T=[v,...A.ancestors];for(const D of w.$_terms.keys){const M=D.key,L=v[M];E.delete(M);const I=A.localize([...A.path,M],T,D),F=D.schema.$_validate(L,I,k);if(F.errors){if(k.abortEarly)return{value:v,errors:F.errors};F.value!==void 0&&(v[M]=F.value),R.push(...F.errors)}else D.schema._flags.result==="strip"||F.value===void 0&&L!==void 0?delete v[M]:F.value!==void 0&&(v[M]=F.value)}}if(E.size||w._flags._hasPatternMatch){const T=g.unknown(w,v,E,R,A,k);if(T)return T}if(w.$_terms.dependencies)for(const T of w.$_terms.dependencies){if(T.key!==null&&g.isPresent(T.options)(T.key.resolve(v,A,k,null,{shadow:!1}))===!1)continue;const D=g.dependencies[T.rel](w,T,v,A,k);if(D){const M=w.$_createError(D.code,v,D.context,A,k);if(k.abortEarly)return{value:v,errors:M};R.push(M)}}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:k,schema:R,message:E}){const T=k.resolve(v,A,x),D=h.isRef(k)?k.absolute(A):[];return R.$_match(T,A.localize(D,[v,...A.ancestors],R),x)?v:w("object.assert",{subject:k,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:k,args:R})=>d.compare(Object.keys(v).length,x,k)?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 k=this.clone();k.$_terms.patterns=k.$_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)),k.$_mutateRegister(R.matches),k.$_setFlag("_hasPatternMatch",!0,{clone:!1})),x.fallthrough&&(R.fallthrough=!0),k.$_terms.patterns.push(R),k.$_mutateRegister(w),k}},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 k of A.$_terms.renames)c(k.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:k,options:R}of w.dependencies)v=g.dependency(v,x,A,k,R);if(w.patterns)for(const{regex:x,schema:A,rule:k,fallthrough:R,matches:E}of w.patterns)v=v.pattern(x||A,k,{fallthrough:R,matches:E});if(w.renames)for(const{from:x,to:A,options:k}of w.renames)v=v.rename(x,A,k);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,k){c(x===null||typeof x=="string",w,"key must be a strings"),k||(k=A.length>1&&typeof A[A.length-1]=="object"?A.pop():{}),d.assertOptions(k,["separator","isPresent"]),A=[].concat(A);const R=d.default(k.separator,"."),E=[];for(const D of A)c(typeof D=="string",w,"peers must be strings"),E.push(m.ref(D,{separator:R,ancestor:0,prefix:!1}));x!==null&&(x=m.ref(x,{separator:R,ancestor:0,prefix:!1}));const T=v.clone();return T.$_terms.dependencies=T.$_terms.dependencies||[],T.$_terms.dependencies.push(new g.Dependency(w,x,E,A,k)),T},g.dependencies={and(v,w,x,A,k){const R=[],E=[],T=w.peers.length,D=g.isPresent(w.options);for(const M of w.peers)D(M.resolve(x,A,k,null,{shadow:!1}))===!1?R.push(M.key):E.push(M.key);if(R.length!==T&&E.length!==T)return{code:"object.and",context:{present:E,presentWithLabels:g.keysToLabels(v,E),missing:R,missingWithLabels:g.keysToLabels(v,R)}}},nand(v,w,x,A,k){const R=[],E=g.isPresent(w.options);for(const M of w.peers)E(M.resolve(x,A,k,null,{shadow:!1}))&&R.push(M.key);if(R.length!==w.peers.length)return;const T=w.paths[0],D=w.paths.slice(1);return{code:"object.nand",context:{main:T,mainWithLabel:g.keysToLabels(v,T),peers:D,peersWithLabels:g.keysToLabels(v,D)}}},or(v,w,x,A,k){const R=g.isPresent(w.options);for(const E of w.peers)if(R(E.resolve(x,A,k,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:w.paths,peersWithLabels:g.keysToLabels(v,w.paths)}}},oxor(v,w,x,A,k){const R=[],E=g.isPresent(w.options);for(const D of w.peers)E(D.resolve(x,A,k,null,{shadow:!1}))&&R.push(D.key);if(!R.length||R.length===1)return;const T={peers:w.paths,peersWithLabels:g.keysToLabels(v,w.paths)};return T.present=R,T.presentWithLabels=g.keysToLabels(v,R),{code:"object.oxor",context:T}},with(v,w,x,A,k){const R=g.isPresent(w.options);for(const E of w.peers)if(R(E.resolve(x,A,k,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,k){const R=g.isPresent(w.options);for(const E of w.peers)if(R(E.resolve(x,A,k,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,k){const R=[],E=g.isPresent(w.options);for(const D of w.peers)E(D.resolve(x,A,k,null,{shadow:!1}))&&R.push(D.key);if(R.length===1)return;const T={peers:w.paths,peersWithLabels:g.keysToLabels(v,w.paths)};return R.length===0?{code:"object.missing",context:T}:(T.present=R,T.presentWithLabels=g.keysToLabels(v,R),{code:"object.xor",context:T})}},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,k){const R={};for(const E of v.$_terms.renames){const T=[],D=typeof E.from!="string";if(D)for(const M in w){if(w[M]===void 0&&E.options.ignoreUndefined||M===E.to)continue;const L=E.from.exec(M);L&&T.push({from:M,to:E.to,match:L})}else!Object.prototype.hasOwnProperty.call(w,E.from)||w[E.from]===void 0&&E.options.ignoreUndefined||T.push(E);for(const M of T){const L=M.from;let I=M.to;if(I instanceof y&&(I=I.render(w,x,A,M.match)),L!==I){if(!E.options.multiple&&R[I]&&(k.push(v.$_createError("object.rename.multiple",w,{from:L,to:I,pattern:D},x,A)),A.abortEarly)||Object.prototype.hasOwnProperty.call(w,I)&&!E.options.override&&!R[I]&&(k.push(v.$_createError("object.rename.override",w,{from:L,to:I,pattern:D},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,k,R){if(v.$_terms.patterns){let E=!1;const T=v.$_terms.patterns.map(M=>{if(M.matches)return E=!0,[]}),D=[w,...k.ancestors];for(const M of x){const L=w[M],I=[...k.path,M];for(let F=0;F<v.$_terms.patterns.length;++F){const U=v.$_terms.patterns[F];if(U.regex){const H=U.regex.test(M);if(k.mainstay.tracer.debug(k,"rule",`pattern.${F}`,H?"pass":"error"),!H)continue}else if(!U.schema.$_match(M,k.nest(U.schema,`pattern.${F}`),R))continue;x.delete(M);const Y=k.localize(I,D,{schema:U.rule,key:M}),W=U.rule.$_validate(L,Y,R);if(W.errors){if(R.abortEarly)return{value:w,errors:W.errors};A.push(...W.errors)}if(U.matches&&T[F].push(M),w[M]=W.value,!U.fallthrough)break}}if(E)for(let M=0;M<T.length;++M){const L=T[M];if(!L)continue;const I=v.$_terms.patterns[M].matches,F=k.localize(k.path,D,I),U=I.$_validate(L,F,R);if(U.errors){const Y=p.details(U.errors,{override:!1});Y.matches=L;const W=v.$_createError("object.pattern.match",w,Y,k,R);if(R.abortEarly)return{value:w,errors:W};A.push(W)}}}if(x.size&&(v.$_terms.keys||v.$_terms.patterns)){if(R.stripUnknown&&v._flags.unknown===void 0||R.skipFunctions){const E=!(!R.stripUnknown||R.stripUnknown!==!0&&!R.stripUnknown.objects);for(const T of x)E?(delete w[T],x.delete(T)):typeof w[T]=="function"&&x.delete(T)}if(!d.default(v._flags.unknown,R.allowUnknown))for(const E of x){const T=k.localize([...k.path,E],[]),D=v.$_createError("object.unknown",w[E],{child:E},T,R,{flags:!1});if(R.abortEarly)return{value:w,errors:D};A.push(D)}}},g.Dependency=class{constructor(v,w,x,A,k){this.rel=v,this.key=w,this.peers=x,this.paths=A,this.options=k}describe(){const v={rel:this.rel,peers:this.paths};return this.key!==null&&(v.key=this.key.key),this.peers[0].separator!=="."&&(v.options={...v.options,separator:this.peers[0].separator}),this.options.isPresent&&(v.options={...v.options,isPresent:this.options.isPresent}),v}},g.Keys=class extends Array{concat(v){const w=this.slice(),x=new Map;for(let A=0;A<w.length;++A)x.set(w[A].key,A);for(const A of v){const k=A.key,R=x.get(k);R!==void 0?w[R]={key:k,schema:w[R].schema.concat(A.schema)}:w.push(A)}return w}}},8785:(s,i,a)=>{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||l<Number.MIN_SAFE_INTEGER)&&(h.errors=m("number.unsafe")),h},rules:{compare:{method:!1,validate:(l,d,{limit:m},{name:p,operator:h,args:y})=>u.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 k=v.$_getRule("case");k&&(g=k.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 T of v.$_terms.replacements)g=g.replace(T.pattern,T.replacement);const E=v.$_getRule("hex");if(E&&E.args.options.byteAligned&&g.length%2!=0&&(g=`0${g}`),v.$_getRule("isoDate")){const T=y.isoDate(g);T&&(g=T)}if(v._flags.truncate){const T=v.$_getRule("max");if(T){let D=T.args.limit;if(h.isResolvable(D)&&(D=D.resolve(g,w,x),!h.limit(D)))return{value:g,errors:v.$_createError("any.ref",D,{ref:T.args.limit,arg:"limit",reason:"must be a positive integer"},w,x)};g=g.slice(0,D)}}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 k=g.charAt(w)*A;x+=k-9*(k>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 k=w.multiple?g.split(x):[g],R=[];for(const E of k)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 k=new Set;for(let R=0;R<A.length;++R){const E=A[R];o(typeof E=="string","version at position "+R+" must be a string");const T=y.guidVersions[E.toLowerCase()];o(T,"version at position "+R+" must be one of "+Object.keys(y.guidVersions).join(", ")),o(!k.has(T),"version at position "+R+" must not be a duplicate"),v+=T,k.add(T)}}o(y.guidSeparators.has(g.separator),'separator must be one of true, false, "-", or ":"');const w=g.separator===void 0?"[:-]?":g.separator===!0?"[:-]":g.separator===!1?"[]?":`\\${g.separator}`,x=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${w})[0-9A-F]{4}\\2?[${v||"0-9A-F"}][0-9A-F]{3}\\2?[${v?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:g},regex:x})},validate(g,v,w,{regex:x}){const A=x.exec(g);return A?y.guidBrackets[A[1]]!==A[A.length-1]?v.error("string.guid"):g:v.error("string.guid")}},hex:{method(g={}){return h.assertOptions(g,["byteAligned","prefix"]),g={byteAligned:!1,prefix:!1,...g},o(typeof g.byteAligned=="boolean","byteAligned must be boolean"),o(typeof g.prefix=="boolean"||g.prefix==="optional",'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:g}})},validate:(g,v,{options:w})=>(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:k,args:R}){const E=!x&&g.length;return h.compare(E,w,k)?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:k}){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:k,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 k=w.value;const R=[];for(const E of x.externals){const T=E.state.path,D=E.schema.type==="link"?x.links.get(E.schema):null;let M,L,I=k;const F=T.length?[k]:[],U=T.length?f(h,T):h;if(T.length){M=T[T.length-1];let Y=k;for(const W of T.slice(0,-1))Y=Y[W],F.unshift(Y);L=F[0],I=L[M]}try{const Y=(H,ee)=>(D||E.schema).$_createError(H,I,ee,E.state,v),W=await E.method(I,{schema:E.schema,linked:D,state:E.state,prefs:g,original:U,error:Y,errorsArray:p.errorsArray,warn:(H,ee)=>x.warnings.push((D||E.schema).$_createError(H,I,ee,E.state,v)),message:(H,ee)=>(D||E.schema).$_createError("external",I,ee,E.state,v,{messages:H})});if(W===void 0||W===I)continue;if(W instanceof d.Report){if(x.tracer.log(E.schema,E.state,"rule","external","error"),R.push(W),v.abortEarly)break;continue}if(Array.isArray(W)&&W[l.symbols.errors]){if(x.tracer.log(E.schema,E.state,"rule","external","error"),R.push(...W),v.abortEarly)break;continue}L?(x.tracer.value(E.state,"rule",I,W,"external"),L[M]=W):(x.tracer.value(E.state,"rule",k,W,"external"),k=W)}catch(Y){throw v.errors.label&&(Y.message+=` (${E.label})`),Y}}if(w.value=k,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,k=new p.Mainstay(v,x,A),R=y._ids._schemaChain?[{schema:y}]:null,E=new m([],[],{mainstay:k,schemas:R}),T=i.validate(h,y,E,g);w&&y.$_root.untrace();const D=d.process(T.errors,h,g);return{value:T.value,error:D,mainstay:k}},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 D=y._cache.get(h);if(g.mainstay.tracer.debug(g,"validate","cached",!!D),D)return D}const x=(D,M,L)=>y.$_createError(D,h,M,L||g,v),A={original:h,prefs:v,schema:y,state:g,error:x,errorsArray:p.errorsArray,warn:(D,M,L)=>g.mainstay.warnings.push(x(D,M,L)),message:(D,M)=>y.$_createError("custom",h,M,g,v,{messages:D})};g.mainstay.tracer.entry(y,g);const k=y._definition;if(k.prepare&&h!==void 0&&v.convert){const D=k.prepare(h,A);if(D){if(g.mainstay.tracer.value(g,"prepare",h,D.value),D.errors)return p.finalize(D.value,[].concat(D.errors),A);h=D.value}}if(k.coerce&&h!==void 0&&v.convert&&(!k.coerce.from||k.coerce.from.includes(typeof h))){const D=k.coerce.method(h,A);if(D){if(g.mainstay.tracer.value(g,"coerced",h,D.value),D.errors)return p.finalize(D.value,[].concat(D.errors),A);h=D.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 T=[];if(y._valids){const D=y._valids.get(h,g,v,y._flags.insensitive);if(D)return v.convert&&(g.mainstay.tracer.value(g,"valids",h,D.value),h=D.value),g.mainstay.tracer.filter(y,g,"valid",D),p.finalize(h,null,A);if(y._flags.only){const M=y.$_createError("any.only",h,{valids:y._valids.values({display:!0})},g,v);if(v.abortEarly)return p.finalize(h,[M],A);T.push(M)}}if(y._invalids){const D=y._invalids.get(h,g,v,y._flags.insensitive);if(D){g.mainstay.tracer.filter(y,g,"invalid",D);const M=y.$_createError("any.invalid",h,{invalids:y._invalids.values({display:!0})},g,v);if(v.abortEarly)return p.finalize(h,[M],A);T.push(M)}}if(k.validate){const D=k.validate(h,A);if(D&&(g.mainstay.tracer.value(g,"base",h,D.value),h=D.value,D.errors)){if(!Array.isArray(D.errors))return T.push(D.errors),p.finalize(h,T,A);if(D.errors.length)return T.push(...D.errors),p.finalize(h,T,A)}}return y._rules.length?p.rules(h,T,A):p.finalize(h,T,A)},p.rules=function(h,y,g){const{schema:v,state:w,prefs:x}=g;for(const A of v._rules){const k=v._definition.rules[A.method];if(k.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 D of A._resolve){const M=k.argsByName.get(D),L=E[D].resolve(h,w,x),I=M.normalize?M.normalize(L):L,F=l.validateArg(I,null,M);if(F){R=v.$_createError("any.ref",L,{arg:D,ref:E[D],reason:F},w,x);break}E[D]=I}}R=R||k.validate(h,g,E,A);const T=p.rule(R,A);if(T.errors){if(w.mainstay.tracer.log(v,w,"rule",A.name,"error"),A.warn){w.mainstay.warnings.push(...T.errors);continue}if(x.abortEarly)return p.finalize(h,T.errors,g);y.push(...T.errors)}else w.mainstay.tracer.log(v,w,"rule",A.name,"pass"),w.mainstay.tracer.value(w,"rule",h,T.value,A.name),h=T.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 k=p.default("failover",void 0,y,g);k!==void 0&&(w.mainstay.tracer.value(w,"failover",h,k),h=k,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 k of y)o(k instanceof Error||k instanceof d.Report,"error() must return an Error object")}else y=[v._flags.error];if(h===void 0){const k=p.default("default",h,y,g);w.mainstay.tracer.value(w,"default",h,k),h=k}if(v._flags.cast&&h!==void 0){const k=v._definition.cast[v._flags.cast];if(k.from(h)){const R=k.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:k}of v.$_terms.externals)w.mainstay.externals.push({method:k,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,k=w._flags[h];if(A.noDefaults||k===void 0)return y;if(x.mainstay.tracer.log(w,x,"rule",h,"full"),!k)return k;if(typeof k=="function"){const R=k.length?[c(x.ancestors[0]),v]:[];try{return k(...R)}catch(E){return void g.push(w.$_createError(`any.${h}`,null,{error:E},x,A))}}return typeof k!="object"?k:k[l.symbols.literal]?k.literal:l.isResolvable(k)?k.resolve(y,x,A):c(k)},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<p.length-1;++g){const v=p[g];typeof y[v]!="object"&&(y[v]={}),y=y[v]}y[p[p.length-1]]=h}},375:(s,i,a)=>{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<f.length;++R)if(!p(f[R],l[R],d,m))return!1;return!0}for(const R of f)for(const E of l)if(p(R,E,d,m))return!0}else if(u===o.set){if(f.size!==l.size)return!1;if(!c.isSetSimpleEqual(f,l)){const R=new Set(Set.prototype.values.call(l));for(const E of Set.prototype.values.call(f)){if(R.delete(E))continue;let T=!1;for(const D of R)if(p(E,D,d,m)){R.delete(D),T=!0;break}if(!T)return!1}}}else if(u===o.map){if(f.size!==l.size)return!1;for(const[R,E]of Map.prototype.entries.call(f))if(E===void 0&&!Map.prototype.has.call(l,R)||!p(E,Map.prototype.get.call(l,R),d,m))return!1}else if(u===o.error&&(f.name!==l.name||f.message!==l.message))return!1;const w=h(f),x=h(l);if((f!==w||l!==x)&&!p(w,x,d,m))return!1;const A=g(f);if(!d.part&&A.length!==g(l).length&&!d.skip)return!1;let k=0;for(const R of A)if(d.skip&&d.skip.includes(R))l[R]===void 0&&++k;else if(!y(l,R)||!p(f[R],l[R],d,m))return!1;if(!d.part&&A.length-k!==g(l).length)return!1;if(d.symbols!==!1){const R=v(f),E=new Set(v(l));for(const T of R){if(!d.skip||!d.skip.includes(T)){if(y(f,T)){if(!y(l,T)||!p(f[T],l[T],d,m))return!1}else if(y(l,T))return!1}E.delete(T)}for(const T of E)if(y(l,T))return!1}return!0},c.SeenEntry=class{constructor(u,f){this.obj=u,this.ref=f}isSame(u,f){return this.obj===u&&this.ref===f}}},7916:(s,i,a)=>{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<a.length;++c){const u=a.charCodeAt(c);i.isSafe(u)?o+=a[c]:o+=i.escapeHtmlChar(u)}return o},i.escapeHtmlChar=function(a){return i.namedHtml.get(a)||(a>=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<d.length;++h)l.push(c(d[h],{symbols:m.symbols}));return l}const p=u.keys(d,m);for(let h=0;h<p.length;++h){const y=p[h];if(y==="__proto__"||!Object.prototype.propertyIsEnumerable.call(d,y))continue;const g=d[y];if(g&&typeof g=="object"){if(l[y]===g)continue;!l[y]||typeof l[y]!="object"||Array.isArray(l[y])!==Array.isArray(g)||g instanceof Date||g instanceof RegExp?l[y]=c(g,{symbols:m.symbols}):f.merge(l[y],g,m)}else(g!=null||m.nullOverride)&&(l[y]=g)}return l}},9621:(s,i,a)=>{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<m.length;++h){let y=m[h];const g=l.iterables&&c.iterables(p);if(Array.isArray(p)||g==="set"){const v=Number(y);Number.isInteger(v)&&(y=v<0?p.length+v:v)}if(!p||typeof p=="function"&&l.functions===!1||!g&&p[y]===void 0){o(!l.strict||h+1===m.length,"Missing segment",y,"in reach path ",f),o(typeof p=="object"||l.functions===!0||typeof p!="function","Invalid segment",y,"in reach path ",f),p=l.default;break}p=g?g==="set"?[...p][y]:p.get(y):p[y]}return p},c.iterables=function(u){return u instanceof Set?"set":u instanceof Map?"map":void 0}},8761:s=>{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;l<this._items.length;++l)this._items[l].seq=l;const f=this._sort();return o(f,"merge created a dependencies error"),this.nodes}sort(){const u=this._sort();return o(u,"sort created a dependencies error"),this.nodes}_sort(){const u={},f=Object.create(null),l=Object.create(null);for(const y of this._items){const g=y.seq,v=y.group;l[v]=l[v]||[],l[v].push(g),u[g]=y.before;for(const w of y.after)f[w]=f[w]||[],f[w].push(g)}for(const y in u){const g=[];for(const v in u[y]){const w=u[y][v];l[w]=l[w]||[],g.push(...l[w])}u[y]=g}for(const y in f)if(l[y])for(const g of l[y])u[g].push(...f[y]);const d={};for(const y in u){const g=u[y];for(const v of g)d[v]=d[v]||[],d[v].push(y)}const m={},p=[];for(let y=0;y<this._items.length;++y){let g=y;if(d[y]){g=null;for(let v=0;v<this._items.length;++v){if(m[v]===!0)continue;d[v]||(d[v]=[]);const w=d[v].length;let x=0;for(let A=0;A<w;++A)m[d[v][A]]&&++x;if(x===w){g=v;break}}}g!==null&&(m[g]=!0,p.push(g))}if(p.length!==this._items.length)return!1;const h={};for(const y of this._items)h[y.seq]=y;this._items=[],this.nodes=[];for(const y of p){const g=h[y];this.nodes.push(g.node),this._items.push(g)}return!0}},c.mergeSort=(u,f)=>u.sort===f.sort?0:u.sort<f.sort?-1:1},5380:(s,i,a)=>{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.length<d)return c.code("DOMAIN_SEGMENTS_COUNT");if(l.maxDomainSegments&&m.length>l.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;h<m.length;++h){const y=m[h];if(!y.length)return c.code("DOMAIN_EMPTY_SEGMENT");if(y.length>63)return c.code("DOMAIN_LONG_SEGMENT");if(h<m.length-1){if(!u.domainSegmentRx.test(y))return c.code("DOMAIN_INVALID_CHARS")}else if(!u.tldSegmentRx.test(y))return c.code("DOMAIN_INVALID_TLDS_CHARS")}return null},i.isValid=function(f,l){return!i.analyze(f,l)},u.punycode=function(f){f.includes("%")&&(f=f.replace(/%/g,"%25"));try{return new u.URL(`http://${f}`).host}catch{return f}}},1745:(s,i,a)=>{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<l.length;++p)o(typeof l[p]=="string","options.version must only contain strings"),l[p]=l[p].toLowerCase(),o(["ipv4","ipv6","ipvfuture"].includes(l[p]),"options.version contains unknown version "+l[p]+" - must be one of ipv4, ipv6, ipvfuture");l=Array.from(new Set(l));const d=`(?:${l.map(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,k="::(?:"+w+":){5}"+x,R="(?:"+w+")?::(?:"+w+":){4}"+x,E="(?:(?:"+w+":){0,1}"+w+")?::(?:"+w+":){3}"+x,T="(?:(?:"+w+":){0,2}"+w+")?::(?:"+w+":){2}"+x,D="(?:(?:"+w+":){0,3}"+w+")?::"+w+":"+x,M="(?:(?:"+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+"|"+k+"|"+R+"|"+E+"|"+T+"|"+D+"|"+M+"|"+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+")",W="(?:"+F+"@)?"+Y+"(?::\\d*)?",H="(?:"+F+"@)?("+Y+")(?::\\d*)?",ee=g+"*",re=g+"+",X="(?:\\/"+ee+")*",G="\\/(?:"+re+X+")?",K=re+X,J="["+m+h+p+"@]+"+X,ue="(?:\\/\\/\\/"+ee+X+")";return f.hierPart="(?:(?:\\/\\/"+W+X+")|"+G+"|"+K+"|"+ue+")",f.hierPartCapture="(?:(?:\\/\\/"+H+X+")|"+G+"|"+K+")",f.relativeRef="(?:(?:\\/\\/"+W+X+")|"+G+"|"+J+"|)",f.relativeRefCapture="(?:(?:\\/\\/"+H+X+")|"+G+"|"+J+"|)",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<g.length;++w){const x=g[w];o(x instanceof RegExp||typeof x=="string","scheme at position "+w+" must be a RegExp or String"),x instanceof RegExp?v.push(x.source.toString()):(o(l.schemeRegex.test(x),"scheme at position "+w+" must be a valid scheme"),v.push(c(x)))}p=v.join("|")}const h="(?:"+(p?"(?:"+p+")":l.scheme)+":"+(f.domain?l.hierPartCapture:l.hierPart)+")",y=f.allowRelative?"(?:"+h+"|"+m+")":h;return u.wrap(y+d,p)},u.wrap=function(f,l){return{raw:f=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${f}`,regex:new RegExp(`^${f}$`),scheme:l}},u.uriRegex=u.createRegex({}),i.regex=function(f={}){return f.scheme||f.allowRelative||f.relativeOnly||f.allowQuerySquareBrackets||f.domain?u.createRegex(f):u.uriRegex}},1447:(s,i)=>{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;h<o.length;++h){const y=o[h];m?(l+=y,y===m&&(m=!1)):y in a.literals&&!d?(l+=y,m=a.literals[y]):y!==","||d?(l+=y,y==="("?++d:y===")"&&--d):p()}p()}return f=f.map(l=>new 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<c.length-1;)if(u.includes(c[f])){const l=c[f],d=a.evaluate(c[f-1],o),m=a.evaluate(c[f+1],o);c.splice(f,2);const p=a.calculate(l,d,m);c[f-1]=p===0?0:p}else f+=2}),a.evaluate(c[0],o)}},i.Parser.prototype[a.symbol]=!0,a.reference=function(o){return function(c){return c&&c[o]!==void 0?c[o]:null}},a.evaluate=function(o,c){return o===null?null:typeof o=="function"?o(c):o[a.symbol]?o.evaluate(c):o},a.single=function(o,c){if(o==="!")return!c;const u=-c;return u===0?0:u},a.calculate=function(o,c,u){if(o==="??")return a.exists(c)?c:u;if(typeof c=="string"||typeof u=="string"){if(o==="+")return(c=a.exists(c)?c:"")+(a.exists(u)?u:"")}else switch(o){case"^":return Math.pow(c,u);case"*":return c*u;case"/":return c/u;case"%":return c%u;case"+":return c+u;case"-":return c-u}switch(o){case"<":return c<u;case"<=":return c<=u;case">":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})})(CJ);var G2e=CJ.exports;const X4=Od(G2e),K2e=()=>{const t=_.useContext(FQ);if(t===void 0)throw new Error("useDataSource must be used within a DataSourceProvider");return t},Y2e=()=>{const t=K2e();return{useSubmitIncidence:e=>{const{mutateOptions:n={}}=e||{};return Nde({mutationFn:r=>t.createOne({resource:"support",data:r}),...n})}}},X2e=()=>X4.object({incidence:X4.string().min(10).required().messages({"string.empty":ft("support.modal.validation.empty"),"string.min":ft("support.modal.validation.min"),"string.max":ft("support.modal.validation.max"),"any.required":ft("support.modal.validation.required")})});function Q2e(){const[t,e]=_.useState(!1),[n,r]=_.useState(!1),{toast:s}=HX(),{useSubmitIncidence:i}=Y2e(),a=RPe({mode:"onBlur",resolver:q2e(X2e()),defaultValues:{incidence:""}}),{handleSubmit:o,watch:c,reset:u}=a,f=c("incidence"),{mutate:l}=i({mutateOptions:{onSuccess:()=>{s({title:ft("support.modal.notifications.sent_title"),description:ft("support.modal.notifications.sent_description"),variant:"success"}),e(!1),u()},onError:()=>{s({title:ft("support.modal.notifications.error_title"),description:ft("support.modal.notifications.error_description"),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(CEe,{open:t,onOpenChange:e,children:[P.jsx(AEe,{asChild:!0,children:P.jsxs(Ci,{variant:"outline",size:"icon",className:"overflow-hidden rounded-full bg-primary text-primary-foreground",onClick:()=>e(!0),children:[P.jsx(Pfe,{className:"w-5 h-5"}),P.jsx("span",{className:"sr-only",children:ft("support.modal.open")})]})}),P.jsxs(j8,{className:"sm:max-w-xl",children:[P.jsxs(z8,{className:"mb-2",children:[P.jsx(U8,{children:ft("support.modal.title")}),P.jsx(H8,{children:ft("support.modal.subtitle")})]}),P.jsx(kPe,{...a,children:P.jsxs("form",{onSubmit:o(d),className:"space-y-4",children:[P.jsx(B2e,{name:"incidence",placeholder:ft("support.modal.placeholder"),className:"min-h-96"}),P.jsxs(B8,{children:[P.jsx(Ci,{type:"button",variant:"outline",onClick:m,children:ft("common.cancel")}),P.jsx(Ci,{type:"submit",children:ft("support.modal.submit")})]})]})})]})]}),P.jsx(u6,{open:n,onOpenChange:r,children:P.jsxs(TL,{children:[P.jsxs(kL,{children:[P.jsx(NL,{children:ft("support.modal.cancel_confirmation.title")}),P.jsx(ML,{children:ft("support.modal.cancel_confirmation.description")})]}),P.jsxs(DL,{children:[P.jsx(LL,{onClick:()=>r(!1),children:ft("support.modal.cancel_confirmation.back")}),P.jsx(OL,{onClick:p,children:ft("support.modal.cancel_confirmation.confirm")})]})]})})]})}const Q4=({className:t,...e})=>P.jsx("svg",{viewBox:"0 0 336 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,...e,children:P.jsx("path",{d:"M49.7002 83.0001H66.9002V22.5001H49.7002V56.2001C49.7002 64.3001 45.5002 68.5001 39.0002 68.5001C32.5002 68.5001 28.6002 64.3001 28.6002 56.2001V22.5001H0.700195V33.2001H11.4002V61.6001C11.4002 75.5001 19.0002 84.1001 31.9002 84.1001C40.6002 84.1001 45.7002 79.5001 49.6002 74.4001V83.0001H49.7002ZM120.6 48.0001H94.8002C96.2002 40.2001 100.8 35.1001 107.9 35.1001C115.1 35.2001 119.6 40.3001 120.6 48.0001ZM137.1 58.7001C137.2 57.1001 137.3 56.1001 137.3 54.4001V54.2001C137.3 37.0001 128 21.4001 107.8 21.4001C90.2002 21.4001 77.9002 35.6001 77.9002 52.9001V53.1001C77.9002 71.6001 91.3002 84.4001 109.5 84.4001C120.4 84.4001 128.6 80.1001 134.2 73.1001L124.4 64.4001C119.7 68.8001 115.5 70.6001 109.7 70.6001C102 70.6001 96.6002 66.5001 94.9002 58.7001H137.1ZM162.2 52.9001V52.7001C162.2 43.8001 168.3 36.2001 176.9 36.2001C183 36.2001 186.8 38.8001 190.7 42.9001L201.2 31.6001C195.6 25.3001 188.4 21.4001 177 21.4001C158.5 21.4001 145.3 35.6001 145.3 52.9001V53.1001C145.3 70.4001 158.6 84.4001 176.8 84.4001C188.9 84.4001 195.6 79.8001 201.5 73.3001L191.5 63.1001C187.3 67.1001 183.4 69.5001 177.6 69.5001C168.2 69.6001 162.2 62.1001 162.2 52.9001ZM269.1 83.0001L245.3 46.3001L268.3 22.5001H247.8L227.7 44.5001V0.600098H210.5V83.0001H227.7V64.6001L233.7 58.3001L249.5 83.0001H269.1ZM318.5 53.1001C318.5 62.0001 312.6 69.6001 302.8 69.6001C293.3 69.6001 286.9 61.8001 286.9 52.9001V52.7001C286.9 43.8001 292.8 36.2001 302.6 36.2001C312.1 36.2001 318.5 44.0001 318.5 52.9001V53.1001ZM335.4 52.9001V52.7001C335.4 35.3001 321.5 21.4001 302.8 21.4001C284 21.4001 270 35.5001 270 52.9001V53.1001C270 70.5001 283.9 84.4001 302.6 84.4001C321.4 84.4001 335.4 70.3001 335.4 52.9001Z",fill:"black",className:t})}),J2e=()=>{const[t,e]=_.useState(!1),n=Fv(),{openDialog:r,DialogComponent:s}=NLe({title:ft("main_menu.logout_dialog.title"),description:ft("main_menu.logout_dialog.description"),confirmLabel:ft("main_menu.logout_dialog.confirm_label"),cancelLabel:ft("main_menu.logout_dialog.cancel_label"),onConfirm:()=>{n("/logout")}}),{data:i,status:a}=qW(),o=c=>{c.preventDefault(),e(!0)};return P.jsxs(P.Fragment,{children:[a==="success"&&P.jsxs("div",{className:"grid gap-1 text-right",children:[P.jsx("p",{className:"text-xs font-medium leading-none",children:i==null?void 0:i.name}),P.jsx("p",{className:"text-xs text-muted-foreground",children:i==null?void 0:i.email})]}),P.jsxs(ZRe,{open:t,onOpenChange:e,children:[P.jsx(ePe,{asChild:!0,children:P.jsxs(Ci,{variant:"outline",size:"icon",className:"overflow-hidden rounded-full",onClick:o,children:[P.jsx(Tfe,{className:"w-5 h-5 accent-current"}),P.jsx("span",{className:"sr-only",children:ft("main_menu.user.user_menu")})]})}),P.jsxs(mK,{align:"end",className:"w-56",children:[P.jsx(gK,{children:ft("main_menu.user.my_account")}),P.jsx(tN,{}),P.jsx(tPe,{children:P.jsxs(eN,{onSelect:()=>n("/settings"),children:[P.jsx($fe,{className:"w-4 h-4 mr-2"}),P.jsx("span",{children:ft("main_menu.user.settings")})]})}),P.jsx(tN,{}),P.jsxs(eN,{onSelect:()=>r(),children:[P.jsx(Nfe,{className:"w-4 h-4 mr-2"}),P.jsx("span",{children:ft("main_menu.user.logout")})]})]}),s]})]})},J4=[{label:"main_menu.quotes",to:"/quotes"},{label:"main_menu.catalog",to:"/catalog"},{label:"main_menu.settings",to:"/settings"}],Z2e=()=>{const t=Vd(),e=_.useCallback(n=>t.pathname===n,[t.pathname]);return P.jsxs("header",{className:"sticky top-0 z-20 flex items-center h-16 gap-6 px-4 border-b shadow bg-accent md:px-6",children:[P.jsxs("nav",{className:"flex-col hidden gap-6 text-lg font-medium md:flex md:flex-row md:items-center md:text-sm",children:[P.jsxs(bf,{to:"/",className:"flex items-center mr-6 font-semibold",children:[P.jsx(Q4,{className:"w-24"}),P.jsx("span",{className:"sr-only",children:"Uecko"})]}),J4.map(n=>P.jsx(bf,{to:n.to,className:ce("transition-colors text-muted-foreground hover:text-foreground",e(n.to)?"text-foreground font-bold":"text-muted-foreground font-semibold"),children:P.jsx(q4,{i18nKey:n.label})},n.to))]}),P.jsxs(iNe,{children:[P.jsx(oNe,{asChild:!0,children:P.jsxs(Ci,{variant:"outline",size:"icon",className:"shrink-0 md:hidden",children:[P.jsx(Mfe,{className:"w-5 h-5"}),P.jsx("span",{className:"sr-only",children:ft("main_menu.toggle_navigation")})]})}),P.jsx(jY,{side:"left",children:P.jsxs("nav",{className:"grid gap-6 text-lg font-medium",children:[P.jsxs(bf,{to:"/",className:"flex items-center gap-2 text-lg font-semibold",children:[P.jsx(Ofe,{className:"w-6 h-6"}),P.jsx("span",{className:"sr-only",children:"Uecko"})]}),J4.map(n=>P.jsx(bf,{to:n.to,className:ce("flex items-center gap-4 px-4 py-3 rounded-lg transition-colors","hover:bg-primary-light hover:text-primary text-muted-foreground"),children:P.jsx(q4,{i18nKey:n.label})},n.to))]})})]}),P.jsxs(bf,{to:"/",className:"flex items-center font-semibold shrink-0 md:hidden",children:[P.jsx(Q4,{className:"w-24"}),P.jsx("span",{className:"sr-only",children:"Uecko"})]}),P.jsxs("div",{className:"flex items-center justify-end w-full gap-4 md:ml-auto md:gap-2 lg:gap-4",children:[P.jsx(J2e,{}),P.jsx(Q2e,{})]})]})};Z2e.displayName="LayoutHeader";const eFe="_LoadingIndicator_1cqh6_4",tFe="_LoadingIndicator__title_1cqh6_9",nFe="_LoadingIndicator__subtitle_1cqh6_13",rFe="_LoadingIndicator__lighttext_1cqh6_17",sFe="_LoadingIndicator__darktext_1cqh6_21",cf={LoadingIndicator:eFe,LoadingIndicator__title:tFe,LoadingIndicator__subtitle:nFe,LoadingIndicator__lighttext:rFe,LoadingIndicator__darktext:sFe},iFe=({size:t=5,color:e="brand",className:n})=>P.jsxs("svg",{className:`animate-spin text-${e} w-${t} h-${t} ${n}`,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[P.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),P.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),AJ=({active:t=!0,look:e="dark",title:n=ft("components.loading_indicator.title"),subtitle:r=""})=>{const s=e==="dark",i=s?"text-brand":"text-white";if(t)return P.jsxs("div",{className:cf.LoadingIndicator,children:[P.jsx(iFe,{size:12,className:i}),n?P.jsx("h2",{className:ce(cf.LoadingIndicator__title,s?cf.LoadingIndicator__darktext:cf.LoadingIndicator__lighttext),children:n}):null,r?P.jsx("p",{className:ce(cf.LoadingIndicator__subtitle,s?cf.LoadingIndicator__darktext:cf.LoadingIndicator__lighttext),children:r}):null]})};AJ.displayName="LoadingIndicator";const Es=({title:t=ft("components.loading_overlay.title"),subtitle:e=ft("components.loading_overlay.subtitle"),...n})=>P.jsx("div",{className:"fixed top-0 bottom-0 left-0 right-0 z-50 w-full h-screen overflow-hidden flex justify-center bg-background/85",...n,children:P.jsx(AJ,{look:"dark",title:t,subtitle:e})});Es.displayName="LoadingOverlay";const oFe="w-6 h-6 rounded-full animate-spin",RJ=_.forwardRef((t,e)=>{const{className:n,...r}=t;return P.jsx(Dfe,{ref:e,className:ce(oFe,n),...r})});RJ.displayName="LoadingSpinner";function aFe(t,e,n){_.useEffect(()=>{if(!t||!("ResizeObserver"in window))return;const r=new ResizeObserver(n);return r.observe(t,e),()=>{r.disconnect()}},[t,e,n])}const lFe="modulepreload",cFe=function(t){return"/"+t},Z4={},Jr=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),o=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=cFe(c),c in Z4)return;Z4[c]=!0;const u=c.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${f}`))return;const l=document.createElement("link");if(l.rel=u?"stylesheet":lFe,u||(l.as="script"),l.crossOrigin="",l.href=c,o&&l.setAttribute("nonce",o),document.head.appendChild(l),u)return new Promise((d,m)=>{l.addEventListener("load",d),l.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return s.then(a=>{for(const o of a||[])o.status==="rejected"&&i(o.reason);return e().catch(i)})};var Sb={};Sb.d=(t,e)=>{for(var n in e)Sb.o(e,n)&&!Sb.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})};Sb.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var ht=globalThis.pdfjsLib={};Sb.d(ht,{AbortException:()=>wp,AnnotationEditorLayer:()=>GM,AnnotationEditorParamsType:()=>pt,AnnotationEditorType:()=>Vt,AnnotationEditorUIManager:()=>ip,AnnotationLayer:()=>a3e,AnnotationMode:()=>Ou,CMapCompressionType:()=>jN,ColorPicker:()=>G1,DOMSVGFactory:()=>V$,DrawLayer:()=>QM,FeatureTest:()=>wi,GlobalWorkerOptions:()=>Ic,ImageKind:()=>QS,InvalidPDFException:()=>TJ,MissingPDFException:()=>bp,OPS:()=>ta,Outliner:()=>PM,PDFDataRangeTransport:()=>EZ,PDFDateString:()=>IJ,PDFWorker:()=>Wm,PasswordResponses:()=>hFe,PermissionFlag:()=>fFe,PixelsPerInch:()=>Dd,RenderingCancelledException:()=>q$,TextLayer:()=>V1,UnexpectedResponseException:()=>YA,Util:()=>et,VerbosityLevel:()=>qA,XfaLayer:()=>AZ,build:()=>Bje,createValidAbsoluteUrl:()=>vFe,fetchData:()=>eR,getDocument:()=>Nje,getFilenameFromUrl:()=>RFe,getPdfFilenameFromUrl:()=>PFe,getXfaPageViewport:()=>TFe,isDataScheme:()=>G$,isPdfFile:()=>K$,noContextMenu:()=>Ri,normalizeUnicode:()=>SFe,renderTextLayer:()=>Sje,setLayerDimensions:()=>sp,shadow:()=>Gt,updateTextLayer:()=>Eje,version:()=>zje});const Ms=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),PJ=[1,0,0,1,0,0],FN=[.001,0,0,.001,0,0],uFe=1e7,lk=1.35,Ro={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},Ou={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},dFe="pdfjs_internal_editor_",Vt={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},pt={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35},fFe={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},xs={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},QS={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Nr={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,WIDGET:20},Ty={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},qA={ERRORS:0,WARNINGS:1,INFOS:5},jN={NONE:0,BINARY:1},ta={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91},hFe={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let GA=qA.WARNINGS;function pFe(t){Number.isInteger(t)&&(GA=t)}function mFe(){return GA}function KA(t){GA>=qA.INFOS&&console.log(`Info: ${t}`)}function kt(t){GA>=qA.WARNINGS&&console.log(`Warning: ${t}`)}function _n(t){throw new Error(t)}function Hr(t,e){t||_n(e)}function gFe(t){switch(t==null?void 0:t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function vFe(t,e=null,n=null){if(!t)return null;try{if(n&&typeof t=="string"){if(n.addDefaultProtocol&&t.startsWith("www.")){const s=t.match(/\./g);(s==null?void 0:s.length)>=2&&(t=`http://${t}`)}if(n.tryConvertEncoding)try{t=xFe(t)}catch{}}const r=e?new URL(t,e):new URL(t);if(gFe(r))return r}catch{}return null}function Gt(t,e,n,r=!1){return Object.defineProperty(t,e,{value:n,enumerable:!r,configurable:!0,writable:!1}),n}const qd=function(){function e(n,r){this.constructor===e&&_n("Cannot initialize BaseException."),this.message=n,this.name=r}return e.prototype=new Error,e.constructor=e,e}();class zN extends qd{constructor(e,n){super(e,"PasswordException"),this.code=n}}class BN extends qd{constructor(e,n){super(e,"UnknownErrorException"),this.details=n}}class TJ extends qd{constructor(e){super(e,"InvalidPDFException")}}class bp extends qd{constructor(e){super(e,"MissingPDFException")}}class YA extends qd{constructor(e,n){super(e,"UnexpectedResponseException"),this.status=n}}class yFe extends qd{constructor(e){super(e,"FormatError")}}class wp extends qd{constructor(e){super(e,"AbortException")}}function kJ(t){(typeof t!="object"||(t==null?void 0:t.length)===void 0)&&_n("Invalid argument for bytesToString");const e=t.length,n=8192;if(e<n)return String.fromCharCode.apply(null,t);const r=[];for(let s=0;s<e;s+=n){const i=Math.min(s+n,e),a=t.subarray(s,i);r.push(String.fromCharCode.apply(null,a))}return r.join("")}function XA(t){typeof t!="string"&&_n("Invalid argument for stringToBytes");const e=t.length,n=new Uint8Array(e);for(let r=0;r<e;++r)n[r]=t.charCodeAt(r)&255;return n}function bFe(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,t&255)}function H$(t){const e=Object.create(null);for(const[n,r]of t)e[n]=r;return e}function wFe(){const t=new Uint8Array(4);return t[0]=1,new Uint32Array(t.buffer,0,1)[0]===1}function _Fe(){try{return new Function(""),!0}catch{return!1}}class wi{static get isLittleEndian(){return Gt(this,"isLittleEndian",wFe())}static get isEvalSupported(){return Gt(this,"isEvalSupported",_Fe())}static get isOffscreenCanvasSupported(){return Gt(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator<"u"&&typeof(navigator==null?void 0:navigator.platform)=="string"?Gt(this,"platform",{isMac:navigator.platform.includes("Mac")}):Gt(this,"platform",{isMac:!1})}static get isCSSRoundSupported(){var e,n;return Gt(this,"isCSSRoundSupported",(n=(e=globalThis.CSS)==null?void 0:e.supports)==null?void 0:n.call(e,"width: round(1.5px, 1px)"))}}const ck=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0"));var jc,JS,UN;class et{static makeHexColor(e,n,r){return`#${ck[e]}${ck[n]}${ck[r]}`}static scaleMinMax(e,n){let r;e[0]?(e[0]<0&&(r=n[0],n[0]=n[2],n[2]=r),n[0]*=e[0],n[2]*=e[0],e[3]<0&&(r=n[1],n[1]=n[3],n[3]=r),n[1]*=e[3],n[3]*=e[3]):(r=n[0],n[0]=n[1],n[1]=r,r=n[2],n[2]=n[3],n[3]=r,e[1]<0&&(r=n[1],n[1]=n[3],n[3]=r),n[1]*=e[1],n[3]*=e[1],e[2]<0&&(r=n[0],n[0]=n[2],n[2]=r),n[0]*=e[2],n[2]*=e[2]),n[0]+=e[4],n[1]+=e[5],n[2]+=e[4],n[3]+=e[5]}static transform(e,n){return[e[0]*n[0]+e[2]*n[1],e[1]*n[0]+e[3]*n[1],e[0]*n[2]+e[2]*n[3],e[1]*n[2]+e[3]*n[3],e[0]*n[4]+e[2]*n[5]+e[4],e[1]*n[4]+e[3]*n[5]+e[5]]}static applyTransform(e,n){const r=e[0]*n[0]+e[1]*n[2]+n[4],s=e[0]*n[1]+e[1]*n[3]+n[5];return[r,s]}static applyInverseTransform(e,n){const r=n[0]*n[3]-n[1]*n[2],s=(e[0]*n[3]-e[1]*n[2]+n[2]*n[5]-n[4]*n[3])/r,i=(-e[0]*n[1]+e[1]*n[0]+n[4]*n[1]-n[5]*n[0])/r;return[s,i]}static getAxialAlignedBoundingBox(e,n){const r=this.applyTransform(e,n),s=this.applyTransform(e.slice(2,4),n),i=this.applyTransform([e[0],e[3]],n),a=this.applyTransform([e[2],e[1]],n);return[Math.min(r[0],s[0],i[0],a[0]),Math.min(r[1],s[1],i[1],a[1]),Math.max(r[0],s[0],i[0],a[0]),Math.max(r[1],s[1],i[1],a[1])]}static inverseTransform(e){const n=e[0]*e[3]-e[1]*e[2];return[e[3]/n,-e[1]/n,-e[2]/n,e[0]/n,(e[2]*e[5]-e[4]*e[3])/n,(e[4]*e[1]-e[5]*e[0])/n]}static singularValueDecompose2dScale(e){const n=[e[0],e[2],e[1],e[3]],r=e[0]*n[0]+e[1]*n[2],s=e[0]*n[1]+e[1]*n[3],i=e[2]*n[0]+e[3]*n[2],a=e[2]*n[1]+e[3]*n[3],o=(r+a)/2,c=Math.sqrt((r+a)**2-4*(r*a-i*s))/2,u=o+c||1,f=o-c||1;return[Math.sqrt(u),Math.sqrt(f)]}static normalizeRect(e){const n=e.slice(0);return e[0]>e[2]&&(n[0]=e[2],n[2]=e[0]),e[1]>e[3]&&(n[1]=e[3],n[3]=e[1]),n}static intersect(e,n){const r=Math.max(Math.min(e[0],e[2]),Math.min(n[0],n[2])),s=Math.min(Math.max(e[0],e[2]),Math.max(n[0],n[2]));if(r>s)return null;const i=Math.max(Math.min(e[1],e[3]),Math.min(n[1],n[3])),a=Math.min(Math.max(e[1],e[3]),Math.max(n[1],n[3]));return i>a?null:[r,i,s,a]}static bezierBoundingBox(e,n,r,s,i,a,o,c,u){return u?(u[0]=Math.min(u[0],e,o),u[1]=Math.min(u[1],n,c),u[2]=Math.max(u[2],e,o),u[3]=Math.max(u[3],n,c)):u=[Math.min(e,o),Math.min(n,c),Math.max(e,o),Math.max(n,c)],B(this,jc,UN).call(this,e,r,i,o,n,s,a,c,3*(-e+3*(r-i)+o),6*(e-2*r+i),3*(r-e),u),B(this,jc,UN).call(this,e,r,i,o,n,s,a,c,3*(-n+3*(s-a)+c),6*(n-2*s+a),3*(s-n),u),u}}jc=new WeakSet,JS=function(e,n,r,s,i,a,o,c,u,f){if(u<=0||u>=1)return;const l=1-u,d=u*u,m=d*u,p=l*(l*(l*e+3*u*n)+3*d*r)+m*s,h=l*(l*(l*i+3*u*a)+3*d*o)+m*c;f[0]=Math.min(f[0],p),f[1]=Math.min(f[1],h),f[2]=Math.max(f[2],p),f[3]=Math.max(f[3],h)},UN=function(e,n,r,s,i,a,o,c,u,f,l,d){if(Math.abs(u)<1e-12){Math.abs(f)>=1e-12&&B(this,jc,JS).call(this,e,n,r,s,i,a,o,c,-l/f,d);return}const m=f**2-4*l*u;if(m<0)return;const p=Math.sqrt(m),h=2*u;B(this,jc,JS).call(this,e,n,r,s,i,a,o,c,(-f+p)/h,d),B(this,jc,JS).call(this,e,n,r,s,i,a,o,c,(-f-p)/h,d)},z(et,jc);function xFe(t){return decodeURIComponent(escape(t))}let uk=null,eU=null;function SFe(t){return uk||(uk=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,eU=new Map([["ſt","ſt"]])),t.replaceAll(uk,(e,n,r)=>n?n.normalize("NFKC"):eU.get(r))}function EFe(){if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.randomUUID)=="function")return crypto.randomUUID();const t=new Uint8Array(32);if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.getRandomValues)=="function")crypto.getRandomValues(t);else for(let e=0;e<32;e++)t[e]=Math.floor(Math.random()*255);return kJ(t)}const DJ="pdfjs_internal_id_",ql={BEZIER_CURVE_TO:0,MOVE_TO:1,LINE_TO:2,QUADRATIC_CURVE_TO:3,RESTORE:4,SAVE:5,SCALE:6,TRANSFORM:7,TRANSLATE:8};class QA{constructor(){this.constructor===QA&&_n("Cannot initialize BaseFilterFactory.")}addFilter(e){return"none"}addHCMFilter(e,n){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,n,r,s,i){return"none"}destroy(e=!1){}}var vw;const i2=class i2{constructor({enableHWA:e=!1}={}){z(this,vw,!1);this.constructor===i2&&_n("Cannot initialize BaseCanvasFactory."),$(this,vw,e)}create(e,n){if(e<=0||n<=0)throw new Error("Invalid canvas size");const r=this._createCanvas(e,n);return{canvas:r,context:r.getContext("2d",{willReadFrequently:!C(this,vw)})}}reset(e,n,r){if(!e.canvas)throw new Error("Canvas is not specified");if(n<=0||r<=0)throw new Error("Invalid canvas size");e.canvas.width=n,e.canvas.height=r}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,n){_n("Abstract method `_createCanvas` called.")}};vw=new WeakMap;let B1=i2;class JA{constructor({baseUrl:e=null,isCompressed:n=!0}){this.constructor===JA&&_n("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=e,this.isCompressed=n}async fetch({name:e}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!e)throw new Error("CMap name must be specified.");const n=this.baseUrl+e+(this.isCompressed?".bcmap":""),r=this.isCompressed?jN.BINARY:jN.NONE;return this._fetchData(n,r).catch(s=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${n}`)})}_fetchData(e,n){_n("Abstract method `_fetchData` called.")}}class ZA{constructor({baseUrl:e=null}){this.constructor===ZA&&_n("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!e)throw new Error("Font filename must be specified.");const n=`${this.baseUrl}${e}`;return this._fetchData(n).catch(r=>{throw new Error(`Unable to load font data at: ${n}`)})}_fetchData(e){_n("Abstract method `_fetchData` called.")}}class W${constructor(){this.constructor===W$&&_n("Cannot initialize BaseSVGFactory.")}create(e,n,r=!1){if(e<=0||n<=0)throw new Error("Invalid SVG dimensions");const s=this._createSVG("svg:svg");return s.setAttribute("version","1.1"),r||(s.setAttribute("width",`${e}px`),s.setAttribute("height",`${n}px`)),s.setAttribute("preserveAspectRatio","none"),s.setAttribute("viewBox",`0 0 ${e} ${n}`),s}createElement(e){if(typeof e!="string")throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){_n("Abstract method `_createSVG` called.")}}const Yl="http://www.w3.org/2000/svg",wf=class wf{};He(wf,"CSS",96),He(wf,"PDF",72),He(wf,"PDF_TO_CSS_UNITS",wf.CSS/wf.PDF);let Dd=wf;var Ff,Xa,oc,di,Z1,jf,Ke,Ss,im,om,ZS,NJ,HN,am,Wy,Vy,WN,qy;class CFe extends QA{constructor({docId:n,ownerDocument:r=globalThis.document}={}){super();z(this,Ke);z(this,Ff);z(this,Xa);z(this,oc);z(this,di);z(this,Z1);z(this,jf,0);$(this,oc,n),$(this,di,r)}addFilter(n){if(!n)return"none";let r=C(this,Ke,Ss).get(n);if(r)return r;const[s,i,a]=B(this,Ke,ZS).call(this,n),o=n.length===1?s:`${s}${i}${a}`;if(r=C(this,Ke,Ss).get(o),r)return C(this,Ke,Ss).set(n,r),r;const c=`g_${C(this,oc)}_transfer_map_${bs(this,jf)._++}`,u=`url(#${c})`;C(this,Ke,Ss).set(n,u),C(this,Ke,Ss).set(o,u);const f=B(this,Ke,am).call(this,c);return B(this,Ke,Vy).call(this,s,i,a,f),u}addHCMFilter(n,r){var p;const s=`${n}-${r}`,i="base";let a=C(this,Ke,im).get(i);if((a==null?void 0:a.key)===s||(a?((p=a.filter)==null||p.remove(),a.key=s,a.url="none",a.filter=null):(a={key:s,url:"none",filter:null},C(this,Ke,im).set(i,a)),!n||!r))return a.url;const o=B(this,Ke,qy).call(this,n);n=et.makeHexColor(...o);const c=B(this,Ke,qy).call(this,r);if(r=et.makeHexColor(...c),C(this,Ke,om).style.color="",n==="#000000"&&r==="#ffffff"||n===r)return a.url;const u=new Array(256);for(let h=0;h<=255;h++){const y=h/255;u[h]=y<=.03928?y/12.92:((y+.055)/1.055)**2.4}const f=u.join(","),l=`g_${C(this,oc)}_hcm_filter`,d=a.filter=B(this,Ke,am).call(this,l);B(this,Ke,Vy).call(this,f,f,f,d),B(this,Ke,HN).call(this,d);const m=(h,y)=>{const g=o[h]/255,v=c[h]/255,w=new Array(y+1);for(let x=0;x<=y;x++)w[x]=g+x/y*(v-g);return w.join(",")};return B(this,Ke,Vy).call(this,m(0,5),m(1,5),m(2,5),d),a.url=`url(#${l})`,a.url}addAlphaFilter(n){let r=C(this,Ke,Ss).get(n);if(r)return r;const[s]=B(this,Ke,ZS).call(this,[n]),i=`alpha_${s}`;if(r=C(this,Ke,Ss).get(i),r)return C(this,Ke,Ss).set(n,r),r;const a=`g_${C(this,oc)}_alpha_map_${bs(this,jf)._++}`,o=`url(#${a})`;C(this,Ke,Ss).set(n,o),C(this,Ke,Ss).set(i,o);const c=B(this,Ke,am).call(this,a);return B(this,Ke,WN).call(this,s,c),o}addLuminosityFilter(n){let r=C(this,Ke,Ss).get(n||"luminosity");if(r)return r;let s,i;if(n?([s]=B(this,Ke,ZS).call(this,[n]),i=`luminosity_${s}`):i="luminosity",r=C(this,Ke,Ss).get(i),r)return C(this,Ke,Ss).set(n,r),r;const a=`g_${C(this,oc)}_luminosity_map_${bs(this,jf)._++}`,o=`url(#${a})`;C(this,Ke,Ss).set(n,o),C(this,Ke,Ss).set(i,o);const c=B(this,Ke,am).call(this,a);return B(this,Ke,NJ).call(this,c),n&&B(this,Ke,WN).call(this,s,c),o}addHighlightHCMFilter(n,r,s,i,a){var v;const o=`${r}-${s}-${i}-${a}`;let c=C(this,Ke,im).get(n);if((c==null?void 0:c.key)===o||(c?((v=c.filter)==null||v.remove(),c.key=o,c.url="none",c.filter=null):(c={key:o,url:"none",filter:null},C(this,Ke,im).set(n,c)),!r||!s))return c.url;const[u,f]=[r,s].map(B(this,Ke,qy).bind(this));let l=Math.round(.2126*u[0]+.7152*u[1]+.0722*u[2]),d=Math.round(.2126*f[0]+.7152*f[1]+.0722*f[2]),[m,p]=[i,a].map(B(this,Ke,qy).bind(this));d<l&&([l,d,m,p]=[d,l,p,m]),C(this,Ke,om).style.color="";const h=(w,x,A)=>{const k=new Array(256),R=(d-l)/A,E=w/255,T=(x-w)/(255*A);let D=0;for(let M=0;M<=A;M++){const L=Math.round(l+M*R),I=E+M*T;for(let F=D;F<=L;F++)k[F]=I;D=L+1}for(let M=D;M<256;M++)k[M]=k[D-1];return k.join(",")},y=`g_${C(this,oc)}_hcm_${n}_filter`,g=c.filter=B(this,Ke,am).call(this,y);return B(this,Ke,HN).call(this,g),B(this,Ke,Vy).call(this,h(m[0],p[0],5),h(m[1],p[1],5),h(m[2],p[2],5),g),c.url=`url(#${y})`,c.url}destroy(n=!1){n&&C(this,Ke,im).size!==0||(C(this,Xa)&&(C(this,Xa).parentNode.parentNode.remove(),$(this,Xa,null)),C(this,Ff)&&(C(this,Ff).clear(),$(this,Ff,null)),$(this,jf,0))}}Ff=new WeakMap,Xa=new WeakMap,oc=new WeakMap,di=new WeakMap,Z1=new WeakMap,jf=new WeakMap,Ke=new WeakSet,Ss=function(){return C(this,Ff)||$(this,Ff,new Map)},im=function(){return C(this,Z1)||$(this,Z1,new Map)},om=function(){if(!C(this,Xa)){const n=C(this,di).createElement("div"),{style:r}=n;r.visibility="hidden",r.contain="strict",r.width=r.height=0,r.position="absolute",r.top=r.left=0,r.zIndex=-1;const s=C(this,di).createElementNS(Yl,"svg");s.setAttribute("width",0),s.setAttribute("height",0),$(this,Xa,C(this,di).createElementNS(Yl,"defs")),n.append(s),s.append(C(this,Xa)),C(this,di).body.append(n)}return C(this,Xa)},ZS=function(n){if(n.length===1){const u=n[0],f=new Array(256);for(let d=0;d<256;d++)f[d]=u[d]/255;const l=f.join(",");return[l,l,l]}const[r,s,i]=n,a=new Array(256),o=new Array(256),c=new Array(256);for(let u=0;u<256;u++)a[u]=r[u]/255,o[u]=s[u]/255,c[u]=i[u]/255;return[a.join(","),o.join(","),c.join(",")]},NJ=function(n){const r=C(this,di).createElementNS(Yl,"feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),n.append(r)},HN=function(n){const r=C(this,di).createElementNS(Yl,"feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),n.append(r)},am=function(n){const r=C(this,di).createElementNS(Yl,"filter");return r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("id",n),C(this,Ke,om).append(r),r},Wy=function(n,r,s){const i=C(this,di).createElementNS(Yl,r);i.setAttribute("type","discrete"),i.setAttribute("tableValues",s),n.append(i)},Vy=function(n,r,s,i){const a=C(this,di).createElementNS(Yl,"feComponentTransfer");i.append(a),B(this,Ke,Wy).call(this,a,"feFuncR",n),B(this,Ke,Wy).call(this,a,"feFuncG",r),B(this,Ke,Wy).call(this,a,"feFuncB",s)},WN=function(n,r){const s=C(this,di).createElementNS(Yl,"feComponentTransfer");r.append(s),B(this,Ke,Wy).call(this,s,"feFuncA",n)},qy=function(n){return C(this,Ke,om).style.color=n,Y$(getComputedStyle(C(this,Ke,om)).getPropertyValue("color"))};class AFe extends B1{constructor({ownerDocument:e=globalThis.document,enableHWA:n=!1}={}){super({enableHWA:n}),this._document=e}_createCanvas(e,n){const r=this._document.createElement("canvas");return r.width=e,r.height=n,r}}async function eR(t,e="text"){if(Gy(t,document.baseURI)){const n=await fetch(t);if(!n.ok)throw new Error(n.statusText);switch(e){case"arraybuffer":return n.arrayBuffer();case"blob":return n.blob();case"json":return n.json()}return n.text()}return new Promise((n,r)=>{const s=new XMLHttpRequest;s.open("GET",t,!0),s.responseType=e,s.onreadystatechange=()=>{if(s.readyState===XMLHttpRequest.DONE){if(s.status===200||s.status===0){switch(e){case"arraybuffer":case"blob":case"json":n(s.response);return}n(s.responseText);return}r(new Error(s.statusText))}},s.send(null)})}class MJ extends JA{_fetchData(e,n){return eR(e,this.isCompressed?"arraybuffer":"text").then(r=>({cMapData:r instanceof ArrayBuffer?new Uint8Array(r):XA(r),compressionType:n}))}}class OJ extends ZA{_fetchData(e){return eR(e,"arraybuffer").then(n=>new Uint8Array(n))}}class V$ extends W${_createSVG(e){return document.createElementNS(Yl,e)}}class $_{constructor({viewBox:e,scale:n,rotation:r,offsetX:s=0,offsetY:i=0,dontFlip:a=!1}){this.viewBox=e,this.scale=n,this.rotation=r,this.offsetX=s,this.offsetY=i;const o=(e[2]+e[0])/2,c=(e[3]+e[1])/2;let u,f,l,d;switch(r%=360,r<0&&(r+=360),r){case 180:u=-1,f=0,l=0,d=1;break;case 90:u=0,f=1,l=1,d=0;break;case 270:u=0,f=-1,l=-1,d=0;break;case 0:u=1,f=0,l=0,d=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}a&&(l=-l,d=-d);let m,p,h,y;u===0?(m=Math.abs(c-e[1])*n+s,p=Math.abs(o-e[0])*n+i,h=(e[3]-e[1])*n,y=(e[2]-e[0])*n):(m=Math.abs(o-e[0])*n+s,p=Math.abs(c-e[1])*n+i,h=(e[2]-e[0])*n,y=(e[3]-e[1])*n),this.transform=[u*n,f*n,l*n,d*n,m-u*n*o-l*n*c,p-f*n*o-d*n*c],this.width=h,this.height=y}get rawDims(){const{viewBox:e}=this;return Gt(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:e=this.scale,rotation:n=this.rotation,offsetX:r=this.offsetX,offsetY:s=this.offsetY,dontFlip:i=!1}={}){return new $_({viewBox:this.viewBox.slice(),scale:e,rotation:n,offsetX:r,offsetY:s,dontFlip:i})}convertToViewportPoint(e,n){return et.applyTransform([e,n],this.transform)}convertToViewportRectangle(e){const n=et.applyTransform([e[0],e[1]],this.transform),r=et.applyTransform([e[2],e[3]],this.transform);return[n[0],n[1],r[0],r[1]]}convertToPdfPoint(e,n){return et.applyInverseTransform([e,n],this.transform)}}class q$ extends qd{constructor(e,n=0){super(e,"RenderingCancelledException"),this.extraDelay=n}}function G$(t){const e=t.length;let n=0;for(;n<e&&t[n].trim()==="";)n++;return t.substring(n,n+5).toLowerCase()==="data:"}function K$(t){return typeof t=="string"&&/\.pdf$/i.test(t)}function RFe(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)}function PFe(t,e="document.pdf"){if(typeof t!="string")return e;if(G$(t))return kt('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const n=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,r=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,s=n.exec(t);let i=r.exec(s[1])||r.exec(s[2])||r.exec(s[3]);if(i&&(i=i[0],i.includes("%")))try{i=r.exec(decodeURIComponent(i))[0]}catch{}return i||e}class tU{constructor(){He(this,"started",Object.create(null));He(this,"times",[])}time(e){e in this.started&&kt(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||kt(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let n=0;for(const{name:r}of this.times)n=Math.max(r.length,n);for(const{name:r,start:s,end:i}of this.times)e.push(`${r.padEnd(n)} ${i-s}ms
|
||
`);return e.join("")}}function Gy(t,e){try{const{protocol:n}=e?new URL(t,e):new URL(t);return n==="http:"||n==="https:"}catch{return!1}}function Ri(t){t.preventDefault()}function LJ(t){console.log("Deprecated API usage: "+t)}let nU;class IJ{static toDateObject(e){if(!e||typeof e!="string")return null;nU||(nU=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const n=nU.exec(e);if(!n)return null;const r=parseInt(n[1],10);let s=parseInt(n[2],10);s=s>=1&&s<=12?s-1:0;let i=parseInt(n[3],10);i=i>=1&&i<=31?i:1;let a=parseInt(n[4],10);a=a>=0&&a<=23?a:0;let o=parseInt(n[5],10);o=o>=0&&o<=59?o:0;let c=parseInt(n[6],10);c=c>=0&&c<=59?c:0;const u=n[7]||"Z";let f=parseInt(n[8],10);f=f>=0&&f<=23?f:0;let l=parseInt(n[9],10)||0;return l=l>=0&&l<=59?l:0,u==="-"?(a+=f,o+=l):u==="+"&&(a-=f,o-=l),new Date(Date.UTC(r,s,i,a,o,c))}}function TFe(t,{scale:e=1,rotation:n=0}){const{width:r,height:s}=t.attributes.style,i=[0,0,parseInt(r),parseInt(s)];return new $_({viewBox:i,scale:e,rotation:n})}function Y$(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(e&16711680)>>16,(e&65280)>>8,e&255]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map(e=>parseInt(e)):t.startsWith("rgba(")?t.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(kt(`Not a valid color format: "${t}"`),[0,0,0])}function kFe(t){const e=document.createElement("span");e.style.visibility="hidden",document.body.append(e);for(const n of t.keys()){e.style.color=n;const r=window.getComputedStyle(e).color;t.set(n,Y$(r))}e.remove()}function Jn(t){const{a:e,b:n,c:r,d:s,e:i,f:a}=t.getTransform();return[e,n,r,s,i,a]}function Gl(t){const{a:e,b:n,c:r,d:s,e:i,f:a}=t.getTransform().invertSelf();return[e,n,r,s,i,a]}function sp(t,e,n=!1,r=!0){if(e instanceof $_){const{pageWidth:s,pageHeight:i}=e.rawDims,{style:a}=t,o=wi.isCSSRoundSupported,c=`var(--scale-factor) * ${s}px`,u=`var(--scale-factor) * ${i}px`,f=o?`round(${c}, 1px)`:`calc(${c})`,l=o?`round(${u}, 1px)`:`calc(${u})`;!n||e.rotation%180===0?(a.width=f,a.height=l):(a.width=l,a.height=f)}r&&t.setAttribute("data-main-rotation",e.rotation)}var zf,Bf,Hi,Uf,eC,$J,Qs,FJ,jJ,eE,zJ,qN;const tC=class tC{constructor(e){z(this,Qs);z(this,zf,null);z(this,Bf,null);z(this,Hi);z(this,Uf,null);$(this,Hi,e)}render(){const e=$(this,zf,document.createElement("div"));e.className="editToolbar",e.setAttribute("role","toolbar");const n=C(this,Hi)._uiManager._signal;e.addEventListener("contextmenu",Ri,{signal:n}),e.addEventListener("pointerdown",B(tC,eC,$J),{signal:n});const r=$(this,Uf,document.createElement("div"));r.className="buttons",e.append(r);const s=C(this,Hi).toolbarPosition;if(s){const{style:i}=e,a=C(this,Hi)._uiManager.direction==="ltr"?1-s[0]:s[0];i.insetInlineEnd=`${100*a}%`,i.top=`calc(${100*s[1]}% + var(--editor-toolbar-vert-offset))`}return B(this,Qs,zJ).call(this),e}hide(){var e;C(this,zf).classList.add("hidden"),(e=C(this,Bf))==null||e.hideDropdown()}show(){C(this,zf).classList.remove("hidden")}addAltTextButton(e){B(this,Qs,eE).call(this,e),C(this,Uf).prepend(e,C(this,Qs,qN))}addColorPicker(e){$(this,Bf,e);const n=e.renderButton();B(this,Qs,eE).call(this,n),C(this,Uf).prepend(n,C(this,Qs,qN))}remove(){var e;C(this,zf).remove(),(e=C(this,Bf))==null||e.destroy(),$(this,Bf,null)}};zf=new WeakMap,Bf=new WeakMap,Hi=new WeakMap,Uf=new WeakMap,eC=new WeakSet,$J=function(e){e.stopPropagation()},Qs=new WeakSet,FJ=function(e){C(this,Hi)._focusEventsAllowed=!1,e.preventDefault(),e.stopPropagation()},jJ=function(e){C(this,Hi)._focusEventsAllowed=!0,e.preventDefault(),e.stopPropagation()},eE=function(e){const n=C(this,Hi)._uiManager._signal;e.addEventListener("focusin",B(this,Qs,FJ).bind(this),{capture:!0,signal:n}),e.addEventListener("focusout",B(this,Qs,jJ).bind(this),{capture:!0,signal:n}),e.addEventListener("contextmenu",Ri,{signal:n})},zJ=function(){const e=document.createElement("button");e.className="delete",e.tabIndex=0,e.setAttribute("data-l10n-id",`pdfjs-editor-remove-${C(this,Hi).editorType}-button`),B(this,Qs,eE).call(this,e),e.addEventListener("click",n=>{C(this,Hi)._uiManager.delete()},{signal:C(this,Hi)._uiManager._signal}),C(this,Uf).append(e)},qN=function(){const e=document.createElement("div");return e.className="divider",e},z(tC,eC);let VN=tC;var yw,Hf,Wf,Nd,BJ,UJ,HJ;class DFe{constructor(e){z(this,Nd);z(this,yw,null);z(this,Hf,null);z(this,Wf);$(this,Wf,e)}show(e,n,r){const[s,i]=B(this,Nd,UJ).call(this,n,r),{style:a}=C(this,Hf)||$(this,Hf,B(this,Nd,BJ).call(this));e.append(C(this,Hf)),a.insetInlineEnd=`${100*s}%`,a.top=`calc(${100*i}% + var(--editor-toolbar-vert-offset))`}hide(){C(this,Hf).remove()}}yw=new WeakMap,Hf=new WeakMap,Wf=new WeakMap,Nd=new WeakSet,BJ=function(){const e=$(this,Hf,document.createElement("div"));e.className="editToolbar",e.setAttribute("role","toolbar"),e.addEventListener("contextmenu",Ri,{signal:C(this,Wf)._signal});const n=$(this,yw,document.createElement("div"));return n.className="buttons",e.append(n),B(this,Nd,HJ).call(this),e},UJ=function(e,n){let r=0,s=0;for(const i of e){const a=i.y+i.height;if(a<r)continue;const o=i.x+(n?i.width:0);if(a>r){s=o,r=a;continue}n?o>s&&(s=o):o<s&&(s=o)}return[n?1-s:s,r]},HJ=function(){const e=document.createElement("button");e.className="highlightButton",e.tabIndex=0,e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const n=document.createElement("span");e.append(n),n.className="visuallyHidden",n.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const r=C(this,Wf)._signal;e.addEventListener("contextmenu",Ri,{signal:r}),e.addEventListener("click",()=>{C(this,Wf).highlightSelection("floating_button")},{signal:r}),C(this,yw).append(e)};function U1(t,e,n){for(const r of n)e.addEventListener(r,t[r].bind(t))}function NFe(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")}var nC;class MFe{constructor(){z(this,nC,0)}get id(){return`${dFe}${bs(this,nC)._++}`}}nC=new WeakMap;var bw,rC,xo,ww,KN;const o2=class o2{constructor(){z(this,ww);z(this,bw,EFe());z(this,rC,0);z(this,xo,null)}static get _isSVGFittingCanvas(){const e='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',r=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),s=new Image;s.src=e;const i=s.decode().then(()=>(r.drawImage(s,0,0,1,1,0,0,1,3),new Uint32Array(r.getImageData(0,0,1,1).data.buffer)[0]===0));return Gt(this,"_isSVGFittingCanvas",i)}async getFromFile(e){const{lastModified:n,name:r,size:s,type:i}=e;return B(this,ww,KN).call(this,`${n}_${r}_${s}_${i}`,e)}async getFromUrl(e){return B(this,ww,KN).call(this,e,e)}async getFromId(e){C(this,xo)||$(this,xo,new Map);const n=C(this,xo).get(e);return n?n.bitmap?(n.refCounter+=1,n):n.file?this.getFromFile(n.file):this.getFromUrl(n.url):null}getSvgUrl(e){const n=C(this,xo).get(e);return n!=null&&n.isSvg?n.svgUrl:null}deleteId(e){C(this,xo)||$(this,xo,new Map);const n=C(this,xo).get(e);n&&(n.refCounter-=1,n.refCounter===0&&(n.bitmap=null))}isValidId(e){return e.startsWith(`image_${C(this,bw)}_`)}};bw=new WeakMap,rC=new WeakMap,xo=new WeakMap,ww=new WeakSet,KN=async function(e,n){C(this,xo)||$(this,xo,new Map);let r=C(this,xo).get(e);if(r===null)return null;if(r!=null&&r.bitmap)return r.refCounter+=1,r;try{r||(r={bitmap:null,id:`image_${C(this,bw)}_${bs(this,rC)._++}`,refCounter:0,isSvg:!1});let s;if(typeof n=="string"?(r.url=n,s=await eR(n,"blob")):s=r.file=n,s.type==="image/svg+xml"){const i=o2._isSVGFittingCanvas,a=new FileReader,o=new Image,c=new Promise((u,f)=>{o.onload=()=>{r.bitmap=o,r.isSvg=!0,u()},a.onload=async()=>{const l=r.svgUrl=a.result;o.src=await i?`${l}#svgView(preserveAspectRatio(none))`:l},o.onerror=a.onerror=f});a.readAsDataURL(s),await c}else r.bitmap=await createImageBitmap(s);r.refCounter=1}catch(s){console.error(s),r=null}return C(this,xo).set(e,r),r&&C(this,xo).set(r.id,r),r};let GN=o2;var Kr,Wu,_w,Yr;class OFe{constructor(e=128){z(this,Kr,[]);z(this,Wu,!1);z(this,_w);z(this,Yr,-1);$(this,_w,e)}add({cmd:e,undo:n,post:r,mustExec:s,type:i=NaN,overwriteIfSameType:a=!1,keepUndo:o=!1}){if(s&&e(),C(this,Wu))return;const c={cmd:e,undo:n,post:r,type:i};if(C(this,Yr)===-1){C(this,Kr).length>0&&(C(this,Kr).length=0),$(this,Yr,0),C(this,Kr).push(c);return}if(a&&C(this,Kr)[C(this,Yr)].type===i){o&&(c.undo=C(this,Kr)[C(this,Yr)].undo),C(this,Kr)[C(this,Yr)]=c;return}const u=C(this,Yr)+1;u===C(this,_w)?C(this,Kr).splice(0,1):($(this,Yr,u),u<C(this,Kr).length&&C(this,Kr).splice(u)),C(this,Kr).push(c)}undo(){if(C(this,Yr)===-1)return;$(this,Wu,!0);const{undo:e,post:n}=C(this,Kr)[C(this,Yr)];e(),n==null||n(),$(this,Wu,!1),$(this,Yr,C(this,Yr)-1)}redo(){if(C(this,Yr)<C(this,Kr).length-1){$(this,Yr,C(this,Yr)+1),$(this,Wu,!0);const{cmd:e,post:n}=C(this,Kr)[C(this,Yr)];e(),n==null||n(),$(this,Wu,!1)}}hasSomethingToUndo(){return C(this,Yr)!==-1}hasSomethingToRedo(){return C(this,Yr)<C(this,Kr).length-1}destroy(){$(this,Kr,null)}}Kr=new WeakMap,Wu=new WeakMap,_w=new WeakMap,Yr=new WeakMap;var sC,WJ;class F_{constructor(e){z(this,sC);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:n}=wi.platform;for(const[r,s,i={}]of e)for(const a of r){const o=a.startsWith("mac+");n&&o?(this.callbacks.set(a.slice(4),{callback:s,options:i}),this.allKeys.add(a.split("+").at(-1))):!n&&!o&&(this.callbacks.set(a,{callback:s,options:i}),this.allKeys.add(a.split("+").at(-1)))}}exec(e,n){if(!this.allKeys.has(n.key))return;const r=this.callbacks.get(B(this,sC,WJ).call(this,n));if(!r)return;const{callback:s,options:{bubbles:i=!1,args:a=[],checker:o=null}}=r;o&&!o(e,n)||(s.bind(e,...a,n)(),i||(n.stopPropagation(),n.preventDefault()))}}sC=new WeakSet,WJ=function(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);const n=this.buffer.join("+");return this.buffer.length=0,n};const iC=class iC{get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return kFe(e),Gt(this,"_colors",e)}convert(e){const n=Y$(e);if(!window.matchMedia("(forced-colors: active)").matches)return n;for(const[r,s]of this._colors)if(s.every((i,a)=>i===n[a]))return iC._colorsMapping.get(r);return n}getHexCode(e){const n=this._colors.get(e);return n?et.makeHexColor(...n):e}};He(iC,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let YN=iC;var og,Wi,Mr,ss,ag,ac,lg,sa,cg,Vf,Qa,ia,qf,xw,Sw,Ja,ug,Vu,Za,oC,qu,Ew,Gf,Cw,dg,is,dn,lc,Kf,Aw,Rw,Pw,Tw,kw,Dw,Nw,Mw,Ow,Lw,Iw,$w,Fw,Gu,el,cc,jw,je,tE,VJ,qJ,nE,GJ,KJ,YJ,XN,XJ,QN,JN,QJ,zs,Su,JJ,ZJ,ZN,eZ,Ky,eM;const Am=class Am{constructor(e,n,r,s,i,a,o,c,u){z(this,je);z(this,og,new AbortController);z(this,Wi,null);z(this,Mr,new Map);z(this,ss,new Map);z(this,ag,null);z(this,ac,null);z(this,lg,null);z(this,sa,new OFe);z(this,cg,0);z(this,Vf,new Set);z(this,Qa,null);z(this,ia,null);z(this,qf,new Set);z(this,xw,!1);z(this,Sw,null);z(this,Ja,null);z(this,ug,null);z(this,Vu,!1);z(this,Za,null);z(this,oC,new MFe);z(this,qu,!1);z(this,Ew,!1);z(this,Gf,null);z(this,Cw,null);z(this,dg,null);z(this,is,Vt.NONE);z(this,dn,new Set);z(this,lc,null);z(this,Kf,null);z(this,Aw,null);z(this,Rw,this.blur.bind(this));z(this,Pw,this.focus.bind(this));z(this,Tw,this.copy.bind(this));z(this,kw,this.cut.bind(this));z(this,Dw,this.paste.bind(this));z(this,Nw,this.keydown.bind(this));z(this,Mw,this.keyup.bind(this));z(this,Ow,this.onEditingAction.bind(this));z(this,Lw,this.onPageChanging.bind(this));z(this,Iw,this.onScaleChanging.bind(this));z(this,$w,this.onRotationChanging.bind(this));z(this,Fw,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1});z(this,Gu,[0,0]);z(this,el,null);z(this,cc,null);z(this,jw,null);this._signal=C(this,og).signal,$(this,cc,e),$(this,jw,n),$(this,ag,r),this._eventBus=s,this._eventBus._on("editingaction",C(this,Ow)),this._eventBus._on("pagechanging",C(this,Lw)),this._eventBus._on("scalechanging",C(this,Iw)),this._eventBus._on("rotationchanging",C(this,$w)),B(this,je,GJ).call(this),B(this,je,QJ).call(this),B(this,je,XN).call(this),$(this,ac,i.annotationStorage),$(this,Sw,i.filterFactory),$(this,Kf,a),$(this,ug,o||null),$(this,xw,c),$(this,dg,u||null),this.viewParameters={realScale:Dd.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}static get _keyboardManager(){const e=Am.prototype,n=a=>C(a,cc).contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&a.hasSomethingToControl(),r=(a,{target:o})=>{if(o instanceof HTMLInputElement){const{type:c}=o;return c!=="text"&&c!=="number"}return!0},s=this.TRANSLATE_SMALL,i=this.TRANSLATE_BIG;return Gt(this,"_keyboardManager",new F_([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:r}],[["ctrl+z","mac+meta+z"],e.undo,{checker:r}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:r}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete,{checker:r}],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&C(a,cc).contains(o)&&!a.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&C(a,cc).contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-s,0],checker:n}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-i,0],checker:n}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[s,0],checker:n}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[i,0],checker:n}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-s],checker:n}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-i],checker:n}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,s],checker:n}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,i],checker:n}]]))}destroy(){var e,n,r;(e=C(this,og))==null||e.abort(),$(this,og,null),this._signal=null,this._eventBus._off("editingaction",C(this,Ow)),this._eventBus._off("pagechanging",C(this,Lw)),this._eventBus._off("scalechanging",C(this,Iw)),this._eventBus._off("rotationchanging",C(this,$w));for(const s of C(this,ss).values())s.destroy();C(this,ss).clear(),C(this,Mr).clear(),C(this,qf).clear(),$(this,Wi,null),C(this,dn).clear(),C(this,sa).destroy(),(n=C(this,ag))==null||n.destroy(),(r=C(this,Za))==null||r.hide(),$(this,Za,null),C(this,Ja)&&(clearTimeout(C(this,Ja)),$(this,Ja,null)),C(this,el)&&(clearTimeout(C(this,el)),$(this,el,null))}async mlGuess(e){var n;return((n=C(this,dg))==null?void 0:n.guess(e))||null}get hasMLManager(){return!!C(this,dg)}get hcmFilter(){return Gt(this,"hcmFilter",C(this,Kf)?C(this,Sw).addHCMFilter(C(this,Kf).foreground,C(this,Kf).background):"none")}get direction(){return Gt(this,"direction",getComputedStyle(C(this,cc)).direction)}get highlightColors(){return Gt(this,"highlightColors",C(this,ug)?new Map(C(this,ug).split(",").map(e=>e.split("=").map(n=>n.trim()))):null)}get highlightColorNames(){return Gt(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}setMainHighlightColorPicker(e){$(this,Cw,e)}editAltText(e){var n;(n=C(this,ag))==null||n.editAltText(this,e)}onPageChanging({pageNumber:e}){$(this,cg,e-1)}focusMainContainer(){C(this,cc).focus()}findParent(e,n){for(const r of C(this,ss).values()){const{x:s,y:i,width:a,height:o}=r.div.getBoundingClientRect();if(e>=s&&e<=s+a&&n>=i&&n<=i+o)return r}return null}disableUserSelect(e=!1){C(this,jw).classList.toggle("noUserSelect",e)}addShouldRescale(e){C(this,qf).add(e)}removeShouldRescale(e){C(this,qf).delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*Dd.PDF_TO_CSS_UNITS;for(const n of C(this,qf))n.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}highlightSelection(e=""){const n=document.getSelection();if(!n||n.isCollapsed)return;const{anchorNode:r,anchorOffset:s,focusNode:i,focusOffset:a}=n,o=n.toString(),u=B(this,je,tE).call(this,n).closest(".textLayer"),f=this.getSelectionBoxes(u);if(f){n.empty(),C(this,is)===Vt.NONE&&(this._eventBus.dispatch("showannotationeditorui",{source:this,mode:Vt.HIGHLIGHT}),this.showAllEditors("highlight",!0,!0));for(const l of C(this,ss).values())if(l.hasTextLayer(u)){l.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:f,anchorNode:r,anchorOffset:s,focusNode:i,focusOffset:a,text:o});break}}}addToAnnotationStorage(e){!e.isEmpty()&&C(this,ac)&&!C(this,ac).has(e.id)&&C(this,ac).setValue(e.id,e)}blur(){if(this.isShiftKeyDown=!1,C(this,Vu)&&($(this,Vu,!1),B(this,je,nE).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const n of C(this,dn))if(n.div.contains(e)){$(this,Gf,[n,e]),n._focusEventsAllowed=!1;break}}focus(){if(!C(this,Gf))return;const[e,n]=C(this,Gf);$(this,Gf,null),n.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),n.focus()}addEditListeners(){B(this,je,XN).call(this),B(this,je,QN).call(this)}removeEditListeners(){B(this,je,XJ).call(this),B(this,je,JN).call(this)}dragOver(e){for(const{type:n}of e.dataTransfer.items)for(const r of C(this,ia))if(r.isHandlingMimeForPasting(n)){e.dataTransfer.dropEffect="copy",e.preventDefault();return}}drop(e){for(const n of e.dataTransfer.items)for(const r of C(this,ia))if(r.isHandlingMimeForPasting(n.type)){r.paste(n,this.currentLayer),e.preventDefault();return}}copy(e){var r;if(e.preventDefault(),(r=C(this,Wi))==null||r.commitOrRemove(),!this.hasSelection)return;const n=[];for(const s of C(this,dn)){const i=s.serialize(!0);i&&n.push(i)}n.length!==0&&e.clipboardData.setData("application/pdfjs",JSON.stringify(n))}cut(e){this.copy(e),this.delete()}paste(e){e.preventDefault();const{clipboardData:n}=e;for(const i of n.items)for(const a of C(this,ia))if(a.isHandlingMimeForPasting(i.type)){a.paste(i,this.currentLayer);return}let r=n.getData("application/pdfjs");if(!r)return;try{r=JSON.parse(r)}catch(i){kt(`paste: "${i.message}".`);return}if(!Array.isArray(r))return;this.unselectAll();const s=this.currentLayer;try{const i=[];for(const c of r){const u=s.deserialize(c);if(!u)return;i.push(u)}const a=()=>{for(const c of i)B(this,je,ZN).call(this,c);B(this,je,eM).call(this,i)},o=()=>{for(const c of i)c.remove()};this.addCommands({cmd:a,undo:o,mustExec:!0})}catch(i){kt(`paste: "${i.message}".`)}}keydown(e){!this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!0),C(this,is)!==Vt.NONE&&!this.isEditorHandlingKeyboard&&Am._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!1,C(this,Vu)&&($(this,Vu,!1),B(this,je,nE).call(this,"main_toolbar")))}onEditingAction({name:e}){switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu");break}}setEditingState(e){e?(B(this,je,KJ).call(this),B(this,je,QN).call(this),B(this,je,zs).call(this,{isEditing:C(this,is)!==Vt.NONE,isEmpty:B(this,je,Ky).call(this),hasSomethingToUndo:C(this,sa).hasSomethingToUndo(),hasSomethingToRedo:C(this,sa).hasSomethingToRedo(),hasSelectedEditor:!1})):(B(this,je,YJ).call(this),B(this,je,JN).call(this),B(this,je,zs).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!C(this,ia)){$(this,ia,e);for(const n of C(this,ia))B(this,je,Su).call(this,n.defaultPropertiesToUpdate)}}getId(){return C(this,oC).id}get currentLayer(){return C(this,ss).get(C(this,cg))}getLayer(e){return C(this,ss).get(e)}get currentPageIndex(){return C(this,cg)}addLayer(e){C(this,ss).set(e.pageIndex,e),C(this,qu)?e.enable():e.disable()}removeLayer(e){C(this,ss).delete(e.pageIndex)}updateMode(e,n=null,r=!1){if(C(this,is)!==e){if($(this,is,e),e===Vt.NONE){this.setEditingState(!1),B(this,je,ZJ).call(this);return}this.setEditingState(!0),B(this,je,JJ).call(this),this.unselectAll();for(const s of C(this,ss).values())s.updateMode(e);if(!n&&r){this.addNewEditorFromKeyboard();return}if(n){for(const s of C(this,Mr).values())if(s.annotationElementId===n){this.setSelected(s),s.enterInEditMode();break}}}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e!==C(this,is)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,n){var r;if(C(this,ia)){switch(e){case pt.CREATE:this.currentLayer.addNewEditor();return;case pt.HIGHLIGHT_DEFAULT_COLOR:(r=C(this,Cw))==null||r.updateColor(n);break;case pt.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(C(this,Aw)||$(this,Aw,new Map)).set(e,n),this.showAllEditors("highlight",n);break}for(const s of C(this,dn))s.updateParams(e,n);for(const s of C(this,ia))s.updateDefaultParams(e,n)}}showAllEditors(e,n,r=!1){var i;for(const a of C(this,Mr).values())a.editorType===e&&a.show(n);(((i=C(this,Aw))==null?void 0:i.get(pt.HIGHLIGHT_SHOW_ALL))??!0)!==n&&B(this,je,Su).call(this,[[pt.HIGHLIGHT_SHOW_ALL,n]])}enableWaiting(e=!1){if(C(this,Ew)!==e){$(this,Ew,e);for(const n of C(this,ss).values())e?n.disableClick():n.enableClick(),n.div.classList.toggle("waiting",e)}}getEditors(e){const n=[];for(const r of C(this,Mr).values())r.pageIndex===e&&n.push(r);return n}getEditor(e){return C(this,Mr).get(e)}addEditor(e){C(this,Mr).set(e.id,e)}removeEditor(e){var n;e.div.contains(document.activeElement)&&(C(this,Ja)&&clearTimeout(C(this,Ja)),$(this,Ja,setTimeout(()=>{this.focusMainContainer(),$(this,Ja,null)},0))),C(this,Mr).delete(e.id),this.unselect(e),(!e.annotationElementId||!C(this,Vf).has(e.annotationElementId))&&((n=C(this,ac))==null||n.remove(e.id))}addDeletedAnnotationElement(e){C(this,Vf).add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return C(this,Vf).has(e)}removeDeletedAnnotationElement(e){C(this,Vf).delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}setActiveEditor(e){C(this,Wi)!==e&&($(this,Wi,e),e&&B(this,je,Su).call(this,e.propertiesToUpdate))}updateUI(e){C(this,je,eZ)===e&&B(this,je,Su).call(this,e.propertiesToUpdate)}toggleSelected(e){if(C(this,dn).has(e)){C(this,dn).delete(e),e.unselect(),B(this,je,zs).call(this,{hasSelectedEditor:this.hasSelection});return}C(this,dn).add(e),e.select(),B(this,je,Su).call(this,e.propertiesToUpdate),B(this,je,zs).call(this,{hasSelectedEditor:!0})}setSelected(e){for(const n of C(this,dn))n!==e&&n.unselect();C(this,dn).clear(),C(this,dn).add(e),e.select(),B(this,je,Su).call(this,e.propertiesToUpdate),B(this,je,zs).call(this,{hasSelectedEditor:!0})}isSelected(e){return C(this,dn).has(e)}get firstSelectedEditor(){return C(this,dn).values().next().value}unselect(e){e.unselect(),C(this,dn).delete(e),B(this,je,zs).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return C(this,dn).size!==0}get isEnterHandled(){return C(this,dn).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){C(this,sa).undo(),B(this,je,zs).call(this,{hasSomethingToUndo:C(this,sa).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:B(this,je,Ky).call(this)})}redo(){C(this,sa).redo(),B(this,je,zs).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:C(this,sa).hasSomethingToRedo(),isEmpty:B(this,je,Ky).call(this)})}addCommands(e){C(this,sa).add(e),B(this,je,zs).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:B(this,je,Ky).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const e=[...C(this,dn)],n=()=>{for(const s of e)s.remove()},r=()=>{for(const s of e)B(this,je,ZN).call(this,s)};this.addCommands({cmd:n,undo:r,mustExec:!0})}commitOrRemove(){var e;(e=C(this,Wi))==null||e.commitOrRemove()}hasSomethingToControl(){return C(this,Wi)||this.hasSelection}selectAll(){for(const e of C(this,dn))e.commit();B(this,je,eM).call(this,C(this,Mr).values())}unselectAll(){if(!(C(this,Wi)&&(C(this,Wi).commitOrRemove(),C(this,is)!==Vt.NONE))&&this.hasSelection){for(const e of C(this,dn))e.unselect();C(this,dn).clear(),B(this,je,zs).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(e,n,r=!1){if(r||this.commitOrRemove(),!this.hasSelection)return;C(this,Gu)[0]+=e,C(this,Gu)[1]+=n;const[s,i]=C(this,Gu),a=[...C(this,dn)],o=1e3;C(this,el)&&clearTimeout(C(this,el)),$(this,el,setTimeout(()=>{$(this,el,null),C(this,Gu)[0]=C(this,Gu)[1]=0,this.addCommands({cmd:()=>{for(const c of a)C(this,Mr).has(c.id)&&c.translateInPage(s,i)},undo:()=>{for(const c of a)C(this,Mr).has(c.id)&&c.translateInPage(-s,-i)},mustExec:!1})},o));for(const c of a)c.translateInPage(e,n)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),$(this,Qa,new Map);for(const e of C(this,dn))C(this,Qa).set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!C(this,Qa))return!1;this.disableUserSelect(!1);const e=C(this,Qa);$(this,Qa,null);let n=!1;for(const[{x:s,y:i,pageIndex:a},o]of e)o.newX=s,o.newY=i,o.newPageIndex=a,n||(n=s!==o.savedX||i!==o.savedY||a!==o.savedPageIndex);if(!n)return!1;const r=(s,i,a,o)=>{if(C(this,Mr).has(s.id)){const c=C(this,ss).get(o);c?s._setParentAndPosition(c,i,a):(s.pageIndex=o,s.x=i,s.y=a)}};return this.addCommands({cmd:()=>{for(const[s,{newX:i,newY:a,newPageIndex:o}]of e)r(s,i,a,o)},undo:()=>{for(const[s,{savedX:i,savedY:a,savedPageIndex:o}]of e)r(s,i,a,o)},mustExec:!0}),!0}dragSelectedEditors(e,n){if(C(this,Qa))for(const r of C(this,Qa).keys())r.drag(e,n)}rebuild(e){if(e.parent===null){const n=this.getLayer(e.pageIndex);n?(n.changeParent(e),n.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){var e;return((e=this.getActive())==null?void 0:e.shouldGetKeyboardEvents())||C(this,dn).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return C(this,Wi)===e}getActive(){return C(this,Wi)}getMode(){return C(this,is)}get imageManager(){return Gt(this,"imageManager",new GN)}getSelectionBoxes(e){if(!e)return null;const n=document.getSelection();for(let u=0,f=n.rangeCount;u<f;u++)if(!e.contains(n.getRangeAt(u).commonAncestorContainer))return null;const{x:r,y:s,width:i,height:a}=e.getBoundingClientRect();let o;switch(e.getAttribute("data-main-rotation")){case"90":o=(u,f,l,d)=>({x:(f-s)/a,y:1-(u+l-r)/i,width:d/a,height:l/i});break;case"180":o=(u,f,l,d)=>({x:1-(u+l-r)/i,y:1-(f+d-s)/a,width:l/i,height:d/a});break;case"270":o=(u,f,l,d)=>({x:1-(f+d-s)/a,y:(u-r)/i,width:d/a,height:l/i});break;default:o=(u,f,l,d)=>({x:(u-r)/i,y:(f-s)/a,width:l/i,height:d/a});break}const c=[];for(let u=0,f=n.rangeCount;u<f;u++){const l=n.getRangeAt(u);if(!l.collapsed)for(const{x:d,y:m,width:p,height:h}of l.getClientRects())p===0||h===0||c.push(o(d,m,p,h))}return c.length===0?null:c}addChangedExistingAnnotation({annotationElementId:e,id:n}){(C(this,lg)||$(this,lg,new Map)).set(e,n)}removeChangedExistingAnnotation({annotationElementId:e}){var n;(n=C(this,lg))==null||n.delete(e)}renderAnnotationElement(e){var s;const n=(s=C(this,lg))==null?void 0:s.get(e.data.id);if(!n)return;const r=C(this,ac).getRawValue(n);r&&(C(this,is)===Vt.NONE&&!r.hasBeenModified||r.renderAnnotationElement(e))}};og=new WeakMap,Wi=new WeakMap,Mr=new WeakMap,ss=new WeakMap,ag=new WeakMap,ac=new WeakMap,lg=new WeakMap,sa=new WeakMap,cg=new WeakMap,Vf=new WeakMap,Qa=new WeakMap,ia=new WeakMap,qf=new WeakMap,xw=new WeakMap,Sw=new WeakMap,Ja=new WeakMap,ug=new WeakMap,Vu=new WeakMap,Za=new WeakMap,oC=new WeakMap,qu=new WeakMap,Ew=new WeakMap,Gf=new WeakMap,Cw=new WeakMap,dg=new WeakMap,is=new WeakMap,dn=new WeakMap,lc=new WeakMap,Kf=new WeakMap,Aw=new WeakMap,Rw=new WeakMap,Pw=new WeakMap,Tw=new WeakMap,kw=new WeakMap,Dw=new WeakMap,Nw=new WeakMap,Mw=new WeakMap,Ow=new WeakMap,Lw=new WeakMap,Iw=new WeakMap,$w=new WeakMap,Fw=new WeakMap,Gu=new WeakMap,el=new WeakMap,cc=new WeakMap,jw=new WeakMap,je=new WeakSet,tE=function({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e},VJ=function(){const e=document.getSelection();if(!e||e.isCollapsed)return;const r=B(this,je,tE).call(this,e).closest(".textLayer"),s=this.getSelectionBoxes(r);s&&(C(this,Za)||$(this,Za,new DFe(this)),C(this,Za).show(r,s,this.direction==="ltr"))},qJ=function(){var i,a,o;const e=document.getSelection();if(!e||e.isCollapsed){C(this,lc)&&((i=C(this,Za))==null||i.hide(),$(this,lc,null),B(this,je,zs).call(this,{hasSelectedText:!1}));return}const{anchorNode:n}=e;if(n===C(this,lc))return;if(!B(this,je,tE).call(this,e).closest(".textLayer")){C(this,lc)&&((a=C(this,Za))==null||a.hide(),$(this,lc,null),B(this,je,zs).call(this,{hasSelectedText:!1}));return}if((o=C(this,Za))==null||o.hide(),$(this,lc,n),B(this,je,zs).call(this,{hasSelectedText:!0}),!(C(this,is)!==Vt.HIGHLIGHT&&C(this,is)!==Vt.NONE)&&(C(this,is)===Vt.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),$(this,Vu,this.isShiftKeyDown),!this.isShiftKeyDown)){const c=this._signal,u=f=>{f.type==="pointerup"&&f.button!==0||(window.removeEventListener("pointerup",u),window.removeEventListener("blur",u),f.type==="pointerup"&&B(this,je,nE).call(this,"main_toolbar"))};window.addEventListener("pointerup",u,{signal:c}),window.addEventListener("blur",u,{signal:c})}},nE=function(e=""){C(this,is)===Vt.HIGHLIGHT?this.highlightSelection(e):C(this,xw)&&B(this,je,VJ).call(this)},GJ=function(){document.addEventListener("selectionchange",B(this,je,qJ).bind(this),{signal:this._signal})},KJ=function(){const e=this._signal;window.addEventListener("focus",C(this,Pw),{signal:e}),window.addEventListener("blur",C(this,Rw),{signal:e})},YJ=function(){window.removeEventListener("focus",C(this,Pw)),window.removeEventListener("blur",C(this,Rw))},XN=function(){const e=this._signal;window.addEventListener("keydown",C(this,Nw),{signal:e}),window.addEventListener("keyup",C(this,Mw),{signal:e})},XJ=function(){window.removeEventListener("keydown",C(this,Nw)),window.removeEventListener("keyup",C(this,Mw))},QN=function(){const e=this._signal;document.addEventListener("copy",C(this,Tw),{signal:e}),document.addEventListener("cut",C(this,kw),{signal:e}),document.addEventListener("paste",C(this,Dw),{signal:e})},JN=function(){document.removeEventListener("copy",C(this,Tw)),document.removeEventListener("cut",C(this,kw)),document.removeEventListener("paste",C(this,Dw))},QJ=function(){const e=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:e}),document.addEventListener("drop",this.drop.bind(this),{signal:e})},zs=function(e){Object.entries(e).some(([r,s])=>C(this,Fw)[r]!==s)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(C(this,Fw),e)}),C(this,is)===Vt.HIGHLIGHT&&e.hasSelectedEditor===!1&&B(this,je,Su).call(this,[[pt.HIGHLIGHT_FREE,!0]]))},Su=function(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})},JJ=function(){if(!C(this,qu)){$(this,qu,!0);for(const e of C(this,ss).values())e.enable();for(const e of C(this,Mr).values())e.enable()}},ZJ=function(){if(this.unselectAll(),C(this,qu)){$(this,qu,!1);for(const e of C(this,ss).values())e.disable();for(const e of C(this,Mr).values())e.disable()}},ZN=function(e){const n=C(this,ss).get(e.pageIndex);n?n.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))},eZ=function(){let e=null;for(e of C(this,dn));return e},Ky=function(){if(C(this,Mr).size===0)return!0;if(C(this,Mr).size===1)for(const e of C(this,Mr).values())return e.isEmpty();return!1},eM=function(e){for(const n of C(this,dn))n.unselect();C(this,dn).clear();for(const n of e)n.isEmpty()||(C(this,dn).add(n),n.select());B(this,je,zs).call(this,{hasSelectedEditor:this.hasSelection})},He(Am,"TRANSLATE_SMALL",1),He(Am,"TRANSLATE_BIG",10);let ip=Am;var uc,dc,oa,fc,Vi,fg,aa,zw,tM;const Jl=class Jl{constructor(e){z(this,zw);z(this,uc,"");z(this,dc,!1);z(this,oa,null);z(this,fc,null);z(this,Vi,null);z(this,fg,!1);z(this,aa,null);$(this,aa,e)}static initialize(e){Jl._l10nPromise||(Jl._l10nPromise=e)}async render(){const e=$(this,oa,document.createElement("button"));e.className="altText";const n=await Jl._l10nPromise.get("pdfjs-editor-alt-text-button-label");e.textContent=n,e.setAttribute("aria-label",n),e.tabIndex="0";const r=C(this,aa)._uiManager._signal;e.addEventListener("contextmenu",Ri,{signal:r}),e.addEventListener("pointerdown",i=>i.stopPropagation(),{signal:r});const s=i=>{i.preventDefault(),C(this,aa)._uiManager.editAltText(C(this,aa))};return e.addEventListener("click",s,{capture:!0,signal:r}),e.addEventListener("keydown",i=>{i.target===e&&i.key==="Enter"&&($(this,fg,!0),s(i))},{signal:r}),await B(this,zw,tM).call(this),e}finish(){C(this,oa)&&(C(this,oa).focus({focusVisible:C(this,fg)}),$(this,fg,!1))}isEmpty(){return!C(this,uc)&&!C(this,dc)}get data(){return{altText:C(this,uc),decorative:C(this,dc)}}set data({altText:e,decorative:n}){C(this,uc)===e&&C(this,dc)===n||($(this,uc,e),$(this,dc,n),B(this,zw,tM).call(this))}toggle(e=!1){C(this,oa)&&(!e&&C(this,Vi)&&(clearTimeout(C(this,Vi)),$(this,Vi,null)),C(this,oa).disabled=!e)}destroy(){var e;(e=C(this,oa))==null||e.remove(),$(this,oa,null),$(this,fc,null)}};uc=new WeakMap,dc=new WeakMap,oa=new WeakMap,fc=new WeakMap,Vi=new WeakMap,fg=new WeakMap,aa=new WeakMap,zw=new WeakSet,tM=async function(){var s;const e=C(this,oa);if(!e)return;if(!C(this,uc)&&!C(this,dc)){e.classList.remove("done"),(s=C(this,fc))==null||s.remove();return}e.classList.add("done"),Jl._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then(i=>{e.setAttribute("aria-label",i)});let n=C(this,fc);if(!n){$(this,fc,n=document.createElement("span")),n.className="tooltip",n.setAttribute("role","tooltip");const i=n.id=`alt-text-tooltip-${C(this,aa).id}`;e.setAttribute("aria-describedby",i);const a=100,o=C(this,aa)._uiManager._signal;o.addEventListener("abort",()=>{clearTimeout(C(this,Vi)),$(this,Vi,null)},{once:!0}),e.addEventListener("mouseenter",()=>{$(this,Vi,setTimeout(()=>{$(this,Vi,null),C(this,fc).classList.add("show"),C(this,aa)._reportTelemetry({action:"alt_text_tooltip"})},a))},{signal:o}),e.addEventListener("mouseleave",()=>{var c;C(this,Vi)&&(clearTimeout(C(this,Vi)),$(this,Vi,null)),(c=C(this,fc))==null||c.classList.remove("show")},{signal:o})}n.innerText=C(this,dc)?await Jl._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):C(this,uc),n.parentNode||e.append(n);const r=C(this,aa).getImageForAltText();r==null||r.setAttribute("aria-describedby",n.id)},He(Jl,"_l10nPromise",null);let H1=Jl;var Yf,la,As,hg,Xf,os,Qf,pg,mg,Rs,Bw,Jf,Ku,Uw,Zf,hc,tl,gg,vg,So,Hw,aC,Mt,nM,Ww,rM,sM,tZ,nZ,iM,oM,aM,rZ,sZ,iZ,oZ,lM,Yy;const An=class An{constructor(e){z(this,Mt);z(this,Yf,null);z(this,la,null);z(this,As,null);z(this,hg,!1);z(this,Xf,!1);z(this,os,null);z(this,Qf,null);z(this,pg,this.focusin.bind(this));z(this,mg,this.focusout.bind(this));z(this,Rs,null);z(this,Bw,"");z(this,Jf,!1);z(this,Ku,null);z(this,Uw,!1);z(this,Zf,!1);z(this,hc,!1);z(this,tl,null);z(this,gg,0);z(this,vg,0);z(this,So,null);He(this,"_initialOptions",Object.create(null));He(this,"_isVisible",!0);He(this,"_uiManager",null);He(this,"_focusEventsAllowed",!0);He(this,"_l10nPromise",null);z(this,Hw,!1);z(this,aC,An._zIndex++);this.constructor===An&&_n("Cannot initialize AnnotationEditor."),this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null;const{rotation:n,rawDims:{pageWidth:r,pageHeight:s,pageX:i,pageY:a}}=this.parent.viewport;this.rotation=n,this.pageRotation=(360+n-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[r,s],this.pageTranslation=[i,a];const[o,c]=this.parentDimensions;this.x=e.x/o,this.y=e.y/c,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){const e=An.prototype._resizeWithKeyboard,n=ip.TRANSLATE_SMALL,r=ip.TRANSLATE_BIG;return Gt(this,"_resizerKeyboardManager",new F_([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-n,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-r,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[n,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[r,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-n]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-r]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,n]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,r]}],[["Escape","mac+Escape"],An.prototype._stopResizingWithKeyboard]]))}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return Gt(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const n=new LFe({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});n.annotationElementId=e.annotationElementId,n.deleted=!0,n._uiManager.addToAnnotationStorage(n)}static initialize(e,n,r){if(An._l10nPromise||(An._l10nPromise=new Map(["pdfjs-editor-alt-text-button-label","pdfjs-editor-alt-text-edit-button-label","pdfjs-editor-alt-text-decorative-tooltip","pdfjs-editor-resizer-label-topLeft","pdfjs-editor-resizer-label-topMiddle","pdfjs-editor-resizer-label-topRight","pdfjs-editor-resizer-label-middleRight","pdfjs-editor-resizer-label-bottomRight","pdfjs-editor-resizer-label-bottomMiddle","pdfjs-editor-resizer-label-bottomLeft","pdfjs-editor-resizer-label-middleLeft"].map(i=>[i,e.get(i.replaceAll(/([A-Z])/g,a=>`-${a.toLowerCase()}`))]))),r!=null&&r.strings)for(const i of r.strings)An._l10nPromise.set(i,e.get(i));if(An._borderLineWidth!==-1)return;const s=getComputedStyle(document.documentElement);An._borderLineWidth=parseFloat(s.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,n){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,n){_n("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return C(this,Hw)}set _isDraggable(e){var n;$(this,Hw,e),(n=this.div)==null||n.classList.toggle("draggable",e)}get isEnterHandled(){return!0}center(){const[e,n]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*n/(e*2),this.y+=this.width*e/(n*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*n/(e*2),this.y-=this.width*e/(n*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=C(this,aC)}setParent(e){e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):B(this,Mt,Yy).call(this),this.parent=e}focusin(e){this._focusEventsAllowed&&(C(this,Jf)?$(this,Jf,!1):this.parent.setSelected(this))}focusout(e){var r;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const n=e.relatedTarget;n!=null&&n.closest(`#${this.id}`)||(e.preventDefault(),(r=this.parent)!=null&&r.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,n,r,s){const[i,a]=this.parentDimensions;[r,s]=this.screenToPageTranslation(r,s),this.x=(e+r)/i,this.y=(n+s)/a,this.fixAndSetPosition()}translate(e,n){B(this,Mt,nM).call(this,this.parentDimensions,e,n)}translateInPage(e,n){C(this,Ku)||$(this,Ku,[this.x,this.y]),B(this,Mt,nM).call(this,this.pageDimensions,e,n),this.div.scrollIntoView({block:"nearest"})}drag(e,n){C(this,Ku)||$(this,Ku,[this.x,this.y]);const[r,s]=this.parentDimensions;if(this.x+=e/r,this.y+=n/s,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:u,y:f}=this.div.getBoundingClientRect();this.parent.findNewParent(this,u,f)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:i,y:a}=this;const[o,c]=this.getBaseTranslation();i+=o,a+=c,this.div.style.left=`${(100*i).toFixed(2)}%`,this.div.style.top=`${(100*a).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!C(this,Ku)&&(C(this,Ku)[0]!==this.x||C(this,Ku)[1]!==this.y)}getBaseTranslation(){const[e,n]=this.parentDimensions,{_borderLineWidth:r}=An,s=r/e,i=r/n;switch(this.rotation){case 90:return[-s,i];case 180:return[s,i];case 270:return[s,-i];default:return[-s,-i]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){const[n,r]=this.pageDimensions;let{x:s,y:i,width:a,height:o}=this;if(a*=n,o*=r,s*=n,i*=r,this._mustFixPosition)switch(e){case 0:s=Math.max(0,Math.min(n-a,s)),i=Math.max(0,Math.min(r-o,i));break;case 90:s=Math.max(0,Math.min(n-o,s)),i=Math.min(r,Math.max(a,i));break;case 180:s=Math.min(n,Math.max(a,s)),i=Math.min(r,Math.max(o,i));break;case 270:s=Math.min(n,Math.max(o,s)),i=Math.max(0,Math.min(r-a,i));break}this.x=s/=n,this.y=i/=r;const[c,u]=this.getBaseTranslation();s+=c,i+=u;const{style:f}=this.div;f.left=`${(100*s).toFixed(2)}%`,f.top=`${(100*i).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(e,n){var r;return B(r=An,Ww,rM).call(r,e,n,this.parentRotation)}pageTranslationToScreen(e,n){var r;return B(r=An,Ww,rM).call(r,e,n,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:e,pageDimensions:[n,r]}=this,s=n*e,i=r*e;return wi.isCSSRoundSupported?[Math.round(s),Math.round(i)]:[s,i]}setDims(e,n){const[r,s]=this.parentDimensions;this.div.style.width=`${(100*e/r).toFixed(2)}%`,C(this,Xf)||(this.div.style.height=`${(100*n/s).toFixed(2)}%`)}fixDims(){const{style:e}=this.div,{height:n,width:r}=e,s=r.endsWith("%"),i=!C(this,Xf)&&n.endsWith("%");if(s&&i)return;const[a,o]=this.parentDimensions;s||(e.width=`${(100*parseFloat(r)/a).toFixed(2)}%`),!C(this,Xf)&&!i&&(e.height=`${(100*parseFloat(n)/o).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}altTextFinish(){var e;(e=C(this,As))==null||e.finish()}async addEditToolbar(){return C(this,Rs)||C(this,Zf)?C(this,Rs):($(this,Rs,new VN(this)),this.div.append(C(this,Rs).render()),C(this,As)&&C(this,Rs).addAltTextButton(await C(this,As).render()),C(this,Rs))}removeEditToolbar(){var e;C(this,Rs)&&(C(this,Rs).remove(),$(this,Rs,null),(e=C(this,As))==null||e.destroy())}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){C(this,As)||(H1.initialize(An._l10nPromise),$(this,As,new H1(this)),C(this,Yf)&&(C(this,As).data=C(this,Yf),$(this,Yf,null)),await this.addEditToolbar())}get altTextData(){var e;return(e=C(this,As))==null?void 0:e.data}set altTextData(e){C(this,As)&&(C(this,As).data=e)}hasAltText(){var e;return!((e=C(this,As))!=null&&e.isEmpty())}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=C(this,hg)?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground();const e=this._uiManager._signal;this.div.addEventListener("focusin",C(this,pg),{signal:e}),this.div.addEventListener("focusout",C(this,mg),{signal:e});const[n,r]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*r/n).toFixed(2)}%`,this.div.style.maxHeight=`${(100*n/r).toFixed(2)}%`);const[s,i]=this.getInitialTranslation();return this.translate(s,i),U1(this,this.div,["pointerdown"]),this.div}pointerdown(e){const{isMac:n}=wi.platform;if(e.button!==0||e.ctrlKey&&n){e.preventDefault();return}if($(this,Jf,!0),this._isDraggable){B(this,Mt,rZ).call(this,e);return}B(this,Mt,aM).call(this,e)}moveInDOM(){C(this,tl)&&clearTimeout(C(this,tl)),$(this,tl,setTimeout(()=>{var e;$(this,tl,null),(e=this.parent)==null||e.moveEditorInDOM(this)},0))}_setParentAndPosition(e,n,r){e.changeParent(this),this.x=n,this.y=r,this.fixAndSetPosition()}getRect(e,n,r=this.rotation){const s=this.parentScale,[i,a]=this.pageDimensions,[o,c]=this.pageTranslation,u=e/s,f=n/s,l=this.x*i,d=this.y*a,m=this.width*i,p=this.height*a;switch(r){case 0:return[l+u+o,a-d-f-p+c,l+u+m+o,a-d-f+c];case 90:return[l+f+o,a-d+u+c,l+f+p+o,a-d+u+m+c];case 180:return[l-u-m+o,a-d+f+c,l-u+o,a-d+f+p+c];case 270:return[l-f-p+o,a-d-u-m+c,l-f+o,a-d-u+c];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,n){const[r,s,i,a]=e,o=i-r,c=a-s;switch(this.rotation){case 0:return[r,n-a,o,c];case 90:return[r,n-s,c,o];case 180:return[i,n-s,o,c];case 270:return[i,n-a,c,o];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){$(this,Zf,!0)}disableEditMode(){$(this,Zf,!1)}isInEditMode(){return C(this,Zf)}shouldGetKeyboardEvents(){return C(this,hc)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var n,r;const e=this._uiManager._signal;(n=this.div)==null||n.addEventListener("focusin",C(this,pg),{signal:e}),(r=this.div)==null||r.addEventListener("focusout",C(this,mg),{signal:e})}rotate(e){}serialize(e=!1,n=null){_n("An editor must be serializable")}static deserialize(e,n,r){const s=new this.prototype.constructor({parent:n,id:n.getNextId(),uiManager:r});s.rotation=e.rotation,$(s,Yf,e.accessibilityData);const[i,a]=s.pageDimensions,[o,c,u,f]=s.getRectInCurrentCoords(e.rect,a);return s.x=o/i,s.y=c/a,s.width=u/i,s.height=f/a,s}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.div.removeEventListener("focusin",C(this,pg)),this.div.removeEventListener("focusout",C(this,mg)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),C(this,tl)&&(clearTimeout(C(this,tl)),$(this,tl,null)),B(this,Mt,Yy).call(this),this.removeEditToolbar(),C(this,So)){for(const e of C(this,So).values())clearTimeout(e);$(this,So,null)}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(B(this,Mt,tZ).call(this),C(this,os).classList.remove("hidden"),U1(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(e){if(!this.isResizable||e.target!==this.div||e.key!=="Enter")return;this._uiManager.setSelected(this),$(this,Qf,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const n=C(this,os).children;if(!C(this,la)){$(this,la,Array.from(n));const a=B(this,Mt,sZ).bind(this),o=B(this,Mt,iZ).bind(this),c=this._uiManager._signal;for(const u of C(this,la)){const f=u.getAttribute("data-resizer-name");u.setAttribute("role","spinbutton"),u.addEventListener("keydown",a,{signal:c}),u.addEventListener("blur",o,{signal:c}),u.addEventListener("focus",B(this,Mt,oZ).bind(this,f),{signal:c}),An._l10nPromise.get(`pdfjs-editor-resizer-label-${f}`).then(l=>u.setAttribute("aria-label",l))}}const r=C(this,la)[0];let s=0;for(const a of n){if(a===r)break;s++}const i=(360-this.rotation+this.parentRotation)%360/90*(C(this,la).length/4);if(i!==s){if(i<s)for(let o=0;o<s-i;o++)C(this,os).append(C(this,os).firstChild);else if(i>s)for(let o=0;o<i-s;o++)C(this,os).firstChild.before(C(this,os).lastChild);let a=0;for(const o of n){const u=C(this,la)[a++].getAttribute("data-resizer-name");An._l10nPromise.get(`pdfjs-editor-resizer-label-${u}`).then(f=>o.setAttribute("aria-label",f))}}B(this,Mt,lM).call(this,0),$(this,hc,!0),C(this,os).firstChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}_resizeWithKeyboard(e,n){C(this,hc)&&B(this,Mt,oM).call(this,C(this,Bw),{movementX:e,movementY:n})}_stopResizingWithKeyboard(){B(this,Mt,Yy).call(this),this.div.focus()}select(){var e,n;if(this.makeResizable(),(e=this.div)==null||e.classList.add("selectedEditor"),!C(this,Rs)){this.addEditToolbar().then(()=>{var r,s;(r=this.div)!=null&&r.classList.contains("selectedEditor")&&((s=C(this,Rs))==null||s.show())});return}(n=C(this,Rs))==null||n.show()}unselect(){var e,n,r,s;(e=C(this,os))==null||e.classList.add("hidden"),(n=this.div)==null||n.classList.remove("selectedEditor"),(r=this.div)!=null&&r.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),(s=C(this,Rs))==null||s.hide()}updateParams(e,n){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return C(this,Uw)}set isEditing(e){$(this,Uw,e),this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(e,n){$(this,Xf,!0);const r=e/n,{style:s}=this.div;s.aspectRatio=r,s.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,n=!1){if(n){C(this,So)||$(this,So,new Map);const{action:r}=e;let s=C(this,So).get(r);s&&clearTimeout(s),s=setTimeout(()=>{this._reportTelemetry(e),C(this,So).delete(r),C(this,So).size===0&&$(this,So,null)},An._telemetryTimeout),C(this,So).set(r,s);return}e.type||(e.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(e=this._isVisible){this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),$(this,hg,!1)}disable(){this.div&&(this.div.tabIndex=-1),$(this,hg,!0)}renderAnnotationElement(e){let n=e.container.querySelector(".annotationContent");if(!n)n=document.createElement("div"),n.classList.add("annotationContent",this.editorType),e.container.prepend(n);else if(n.nodeName==="CANVAS"){const r=n;n=document.createElement("div"),n.classList.add("annotationContent",this.editorType),r.before(n)}return n}resetAnnotationElement(e){const{firstChild:n}=e.container;n.nodeName==="DIV"&&n.classList.contains("annotationContent")&&n.remove()}};Yf=new WeakMap,la=new WeakMap,As=new WeakMap,hg=new WeakMap,Xf=new WeakMap,os=new WeakMap,Qf=new WeakMap,pg=new WeakMap,mg=new WeakMap,Rs=new WeakMap,Bw=new WeakMap,Jf=new WeakMap,Ku=new WeakMap,Uw=new WeakMap,Zf=new WeakMap,hc=new WeakMap,tl=new WeakMap,gg=new WeakMap,vg=new WeakMap,So=new WeakMap,Hw=new WeakMap,aC=new WeakMap,Mt=new WeakSet,nM=function([e,n],r,s){[r,s]=this.screenToPageTranslation(r,s),this.x+=r/e,this.y+=s/n,this.fixAndSetPosition()},Ww=new WeakSet,rM=function(e,n,r){switch(r){case 90:return[n,-e];case 180:return[-e,-n];case 270:return[-n,e];default:return[e,n]}},sM=function(e){switch(e){case 90:{const[n,r]=this.pageDimensions;return[0,-n/r,r/n,0]}case 180:return[-1,0,0,-1];case 270:{const[n,r]=this.pageDimensions;return[0,n/r,-r/n,0]}default:return[1,0,0,1]}},tZ=function(){if(C(this,os))return;$(this,os,document.createElement("div")),C(this,os).classList.add("resizers");const e=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],n=this._uiManager._signal;for(const r of e){const s=document.createElement("div");C(this,os).append(s),s.classList.add("resizer",r),s.setAttribute("data-resizer-name",r),s.addEventListener("pointerdown",B(this,Mt,nZ).bind(this,r),{signal:n}),s.addEventListener("contextmenu",Ri,{signal:n}),s.tabIndex=-1}this.div.prepend(C(this,os))},nZ=function(e,n){var h;n.preventDefault();const{isMac:r}=wi.platform;if(n.button!==0||n.ctrlKey&&r)return;(h=C(this,As))==null||h.toggle(!1);const s=B(this,Mt,oM).bind(this,e),i=this._isDraggable;this._isDraggable=!1;const a=this._uiManager._signal,o={passive:!0,capture:!0,signal:a};this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",s,o),window.addEventListener("contextmenu",Ri,{signal:a});const c=this.x,u=this.y,f=this.width,l=this.height,d=this.parent.div.style.cursor,m=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(n.target).cursor;const p=()=>{var y;this.parent.togglePointerEvents(!0),(y=C(this,As))==null||y.toggle(!0),this._isDraggable=i,window.removeEventListener("pointerup",p),window.removeEventListener("blur",p),window.removeEventListener("pointermove",s,o),window.removeEventListener("contextmenu",Ri),this.parent.div.style.cursor=d,this.div.style.cursor=m,B(this,Mt,iM).call(this,c,u,f,l)};window.addEventListener("pointerup",p,{signal:a}),window.addEventListener("blur",p,{signal:a})},iM=function(e,n,r,s){const i=this.x,a=this.y,o=this.width,c=this.height;i===e&&a===n&&o===r&&c===s||this.addCommands({cmd:()=>{this.width=o,this.height=c,this.x=i,this.y=a;const[u,f]=this.parentDimensions;this.setDims(u*o,f*c),this.fixAndSetPosition()},undo:()=>{this.width=r,this.height=s,this.x=e,this.y=n;const[u,f]=this.parentDimensions;this.setDims(u*r,f*s),this.fixAndSetPosition()},mustExec:!0})},oM=function(e,n){const[r,s]=this.parentDimensions,i=this.x,a=this.y,o=this.width,c=this.height,u=An.MIN_SIZE/r,f=An.MIN_SIZE/s,l=W=>Math.round(W*1e4)/1e4,d=B(this,Mt,sM).call(this,this.rotation),m=(W,H)=>[d[0]*W+d[2]*H,d[1]*W+d[3]*H],p=B(this,Mt,sM).call(this,360-this.rotation),h=(W,H)=>[p[0]*W+p[2]*H,p[1]*W+p[3]*H];let y,g,v=!1,w=!1;switch(e){case"topLeft":v=!0,y=(W,H)=>[0,0],g=(W,H)=>[W,H];break;case"topMiddle":y=(W,H)=>[W/2,0],g=(W,H)=>[W/2,H];break;case"topRight":v=!0,y=(W,H)=>[W,0],g=(W,H)=>[0,H];break;case"middleRight":w=!0,y=(W,H)=>[W,H/2],g=(W,H)=>[0,H/2];break;case"bottomRight":v=!0,y=(W,H)=>[W,H],g=(W,H)=>[0,0];break;case"bottomMiddle":y=(W,H)=>[W/2,H],g=(W,H)=>[W/2,0];break;case"bottomLeft":v=!0,y=(W,H)=>[0,H],g=(W,H)=>[W,0];break;case"middleLeft":w=!0,y=(W,H)=>[0,H/2],g=(W,H)=>[W,H/2];break}const x=y(o,c),A=g(o,c);let k=m(...A);const R=l(i+k[0]),E=l(a+k[1]);let T=1,D=1,[M,L]=this.screenToPageTranslation(n.movementX,n.movementY);if([M,L]=h(M/r,L/s),v){const W=Math.hypot(o,c);T=D=Math.max(Math.min(Math.hypot(A[0]-x[0]-M,A[1]-x[1]-L)/W,1/o,1/c),u/o,f/c)}else w?T=Math.max(u,Math.min(1,Math.abs(A[0]-x[0]-M)))/o:D=Math.max(f,Math.min(1,Math.abs(A[1]-x[1]-L)))/c;const I=l(o*T),F=l(c*D);k=m(...g(I,F));const U=R-k[0],Y=E-k[1];this.width=I,this.height=F,this.x=U,this.y=Y,this.setDims(r*I,s*F),this.fixAndSetPosition()},aM=function(e){const{isMac:n}=wi.platform;e.ctrlKey&&!n||e.shiftKey||e.metaKey&&n?this.parent.toggleSelected(this):this.parent.setSelected(this)},rZ=function(e){const n=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let r,s;const i=this._uiManager._signal;n&&(this.div.classList.add("moving"),r={passive:!0,capture:!0,signal:i},$(this,gg,e.clientX),$(this,vg,e.clientY),s=o=>{const{clientX:c,clientY:u}=o,[f,l]=this.screenToPageTranslation(c-C(this,gg),u-C(this,vg));$(this,gg,c),$(this,vg,u),this._uiManager.dragSelectedEditors(f,l)},window.addEventListener("pointermove",s,r));const a=()=>{window.removeEventListener("pointerup",a),window.removeEventListener("blur",a),n&&(this.div.classList.remove("moving"),window.removeEventListener("pointermove",s,r)),$(this,Jf,!1),this._uiManager.endDragSession()||B(this,Mt,aM).call(this,e)};window.addEventListener("pointerup",a,{signal:i}),window.addEventListener("blur",a,{signal:i})},sZ=function(e){An._resizerKeyboardManager.exec(this,e)},iZ=function(e){var n;C(this,hc)&&((n=e.relatedTarget)==null?void 0:n.parentNode)!==C(this,os)&&B(this,Mt,Yy).call(this)},oZ=function(e){$(this,Bw,C(this,hc)?e:"")},lM=function(e){if(C(this,la))for(const n of C(this,la))n.tabIndex=e},Yy=function(){if($(this,hc,!1),B(this,Mt,lM).call(this,-1),C(this,Qf)){const{savedX:e,savedY:n,savedWidth:r,savedHeight:s}=C(this,Qf);B(this,Mt,iM).call(this,e,n,r,s),$(this,Qf,null)}},z(An,Ww),He(An,"_borderLineWidth",-1),He(An,"_colorManager",new YN),He(An,"_zIndex",1),He(An,"_telemetryTimeout",1e3);let pn=An;class LFe extends pn{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}const rU=3285377520,wo=4294901760,Ha=65535;class aZ{constructor(e){this.h1=e?e&4294967295:rU,this.h2=e?e&4294967295:rU}update(e){let n,r;if(typeof e=="string"){n=new Uint8Array(e.length*2),r=0;for(let h=0,y=e.length;h<y;h++){const g=e.charCodeAt(h);g<=255?n[r++]=g:(n[r++]=g>>>8,n[r++]=g&255)}}else if(ArrayBuffer.isView(e))n=e.slice(),r=n.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const s=r>>2,i=r-s*4,a=new Uint32Array(n.buffer,0,s);let o=0,c=0,u=this.h1,f=this.h2;const l=3432918353,d=461845907,m=l&Ha,p=d&Ha;for(let h=0;h<s;h++)h&1?(o=a[h],o=o*l&wo|o*m&Ha,o=o<<15|o>>>17,o=o*d&wo|o*p&Ha,u^=o,u=u<<13|u>>>19,u=u*5+3864292196):(c=a[h],c=c*l&wo|c*m&Ha,c=c<<15|c>>>17,c=c*d&wo|c*p&Ha,f^=c,f=f<<13|f>>>19,f=f*5+3864292196);switch(o=0,i){case 3:o^=n[s*4+2]<<16;case 2:o^=n[s*4+1]<<8;case 1:o^=n[s*4],o=o*l&wo|o*m&Ha,o=o<<15|o>>>17,o=o*d&wo|o*p&Ha,s&1?u^=o:f^=o}this.h1=u,this.h2=f}hexdigest(){let e=this.h1,n=this.h2;return e^=n>>>1,e=e*3981806797&wo|e*36045&Ha,n=n*4283543511&wo|((n<<16|e>>>16)*2950163797&wo)>>>16,e^=n>>>1,e=e*444984403&wo|e*60499&Ha,n=n*3301882366&wo|((n<<16|e>>>16)*3120437893&wo)>>>16,e^=n>>>1,(e>>>0).toString(16).padStart(8,"0")+(n>>>0).toString(16).padStart(8,"0")}}const cM=Object.freeze({map:null,hash:"",transfer:void 0});var eh,as,lC,lZ;class X${constructor(){z(this,lC);z(this,eh,!1);z(this,as,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,n){const r=C(this,as).get(e);return r===void 0?n:Object.assign(n,r)}getRawValue(e){return C(this,as).get(e)}remove(e){if(C(this,as).delete(e),C(this,as).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const n of C(this,as).values())if(n instanceof pn)return;this.onAnnotationEditor(null)}}setValue(e,n){const r=C(this,as).get(e);let s=!1;if(r!==void 0)for(const[i,a]of Object.entries(n))r[i]!==a&&(s=!0,r[i]=a);else s=!0,C(this,as).set(e,n);s&&B(this,lC,lZ).call(this),n instanceof pn&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(n.constructor._type)}has(e){return C(this,as).has(e)}getAll(){return C(this,as).size>0?H$(C(this,as)):null}setAll(e){for(const[n,r]of Object.entries(e))this.setValue(n,r)}get size(){return C(this,as).size}resetModified(){C(this,eh)&&($(this,eh,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new cZ(this)}get serializable(){if(C(this,as).size===0)return cM;const e=new Map,n=new aZ,r=[],s=Object.create(null);let i=!1;for(const[a,o]of C(this,as)){const c=o instanceof pn?o.serialize(!1,s):o;c&&(e.set(a,c),n.update(`${a}:${JSON.stringify(c)}`),i||(i=!!c.bitmap))}if(i)for(const a of e.values())a.bitmap&&r.push(a.bitmap);return e.size>0?{map:e,hash:n.hexdigest(),transfer:r}:cM}get editorStats(){let e=null;const n=new Map;for(const r of C(this,as).values()){if(!(r instanceof pn))continue;const s=r.telemetryFinalData;if(!s)continue;const{type:i}=s;n.has(i)||n.set(i,Object.getPrototypeOf(r).constructor),e||(e=Object.create(null));const a=e[i]||(e[i]=new Map);for(const[o,c]of Object.entries(s)){if(o==="type")continue;let u=a.get(o);u||(u=new Map,a.set(o,u));const f=u.get(c)??0;u.set(c,f+1)}}for(const[r,s]of n)e[r]=s.computeTelemetryFinalData(e[r]);return e}}eh=new WeakMap,as=new WeakMap,lC=new WeakSet,lZ=function(){C(this,eh)||($(this,eh,!0),typeof this.onSetModified=="function"&&this.onSetModified())};var Vw;class cZ extends X${constructor(n){super();z(this,Vw);const{map:r,hash:s,transfer:i}=n.serializable,a=structuredClone(r,i?{transfer:i}:null);$(this,Vw,{map:a,hash:s,transfer:i})}get print(){_n("Should not call PrintAnnotationStorage.print")}get serializable(){return C(this,Vw)}}Vw=new WeakMap;var yg;class IFe{constructor({ownerDocument:e=globalThis.document,styleElement:n=null}){z(this,yg,new Set);this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const n=this.styleElement.sheet;n.insertRule(e,n.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),C(this,yg).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,_inspectFont:n}){if(!(!e||C(this,yg).has(e.loadedName))){if(Hr(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:r,src:s,style:i}=e,a=new FontFace(r,s,i);this.addNativeFontFace(a);try{await a.load(),C(this,yg).add(r),n==null||n(e)}catch{kt(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}return}_n("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){const r=e.createNativeFontFace();if(r){this.addNativeFontFace(r);try{await r.loaded}catch(s){throw kt(`Failed to load font '${r.family}': '${s}'.`),e.disableFontFace=!0,s}}return}const n=e.createFontFaceRule();if(n){if(this.insertRule(n),this.isSyncFontLoadingSupported)return;await new Promise(r=>{const s=this._queueLoadingCallback(r);this._prepareFontLoadEvent(e,s)})}}get isFontLoadingAPISupported(){var n;const e=!!((n=this._document)!=null&&n.fonts);return Gt(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){let e=!1;return(Ms||typeof navigator<"u"&&typeof(navigator==null?void 0:navigator.userAgent)=="string"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),Gt(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){function n(){for(Hr(!s.done,"completeRequest() cannot be called twice."),s.done=!0;r.length>0&&r[0].done;){const i=r.shift();setTimeout(i.callback,0)}}const{loadingRequests:r}=this,s={done:!1,complete:n,callback:e};return r.push(s),s}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return Gt(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,n){function r(x,A){return x.charCodeAt(A)<<24|x.charCodeAt(A+1)<<16|x.charCodeAt(A+2)<<8|x.charCodeAt(A+3)&255}function s(x,A,k,R){const E=x.substring(0,A),T=x.substring(A+k);return E+R+T}let i,a;const o=this._document.createElement("canvas");o.width=1,o.height=1;const c=o.getContext("2d");let u=0;function f(x,A){if(++u>30){kt("Load test font never loaded."),A();return}if(c.font="30px "+x,c.fillText(".",0,20),c.getImageData(0,0,1,1).data[3]>0){A();return}setTimeout(f.bind(null,x,A))}const l=`lt${Date.now()}${this.loadTestFontId++}`;let d=this._loadTestFont;d=s(d,976,l.length,l);const p=16,h=1482184792;let y=r(d,p);for(i=0,a=l.length-3;i<a;i+=4)y=y-h+r(l,i)|0;i<l.length&&(y=y-h+r(l+"XXX",i)|0),d=s(d,p,4,bFe(y));const g=`url(data:font/opentype;base64,${btoa(d)});`,v=`@font-face {font-family:"${l}";src:${g}}`;this.insertRule(v);const w=this._document.createElement("div");w.style.visibility="hidden",w.style.width=w.style.height="10px",w.style.position="absolute",w.style.top=w.style.left="0px";for(const x of[e.loadedName,l]){const A=this._document.createElement("span");A.textContent="Hi",A.style.fontFamily=x,w.append(A)}this._document.body.append(w),f(l,()=>{w.remove(),n.complete()})}}yg=new WeakMap;class $Fe{constructor(e,{disableFontFace:n=!1,inspectFont:r=null}){this.compiledGlyphs=Object.create(null);for(const s in e)this[s]=e[s];this.disableFontFace=n===!0,this._inspectFont=r}createNativeFontFace(){var n;if(!this.data||this.disableFontFace)return null;let e;if(!this.cssFontInfo)e=new FontFace(this.loadedName,this.data,{});else{const r={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(r.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,r)}return(n=this._inspectFont)==null||n.call(this,this),e}createFontFaceRule(){var s;if(!this.data||this.disableFontFace)return null;const e=kJ(this.data),n=`url(data:${this.mimetype};base64,${btoa(e)});`;let r;if(!this.cssFontInfo)r=`@font-face {font-family:"${this.loadedName}";src:${n}}`;else{let i=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(i+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),r=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${i}src:${n}}`}return(s=this._inspectFont)==null||s.call(this,this,n),r}getPathGenerator(e,n){if(this.compiledGlyphs[n]!==void 0)return this.compiledGlyphs[n];let r;try{r=e.get(this.loadedName+"_path_"+n)}catch(i){kt(`getPathGenerator - ignoring character: "${i}".`)}if(!Array.isArray(r)||r.length===0)return this.compiledGlyphs[n]=function(i,a){};const s=[];for(let i=0,a=r.length;i<a;)switch(r[i++]){case ql.BEZIER_CURVE_TO:{const[o,c,u,f,l,d]=r.slice(i,i+6);s.push(m=>m.bezierCurveTo(o,c,u,f,l,d)),i+=6}break;case ql.MOVE_TO:{const[o,c]=r.slice(i,i+2);s.push(u=>u.moveTo(o,c)),i+=2}break;case ql.LINE_TO:{const[o,c]=r.slice(i,i+2);s.push(u=>u.lineTo(o,c)),i+=2}break;case ql.QUADRATIC_CURVE_TO:{const[o,c,u,f]=r.slice(i,i+4);s.push(l=>l.quadraticCurveTo(o,c,u,f)),i+=4}break;case ql.RESTORE:s.push(o=>o.restore());break;case ql.SAVE:s.push(o=>o.save());break;case ql.SCALE:Hr(s.length===2,"Scale command is only valid at the third position.");break;case ql.TRANSFORM:{const[o,c,u,f,l,d]=r.slice(i,i+6);s.push(m=>m.transform(o,c,u,f,l,d)),i+=6}break;case ql.TRANSLATE:{const[o,c]=r.slice(i,i+2);s.push(u=>u.translate(o,c)),i+=2}break}return this.compiledGlyphs[n]=function(a,o){s[0](a),s[1](a),a.scale(o,-o);for(let c=2,u=s.length;c<u;c++)s[c](a)}}}if(Ms){var uM=Promise.withResolvers(),Eb=null;(async()=>{const e=await Jr(()=>Promise.resolve().then(()=>ib),void 0),n=await Jr(()=>Promise.resolve().then(()=>ib),void 0),r=await Jr(()=>Promise.resolve().then(()=>ib),void 0),s=await Jr(()=>Promise.resolve().then(()=>ib),void 0);let i,a;return new Map(Object.entries({fs:e,http:n,https:r,url:s,canvas:i,path2d:a}))})().then(e=>{Eb=e,uM.resolve()},e=>{kt(`loadPackages: ${e}`),Eb=new Map,uM.resolve()})}class Al{static get promise(){return uM.promise}static get(e){return Eb==null?void 0:Eb.get(e)}}const uZ=function(t){return Al.get("fs").promises.readFile(t).then(n=>new Uint8Array(n))};class FFe extends QA{}class jFe extends B1{_createCanvas(e,n){return Al.get("canvas").createCanvas(e,n)}}class zFe extends JA{_fetchData(e,n){return uZ(e).then(r=>({cMapData:r,compressionType:n}))}}class BFe extends ZA{_fetchData(e){return uZ(e)}}const Ks={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function dM(t,e){if(!e)return;const n=e[2]-e[0],r=e[3]-e[1],s=new Path2D;s.rect(e[0],e[1],n,r),t.clip(s)}class j_{constructor(){this.constructor===j_&&_n("Cannot initialize BaseShadingPattern.")}getPattern(){_n("Abstract method `getPattern` called.")}}class UFe extends j_{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let n;this._type==="axial"?n=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(n=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const r of this._colorStops)n.addColorStop(r[0],r[1]);return n}getPattern(e,n,r,s){let i;if(s===Ks.STROKE||s===Ks.FILL){const a=n.current.getClippedPathBoundingBox(s,Jn(e))||[0,0,0,0],o=Math.ceil(a[2]-a[0])||1,c=Math.ceil(a[3]-a[1])||1,u=n.cachedCanvases.getCanvas("pattern",o,c,!0),f=u.context;f.clearRect(0,0,f.canvas.width,f.canvas.height),f.beginPath(),f.rect(0,0,f.canvas.width,f.canvas.height),f.translate(-a[0],-a[1]),r=et.transform(r,[1,0,0,1,a[0],a[1]]),f.transform(...n.baseTransform),this.matrix&&f.transform(...this.matrix),dM(f,this._bbox),f.fillStyle=this._createGradient(f),f.fill(),i=e.createPattern(u.canvas,"no-repeat");const l=new DOMMatrix(r);i.setTransform(l)}else dM(e,this._bbox),i=this._createGradient(e);return i}}function dk(t,e,n,r,s,i,a,o){const c=e.coords,u=e.colors,f=t.data,l=t.width*4;let d;c[n+1]>c[r+1]&&(d=n,n=r,r=d,d=i,i=a,a=d),c[r+1]>c[s+1]&&(d=r,r=s,s=d,d=a,a=o,o=d),c[n+1]>c[r+1]&&(d=n,n=r,r=d,d=i,i=a,a=d);const m=(c[n]+e.offsetX)*e.scaleX,p=(c[n+1]+e.offsetY)*e.scaleY,h=(c[r]+e.offsetX)*e.scaleX,y=(c[r+1]+e.offsetY)*e.scaleY,g=(c[s]+e.offsetX)*e.scaleX,v=(c[s+1]+e.offsetY)*e.scaleY;if(p>=v)return;const w=u[i],x=u[i+1],A=u[i+2],k=u[a],R=u[a+1],E=u[a+2],T=u[o],D=u[o+1],M=u[o+2],L=Math.round(p),I=Math.round(v);let F,U,Y,W,H,ee,re,X;for(let G=L;G<=I;G++){if(G<y){const ie=G<p?0:(p-G)/(p-y);F=m-(m-h)*ie,U=w-(w-k)*ie,Y=x-(x-R)*ie,W=A-(A-E)*ie}else{let ie;G>v?ie=1:y===v?ie=0:ie=(y-G)/(y-v),F=h-(h-g)*ie,U=k-(k-T)*ie,Y=R-(R-D)*ie,W=E-(E-M)*ie}let K;G<p?K=0:G>v?K=1:K=(p-G)/(p-v),H=m-(m-g)*K,ee=w-(w-T)*K,re=x-(x-D)*K,X=A-(A-M)*K;const J=Math.round(Math.min(F,H)),ue=Math.round(Math.max(F,H));let de=l*G+J*4;for(let ie=J;ie<=ue;ie++)K=(F-ie)/(F-H),K<0?K=0:K>1&&(K=1),f[de++]=U-(U-ee)*K|0,f[de++]=Y-(Y-re)*K|0,f[de++]=W-(W-X)*K|0,f[de++]=255}}function HFe(t,e,n){const r=e.coords,s=e.colors;let i,a;switch(e.type){case"lattice":const o=e.verticesPerRow,c=Math.floor(r.length/o)-1,u=o-1;for(i=0;i<c;i++){let f=i*o;for(let l=0;l<u;l++,f++)dk(t,n,r[f],r[f+1],r[f+o],s[f],s[f+1],s[f+o]),dk(t,n,r[f+o+1],r[f+1],r[f+o],s[f+o+1],s[f+1],s[f+o])}break;case"triangles":for(i=0,a=r.length;i<a;i+=3)dk(t,n,r[i],r[i+1],r[i+2],s[i],s[i+1],s[i+2]);break;default:throw new Error("illegal figure")}}class WFe extends j_{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[7],this._background=e[8],this.matrix=null}_createMeshCanvas(e,n,r){const o=Math.floor(this._bounds[0]),c=Math.floor(this._bounds[1]),u=Math.ceil(this._bounds[2])-o,f=Math.ceil(this._bounds[3])-c,l=Math.min(Math.ceil(Math.abs(u*e[0]*1.1)),3e3),d=Math.min(Math.ceil(Math.abs(f*e[1]*1.1)),3e3),m=u/l,p=f/d,h={coords:this._coords,colors:this._colors,offsetX:-o,offsetY:-c,scaleX:1/m,scaleY:1/p},y=l+2*2,g=d+2*2,v=r.getCanvas("mesh",y,g,!1),w=v.context,x=w.createImageData(l,d);if(n){const k=x.data;for(let R=0,E=k.length;R<E;R+=4)k[R]=n[0],k[R+1]=n[1],k[R+2]=n[2],k[R+3]=255}for(const k of this._figures)HFe(x,k,h);return w.putImageData(x,2,2),{canvas:v.canvas,offsetX:o-2*m,offsetY:c-2*p,scaleX:m,scaleY:p}}getPattern(e,n,r,s){dM(e,this._bbox);let i;if(s===Ks.SHADING)i=et.singularValueDecompose2dScale(Jn(e));else if(i=et.singularValueDecompose2dScale(n.baseTransform),this.matrix){const o=et.singularValueDecompose2dScale(this.matrix);i=[i[0]*o[0],i[1]*o[1]]}const a=this._createMeshCanvas(i,s===Ks.SHADING?null:this._background,n.cachedCanvases);return s!==Ks.SHADING&&(e.setTransform(...n.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(a.offsetX,a.offsetY),e.scale(a.scaleX,a.scaleY),e.createPattern(a.canvas,"no-repeat")}}class VFe extends j_{getPattern(){return"hotpink"}}function qFe(t){switch(t[0]){case"RadialAxial":return new UFe(t);case"Mesh":return new WFe(t);case"Dummy":return new VFe}throw new Error(`Unknown IR type: ${t[0]}`)}const sU={COLORED:1,UNCOLORED:2},cC=class cC{constructor(e,n,r,s,i){this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.color=n,this.ctx=r,this.canvasGraphicsFactory=s,this.baseTransform=i}createPatternCanvas(e){const n=this.operatorList,r=this.bbox,s=this.xstep,i=this.ystep,a=this.paintType,o=this.tilingType,c=this.color,u=this.canvasGraphicsFactory;KA("TilingType: "+o);const f=r[0],l=r[1],d=r[2],m=r[3],p=et.singularValueDecompose2dScale(this.matrix),h=et.singularValueDecompose2dScale(this.baseTransform),y=[p[0]*h[0],p[1]*h[1]],g=this.getSizeAndScale(s,this.ctx.canvas.width,y[0]),v=this.getSizeAndScale(i,this.ctx.canvas.height,y[1]),w=e.cachedCanvases.getCanvas("pattern",g.size,v.size,!0),x=w.context,A=u.createCanvasGraphics(x);A.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(A,a,c);let k=f,R=l,E=d,T=m;return f<0&&(k=0,E+=Math.abs(f)),l<0&&(R=0,T+=Math.abs(l)),x.translate(-(g.scale*k),-(v.scale*R)),A.transform(g.scale,0,0,v.scale,0,0),x.save(),this.clipBbox(A,k,R,E,T),A.baseTransform=Jn(A.ctx),A.executeOperatorList(n),A.endDrawing(),{canvas:w.canvas,scaleX:g.scale,scaleY:v.scale,offsetX:k,offsetY:R}}getSizeAndScale(e,n,r){e=Math.abs(e);const s=Math.max(cC.MAX_PATTERN_SIZE,n);let i=Math.ceil(e*r);return i>=s?i=s:r=i/e,{scale:r,size:i}}clipBbox(e,n,r,s,i){const a=s-n,o=i-r;e.ctx.rect(n,r,a,o),e.current.updateRectMinMax(Jn(e.ctx),[n,r,s,i]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,n,r){const s=e.ctx,i=e.current;switch(n){case sU.COLORED:const a=this.ctx;s.fillStyle=a.fillStyle,s.strokeStyle=a.strokeStyle,i.fillColor=a.fillStyle,i.strokeColor=a.strokeStyle;break;case sU.UNCOLORED:const o=et.makeHexColor(r[0],r[1],r[2]);s.fillStyle=o,s.strokeStyle=o,i.fillColor=o,i.strokeColor=o;break;default:throw new yFe(`Unsupported paint type: ${n}`)}}getPattern(e,n,r,s){let i=r;s!==Ks.SHADING&&(i=et.transform(i,n.baseTransform),this.matrix&&(i=et.transform(i,this.matrix)));const a=this.createPatternCanvas(n);let o=new DOMMatrix(i);o=o.translate(a.offsetX,a.offsetY),o=o.scale(1/a.scaleX,1/a.scaleY);const c=e.createPattern(a.canvas,"repeat");return c.setTransform(o),c}};He(cC,"MAX_PATTERN_SIZE",3e3);let fM=cC;function GFe({src:t,srcPos:e=0,dest:n,width:r,height:s,nonBlackColor:i=4294967295,inverseDecode:a=!1}){const o=wi.isLittleEndian?4278190080:255,[c,u]=a?[i,o]:[o,i],f=r>>3,l=r&7,d=t.length;n=new Uint32Array(n.buffer);let m=0;for(let p=0;p<s;p++){for(const y=e+f;e<y;e++){const g=e<d?t[e]:255;n[m++]=g&128?u:c,n[m++]=g&64?u:c,n[m++]=g&32?u:c,n[m++]=g&16?u:c,n[m++]=g&8?u:c,n[m++]=g&4?u:c,n[m++]=g&2?u:c,n[m++]=g&1?u:c}if(l===0)continue;const h=e<d?t[e++]:255;for(let y=0;y<l;y++)n[m++]=h&1<<7-y?u:c}return{srcPos:e,destPos:m}}const iU=16,oU=100,KFe=15,aU=10,lU=1e3,pi=16;function YFe(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){e.save(),this.__originalSave()},t.restore=function(){e.restore(),this.__originalRestore()},t.translate=function(r,s){e.translate(r,s),this.__originalTranslate(r,s)},t.scale=function(r,s){e.scale(r,s),this.__originalScale(r,s)},t.transform=function(r,s,i,a,o,c){e.transform(r,s,i,a,o,c),this.__originalTransform(r,s,i,a,o,c)},t.setTransform=function(r,s,i,a,o,c){e.setTransform(r,s,i,a,o,c),this.__originalSetTransform(r,s,i,a,o,c)},t.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function(r){e.rotate(r),this.__originalRotate(r)},t.clip=function(r){e.clip(r),this.__originalClip(r)},t.moveTo=function(n,r){e.moveTo(n,r),this.__originalMoveTo(n,r)},t.lineTo=function(n,r){e.lineTo(n,r),this.__originalLineTo(n,r)},t.bezierCurveTo=function(n,r,s,i,a,o){e.bezierCurveTo(n,r,s,i,a,o),this.__originalBezierCurveTo(n,r,s,i,a,o)},t.rect=function(n,r,s,i){e.rect(n,r,s,i),this.__originalRect(n,r,s,i)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}class XFe{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,n,r){let s;return this.cache[e]!==void 0?(s=this.cache[e],this.canvasFactory.reset(s,n,r)):(s=this.canvasFactory.create(n,r),this.cache[e]=s),s}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const n=this.cache[e];this.canvasFactory.destroy(n),delete this.cache[e]}}}function SS(t,e,n,r,s,i,a,o,c,u){const[f,l,d,m,p,h]=Jn(t);if(l===0&&d===0){const v=a*f+p,w=Math.round(v),x=o*m+h,A=Math.round(x),k=(a+c)*f+p,R=Math.abs(Math.round(k)-w)||1,E=(o+u)*m+h,T=Math.abs(Math.round(E)-A)||1;return t.setTransform(Math.sign(f),0,0,Math.sign(m),w,A),t.drawImage(e,n,r,s,i,0,0,R,T),t.setTransform(f,l,d,m,p,h),[R,T]}if(f===0&&m===0){const v=o*d+p,w=Math.round(v),x=a*l+h,A=Math.round(x),k=(o+u)*d+p,R=Math.abs(Math.round(k)-w)||1,E=(a+c)*l+h,T=Math.abs(Math.round(E)-A)||1;return t.setTransform(0,Math.sign(l),Math.sign(d),0,w,A),t.drawImage(e,n,r,s,i,0,0,T,R),t.setTransform(f,l,d,m,p,h),[T,R]}t.drawImage(e,n,r,s,i,a,o,c,u);const y=Math.hypot(f,l),g=Math.hypot(d,m);return[y*c,g*u]}function QFe(t){const{width:e,height:n}=t;if(e>lU||n>lU)return null;const r=1e3,s=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),i=e+1;let a=new Uint8Array(i*(n+1)),o,c,u;const f=e+7&-8;let l=new Uint8Array(f*n),d=0;for(const g of t.data){let v=128;for(;v>0;)l[d++]=g&v?0:255,v>>=1}let m=0;for(d=0,l[d]!==0&&(a[0]=1,++m),c=1;c<e;c++)l[d]!==l[d+1]&&(a[c]=l[d]?2:1,++m),d++;for(l[d]!==0&&(a[c]=2,++m),o=1;o<n;o++){d=o*f,u=o*i,l[d-f]!==l[d]&&(a[u]=l[d]?1:8,++m);let g=(l[d]?4:0)+(l[d-f]?8:0);for(c=1;c<e;c++)g=(g>>2)+(l[d+1]?4:0)+(l[d-f+1]?8:0),s[g]&&(a[u+c]=s[g],++m),d++;if(l[d-f]!==l[d]&&(a[u+c]=l[d]?2:4,++m),m>r)return null}for(d=f*(n-1),u=o*i,l[d]!==0&&(a[u]=8,++m),c=1;c<e;c++)l[d]!==l[d+1]&&(a[u+c]=l[d]?4:8,++m),d++;if(l[d]!==0&&(a[u+c]=4,++m),m>r)return null;const p=new Int32Array([0,i,-1,0,-i,0,0,0,1]),h=new Path2D;for(o=0;m&&o<=n;o++){let g=o*i;const v=g+e;for(;g<v&&!a[g];)g++;if(g===v)continue;h.moveTo(g%i,o);const w=g;let x=a[g];do{const A=p[x];do g+=A;while(!a[g]);const k=a[g];k!==5&&k!==10?(x=k,a[g]=0):(x=k&51*x>>4,a[g]&=x>>2|x<<2),h.lineTo(g%i,g/i|0),a[g]||--m}while(w!==g);--o}return l=null,a=null,function(g){g.save(),g.scale(1/e,-1/n),g.translate(0,-n),g.fill(h),g.beginPath(),g.restore()}}class cU{constructor(e,n){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=PJ,this.textMatrixScale=1,this.fontMatrix=FN,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=xs.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,e,n])}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e}setCurrentPoint(e,n){this.x=e,this.y=n}updatePathMinMax(e,n,r){[n,r]=et.applyTransform([n,r],e),this.minX=Math.min(this.minX,n),this.minY=Math.min(this.minY,r),this.maxX=Math.max(this.maxX,n),this.maxY=Math.max(this.maxY,r)}updateRectMinMax(e,n){const r=et.applyTransform(n,e),s=et.applyTransform(n.slice(2),e),i=et.applyTransform([n[0],n[3]],e),a=et.applyTransform([n[2],n[1]],e);this.minX=Math.min(this.minX,r[0],s[0],i[0],a[0]),this.minY=Math.min(this.minY,r[1],s[1],i[1],a[1]),this.maxX=Math.max(this.maxX,r[0],s[0],i[0],a[0]),this.maxY=Math.max(this.maxY,r[1],s[1],i[1],a[1])}updateScalingPathMinMax(e,n){et.scaleMinMax(e,n),this.minX=Math.min(this.minX,n[0]),this.minY=Math.min(this.minY,n[1]),this.maxX=Math.max(this.maxX,n[2]),this.maxY=Math.max(this.maxY,n[3])}updateCurvePathMinMax(e,n,r,s,i,a,o,c,u,f){const l=et.bezierBoundingBox(n,r,s,i,a,o,c,u,f);f||this.updateRectMinMax(e,l)}getPathBoundingBox(e=Ks.FILL,n=null){const r=[this.minX,this.minY,this.maxX,this.maxY];if(e===Ks.STROKE){n||_n("Stroke bounding box must include transform.");const s=et.singularValueDecompose2dScale(n),i=s[0]*this.lineWidth/2,a=s[1]*this.lineWidth/2;r[0]-=i,r[1]-=a,r[2]+=i,r[3]+=a}return r}updateClipFromPath(){const e=et.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(e){this.clipBox=e,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(e=Ks.FILL,n=null){return et.intersect(this.clipBox,this.getPathBoundingBox(e,n))}}function uU(t,e){if(typeof ImageData<"u"&&e instanceof ImageData){t.putImageData(e,0,0);return}const n=e.height,r=e.width,s=n%pi,i=(n-s)/pi,a=s===0?i:i+1,o=t.createImageData(r,pi);let c=0,u;const f=e.data,l=o.data;let d,m,p,h;if(e.kind===QS.GRAYSCALE_1BPP){const y=f.byteLength,g=new Uint32Array(l.buffer,0,l.byteLength>>2),v=g.length,w=r+7>>3,x=4294967295,A=wi.isLittleEndian?4278190080:255;for(d=0;d<a;d++){for(p=d<i?pi:s,u=0,m=0;m<p;m++){const k=y-c;let R=0;const E=k>w?r:k*8-7,T=E&-8;let D=0,M=0;for(;R<T;R+=8)M=f[c++],g[u++]=M&128?x:A,g[u++]=M&64?x:A,g[u++]=M&32?x:A,g[u++]=M&16?x:A,g[u++]=M&8?x:A,g[u++]=M&4?x:A,g[u++]=M&2?x:A,g[u++]=M&1?x:A;for(;R<E;R++)D===0&&(M=f[c++],D=128),g[u++]=M&D?x:A,D>>=1}for(;u<v;)g[u++]=0;t.putImageData(o,0,d*pi)}}else if(e.kind===QS.RGBA_32BPP){for(m=0,h=r*pi*4,d=0;d<i;d++)l.set(f.subarray(c,c+h)),c+=h,t.putImageData(o,0,m),m+=pi;d<a&&(h=r*s*4,l.set(f.subarray(c,c+h)),t.putImageData(o,0,m))}else if(e.kind===QS.RGB_24BPP)for(p=pi,h=r*p,d=0;d<a;d++){for(d>=i&&(p=s,h=r*p),u=0,m=h;m--;)l[u++]=f[c++],l[u++]=f[c++],l[u++]=f[c++],l[u++]=255;t.putImageData(o,0,d*pi)}else throw new Error(`bad image kind: ${e.kind}`)}function dU(t,e){if(e.bitmap){t.drawImage(e.bitmap,0,0);return}const n=e.height,r=e.width,s=n%pi,i=(n-s)/pi,a=s===0?i:i+1,o=t.createImageData(r,pi);let c=0;const u=e.data,f=o.data;for(let l=0;l<a;l++){const d=l<i?pi:s;({srcPos:c}=GFe({src:u,srcPos:c,dest:f,width:r,height:d,nonBlackColor:0})),t.putImageData(o,0,l*pi)}}function ky(t,e){const n=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const r of n)t[r]!==void 0&&(e[r]=t[r]);t.setLineDash!==void 0&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function ES(t){if(t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",t.setLineDash!==void 0&&(t.setLineDash([]),t.lineDashOffset=0),!Ms){const{filter:e}=t;e!=="none"&&e!==""&&(t.filter="none")}}function fU(t,e){if(e)return!0;const n=et.singularValueDecompose2dScale(t);n[0]=Math.fround(n[0]),n[1]=Math.fround(n[1]);const r=Math.fround((globalThis.devicePixelRatio||1)*Dd.PDF_TO_CSS_UNITS);return n[0]<=r&&n[1]<=r}const JFe=["butt","round","square"],ZFe=["miter","round","bevel"],eje={},hU={};var Md,hM,pM;const a2=class a2{constructor(e,n,r,s,i,{optionalContentConfig:a,markedContentStack:o=null},c,u){z(this,Md);this.ctx=e,this.current=new cU(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=n,this.objs=r,this.canvasFactory=s,this.filterFactory=i,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=o||[],this.optionalContentConfig=a,this.cachedCanvases=new XFe(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=c,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=u,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(e,n=null){return typeof e=="string"?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):n}beginDrawing({transform:e,viewport:n,transparency:r=!1,background:s=null}){const i=this.ctx.canvas.width,a=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=s||"#ffffff",this.ctx.fillRect(0,0,i,a),this.ctx.fillStyle=o,r){const c=this.cachedCanvases.getCanvas("transparent",i,a);this.compositeCtx=this.ctx,this.transparentCanvas=c.canvas,this.ctx=c.context,this.ctx.save(),this.ctx.transform(...Jn(this.compositeCtx))}this.ctx.save(),ES(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...n.transform),this.viewportScale=n.scale,this.baseTransform=Jn(this.ctx)}executeOperatorList(e,n,r,s){const i=e.argsArray,a=e.fnArray;let o=n||0;const c=i.length;if(c===o)return o;const u=c-o>aU&&typeof r=="function",f=u?Date.now()+KFe:0;let l=0;const d=this.commonObjs,m=this.objs;let p;for(;;){if(s!==void 0&&o===s.nextBreakPoint)return s.breakIt(o,r),o;if(p=a[o],p!==ta.dependency)this[p].apply(this,i[o]);else for(const h of i[o]){const y=h.startsWith("g_")?d:m;if(!y.has(h))return y.get(h,r),o}if(o++,o===c)return o;if(u&&++l>aU){if(Date.now()>f)return r(),o;l=0}}}endDrawing(){B(this,Md,hM).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const n of e.values())typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&(n.width=n.height=0);e.clear()}this._cachedBitmapsMap.clear(),B(this,Md,pM).call(this)}_scaleImage(e,n){const r=e.width,s=e.height;let i=Math.max(Math.hypot(n[0],n[1]),1),a=Math.max(Math.hypot(n[2],n[3]),1),o=r,c=s,u="prescale1",f,l;for(;i>2&&o>1||a>2&&c>1;){let d=o,m=c;i>2&&o>1&&(d=o>=16384?Math.floor(o/2)-1||1:Math.ceil(o/2),i/=o/d),a>2&&c>1&&(m=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,a/=c/m),f=this.cachedCanvases.getCanvas(u,d,m),l=f.context,l.clearRect(0,0,d,m),l.drawImage(e,0,0,o,c,0,0,d,m),e=f.canvas,o=d,c=m,u=u==="prescale1"?"prescale2":"prescale1"}return{img:e,paintWidth:o,paintHeight:c}}_createMaskCanvas(e){const n=this.ctx,{width:r,height:s}=e,i=this.current.fillColor,a=this.current.patternFill,o=Jn(n);let c,u,f,l;if((e.bitmap||e.data)&&e.count>1){const E=e.bitmap||e.data.buffer;u=JSON.stringify(a?o:[o.slice(0,4),i]),c=this._cachedBitmapsMap.get(E),c||(c=new Map,this._cachedBitmapsMap.set(E,c));const T=c.get(u);if(T&&!a){const D=Math.round(Math.min(o[0],o[2])+o[4]),M=Math.round(Math.min(o[1],o[3])+o[5]);return{canvas:T,offsetX:D,offsetY:M}}f=T}f||(l=this.cachedCanvases.getCanvas("maskCanvas",r,s),dU(l.context,e));let d=et.transform(o,[1/r,0,0,-1/s,0,0]);d=et.transform(d,[1,0,0,1,0,-s]);const[m,p,h,y]=et.getAxialAlignedBoundingBox([0,0,r,s],d),g=Math.round(h-m)||1,v=Math.round(y-p)||1,w=this.cachedCanvases.getCanvas("fillCanvas",g,v),x=w.context,A=m,k=p;x.translate(-A,-k),x.transform(...d),f||(f=this._scaleImage(l.canvas,Gl(x)),f=f.img,c&&a&&c.set(u,f)),x.imageSmoothingEnabled=fU(Jn(x),e.interpolate),SS(x,f,0,0,f.width,f.height,0,0,r,s),x.globalCompositeOperation="source-in";const R=et.transform(Gl(x),[1,0,0,1,-A,-k]);return x.fillStyle=a?i.getPattern(n,this,R,Ks.FILL):i,x.fillRect(0,0,r,s),c&&!a&&(this.cachedCanvases.delete("fillCanvas"),c.set(u,w.canvas)),{canvas:w.canvas,offsetX:Math.round(A),offsetY:Math.round(k)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=JFe[e]}setLineJoin(e){this.ctx.lineJoin=ZFe[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,n){const r=this.ctx;r.setLineDash!==void 0&&(r.setLineDash(e),r.lineDashOffset=n)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[n,r]of e)switch(n){case"LW":this.setLineWidth(r);break;case"LC":this.setLineCap(r);break;case"LJ":this.setLineJoin(r);break;case"ML":this.setMiterLimit(r);break;case"D":this.setDash(r[0],r[1]);break;case"RI":this.setRenderingIntent(r);break;case"FL":this.setFlatness(r);break;case"Font":this.setFont(r[0],r[1]);break;case"CA":this.current.strokeAlpha=r;break;case"ca":this.current.fillAlpha=r,this.ctx.globalAlpha=r;break;case"BM":this.ctx.globalCompositeOperation=r;break;case"SMask":this.current.activeSMask=r?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(r);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,n=this.ctx.canvas.height,r="smaskGroupAt"+this.groupLevel,s=this.cachedCanvases.getCanvas(r,e,n);this.suspendedCtx=this.ctx,this.ctx=s.context;const i=this.ctx;i.setTransform(...Jn(this.suspendedCtx)),ky(this.suspendedCtx,i),YFe(i,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),ky(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const n=this.current.activeSMask,r=this.suspendedCtx;this.composeSMask(r,n,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(e,n,r,s){const i=s[0],a=s[1],o=s[2]-i,c=s[3]-a;o===0||c===0||(this.genericComposeSMask(n.context,r,o,c,n.subtype,n.backdrop,n.transferMap,i,a,n.offsetX,n.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(r.canvas,0,0),e.restore())}genericComposeSMask(e,n,r,s,i,a,o,c,u,f,l){let d=e.canvas,m=c-f,p=u-l;if(a){if(m<0||p<0||m+r>d.width||p+s>d.height){const y=this.cachedCanvases.getCanvas("maskExtension",r,s),g=y.context;g.drawImage(d,-m,-p),a.some(v=>v!==0)&&(g.globalCompositeOperation="destination-atop",g.fillStyle=et.makeHexColor(...a),g.fillRect(0,0,r,s),g.globalCompositeOperation="source-over"),d=y.canvas,m=p=0}else if(a.some(y=>y!==0)){e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);const y=new Path2D;y.rect(m,p,r,s),e.clip(y),e.globalCompositeOperation="destination-atop",e.fillStyle=et.makeHexColor(...a),e.fillRect(m,p,r,s),e.restore()}}n.save(),n.globalAlpha=1,n.setTransform(1,0,0,1,0,0),i==="Alpha"&&o?n.filter=this.filterFactory.addAlphaFilter(o):i==="Luminosity"&&(n.filter=this.filterFactory.addLuminosityFilter(o));const h=new Path2D;h.rect(c,u,r,s),n.clip(h),n.globalCompositeOperation="destination-in",n.drawImage(d,m,p,r,s,c,u,r,s),n.restore()}save(){this.inSMaskMode?(ky(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),ky(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(e,n,r,s,i,a){this.ctx.transform(e,n,r,s,i,a),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,n,r){const s=this.ctx,i=this.current;let a=i.x,o=i.y,c,u;const f=Jn(s),l=f[0]===0&&f[3]===0||f[1]===0&&f[2]===0,d=l?r.slice(0):null;for(let m=0,p=0,h=e.length;m<h;m++)switch(e[m]|0){case ta.rectangle:a=n[p++],o=n[p++];const y=n[p++],g=n[p++],v=a+y,w=o+g;s.moveTo(a,o),y===0||g===0?s.lineTo(v,w):(s.lineTo(v,o),s.lineTo(v,w),s.lineTo(a,w)),l||i.updateRectMinMax(f,[a,o,v,w]),s.closePath();break;case ta.moveTo:a=n[p++],o=n[p++],s.moveTo(a,o),l||i.updatePathMinMax(f,a,o);break;case ta.lineTo:a=n[p++],o=n[p++],s.lineTo(a,o),l||i.updatePathMinMax(f,a,o);break;case ta.curveTo:c=a,u=o,a=n[p+4],o=n[p+5],s.bezierCurveTo(n[p],n[p+1],n[p+2],n[p+3],a,o),i.updateCurvePathMinMax(f,c,u,n[p],n[p+1],n[p+2],n[p+3],a,o,d),p+=6;break;case ta.curveTo2:c=a,u=o,s.bezierCurveTo(a,o,n[p],n[p+1],n[p+2],n[p+3]),i.updateCurvePathMinMax(f,c,u,a,o,n[p],n[p+1],n[p+2],n[p+3],d),a=n[p+2],o=n[p+3],p+=4;break;case ta.curveTo3:c=a,u=o,a=n[p+2],o=n[p+3],s.bezierCurveTo(n[p],n[p+1],a,o,a,o),i.updateCurvePathMinMax(f,c,u,n[p],n[p+1],a,o,a,o,d),p+=4;break;case ta.closePath:s.closePath();break}l&&i.updateScalingPathMinMax(f,d),i.setCurrentPoint(a,o)}closePath(){this.ctx.closePath()}stroke(e=!0){const n=this.ctx,r=this.current.strokeColor;n.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof r=="object"&&(r!=null&&r.getPattern)?(n.save(),n.strokeStyle=r.getPattern(n,this,Gl(n),Ks.STROKE),this.rescaleAndStroke(!1),n.restore()):this.rescaleAndStroke(!0)),e&&this.consumePath(this.current.getClippedPathBoundingBox()),n.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(e=!0){const n=this.ctx,r=this.current.fillColor,s=this.current.patternFill;let i=!1;s&&(n.save(),n.fillStyle=r.getPattern(n,this,Gl(n),Ks.FILL),i=!0);const a=this.current.getClippedPathBoundingBox();this.contentVisible&&a!==null&&(this.pendingEOFill?(n.fill("evenodd"),this.pendingEOFill=!1):n.fill()),i&&n.restore(),e&&this.consumePath(a)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=eje}eoClip(){this.pendingClip=hU}beginText(){this.current.textMatrix=PJ,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const e=this.pendingTextPaths,n=this.ctx;if(e===void 0){n.beginPath();return}n.save(),n.beginPath();for(const r of e)n.setTransform(...r.transform),n.translate(r.x,r.y),r.addToPath(n,r.fontSize);n.restore(),n.clip(),n.beginPath(),delete this.pendingTextPaths}setCharSpacing(e){this.current.charSpacing=e}setWordSpacing(e){this.current.wordSpacing=e}setHScale(e){this.current.textHScale=e/100}setLeading(e){this.current.leading=-e}setFont(e,n){var f;const r=this.commonObjs.get(e),s=this.current;if(!r)throw new Error(`Can't find font for ${e}`);if(s.fontMatrix=r.fontMatrix||FN,(s.fontMatrix[0]===0||s.fontMatrix[3]===0)&&kt("Invalid font matrix for font "+e),n<0?(n=-n,s.fontDirection=-1):s.fontDirection=1,this.current.font=r,this.current.fontSize=n,r.isType3Font)return;const i=r.loadedName||"sans-serif",a=((f=r.systemFontInfo)==null?void 0:f.css)||`"${i}", ${r.fallbackName}`;let o="normal";r.black?o="900":r.bold&&(o="bold");const c=r.italic?"italic":"normal";let u=n;n<iU?u=iU:n>oU&&(u=oU),this.current.fontSizeScale=n/u,this.ctx.font=`${c} ${o} ${u}px ${a}`}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,n){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=n}setLeadingMoveText(e,n){this.setLeading(-n),this.moveText(e,n)}setTextMatrix(e,n,r,s,i,a){this.current.textMatrix=[e,n,r,s,i,a],this.current.textMatrixScale=Math.hypot(e,n),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(e,n,r,s){const i=this.ctx,a=this.current,o=a.font,c=a.textRenderingMode,u=a.fontSize/a.fontSizeScale,f=c&xs.FILL_STROKE_MASK,l=!!(c&xs.ADD_TO_PATH_FLAG),d=a.patternFill&&!o.missingFile;let m;(o.disableFontFace||l||d)&&(m=o.getPathGenerator(this.commonObjs,e)),o.disableFontFace||d?(i.save(),i.translate(n,r),i.beginPath(),m(i,u),s&&i.setTransform(...s),(f===xs.FILL||f===xs.FILL_STROKE)&&i.fill(),(f===xs.STROKE||f===xs.FILL_STROKE)&&i.stroke(),i.restore()):((f===xs.FILL||f===xs.FILL_STROKE)&&i.fillText(e,n,r),(f===xs.STROKE||f===xs.FILL_STROKE)&&i.strokeText(e,n,r)),l&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:Jn(i),x:n,y:r,fontSize:u,addToPath:m})}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const n=e.getImageData(0,0,10,10).data;let r=!1;for(let s=3;s<n.length;s+=4)if(n[s]>0&&n[s]<255){r=!0;break}return Gt(this,"isFontSubpixelAAEnabled",r)}showText(e){const n=this.current,r=n.font;if(r.isType3Font)return this.showType3Text(e);const s=n.fontSize;if(s===0)return;const i=this.ctx,a=n.fontSizeScale,o=n.charSpacing,c=n.wordSpacing,u=n.fontDirection,f=n.textHScale*u,l=e.length,d=r.vertical,m=d?1:-1,p=r.defaultVMetrics,h=s*n.fontMatrix[0],y=n.textRenderingMode===xs.FILL&&!r.disableFontFace&&!n.patternFill;i.save(),i.transform(...n.textMatrix),i.translate(n.x,n.y+n.textRise),u>0?i.scale(f,-1):i.scale(f,1);let g;if(n.patternFill){i.save();const k=n.fillColor.getPattern(i,this,Gl(i),Ks.FILL);g=Jn(i),i.restore(),i.fillStyle=k}let v=n.lineWidth;const w=n.textMatrixScale;if(w===0||v===0){const k=n.textRenderingMode&xs.FILL_STROKE_MASK;(k===xs.STROKE||k===xs.FILL_STROKE)&&(v=this.getSinglePixelWidth())}else v/=w;if(a!==1&&(i.scale(a,a),v/=a),i.lineWidth=v,r.isInvalidPDFjsFont){const k=[];let R=0;for(const E of e)k.push(E.unicode),R+=E.width;i.fillText(k.join(""),0,0),n.x+=R*h*f,i.restore(),this.compose();return}let x=0,A;for(A=0;A<l;++A){const k=e[A];if(typeof k=="number"){x+=m*k*s/1e3;continue}let R=!1;const E=(k.isSpace?c:0)+o,T=k.fontChar,D=k.accent;let M,L,I=k.width;if(d){const U=k.vmetric||p,Y=-(k.vmetric?U[1]:I*.5)*h,W=U[2]*h;I=U?-U[0]:I,M=Y/a,L=(x+W)/a}else M=x/a,L=0;if(r.remeasure&&I>0){const U=i.measureText(T).width*1e3/s*a;if(I<U&&this.isFontSubpixelAAEnabled){const Y=I/U;R=!0,i.save(),i.scale(Y,1),M/=Y}else I!==U&&(M+=(I-U)/2e3*s/a)}if(this.contentVisible&&(k.isInFont||r.missingFile)){if(y&&!D)i.fillText(T,M,L);else if(this.paintChar(T,M,L,g),D){const U=M+s*D.offset.x/a,Y=L-s*D.offset.y/a;this.paintChar(D.fontChar,U,Y,g)}}const F=d?I*h-E*u:I*h+E*u;x+=F,R&&i.restore()}d?n.y-=x:n.x+=x*f,i.restore(),this.compose()}showType3Text(e){const n=this.ctx,r=this.current,s=r.font,i=r.fontSize,a=r.fontDirection,o=s.vertical?1:-1,c=r.charSpacing,u=r.wordSpacing,f=r.textHScale*a,l=r.fontMatrix||FN,d=e.length,m=r.textRenderingMode===xs.INVISIBLE;let p,h,y,g;if(!(m||i===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,n.save(),n.transform(...r.textMatrix),n.translate(r.x,r.y),n.scale(f,a),p=0;p<d;++p){if(h=e[p],typeof h=="number"){g=o*h*i/1e3,this.ctx.translate(g,0),r.x+=g*f;continue}const v=(h.isSpace?u:0)+c,w=s.charProcOperatorList[h.operatorListId];if(!w){kt(`Type3 character "${h.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=h,this.save(),n.scale(i,i),n.transform(...l),this.executeOperatorList(w),this.restore()),y=et.applyTransform([h.width,0],l)[0]*i+v,n.translate(y,0),r.x+=y*f}n.restore(),this.processingType3=null}}setCharWidth(e,n){}setCharWidthAndBounds(e,n,r,s,i,a){this.ctx.rect(r,s,i-r,a-s),this.ctx.clip(),this.endPath()}getColorN_Pattern(e){let n;if(e[0]==="TilingPattern"){const r=e[1],s=this.baseTransform||Jn(this.ctx),i={createCanvasGraphics:a=>new a2(a,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};n=new fM(e,r,this.ctx,i,s)}else n=this._getPattern(e[1],e[2]);return n}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e,n,r){const s=et.makeHexColor(e,n,r);this.ctx.strokeStyle=s,this.current.strokeColor=s}setFillRGBColor(e,n,r){const s=et.makeHexColor(e,n,r);this.ctx.fillStyle=s,this.current.fillColor=s,this.current.patternFill=!1}_getPattern(e,n=null){let r;return this.cachedPatterns.has(e)?r=this.cachedPatterns.get(e):(r=qFe(this.getObject(e)),this.cachedPatterns.set(e,r)),n&&(r.matrix=n),r}shadingFill(e){if(!this.contentVisible)return;const n=this.ctx;this.save();const r=this._getPattern(e);n.fillStyle=r.getPattern(n,this,Gl(n),Ks.SHADING);const s=Gl(n);if(s){const{width:i,height:a}=n.canvas,[o,c,u,f]=et.getAxialAlignedBoundingBox([0,0,i,a],s);this.ctx.fillRect(o,c,u-o,f-c)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){_n("Should not call beginInlineImage")}beginImageData(){_n("Should not call beginImageData")}paintFormXObjectBegin(e,n){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),e&&this.transform(...e),this.baseTransform=Jn(this.ctx),n)){const r=n[2]-n[0],s=n[3]-n[1];this.ctx.rect(n[0],n[1],r,s),this.current.updateRectMinMax(Jn(this.ctx),n),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const n=this.ctx;e.isolated||KA("TODO: Support non-isolated groups."),e.knockout&&kt("Knockout groups not supported.");const r=Jn(n);if(e.matrix&&n.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let s=et.getAxialAlignedBoundingBox(e.bbox,Jn(n));const i=[0,0,n.canvas.width,n.canvas.height];s=et.intersect(s,i)||[0,0,0,0];const a=Math.floor(s[0]),o=Math.floor(s[1]),c=Math.max(Math.ceil(s[2])-a,1),u=Math.max(Math.ceil(s[3])-o,1);this.current.startNewPathAndClipBox([0,0,c,u]);let f="groupAt"+this.groupLevel;e.smask&&(f+="_smask_"+this.smaskCounter++%2);const l=this.cachedCanvases.getCanvas(f,c,u),d=l.context;d.translate(-a,-o),d.transform(...r),e.smask?this.smaskStack.push({canvas:l.canvas,context:d,offsetX:a,offsetY:o,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(n.setTransform(1,0,0,1,0,0),n.translate(a,o),n.save()),ky(n,d),this.ctx=d,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(n),this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;const n=this.ctx,r=this.groupStack.pop();if(this.ctx=r,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const s=Jn(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...s);const i=et.getAxialAlignedBoundingBox([0,0,n.canvas.width,n.canvas.height],s);this.ctx.drawImage(n.canvas,0,0),this.ctx.restore(),this.compose(i)}}beginAnnotation(e,n,r,s,i){if(B(this,Md,hM).call(this),ES(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),n){const a=n[2]-n[0],o=n[3]-n[1];if(i&&this.annotationCanvasMap){r=r.slice(),r[4]-=n[0],r[5]-=n[1],n=n.slice(),n[0]=n[1]=0,n[2]=a,n[3]=o;const[c,u]=et.singularValueDecompose2dScale(Jn(this.ctx)),{viewportScale:f}=this,l=Math.ceil(a*this.outputScaleX*f),d=Math.ceil(o*this.outputScaleY*f);this.annotationCanvas=this.canvasFactory.create(l,d);const{canvas:m,context:p}=this.annotationCanvas;this.annotationCanvasMap.set(e,m),this.annotationCanvas.savedCtx=this.ctx,this.ctx=p,this.ctx.save(),this.ctx.setTransform(c,0,0,-u,0,o*u),ES(this.ctx)}else ES(this.ctx),this.ctx.rect(n[0],n[1],a,o),this.ctx.clip(),this.endPath()}this.current=new cU(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...r),this.transform(...s)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),B(this,Md,pM).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){if(!this.contentVisible)return;const n=e.count;e=this.getObject(e.data,e),e.count=n;const r=this.ctx,s=this.processingType3;if(s&&(s.compiled===void 0&&(s.compiled=QFe(e)),s.compiled)){s.compiled(r);return}const i=this._createMaskCanvas(e),a=i.canvas;r.save(),r.setTransform(1,0,0,1,0,0),r.drawImage(a,i.offsetX,i.offsetY),r.restore(),this.compose()}paintImageMaskXObjectRepeat(e,n,r=0,s=0,i,a){if(!this.contentVisible)return;e=this.getObject(e.data,e);const o=this.ctx;o.save();const c=Jn(o);o.transform(n,r,s,i,0,0);const u=this._createMaskCanvas(e);o.setTransform(1,0,0,1,u.offsetX-c[4],u.offsetY-c[5]);for(let f=0,l=a.length;f<l;f+=2){const d=et.transform(c,[n,r,s,i,a[f],a[f+1]]),[m,p]=et.applyTransform([0,0],d);o.drawImage(u.canvas,m,p)}o.restore(),this.compose()}paintImageMaskXObjectGroup(e){if(!this.contentVisible)return;const n=this.ctx,r=this.current.fillColor,s=this.current.patternFill;for(const i of e){const{data:a,width:o,height:c,transform:u}=i,f=this.cachedCanvases.getCanvas("maskCanvas",o,c),l=f.context;l.save();const d=this.getObject(a,i);dU(l,d),l.globalCompositeOperation="source-in",l.fillStyle=s?r.getPattern(l,this,Gl(n),Ks.FILL):r,l.fillRect(0,0,o,c),l.restore(),n.save(),n.transform(...u),n.scale(1,-1),SS(n,f.canvas,0,0,o,c,0,-1,1,1),n.restore()}this.compose()}paintImageXObject(e){if(!this.contentVisible)return;const n=this.getObject(e);if(!n){kt("Dependent image isn't ready yet");return}this.paintInlineImageXObject(n)}paintImageXObjectRepeat(e,n,r,s){if(!this.contentVisible)return;const i=this.getObject(e);if(!i){kt("Dependent image isn't ready yet");return}const a=i.width,o=i.height,c=[];for(let u=0,f=s.length;u<f;u+=2)c.push({transform:[n,0,0,r,s[u],s[u+1]],x:0,y:0,w:a,h:o});this.paintInlineImageXObjectGroup(i,c)}applyTransferMapsToCanvas(e){return this.current.transferMaps!=="none"&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if(this.current.transferMaps==="none")return e.bitmap;const{bitmap:n,width:r,height:s}=e,i=this.cachedCanvases.getCanvas("inlineImage",r,s),a=i.context;return a.filter=this.current.transferMaps,a.drawImage(n,0,0),a.filter="none",i.canvas}paintInlineImageXObject(e){if(!this.contentVisible)return;const n=e.width,r=e.height,s=this.ctx;if(this.save(),!Ms){const{filter:o}=s;o!=="none"&&o!==""&&(s.filter="none")}s.scale(1/n,-1/r);let i;if(e.bitmap)i=this.applyTransferMapsToBitmap(e);else if(typeof HTMLElement=="function"&&e instanceof HTMLElement||!e.data)i=e;else{const c=this.cachedCanvases.getCanvas("inlineImage",n,r).context;uU(c,e),i=this.applyTransferMapsToCanvas(c)}const a=this._scaleImage(i,Gl(s));s.imageSmoothingEnabled=fU(Jn(s),e.interpolate),SS(s,a.img,0,0,a.paintWidth,a.paintHeight,0,-r,n,r),this.compose(),this.restore()}paintInlineImageXObjectGroup(e,n){if(!this.contentVisible)return;const r=this.ctx;let s;if(e.bitmap)s=e.bitmap;else{const i=e.width,a=e.height,c=this.cachedCanvases.getCanvas("inlineImage",i,a).context;uU(c,e),s=this.applyTransferMapsToCanvas(c)}for(const i of n)r.save(),r.transform(...i.transform),r.scale(1,-1),SS(r,s,i.x,i.y,i.w,i.h,0,-1,1,1),r.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e){}markPointProps(e,n){}beginMarkedContent(e){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,n){e==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(n)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(e){const n=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(e);const r=this.ctx;this.pendingClip&&(n||(this.pendingClip===hU?r.clip("evenodd"):r.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),r.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const e=Jn(this.ctx);if(e[1]===0&&e[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{const n=Math.abs(e[0]*e[3]-e[2]*e[1]),r=Math.hypot(e[0],e[2]),s=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(r,s)/n}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:e}=this.current,{a:n,b:r,c:s,d:i}=this.ctx.getTransform();let a,o;if(r===0&&s===0){const c=Math.abs(n),u=Math.abs(i);if(c===u)if(e===0)a=o=1/c;else{const f=c*e;a=o=f<1?1/f:1}else if(e===0)a=1/c,o=1/u;else{const f=c*e,l=u*e;a=f<1?1/f:1,o=l<1?1/l:1}}else{const c=Math.abs(n*i-r*s),u=Math.hypot(n,r),f=Math.hypot(s,i);if(e===0)a=f/c,o=u/c;else{const l=e*c;a=f>l?f/l:1,o=u>l?u/l:1}}this._cachedScaleForStroking[0]=a,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(e){const{ctx:n}=this,{lineWidth:r}=this.current,[s,i]=this.getScaleForStroking();if(n.lineWidth=r||1,s===1&&i===1){n.stroke();return}const a=n.getLineDash();if(e&&n.save(),n.scale(s,i),a.length>0){const o=Math.max(s,i);n.setLineDash(a.map(c=>c/o)),n.lineDashOffset/=o}n.stroke(),e&&n.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}};Md=new WeakSet,hM=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},pM=function(){if(this.pageColors){const e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(e!=="none"){const n=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=n}}};let Hm=a2;for(const t in ta)Hm.prototype[t]!==void 0&&(Hm.prototype[ta[t]]=Hm.prototype[t]);var qw,Gw;class Ic{static get workerPort(){return C(this,qw)}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&e!==null)throw new Error("Invalid `workerPort` type.");$(this,qw,e)}static get workerSrc(){return C(this,Gw)}static set workerSrc(e){if(typeof e!="string")throw new Error("Invalid `workerSrc` type.");$(this,Gw,e)}}qw=new WeakMap,Gw=new WeakMap,z(Ic,qw,null),z(Ic,Gw,"");const CS={DATA:1,ERROR:2},xr={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function Fi(t){switch(t instanceof Error||typeof t=="object"&&t!==null||_n('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new wp(t.message);case"MissingPDFException":return new bp(t.message);case"PasswordException":return new zN(t.message,t.code);case"UnexpectedResponseException":return new YA(t.message,t.status);case"UnknownErrorException":return new BN(t.message,t.details);default:return new BN(t.message,t.toString())}}var wl,dZ,fZ,rE;class Xy{constructor(e,n,r){z(this,wl);this.sourceName=e,this.targetName=n,this.comObj=r,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=s=>{const i=s.data;if(i.targetName!==this.sourceName)return;if(i.stream){B(this,wl,fZ).call(this,i);return}if(i.callback){const o=i.callbackId,c=this.callbackCapabilities[o];if(!c)throw new Error(`Cannot resolve callback ${o}`);if(delete this.callbackCapabilities[o],i.callback===CS.DATA)c.resolve(i.data);else if(i.callback===CS.ERROR)c.reject(Fi(i.reason));else throw new Error("Unexpected callback case");return}const a=this.actionHandler[i.action];if(!a)throw new Error(`Unknown action from worker: ${i.action}`);if(i.callbackId){const o=this.sourceName,c=i.sourceName;new Promise(function(u){u(a(i.data))}).then(function(u){r.postMessage({sourceName:o,targetName:c,callback:CS.DATA,callbackId:i.callbackId,data:u})},function(u){r.postMessage({sourceName:o,targetName:c,callback:CS.ERROR,callbackId:i.callbackId,reason:Fi(u)})});return}if(i.streamId){B(this,wl,dZ).call(this,i);return}a(i.data)},r.addEventListener("message",this._onComObjOnMessage)}on(e,n){const r=this.actionHandler;if(r[e])throw new Error(`There is already an actionName called "${e}"`);r[e]=n}send(e,n,r){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:n},r)}sendWithPromise(e,n,r){const s=this.callbackId++,i=Promise.withResolvers();this.callbackCapabilities[s]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:s,data:n},r)}catch(a){i.reject(a)}return i.promise}sendWithStream(e,n,r,s){const i=this.streamId++,a=this.sourceName,o=this.targetName,c=this.comObj;return new ReadableStream({start:u=>{const f=Promise.withResolvers();return this.streamControllers[i]={controller:u,startCall:f,pullCall:null,cancelCall:null,isClosed:!1},c.postMessage({sourceName:a,targetName:o,action:e,streamId:i,data:n,desiredSize:u.desiredSize},s),f.promise},pull:u=>{const f=Promise.withResolvers();return this.streamControllers[i].pullCall=f,c.postMessage({sourceName:a,targetName:o,stream:xr.PULL,streamId:i,desiredSize:u.desiredSize}),f.promise},cancel:u=>{Hr(u instanceof Error,"cancel must have a valid reason");const f=Promise.withResolvers();return this.streamControllers[i].cancelCall=f,this.streamControllers[i].isClosed=!0,c.postMessage({sourceName:a,targetName:o,stream:xr.CANCEL,streamId:i,reason:Fi(u)}),f.promise}},r)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}wl=new WeakSet,dZ=function(e){const n=e.streamId,r=this.sourceName,s=e.sourceName,i=this.comObj,a=this,o=this.actionHandler[e.action],c={enqueue(u,f=1,l){if(this.isCancelled)return;const d=this.desiredSize;this.desiredSize-=f,d>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),i.postMessage({sourceName:r,targetName:s,stream:xr.ENQUEUE,streamId:n,chunk:u},l)},close(){this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:r,targetName:s,stream:xr.CLOSE,streamId:n}),delete a.streamSinks[n])},error(u){Hr(u instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,i.postMessage({sourceName:r,targetName:s,stream:xr.ERROR,streamId:n,reason:Fi(u)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};c.sinkCapability.resolve(),c.ready=c.sinkCapability.promise,this.streamSinks[n]=c,new Promise(function(u){u(o(e.data,c))}).then(function(){i.postMessage({sourceName:r,targetName:s,stream:xr.START_COMPLETE,streamId:n,success:!0})},function(u){i.postMessage({sourceName:r,targetName:s,stream:xr.START_COMPLETE,streamId:n,reason:Fi(u)})})},fZ=function(e){const n=e.streamId,r=this.sourceName,s=e.sourceName,i=this.comObj,a=this.streamControllers[n],o=this.streamSinks[n];switch(e.stream){case xr.START_COMPLETE:e.success?a.startCall.resolve():a.startCall.reject(Fi(e.reason));break;case xr.PULL_COMPLETE:e.success?a.pullCall.resolve():a.pullCall.reject(Fi(e.reason));break;case xr.PULL:if(!o){i.postMessage({sourceName:r,targetName:s,stream:xr.PULL_COMPLETE,streamId:n,success:!0});break}o.desiredSize<=0&&e.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=e.desiredSize,new Promise(function(c){var u;c((u=o.onPull)==null?void 0:u.call(o))}).then(function(){i.postMessage({sourceName:r,targetName:s,stream:xr.PULL_COMPLETE,streamId:n,success:!0})},function(c){i.postMessage({sourceName:r,targetName:s,stream:xr.PULL_COMPLETE,streamId:n,reason:Fi(c)})});break;case xr.ENQUEUE:if(Hr(a,"enqueue should have stream controller"),a.isClosed)break;a.controller.enqueue(e.chunk);break;case xr.CLOSE:if(Hr(a,"close should have stream controller"),a.isClosed)break;a.isClosed=!0,a.controller.close(),B(this,wl,rE).call(this,a,n);break;case xr.ERROR:Hr(a,"error should have stream controller"),a.controller.error(Fi(e.reason)),B(this,wl,rE).call(this,a,n);break;case xr.CANCEL_COMPLETE:e.success?a.cancelCall.resolve():a.cancelCall.reject(Fi(e.reason)),B(this,wl,rE).call(this,a,n);break;case xr.CANCEL:if(!o)break;new Promise(function(c){var u;c((u=o.onCancel)==null?void 0:u.call(o,Fi(e.reason)))}).then(function(){i.postMessage({sourceName:r,targetName:s,stream:xr.CANCEL_COMPLETE,streamId:n,success:!0})},function(c){i.postMessage({sourceName:r,targetName:s,stream:xr.CANCEL_COMPLETE,streamId:n,reason:Fi(c)})}),o.sinkCapability.reject(Fi(e.reason)),o.isCancelled=!0,delete this.streamSinks[n];break;default:throw new Error("Unexpected stream case")}},rE=async function(e,n){var r,s,i;await Promise.allSettled([(r=e.startCall)==null?void 0:r.promise,(s=e.pullCall)==null?void 0:s.promise,(i=e.cancelCall)==null?void 0:i.promise]),delete this.streamControllers[n]};var th,Kw;class tje{constructor({parsedData:e,rawData:n}){z(this,th);z(this,Kw);$(this,th,e),$(this,Kw,n)}getRaw(){return C(this,Kw)}get(e){return C(this,th).get(e)??null}getAll(){return H$(C(this,th))}has(e){return C(this,th).has(e)}}th=new WeakMap,Kw=new WeakMap;const Eu=Symbol("INTERNAL");var Yw,Xw,Qw,bg;class nje{constructor(e,{name:n,intent:r,usage:s}){z(this,Yw,!1);z(this,Xw,!1);z(this,Qw,!1);z(this,bg,!0);$(this,Yw,!!(e&Ro.DISPLAY)),$(this,Xw,!!(e&Ro.PRINT)),this.name=n,this.intent=r,this.usage=s}get visible(){if(C(this,Qw))return C(this,bg);if(!C(this,bg))return!1;const{print:e,view:n}=this.usage;return C(this,Yw)?(n==null?void 0:n.viewState)!=="OFF":C(this,Xw)?(e==null?void 0:e.printState)!=="OFF":!0}_setVisible(e,n,r=!1){e!==Eu&&_n("Internal method `_setVisible` called."),$(this,Qw,r),$(this,bg,n)}}Yw=new WeakMap,Xw=new WeakMap,Qw=new WeakMap,bg=new WeakMap;var Yu,wn,wg,_g,Jw,mM;class rje{constructor(e,n=Ro.DISPLAY){z(this,Jw);z(this,Yu,null);z(this,wn,new Map);z(this,wg,null);z(this,_g,null);if(this.renderingIntent=n,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,$(this,_g,e.order);for(const r of e.groups)C(this,wn).set(r.id,new nje(n,r));if(e.baseState==="OFF")for(const r of C(this,wn).values())r._setVisible(Eu,!1);for(const r of e.on)C(this,wn).get(r)._setVisible(Eu,!0);for(const r of e.off)C(this,wn).get(r)._setVisible(Eu,!1);$(this,wg,this.getHash())}}isVisible(e){if(C(this,wn).size===0)return!0;if(!e)return KA("Optional content group not defined."),!0;if(e.type==="OCG")return C(this,wn).has(e.id)?C(this,wn).get(e.id).visible:(kt(`Optional content group not found: ${e.id}`),!0);if(e.type==="OCMD"){if(e.expression)return B(this,Jw,mM).call(this,e.expression);if(!e.policy||e.policy==="AnyOn"){for(const n of e.ids){if(!C(this,wn).has(n))return kt(`Optional content group not found: ${n}`),!0;if(C(this,wn).get(n).visible)return!0}return!1}else if(e.policy==="AllOn"){for(const n of e.ids){if(!C(this,wn).has(n))return kt(`Optional content group not found: ${n}`),!0;if(!C(this,wn).get(n).visible)return!1}return!0}else if(e.policy==="AnyOff"){for(const n of e.ids){if(!C(this,wn).has(n))return kt(`Optional content group not found: ${n}`),!0;if(!C(this,wn).get(n).visible)return!0}return!1}else if(e.policy==="AllOff"){for(const n of e.ids){if(!C(this,wn).has(n))return kt(`Optional content group not found: ${n}`),!0;if(C(this,wn).get(n).visible)return!1}return!0}return kt(`Unknown optional content policy ${e.policy}.`),!0}return kt(`Unknown group type ${e.type}.`),!0}setVisibility(e,n=!0){const r=C(this,wn).get(e);if(!r){kt(`Optional content group not found: ${e}`);return}r._setVisible(Eu,!!n,!0),$(this,Yu,null)}setOCGState({state:e,preserveRB:n}){let r;for(const s of e){switch(s){case"ON":case"OFF":case"Toggle":r=s;continue}const i=C(this,wn).get(s);if(i)switch(r){case"ON":i._setVisible(Eu,!0);break;case"OFF":i._setVisible(Eu,!1);break;case"Toggle":i._setVisible(Eu,!i.visible);break}}$(this,Yu,null)}get hasInitialVisibility(){return C(this,wg)===null||this.getHash()===C(this,wg)}getOrder(){return C(this,wn).size?C(this,_g)?C(this,_g).slice():[...C(this,wn).keys()]:null}getGroups(){return C(this,wn).size>0?H$(C(this,wn)):null}getGroup(e){return C(this,wn).get(e)||null}getHash(){if(C(this,Yu)!==null)return C(this,Yu);const e=new aZ;for(const[n,r]of C(this,wn))e.update(`${n}:${r.visible}`);return $(this,Yu,e.hexdigest())}}Yu=new WeakMap,wn=new WeakMap,wg=new WeakMap,_g=new WeakMap,Jw=new WeakSet,mM=function(e){const n=e.length;if(n<2)return!0;const r=e[0];for(let s=1;s<n;s++){const i=e[s];let a;if(Array.isArray(i))a=B(this,Jw,mM).call(this,i);else if(C(this,wn).has(i))a=C(this,wn).get(i).visible;else return kt(`Optional content group not found: ${i}`),!0;switch(r){case"And":if(!a)return!1;break;case"Or":if(a)return!0;break;case"Not":return!a;default:return!0}}return r==="And"};class sje{constructor(e,{disableRange:n=!1,disableStream:r=!1}){Hr(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:s,initialData:i,progressiveDone:a,contentDispositionFilename:o}=e;if(this._queuedChunks=[],this._progressiveDone=a,this._contentDispositionFilename=o,(i==null?void 0:i.length)>0){const c=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;this._queuedChunks.push(c)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!r,this._isRangeSupported=!n,this._contentLength=s,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((c,u)=>{this._onReceiveData({begin:c,chunk:u})}),e.addProgressListener((c,u)=>{this._onProgress({loaded:c,total:u})}),e.addProgressiveReadListener(c=>{this._onReceiveData({chunk:c})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData({begin:e,chunk:n}){const r=n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer;if(e===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(r):this._queuedChunks.push(r);else{const s=this._rangeReaders.some(function(i){return i._begin!==e?!1:(i._enqueue(r),!0)});Hr(s,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var e;return((e=this._fullRequestReader)==null?void 0:e._loaded)??0}_onProgress(e){var n,r,s,i;e.total===void 0?(r=(n=this._rangeReaders[0])==null?void 0:n.onProgress)==null||r.call(n,{loaded:e.loaded}):(i=(s=this._fullRequestReader)==null?void 0:s.onProgress)==null||i.call(s,{loaded:e.loaded,total:e.total})}_onProgressiveDone(){var e;(e=this._fullRequestReader)==null||e.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const n=this._rangeReaders.indexOf(e);n>=0&&this._rangeReaders.splice(n,1)}getFullReader(){Hr(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new ije(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,n){if(n<=this._progressiveDataLength)return null;const r=new oje(this,e,n);return this._pdfDataRangeTransport.requestDataRange(e,n),this._rangeReaders.push(r),r}cancelAllRequests(e){var n;(n=this._fullRequestReader)==null||n.cancel(e);for(const r of this._rangeReaders.slice(0))r.cancel(e);this._pdfDataRangeTransport.abort()}}class ije{constructor(e,n,r=!1,s=null){this._stream=e,this._done=r||!1,this._filename=K$(s)?s:null,this._queuedChunks=n||[],this._loaded=0;for(const i of this._queuedChunks)this._loaded+=i.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class oje{constructor(e,n,r){this._stream=e,this._begin=n,this._end=r,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length===0)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const n=this._queuedChunk;return this._queuedChunk=null,{value:n,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function aje(t){let e=!0,n=r("filename\\*","i").exec(t);if(n){n=n[1];let f=o(n);return f=unescape(f),f=c(f),f=u(f),i(f)}if(n=a(t),n){const f=u(n);return i(f)}if(n=r("filename","i").exec(t),n){n=n[1];let f=o(n);return f=u(f),i(f)}function r(f,l){return new RegExp("(?:^|;)\\s*"+f+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',l)}function s(f,l){if(f){if(!/^[\x00-\xFF]+$/.test(l))return l;try{const d=new TextDecoder(f,{fatal:!0}),m=XA(l);l=d.decode(m),e=!1}catch{}}return l}function i(f){return e&&/[\x80-\xff]/.test(f)&&(f=s("utf-8",f),e&&(f=s("iso-8859-1",f))),f}function a(f){const l=[];let d;const m=r("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(d=m.exec(f))!==null;){let[,h,y,g]=d;if(h=parseInt(h,10),h in l){if(h===0)break;continue}l[h]=[y,g]}const p=[];for(let h=0;h<l.length&&h in l;++h){let[y,g]=l[h];g=o(g),y&&(g=unescape(g),h===0&&(g=c(g))),p.push(g)}return p.join("")}function o(f){if(f.startsWith('"')){const l=f.slice(1).split('\\"');for(let d=0;d<l.length;++d){const m=l[d].indexOf('"');m!==-1&&(l[d]=l[d].slice(0,m),l.length=d+1),l[d]=l[d].replaceAll(/\\(.)/g,"$1")}f=l.join('"')}return f}function c(f){const l=f.indexOf("'");if(l===-1)return f;const d=f.slice(0,l),p=f.slice(l+1).replace(/^[^']*'/,"");return s(d,p)}function u(f){return!f.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(f)?f:f.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(l,d,m,p){if(m==="q"||m==="Q")return p=p.replaceAll("_"," "),p=p.replaceAll(/=([0-9a-fA-F]{2})/g,function(h,y){return String.fromCharCode(parseInt(y,16))}),s(d,p);try{p=atob(p)}catch{}return s(d,p)})}return""}function Q$({getResponseHeader:t,isHttp:e,rangeChunkSize:n,disableRange:r}){const s={allowRangeRequests:!1,suggestedLength:void 0},i=parseInt(t("Content-Length"),10);return!Number.isInteger(i)||(s.suggestedLength=i,i<=2*n)||r||!e||t("Accept-Ranges")!=="bytes"||(t("Content-Encoding")||"identity")!=="identity"||(s.allowRangeRequests=!0),s}function J$(t){const e=t("Content-Disposition");if(e){let n=aje(e);if(n.includes("%"))try{n=decodeURIComponent(n)}catch{}if(K$(n))return n}return null}function tR(t,e){return t===404||t===0&&e.startsWith("file:")?new bp('Missing PDF "'+e+'".'):new YA(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)}function hZ(t){return t===200||t===206}function pZ(t,e,n){return{method:"GET",headers:t,signal:n.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function mZ(t){const e=new Headers;for(const n in t){const r=t[n];r!==void 0&&e.append(n,r)}return e}function gZ(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(kt(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}class pU{constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var e;return((e=this._fullRequestReader)==null?void 0:e._loaded)??0}getFullReader(){return Hr(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new lje(this),this._fullRequestReader}getRangeReader(e,n){if(n<=this._progressiveDataLength)return null;const r=new cje(this,e,n);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){var n;(n=this._fullRequestReader)==null||n.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class lje{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const n=e.source;this._withCredentials=n.withCredentials||!1,this._contentLength=n.length,this._headersCapability=Promise.withResolvers(),this._disableRange=n.disableRange||!1,this._rangeChunkSize=n.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!n.disableStream,this._isRangeSupported=!n.disableRange,this._headers=mZ(this._stream.httpHeaders);const r=n.url;fetch(r,pZ(this._headers,this._withCredentials,this._abortController)).then(s=>{if(!hZ(s.status))throw tR(s.status,r);this._reader=s.body.getReader(),this._headersCapability.resolve();const i=c=>s.headers.get(c),{allowRangeRequests:a,suggestedLength:o}=Q$({getResponseHeader:i,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=o||this._contentLength,this._filename=J$(i),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new wp("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var r;await this._headersCapability.promise;const{value:e,done:n}=await this._reader.read();return n?{value:e,done:n}:(this._loaded+=e.byteLength,(r=this.onProgress)==null||r.call(this,{loaded:this._loaded,total:this._contentLength}),{value:gZ(e),done:!1})}cancel(e){var n;(n=this._reader)==null||n.cancel(e),this._abortController.abort()}}class cje{constructor(e,n,r){this._stream=e,this._reader=null,this._loaded=0;const s=e.source;this._withCredentials=s.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!s.disableStream,this._abortController=new AbortController,this._headers=mZ(this._stream.httpHeaders),this._headers.append("Range",`bytes=${n}-${r-1}`);const i=s.url;fetch(i,pZ(this._headers,this._withCredentials,this._abortController)).then(a=>{if(!hZ(a.status))throw tR(a.status,i);this._readCapability.resolve(),this._reader=a.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var r;await this._readCapability.promise;const{value:e,done:n}=await this._reader.read();return n?{value:e,done:n}:(this._loaded+=e.byteLength,(r=this.onProgress)==null||r.call(this,{loaded:this._loaded}),{value:gZ(e),done:!1})}cancel(e){var n;(n=this._reader)==null||n.cancel(e),this._abortController.abort()}}const fk=200,hk=206;function uje(t){const e=t.response;return typeof e!="string"?e:XA(e).buffer}class dje{constructor(e,n={}){this.url=e,this.isHttp=/^https?:/i.test(e),this.httpHeaders=this.isHttp&&n.httpHeaders||Object.create(null),this.withCredentials=n.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(e,n,r){const s={begin:e,end:n};for(const i in r)s[i]=r[i];return this.request(s)}requestFull(e){return this.request(e)}request(e){const n=new XMLHttpRequest,r=this.currXhrId++,s=this.pendingRequests[r]={xhr:n};n.open("GET",this.url),n.withCredentials=this.withCredentials;for(const i in this.httpHeaders){const a=this.httpHeaders[i];a!==void 0&&n.setRequestHeader(i,a)}return this.isHttp&&"begin"in e&&"end"in e?(n.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),s.expectedStatus=hk):s.expectedStatus=fk,n.responseType="arraybuffer",e.onError&&(n.onerror=function(i){e.onError(n.status)}),n.onreadystatechange=this.onStateChange.bind(this,r),n.onprogress=this.onProgress.bind(this,r),s.onHeadersReceived=e.onHeadersReceived,s.onDone=e.onDone,s.onError=e.onError,s.onProgress=e.onProgress,n.send(null),r}onProgress(e,n){var s;const r=this.pendingRequests[e];r&&((s=r.onProgress)==null||s.call(r,n))}onStateChange(e,n){var c,u,f;const r=this.pendingRequests[e];if(!r)return;const s=r.xhr;if(s.readyState>=2&&r.onHeadersReceived&&(r.onHeadersReceived(),delete r.onHeadersReceived),s.readyState!==4||!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],s.status===0&&this.isHttp){(c=r.onError)==null||c.call(r,s.status);return}const i=s.status||fk;if(!(i===fk&&r.expectedStatus===hk)&&i!==r.expectedStatus){(u=r.onError)==null||u.call(r,s.status);return}const o=uje(s);if(i===hk){const l=s.getResponseHeader("Content-Range"),d=/bytes (\d+)-(\d+)\/(\d+)/.exec(l);r.onDone({begin:parseInt(d[1],10),chunk:o})}else o?r.onDone({begin:0,chunk:o}):(f=r.onError)==null||f.call(r,s.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){const n=this.pendingRequests[e].xhr;delete this.pendingRequests[e],n.abort()}}class fje{constructor(e){this._source=e,this._manager=new dje(e.url,{httpHeaders:e.httpHeaders,withCredentials:e.withCredentials}),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const n=this._rangeRequestReaders.indexOf(e);n>=0&&this._rangeRequestReaders.splice(n,1)}getFullReader(){return Hr(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new hje(this._manager,this._source),this._fullRequestReader}getRangeReader(e,n){const r=new pje(this._manager,e,n);return r.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(r),r}cancelAllRequests(e){var n;(n=this._fullRequestReader)==null||n.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class hje{constructor(e,n){this._manager=e;const r={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=n.url,this._fullRequestId=e.requestFull(r),this._headersReceivedCapability=Promise.withResolvers(),this._disableRange=n.disableRange||!1,this._contentLength=n.length,this._rangeChunkSize=n.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const e=this._fullRequestId,n=this._manager.getRequestXhr(e),r=a=>n.getResponseHeader(a),{allowRangeRequests:s,suggestedLength:i}=Q$({getResponseHeader:r,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});s&&(this._isRangeSupported=!0),this._contentLength=i||this._contentLength,this._filename=J$(r),this._isRangeSupported&&this._manager.abortRequest(e),this._headersReceivedCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=tR(e,this._url),this._headersReceivedCapability.reject(this._storedError);for(const n of this._requests)n.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){var n;(n=this.onProgress)==null||n.call(this,{loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersReceivedCapability.reject(e);for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class pje{constructor(e,n,r){this._manager=e;const s={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._requestId=e.requestRange(n,r,s),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var e;(e=this.onClosed)==null||e.call(this,this)}_onDone(e){const n=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:n,done:!1}):this._queuedChunk=n,this._done=!0;for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError=tR(e,this._url);for(const n of this._requests)n.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){var n;this.isStreamingSupported||(n=this.onProgress)==null||n.call(this,{loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const n=this._queuedChunk;return this._queuedChunk=null,{value:n,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const vZ=/^file:\/\/\/[a-zA-Z]:\//;function mje(t){const e=Al.get("url"),n=e.parse(t);return n.protocol==="file:"||n.host?n:/^[a-z]:[/\\]/i.test(t)?e.parse(`file:///${t}`):(n.host||(n.protocol="file:"),n)}class gje{constructor(e){this.source=e,this.url=mje(e.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var e;return((e=this._fullRequestReader)==null?void 0:e._loaded)??0}getFullReader(){return Hr(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new bje(this):new vje(this),this._fullRequestReader}getRangeReader(e,n){if(n<=this._progressiveDataLength)return null;const r=this.isFsUrl?new wje(this,e,n):new yje(this,e,n);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){var n;(n=this._fullRequestReader)==null||n.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class yZ{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const n=e.source;this._contentLength=n.length,this._loaded=0,this._filename=null,this._disableRange=n.disableRange||!1,this._rangeChunkSize=n.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!n.disableStream,this._isRangeSupported=!n.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var r;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,(r=this.onProgress)==null||r.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",n=>{this._error(n)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new wp("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class bZ{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const n=e.source;this._isStreamingSupported=!n.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var r;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,(r=this.onProgress)==null||r.call(this,{loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",n=>{this._error(n)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function W1(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class vje extends yZ{constructor(e){super(e);const n=r=>{if(r.statusCode===404){const o=new bp(`Missing PDF "${this._url}".`);this._storedError=o,this._headersCapability.reject(o);return}this._headersCapability.resolve(),this._setReadableStream(r);const s=o=>this._readableStream.headers[o.toLowerCase()],{allowRangeRequests:i,suggestedLength:a}=Q$({getResponseHeader:s,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=i,this._contentLength=a||this._contentLength,this._filename=J$(s)};if(this._request=null,this._url.protocol==="http:"){const r=Al.get("http");this._request=r.request(W1(this._url,e.httpHeaders),n)}else{const r=Al.get("https");this._request=r.request(W1(this._url,e.httpHeaders),n)}this._request.on("error",r=>{this._storedError=r,this._headersCapability.reject(r)}),this._request.end()}}class yje extends bZ{constructor(e,n,r){super(e),this._httpHeaders={};for(const i in e.httpHeaders){const a=e.httpHeaders[i];a!==void 0&&(this._httpHeaders[i]=a)}this._httpHeaders.Range=`bytes=${n}-${r-1}`;const s=i=>{if(i.statusCode===404){const a=new bp(`Missing PDF "${this._url}".`);this._storedError=a;return}this._setReadableStream(i)};if(this._request=null,this._url.protocol==="http:"){const i=Al.get("http");this._request=i.request(W1(this._url,this._httpHeaders),s)}else{const i=Al.get("https");this._request=i.request(W1(this._url,this._httpHeaders),s)}this._request.on("error",i=>{this._storedError=i}),this._request.end()}}class bje extends yZ{constructor(e){super(e);let n=decodeURIComponent(this._url.path);vZ.test(this._url.href)&&(n=n.replace(/^\//,""));const r=Al.get("fs");r.promises.lstat(n).then(s=>{this._contentLength=s.size,this._setReadableStream(r.createReadStream(n)),this._headersCapability.resolve()},s=>{s.code==="ENOENT"&&(s=new bp(`Missing PDF "${n}".`)),this._storedError=s,this._headersCapability.reject(s)})}}class wje extends bZ{constructor(e,n,r){super(e);let s=decodeURIComponent(this._url.path);vZ.test(this._url.href)&&(s=s.replace(/^\//,""));const i=Al.get("fs");this._setReadableStream(i.createReadStream(s,{start:n,end:r-1}))}}const _je=1e5,ai=30,xje=.8;var hH,Xu,fi,Zw,e0,nh,pc,t0,n0,rh,xg,Sg,Qu,Eg,r0,Cg,sh,s0,i0,jr,ih,oh,Ju,Ag,Gc,wZ,_Z,gM,_l,sE,xZ,SZ;let V1=(jr=class{constructor({textContentSource:e,container:n,viewport:r}){z(this,Gc);z(this,Xu,Promise.withResolvers());z(this,fi,null);z(this,Zw,!1);z(this,e0,!!((hH=globalThis.FontInspector)!=null&&hH.enabled));z(this,nh,null);z(this,pc,null);z(this,t0,0);z(this,n0,0);z(this,rh,null);z(this,xg,null);z(this,Sg,0);z(this,Qu,0);z(this,Eg,Object.create(null));z(this,r0,[]);z(this,Cg,null);z(this,sh,[]);z(this,s0,new WeakMap);z(this,i0,null);var c;if(e instanceof ReadableStream)$(this,Cg,e);else if(typeof e=="object")$(this,Cg,new ReadableStream({start(u){u.enqueue(e),u.close()}}));else throw new Error('No "textContentSource" parameter specified.');$(this,fi,$(this,xg,n)),$(this,Qu,r.scale*(globalThis.devicePixelRatio||1)),$(this,Sg,r.rotation),$(this,pc,{prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:null});const{pageWidth:s,pageHeight:i,pageX:a,pageY:o}=r.rawDims;$(this,i0,[1,0,0,-1,-a,o+i]),$(this,n0,s),$(this,t0,i),B(c=jr,_l,xZ).call(c),sp(n,r),C(this,Xu).promise.catch(()=>{}).then(()=>{C(jr,Ag).delete(this),$(this,pc,null),$(this,Eg,null)})}render(){const e=()=>{C(this,rh).read().then(({value:n,done:r})=>{if(r){C(this,Xu).resolve();return}C(this,nh)??$(this,nh,n.lang),Object.assign(C(this,Eg),n.styles),B(this,Gc,wZ).call(this,n.items),e()},C(this,Xu).reject)};return $(this,rh,C(this,Cg).getReader()),C(jr,Ag).add(this),e(),C(this,Xu).promise}update({viewport:e,onBefore:n=null}){var i;const r=e.scale*(globalThis.devicePixelRatio||1),s=e.rotation;if(s!==C(this,Sg)&&(n==null||n(),$(this,Sg,s),sp(C(this,xg),{rotation:s})),r!==C(this,Qu)){n==null||n(),$(this,Qu,r);const a={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:B(i=jr,_l,sE).call(i,C(this,nh))};for(const o of C(this,sh))a.properties=C(this,s0).get(o),a.div=o,B(this,Gc,gM).call(this,a)}}cancel(){var n;const e=new wp("TextLayer task cancelled.");(n=C(this,rh))==null||n.cancel(e).catch(()=>{}),$(this,rh,null),C(this,Xu).reject(e)}get textDivs(){return C(this,sh)}get textContentItemsStr(){return C(this,r0)}static cleanup(){if(!(C(this,Ag).size>0)){C(this,ih).clear();for(const{canvas:e}of C(this,oh).values())e.remove();C(this,oh).clear()}}},Xu=new WeakMap,fi=new WeakMap,Zw=new WeakMap,e0=new WeakMap,nh=new WeakMap,pc=new WeakMap,t0=new WeakMap,n0=new WeakMap,rh=new WeakMap,xg=new WeakMap,Sg=new WeakMap,Qu=new WeakMap,Eg=new WeakMap,r0=new WeakMap,Cg=new WeakMap,sh=new WeakMap,s0=new WeakMap,i0=new WeakMap,ih=new WeakMap,oh=new WeakMap,Ju=new WeakMap,Ag=new WeakMap,Gc=new WeakSet,wZ=function(e){var s,i;if(C(this,Zw))return;(i=C(this,pc)).ctx??(i.ctx=B(s=jr,_l,sE).call(s,C(this,nh)));const n=C(this,sh),r=C(this,r0);for(const a of e){if(n.length>_je){kt("Ignoring additional textDivs for performance reasons."),$(this,Zw,!0);return}if(a.str===void 0){if(a.type==="beginMarkedContentProps"||a.type==="beginMarkedContent"){const o=C(this,fi);$(this,fi,document.createElement("span")),C(this,fi).classList.add("markedContent"),a.id!==null&&C(this,fi).setAttribute("id",`${a.id}`),o.append(C(this,fi))}else a.type==="endMarkedContent"&&$(this,fi,C(this,fi).parentNode);continue}r.push(a.str),B(this,Gc,_Z).call(this,a)}},_Z=function(e){var h;const n=document.createElement("span"),r={angle:0,canvasWidth:0,hasText:e.str!=="",hasEOL:e.hasEOL,fontSize:0};C(this,sh).push(n);const s=et.transform(C(this,i0),e.transform);let i=Math.atan2(s[1],s[0]);const a=C(this,Eg)[e.fontName];a.vertical&&(i+=Math.PI/2);const o=C(this,e0)&&a.fontSubstitution||a.fontFamily,c=Math.hypot(s[2],s[3]),u=c*B(h=jr,_l,SZ).call(h,o,C(this,nh));let f,l;i===0?(f=s[4],l=s[5]-u):(f=s[4]+u*Math.sin(i),l=s[5]-u*Math.cos(i));const d="calc(var(--scale-factor)*",m=n.style;C(this,fi)===C(this,xg)?(m.left=`${(100*f/C(this,n0)).toFixed(2)}%`,m.top=`${(100*l/C(this,t0)).toFixed(2)}%`):(m.left=`${d}${f.toFixed(2)}px)`,m.top=`${d}${l.toFixed(2)}px)`),m.fontSize=`${d}${(C(jr,Ju)*c).toFixed(2)}px)`,m.fontFamily=o,r.fontSize=c,n.setAttribute("role","presentation"),n.textContent=e.str,n.dir=e.dir,C(this,e0)&&(n.dataset.fontName=a.fontSubstitutionLoadedName||e.fontName),i!==0&&(r.angle=i*(180/Math.PI));let p=!1;if(e.str.length>1)p=!0;else if(e.str!==" "&&e.transform[0]!==e.transform[3]){const y=Math.abs(e.transform[0]),g=Math.abs(e.transform[3]);y!==g&&Math.max(y,g)/Math.min(y,g)>1.5&&(p=!0)}if(p&&(r.canvasWidth=a.vertical?e.height:e.width),C(this,s0).set(n,r),C(this,pc).div=n,C(this,pc).properties=r,B(this,Gc,gM).call(this,C(this,pc)),r.hasText&&C(this,fi).append(n),r.hasEOL){const y=document.createElement("br");y.setAttribute("role","presentation"),C(this,fi).append(y)}},gM=function(e){const{div:n,properties:r,ctx:s,prevFontSize:i,prevFontFamily:a}=e,{style:o}=n;let c="";if(C(jr,Ju)>1&&(c=`scale(${1/C(jr,Ju)})`),r.canvasWidth!==0&&r.hasText){const{fontFamily:u}=o,{canvasWidth:f,fontSize:l}=r;(i!==l||a!==u)&&(s.font=`${l*C(this,Qu)}px ${u}`,e.prevFontSize=l,e.prevFontFamily=u);const{width:d}=s.measureText(n.textContent);d>0&&(c=`scaleX(${f*C(this,Qu)/d}) ${c}`)}r.angle!==0&&(c=`rotate(${r.angle}deg) ${c}`),c.length>0&&(o.transform=c)},_l=new WeakSet,sE=function(e=null){let n=C(this,oh).get(e||(e=""));if(!n){const r=document.createElement("canvas");r.className="hiddenCanvasElement",r.lang=e,document.body.append(r),n=r.getContext("2d",{alpha:!1,willReadFrequently:!0}),C(this,oh).set(e,n)}return n},xZ=function(){if(C(this,Ju)!==null)return;const e=document.createElement("div");e.style.opacity=0,e.style.lineHeight=1,e.style.fontSize="1px",e.textContent="X",document.body.append(e),$(this,Ju,e.getBoundingClientRect().height),e.remove()},SZ=function(e,n){const r=C(this,ih).get(e);if(r)return r;const s=B(this,_l,sE).call(this,n),i=s.font;s.canvas.width=s.canvas.height=ai,s.font=`${ai}px ${e}`;const a=s.measureText("");let o=a.fontBoundingBoxAscent,c=Math.abs(a.fontBoundingBoxDescent);if(o){const l=o/(o+c);return C(this,ih).set(e,l),s.canvas.width=s.canvas.height=0,s.font=i,l}s.strokeStyle="red",s.clearRect(0,0,ai,ai),s.strokeText("g",0,0);let u=s.getImageData(0,0,ai,ai).data;c=0;for(let l=u.length-1-3;l>=0;l-=4)if(u[l]>0){c=Math.ceil(l/4/ai);break}s.clearRect(0,0,ai,ai),s.strokeText("A",0,ai),u=s.getImageData(0,0,ai,ai).data,o=0;for(let l=0,d=u.length;l<d;l+=4)if(u[l]>0){o=ai-Math.floor(l/4/ai);break}s.canvas.width=s.canvas.height=0,s.font=i;const f=o?o/(o+c):xje;return C(this,ih).set(e,f),f},z(jr,_l),z(jr,ih,new Map),z(jr,oh,new Map),z(jr,Ju,null),z(jr,Ag,new Set),jr);function Sje(){LJ("`renderTextLayer`, please use `TextLayer` instead.");const{textContentSource:t,container:e,viewport:n,...r}=arguments[0],s=Object.keys(r);s.length>0&&kt("Ignoring `renderTextLayer` parameters: "+s.join(", "));const i=new V1({textContentSource:t,container:e,viewport:n}),{textDivs:a,textContentItemsStr:o}=i;return{promise:i.render(),textDivs:a,textContentItemsStr:o}}function Eje(){LJ("`updateTextLayer`, please use `TextLayer` instead.")}class dw{static textContent(e){const n=[],r={items:n,styles:Object.create(null)};function s(i){var c;if(!i)return;let a=null;const o=i.name;if(o==="#text")a=i.value;else if(dw.shouldBuildText(o))(c=i==null?void 0:i.attributes)!=null&&c.textContent?a=i.attributes.textContent:i.value&&(a=i.value);else return;if(a!==null&&n.push({str:a}),!!i.children)for(const u of i.children)s(u)}return s(e),r}static shouldBuildText(e){return!(e==="textarea"||e==="input"||e==="option"||e==="select")}}const Cje=65536,Aje=100,Rje=5e3,Pje=Ms?jFe:AFe,Tje=Ms?zFe:MJ,kje=Ms?FFe:CFe,Dje=Ms?BFe:OJ;function Nje(t={}){typeof t=="string"||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});const e=new vM,{docId:n}=e,r=t.url?Mje(t.url):null,s=t.data?Oje(t.data):null,i=t.httpHeaders||null,a=t.withCredentials===!0,o=t.password??null,c=t.range instanceof EZ?t.range:null,u=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:Cje;let f=t.worker instanceof Wm?t.worker:null;const l=t.verbosity,d=typeof t.docBaseUrl=="string"&&!G$(t.docBaseUrl)?t.docBaseUrl:null,m=typeof t.cMapUrl=="string"?t.cMapUrl:null,p=t.cMapPacked!==!1,h=t.CMapReaderFactory||Tje,y=typeof t.standardFontDataUrl=="string"?t.standardFontDataUrl:null,g=t.StandardFontDataFactory||Dje,v=t.stopAtErrors!==!0,w=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,x=t.isEvalSupported!==!1,A=typeof t.isOffscreenCanvasSupported=="boolean"?t.isOffscreenCanvasSupported:!Ms,k=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,R=typeof t.disableFontFace=="boolean"?t.disableFontFace:Ms,E=t.fontExtraProperties===!0,T=t.enableXfa===!0,D=t.ownerDocument||globalThis.document,M=t.disableRange===!0,L=t.disableStream===!0,I=t.disableAutoFetch===!0,F=t.pdfBug===!0,U=t.enableHWA===!0,Y=c?c.length:t.length??NaN,W=typeof t.useSystemFonts=="boolean"?t.useSystemFonts:!Ms&&!R,H=typeof t.useWorkerFetch=="boolean"?t.useWorkerFetch:h===MJ&&g===OJ&&m&&y&&Gy(m,document.baseURI)&&Gy(y,document.baseURI),ee=t.canvasFactory||new Pje({ownerDocument:D,enableHWA:U}),re=t.filterFactory||new kje({docId:n,ownerDocument:D}),X=null;pFe(l);const G={canvasFactory:ee,filterFactory:re};if(H||(G.cMapReaderFactory=new h({baseUrl:m,isCompressed:p}),G.standardFontDataFactory=new g({baseUrl:y})),!f){const ue={verbosity:l,port:Ic.workerPort};f=ue.port?Wm.fromPort(ue):new Wm(ue),e._worker=f}const K={docId:n,apiVersion:"4.4.168",data:s,password:o,disableAutoFetch:I,rangeChunkSize:u,length:Y,docBaseUrl:d,enableXfa:T,evaluatorOptions:{maxImageSize:w,disableFontFace:R,ignoreErrors:v,isEvalSupported:x,isOffscreenCanvasSupported:A,canvasMaxAreaInBytes:k,fontExtraProperties:E,useSystemFonts:W,cMapUrl:H?m:null,standardFontDataUrl:H?y:null}},J={disableFontFace:R,fontExtraProperties:E,ownerDocument:D,pdfBug:F,styleElement:X,loadingParams:{disableAutoFetch:I,enableXfa:T}};return f.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(f.destroyed)throw new Error("Worker was destroyed");const ue=f.messageHandler.sendWithPromise("GetDocRequest",K,s?[s.buffer]:null);let de;if(c)de=new sje(c,{disableRange:M,disableStream:L});else if(!s){if(!r)throw new Error("getDocument - no `url` parameter provided.");de=(be=>Ms?function(){return typeof fetch<"u"&&typeof Response<"u"&&"body"in Response.prototype}()&&Gy(be.url)?new pU(be):new gje(be):Gy(be.url)?new pU(be):new fje(be))({url:r,length:Y,httpHeaders:i,withCredentials:a,rangeChunkSize:u,disableRange:M,disableStream:L})}return ue.then(ie=>{if(e.destroyed)throw new Error("Loading aborted");if(f.destroyed)throw new Error("Worker was destroyed");const be=new Xy(n,ie,f.port),Ae=new Fje(be,e,de,J,G);e._transport=Ae,be.send("Ready",null)})}).catch(e._capability.reject),e}function Mje(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch{if(Ms&&typeof t=="string")return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function Oje(t){if(Ms&&typeof Buffer<"u"&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if(typeof t=="string")return XA(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||typeof t=="object"&&!isNaN(t==null?void 0:t.length))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function mU(t){return typeof t=="object"&&Number.isInteger(t==null?void 0:t.num)&&t.num>=0&&Number.isInteger(t==null?void 0:t.gen)&&t.gen>=0}var uC;const dC=class dC{constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${bs(dC,uC)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var e,n,r;this.destroyed=!0;try{(e=this._worker)!=null&&e.port&&(this._worker._pendingDestroy=!0),await((n=this._transport)==null?void 0:n.destroy())}catch(s){throw(r=this._worker)!=null&&r.port&&delete this._worker._pendingDestroy,s}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};uC=new WeakMap,z(dC,uC,0);let vM=dC,EZ=class{constructor(e,n,r=!1,s=null){this.length=e,this.initialData=n,this.progressiveDone=r,this.contentDispositionFilename=s,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,n){for(const r of this._rangeListeners)r(e,n)}onDataProgress(e,n){this._readyCapability.promise.then(()=>{for(const r of this._progressListeners)r(e,n)})}onDataProgressiveRead(e){this._readyCapability.promise.then(()=>{for(const n of this._progressiveReadListeners)n(e)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const e of this._progressiveDoneListeners)e()})}transportReady(){this._readyCapability.resolve()}requestDataRange(e,n){_n("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};class Lje{constructor(e,n){this._pdfInfo=e,this._transport=n}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return Gt(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e="display"}={}){const{renderingIntent:n}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(n)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}var Zu,mc,Mo,lm,iE;class Ije{constructor(e,n,r,s=!1){z(this,Mo);z(this,Zu,null);z(this,mc,!1);this._pageIndex=e,this._pageInfo=n,this._transport=r,this._stats=s?new tU:null,this._pdfBug=s,this.commonObjs=r.commonObjs,this.objs=new CZ,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:n=this.rotate,offsetX:r=0,offsetY:s=0,dontFlip:i=!1}={}){return new $_({viewBox:this.view,scale:e,rotation:n,offsetX:r,offsetY:s,dontFlip:i})}getAnnotations({intent:e="display"}={}){const{renderingIntent:n}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,n)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return Gt(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var e;return((e=this._transport._htmlForXfa)==null?void 0:e.children[this._pageIndex])||null}render({canvasContext:e,viewport:n,intent:r="display",annotationMode:s=Ou.ENABLE,transform:i=null,background:a=null,optionalContentConfigPromise:o=null,annotationCanvasMap:c=null,pageColors:u=null,printAnnotationStorage:f=null}){var w,x;(w=this._stats)==null||w.time("Overall");const l=this._transport.getRenderingIntent(r,s,f),{renderingIntent:d,cacheKey:m}=l;$(this,mc,!1),B(this,Mo,iE).call(this),o||(o=this._transport.getOptionalContentConfig(d));let p=this._intentStates.get(m);p||(p=Object.create(null),this._intentStates.set(m,p)),p.streamReaderCancelTimeout&&(clearTimeout(p.streamReaderCancelTimeout),p.streamReaderCancelTimeout=null);const h=!!(d&Ro.PRINT);p.displayReadyCapability||(p.displayReadyCapability=Promise.withResolvers(),p.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(x=this._stats)==null||x.time("Page Request"),this._pumpOperatorList(l));const y=A=>{var k;p.renderTasks.delete(g),(this._maybeCleanupAfterRender||h)&&$(this,mc,!0),B(this,Mo,lm).call(this,!h),A?(g.capability.reject(A),this._abortOperatorList({intentState:p,reason:A instanceof Error?A:new Error(A)})):g.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),(k=globalThis.Stats)!=null&&k.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},g=new bM({callback:y,params:{canvasContext:e,viewport:n,transform:i,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:p.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!h,pdfBug:this._pdfBug,pageColors:u});(p.renderTasks||(p.renderTasks=new Set)).add(g);const v=g.task;return Promise.all([p.displayReadyCapability.promise,o]).then(([A,k])=>{var R;if(this.destroyed){y();return}if((R=this._stats)==null||R.time("Rendering"),!(k.renderingIntent&d))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");g.initializeGraphics({transparency:A,optionalContentConfig:k}),g.operatorListChanged()}).catch(y),v}getOperatorList({intent:e="display",annotationMode:n=Ou.ENABLE,printAnnotationStorage:r=null}={}){var c;function s(){a.operatorList.lastChunk&&(a.opListReadCapability.resolve(a.operatorList),a.renderTasks.delete(o))}const i=this._transport.getRenderingIntent(e,n,r,!0);let a=this._intentStates.get(i.cacheKey);a||(a=Object.create(null),this._intentStates.set(i.cacheKey,a));let o;return a.opListReadCapability||(o=Object.create(null),o.operatorListChanged=s,a.opListReadCapability=Promise.withResolvers(),(a.renderTasks||(a.renderTasks=new Set)).add(o),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(c=this._stats)==null||c.time("Page Request"),this._pumpOperatorList(i)),a.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:n=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:n===!0},{highWaterMark:100,size(s){return s.items.length}})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(r=>dw.textContent(r));const n=this.streamTextContent(e);return new Promise(function(r,s){function i(){a.read().then(function({value:c,done:u}){if(u){r(o);return}o.lang??(o.lang=c.lang),Object.assign(o.styles,c.styles),o.items.push(...c.items),i()},s)}const a=n.getReader(),o={items:[],styles:Object.create(null),lang:null};i()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const n of this._intentStates.values())if(this._abortOperatorList({intentState:n,reason:new Error("Page was destroyed."),force:!0}),!n.opListReadCapability)for(const r of n.renderTasks)e.push(r.completed),r.cancel();return this.objs.clear(),$(this,mc,!1),B(this,Mo,iE).call(this),Promise.all(e)}cleanup(e=!1){$(this,mc,!0);const n=B(this,Mo,lm).call(this,!1);return e&&n&&this._stats&&(this._stats=new tU),n}_startRenderPage(e,n){var s,i;const r=this._intentStates.get(n);r&&((s=this._stats)==null||s.timeEnd("Page Request"),(i=r.displayReadyCapability)==null||i.resolve(e))}_renderPageChunk(e,n){for(let r=0,s=e.length;r<s;r++)n.operatorList.fnArray.push(e.fnArray[r]),n.operatorList.argsArray.push(e.argsArray[r]);n.operatorList.lastChunk=e.lastChunk,n.operatorList.separateAnnots=e.separateAnnots;for(const r of n.renderTasks)r.operatorListChanged();e.lastChunk&&B(this,Mo,lm).call(this,!0)}_pumpOperatorList({renderingIntent:e,cacheKey:n,annotationStorageSerializable:r}){const{map:s,transfer:i}=r,o=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:n,annotationStorage:s},i).getReader(),c=this._intentStates.get(n);c.streamReader=o;const u=()=>{o.read().then(({value:f,done:l})=>{if(l){c.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(f,c),u())},f=>{if(c.streamReader=null,!this._transport.destroyed){if(c.operatorList){c.operatorList.lastChunk=!0;for(const l of c.renderTasks)l.operatorListChanged();B(this,Mo,lm).call(this,!0)}if(c.displayReadyCapability)c.displayReadyCapability.reject(f);else if(c.opListReadCapability)c.opListReadCapability.reject(f);else throw f}})};u()}_abortOperatorList({intentState:e,reason:n,force:r=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!r){if(e.renderTasks.size>0)return;if(n instanceof q$){let s=Aje;n.extraDelay>0&&n.extraDelay<1e3&&(s+=n.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:n,force:!0})},s);return}}if(e.streamReader.cancel(new wp(n.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[s,i]of this._intentStates)if(i===e){this._intentStates.delete(s);break}this.cleanup()}}}get stats(){return this._stats}}Zu=new WeakMap,mc=new WeakMap,Mo=new WeakSet,lm=function(e=!1){if(B(this,Mo,iE).call(this),!C(this,mc)||this.destroyed)return!1;if(e)return $(this,Zu,setTimeout(()=>{$(this,Zu,null),B(this,Mo,lm).call(this,!1)},Rje)),!1;for(const{renderTasks:n,operatorList:r}of this._intentStates.values())if(n.size>0||!r.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),$(this,mc,!1),!0},iE=function(){C(this,Zu)&&(clearTimeout(C(this,Zu)),$(this,Zu,null))};var ah,fC;class $je{constructor(){z(this,ah,new Set);z(this,fC,Promise.resolve())}postMessage(e,n){const r={data:structuredClone(e,n?{transfer:n}:null)};C(this,fC).then(()=>{for(const s of C(this,ah))s.call(this,r)})}addEventListener(e,n){C(this,ah).add(n)}removeEventListener(e,n){C(this,ah).delete(n)}terminate(){C(this,ah).clear()}}ah=new WeakMap,fC=new WeakMap;const rc={isWorkerDisabled:!1,fakeWorkerId:0};Ms&&(rc.isWorkerDisabled=!0,Ic.workerSrc||(Ic.workerSrc="./pdf.worker.mjs")),rc.isSameOrigin=function(t,e){let n;try{if(n=new URL(t),!n.origin||n.origin==="null")return!1}catch{return!1}const r=new URL(e,n);return n.origin===r.origin},rc.createCDNWrapper=function(t){const e=`await import("${t}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))};var lh,Rg,oE,Pg,aE;const Ui=class Ui{constructor({name:e=null,port:n=null,verbosity:r=mFe()}={}){z(this,Rg);var s;if(this.name=e,this.destroyed=!1,this.verbosity=r,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,n){if((s=C(Ui,lh))!=null&&s.has(n))throw new Error("Cannot use more than one PDFWorker per port.");(C(Ui,lh)||$(Ui,lh,new WeakMap)).set(n,this),this._initializeFromPort(n);return}this._initialize()}get promise(){return Ms?Promise.all([Al.promise,this._readyCapability.promise]):this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new Xy("main","worker",e),this._messageHandler.on("ready",function(){}),B(this,Rg,oE).call(this)}_initialize(){if(rc.isWorkerDisabled||C(Ui,Pg,aE)){this._setupFakeWorker();return}let{workerSrc:e}=Ui;try{rc.isSameOrigin(window.location.href,e)||(e=rc.createCDNWrapper(new URL(e,window.location).href));const n=new Worker(e,{type:"module"}),r=new Xy("main","worker",n),s=()=>{i.abort(),r.destroy(),n.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},i=new AbortController;n.addEventListener("error",()=>{this._webWorker||s()},{signal:i.signal}),r.on("test",o=>{if(i.abort(),this.destroyed||!o){s();return}this._messageHandler=r,this._port=n,this._webWorker=n,B(this,Rg,oE).call(this)}),r.on("ready",o=>{if(i.abort(),this.destroyed){s();return}try{a()}catch{this._setupFakeWorker()}});const a=()=>{const o=new Uint8Array;r.send("test",o,[o.buffer])};a();return}catch{KA("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){rc.isWorkerDisabled||(kt("Setting up fake worker."),rc.isWorkerDisabled=!0),Ui._setupFakeWorkerGlobal.then(e=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const n=new $je;this._port=n;const r=`fake${rc.fakeWorkerId++}`,s=new Xy(r+"_worker",r,n);e.setup(s,n),this._messageHandler=new Xy(r,r+"_worker",n),B(this,Rg,oE).call(this)}).catch(e=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${e.message}".`))})}destroy(){var e;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),(e=C(Ui,lh))==null||e.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(e){var r;if(!(e!=null&&e.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const n=(r=C(this,lh))==null?void 0:r.get(e.port);if(n){if(n._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return n}return new Ui(e)}static get workerSrc(){if(Ic.workerSrc)return Ic.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return Gt(this,"_setupFakeWorkerGlobal",(async()=>C(this,Pg,aE)?C(this,Pg,aE):(await import(this.workerSrc)).WorkerMessageHandler)())}};lh=new WeakMap,Rg=new WeakSet,oE=function(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})},Pg=new WeakSet,aE=function(){var e;try{return((e=globalThis.pdfjsWorker)==null?void 0:e.WorkerMessageHandler)||null}catch{return null}},z(Ui,Pg),z(Ui,lh);let Wm=Ui;var gc,nl,Tg,kg,rl,ch,Qy;class Fje{constructor(e,n,r,s,i){z(this,ch);z(this,gc,new Map);z(this,nl,new Map);z(this,Tg,new Map);z(this,kg,new Map);z(this,rl,null);this.messageHandler=e,this.loadingTask=n,this.commonObjs=new CZ,this.fontLoader=new IFe({ownerDocument:s.ownerDocument,styleElement:s.styleElement}),this.loadingParams=s.loadingParams,this._params=s,this.canvasFactory=i.canvasFactory,this.filterFactory=i.filterFactory,this.cMapReaderFactory=i.cMapReaderFactory,this.standardFontDataFactory=i.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=r,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}get annotationStorage(){return Gt(this,"annotationStorage",new X$)}getRenderingIntent(e,n=Ou.ENABLE,r=null,s=!1){let i=Ro.DISPLAY,a=cM;switch(e){case"any":i=Ro.ANY;break;case"display":break;case"print":i=Ro.PRINT;break;default:kt(`getRenderingIntent - invalid intent: ${e}`)}switch(n){case Ou.DISABLE:i+=Ro.ANNOTATIONS_DISABLE;break;case Ou.ENABLE:break;case Ou.ENABLE_FORMS:i+=Ro.ANNOTATIONS_FORMS;break;case Ou.ENABLE_STORAGE:i+=Ro.ANNOTATIONS_STORAGE,a=(i&Ro.PRINT&&r instanceof cZ?r:this.annotationStorage).serializable;break;default:kt(`getRenderingIntent - invalid annotationMode: ${n}`)}return s&&(i+=Ro.OPLIST),{renderingIntent:i,cacheKey:`${i}_${a.hash}`,annotationStorageSerializable:a}}destroy(){var r;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),(r=C(this,rl))==null||r.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const s of C(this,nl).values())e.push(s._destroy());C(this,nl).clear(),C(this,Tg).clear(),C(this,kg).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const n=this.messageHandler.sendWithPromise("Terminate",null);return e.push(n),Promise.all(e).then(()=>{var s;this.commonObjs.clear(),this.fontLoader.clear(),C(this,gc).clear(),this.filterFactory.destroy(),V1.cleanup(),(s=this._networkStream)==null||s.cancelAllRequests(new wp("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:n}=this;e.on("GetReader",(r,s)=>{Hr(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=i=>{this._lastProgress={loaded:i.loaded,total:i.total}},s.onPull=()=>{this._fullReader.read().then(function({value:i,done:a}){if(a){s.close();return}Hr(i instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),s.enqueue(new Uint8Array(i),1,[i])}).catch(i=>{s.error(i)})},s.onCancel=i=>{this._fullReader.cancel(i),s.ready.catch(a=>{if(!this.destroyed)throw a})}}),e.on("ReaderHeadersReady",r=>{const s=Promise.withResolvers(),i=this._fullReader;return i.headersReady.then(()=>{var a;(!i.isStreamingSupported||!i.isRangeSupported)&&(this._lastProgress&&((a=n.onProgress)==null||a.call(n,this._lastProgress)),i.onProgress=o=>{var c;(c=n.onProgress)==null||c.call(n,{loaded:o.loaded,total:o.total})}),s.resolve({isStreamingSupported:i.isStreamingSupported,isRangeSupported:i.isRangeSupported,contentLength:i.contentLength})},s.reject),s.promise}),e.on("GetRangeReader",(r,s)=>{Hr(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const i=this._networkStream.getRangeReader(r.begin,r.end);if(!i){s.close();return}s.onPull=()=>{i.read().then(function({value:a,done:o}){if(o){s.close();return}Hr(a instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),s.enqueue(new Uint8Array(a),1,[a])}).catch(a=>{s.error(a)})},s.onCancel=a=>{i.cancel(a),s.ready.catch(o=>{if(!this.destroyed)throw o})}}),e.on("GetDoc",({pdfInfo:r})=>{this._numPages=r.numPages,this._htmlForXfa=r.htmlForXfa,delete r.htmlForXfa,n._capability.resolve(new Lje(r,this))}),e.on("DocException",function(r){let s;switch(r.name){case"PasswordException":s=new zN(r.message,r.code);break;case"InvalidPDFException":s=new TJ(r.message);break;case"MissingPDFException":s=new bp(r.message);break;case"UnexpectedResponseException":s=new YA(r.message,r.status);break;case"UnknownErrorException":s=new BN(r.message,r.details);break;default:_n("DocException - expected a valid Error.")}n._capability.reject(s)}),e.on("PasswordRequest",r=>{if($(this,rl,Promise.withResolvers()),n.onPassword){const s=i=>{i instanceof Error?C(this,rl).reject(i):C(this,rl).resolve({password:i})};try{n.onPassword(s,r.code)}catch(i){C(this,rl).reject(i)}}else C(this,rl).reject(new zN(r.message,r.code));return C(this,rl).promise}),e.on("DataLoaded",r=>{var s;(s=n.onProgress)==null||s.call(n,{loaded:r.length,total:r.length}),this.downloadInfoCapability.resolve(r)}),e.on("StartRenderPage",r=>{if(this.destroyed)return;C(this,nl).get(r.pageIndex)._startRenderPage(r.transparency,r.cacheKey)}),e.on("commonobj",([r,s,i])=>{var a;if(this.destroyed||this.commonObjs.has(r))return null;switch(s){case"Font":const{disableFontFace:o,fontExtraProperties:c,pdfBug:u}=this._params;if("error"in i){const m=i.error;kt(`Error during font loading: ${m}`),this.commonObjs.resolve(r,m);break}const f=u&&((a=globalThis.FontInspector)!=null&&a.enabled)?(m,p)=>globalThis.FontInspector.fontAdded(m,p):null,l=new $Fe(i,{disableFontFace:o,inspectFont:f});this.fontLoader.bind(l).catch(()=>e.sendWithPromise("FontFallback",{id:r})).finally(()=>{!c&&l.data&&(l.data=null),this.commonObjs.resolve(r,l)});break;case"CopyLocalImage":const{imageRef:d}=i;Hr(d,"The imageRef must be defined.");for(const m of C(this,nl).values())for(const[,p]of m.objs)if((p==null?void 0:p.ref)===d)return p.dataLen?(this.commonObjs.resolve(r,structuredClone(p)),p.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(r,i);break;default:throw new Error(`Got unknown common object type ${s}`)}return null}),e.on("obj",([r,s,i,a])=>{var c;if(this.destroyed)return;const o=C(this,nl).get(s);if(!o.objs.has(r)){if(o._intentStates.size===0){(c=a==null?void 0:a.bitmap)==null||c.close();return}switch(i){case"Image":o.objs.resolve(r,a),(a==null?void 0:a.dataLen)>uFe&&(o._maybeCleanupAfterRender=!0);break;case"Pattern":o.objs.resolve(r,a);break;default:throw new Error(`Got unknown object type ${i}`)}}}),e.on("DocProgress",r=>{var s;this.destroyed||(s=n.onProgress)==null||s.call(n,{loaded:r.loaded,total:r.total})}),e.on("FetchBuiltInCMap",r=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(r):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),e.on("FetchStandardFontData",r=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(r):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var r;this.annotationStorage.size<=0&&kt("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:e,transfer:n}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:((r=this._fullReader)==null?void 0:r.filename)??null},n).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const n=e-1,r=C(this,Tg).get(n);if(r)return r;const s=this.messageHandler.sendWithPromise("GetPage",{pageIndex:n}).then(i=>{if(this.destroyed)throw new Error("Transport destroyed");i.refStr&&C(this,kg).set(i.refStr,e);const a=new Ije(n,i,this,this._params.pdfBug);return C(this,nl).set(n,a),a});return C(this,Tg).set(n,s),s}getPageIndex(e){return mU(e)?this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(e,n){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:n})}getFieldObjects(){return B(this,ch,Qy).call(this,"GetFieldObjects")}hasJSActions(){return B(this,ch,Qy).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return typeof e!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return B(this,ch,Qy).call(this,"GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return B(this,ch,Qy).call(this,"GetOptionalContentConfig").then(n=>new rje(n,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",n=C(this,gc).get(e);if(n)return n;const r=this.messageHandler.sendWithPromise(e,null).then(s=>{var i,a;return{info:s[0],metadata:s[1]?new tje(s[1]):null,contentDispositionFilename:((i=this._fullReader)==null?void 0:i.filename)??null,contentLength:((a=this._fullReader)==null?void 0:a.contentLength)??null}});return C(this,gc).set(e,r),r}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const n of C(this,nl).values())if(!n.cleanup())throw new Error(`startCleanup: Page ${n.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),C(this,gc).clear(),this.filterFactory.destroy(!0),V1.cleanup()}}cachedPageNumber(e){if(!mU(e))return null;const n=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;return C(this,kg).get(n)??null}}gc=new WeakMap,nl=new WeakMap,Tg=new WeakMap,kg=new WeakMap,rl=new WeakMap,ch=new WeakSet,Qy=function(e,n=null){const r=C(this,gc).get(e);if(r)return r;const s=this.messageHandler.sendWithPromise(e,n);return C(this,gc).set(e,s),s};const AS=Symbol("INITIAL_DATA");var ca,o0,yM;class CZ{constructor(){z(this,o0);z(this,ca,Object.create(null))}get(e,n=null){if(n){const s=B(this,o0,yM).call(this,e);return s.promise.then(()=>n(s.data)),null}const r=C(this,ca)[e];if(!r||r.data===AS)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return r.data}has(e){const n=C(this,ca)[e];return!!n&&n.data!==AS}resolve(e,n=null){const r=B(this,o0,yM).call(this,e);r.data=n,r.resolve()}clear(){var e;for(const n in C(this,ca)){const{data:r}=C(this,ca)[n];(e=r==null?void 0:r.bitmap)==null||e.close()}$(this,ca,Object.create(null))}*[Symbol.iterator](){for(const e in C(this,ca)){const{data:n}=C(this,ca)[e];n!==AS&&(yield[e,n])}}}ca=new WeakMap,o0=new WeakSet,yM=function(e){var n;return(n=C(this,ca))[e]||(n[e]={...Promise.withResolvers(),data:AS})};var ed;class jje{constructor(e){z(this,ed,null);$(this,ed,e),this.onContinue=null}get promise(){return C(this,ed).capability.promise}cancel(e=0){C(this,ed).cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=C(this,ed).operatorList;if(!e)return!1;const{annotationCanvasMap:n}=C(this,ed);return e.form||e.canvas&&(n==null?void 0:n.size)>0}}ed=new WeakMap;var td,uh;const _f=class _f{constructor({callback:e,params:n,objs:r,commonObjs:s,annotationCanvasMap:i,operatorList:a,pageIndex:o,canvasFactory:c,filterFactory:u,useRequestAnimationFrame:f=!1,pdfBug:l=!1,pageColors:d=null}){z(this,td,null);this.callback=e,this.params=n,this.objs=r,this.commonObjs=s,this.annotationCanvasMap=i,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=c,this.filterFactory=u,this._pdfBug=l,this.pageColors=d,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=f===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new jje(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=n.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:n}){var o,c;if(this.cancelled)return;if(this._canvas){if(C(_f,uh).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");C(_f,uh).add(this._canvas)}this._pdfBug&&((o=globalThis.StepperManager)!=null&&o.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:r,viewport:s,transform:i,background:a}=this.params;this.gfx=new Hm(r,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:n},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:i,viewport:s,transparency:e,background:a}),this.operatorListIdx=0,this.graphicsReady=!0,(c=this.graphicsReadyCallback)==null||c.call(this)}cancel(e=null,n=0){var r;this.running=!1,this.cancelled=!0,(r=this.gfx)==null||r.endDrawing(),C(this,td)&&(window.cancelAnimationFrame(C(this,td)),$(this,td,null)),C(_f,uh).delete(this._canvas),this.callback(e||new q$(`Rendering cancelled, page ${this._pageIndex+1}`,n))}operatorListChanged(){var e;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(e=this.stepper)==null||e.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?$(this,td,window.requestAnimationFrame(()=>{$(this,td,null),this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),C(_f,uh).delete(this._canvas),this.callback())))}};td=new WeakMap,uh=new WeakMap,z(_f,uh,new WeakSet);let bM=_f;const zje="4.4.168",Bje="19fbc8998";function gU(t){return Math.floor(Math.max(0,Math.min(1,t))*255).toString(16).padStart(2,"0")}function Dy(t){return Math.max(0,Math.min(255,255*t))}class vU{static CMYK_G([e,n,r,s]){return["G",1-Math.min(1,.3*e+.59*r+.11*n+s)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_rgb([e]){return e=Dy(e),[e,e,e]}static G_HTML([e]){const n=gU(e);return`#${n}${n}${n}`}static RGB_G([e,n,r]){return["G",.3*e+.59*n+.11*r]}static RGB_rgb(e){return e.map(Dy)}static RGB_HTML(e){return`#${e.map(gU).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,n,r,s]){return["RGB",1-Math.min(1,e+s),1-Math.min(1,r+s),1-Math.min(1,n+s)]}static CMYK_rgb([e,n,r,s]){return[Dy(1-Math.min(1,e+s)),Dy(1-Math.min(1,r+s)),Dy(1-Math.min(1,n+s))]}static CMYK_HTML(e){const n=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(n)}static RGB_CMYK([e,n,r]){const s=1-e,i=1-n,a=1-r,o=Math.min(s,i,a);return["CMYK",s,i,a,o]}}class AZ{static setupStorage(e,n,r,s,i){const a=s.getValue(n,{value:null});switch(r.name){case"textarea":if(a.value!==null&&(e.textContent=a.value),i==="print")break;e.addEventListener("input",o=>{s.setValue(n,{value:o.target.value})});break;case"input":if(r.attributes.type==="radio"||r.attributes.type==="checkbox"){if(a.value===r.attributes.xfaOn?e.setAttribute("checked",!0):a.value===r.attributes.xfaOff&&e.removeAttribute("checked"),i==="print")break;e.addEventListener("change",o=>{s.setValue(n,{value:o.target.checked?o.target.getAttribute("xfaOn"):o.target.getAttribute("xfaOff")})})}else{if(a.value!==null&&e.setAttribute("value",a.value),i==="print")break;e.addEventListener("input",o=>{s.setValue(n,{value:o.target.value})})}break;case"select":if(a.value!==null){e.setAttribute("value",a.value);for(const o of r.children)o.attributes.value===a.value?o.attributes.selected=!0:o.attributes.hasOwnProperty("selected")&&delete o.attributes.selected}e.addEventListener("input",o=>{const c=o.target.options,u=c.selectedIndex===-1?"":c[c.selectedIndex].value;s.setValue(n,{value:u})});break}}static setAttributes({html:e,element:n,storage:r=null,intent:s,linkService:i}){const{attributes:a}=n,o=e instanceof HTMLAnchorElement;a.type==="radio"&&(a.name=`${a.name}-${s}`);for(const[c,u]of Object.entries(a))if(u!=null)switch(c){case"class":u.length&&e.setAttribute(c,u.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",u);break;case"style":Object.assign(e.style,u);break;case"textContent":e.textContent=u;break;default:(!o||c!=="href"&&c!=="newWindow")&&e.setAttribute(c,u)}o&&i.addLinkAttributes(e,a.href,a.newWindow),r&&a.dataId&&this.setupStorage(e,a.dataId,n,r)}static render(e){var l,d;const n=e.annotationStorage,r=e.linkService,s=e.xfaHtml,i=e.intent||"display",a=document.createElement(s.name);s.attributes&&this.setAttributes({html:a,element:s,intent:i,linkService:r});const o=i!=="richText",c=e.div;if(c.append(a),e.viewport){const m=`matrix(${e.viewport.transform.join(",")})`;c.style.transform=m}o&&c.setAttribute("class","xfaLayer xfaFont");const u=[];if(s.children.length===0){if(s.value){const m=document.createTextNode(s.value);a.append(m),o&&dw.shouldBuildText(s.name)&&u.push(m)}return{textDivs:u}}const f=[[s,-1,a]];for(;f.length>0;){const[m,p,h]=f.at(-1);if(p+1===m.children.length){f.pop();continue}const y=m.children[++f.at(-1)[1]];if(y===null)continue;const{name:g}=y;if(g==="#text"){const w=document.createTextNode(y.value);u.push(w),h.append(w);continue}const v=(l=y==null?void 0:y.attributes)!=null&&l.xmlns?document.createElementNS(y.attributes.xmlns,g):document.createElement(g);if(h.append(v),y.attributes&&this.setAttributes({html:v,element:y,storage:n,intent:i,linkService:r}),((d=y.children)==null?void 0:d.length)>0)f.push([y,-1,v]);else if(y.value){const w=document.createTextNode(y.value);o&&dw.shouldBuildText(g)&&u.push(w),v.append(w)}}for(const m of c.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))m.setAttribute("readOnly",!0);return{textDivs:u}}static update(e){const n=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=n,e.div.hidden=!1}}const z_=1e3,Uje=9,op=new WeakSet;function $c(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class Hje{static create(e){switch(e.data.annotationType){case Nr.LINK:return new RZ(e);case Nr.TEXT:return new Wje(e);case Nr.WIDGET:switch(e.data.fieldType){case"Tx":return new Vje(e);case"Btn":return e.data.radioButton?new kZ(e):e.data.checkBox?new Gje(e):new Kje(e);case"Ch":return new Yje(e);case"Sig":return new qje(e)}return new _p(e);case Nr.POPUP:return new _M(e);case Nr.FREETEXT:return new LZ(e);case Nr.LINE:return new Qje(e);case Nr.SQUARE:return new Jje(e);case Nr.CIRCLE:return new Zje(e);case Nr.POLYLINE:return new IZ(e);case Nr.CARET:return new t3e(e);case Nr.INK:return new $Z(e);case Nr.POLYGON:return new e3e(e);case Nr.HIGHLIGHT:return new n3e(e);case Nr.UNDERLINE:return new r3e(e);case Nr.SQUIGGLY:return new s3e(e);case Nr.STRIKEOUT:return new i3e(e);case Nr.STAMP:return new FZ(e);case Nr.FILEATTACHMENT:return new o3e(e);default:return new wr(e)}}}var dh,Dg,Ng,a0,wM;const l2=class l2{constructor(e,{isRenderable:n=!1,ignoreBorder:r=!1,createQuadrilaterals:s=!1}={}){z(this,a0);z(this,dh,null);z(this,Dg,!1);z(this,Ng,null);this.isRenderable=n,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,n&&(this.container=this._createContainer(r)),s&&this._createQuadrilaterals()}static _hasPopupData({titleObj:e,contentsObj:n,richText:r}){return!!(e!=null&&e.str||n!=null&&n.str||r!=null&&r.str)}get hasPopupData(){return l2._hasPopupData(this.data)}updateEdited(e){var r;if(!this.container)return;C(this,dh)||$(this,dh,{rect:this.data.rect.slice(0)});const{rect:n}=e;n&&B(this,a0,wM).call(this,n),(r=C(this,Ng))==null||r.popup.updateEdited(e)}resetEdited(){var e;C(this,dh)&&(B(this,a0,wM).call(this,C(this,dh).rect),(e=C(this,Ng))==null||e.popup.resetEdited(),$(this,dh,null))}_createContainer(e){const{data:n,parent:{page:r,viewport:s}}=this,i=document.createElement("section");i.setAttribute("data-annotation-id",n.id),this instanceof _p||(i.tabIndex=z_);const{style:a}=i;if(a.zIndex=this.parent.zIndex++,n.popupRef&&i.setAttribute("aria-haspopup","dialog"),n.alternativeText&&(i.title=n.alternativeText),n.noRotate&&i.classList.add("norotate"),!n.rect||this instanceof _M){const{rotation:h}=n;return!n.hasOwnCanvas&&h!==0&&this.setRotation(h,i),i}const{width:o,height:c}=$c(n.rect);if(!e&&n.borderStyle.width>0){a.borderWidth=`${n.borderStyle.width}px`;const h=n.borderStyle.horizontalCornerRadius,y=n.borderStyle.verticalCornerRadius;if(h>0||y>0){const v=`calc(${h}px * var(--scale-factor)) / calc(${y}px * var(--scale-factor))`;a.borderRadius=v}else if(this instanceof kZ){const v=`calc(${o}px * var(--scale-factor)) / calc(${c}px * var(--scale-factor))`;a.borderRadius=v}switch(n.borderStyle.style){case Ty.SOLID:a.borderStyle="solid";break;case Ty.DASHED:a.borderStyle="dashed";break;case Ty.BEVELED:kt("Unimplemented border style: beveled");break;case Ty.INSET:kt("Unimplemented border style: inset");break;case Ty.UNDERLINE:a.borderBottomStyle="solid";break}const g=n.borderColor||null;g?($(this,Dg,!0),a.borderColor=et.makeHexColor(g[0]|0,g[1]|0,g[2]|0)):a.borderWidth=0}const u=et.normalizeRect([n.rect[0],r.view[3]-n.rect[1]+r.view[1],n.rect[2],r.view[3]-n.rect[3]+r.view[1]]),{pageWidth:f,pageHeight:l,pageX:d,pageY:m}=s.rawDims;a.left=`${100*(u[0]-d)/f}%`,a.top=`${100*(u[1]-m)/l}%`;const{rotation:p}=n;return n.hasOwnCanvas||p===0?(a.width=`${100*o/f}%`,a.height=`${100*c/l}%`):this.setRotation(p,i),i}setRotation(e,n=this.container){if(!this.data.rect)return;const{pageWidth:r,pageHeight:s}=this.parent.viewport.rawDims,{width:i,height:a}=$c(this.data.rect);let o,c;e%180===0?(o=100*i/r,c=100*a/s):(o=100*a/r,c=100*i/s),n.style.width=`${o}%`,n.style.height=`${c}%`,n.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(n,r,s)=>{const i=s.detail[n],a=i[0],o=i.slice(1);s.target.style[r]=vU[`${a}_HTML`](o),this.annotationStorage.setValue(this.data.id,{[r]:vU[`${a}_rgb`](o)})};return Gt(this,"_commonActions",{display:n=>{const{display:r}=n.detail,s=r%2===1;this.container.style.visibility=s?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:s,noPrint:r===1||r===2})},print:n=>{this.annotationStorage.setValue(this.data.id,{noPrint:!n.detail.print})},hidden:n=>{const{hidden:r}=n.detail;this.container.style.visibility=r?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:r,noView:r})},focus:n=>{setTimeout(()=>n.target.focus({preventScroll:!1}),0)},userName:n=>{n.target.title=n.detail.userName},readonly:n=>{n.target.disabled=n.detail.readonly},required:n=>{this._setRequired(n.target,n.detail.required)},bgColor:n=>{e("bgColor","backgroundColor",n)},fillColor:n=>{e("fillColor","backgroundColor",n)},fgColor:n=>{e("fgColor","color",n)},textColor:n=>{e("textColor","color",n)},borderColor:n=>{e("borderColor","borderColor",n)},strokeColor:n=>{e("strokeColor","borderColor",n)},rotation:n=>{const r=n.detail.rotation;this.setRotation(r),this.annotationStorage.setValue(this.data.id,{rotation:r})}})}_dispatchEventFromSandbox(e,n){const r=this._commonActions;for(const s of Object.keys(n.detail)){const i=e[s]||r[s];i==null||i(n)}}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const n=this.annotationStorage.getRawValue(this.data.id);if(!n)return;const r=this._commonActions;for(const[s,i]of Object.entries(n)){const a=r[s];if(a){const o={detail:{[s]:i},target:e};a(o),delete n[s]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[n,r,s,i]=this.data.rect.map(h=>Math.fround(h));if(e.length===8){const[h,y,g,v]=e.subarray(2,6);if(s===h&&i===y&&n===g&&r===v)return}const{style:a}=this.container;let o;if(C(this,Dg)){const{borderColor:h,borderWidth:y}=a;a.borderWidth=0,o=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${h}" stroke-width="${y}">`],this.container.classList.add("hasBorder")}const c=s-n,u=i-r,{svgFactory:f}=this,l=f.createElement("svg");l.classList.add("quadrilateralsContainer"),l.setAttribute("width",0),l.setAttribute("height",0);const d=f.createElement("defs");l.append(d);const m=f.createElement("clipPath"),p=`clippath_${this.data.id}`;m.setAttribute("id",p),m.setAttribute("clipPathUnits","objectBoundingBox"),d.append(m);for(let h=2,y=e.length;h<y;h+=8){const g=e[h],v=e[h+1],w=e[h+2],x=e[h+3],A=f.createElement("rect"),k=(w-n)/c,R=(i-v)/u,E=(g-w)/c,T=(v-x)/u;A.setAttribute("x",k),A.setAttribute("y",R),A.setAttribute("width",E),A.setAttribute("height",T),m.append(A),o==null||o.push(`<rect vector-effect="non-scaling-stroke" x="${k}" y="${R}" width="${E}" height="${T}"/>`)}C(this,Dg)&&(o.push("</g></svg>')"),a.backgroundImage=o.join("")),this.container.append(l),this.container.style.clipPath=`url(#${p})`}_createPopup(){const{container:e,data:n}=this;e.setAttribute("aria-haspopup","dialog");const r=$(this,Ng,new _M({data:{color:n.color,titleObj:n.titleObj,modificationDate:n.modificationDate,contentsObj:n.contentsObj,richText:n.richText,parentRect:n.rect,borderStyle:0,id:`popup_${n.id}`,rotation:n.rotation},parent:this.parent,elements:[this]}));this.parent.div.append(r.render())}render(){_n("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,n=null){const r=[];if(this._fieldObjects){const s=this._fieldObjects[e];if(s)for(const{page:i,id:a,exportValues:o}of s){if(i===-1||a===n)continue;const c=typeof o=="string"?o:null,u=document.querySelector(`[data-element-id="${a}"]`);if(u&&!op.has(u)){kt(`_getElementsByName - element not allowed: ${a}`);continue}r.push({id:a,exportValue:c,domElement:u})}return r}for(const s of document.getElementsByName(e)){const{exportValue:i}=s,a=s.getAttribute("data-element-id");a!==n&&op.has(s)&&r.push({id:a,exportValue:i,domElement:s})}return r}show(){var e;this.container&&(this.container.hidden=!1),(e=this.popup)==null||e.maybeShow()}hide(){var e;this.container&&(this.container.hidden=!0),(e=this.popup)==null||e.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(const n of e)n.classList.add("highlightArea");else e.classList.add("highlightArea")}get _isEditable(){return!1}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:e,data:{id:n}}=this;this.container.addEventListener("dblclick",()=>{var r;(r=this.linkService.eventBus)==null||r.dispatch("switchannotationeditormode",{source:this,mode:e,editId:n})})}};dh=new WeakMap,Dg=new WeakMap,Ng=new WeakMap,a0=new WeakSet,wM=function(e){const{container:{style:n},data:{rect:r,rotation:s},parent:{viewport:{rawDims:{pageWidth:i,pageHeight:a,pageX:o,pageY:c}}}}=this;r==null||r.splice(0,4,...e);const{width:u,height:f}=$c(e);n.left=`${100*(e[0]-o)/i}%`,n.top=`${100*(a-e[3]+c)/a}%`,s===0?(n.width=`${100*u/i}%`,n.height=`${100*f/a}%`):this.setRotation(s)};let wr=l2;var no,pf,PZ,TZ;class RZ extends wr{constructor(n,r=null){super(n,{isRenderable:!0,ignoreBorder:!!(r!=null&&r.ignoreBorder),createQuadrilaterals:!0});z(this,no);this.isTooltipOnly=n.data.isTooltipOnly}render(){const{data:n,linkService:r}=this,s=document.createElement("a");s.setAttribute("data-element-id",n.id);let i=!1;return n.url?(r.addLinkAttributes(s,n.url,n.newWindow),i=!0):n.action?(this._bindNamedAction(s,n.action),i=!0):n.attachment?(B(this,no,PZ).call(this,s,n.attachment,n.attachmentDest),i=!0):n.setOCGState?(B(this,no,TZ).call(this,s,n.setOCGState),i=!0):n.dest?(this._bindLink(s,n.dest),i=!0):(n.actions&&(n.actions.Action||n.actions["Mouse Up"]||n.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(s,n),i=!0),n.resetForm?(this._bindResetFormAction(s,n.resetForm),i=!0):this.isTooltipOnly&&!i&&(this._bindLink(s,""),i=!0)),this.container.classList.add("linkAnnotation"),i&&this.container.append(s),this.container}_bindLink(n,r){n.href=this.linkService.getDestinationHash(r),n.onclick=()=>(r&&this.linkService.goToDestination(r),!1),(r||r==="")&&B(this,no,pf).call(this)}_bindNamedAction(n,r){n.href=this.linkService.getAnchorUrl(""),n.onclick=()=>(this.linkService.executeNamedAction(r),!1),B(this,no,pf).call(this)}_bindJSAction(n,r){n.href=this.linkService.getAnchorUrl("");const s=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const i of Object.keys(r.actions)){const a=s.get(i);a&&(n[a]=()=>{var o;return(o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r.id,name:i}}),!1})}n.onclick||(n.onclick=()=>!1),B(this,no,pf).call(this)}_bindResetFormAction(n,r){const s=n.onclick;if(s||(n.href=this.linkService.getAnchorUrl("")),B(this,no,pf).call(this),!this._fieldObjects){kt('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),s||(n.onclick=()=>!1);return}n.onclick=()=>{var l;s==null||s();const{fields:i,refs:a,include:o}=r,c=[];if(i.length!==0||a.length!==0){const d=new Set(a);for(const m of i){const p=this._fieldObjects[m]||[];for(const{id:h}of p)d.add(h)}for(const m of Object.values(this._fieldObjects))for(const p of m)d.has(p.id)===o&&c.push(p)}else for(const d of Object.values(this._fieldObjects))c.push(...d);const u=this.annotationStorage,f=[];for(const d of c){const{id:m}=d;switch(f.push(m),d.type){case"text":{const h=d.defaultValue||"";u.setValue(m,{value:h});break}case"checkbox":case"radiobutton":{const h=d.defaultValue===d.exportValues;u.setValue(m,{value:h});break}case"combobox":case"listbox":{const h=d.defaultValue||"";u.setValue(m,{value:h});break}default:continue}const p=document.querySelector(`[data-element-id="${m}"]`);if(p){if(!op.has(p)){kt(`_bindResetFormAction - element not allowed: ${m}`);continue}}else continue;p.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((l=this.linkService.eventBus)==null||l.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:f,name:"ResetForm"}})),!1}}}no=new WeakSet,pf=function(){this.container.setAttribute("data-internal-link","")},PZ=function(n,r,s=null){n.href=this.linkService.getAnchorUrl(""),r.description&&(n.title=r.description),n.onclick=()=>{var i;return(i=this.downloadManager)==null||i.openOrDownloadData(r.content,r.filename,s),!1},B(this,no,pf).call(this)},TZ=function(n,r){n.href=this.linkService.getAnchorUrl(""),n.onclick=()=>(this.linkService.executeSetOCGState(r),!1),B(this,no,pf).call(this)};class Wje extends wr{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),e.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(e),this.container}}class _p extends wr{render(){return this.container}showElementAndHideCanvas(e){var n;this.data.hasOwnCanvas&&(((n=e.previousSibling)==null?void 0:n.nodeName)==="CANVAS"&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return wi.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,n,r,s,i){r.includes("mouse")?e.addEventListener(r,a=>{var o;(o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:i(a),shift:a.shiftKey,modifier:this._getKeyModifier(a)}})}):e.addEventListener(r,a=>{var o;if(r==="blur"){if(!n.focused||!a.relatedTarget)return;n.focused=!1}else if(r==="focus"){if(n.focused)return;n.focused=!0}i&&((o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:i(a)}}))})}_setEventListeners(e,n,r,s){var i,a,o;for(const[c,u]of r)(u==="Action"||(i=this.data.actions)!=null&&i[u])&&((u==="Focus"||u==="Blur")&&(n||(n={focused:!1})),this._setEventListener(e,n,c,u,s),u==="Focus"&&!((a=this.data.actions)!=null&&a.Blur)?this._setEventListener(e,n,"blur","Blur",null):u==="Blur"&&!((o=this.data.actions)!=null&&o.Focus)&&this._setEventListener(e,n,"focus","Focus",null))}_setBackgroundColor(e){const n=this.data.backgroundColor||null;e.style.backgroundColor=n===null?"transparent":et.makeHexColor(n[0],n[1],n[2])}_setTextStyle(e){const n=["left","center","right"],{fontColor:r}=this.data.defaultAppearanceData,s=this.data.defaultAppearanceData.fontSize||Uje,i=e.style;let a;const o=2,c=u=>Math.round(10*u)/10;if(this.data.multiLine){const u=Math.abs(this.data.rect[3]-this.data.rect[1]-o),f=Math.round(u/(lk*s))||1,l=u/f;a=Math.min(s,c(l/lk))}else{const u=Math.abs(this.data.rect[3]-this.data.rect[1]-o);a=Math.min(s,c(u/lk))}i.fontSize=`calc(${a}px * var(--scale-factor))`,i.color=et.makeHexColor(r[0],r[1],r[2]),this.data.textAlignment!==null&&(i.textAlign=n[this.data.textAlignment])}_setRequired(e,n){n?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",n)}}class Vje extends _p{constructor(e){const n=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:n})}setPropertyOnSiblings(e,n,r,s){const i=this.annotationStorage;for(const a of this._getElementsByName(e.name,e.id))a.domElement&&(a.domElement[n]=r),i.setValue(a.id,{[s]:r})}render(){var s,i;const e=this.annotationStorage,n=this.data.id;this.container.classList.add("textWidgetAnnotation");let r=null;if(this.renderForms){const a=e.getValue(n,{value:this.data.fieldValue});let o=a.value||"";const c=e.getValue(n,{charLimit:this.data.maxLen}).charLimit;c&&o.length>c&&(o=o.slice(0,c));let u=a.formattedValue||((s=this.data.textContent)==null?void 0:s.join(`
|
||
`))||null;u&&this.data.comb&&(u=u.replaceAll(/\s+/g,""));const f={userValue:o,formattedValue:u,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(r=document.createElement("textarea"),r.textContent=u??o,this.data.doNotScroll&&(r.style.overflowY="hidden")):(r=document.createElement("input"),r.type="text",r.setAttribute("value",u??o),this.data.doNotScroll&&(r.style.overflowX="hidden")),this.data.hasOwnCanvas&&(r.hidden=!0),op.add(r),r.setAttribute("data-element-id",n),r.disabled=this.data.readOnly,r.name=this.data.fieldName,r.tabIndex=z_,this._setRequired(r,this.data.required),c&&(r.maxLength=c),r.addEventListener("input",d=>{e.setValue(n,{value:d.target.value}),this.setPropertyOnSiblings(r,"value",d.target.value,"value"),f.formattedValue=null}),r.addEventListener("resetform",d=>{const m=this.data.defaultFieldValue??"";r.value=f.userValue=m,f.formattedValue=null});let l=d=>{const{formattedValue:m}=f;m!=null&&(d.target.value=m),d.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){r.addEventListener("focus",m=>{var h;if(f.focused)return;const{target:p}=m;f.userValue&&(p.value=f.userValue),f.lastCommittedValue=p.value,f.commitKey=1,(h=this.data.actions)!=null&&h.Focus||(f.focused=!0)}),r.addEventListener("updatefromsandbox",m=>{this.showElementAndHideCanvas(m.target);const p={value(h){f.userValue=h.detail.value??"",e.setValue(n,{value:f.userValue.toString()}),h.target.value=f.userValue},formattedValue(h){const{formattedValue:y}=h.detail;f.formattedValue=y,y!=null&&h.target!==document.activeElement&&(h.target.value=y),e.setValue(n,{formattedValue:y})},selRange(h){h.target.setSelectionRange(...h.detail.selRange)},charLimit:h=>{var w;const{charLimit:y}=h.detail,{target:g}=h;if(y===0){g.removeAttribute("maxLength");return}g.setAttribute("maxLength",y);let v=f.userValue;!v||v.length<=y||(v=v.slice(0,y),g.value=f.userValue=v,e.setValue(n,{value:v}),(w=this.linkService.eventBus)==null||w.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:v,willCommit:!0,commitKey:1,selStart:g.selectionStart,selEnd:g.selectionEnd}}))}};this._dispatchEventFromSandbox(p,m)}),r.addEventListener("keydown",m=>{var y;f.commitKey=1;let p=-1;if(m.key==="Escape"?p=0:m.key==="Enter"&&!this.data.multiLine?p=2:m.key==="Tab"&&(f.commitKey=3),p===-1)return;const{value:h}=m.target;f.lastCommittedValue!==h&&(f.lastCommittedValue=h,f.userValue=h,(y=this.linkService.eventBus)==null||y.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:h,willCommit:!0,commitKey:p,selStart:m.target.selectionStart,selEnd:m.target.selectionEnd}}))});const d=l;l=null,r.addEventListener("blur",m=>{var h,y;if(!f.focused||!m.relatedTarget)return;(h=this.data.actions)!=null&&h.Blur||(f.focused=!1);const{value:p}=m.target;f.userValue=p,f.lastCommittedValue!==p&&((y=this.linkService.eventBus)==null||y.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:p,willCommit:!0,commitKey:f.commitKey,selStart:m.target.selectionStart,selEnd:m.target.selectionEnd}})),d(m)}),(i=this.data.actions)!=null&&i.Keystroke&&r.addEventListener("beforeinput",m=>{var A;f.lastCommittedValue=null;const{data:p,target:h}=m,{value:y,selectionStart:g,selectionEnd:v}=h;let w=g,x=v;switch(m.inputType){case"deleteWordBackward":{const k=y.substring(0,g).match(/\w*[^\w]*$/);k&&(w-=k[0].length);break}case"deleteWordForward":{const k=y.substring(g).match(/^[^\w]*\w*/);k&&(x+=k[0].length);break}case"deleteContentBackward":g===v&&(w-=1);break;case"deleteContentForward":g===v&&(x+=1);break}m.preventDefault(),(A=this.linkService.eventBus)==null||A.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:y,change:p||"",willCommit:!1,selStart:w,selEnd:x}})}),this._setEventListeners(r,f,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],m=>m.target.value)}if(l&&r.addEventListener("blur",l),this.data.comb){const m=(this.data.rect[2]-this.data.rect[0])/c;r.classList.add("comb"),r.style.letterSpacing=`calc(${m}px * var(--scale-factor) - 1ch)`}}else r=document.createElement("div"),r.textContent=this.data.fieldValue,r.style.verticalAlign="middle",r.style.display="table-cell",this.data.hasOwnCanvas&&(r.hidden=!0);return this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class qje extends _p{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class Gje extends _p{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,n=this.data,r=n.id;let s=e.getValue(r,{value:n.exportValue===n.fieldValue}).value;typeof s=="string"&&(s=s!=="Off",e.setValue(r,{value:s})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const i=document.createElement("input");return op.add(i),i.setAttribute("data-element-id",r),i.disabled=n.readOnly,this._setRequired(i,this.data.required),i.type="checkbox",i.name=n.fieldName,s&&i.setAttribute("checked",!0),i.setAttribute("exportValue",n.exportValue),i.tabIndex=z_,i.addEventListener("change",a=>{const{name:o,checked:c}=a.target;for(const u of this._getElementsByName(o,r)){const f=c&&u.exportValue===n.exportValue;u.domElement&&(u.domElement.checked=f),e.setValue(u.id,{value:f})}e.setValue(r,{value:c})}),i.addEventListener("resetform",a=>{const o=n.defaultFieldValue||"Off";a.target.checked=o===n.exportValue}),this.enableScripting&&this.hasJSActions&&(i.addEventListener("updatefromsandbox",a=>{const o={value(c){c.target.checked=c.detail.value!=="Off",e.setValue(r,{value:c.target.checked})}};this._dispatchEventFromSandbox(o,a)}),this._setEventListeners(i,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],a=>a.target.checked)),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class kZ extends _p{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const e=this.annotationStorage,n=this.data,r=n.id;let s=e.getValue(r,{value:n.fieldValue===n.buttonValue}).value;if(typeof s=="string"&&(s=s!==n.buttonValue,e.setValue(r,{value:s})),s)for(const a of this._getElementsByName(n.fieldName,r))e.setValue(a.id,{value:!1});const i=document.createElement("input");if(op.add(i),i.setAttribute("data-element-id",r),i.disabled=n.readOnly,this._setRequired(i,this.data.required),i.type="radio",i.name=n.fieldName,s&&i.setAttribute("checked",!0),i.tabIndex=z_,i.addEventListener("change",a=>{const{name:o,checked:c}=a.target;for(const u of this._getElementsByName(o,r))e.setValue(u.id,{value:!1});e.setValue(r,{value:c})}),i.addEventListener("resetform",a=>{const o=n.defaultFieldValue;a.target.checked=o!=null&&o===n.buttonValue}),this.enableScripting&&this.hasJSActions){const a=n.buttonValue;i.addEventListener("updatefromsandbox",o=>{const c={value:u=>{const f=a===u.detail.value;for(const l of this._getElementsByName(u.target.name)){const d=f&&l.id===r;l.domElement&&(l.domElement.checked=d),e.setValue(l.id,{value:d})}}};this._dispatchEventFromSandbox(c,o)}),this._setEventListeners(i,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],o=>o.target.checked)}return this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class Kje extends RZ{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton");const n=e.lastChild;return this.enableScripting&&this.hasJSActions&&n&&(this._setDefaultPropertiesFromJS(n),n.addEventListener("updatefromsandbox",r=>{this._dispatchEventFromSandbox({},r)})),e}}class Yje extends _p{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const e=this.annotationStorage,n=this.data.id,r=e.getValue(n,{value:this.data.fieldValue}),s=document.createElement("select");op.add(s),s.setAttribute("data-element-id",n),s.disabled=this.data.readOnly,this._setRequired(s,this.data.required),s.name=this.data.fieldName,s.tabIndex=z_;let i=this.data.combo&&this.data.options.length>0;this.data.combo||(s.size=this.data.options.length,this.data.multiSelect&&(s.multiple=!0)),s.addEventListener("resetform",f=>{const l=this.data.defaultFieldValue;for(const d of s.options)d.selected=d.value===l});for(const f of this.data.options){const l=document.createElement("option");l.textContent=f.displayValue,l.value=f.exportValue,r.value.includes(f.exportValue)&&(l.setAttribute("selected",!0),i=!1),s.append(l)}let a=null;if(i){const f=document.createElement("option");f.value=" ",f.setAttribute("hidden",!0),f.setAttribute("selected",!0),s.prepend(f),a=()=>{f.remove(),s.removeEventListener("input",a),a=null},s.addEventListener("input",a)}const o=f=>{const l=f?"value":"textContent",{options:d,multiple:m}=s;return m?Array.prototype.filter.call(d,p=>p.selected).map(p=>p[l]):d.selectedIndex===-1?null:d[d.selectedIndex][l]};let c=o(!1);const u=f=>{const l=f.target.options;return Array.prototype.map.call(l,d=>({displayValue:d.textContent,exportValue:d.value}))};return this.enableScripting&&this.hasJSActions?(s.addEventListener("updatefromsandbox",f=>{const l={value(d){a==null||a();const m=d.detail.value,p=new Set(Array.isArray(m)?m:[m]);for(const h of s.options)h.selected=p.has(h.value);e.setValue(n,{value:o(!0)}),c=o(!1)},multipleSelection(d){s.multiple=!0},remove(d){const m=s.options,p=d.detail.remove;m[p].selected=!1,s.remove(p),m.length>0&&Array.prototype.findIndex.call(m,y=>y.selected)===-1&&(m[0].selected=!0),e.setValue(n,{value:o(!0),items:u(d)}),c=o(!1)},clear(d){for(;s.length!==0;)s.remove(0);e.setValue(n,{value:null,items:[]}),c=o(!1)},insert(d){const{index:m,displayValue:p,exportValue:h}=d.detail.insert,y=s.children[m],g=document.createElement("option");g.textContent=p,g.value=h,y?y.before(g):s.append(g),e.setValue(n,{value:o(!0),items:u(d)}),c=o(!1)},items(d){const{items:m}=d.detail;for(;s.length!==0;)s.remove(0);for(const p of m){const{displayValue:h,exportValue:y}=p,g=document.createElement("option");g.textContent=h,g.value=y,s.append(g)}s.options.length>0&&(s.options[0].selected=!0),e.setValue(n,{value:o(!0),items:u(d)}),c=o(!1)},indices(d){const m=new Set(d.detail.indices);for(const p of d.target.options)p.selected=m.has(p.index);e.setValue(n,{value:o(!0)}),c=o(!1)},editable(d){d.target.disabled=!d.detail.editable}};this._dispatchEventFromSandbox(l,f)}),s.addEventListener("input",f=>{var m;const l=o(!0),d=o(!1);e.setValue(n,{value:l}),f.preventDefault(),(m=this.linkService.eventBus)==null||m.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:c,change:d,changeEx:l,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(s,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],f=>f.target.value)):s.addEventListener("input",function(f){e.setValue(n,{value:o(!0)})}),this.data.combo&&this._setTextStyle(s),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class _M extends wr{constructor(e){const{data:n,elements:r}=e;super(e,{isRenderable:wr._hasPopupData(n)}),this.elements=r,this.popup=null}render(){this.container.classList.add("popupAnnotation");const e=this.popup=new Xje({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),n=[];for(const r of this.elements)r.popup=e,n.push(r.data.id),r.addHighlightArea();return this.container.setAttribute("aria-controls",n.map(r=>`${DJ}${r}`).join(",")),this.container}}var Mg,hC,pC,Og,fh,cr,vc,hh,l0,c0,Lg,yc,ua,bc,u0,wc,d0,ph,mh,xn,lE,xM,DZ,NZ,MZ,OZ,cE,uE,SM;class Xje{constructor({container:e,color:n,elements:r,titleObj:s,modificationDate:i,contentsObj:a,richText:o,parent:c,rect:u,parentRect:f,open:l}){z(this,xn);z(this,Mg,B(this,xn,MZ).bind(this));z(this,hC,B(this,xn,SM).bind(this));z(this,pC,B(this,xn,uE).bind(this));z(this,Og,B(this,xn,cE).bind(this));z(this,fh,null);z(this,cr,null);z(this,vc,null);z(this,hh,null);z(this,l0,null);z(this,c0,null);z(this,Lg,null);z(this,yc,!1);z(this,ua,null);z(this,bc,null);z(this,u0,null);z(this,wc,null);z(this,d0,null);z(this,ph,null);z(this,mh,!1);var d;$(this,cr,e),$(this,d0,s),$(this,vc,a),$(this,wc,o),$(this,c0,c),$(this,fh,n),$(this,u0,u),$(this,Lg,f),$(this,l0,r),$(this,hh,IJ.toDateObject(i)),this.trigger=r.flatMap(m=>m.getElementsToTriggerPopup());for(const m of this.trigger)m.addEventListener("click",C(this,Og)),m.addEventListener("mouseenter",C(this,pC)),m.addEventListener("mouseleave",C(this,hC)),m.classList.add("popupTriggerArea");for(const m of r)(d=m.container)==null||d.addEventListener("keydown",C(this,Mg));C(this,cr).hidden=!0,l&&B(this,xn,cE).call(this)}render(){if(C(this,ua))return;const e=$(this,ua,document.createElement("div"));if(e.className="popup",C(this,fh)){const i=e.style.outlineColor=et.makeHexColor(...C(this,fh));CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?e.style.backgroundColor=`color-mix(in srgb, ${i} 30%, white)`:e.style.backgroundColor=et.makeHexColor(...C(this,fh).map(o=>Math.floor(.7*(255-o)+o)))}const n=document.createElement("span");n.className="header";const r=document.createElement("h1");if(n.append(r),{dir:r.dir,str:r.textContent}=C(this,d0),e.append(n),C(this,hh)){const i=document.createElement("span");i.classList.add("popupDate"),i.setAttribute("data-l10n-id","pdfjs-annotation-date-string"),i.setAttribute("data-l10n-args",JSON.stringify({date:C(this,hh).toLocaleDateString(),time:C(this,hh).toLocaleTimeString()})),n.append(i)}const s=C(this,xn,lE);if(s)AZ.render({xfaHtml:s,intent:"richText",div:e}),e.lastChild.classList.add("richText","popupContent");else{const i=this._formatContents(C(this,vc));e.append(i)}C(this,cr).append(e)}_formatContents({str:e,dir:n}){const r=document.createElement("p");r.classList.add("popupContent"),r.dir=n;const s=e.split(/(?:\r\n?|\n)/);for(let i=0,a=s.length;i<a;++i){const o=s[i];r.append(document.createTextNode(o)),i<a-1&&r.append(document.createElement("br"))}return r}updateEdited({rect:e,popupContent:n}){var r;C(this,ph)||$(this,ph,{contentsObj:C(this,vc),richText:C(this,wc)}),e&&$(this,bc,null),n&&($(this,wc,B(this,xn,NZ).call(this,n)),$(this,vc,null)),(r=C(this,ua))==null||r.remove(),$(this,ua,null)}resetEdited(){var e;C(this,ph)&&({contentsObj:bs(this,vc)._,richText:bs(this,wc)._}=C(this,ph),$(this,ph,null),(e=C(this,ua))==null||e.remove(),$(this,ua,null),$(this,bc,null))}forceHide(){$(this,mh,this.isVisible),C(this,mh)&&(C(this,cr).hidden=!0)}maybeShow(){C(this,mh)&&(C(this,ua)||B(this,xn,uE).call(this),$(this,mh,!1),C(this,cr).hidden=!1)}get isVisible(){return C(this,cr).hidden===!1}}Mg=new WeakMap,hC=new WeakMap,pC=new WeakMap,Og=new WeakMap,fh=new WeakMap,cr=new WeakMap,vc=new WeakMap,hh=new WeakMap,l0=new WeakMap,c0=new WeakMap,Lg=new WeakMap,yc=new WeakMap,ua=new WeakMap,bc=new WeakMap,u0=new WeakMap,wc=new WeakMap,d0=new WeakMap,ph=new WeakMap,mh=new WeakMap,xn=new WeakSet,lE=function(){const e=C(this,wc),n=C(this,vc);return e!=null&&e.str&&(!(n!=null&&n.str)||n.str===e.str)&&C(this,wc).html||null},xM=function(){var e,n,r;return((r=(n=(e=C(this,xn,lE))==null?void 0:e.attributes)==null?void 0:n.style)==null?void 0:r.fontSize)||0},DZ=function(){var e,n,r;return((r=(n=(e=C(this,xn,lE))==null?void 0:e.attributes)==null?void 0:n.style)==null?void 0:r.color)||null},NZ=function(e){const n=[],r={str:e,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:n}]}},s={style:{color:C(this,xn,DZ),fontSize:C(this,xn,xM)?`calc(${C(this,xn,xM)}px * var(--scale-factor))`:""}};for(const i of e.split(`
|
||
`))n.push({name:"span",value:i,attributes:s});return r},MZ=function(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key==="Enter"||e.key==="Escape"&&C(this,yc))&&B(this,xn,cE).call(this)},OZ=function(){if(C(this,bc)!==null)return;const{page:{view:e},viewport:{rawDims:{pageWidth:n,pageHeight:r,pageX:s,pageY:i}}}=C(this,c0);let a=!!C(this,Lg),o=a?C(this,Lg):C(this,u0);for(const p of C(this,l0))if(!o||et.intersect(p.data.rect,o)!==null){o=p.data.rect,a=!0;break}const c=et.normalizeRect([o[0],e[3]-o[1]+e[1],o[2],e[3]-o[3]+e[1]]),f=a?o[2]-o[0]+5:0,l=c[0]+f,d=c[1];$(this,bc,[100*(l-s)/n,100*(d-i)/r]);const{style:m}=C(this,cr);m.left=`${C(this,bc)[0]}%`,m.top=`${C(this,bc)[1]}%`},cE=function(){$(this,yc,!C(this,yc)),C(this,yc)?(B(this,xn,uE).call(this),C(this,cr).addEventListener("click",C(this,Og)),C(this,cr).addEventListener("keydown",C(this,Mg))):(B(this,xn,SM).call(this),C(this,cr).removeEventListener("click",C(this,Og)),C(this,cr).removeEventListener("keydown",C(this,Mg)))},uE=function(){C(this,ua)||this.render(),this.isVisible?C(this,yc)&&C(this,cr).classList.add("focused"):(B(this,xn,OZ).call(this),C(this,cr).hidden=!1,C(this,cr).style.zIndex=parseInt(C(this,cr).style.zIndex)+1e3)},SM=function(){C(this,cr).classList.remove("focused"),!(C(this,yc)||!this.isVisible)&&(C(this,cr).hidden=!0,C(this,cr).style.zIndex=parseInt(C(this,cr).style.zIndex)-1e3)};class LZ extends wr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=Vt.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const e=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(const n of this.textContent){const r=document.createElement("span");r.textContent=n,e.append(r)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}get _isEditable(){return this.data.hasOwnCanvas}}var f0;class Qje extends wr{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0});z(this,f0,null)}render(){this.container.classList.add("lineAnnotation");const n=this.data,{width:r,height:s}=$c(n.rect),i=this.svgFactory.create(r,s,!0),a=$(this,f0,this.svgFactory.createElement("svg:line"));return a.setAttribute("x1",n.rect[2]-n.lineCoordinates[0]),a.setAttribute("y1",n.rect[3]-n.lineCoordinates[1]),a.setAttribute("x2",n.rect[2]-n.lineCoordinates[2]),a.setAttribute("y2",n.rect[3]-n.lineCoordinates[3]),a.setAttribute("stroke-width",n.borderStyle.width||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),i.append(a),this.container.append(i),!n.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return C(this,f0)}addHighlightArea(){this.container.classList.add("highlightArea")}}f0=new WeakMap;var h0;class Jje extends wr{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0});z(this,h0,null)}render(){this.container.classList.add("squareAnnotation");const n=this.data,{width:r,height:s}=$c(n.rect),i=this.svgFactory.create(r,s,!0),a=n.borderStyle.width,o=$(this,h0,this.svgFactory.createElement("svg:rect"));return o.setAttribute("x",a/2),o.setAttribute("y",a/2),o.setAttribute("width",r-a),o.setAttribute("height",s-a),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),i.append(o),this.container.append(i),!n.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return C(this,h0)}addHighlightArea(){this.container.classList.add("highlightArea")}}h0=new WeakMap;var p0;class Zje extends wr{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0});z(this,p0,null)}render(){this.container.classList.add("circleAnnotation");const n=this.data,{width:r,height:s}=$c(n.rect),i=this.svgFactory.create(r,s,!0),a=n.borderStyle.width,o=$(this,p0,this.svgFactory.createElement("svg:ellipse"));return o.setAttribute("cx",r/2),o.setAttribute("cy",s/2),o.setAttribute("rx",r/2-a/2),o.setAttribute("ry",s/2-a/2),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),i.append(o),this.container.append(i),!n.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return C(this,p0)}addHighlightArea(){this.container.classList.add("highlightArea")}}p0=new WeakMap;var m0;class IZ extends wr{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0});z(this,m0,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:n,vertices:r,borderStyle:s,popupRef:i}}=this;if(!r)return this.container;const{width:a,height:o}=$c(n),c=this.svgFactory.create(a,o,!0);let u=[];for(let l=0,d=r.length;l<d;l+=2){const m=r[l]-n[0],p=n[3]-r[l+1];u.push(`${m},${p}`)}u=u.join(" ");const f=$(this,m0,this.svgFactory.createElement(this.svgElementName));return f.setAttribute("points",u),f.setAttribute("stroke-width",s.width||1),f.setAttribute("stroke","transparent"),f.setAttribute("fill","transparent"),c.append(f),this.container.append(c),!i&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return C(this,m0)}addHighlightArea(){this.container.classList.add("highlightArea")}}m0=new WeakMap;class e3e extends IZ{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class t3e extends wr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}var g0;class $Z extends wr{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0});z(this,g0,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=Vt.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:n,inkLists:r,borderStyle:s,popupRef:i}}=this,{width:a,height:o}=$c(n),c=this.svgFactory.create(a,o,!0);for(const u of r){let f=[];for(let d=0,m=u.length;d<m;d+=2){const p=u[d]-n[0],h=n[3]-u[d+1];f.push(`${p},${h}`)}f=f.join(" ");const l=this.svgFactory.createElement(this.svgElementName);C(this,g0).push(l),l.setAttribute("points",f),l.setAttribute("stroke-width",s.width||1),l.setAttribute("stroke","transparent"),l.setAttribute("fill","transparent"),!i&&this.hasPopupData&&this._createPopup(),c.append(l)}return this.container.append(c),this.container}getElementsToTriggerPopup(){return C(this,g0)}addHighlightArea(){this.container.classList.add("highlightArea")}}g0=new WeakMap;class n3e extends wr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class r3e extends wr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class s3e extends wr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class i3e extends wr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class FZ extends wr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}var v0,y0,EM;class o3e extends wr{constructor(n){var s;super(n,{isRenderable:!0});z(this,y0);z(this,v0,null);const{file:r}=this.data;this.filename=r.filename,this.content=r.content,(s=this.linkService.eventBus)==null||s.dispatch("fileattachmentannotation",{source:this,...r})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:n,data:r}=this;let s;r.hasAppearance||r.fillAlpha===0?s=document.createElement("div"):(s=document.createElement("img"),s.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(r.name)?"paperclip":"pushpin"}.svg`,r.fillAlpha&&r.fillAlpha<1&&(s.style=`filter: opacity(${Math.round(r.fillAlpha*100)}%);`)),s.addEventListener("dblclick",B(this,y0,EM).bind(this)),$(this,v0,s);const{isMac:i}=wi.platform;return n.addEventListener("keydown",a=>{a.key==="Enter"&&(i?a.metaKey:a.ctrlKey)&&B(this,y0,EM).call(this)}),!r.popupRef&&this.hasPopupData?this._createPopup():s.classList.add("popupTriggerArea"),n.append(s),n}getElementsToTriggerPopup(){return C(this,v0)}addHighlightArea(){this.container.classList.add("highlightArea")}}v0=new WeakMap,y0=new WeakSet,EM=function(){var n;(n=this.downloadManager)==null||n.openOrDownloadData(this.content,this.filename)};var b0,gh,Ig,cp,jZ,CM,pH;let a3e=(pH=class{constructor({div:e,accessibilityManager:n,annotationCanvasMap:r,annotationEditorUIManager:s,page:i,viewport:a}){z(this,cp);z(this,b0,null);z(this,gh,null);z(this,Ig,new Map);this.div=e,$(this,b0,n),$(this,gh,r),this.page=i,this.viewport=a,this.zIndex=0,this._annotationEditorUIManager=s}async render(e){var a;const{annotations:n}=e,r=this.div;sp(r,this.viewport);const s=new Map,i={data:null,layer:r,linkService:e.linkService,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:e.renderForms!==!1,svgFactory:new V$,annotationStorage:e.annotationStorage||new X$,enableScripting:e.enableScripting===!0,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(const o of n){if(o.noHTML)continue;const c=o.annotationType===Nr.POPUP;if(c){const l=s.get(o.id);if(!l)continue;i.elements=l}else{const{width:l,height:d}=$c(o.rect);if(l<=0||d<=0)continue}i.data=o;const u=Hje.create(i);if(!u.isRenderable)continue;if(!c&&o.popupRef){const l=s.get(o.popupRef);l?l.push(u):s.set(o.popupRef,[u])}const f=u.render();o.hidden&&(f.style.visibility="hidden"),B(this,cp,jZ).call(this,f,o.id),u.annotationEditorType>0&&(C(this,Ig).set(u.data.id,u),(a=this._annotationEditorUIManager)==null||a.renderAnnotationElement(u))}B(this,cp,CM).call(this)}update({viewport:e}){const n=this.div;this.viewport=e,sp(n,{rotation:e.rotation}),B(this,cp,CM).call(this),n.hidden=!1}getEditableAnnotations(){return Array.from(C(this,Ig).values())}getEditableAnnotation(e){return C(this,Ig).get(e)}},b0=new WeakMap,gh=new WeakMap,Ig=new WeakMap,cp=new WeakSet,jZ=function(e,n){var s;const r=e.firstChild||e;r.id=`${DJ}${n}`,this.div.append(e),(s=C(this,b0))==null||s.moveElementInDOM(this.div,e,r,!1)},CM=function(){if(!C(this,gh))return;const e=this.div;for(const[n,r]of C(this,gh)){const s=e.querySelector(`[data-annotation-id="${n}"]`);if(!s)continue;r.className="annotationContent";const{firstChild:i}=s;i?i.nodeName==="CANVAS"?i.replaceWith(r):i.classList.contains("annotationContent")?i.after(r):i.before(r):s.append(r)}C(this,gh).clear()},pH);const RS=/\r\n?|\n/g;var w0,_0,x0,S0,E0,da,qi,C0,Gi,$g,Pr,zZ,BZ,UZ,dE,zc,fE,hE,HZ,RM,WZ;const Mn=class Mn extends pn{constructor(n){super({...n,name:"freeTextEditor"});z(this,Pr);z(this,w0,this.editorDivBlur.bind(this));z(this,_0,this.editorDivFocus.bind(this));z(this,x0,this.editorDivInput.bind(this));z(this,S0,this.editorDivKeydown.bind(this));z(this,E0,this.editorDivPaste.bind(this));z(this,da);z(this,qi,"");z(this,C0,`${this.id}-editor`);z(this,Gi);z(this,$g,null);$(this,da,n.color||Mn._defaultColor||pn._defaultLineColor),$(this,Gi,n.fontSize||Mn._defaultFontSize)}static get _keyboardManager(){const n=Mn.prototype,r=a=>a.isEmpty(),s=ip.TRANSLATE_SMALL,i=ip.TRANSLATE_BIG;return Gt(this,"_keyboardManager",new F_([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],n.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],n.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],n._translateEmpty,{args:[-s,0],checker:r}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],n._translateEmpty,{args:[-i,0],checker:r}],[["ArrowRight","mac+ArrowRight"],n._translateEmpty,{args:[s,0],checker:r}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],n._translateEmpty,{args:[i,0],checker:r}],[["ArrowUp","mac+ArrowUp"],n._translateEmpty,{args:[0,-s],checker:r}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],n._translateEmpty,{args:[0,-i],checker:r}],[["ArrowDown","mac+ArrowDown"],n._translateEmpty,{args:[0,s],checker:r}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],n._translateEmpty,{args:[0,i],checker:r}]]))}static initialize(n,r){pn.initialize(n,r,{strings:["pdfjs-free-text-default-content"]});const s=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(s.getPropertyValue("--freetext-padding"))}static updateDefaultParams(n,r){switch(n){case pt.FREETEXT_SIZE:Mn._defaultFontSize=r;break;case pt.FREETEXT_COLOR:Mn._defaultColor=r;break}}updateParams(n,r){switch(n){case pt.FREETEXT_SIZE:B(this,Pr,zZ).call(this,r);break;case pt.FREETEXT_COLOR:B(this,Pr,BZ).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[pt.FREETEXT_SIZE,Mn._defaultFontSize],[pt.FREETEXT_COLOR,Mn._defaultColor||pn._defaultLineColor]]}get propertiesToUpdate(){return[[pt.FREETEXT_SIZE,C(this,Gi)],[pt.FREETEXT_COLOR,C(this,da)]]}_translateEmpty(n,r){this._uiManager.translateSelectedEditors(n,r,!0)}getInitialTranslation(){const n=this.parentScale;return[-Mn._internalPadding*n,-(Mn._internalPadding+C(this,Gi))*n]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(this.isInEditMode())return;this.parent.setEditingState(!1),this.parent.updateToolbar(Vt.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant");const n=this._uiManager._signal;this.editorDiv.addEventListener("keydown",C(this,S0),{signal:n}),this.editorDiv.addEventListener("focus",C(this,_0),{signal:n}),this.editorDiv.addEventListener("blur",C(this,w0),{signal:n}),this.editorDiv.addEventListener("input",C(this,x0),{signal:n}),this.editorDiv.addEventListener("paste",C(this,E0),{signal:n})}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",C(this,C0)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",C(this,S0)),this.editorDiv.removeEventListener("focus",C(this,_0)),this.editorDiv.removeEventListener("blur",C(this,w0)),this.editorDiv.removeEventListener("input",C(this,x0)),this.editorDiv.removeEventListener("paste",C(this,E0)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(n){this._focusEventsAllowed&&(super.focusin(n),n.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){var n;this.width||(this.enableEditMode(),this.editorDiv.focus(),(n=this._initialOptions)!=null&&n.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const n=C(this,qi),r=$(this,qi,B(this,Pr,UZ).call(this).trimEnd());if(n===r)return;const s=i=>{if($(this,qi,i),!i){this.remove();return}B(this,Pr,hE).call(this),this._uiManager.rebuild(this),B(this,Pr,dE).call(this)};this.addCommands({cmd:()=>{s(r)},undo:()=>{s(n)},mustExec:!1}),B(this,Pr,dE).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(n){this.enterInEditMode()}keydown(n){n.target===this.div&&n.key==="Enter"&&(this.enterInEditMode(),n.preventDefault())}editorDivKeydown(n){Mn._keyboardManager.exec(this,n)}editorDivFocus(n){this.isEditing=!0}editorDivBlur(n){this.isEditing=!1}editorDivInput(n){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let n,r;this.width&&(n=this.x,r=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",C(this,C0)),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text"),this.enableEditing(),pn._l10nPromise.get("pdfjs-free-text-default-content").then(i=>{var a;return(a=this.editorDiv)==null?void 0:a.setAttribute("default-content",i)}),this.editorDiv.contentEditable=!0;const{style:s}=this.editorDiv;if(s.fontSize=`calc(${C(this,Gi)}px * var(--scale-factor))`,s.color=C(this,da),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),U1(this,this.div,["dblclick","keydown"]),this.width){const[i,a]=this.parentDimensions;if(this.annotationElementId){const{position:o}=C(this,$g);let[c,u]=this.getInitialTranslation();[c,u]=this.pageTranslationToScreen(c,u);const[f,l]=this.pageDimensions,[d,m]=this.pageTranslation;let p,h;switch(this.rotation){case 0:p=n+(o[0]-d)/f,h=r+this.height-(o[1]-m)/l;break;case 90:p=n+(o[0]-d)/f,h=r-(o[1]-m)/l,[c,u]=[u,-c];break;case 180:p=n-this.width+(o[0]-d)/f,h=r-(o[1]-m)/l,[c,u]=[-c,-u];break;case 270:p=n+(o[0]-d-this.height*l)/f,h=r+(o[1]-m-this.width*f)/l,[c,u]=[-u,c];break}this.setAt(p*i,h*a,c,u)}else this.setAt(n*i,r*a,this.width*i,this.height*a);B(this,Pr,hE).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(n){var p,h,y;const r=n.clipboardData||window.clipboardData,{types:s}=r;if(s.length===1&&s[0]==="text/plain")return;n.preventDefault();const i=B(p=Mn,zc,RM).call(p,r.getData("text")||"").replaceAll(RS,`
|
||
`);if(!i)return;const a=window.getSelection();if(!a.rangeCount)return;this.editorDiv.normalize(),a.deleteFromDocument();const o=a.getRangeAt(0);if(!i.includes(`
|
||
`)){o.insertNode(document.createTextNode(i)),this.editorDiv.normalize(),a.collapseToStart();return}const{startContainer:c,startOffset:u}=o,f=[],l=[];if(c.nodeType===Node.TEXT_NODE){const g=c.parentElement;if(l.push(c.nodeValue.slice(u).replaceAll(RS,"")),g!==this.editorDiv){let v=f;for(const w of this.editorDiv.childNodes){if(w===g){v=l;continue}v.push(B(h=Mn,zc,fE).call(h,w))}}f.push(c.nodeValue.slice(0,u).replaceAll(RS,""))}else if(c===this.editorDiv){let g=f,v=0;for(const w of this.editorDiv.childNodes)v++===u&&(g=l),g.push(B(y=Mn,zc,fE).call(y,w))}$(this,qi,`${f.join(`
|
||
`)}${i}${l.join(`
|
||
`)}`),B(this,Pr,hE).call(this);const d=new Range;let m=f.reduce((g,v)=>g+v.length,0);for(const{firstChild:g}of this.editorDiv.childNodes)if(g.nodeType===Node.TEXT_NODE){const v=g.nodeValue.length;if(m<=v){d.setStart(g,m),d.setEnd(g,m);break}m-=v}a.removeAllRanges(),a.addRange(d)}get contentDiv(){return this.editorDiv}static deserialize(n,r,s){var o;let i=null;if(n instanceof LZ){const{data:{defaultAppearanceData:{fontSize:c,fontColor:u},rect:f,rotation:l,id:d},textContent:m,textPosition:p,parent:{page:{pageNumber:h}}}=n;if(!m||m.length===0)return null;i=n={annotationType:Vt.FREETEXT,color:Array.from(u),fontSize:c,value:m.join(`
|
||
`),position:p,pageIndex:h-1,rect:f.slice(0),rotation:l,id:d,deleted:!1}}const a=super.deserialize(n,r,s);return $(a,Gi,n.fontSize),$(a,da,et.makeHexColor(...n.color)),$(a,qi,B(o=Mn,zc,RM).call(o,n.value)),a.annotationElementId=n.id||null,$(a,$g,i),a}serialize(n=!1){if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const r=Mn._internalPadding*this.parentScale,s=this.getRect(r,r),i=pn._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:C(this,da)),a={annotationType:Vt.FREETEXT,color:i,fontSize:C(this,Gi),value:B(this,Pr,HZ).call(this),pageIndex:this.pageIndex,rect:s,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return n?a:this.annotationElementId&&!B(this,Pr,WZ).call(this,a)?null:(a.id=this.annotationElementId,a)}renderAnnotationElement(n){const r=super.renderAnnotationElement(n);if(this.deleted)return r;const{style:s}=r;s.fontSize=`calc(${C(this,Gi)}px * var(--scale-factor))`,s.color=C(this,da),r.replaceChildren();for(const a of C(this,qi).split(`
|
||
`)){const o=document.createElement("div");o.append(a?document.createTextNode(a):document.createElement("br")),r.append(o)}const i=Mn._internalPadding*this.parentScale;return n.updateEdited({rect:this.getRect(i,i),popupContent:C(this,qi)}),r}resetAnnotationElement(n){super.resetAnnotationElement(n),n.resetEdited()}};w0=new WeakMap,_0=new WeakMap,x0=new WeakMap,S0=new WeakMap,E0=new WeakMap,da=new WeakMap,qi=new WeakMap,C0=new WeakMap,Gi=new WeakMap,$g=new WeakMap,Pr=new WeakSet,zZ=function(n){const r=i=>{this.editorDiv.style.fontSize=`calc(${i}px * var(--scale-factor))`,this.translate(0,-(i-C(this,Gi))*this.parentScale),$(this,Gi,i),B(this,Pr,dE).call(this)},s=C(this,Gi);this.addCommands({cmd:r.bind(this,n),undo:r.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:pt.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},BZ=function(n){const r=i=>{$(this,da,this.editorDiv.style.color=i)},s=C(this,da);this.addCommands({cmd:r.bind(this,n),undo:r.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:pt.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},UZ=function(){var r;const n=[];this.editorDiv.normalize();for(const s of this.editorDiv.childNodes)n.push(B(r=Mn,zc,fE).call(r,s));return n.join(`
|
||
`)},dE=function(){const[n,r]=this.parentDimensions;let s;if(this.isAttachedToDOM)s=this.div.getBoundingClientRect();else{const{currentLayer:i,div:a}=this,o=a.style.display,c=a.classList.contains("hidden");a.classList.remove("hidden"),a.style.display="hidden",i.div.append(this.div),s=a.getBoundingClientRect(),a.remove(),a.style.display=o,a.classList.toggle("hidden",c)}this.rotation%180===this.parentRotation%180?(this.width=s.width/n,this.height=s.height/r):(this.width=s.height/n,this.height=s.width/r),this.fixAndSetPosition()},zc=new WeakSet,fE=function(n){return(n.nodeType===Node.TEXT_NODE?n.nodeValue:n.innerText).replaceAll(RS,"")},hE=function(){if(this.editorDiv.replaceChildren(),!!C(this,qi))for(const n of C(this,qi).split(`
|
||
`)){const r=document.createElement("div");r.append(n?document.createTextNode(n):document.createElement("br")),this.editorDiv.append(r)}},HZ=function(){return C(this,qi).replaceAll(" "," ")},RM=function(n){return n.replaceAll(" "," ")},WZ=function(n){const{value:r,fontSize:s,color:i,pageIndex:a}=C(this,$g);return this._hasBeenMoved||n.value!==r||n.fontSize!==s||n.color.some((o,c)=>o!==i[c])||n.pageIndex!==a},z(Mn,zc),He(Mn,"_freeTextDefaultContent",""),He(Mn,"_internalPadding",0),He(Mn,"_defaultColor",null),He(Mn,"_defaultFontSize",10),He(Mn,"_type","freetext"),He(Mn,"_editorType",Vt.FREETEXT);let AM=Mn;var A0,nd,fa,Js,VZ,pE,qZ,GZ,TM;class PM{constructor(e,n=0,r=0,s=!0){z(this,Js);z(this,A0);z(this,nd,[]);z(this,fa,[]);let i=1/0,a=-1/0,o=1/0,c=-1/0;const u=10**-4;for(const{x:y,y:g,width:v,height:w}of e){const x=Math.floor((y-n)/u)*u,A=Math.ceil((y+v+n)/u)*u,k=Math.floor((g-n)/u)*u,R=Math.ceil((g+w+n)/u)*u,E=[x,k,R,!0],T=[A,k,R,!1];C(this,nd).push(E,T),i=Math.min(i,x),a=Math.max(a,A),o=Math.min(o,k),c=Math.max(c,R)}const f=a-i+2*r,l=c-o+2*r,d=i-r,m=o-r,p=C(this,nd).at(s?-1:-2),h=[p[0],p[2]];for(const y of C(this,nd)){const[g,v,w]=y;y[0]=(g-d)/f,y[1]=(v-m)/l,y[2]=(w-m)/l}$(this,A0,{x:d,y:m,width:f,height:l,lastPoint:h})}getOutlines(){C(this,nd).sort((n,r)=>n[0]-r[0]||n[1]-r[1]||n[2]-r[2]);const e=[];for(const n of C(this,nd))n[3]?(e.push(...B(this,Js,TM).call(this,n)),B(this,Js,qZ).call(this,n)):(B(this,Js,GZ).call(this,n),e.push(...B(this,Js,TM).call(this,n)));return B(this,Js,VZ).call(this,e)}}A0=new WeakMap,nd=new WeakMap,fa=new WeakMap,Js=new WeakSet,VZ=function(e){const n=[],r=new Set;for(const a of e){const[o,c,u]=a;n.push([o,c,a],[o,u,a])}n.sort((a,o)=>a[1]-o[1]||a[0]-o[0]);for(let a=0,o=n.length;a<o;a+=2){const c=n[a][2],u=n[a+1][2];c.push(u),u.push(c),r.add(c),r.add(u)}const s=[];let i;for(;r.size>0;){const a=r.values().next().value;let[o,c,u,f,l]=a;r.delete(a);let d=o,m=c;for(i=[o,u],s.push(i);;){let p;if(r.has(f))p=f;else if(r.has(l))p=l;else break;r.delete(p),[o,c,u,f,l]=p,d!==o&&(i.push(d,m,o,m===c?c:u),d=o),m=m===c?u:c}i.push(d,m)}return new l3e(s,C(this,A0))},pE=function(e){const n=C(this,fa);let r=0,s=n.length-1;for(;r<=s;){const i=r+s>>1,a=n[i][0];if(a===e)return i;a<e?r=i+1:s=i-1}return s+1},qZ=function([,e,n]){const r=B(this,Js,pE).call(this,e);C(this,fa).splice(r,0,[e,n])},GZ=function([,e,n]){const r=B(this,Js,pE).call(this,e);for(let s=r;s<C(this,fa).length;s++){const[i,a]=C(this,fa)[s];if(i!==e)break;if(i===e&&a===n){C(this,fa).splice(s,1);return}}for(let s=r-1;s>=0;s--){const[i,a]=C(this,fa)[s];if(i!==e)break;if(i===e&&a===n){C(this,fa).splice(s,1);return}}},TM=function(e){const[n,r,s]=e,i=[[n,r,s]],a=B(this,Js,pE).call(this,s);for(let o=0;o<a;o++){const[c,u]=C(this,fa)[o];for(let f=0,l=i.length;f<l;f++){const[,d,m]=i[f];if(!(u<=d||m<=c)){if(d>=c){if(m>u)i[f][1]=u;else{if(l===1)return[];i.splice(f,1),f--,l--}continue}i[f][2]=c,m>u&&i.push([n,u,m])}}}return i};class KZ{toSVGPath(){throw new Error("Abstract method `toSVGPath` must be implemented.")}get box(){throw new Error("Abstract getter `box` must be implemented.")}serialize(e,n){throw new Error("Abstract method `serialize` must be implemented.")}get free(){return this instanceof DM}}var R0,Fg;class l3e extends KZ{constructor(n,r){super();z(this,R0);z(this,Fg);$(this,Fg,n),$(this,R0,r)}toSVGPath(){const n=[];for(const r of C(this,Fg)){let[s,i]=r;n.push(`M${s} ${i}`);for(let a=2;a<r.length;a+=2){const o=r[a],c=r[a+1];o===s?(n.push(`V${c}`),i=c):c===i&&(n.push(`H${o}`),s=o)}n.push("Z")}return n.join(" ")}serialize([n,r,s,i],a){const o=[],c=s-n,u=i-r;for(const f of C(this,Fg)){const l=new Array(f.length);for(let d=0;d<f.length;d+=2)l[d]=n+f[d]*c,l[d+1]=i-f[d+1]*u;o.push(l)}return o}get box(){return C(this,R0)}}R0=new WeakMap,Fg=new WeakMap;var sl,_c,jg,zg,il,Bt,vh,yh,P0,T0,Bg,Ug,rd,k0,mC,gC,D0,kM;const Zl=class Zl{constructor({x:e,y:n},r,s,i,a,o=0){z(this,D0);z(this,sl);z(this,_c,[]);z(this,jg);z(this,zg);z(this,il,[]);z(this,Bt,new Float64Array(18));z(this,vh);z(this,yh);z(this,P0);z(this,T0);z(this,Bg);z(this,Ug);z(this,rd,[]);$(this,sl,r),$(this,Ug,i*s),$(this,zg,a),C(this,Bt).set([NaN,NaN,NaN,NaN,e,n],6),$(this,jg,o),$(this,T0,C(Zl,k0)*s),$(this,P0,C(Zl,gC)*s),$(this,Bg,s),C(this,rd).push(e,n)}get free(){return!0}isEmpty(){return isNaN(C(this,Bt)[8])}add({x:e,y:n}){var T;$(this,vh,e),$(this,yh,n);const[r,s,i,a]=C(this,sl);let[o,c,u,f]=C(this,Bt).subarray(8,12);const l=e-u,d=n-f,m=Math.hypot(l,d);if(m<C(this,P0))return!1;const p=m-C(this,T0),h=p/m,y=h*l,g=h*d;let v=o,w=c;o=u,c=f,u+=y,f+=g,(T=C(this,rd))==null||T.push(e,n);const x=-g/p,A=y/p,k=x*C(this,Ug),R=A*C(this,Ug);return C(this,Bt).set(C(this,Bt).subarray(2,8),0),C(this,Bt).set([u+k,f+R],4),C(this,Bt).set(C(this,Bt).subarray(14,18),12),C(this,Bt).set([u-k,f-R],16),isNaN(C(this,Bt)[6])?(C(this,il).length===0&&(C(this,Bt).set([o+k,c+R],2),C(this,il).push(NaN,NaN,NaN,NaN,(o+k-r)/i,(c+R-s)/a),C(this,Bt).set([o-k,c-R],14),C(this,_c).push(NaN,NaN,NaN,NaN,(o-k-r)/i,(c-R-s)/a)),C(this,Bt).set([v,w,o,c,u,f],6),!this.isEmpty()):(C(this,Bt).set([v,w,o,c,u,f],6),Math.abs(Math.atan2(w-c,v-o)-Math.atan2(g,y))<Math.PI/2?([o,c,u,f]=C(this,Bt).subarray(2,6),C(this,il).push(NaN,NaN,NaN,NaN,((o+u)/2-r)/i,((c+f)/2-s)/a),[o,c,v,w]=C(this,Bt).subarray(14,18),C(this,_c).push(NaN,NaN,NaN,NaN,((v+o)/2-r)/i,((w+c)/2-s)/a),!0):([v,w,o,c,u,f]=C(this,Bt).subarray(0,6),C(this,il).push(((v+5*o)/6-r)/i,((w+5*c)/6-s)/a,((5*o+u)/6-r)/i,((5*c+f)/6-s)/a,((o+u)/2-r)/i,((c+f)/2-s)/a),[u,f,o,c,v,w]=C(this,Bt).subarray(12,18),C(this,_c).push(((v+5*o)/6-r)/i,((w+5*c)/6-s)/a,((5*o+u)/6-r)/i,((5*c+f)/6-s)/a,((o+u)/2-r)/i,((c+f)/2-s)/a),!0))}toSVGPath(){if(this.isEmpty())return"";const e=C(this,il),n=C(this,_c),r=C(this,Bt).subarray(4,6),s=C(this,Bt).subarray(16,18),[i,a,o,c]=C(this,sl),[u,f,l,d]=B(this,D0,kM).call(this);if(isNaN(C(this,Bt)[6])&&!this.isEmpty())return`M${(C(this,Bt)[2]-i)/o} ${(C(this,Bt)[3]-a)/c} L${(C(this,Bt)[4]-i)/o} ${(C(this,Bt)[5]-a)/c} L${u} ${f} L${l} ${d} L${(C(this,Bt)[16]-i)/o} ${(C(this,Bt)[17]-a)/c} L${(C(this,Bt)[14]-i)/o} ${(C(this,Bt)[15]-a)/c} Z`;const m=[];m.push(`M${e[4]} ${e[5]}`);for(let p=6;p<e.length;p+=6)isNaN(e[p])?m.push(`L${e[p+4]} ${e[p+5]}`):m.push(`C${e[p]} ${e[p+1]} ${e[p+2]} ${e[p+3]} ${e[p+4]} ${e[p+5]}`);m.push(`L${(r[0]-i)/o} ${(r[1]-a)/c} L${u} ${f} L${l} ${d} L${(s[0]-i)/o} ${(s[1]-a)/c}`);for(let p=n.length-6;p>=6;p-=6)isNaN(n[p])?m.push(`L${n[p+4]} ${n[p+5]}`):m.push(`C${n[p]} ${n[p+1]} ${n[p+2]} ${n[p+3]} ${n[p+4]} ${n[p+5]}`);return m.push(`L${n[4]} ${n[5]} Z`),m.join(" ")}getOutlines(){var g;const e=C(this,il),n=C(this,_c),r=C(this,Bt),s=r.subarray(4,6),i=r.subarray(16,18),[a,o,c,u]=C(this,sl),f=new Float64Array((((g=C(this,rd))==null?void 0:g.length)??0)+2);for(let v=0,w=f.length-2;v<w;v+=2)f[v]=(C(this,rd)[v]-a)/c,f[v+1]=(C(this,rd)[v+1]-o)/u;f[f.length-2]=(C(this,vh)-a)/c,f[f.length-1]=(C(this,yh)-o)/u;const[l,d,m,p]=B(this,D0,kM).call(this);if(isNaN(r[6])&&!this.isEmpty()){const v=new Float64Array(36);return v.set([NaN,NaN,NaN,NaN,(r[2]-a)/c,(r[3]-o)/u,NaN,NaN,NaN,NaN,(r[4]-a)/c,(r[5]-o)/u,NaN,NaN,NaN,NaN,l,d,NaN,NaN,NaN,NaN,m,p,NaN,NaN,NaN,NaN,(r[16]-a)/c,(r[17]-o)/u,NaN,NaN,NaN,NaN,(r[14]-a)/c,(r[15]-o)/u],0),new DM(v,f,C(this,sl),C(this,Bg),C(this,jg),C(this,zg))}const h=new Float64Array(C(this,il).length+24+C(this,_c).length);let y=e.length;for(let v=0;v<y;v+=2){if(isNaN(e[v])){h[v]=h[v+1]=NaN;continue}h[v]=e[v],h[v+1]=e[v+1]}h.set([NaN,NaN,NaN,NaN,(s[0]-a)/c,(s[1]-o)/u,NaN,NaN,NaN,NaN,l,d,NaN,NaN,NaN,NaN,m,p,NaN,NaN,NaN,NaN,(i[0]-a)/c,(i[1]-o)/u],y),y+=24;for(let v=n.length-6;v>=6;v-=6)for(let w=0;w<6;w+=2){if(isNaN(n[v+w])){h[y]=h[y+1]=NaN,y+=2;continue}h[y]=n[v+w],h[y+1]=n[v+w+1],y+=2}return h.set([NaN,NaN,NaN,NaN,n[4],n[5]],y),new DM(h,f,C(this,sl),C(this,Bg),C(this,jg),C(this,zg))}};sl=new WeakMap,_c=new WeakMap,jg=new WeakMap,zg=new WeakMap,il=new WeakMap,Bt=new WeakMap,vh=new WeakMap,yh=new WeakMap,P0=new WeakMap,T0=new WeakMap,Bg=new WeakMap,Ug=new WeakMap,rd=new WeakMap,k0=new WeakMap,mC=new WeakMap,gC=new WeakMap,D0=new WeakSet,kM=function(){const e=C(this,Bt).subarray(4,6),n=C(this,Bt).subarray(16,18),[r,s,i,a]=C(this,sl);return[(C(this,vh)+(e[0]-n[0])/2-r)/i,(C(this,yh)+(e[1]-n[1])/2-s)/a,(C(this,vh)+(n[0]-e[0])/2-r)/i,(C(this,yh)+(n[1]-e[1])/2-s)/a]},z(Zl,k0,8),z(Zl,mC,2),z(Zl,gC,C(Zl,k0)+C(Zl,mC));let q1=Zl;var Hg,bh,xc,N0,Ki,M0,gr,_i,Jy,Zy,YZ;class DM extends KZ{constructor(n,r,s,i,a,o){super();z(this,_i);z(this,Hg);z(this,bh,null);z(this,xc);z(this,N0);z(this,Ki);z(this,M0);z(this,gr);$(this,gr,n),$(this,Ki,r),$(this,Hg,s),$(this,M0,i),$(this,xc,a),$(this,N0,o),B(this,_i,YZ).call(this,o);const{x:c,y:u,width:f,height:l}=C(this,bh);for(let d=0,m=n.length;d<m;d+=2)n[d]=(n[d]-c)/f,n[d+1]=(n[d+1]-u)/l;for(let d=0,m=r.length;d<m;d+=2)r[d]=(r[d]-c)/f,r[d+1]=(r[d+1]-u)/l}toSVGPath(){const n=[`M${C(this,gr)[4]} ${C(this,gr)[5]}`];for(let r=6,s=C(this,gr).length;r<s;r+=6){if(isNaN(C(this,gr)[r])){n.push(`L${C(this,gr)[r+4]} ${C(this,gr)[r+5]}`);continue}n.push(`C${C(this,gr)[r]} ${C(this,gr)[r+1]} ${C(this,gr)[r+2]} ${C(this,gr)[r+3]} ${C(this,gr)[r+4]} ${C(this,gr)[r+5]}`)}return n.push("Z"),n.join(" ")}serialize([n,r,s,i],a){const o=s-n,c=i-r;let u,f;switch(a){case 0:u=B(this,_i,Jy).call(this,C(this,gr),n,i,o,-c),f=B(this,_i,Jy).call(this,C(this,Ki),n,i,o,-c);break;case 90:u=B(this,_i,Zy).call(this,C(this,gr),n,r,o,c),f=B(this,_i,Zy).call(this,C(this,Ki),n,r,o,c);break;case 180:u=B(this,_i,Jy).call(this,C(this,gr),s,r,-o,c),f=B(this,_i,Jy).call(this,C(this,Ki),s,r,-o,c);break;case 270:u=B(this,_i,Zy).call(this,C(this,gr),s,i,-o,-c),f=B(this,_i,Zy).call(this,C(this,Ki),s,i,-o,-c);break}return{outline:Array.from(u),points:[Array.from(f)]}}get box(){return C(this,bh)}getNewOutline(n,r){const{x:s,y:i,width:a,height:o}=C(this,bh),[c,u,f,l]=C(this,Hg),d=a*f,m=o*l,p=s*f+c,h=i*l+u,y=new q1({x:C(this,Ki)[0]*d+p,y:C(this,Ki)[1]*m+h},C(this,Hg),C(this,M0),n,C(this,N0),r??C(this,xc));for(let g=2;g<C(this,Ki).length;g+=2)y.add({x:C(this,Ki)[g]*d+p,y:C(this,Ki)[g+1]*m+h});return y.getOutlines()}}Hg=new WeakMap,bh=new WeakMap,xc=new WeakMap,N0=new WeakMap,Ki=new WeakMap,M0=new WeakMap,gr=new WeakMap,_i=new WeakSet,Jy=function(n,r,s,i,a){const o=new Float64Array(n.length);for(let c=0,u=n.length;c<u;c+=2)o[c]=r+n[c]*i,o[c+1]=s+n[c+1]*a;return o},Zy=function(n,r,s,i,a){const o=new Float64Array(n.length);for(let c=0,u=n.length;c<u;c+=2)o[c]=r+n[c+1]*i,o[c+1]=s+n[c]*a;return o},YZ=function(n){const r=C(this,gr);let s=r[4],i=r[5],a=s,o=i,c=s,u=i,f=s,l=i;const d=n?Math.max:Math.min;for(let g=6,v=r.length;g<v;g+=6){if(isNaN(r[g]))a=Math.min(a,r[g+4]),o=Math.min(o,r[g+5]),c=Math.max(c,r[g+4]),u=Math.max(u,r[g+5]),l<r[g+5]?(f=r[g+4],l=r[g+5]):l===r[g+5]&&(f=d(f,r[g+4]));else{const w=et.bezierBoundingBox(s,i,...r.slice(g,g+6));a=Math.min(a,w[0]),o=Math.min(o,w[1]),c=Math.max(c,w[2]),u=Math.max(u,w[3]),l<w[3]?(f=w[2],l=w[3]):l===w[3]&&(f=d(f,w[2]))}s=r[g+4],i=r[g+5]}const m=a-C(this,xc),p=o-C(this,xc),h=c-a+2*C(this,xc),y=u-o+2*C(this,xc);$(this,bh,{x:m,y:p,width:h,height:y,lastPoint:[f,l]})};var O0,L0,ha,wh,Wg,Or,I0,Vg,$0,F0,pa,qg,Pn,NM,MM,XZ,mf,QZ,Cu;const ec=class ec{constructor({editor:e=null,uiManager:n=null}){z(this,Pn);z(this,O0,B(this,Pn,XZ).bind(this));z(this,L0,B(this,Pn,QZ).bind(this));z(this,ha,null);z(this,wh,null);z(this,Wg);z(this,Or,null);z(this,I0,!1);z(this,Vg,!1);z(this,$0,null);z(this,F0);z(this,pa,null);z(this,qg);var r;e?($(this,Vg,!1),$(this,qg,pt.HIGHLIGHT_COLOR),$(this,$0,e)):($(this,Vg,!0),$(this,qg,pt.HIGHLIGHT_DEFAULT_COLOR)),$(this,pa,(e==null?void 0:e._uiManager)||n),$(this,F0,C(this,pa)._eventBus),$(this,Wg,(e==null?void 0:e.color)||((r=C(this,pa))==null?void 0:r.highlightColors.values().next().value)||"#FFFF98")}static get _keyboardManager(){return Gt(this,"_keyboardManager",new F_([[["Escape","mac+Escape"],ec.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],ec.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],ec.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],ec.prototype._moveToPrevious],[["Home","mac+Home"],ec.prototype._moveToBeginning],[["End","mac+End"],ec.prototype._moveToEnd]]))}renderButton(){const e=$(this,ha,document.createElement("button"));e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.setAttribute("aria-haspopup",!0);const n=C(this,pa)._signal;e.addEventListener("click",B(this,Pn,mf).bind(this),{signal:n}),e.addEventListener("keydown",C(this,O0),{signal:n});const r=$(this,wh,document.createElement("span"));return r.className="swatch",r.setAttribute("aria-hidden",!0),r.style.backgroundColor=C(this,Wg),e.append(r),e}renderMainDropdown(){const e=$(this,Or,B(this,Pn,NM).call(this));return e.setAttribute("aria-orientation","horizontal"),e.setAttribute("aria-labelledby","highlightColorPickerLabel"),e}_colorSelectFromKeyboard(e){if(e.target===C(this,ha)){B(this,Pn,mf).call(this,e);return}const n=e.target.getAttribute("data-color");n&&B(this,Pn,MM).call(this,n,e)}_moveToNext(e){var n,r;if(!C(this,Pn,Cu)){B(this,Pn,mf).call(this,e);return}if(e.target===C(this,ha)){(n=C(this,Or).firstChild)==null||n.focus();return}(r=e.target.nextSibling)==null||r.focus()}_moveToPrevious(e){var n,r;if(e.target===((n=C(this,Or))==null?void 0:n.firstChild)||e.target===C(this,ha)){C(this,Pn,Cu)&&this._hideDropdownFromKeyboard();return}C(this,Pn,Cu)||B(this,Pn,mf).call(this,e),(r=e.target.previousSibling)==null||r.focus()}_moveToBeginning(e){var n;if(!C(this,Pn,Cu)){B(this,Pn,mf).call(this,e);return}(n=C(this,Or).firstChild)==null||n.focus()}_moveToEnd(e){var n;if(!C(this,Pn,Cu)){B(this,Pn,mf).call(this,e);return}(n=C(this,Or).lastChild)==null||n.focus()}hideDropdown(){var e;(e=C(this,Or))==null||e.classList.add("hidden"),window.removeEventListener("pointerdown",C(this,L0))}_hideDropdownFromKeyboard(){var e;if(!C(this,Vg)){if(!C(this,Pn,Cu)){(e=C(this,$0))==null||e.unselect();return}this.hideDropdown(),C(this,ha).focus({preventScroll:!0,focusVisible:C(this,I0)})}}updateColor(e){if(C(this,wh)&&(C(this,wh).style.backgroundColor=e),!C(this,Or))return;const n=C(this,pa).highlightColors.values();for(const r of C(this,Or).children)r.setAttribute("aria-selected",n.next().value===e)}destroy(){var e,n;(e=C(this,ha))==null||e.remove(),$(this,ha,null),$(this,wh,null),(n=C(this,Or))==null||n.remove(),$(this,Or,null)}};O0=new WeakMap,L0=new WeakMap,ha=new WeakMap,wh=new WeakMap,Wg=new WeakMap,Or=new WeakMap,I0=new WeakMap,Vg=new WeakMap,$0=new WeakMap,F0=new WeakMap,pa=new WeakMap,qg=new WeakMap,Pn=new WeakSet,NM=function(){const e=document.createElement("div"),n=C(this,pa)._signal;e.addEventListener("contextmenu",Ri,{signal:n}),e.className="dropdown",e.role="listbox",e.setAttribute("aria-multiselectable",!1),e.setAttribute("aria-orientation","vertical"),e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown");for(const[r,s]of C(this,pa).highlightColors){const i=document.createElement("button");i.tabIndex="0",i.role="option",i.setAttribute("data-color",s),i.title=r,i.setAttribute("data-l10n-id",`pdfjs-editor-colorpicker-${r}`);const a=document.createElement("span");i.append(a),a.className="swatch",a.style.backgroundColor=s,i.setAttribute("aria-selected",s===C(this,Wg)),i.addEventListener("click",B(this,Pn,MM).bind(this,s),{signal:n}),e.append(i)}return e.addEventListener("keydown",C(this,O0),{signal:n}),e},MM=function(e,n){n.stopPropagation(),C(this,F0).dispatch("switchannotationeditorparams",{source:this,type:C(this,qg),value:e})},XZ=function(e){ec._keyboardManager.exec(this,e)},mf=function(e){if(C(this,Pn,Cu)){this.hideDropdown();return}if($(this,I0,e.detail===0),window.addEventListener("pointerdown",C(this,L0),{signal:C(this,pa)._signal}),C(this,Or)){C(this,Or).classList.remove("hidden");return}const n=$(this,Or,B(this,Pn,NM).call(this));C(this,ha).append(n)},QZ=function(e){var n;(n=C(this,Or))!=null&&n.contains(e.target)||this.hideDropdown()},Cu=function(){return C(this,Or)&&!C(this,Or).classList.contains("hidden")};let G1=ec;var Gg,j0,sd,_h,Kg,Eo,z0,B0,xh,ma,Hs,Yi,vC,Yg,Sh,Lr,Xg,ol,U0,Ot,OM,LM,JZ,ZZ,eee,IM,eb,Oo,cm,tee,mE,tb,nee,ree,see,iee;const nn=class nn extends pn{constructor(n){super({...n,name:"highlightEditor"});z(this,Ot);z(this,Gg,null);z(this,j0,0);z(this,sd);z(this,_h,null);z(this,Kg,null);z(this,Eo,null);z(this,z0,null);z(this,B0,0);z(this,xh,null);z(this,ma,null);z(this,Hs,null);z(this,Yi,!1);z(this,vC,B(this,Ot,tee).bind(this));z(this,Yg,null);z(this,Sh);z(this,Lr,null);z(this,Xg,"");z(this,ol);z(this,U0,"");this.color=n.color||nn._defaultColor,$(this,ol,n.thickness||nn._defaultThickness),$(this,Sh,n.opacity||nn._defaultOpacity),$(this,sd,n.boxes||null),$(this,U0,n.methodOfCreation||""),$(this,Xg,n.text||""),this._isDraggable=!1,n.highlightId>-1?($(this,Yi,!0),B(this,Ot,LM).call(this,n),B(this,Ot,eb).call(this)):($(this,Gg,n.anchorNode),$(this,j0,n.anchorOffset),$(this,z0,n.focusNode),$(this,B0,n.focusOffset),B(this,Ot,OM).call(this),B(this,Ot,eb).call(this),this.rotate(this.rotation))}static get _keyboardManager(){const n=nn.prototype;return Gt(this,"_keyboardManager",new F_([[["ArrowLeft","mac+ArrowLeft"],n._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],n._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],n._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],n._moveCaret,{args:[3]}]]))}get telemetryInitialData(){return{action:"added",type:C(this,Yi)?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:C(this,ol),methodOfCreation:C(this,U0)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(n){return{numberOfColors:n.get("color").size}}static initialize(n,r){var s;pn.initialize(n,r),nn._defaultColor||(nn._defaultColor=((s=r.highlightColors)==null?void 0:s.values().next().value)||"#fff066")}static updateDefaultParams(n,r){switch(n){case pt.HIGHLIGHT_DEFAULT_COLOR:nn._defaultColor=r;break;case pt.HIGHLIGHT_THICKNESS:nn._defaultThickness=r;break}}translateInPage(n,r){}get toolbarPosition(){return C(this,Yg)}updateParams(n,r){switch(n){case pt.HIGHLIGHT_COLOR:B(this,Ot,JZ).call(this,r);break;case pt.HIGHLIGHT_THICKNESS:B(this,Ot,ZZ).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[pt.HIGHLIGHT_DEFAULT_COLOR,nn._defaultColor],[pt.HIGHLIGHT_THICKNESS,nn._defaultThickness]]}get propertiesToUpdate(){return[[pt.HIGHLIGHT_COLOR,this.color||nn._defaultColor],[pt.HIGHLIGHT_THICKNESS,C(this,ol)||nn._defaultThickness],[pt.HIGHLIGHT_FREE,C(this,Yi)]]}async addEditToolbar(){const n=await super.addEditToolbar();return n?(this._uiManager.highlightColors&&($(this,Kg,new G1({editor:this})),n.addColorPicker(C(this,Kg))),n):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(B(this,Ot,tb).call(this))}getBaseTranslation(){return[0,0]}getRect(n,r){return super.getRect(n,r,B(this,Ot,tb).call(this))}onceAdded(){this.parent.addUndoableEditor(this),this.div.focus()}remove(){B(this,Ot,IM).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(B(this,Ot,eb).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(n){var s;let r=!1;this.parent&&!n?B(this,Ot,IM).call(this):n&&(B(this,Ot,eb).call(this,n),r=!this.parent&&((s=this.div)==null?void 0:s.classList.contains("selectedEditor"))),super.setParent(n),this.show(this._isVisible),r&&this.select()}rotate(n){var i,a,o;const{drawLayer:r}=this.parent;let s;C(this,Yi)?(n=(n-this.rotation+360)%360,s=B(i=nn,Oo,cm).call(i,C(this,ma).box,n)):s=B(a=nn,Oo,cm).call(a,this,n),r.rotate(C(this,Hs),n),r.rotate(C(this,Lr),n),r.updateBox(C(this,Hs),s),r.updateBox(C(this,Lr),B(o=nn,Oo,cm).call(o,C(this,Eo).box,n))}render(){if(this.div)return this.div;const n=super.render();C(this,Xg)&&(n.setAttribute("aria-label",C(this,Xg)),n.setAttribute("role","mark")),C(this,Yi)?n.classList.add("free"):this.div.addEventListener("keydown",C(this,vC),{signal:this._uiManager._signal});const r=$(this,xh,document.createElement("div"));n.append(r),r.setAttribute("aria-hidden","true"),r.className="internal",r.style.clipPath=C(this,_h);const[s,i]=this.parentDimensions;return this.setDims(this.width*s,this.height*i),U1(this,C(this,xh),["pointerover","pointerleave"]),this.enableEditing(),n}pointerover(){this.parent.drawLayer.addClass(C(this,Lr),"hovered")}pointerleave(){this.parent.drawLayer.removeClass(C(this,Lr),"hovered")}_moveCaret(n){switch(this.parent.unselect(this),n){case 0:case 2:B(this,Ot,mE).call(this,!0);break;case 1:case 3:B(this,Ot,mE).call(this,!1);break}}select(){var n,r;super.select(),C(this,Lr)&&((n=this.parent)==null||n.drawLayer.removeClass(C(this,Lr),"hovered"),(r=this.parent)==null||r.drawLayer.addClass(C(this,Lr),"selected"))}unselect(){var n;super.unselect(),C(this,Lr)&&((n=this.parent)==null||n.drawLayer.removeClass(C(this,Lr),"selected"),C(this,Yi)||B(this,Ot,mE).call(this,!1))}get _mustFixPosition(){return!C(this,Yi)}show(n=this._isVisible){super.show(n),this.parent&&(this.parent.drawLayer.show(C(this,Hs),n),this.parent.drawLayer.show(C(this,Lr),n))}static startHighlighting(n,r,{target:s,x:i,y:a}){const{x:o,y:c,width:u,height:f}=s.getBoundingClientRect(),l=y=>{B(this,Oo,see).call(this,n,y)},d=n._signal,m={capture:!0,passive:!1,signal:d},p=y=>{y.preventDefault(),y.stopPropagation()},h=y=>{s.removeEventListener("pointermove",l),window.removeEventListener("blur",h),window.removeEventListener("pointerup",h),window.removeEventListener("pointerdown",p,m),window.removeEventListener("contextmenu",Ri),B(this,Oo,iee).call(this,n,y)};window.addEventListener("blur",h,{signal:d}),window.addEventListener("pointerup",h,{signal:d}),window.addEventListener("pointerdown",p,m),window.addEventListener("contextmenu",Ri,{signal:d}),s.addEventListener("pointermove",l,{signal:d}),this._freeHighlight=new q1({x:i,y:a},[o,c,u,f],n.scale,this._defaultThickness/2,r,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=n.drawLayer.highlight(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0)}static deserialize(n,r,s){var h;const i=super.deserialize(n,r,s),{rect:[a,o,c,u],color:f,quadPoints:l}=n;i.color=et.makeHexColor(...f),$(i,Sh,n.opacity);const[d,m]=i.pageDimensions;i.width=(c-a)/d,i.height=(u-o)/m;const p=$(i,sd,[]);for(let y=0;y<l.length;y+=8)p.push({x:(l[4]-c)/d,y:(u-(1-l[y+5]))/m,width:(l[y+2]-l[y])/d,height:(l[y+5]-l[y+1])/m});return B(h=i,Ot,OM).call(h),i}serialize(n=!1){if(this.isEmpty()||n)return null;const r=this.getRect(0,0),s=pn._colorManager.convert(this.color);return{annotationType:Vt.HIGHLIGHT,color:s,opacity:C(this,Sh),thickness:C(this,ol),quadPoints:B(this,Ot,nee).call(this),outlines:B(this,Ot,ree).call(this,r),pageIndex:this.pageIndex,rect:r,rotation:B(this,Ot,tb).call(this),structTreeParentId:this._structTreeParentId}}static canCreateNewEmptyEditor(){return!1}};Gg=new WeakMap,j0=new WeakMap,sd=new WeakMap,_h=new WeakMap,Kg=new WeakMap,Eo=new WeakMap,z0=new WeakMap,B0=new WeakMap,xh=new WeakMap,ma=new WeakMap,Hs=new WeakMap,Yi=new WeakMap,vC=new WeakMap,Yg=new WeakMap,Sh=new WeakMap,Lr=new WeakMap,Xg=new WeakMap,ol=new WeakMap,U0=new WeakMap,Ot=new WeakSet,OM=function(){const n=new PM(C(this,sd),.001);$(this,ma,n.getOutlines()),{x:this.x,y:this.y,width:this.width,height:this.height}=C(this,ma).box;const r=new PM(C(this,sd),.0025,.001,this._uiManager.direction==="ltr");$(this,Eo,r.getOutlines());const{lastPoint:s}=C(this,Eo).box;$(this,Yg,[(s[0]-this.x)/this.width,(s[1]-this.y)/this.height])},LM=function({highlightOutlines:n,highlightId:r,clipPathId:s}){var l,d;if($(this,ma,n),$(this,Eo,n.getNewOutline(C(this,ol)/2+1.5,.0025)),r>=0)$(this,Hs,r),$(this,_h,s),this.parent.drawLayer.finalizeLine(r,n),$(this,Lr,this.parent.drawLayer.highlightOutline(C(this,Eo)));else if(this.parent){const m=this.parent.viewport.rotation;this.parent.drawLayer.updateLine(C(this,Hs),n),this.parent.drawLayer.updateBox(C(this,Hs),B(l=nn,Oo,cm).call(l,C(this,ma).box,(m-this.rotation+360)%360)),this.parent.drawLayer.updateLine(C(this,Lr),C(this,Eo)),this.parent.drawLayer.updateBox(C(this,Lr),B(d=nn,Oo,cm).call(d,C(this,Eo).box,m))}const{x:a,y:o,width:c,height:u}=n.box;switch(this.rotation){case 0:this.x=a,this.y=o,this.width=c,this.height=u;break;case 90:{const[m,p]=this.parentDimensions;this.x=o,this.y=1-a,this.width=c*p/m,this.height=u*m/p;break}case 180:this.x=1-a,this.y=1-o,this.width=c,this.height=u;break;case 270:{const[m,p]=this.parentDimensions;this.x=1-o,this.y=a,this.width=c*p/m,this.height=u*m/p;break}}const{lastPoint:f}=C(this,Eo).box;$(this,Yg,[(f[0]-a)/c,(f[1]-o)/u])},JZ=function(n){const r=i=>{var a,o;this.color=i,(a=this.parent)==null||a.drawLayer.changeColor(C(this,Hs),i),(o=C(this,Kg))==null||o.updateColor(i)},s=this.color;this.addCommands({cmd:r.bind(this,n),undo:r.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:pt.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(n)},!0)},ZZ=function(n){const r=C(this,ol),s=i=>{$(this,ol,i),B(this,Ot,eee).call(this,i)};this.addCommands({cmd:s.bind(this,n),undo:s.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:pt.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:n},!0)},eee=function(n){if(!C(this,Yi))return;B(this,Ot,LM).call(this,{highlightOutlines:C(this,ma).getNewOutline(n/2)}),this.fixAndSetPosition();const[r,s]=this.parentDimensions;this.setDims(this.width*r,this.height*s)},IM=function(){C(this,Hs)===null||!this.parent||(this.parent.drawLayer.remove(C(this,Hs)),$(this,Hs,null),this.parent.drawLayer.remove(C(this,Lr)),$(this,Lr,null))},eb=function(n=this.parent){C(this,Hs)===null&&({id:bs(this,Hs)._,clipPathId:bs(this,_h)._}=n.drawLayer.highlight(C(this,ma),this.color,C(this,Sh)),$(this,Lr,n.drawLayer.highlightOutline(C(this,Eo))),C(this,xh)&&(C(this,xh).style.clipPath=C(this,_h)))},Oo=new WeakSet,cm=function({x:n,y:r,width:s,height:i},a){switch(a){case 90:return{x:1-r-i,y:n,width:i,height:s};case 180:return{x:1-n-s,y:1-r-i,width:s,height:i};case 270:return{x:r,y:1-n-s,width:i,height:s}}return{x:n,y:r,width:s,height:i}},tee=function(n){nn._keyboardManager.exec(this,n)},mE=function(n){if(!C(this,Gg))return;const r=window.getSelection();n?r.setPosition(C(this,Gg),C(this,j0)):r.setPosition(C(this,z0),C(this,B0))},tb=function(){return C(this,Yi)?this.rotation:0},nee=function(){if(C(this,Yi))return null;const[n,r]=this.pageDimensions,s=C(this,sd),i=new Float32Array(s.length*8);let a=0;for(const{x:o,y:c,width:u,height:f}of s){const l=o*n,d=(1-c-f)*r;i[a]=i[a+4]=l,i[a+1]=i[a+3]=d,i[a+2]=i[a+6]=l+u*n,i[a+5]=i[a+7]=d+f*r,a+=8}return i},ree=function(n){return C(this,ma).serialize(n,B(this,Ot,tb).call(this))},see=function(n,r){this._freeHighlight.add(r)&&n.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)},iee=function(n,r){this._freeHighlight.isEmpty()?n.drawLayer.removeFreeHighlight(this._freeHighlightId):n.createAndAddNewEditor(r,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""},z(nn,Oo),He(nn,"_defaultColor",null),He(nn,"_defaultOpacity",1),He(nn,"_defaultThickness",12),He(nn,"_l10nPromise"),He(nn,"_type","highlight"),He(nn,"_editorType",Vt.HIGHLIGHT),He(nn,"_freeHighlightId",-1),He(nn,"_freeHighlight",null),He(nn,"_freeHighlightClipId","");let K1=nn;var Eh,Ch,H0,W0,V0,Ah,al,Sc,Co,Rh,Ph,Ec,Th,kh,id,ze,oee,aee,lee,cee,FM,uee,jM,dee,fee,hee,pee,mee,gf,zM,gE,vE,um,BM,yE,Kc,gee,UM,vee,yee,HM,bE,nb;const Qn=class Qn extends pn{constructor(n){super({...n,name:"inkEditor"});z(this,ze);z(this,Eh,0);z(this,Ch,0);z(this,H0,this.canvasPointermove.bind(this));z(this,W0,this.canvasPointerleave.bind(this));z(this,V0,this.canvasPointerup.bind(this));z(this,Ah,this.canvasPointerdown.bind(this));z(this,al,null);z(this,Sc,new Path2D);z(this,Co,!1);z(this,Rh,!1);z(this,Ph,!1);z(this,Ec,null);z(this,Th,0);z(this,kh,0);z(this,id,null);this.color=n.color||null,this.thickness=n.thickness||null,this.opacity=n.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(n,r){pn.initialize(n,r)}static updateDefaultParams(n,r){switch(n){case pt.INK_THICKNESS:Qn._defaultThickness=r;break;case pt.INK_COLOR:Qn._defaultColor=r;break;case pt.INK_OPACITY:Qn._defaultOpacity=r/100;break}}updateParams(n,r){switch(n){case pt.INK_THICKNESS:B(this,ze,oee).call(this,r);break;case pt.INK_COLOR:B(this,ze,aee).call(this,r);break;case pt.INK_OPACITY:B(this,ze,lee).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[pt.INK_THICKNESS,Qn._defaultThickness],[pt.INK_COLOR,Qn._defaultColor||pn._defaultLineColor],[pt.INK_OPACITY,Math.round(Qn._defaultOpacity*100)]]}get propertiesToUpdate(){return[[pt.INK_THICKNESS,this.thickness||Qn._defaultThickness],[pt.INK_COLOR,this.color||Qn._defaultColor||pn._defaultLineColor],[pt.INK_OPACITY,Math.round(100*(this.opacity??Qn._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.canvas||(B(this,ze,gE).call(this),B(this,ze,vE).call(this)),this.isAttachedToDOM||(this.parent.add(this),B(this,ze,um).call(this)),B(this,ze,nb).call(this)))}remove(){var n;this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,C(this,al)&&(clearTimeout(C(this,al)),$(this,al,null)),(n=C(this,Ec))==null||n.disconnect(),$(this,Ec,null),super.remove())}setParent(n){!this.parent&&n?this._uiManager.removeShouldRescale(this):this.parent&&n===null&&this._uiManager.addShouldRescale(this),super.setParent(n)}onScaleChanging(){const[n,r]=this.parentDimensions,s=this.width*n,i=this.height*r;this.setDimensions(s,i)}enableEditMode(){C(this,Co)||this.canvas===null||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",C(this,Ah),{signal:this._uiManager._signal}))}disableEditMode(){!this.isInEditMode()||this.canvas===null||(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",C(this,Ah)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}commit(){C(this,Co)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),$(this,Co,!0),this.div.classList.add("disabled"),B(this,ze,nb).call(this,!0),this.select(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(n){this._focusEventsAllowed&&(super.focusin(n),this.enableEditMode())}canvasPointerdown(n){n.button!==0||!this.isInEditMode()||C(this,Co)||(this.setInForeground(),n.preventDefault(),this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0}),B(this,ze,uee).call(this,n.offsetX,n.offsetY))}canvasPointermove(n){n.preventDefault(),B(this,ze,jM).call(this,n.offsetX,n.offsetY)}canvasPointerup(n){n.preventDefault(),B(this,ze,zM).call(this,n)}canvasPointerleave(n){B(this,ze,zM).call(this,n)}get isResizable(){return!this.isEmpty()&&C(this,Co)}render(){if(this.div)return this.div;let n,r;this.width&&(n=this.x,r=this.y),super.render(),this.div.setAttribute("data-l10n-id","pdfjs-ink");const[s,i,a,o]=B(this,ze,cee).call(this);if(this.setAt(s,i,0,0),this.setDims(a,o),B(this,ze,gE).call(this),this.width){const[c,u]=this.parentDimensions;this.setAspectRatio(this.width*c,this.height*u),this.setAt(n*c,r*u,this.width*c,this.height*u),$(this,Ph,!0),B(this,ze,um).call(this),this.setDims(this.width*c,this.height*u),B(this,ze,gf).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return B(this,ze,vE).call(this),this.div}setDimensions(n,r){const s=Math.round(n),i=Math.round(r);if(C(this,Th)===s&&C(this,kh)===i)return;$(this,Th,s),$(this,kh,i),this.canvas.style.visibility="hidden";const[a,o]=this.parentDimensions;this.width=n/a,this.height=r/o,this.fixAndSetPosition(),C(this,Co)&&B(this,ze,BM).call(this,n,r),B(this,ze,um).call(this),B(this,ze,gf).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(n,r,s){var y,g,v;if(n instanceof $Z)return null;const i=super.deserialize(n,r,s);i.thickness=n.thickness,i.color=et.makeHexColor(...n.color),i.opacity=n.opacity;const[a,o]=i.pageDimensions,c=i.width*a,u=i.height*o,f=i.parentScale,l=n.thickness/2;$(i,Co,!0),$(i,Th,Math.round(c)),$(i,kh,Math.round(u));const{paths:d,rect:m,rotation:p}=n;for(let{bezier:w}of d){w=B(y=Qn,Kc,vee).call(y,w,m,p);const x=[];i.paths.push(x);let A=f*(w[0]-l),k=f*(w[1]-l);for(let E=2,T=w.length;E<T;E+=6){const D=f*(w[E]-l),M=f*(w[E+1]-l),L=f*(w[E+2]-l),I=f*(w[E+3]-l),F=f*(w[E+4]-l),U=f*(w[E+5]-l);x.push([[A,k],[D,M],[L,I],[F,U]]),A=F,k=U}const R=B(this,Kc,gee).call(this,x);i.bezierPath2D.push(R)}const h=B(g=i,ze,HM).call(g);return $(i,Ch,Math.max(pn.MIN_SIZE,h[2]-h[0])),$(i,Eh,Math.max(pn.MIN_SIZE,h[3]-h[1])),B(v=i,ze,BM).call(v,c,u),i}serialize(){if(this.isEmpty())return null;const n=this.getRect(0,0),r=pn._colorManager.convert(this.ctx.strokeStyle);return{annotationType:Vt.INK,color:r,thickness:this.thickness,opacity:this.opacity,paths:B(this,ze,yee).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,n),pageIndex:this.pageIndex,rect:n,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}};Eh=new WeakMap,Ch=new WeakMap,H0=new WeakMap,W0=new WeakMap,V0=new WeakMap,Ah=new WeakMap,al=new WeakMap,Sc=new WeakMap,Co=new WeakMap,Rh=new WeakMap,Ph=new WeakMap,Ec=new WeakMap,Th=new WeakMap,kh=new WeakMap,id=new WeakMap,ze=new WeakSet,oee=function(n){const r=i=>{this.thickness=i,B(this,ze,nb).call(this)},s=this.thickness;this.addCommands({cmd:r.bind(this,n),undo:r.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:pt.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},aee=function(n){const r=i=>{this.color=i,B(this,ze,gf).call(this)},s=this.color;this.addCommands({cmd:r.bind(this,n),undo:r.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:pt.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},lee=function(n){const r=i=>{this.opacity=i,B(this,ze,gf).call(this)};n/=100;const s=this.opacity;this.addCommands({cmd:r.bind(this,n),undo:r.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:pt.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},cee=function(){const{parentRotation:n,parentDimensions:[r,s]}=this;switch(n){case 90:return[0,s,s,r];case 180:return[r,s,r,s];case 270:return[r,0,s,r];default:return[0,0,r,s]}},FM=function(){const{ctx:n,color:r,opacity:s,thickness:i,parentScale:a,scaleFactor:o}=this;n.lineWidth=i*a/o,n.lineCap="round",n.lineJoin="round",n.miterLimit=10,n.strokeStyle=`${r}${NFe(s)}`},uee=function(n,r){const s=this._uiManager._signal;this.canvas.addEventListener("contextmenu",Ri,{signal:s}),this.canvas.addEventListener("pointerleave",C(this,W0),{signal:s}),this.canvas.addEventListener("pointermove",C(this,H0),{signal:s}),this.canvas.addEventListener("pointerup",C(this,V0),{signal:s}),this.canvas.removeEventListener("pointerdown",C(this,Ah)),this.isEditing=!0,C(this,Ph)||($(this,Ph,!0),B(this,ze,um).call(this),this.thickness||(this.thickness=Qn._defaultThickness),this.color||(this.color=Qn._defaultColor||pn._defaultLineColor),this.opacity??(this.opacity=Qn._defaultOpacity)),this.currentPath.push([n,r]),$(this,Rh,!1),B(this,ze,FM).call(this),$(this,id,()=>{B(this,ze,hee).call(this),C(this,id)&&window.requestAnimationFrame(C(this,id))}),window.requestAnimationFrame(C(this,id))},jM=function(n,r){const[s,i]=this.currentPath.at(-1);if(this.currentPath.length>1&&n===s&&r===i)return;const a=this.currentPath;let o=C(this,Sc);if(a.push([n,r]),$(this,Rh,!0),a.length<=2){o.moveTo(...a[0]),o.lineTo(n,r);return}a.length===3&&($(this,Sc,o=new Path2D),o.moveTo(...a[0])),B(this,ze,pee).call(this,o,...a.at(-3),...a.at(-2),n,r)},dee=function(){if(this.currentPath.length===0)return;const n=this.currentPath.at(-1);C(this,Sc).lineTo(...n)},fee=function(n,r){$(this,id,null),n=Math.min(Math.max(n,0),this.canvas.width),r=Math.min(Math.max(r,0),this.canvas.height),B(this,ze,jM).call(this,n,r),B(this,ze,dee).call(this);let s;if(this.currentPath.length!==1)s=B(this,ze,mee).call(this);else{const u=[n,r];s=[[u,u.slice(),u.slice(),u]]}const i=C(this,Sc),a=this.currentPath;this.currentPath=[],$(this,Sc,new Path2D);const o=()=>{this.allRawPaths.push(a),this.paths.push(s),this.bezierPath2D.push(i),this._uiManager.rebuild(this)},c=()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(B(this,ze,gE).call(this),B(this,ze,vE).call(this)),B(this,ze,nb).call(this))};this.addCommands({cmd:o,undo:c,mustExec:!0})},hee=function(){if(!C(this,Rh))return;$(this,Rh,!1);const n=Math.ceil(this.thickness*this.parentScale),r=this.currentPath.slice(-3),s=r.map(o=>o[0]),i=r.map(o=>o[1]);Math.min(...s)-n,Math.max(...s)+n,Math.min(...i)-n,Math.max(...i)+n;const{ctx:a}=this;a.save(),a.clearRect(0,0,this.canvas.width,this.canvas.height);for(const o of this.bezierPath2D)a.stroke(o);a.stroke(C(this,Sc)),a.restore()},pee=function(n,r,s,i,a,o,c){const u=(r+i)/2,f=(s+a)/2,l=(i+o)/2,d=(a+c)/2;n.bezierCurveTo(u+2*(i-u)/3,f+2*(a-f)/3,l+2*(i-l)/3,d+2*(a-d)/3,l,d)},mee=function(){const n=this.currentPath;if(n.length<=2)return[[n[0],n[0],n.at(-1),n.at(-1)]];const r=[];let s,[i,a]=n[0];for(s=1;s<n.length-2;s++){const[m,p]=n[s],[h,y]=n[s+1],g=(m+h)/2,v=(p+y)/2,w=[i+2*(m-i)/3,a+2*(p-a)/3],x=[g+2*(m-g)/3,v+2*(p-v)/3];r.push([[i,a],w,x,[g,v]]),[i,a]=[g,v]}const[o,c]=n[s],[u,f]=n[s+1],l=[i+2*(o-i)/3,a+2*(c-a)/3],d=[u+2*(o-u)/3,f+2*(c-f)/3];return r.push([[i,a],l,d,[u,f]]),r},gf=function(){if(this.isEmpty()){B(this,ze,yE).call(this);return}B(this,ze,FM).call(this);const{canvas:n,ctx:r}=this;r.setTransform(1,0,0,1,0,0),r.clearRect(0,0,n.width,n.height),B(this,ze,yE).call(this);for(const s of this.bezierPath2D)r.stroke(s)},zM=function(n){this.canvas.removeEventListener("pointerleave",C(this,W0)),this.canvas.removeEventListener("pointermove",C(this,H0)),this.canvas.removeEventListener("pointerup",C(this,V0)),this.canvas.addEventListener("pointerdown",C(this,Ah),{signal:this._uiManager._signal}),C(this,al)&&clearTimeout(C(this,al)),$(this,al,setTimeout(()=>{$(this,al,null),this.canvas.removeEventListener("contextmenu",Ri)},10)),B(this,ze,fee).call(this,n.offsetX,n.offsetY),this.addToAnnotationStorage(),this.setInBackground()},gE=function(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",this.canvas.setAttribute("data-l10n-id","pdfjs-ink-canvas"),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")},vE=function(){$(this,Ec,new ResizeObserver(n=>{const r=n[0].contentRect;r.width&&r.height&&this.setDimensions(r.width,r.height)})),C(this,Ec).observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{var n;(n=C(this,Ec))==null||n.disconnect(),$(this,Ec,null)},{once:!0})},um=function(){if(!C(this,Ph))return;const[n,r]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*n),this.canvas.height=Math.ceil(this.height*r),B(this,ze,yE).call(this)},BM=function(n,r){const s=B(this,ze,bE).call(this),i=(n-s)/C(this,Ch),a=(r-s)/C(this,Eh);this.scaleFactor=Math.min(i,a)},yE=function(){const n=B(this,ze,bE).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+n,this.translationY*this.scaleFactor+n)},Kc=new WeakSet,gee=function(n){const r=new Path2D;for(let s=0,i=n.length;s<i;s++){const[a,o,c,u]=n[s];s===0&&r.moveTo(...a),r.bezierCurveTo(o[0],o[1],c[0],c[1],u[0],u[1])}return r},UM=function(n,r,s){const[i,a,o,c]=r;switch(s){case 0:for(let u=0,f=n.length;u<f;u+=2)n[u]+=i,n[u+1]=c-n[u+1];break;case 90:for(let u=0,f=n.length;u<f;u+=2){const l=n[u];n[u]=n[u+1]+i,n[u+1]=l+a}break;case 180:for(let u=0,f=n.length;u<f;u+=2)n[u]=o-n[u],n[u+1]+=a;break;case 270:for(let u=0,f=n.length;u<f;u+=2){const l=n[u];n[u]=o-n[u+1],n[u+1]=c-l}break;default:throw new Error("Invalid rotation")}return n},vee=function(n,r,s){const[i,a,o,c]=r;switch(s){case 0:for(let u=0,f=n.length;u<f;u+=2)n[u]-=i,n[u+1]=c-n[u+1];break;case 90:for(let u=0,f=n.length;u<f;u+=2){const l=n[u];n[u]=n[u+1]-a,n[u+1]=l-i}break;case 180:for(let u=0,f=n.length;u<f;u+=2)n[u]=o-n[u],n[u+1]-=a;break;case 270:for(let u=0,f=n.length;u<f;u+=2){const l=n[u];n[u]=c-n[u+1],n[u+1]=o-l}break;default:throw new Error("Invalid rotation")}return n},yee=function(n,r,s,i){var f,l;const a=[],o=this.thickness/2,c=n*r+o,u=n*s+o;for(const d of this.paths){const m=[],p=[];for(let h=0,y=d.length;h<y;h++){const[g,v,w,x]=d[h];if(g[0]===x[0]&&g[1]===x[1]&&y===1){const I=n*g[0]+c,F=n*g[1]+u;m.push(I,F),p.push(I,F);break}const A=n*g[0]+c,k=n*g[1]+u,R=n*v[0]+c,E=n*v[1]+u,T=n*w[0]+c,D=n*w[1]+u,M=n*x[0]+c,L=n*x[1]+u;h===0&&(m.push(A,k),p.push(A,k)),m.push(R,E,T,D,M,L),p.push(R,E),h===y-1&&p.push(M,L)}a.push({bezier:B(f=Qn,Kc,UM).call(f,m,i,this.rotation),points:B(l=Qn,Kc,UM).call(l,p,i,this.rotation)})}return a},HM=function(){let n=1/0,r=-1/0,s=1/0,i=-1/0;for(const a of this.paths)for(const[o,c,u,f]of a){const l=et.bezierBoundingBox(...o,...c,...u,...f);n=Math.min(n,l[0]),s=Math.min(s,l[1]),r=Math.max(r,l[2]),i=Math.max(i,l[3])}return[n,s,r,i]},bE=function(){return C(this,Co)?Math.ceil(this.thickness*this.parentScale):0},nb=function(n=!1){if(this.isEmpty())return;if(!C(this,Co)){B(this,ze,gf).call(this);return}const r=B(this,ze,HM).call(this),s=B(this,ze,bE).call(this);$(this,Ch,Math.max(pn.MIN_SIZE,r[2]-r[0])),$(this,Eh,Math.max(pn.MIN_SIZE,r[3]-r[1]));const i=Math.ceil(s+C(this,Ch)*this.scaleFactor),a=Math.ceil(s+C(this,Eh)*this.scaleFactor),[o,c]=this.parentDimensions;this.width=i/o,this.height=a/c,this.setAspectRatio(i,a);const u=this.translationX,f=this.translationY;this.translationX=-r[0],this.translationY=-r[1],B(this,ze,um).call(this),B(this,ze,gf).call(this),$(this,Th,i),$(this,kh,a),this.setDims(i,a);const l=n?s/this.scaleFactor/2:0;this.translate(u-this.translationX-l,f-this.translationY-l)},z(Qn,Kc),He(Qn,"_defaultColor",null),He(Qn,"_defaultOpacity",1),He(Qn,"_defaultThickness",1),He(Qn,"_type","ink"),He(Qn,"_editorType",Vt.INK);let $M=Qn;var ls,cs,od,Cc,ad,Qg,ll,Ac,cl,ga,q0,en,rb,sb,wE,VM,bee,wee,qM,_E,_ee;const Cb=class Cb extends pn{constructor(n){super({...n,name:"stampEditor"});z(this,en);z(this,ls,null);z(this,cs,null);z(this,od,null);z(this,Cc,null);z(this,ad,null);z(this,Qg,"");z(this,ll,null);z(this,Ac,null);z(this,cl,null);z(this,ga,!1);z(this,q0,!1);$(this,Cc,n.bitmapUrl),$(this,ad,n.bitmapFile)}static initialize(n,r){pn.initialize(n,r)}static get supportedTypes(){return Gt(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map(r=>`image/${r}`))}static get supportedTypesStr(){return Gt(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(n){return this.supportedTypes.includes(n)}static paste(n,r){r.pasteEditor(Vt.STAMP,{bitmapFile:n.getAsFile()})}remove(){var n,r;C(this,cs)&&($(this,ls,null),this._uiManager.imageManager.deleteId(C(this,cs)),(n=C(this,ll))==null||n.remove(),$(this,ll,null),(r=C(this,Ac))==null||r.disconnect(),$(this,Ac,null),C(this,cl)&&(clearTimeout(C(this,cl)),$(this,cl,null))),super.remove()}rebuild(){if(!this.parent){C(this,cs)&&B(this,en,wE).call(this);return}super.rebuild(),this.div!==null&&(C(this,cs)&&C(this,ll)===null&&B(this,en,wE).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(C(this,od)||C(this,ls)||C(this,Cc)||C(this,ad)||C(this,cs))}get isResizable(){return!0}render(){if(this.div)return this.div;let n,r;if(this.width&&(n=this.x,r=this.y),super.render(),this.div.hidden=!0,this.addAltTextButton(),C(this,ls)?B(this,en,VM).call(this):B(this,en,wE).call(this),this.width){const[s,i]=this.parentDimensions;this.setAt(n*s,r*i,this.width*s,this.height*i)}return this.div}getImageForAltText(){return C(this,ll)}static deserialize(n,r,s){if(n instanceof FZ)return null;const i=super.deserialize(n,r,s),{rect:a,bitmapUrl:o,bitmapId:c,isSvg:u,accessibilityData:f}=n;c&&s.imageManager.isValidId(c)?$(i,cs,c):$(i,Cc,o),$(i,ga,u);const[l,d]=i.pageDimensions;return i.width=(a[2]-a[0])/l,i.height=(a[3]-a[1])/d,f&&(i.altTextData=f),i}serialize(n=!1,r=null){if(this.isEmpty())return null;const s={annotationType:Vt.STAMP,bitmapId:C(this,cs),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:C(this,ga),structTreeParentId:this._structTreeParentId};if(n)return s.bitmapUrl=B(this,en,_E).call(this,!0),s.accessibilityData=this.altTextData,s;const{decorative:i,altText:a}=this.altTextData;if(!i&&a&&(s.accessibilityData={type:"Figure",alt:a}),r===null)return s;r.stamps||(r.stamps=new Map);const o=C(this,ga)?(s.rect[2]-s.rect[0])*(s.rect[3]-s.rect[1]):null;if(!r.stamps.has(C(this,cs)))r.stamps.set(C(this,cs),{area:o,serialized:s}),s.bitmap=B(this,en,_E).call(this,!1);else if(C(this,ga)){const c=r.stamps.get(C(this,cs));o>c.area&&(c.area=o,c.serialized.bitmap.close(),c.serialized.bitmap=B(this,en,_E).call(this,!1))}return s}};ls=new WeakMap,cs=new WeakMap,od=new WeakMap,Cc=new WeakMap,ad=new WeakMap,Qg=new WeakMap,ll=new WeakMap,Ac=new WeakMap,cl=new WeakMap,ga=new WeakMap,q0=new WeakMap,en=new WeakSet,rb=function(n,r=!1){if(!n){this.remove();return}$(this,ls,n.bitmap),r||($(this,cs,n.id),$(this,ga,n.isSvg)),n.file&&$(this,Qg,n.file.name),B(this,en,VM).call(this)},sb=function(){$(this,od,null),this._uiManager.enableWaiting(!1),C(this,ll)&&this.div.focus()},wE=function(){if(C(this,cs)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(C(this,cs)).then(s=>B(this,en,rb).call(this,s,!0)).finally(()=>B(this,en,sb).call(this));return}if(C(this,Cc)){const s=C(this,Cc);$(this,Cc,null),this._uiManager.enableWaiting(!0),$(this,od,this._uiManager.imageManager.getFromUrl(s).then(i=>B(this,en,rb).call(this,i)).finally(()=>B(this,en,sb).call(this)));return}if(C(this,ad)){const s=C(this,ad);$(this,ad,null),this._uiManager.enableWaiting(!0),$(this,od,this._uiManager.imageManager.getFromFile(s).then(i=>B(this,en,rb).call(this,i)).finally(()=>B(this,en,sb).call(this)));return}const n=document.createElement("input");n.type="file",n.accept=Cb.supportedTypesStr;const r=this._uiManager._signal;$(this,od,new Promise(s=>{n.addEventListener("change",async()=>{if(!n.files||n.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const i=await this._uiManager.imageManager.getFromFile(n.files[0]);B(this,en,rb).call(this,i)}s()},{signal:r}),n.addEventListener("cancel",()=>{this.remove(),s()},{signal:r})}).finally(()=>B(this,en,sb).call(this))),n.click()},VM=function(){const{div:n}=this;let{width:r,height:s}=C(this,ls);const[i,a]=this.pageDimensions,o=.75;if(this.width)r=this.width*i,s=this.height*a;else if(r>o*i||s>o*a){const l=Math.min(o*i/r,o*a/s);r*=l,s*=l}const[c,u]=this.parentDimensions;this.setDims(r*c/i,s*u/a),this._uiManager.enableWaiting(!1);const f=$(this,ll,document.createElement("canvas"));n.append(f),n.hidden=!1,B(this,en,qM).call(this,r,s),B(this,en,_ee).call(this),C(this,q0)||(this.parent.addUndoableEditor(this),$(this,q0,!0)),this._reportTelemetry({action:"inserted_image"}),C(this,Qg)&&f.setAttribute("aria-label",C(this,Qg))},bee=function(n,r){var o;const[s,i]=this.parentDimensions;this.width=n/s,this.height=r/i,this.setDims(n,r),(o=this._initialOptions)!=null&&o.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,C(this,cl)!==null&&clearTimeout(C(this,cl)),$(this,cl,setTimeout(()=>{$(this,cl,null),B(this,en,qM).call(this,n,r)},200))},wee=function(n,r){const{width:s,height:i}=C(this,ls);let a=s,o=i,c=C(this,ls);for(;a>2*n||o>2*r;){const u=a,f=o;a>2*n&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2)),o>2*r&&(o=o>=16384?Math.floor(o/2)-1:Math.ceil(o/2));const l=new OffscreenCanvas(a,o);l.getContext("2d").drawImage(c,0,0,u,f,0,0,a,o),c=l.transferToImageBitmap()}return c},qM=function(n,r){n=Math.ceil(n),r=Math.ceil(r);const s=C(this,ll);if(!s||s.width===n&&s.height===r)return;s.width=n,s.height=r;const i=C(this,ga)?C(this,ls):B(this,en,wee).call(this,n,r);if(this._uiManager.hasMLManager&&!this.hasAltText()){const c=new OffscreenCanvas(n,r).getContext("2d");c.drawImage(i,0,0,i.width,i.height,0,0,n,r),this._uiManager.mlGuess({service:"image-to-text",request:{data:c.getImageData(0,0,n,r).data,width:n,height:r,channels:4}}).then(u=>{const f=(u==null?void 0:u.output)||"";this.parent&&f&&!this.hasAltText()&&(this.altTextData={altText:f,decorative:!1})})}const a=s.getContext("2d");a.filter=this._uiManager.hcmFilter,a.drawImage(i,0,0,i.width,i.height,0,0,n,r)},_E=function(n){if(n){if(C(this,ga)){const i=this._uiManager.imageManager.getSvgUrl(C(this,cs));if(i)return i}const r=document.createElement("canvas");return{width:r.width,height:r.height}=C(this,ls),r.getContext("2d").drawImage(C(this,ls),0,0),r.toDataURL()}if(C(this,ga)){const[r,s]=this.pageDimensions,i=Math.round(this.width*r*Dd.PDF_TO_CSS_UNITS),a=Math.round(this.height*s*Dd.PDF_TO_CSS_UNITS),o=new OffscreenCanvas(i,a);return o.getContext("2d").drawImage(C(this,ls),0,0,C(this,ls).width,C(this,ls).height,0,0,i,a),o.transferToImageBitmap()}return structuredClone(C(this,ls))},_ee=function(){this._uiManager._signal&&($(this,Ac,new ResizeObserver(n=>{const r=n[0].contentRect;r.width&&r.height&&B(this,en,bee).call(this,r.width,r.height)})),C(this,Ac).observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{var n;(n=C(this,Ac))==null||n.disconnect(),$(this,Ac,null)},{once:!0}))},He(Cb,"_type","stamp"),He(Cb,"_editorType",Vt.STAMP);let WM=Cb;var Dh,Jg,ul,Nh,Rc,Pc,Tc,Xi,ld,Zg,ev,Ws,rt,cd,fs,xee,KM,YM,XM,xE;const Zo=class Zo{constructor({uiManager:e,pageIndex:n,div:r,accessibilityManager:s,annotationLayer:i,drawLayer:a,textLayer:o,viewport:c,l10n:u}){z(this,fs);z(this,Dh);z(this,Jg,!1);z(this,ul,null);z(this,Nh,null);z(this,Rc,null);z(this,Pc,null);z(this,Tc,null);z(this,Xi,new Map);z(this,ld,!1);z(this,Zg,!1);z(this,ev,!1);z(this,Ws,null);z(this,rt);const f=[...C(Zo,cd).values()];if(!Zo._initialized){Zo._initialized=!0;for(const l of f)l.initialize(u,e)}e.registerEditorTypes(f),$(this,rt,e),this.pageIndex=n,this.div=r,$(this,Dh,s),$(this,ul,i),this.viewport=c,$(this,Ws,o),this.drawLayer=a,C(this,rt).addLayer(this)}get isEmpty(){return C(this,Xi).size===0}get isInvisible(){return this.isEmpty&&C(this,rt).getMode()===Vt.NONE}updateToolbar(e){C(this,rt).updateToolbar(e)}updateMode(e=C(this,rt).getMode()){switch(B(this,fs,xE).call(this),e){case Vt.NONE:this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case Vt.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case Vt.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:n}=this.div;for(const r of C(Zo,cd).values())n.toggle(`${r._type}Editing`,e===r._editorType);this.div.hidden=!1}hasTextLayer(e){var n;return e===((n=C(this,Ws))==null?void 0:n.div)}addInkEditorIfNeeded(e){if(C(this,rt).getMode()!==Vt.INK)return;if(!e){for(const r of C(this,Xi).values())if(r.isEmpty()){r.setInBackground();return}}this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(e){C(this,rt).setEditingState(e)}addCommands(e){C(this,rt).addCommands(e)}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}toggleAnnotationLayerPointerEvents(e=!1){var n;(n=C(this,ul))==null||n.div.classList.toggle("disabled",!e)}enable(){this.div.tabIndex=0,this.togglePointerEvents(!0);const e=new Set;for(const r of C(this,Xi).values())r.enableEditing(),r.show(!0),r.annotationElementId&&(C(this,rt).removeChangedExistingAnnotation(r),e.add(r.annotationElementId));if(!C(this,ul))return;const n=C(this,ul).getEditableAnnotations();for(const r of n){if(r.hide(),C(this,rt).isDeletedAnnotationElement(r.data.id)||e.has(r.data.id))continue;const s=this.deserialize(r);s&&(this.addOrRebuild(s),s.enableEditing())}}disable(){var s;$(this,ev,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1);const e=new Map,n=new Map;for(const i of C(this,Xi).values())if(i.disableEditing(),!!i.annotationElementId){if(i.serialize()!==null){e.set(i.annotationElementId,i);continue}else n.set(i.annotationElementId,i);(s=this.getEditableAnnotation(i.annotationElementId))==null||s.show(),i.remove()}if(C(this,ul)){const i=C(this,ul).getEditableAnnotations();for(const a of i){const{id:o}=a.data;if(C(this,rt).isDeletedAnnotationElement(o))continue;let c=n.get(o);if(c){c.resetAnnotationElement(a),c.show(!1),a.show();continue}c=e.get(o),c&&(C(this,rt).addChangedExistingAnnotation(c),c.renderAnnotationElement(a),c.show(!1)),a.show()}}B(this,fs,xE).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:r}=this.div;for(const i of C(Zo,cd).values())r.remove(`${i._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),$(this,ev,!1)}getEditableAnnotation(e){var n;return((n=C(this,ul))==null?void 0:n.getEditableAnnotation(e))||null}setActiveEditor(e){C(this,rt).getActive()!==e&&C(this,rt).setActiveEditor(e)}enableTextSelection(){var e;this.div.tabIndex=-1,(e=C(this,Ws))!=null&&e.div&&!C(this,Pc)&&($(this,Pc,B(this,fs,xee).bind(this)),C(this,Ws).div.addEventListener("pointerdown",C(this,Pc),{signal:C(this,rt)._signal}),C(this,Ws).div.classList.add("highlighting"))}disableTextSelection(){var e;this.div.tabIndex=0,(e=C(this,Ws))!=null&&e.div&&C(this,Pc)&&(C(this,Ws).div.removeEventListener("pointerdown",C(this,Pc)),$(this,Pc,null),C(this,Ws).div.classList.remove("highlighting"))}enableClick(){if(C(this,Rc))return;const e=C(this,rt)._signal;$(this,Rc,this.pointerdown.bind(this)),$(this,Nh,this.pointerup.bind(this)),this.div.addEventListener("pointerdown",C(this,Rc),{signal:e}),this.div.addEventListener("pointerup",C(this,Nh),{signal:e})}disableClick(){C(this,Rc)&&(this.div.removeEventListener("pointerdown",C(this,Rc)),this.div.removeEventListener("pointerup",C(this,Nh)),$(this,Rc,null),$(this,Nh,null))}attach(e){C(this,Xi).set(e.id,e);const{annotationElementId:n}=e;n&&C(this,rt).isDeletedAnnotationElement(n)&&C(this,rt).removeDeletedAnnotationElement(e)}detach(e){var n;C(this,Xi).delete(e.id),(n=C(this,Dh))==null||n.removePointerInTextLayer(e.contentDiv),!C(this,ev)&&e.annotationElementId&&C(this,rt).addDeletedAnnotationElement(e)}remove(e){this.detach(e),C(this,rt).removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1,C(this,Zg)||this.addInkEditorIfNeeded(!1)}changeParent(e){var n;e.parent!==this&&(e.parent&&e.annotationElementId&&(C(this,rt).addDeletedAnnotationElement(e.annotationElementId),pn.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),(n=e.parent)==null||n.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(!(e.parent===this&&e.isAttachedToDOM)){if(this.changeParent(e),C(this,rt).addEditor(e),this.attach(e),!e.isAttachedToDOM){const n=e.render();this.div.append(n),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(),C(this,rt).addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){var r;if(!e.isAttachedToDOM)return;const{activeElement:n}=document;e.div.contains(n)&&!C(this,Tc)&&(e._focusEventsAllowed=!1,$(this,Tc,setTimeout(()=>{$(this,Tc,null),e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:C(this,rt)._signal}),n.focus())},0))),e._structTreeParentId=(r=C(this,Dh))==null?void 0:r.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(e.parent||(e.parent=this),e.rebuild(),e.show()):this.add(e)}addUndoableEditor(e){const n=()=>e._uiManager.rebuild(e),r=()=>{e.remove()};this.addCommands({cmd:n,undo:r,mustExec:!1})}getNextId(){return C(this,rt).getId()}get _signal(){return C(this,rt)._signal}canCreateNewEmptyEditor(){var e;return(e=C(this,fs,KM))==null?void 0:e.canCreateNewEmptyEditor()}pasteEditor(e,n){C(this,rt).updateToolbar(e),C(this,rt).updateMode(e);const{offsetX:r,offsetY:s}=B(this,fs,XM).call(this),i=this.getNextId(),a=B(this,fs,YM).call(this,{parent:this,id:i,x:r,y:s,uiManager:C(this,rt),isCentered:!0,...n});a&&this.add(a)}deserialize(e){var n;return((n=C(Zo,cd).get(e.annotationType??e.annotationEditorType))==null?void 0:n.deserialize(e,this,C(this,rt)))||null}createAndAddNewEditor(e,n,r={}){const s=this.getNextId(),i=B(this,fs,YM).call(this,{parent:this,id:s,x:e.offsetX,y:e.offsetY,uiManager:C(this,rt),isCentered:n,...r});return i&&this.add(i),i}addNewEditor(){this.createAndAddNewEditor(B(this,fs,XM).call(this),!0)}setSelected(e){C(this,rt).setSelected(e)}toggleSelected(e){C(this,rt).toggleSelected(e)}isSelected(e){return C(this,rt).isSelected(e)}unselect(e){C(this,rt).unselect(e)}pointerup(e){const{isMac:n}=wi.platform;if(!(e.button!==0||e.ctrlKey&&n)&&e.target===this.div&&C(this,ld)){if($(this,ld,!1),!C(this,Jg)){$(this,Jg,!0);return}if(C(this,rt).getMode()===Vt.STAMP){C(this,rt).unselectAll();return}this.createAndAddNewEditor(e,!1)}}pointerdown(e){if(C(this,rt).getMode()===Vt.HIGHLIGHT&&this.enableTextSelection(),C(this,ld)){$(this,ld,!1);return}const{isMac:n}=wi.platform;if(e.button!==0||e.ctrlKey&&n||e.target!==this.div)return;$(this,ld,!0);const r=C(this,rt).getActive();$(this,Jg,!r||r.isEmpty())}findNewParent(e,n,r){const s=C(this,rt).findParent(n,r);return s===null||s===this?!1:(s.changeParent(e),!0)}destroy(){var e,n;((e=C(this,rt).getActive())==null?void 0:e.parent)===this&&(C(this,rt).commitOrRemove(),C(this,rt).setActiveEditor(null)),C(this,Tc)&&(clearTimeout(C(this,Tc)),$(this,Tc,null));for(const r of C(this,Xi).values())(n=C(this,Dh))==null||n.removePointerInTextLayer(r.contentDiv),r.setParent(null),r.isAttachedToDOM=!1,r.div.remove();this.div=null,C(this,Xi).clear(),C(this,rt).removeLayer(this)}render({viewport:e}){this.viewport=e,sp(this.div,e);for(const n of C(this,rt).getEditors(this.pageIndex))this.add(n),n.rebuild();this.updateMode()}update({viewport:e}){C(this,rt).commitOrRemove(),B(this,fs,xE).call(this);const n=this.viewport.rotation,r=e.rotation;if(this.viewport=e,sp(this.div,{rotation:r}),n!==r)for(const s of C(this,Xi).values())s.rotate(r);this.addInkEditorIfNeeded(!1)}get pageDimensions(){const{pageWidth:e,pageHeight:n}=this.viewport.rawDims;return[e,n]}get scale(){return C(this,rt).viewParameters.realScale}};Dh=new WeakMap,Jg=new WeakMap,ul=new WeakMap,Nh=new WeakMap,Rc=new WeakMap,Pc=new WeakMap,Tc=new WeakMap,Xi=new WeakMap,ld=new WeakMap,Zg=new WeakMap,ev=new WeakMap,Ws=new WeakMap,rt=new WeakMap,cd=new WeakMap,fs=new WeakSet,xee=function(e){if(C(this,rt).unselectAll(),e.target===C(this,Ws).div){const{isMac:n}=wi.platform;if(e.button!==0||e.ctrlKey&&n)return;C(this,rt).showAllEditors("highlight",!0,!0),C(this,Ws).div.classList.add("free"),K1.startHighlighting(this,C(this,rt).direction==="ltr",e),C(this,Ws).div.addEventListener("pointerup",()=>{C(this,Ws).div.classList.remove("free")},{once:!0,signal:C(this,rt)._signal}),e.preventDefault()}},KM=function(){return C(Zo,cd).get(C(this,rt).getMode())},YM=function(e){const n=C(this,fs,KM);return n?new n.prototype.constructor(e):null},XM=function(){const{x:e,y:n,width:r,height:s}=this.div.getBoundingClientRect(),i=Math.max(0,e),a=Math.max(0,n),o=Math.min(window.innerWidth,e+r),c=Math.min(window.innerHeight,n+s),u=(i+o)/2-e,f=(a+c)/2-n,[l,d]=this.viewport.rotation%180===0?[u,f]:[f,u];return{offsetX:l,offsetY:d}},xE=function(){$(this,Zg,!0);for(const e of C(this,Xi).values())e.isEmpty()&&e.remove();$(this,Zg,!1)},He(Zo,"_initialized",!1),z(Zo,cd,new Map([AM,$M,WM,K1].map(e=>[e._editorType,e])));let GM=Zo;var dl,G0,Ir,ud,K0,JM,up,ZM,See;const rs=class rs{constructor({pageIndex:e}){z(this,up);z(this,dl,null);z(this,G0,0);z(this,Ir,new Map);z(this,ud,new Map);this.pageIndex=e}setParent(e){if(!C(this,dl)){$(this,dl,e);return}if(C(this,dl)!==e){if(C(this,Ir).size>0)for(const n of C(this,Ir).values())n.remove(),e.append(n);$(this,dl,e)}}static get _svgFactory(){return Gt(this,"_svgFactory",new V$)}highlight(e,n,r,s=!1){const i=bs(this,G0)._++,a=B(this,up,ZM).call(this,e.box);a.classList.add("highlight"),e.free&&a.classList.add("free");const o=rs._svgFactory.createElement("defs");a.append(o);const c=rs._svgFactory.createElement("path");o.append(c);const u=`path_p${this.pageIndex}_${i}`;c.setAttribute("id",u),c.setAttribute("d",e.toSVGPath()),s&&C(this,ud).set(i,c);const f=B(this,up,See).call(this,o,u),l=rs._svgFactory.createElement("use");return a.append(l),a.setAttribute("fill",n),a.setAttribute("fill-opacity",r),l.setAttribute("href",`#${u}`),C(this,Ir).set(i,a),{id:i,clipPathId:`url(#${f})`}}highlightOutline(e){const n=bs(this,G0)._++,r=B(this,up,ZM).call(this,e.box);r.classList.add("highlightOutline");const s=rs._svgFactory.createElement("defs");r.append(s);const i=rs._svgFactory.createElement("path");s.append(i);const a=`path_p${this.pageIndex}_${n}`;i.setAttribute("id",a),i.setAttribute("d",e.toSVGPath()),i.setAttribute("vector-effect","non-scaling-stroke");let o;if(e.free){r.classList.add("free");const f=rs._svgFactory.createElement("mask");s.append(f),o=`mask_p${this.pageIndex}_${n}`,f.setAttribute("id",o),f.setAttribute("maskUnits","objectBoundingBox");const l=rs._svgFactory.createElement("rect");f.append(l),l.setAttribute("width","1"),l.setAttribute("height","1"),l.setAttribute("fill","white");const d=rs._svgFactory.createElement("use");f.append(d),d.setAttribute("href",`#${a}`),d.setAttribute("stroke","none"),d.setAttribute("fill","black"),d.setAttribute("fill-rule","nonzero"),d.classList.add("mask")}const c=rs._svgFactory.createElement("use");r.append(c),c.setAttribute("href",`#${a}`),o&&c.setAttribute("mask",`url(#${o})`);const u=c.cloneNode();return r.append(u),c.classList.add("mainOutline"),u.classList.add("secondaryOutline"),C(this,Ir).set(n,r),n}finalizeLine(e,n){const r=C(this,ud).get(e);C(this,ud).delete(e),this.updateBox(e,n.box),r.setAttribute("d",n.toSVGPath())}updateLine(e,n){C(this,Ir).get(e).firstChild.firstChild.setAttribute("d",n.toSVGPath())}removeFreeHighlight(e){this.remove(e),C(this,ud).delete(e)}updatePath(e,n){C(this,ud).get(e).setAttribute("d",n.toSVGPath())}updateBox(e,n){var r;B(r=rs,K0,JM).call(r,C(this,Ir).get(e),n)}show(e,n){C(this,Ir).get(e).classList.toggle("hidden",!n)}rotate(e,n){C(this,Ir).get(e).setAttribute("data-main-rotation",n)}changeColor(e,n){C(this,Ir).get(e).setAttribute("fill",n)}changeOpacity(e,n){C(this,Ir).get(e).setAttribute("fill-opacity",n)}addClass(e,n){C(this,Ir).get(e).classList.add(n)}removeClass(e,n){C(this,Ir).get(e).classList.remove(n)}remove(e){C(this,dl)!==null&&(C(this,Ir).get(e).remove(),C(this,Ir).delete(e))}destroy(){$(this,dl,null);for(const e of C(this,Ir).values())e.remove();C(this,Ir).clear()}};dl=new WeakMap,G0=new WeakMap,Ir=new WeakMap,ud=new WeakMap,K0=new WeakSet,JM=function(e,{x:n=0,y:r=0,width:s=1,height:i=1}={}){const{style:a}=e;a.top=`${100*r}%`,a.left=`${100*n}%`,a.width=`${100*s}%`,a.height=`${100*i}%`},up=new WeakSet,ZM=function(e){var r;const n=rs._svgFactory.create(1,1,!0);return C(this,dl).append(n),n.setAttribute("aria-hidden",!0),B(r=rs,K0,JM).call(r,n,e),n},See=function(e,n){const r=rs._svgFactory.createElement("clipPath");e.append(r);const s=`clip_${n}`;r.setAttribute("id",s),r.setAttribute("clipPathUnits","objectBoundingBox");const i=rs._svgFactory.createElement("use");return r.append(i),i.setAttribute("href",`#${n}`),i.classList.add("clip"),s},z(rs,K0);let QM=rs;var c3e=ht.AbortException,u3e=ht.AnnotationEditorLayer,d3e=ht.AnnotationEditorParamsType,f3e=ht.AnnotationEditorType,h3e=ht.AnnotationEditorUIManager,Eee=ht.AnnotationLayer,Cee=ht.AnnotationMode,p3e=ht.CMapCompressionType,m3e=ht.ColorPicker,g3e=ht.DOMSVGFactory,v3e=ht.DrawLayer,y3e=ht.FeatureTest,Z$=ht.GlobalWorkerOptions,b3e=ht.ImageKind,w3e=ht.InvalidPDFException,_3e=ht.MissingPDFException,x3e=ht.OPS,S3e=ht.Outliner,E3e=ht.PDFDataRangeTransport,C3e=ht.PDFDateString,A3e=ht.PDFWorker,R3e=ht.PasswordResponses,P3e=ht.PermissionFlag,T3e=ht.PixelsPerInch,k3e=ht.RenderingCancelledException,Aee=ht.TextLayer,D3e=ht.UnexpectedResponseException,N3e=ht.Util,M3e=ht.VerbosityLevel,O3e=ht.XfaLayer,L3e=ht.build,I3e=ht.createValidAbsoluteUrl,$3e=ht.fetchData,Ree=ht.getDocument,F3e=ht.getFilenameFromUrl,j3e=ht.getPdfFilenameFromUrl,z3e=ht.getXfaPageViewport,B3e=ht.isDataScheme,U3e=ht.isPdfFile,H3e=ht.noContextMenu,W3e=ht.normalizeUnicode,V3e=ht.renderTextLayer,q3e=ht.setLayerDimensions,G3e=ht.shadow,K3e=ht.updateTextLayer,Pee=ht.version;const Y3e=Object.freeze(Object.defineProperty({__proto__:null,AbortException:c3e,AnnotationEditorLayer:u3e,AnnotationEditorParamsType:d3e,AnnotationEditorType:f3e,AnnotationEditorUIManager:h3e,AnnotationLayer:Eee,AnnotationMode:Cee,CMapCompressionType:p3e,ColorPicker:m3e,DOMSVGFactory:g3e,DrawLayer:v3e,FeatureTest:y3e,GlobalWorkerOptions:Z$,ImageKind:b3e,InvalidPDFException:w3e,MissingPDFException:_3e,OPS:x3e,Outliner:S3e,PDFDataRangeTransport:E3e,PDFDateString:C3e,PDFWorker:A3e,PasswordResponses:R3e,PermissionFlag:P3e,PixelsPerInch:T3e,RenderingCancelledException:k3e,TextLayer:Aee,UnexpectedResponseException:D3e,Util:N3e,VerbosityLevel:M3e,XfaLayer:O3e,build:L3e,createValidAbsoluteUrl:I3e,fetchData:$3e,getDocument:Ree,getFilenameFromUrl:F3e,getPdfFilenameFromUrl:j3e,getXfaPageViewport:z3e,isDataScheme:B3e,isPdfFile:U3e,noContextMenu:H3e,normalizeUnicode:W3e,renderTextLayer:V3e,setLayerDimensions:q3e,shadow:G3e,updateTextLayer:K3e,version:Pee},Symbol.toStringTag,{value:"Module"}));var Gr=function(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,i;r<s;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},X3e=["onCopy","onCut","onPaste"],Q3e=["onCompositionEnd","onCompositionStart","onCompositionUpdate"],J3e=["onFocus","onBlur"],Z3e=["onInput","onInvalid","onReset","onSubmit"],eze=["onLoad","onError"],tze=["onKeyDown","onKeyPress","onKeyUp"],nze=["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],rze=["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],sze=["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],ize=["onSelect"],oze=["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],aze=["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],lze=["onScroll"],cze=["onWheel"],uze=["onAnimationStart","onAnimationEnd","onAnimationIteration"],dze=["onTransitionEnd"],fze=["onToggle"],hze=["onChange"],pze=Gr(Gr(Gr(Gr(Gr(Gr(Gr(Gr(Gr(Gr(Gr(Gr(Gr(Gr(Gr(Gr(Gr(Gr([],X3e,!0),Q3e,!0),J3e,!0),Z3e,!0),eze,!0),tze,!0),nze,!0),rze,!0),sze,!0),ize,!0),oze,!0),aze,!0),lze,!0),cze,!0),uze,!0),dze,!0),hze,!0),fze,!0);function Tee(t,e){var n={};return pze.forEach(function(r){var s=t[r];s&&(e?n[r]=function(i){return s(i,e(r))}:n[r]=s)}),n}function B_(t){var e=!1,n=new Promise(function(r,s){t.then(function(i){return!e&&r(i)}).catch(function(i){return!e&&s(i)})});return{promise:n,cancel:function(){e=!0}}}var mze=function(){},gze=mze;const ks=Od(gze);var yU=Object.prototype.hasOwnProperty;function bU(t,e,n){for(n of t.keys())if(Vm(n,e))return n}function Vm(t,e){var n,r,s;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&Vm(t[r],e[r]););return r===-1}if(n===Set){if(t.size!==e.size)return!1;for(r of t)if(s=r,s&&typeof s=="object"&&(s=bU(e,s),!s)||!e.has(s))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(r of t)if(s=r[0],s&&typeof s=="object"&&(s=bU(e,s),!s)||!Vm(r[1],e.get(s)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((r=t.byteLength)===e.byteLength)for(;r--&&t.getInt8(r)===e.getInt8(r););return r===-1}if(ArrayBuffer.isView(t)){if((r=t.byteLength)===e.byteLength)for(;r--&&t[r]===e[r];);return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(yU.call(t,n)&&++r&&!yU.call(e,n)||!(n in e)||!Vm(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}const kee=_.createContext(null);function qm({children:t,type:e}){return P.jsx("div",{className:`react-pdf__message react-pdf__message--${e}`,children:t})}const vze="noopener noreferrer nofollow";class yze{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(e){this.pdfDocument=e}setViewer(e){this.pdfViewer=e}setExternalLinkRel(e){this.externalLinkRel=e}setExternalLinkTarget(e){this.externalLinkTarget=e}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return Rn(this.pdfViewer),this.pdfViewer.currentPageNumber||0}set page(e){Rn(this.pdfViewer),this.pdfViewer.currentPageNumber=e}get rotation(){return 0}set rotation(e){}goToDestination(e){return new Promise(n=>{Rn(this.pdfDocument),Rn(e),typeof e=="string"?this.pdfDocument.getDestination(e).then(n):Array.isArray(e)?n(e):e.then(n)}).then(n=>{Rn(Array.isArray(n));const r=n[0];new Promise(s=>{Rn(this.pdfDocument),r instanceof Object?this.pdfDocument.getPageIndex(r).then(i=>{s(i)}).catch(()=>{Rn(!1)}):typeof r=="number"?s(r):Rn(!1)}).then(s=>{const i=s+1;Rn(this.pdfViewer),Rn(i>=1&&i<=this.pagesCount),this.pdfViewer.scrollPageIntoView({dest:n,pageIndex:s,pageNumber:i})})})}navigateTo(e){this.goToDestination(e)}goToPage(e){const n=e-1;Rn(this.pdfViewer),Rn(e>=1&&e<=this.pagesCount),this.pdfViewer.scrollPageIntoView({pageIndex:n,pageNumber:e})}addLinkAttributes(e,n,r){e.href=n,e.rel=this.externalLinkRel||vze,e.target=r?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const wU={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},nR=typeof document<"u",Dee=nR&&window.location.protocol==="file:";function bze(t){return typeof t<"u"}function uf(t){return bze(t)&&t!==null}function wze(t){return typeof t=="string"}function _ze(t){return t instanceof ArrayBuffer}function xze(t){return Rn(nR),t instanceof Blob}function eO(t){return wze(t)&&/^data:/.test(t)}function _U(t){Rn(eO(t));const[e="",n=""]=t.split(",");return e.split(";").indexOf("base64")!==-1?atob(n):unescape(n)}function Sze(){return nR&&window.devicePixelRatio||1}const Nee="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function xU(){ks(!Dee,`Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ${Nee}`)}function Eze(){ks(!Dee,`Loading PDF.js worker may not work on protocols other than HTTP/HTTPS. ${Nee}`)}function ap(t){t!=null&&t.cancel&&t.cancel()}function tO(t,e){return Object.defineProperty(t,"width",{get(){return this.view[2]*e},configurable:!0}),Object.defineProperty(t,"height",{get(){return this.view[3]*e},configurable:!0}),Object.defineProperty(t,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(t,"originalHeight",{get(){return this.view[3]},configurable:!0}),t}function Cze(t){return t.name==="RenderingCancelledException"}function Aze(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=()=>{if(!r.result)return n(new Error("Error while reading a file."));e(r.result)},r.onerror=s=>{if(!s.target)return n(new Error("Error while reading a file."));const{error:i}=s.target;if(!i)return n(new Error("Error while reading a file."));switch(i.code){case i.NOT_FOUND_ERR:return n(new Error("Error while reading a file: File not found."));case i.SECURITY_ERR:return n(new Error("Error while reading a file: Security error."));case i.ABORT_ERR:return n(new Error("Error while reading a file: Aborted."));default:return n(new Error("Error while reading a file."))}},r.readAsArrayBuffer(t)})}function Rze(t,e){switch(e.type){case"RESOLVE":return{value:e.value,error:void 0};case"REJECT":return{value:!1,error:e.error};case"RESET":return{value:void 0,error:void 0};default:return t}}function vv(){return _.useReducer(Rze,{value:void 0,error:void 0})}var Pze=function(t,e,n,r){function s(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function o(f){try{u(r.next(f))}catch(l){a(l)}}function c(f){try{u(r.throw(f))}catch(l){a(l)}}function u(f){f.done?i(f.value):s(f.value).then(o,c)}u((r=r.apply(t,e||[])).next())})},SU=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n};const{PDFDataRangeTransport:Tze}=Y3e,kze=(t,e)=>{switch(e){case wU.NEED_PASSWORD:{const n=prompt("Enter the password to open this PDF file.");t(n);break}case wU.INCORRECT_PASSWORD:{const n=prompt("Invalid password. Please try again.");t(n);break}}};function EU(t){return typeof t=="object"&&t!==null&&("data"in t||"range"in t||"url"in t)}const Dze=_.forwardRef(function(e,n){var{children:r,className:s,error:i="Failed to load PDF file.",externalLinkRel:a,externalLinkTarget:o,file:c,inputRef:u,imageResourcesPath:f,loading:l="Loading PDF…",noData:d="No PDF file specified.",onItemClick:m,onLoadError:p,onLoadProgress:h,onLoadSuccess:y,onPassword:g=kze,onSourceError:v,onSourceSuccess:w,options:x,renderMode:A,rotate:k}=e,R=SU(e,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[E,T]=vv(),{value:D,error:M}=E,[L,I]=vv(),{value:F,error:U}=L,Y=_.useRef(new yze),W=_.useRef([]),H=_.useRef(void 0),ee=_.useRef(void 0);c&&c!==H.current&&EU(c)&&(ks(!Vm(c,H.current),`File prop passed to <Document /> changed, but it's equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "file" prop.`),H.current=c),x&&x!==ee.current&&(ks(!Vm(x,ee.current),`Options prop passed to <Document /> changed, but it's equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "options" prop.`),ee.current=x);const re=_.useRef({scrollPageIntoView:ye=>{const{dest:$e,pageNumber:ut,pageIndex:Qe=ut-1}=ye;if(m){m({dest:$e,pageIndex:Qe,pageNumber:ut});return}const yt=W.current[Qe];if(yt){yt.scrollIntoView();return}ks(!1,`An internal link leading to page ${ut} was clicked, but neither <Document> was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to <Document> and handle navigating by yourself or ensure that all pages are rendered within <Document>.`)}});_.useImperativeHandle(n,()=>({linkService:Y,pages:W,viewer:re}),[]);function X(){w&&w()}function G(){M&&(ks(!1,M.toString()),v&&v(M))}function K(){T({type:"RESET"})}_.useEffect(K,[c,T]);const J=_.useCallback(()=>Pze(this,void 0,void 0,function*(){if(!c)return null;if(typeof c=="string")return eO(c)?{data:_U(c)}:(xU(),{url:c});if(c instanceof Tze)return{range:c};if(_ze(c))return{data:c};if(nR&&xze(c))return{data:yield Aze(c)};if(Rn(typeof c=="object"),Rn(EU(c)),"url"in c&&typeof c.url=="string"){if(eO(c.url)){const{url:ye}=c,$e=SU(c,["url"]),ut=_U(ye);return Object.assign({data:ut},$e)}xU()}return c}),[c]);_.useEffect(()=>{const ye=B_(J());return ye.promise.then($e=>{T({type:"RESOLVE",value:$e})}).catch($e=>{T({type:"REJECT",error:$e})}),()=>{ap(ye)}},[J,T]),_.useEffect(()=>{if(!(typeof D>"u")){if(D===!1){G();return}X()}},[D]);function ue(){F&&(y&&y(F),W.current=new Array(F.numPages),Y.current.setDocument(F))}function de(){U&&(ks(!1,U.toString()),p&&p(U))}_.useEffect(function(){I({type:"RESET"})},[I,D]),_.useEffect(function(){if(!D)return;const $e=Object.assign(Object.assign({},D),x),ut=Ree($e);h&&(ut.onProgress=h),g&&(ut.onPassword=g);const Qe=ut;return Qe.promise.then(yt=>{I({type:"RESOLVE",value:yt})}).catch(yt=>{Qe.destroyed||I({type:"REJECT",error:yt})}),()=>{Qe.destroy()}},[x,I,D]),_.useEffect(()=>{if(!(typeof F>"u")){if(F===!1){de();return}ue()}},[F]),_.useEffect(function(){Y.current.setViewer(re.current),Y.current.setExternalLinkRel(a),Y.current.setExternalLinkTarget(o)},[a,o]);const ie=_.useCallback((ye,$e)=>{W.current[ye]=$e},[]),be=_.useCallback(ye=>{delete W.current[ye]},[]),Ae=_.useMemo(()=>({imageResourcesPath:f,linkService:Y.current,onItemClick:m,pdf:F,registerPage:ie,renderMode:A,rotate:k,unregisterPage:be}),[f,m,F,ie,A,k,be]),_e=_.useMemo(()=>Tee(R,()=>F),[R,F]);function Oe(){return P.jsx(kee.Provider,{value:Ae,children:r})}function Ne(){return c?F==null?P.jsx(qm,{type:"loading",children:typeof l=="function"?l():l}):F===!1?P.jsx(qm,{type:"error",children:typeof i=="function"?i():i}):Oe():P.jsx(qm,{type:"no-data",children:typeof d=="function"?d():d})}return P.jsx("div",Object.assign({className:hp("react-pdf__Document",s),ref:u,style:{"--scale-factor":"1"}},_e,{children:Ne()}))});function Mee(){return _.useContext(kee)}function Oee(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.filter(Boolean);if(n.length<=1){var r=n[0];return r||null}return function(i){n.forEach(function(a){typeof a=="function"?a(i):a&&(a.current=i)})}}const Lee=_.createContext(null),Iee={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},Nze=/^H(\d+)$/;function Mze(t){return t in Iee}function rR(t){return"children"in t}function $ee(t){return rR(t)?t.children.length===1&&0 in t.children&&"id"in t.children[0]:!1}function Oze(t){const e={};if(rR(t)){const{role:n}=t,r=n.match(Nze);if(r)e.role="heading",e["aria-level"]=Number(r[1]);else if(Mze(n)){const s=Iee[n];s&&(e.role=s)}}return e}function Fee(t){const e={};if(rR(t)){if(t.alt!==void 0&&(e["aria-label"]=t.alt),t.lang!==void 0&&(e.lang=t.lang),$ee(t)){const[n]=t.children;if(n){const r=Fee(n);return Object.assign(Object.assign({},e),r)}}}else"id"in t&&(e["aria-owns"]=t.id);return e}function Lze(t){return t?Object.assign(Object.assign({},Oze(t)),Fee(t)):null}function jee({className:t,node:e}){const n=_.useMemo(()=>Lze(e),[e]),r=_.useMemo(()=>!rR(e)||$ee(e)?null:e.children.map((s,i)=>P.jsx(jee,{node:s},i)),[e]);return P.jsx("span",Object.assign({className:t},n,{children:r}))}function sR(){return _.useContext(Lee)}function Ize(){const t=sR();Rn(t);const{onGetStructTreeError:e,onGetStructTreeSuccess:n}=t,[r,s]=vv(),{value:i,error:a}=r,{customTextRenderer:o,page:c}=t;function u(){i&&n&&n(i)}function f(){a&&(ks(!1,a.toString()),e&&e(a))}return _.useEffect(function(){s({type:"RESET"})},[s,c]),_.useEffect(function(){if(o||!c)return;const d=B_(c.getStructTree()),m=d;return d.promise.then(p=>{s({type:"RESOLVE",value:p})}).catch(p=>{s({type:"REJECT",error:p})}),()=>ap(m)},[o,c,s]),_.useEffect(()=>{if(i!==void 0){if(i===!1){f();return}u()}},[i]),i?P.jsx(jee,{className:"react-pdf__Page__structTree structTree",node:i}):null}const CU=Cee;function $ze(t){const e=sR();Rn(e);const n=Object.assign(Object.assign({},e),t),{_className:r,canvasBackground:s,devicePixelRatio:i=Sze(),onRenderError:a,onRenderSuccess:o,page:c,renderForms:u,renderTextLayer:f,rotate:l,scale:d}=n,{canvasRef:m}=t;Rn(c);const p=_.useRef(null);function h(){c&&o&&o(tO(c,d))}function y(x){Cze(x)||(ks(!1,x.toString()),a&&a(x))}const g=_.useMemo(()=>c.getViewport({scale:d*i,rotation:l}),[i,c,l,d]),v=_.useMemo(()=>c.getViewport({scale:d,rotation:l}),[c,l,d]);_.useEffect(function(){if(!c)return;c.cleanup();const{current:A}=p;if(!A)return;A.width=g.width,A.height=g.height,A.style.width=`${Math.floor(v.width)}px`,A.style.height=`${Math.floor(v.height)}px`,A.style.visibility="hidden";const k={annotationMode:u?CU.ENABLE_FORMS:CU.ENABLE,canvasContext:A.getContext("2d",{alpha:!1}),viewport:g};s&&(k.background=s);const R=c.render(k),E=R;return R.promise.then(()=>{A.style.visibility="",h()}).catch(y),()=>ap(E)},[s,c,u,g,v]);const w=_.useCallback(()=>{const{current:x}=p;x&&(x.width=0,x.height=0)},[]);return _.useEffect(()=>w,[w]),P.jsx("canvas",{className:`${r}__canvas`,dir:"ltr",ref:Oee(m,p),style:{display:"block",userSelect:"none"},children:f?P.jsx(Ize,{}):null})}function Fze(t){return"str"in t}function jze(){const t=sR();Rn(t);const{customTextRenderer:e,onGetTextError:n,onGetTextSuccess:r,onRenderTextLayerError:s,onRenderTextLayerSuccess:i,page:a,pageIndex:o,pageNumber:c,rotate:u,scale:f}=t;Rn(a);const[l,d]=vv(),{value:m,error:p}=l,h=_.useRef(null),y=_.useRef(void 0);ks(Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10)===1,"TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer");function g(){m&&r&&r(m)}function v(){p&&(ks(!1,p.toString()),n&&n(p))}_.useEffect(function(){d({type:"RESET"})},[a,d]),_.useEffect(function(){if(!a)return;const T=B_(a.getTextContent()),D=T;return T.promise.then(M=>{d({type:"RESOLVE",value:M})}).catch(M=>{d({type:"REJECT",error:M})}),()=>ap(D)},[a,d]),_.useEffect(()=>{if(m!==void 0){if(m===!1){v();return}g()}},[m]);const w=_.useCallback(()=>{i&&i()},[i]),x=_.useCallback(E=>{ks(!1,E.toString()),s&&s(E)},[s]);function A(){const E=y.current;E&&E.classList.add("active")}function k(){const E=y.current;E&&E.classList.remove("active")}const R=_.useMemo(()=>a.getViewport({scale:f,rotation:u}),[a,u,f]);return _.useLayoutEffect(function(){if(!a||!m)return;const{current:T}=h;if(!T)return;T.innerHTML="";const D=a.streamTextContent({includeMarkedContent:!0}),M={container:T,textContentSource:D,viewport:R},L=new Aee(M),I=L;return L.render().then(()=>{const F=document.createElement("div");F.className="endOfContent",T.append(F),y.current=F;const U=T.querySelectorAll('[role="presentation"]');if(e){let Y=0;m.items.forEach((W,H)=>{if(!Fze(W))return;const ee=U[Y];if(!ee)return;const re=e(Object.assign({pageIndex:o,pageNumber:c,itemIndex:H},W));ee.innerHTML=re,Y+=W.str&&W.hasEOL?2:1})}w()}).catch(x),()=>ap(I)},[e,x,w,a,o,c,m,R]),P.jsx("div",{className:hp("react-pdf__Page__textContent","textLayer"),onMouseUp:k,onMouseDown:A,ref:h})}function zze(){const t=Mee(),e=sR();Rn(e);const n=Object.assign(Object.assign({},t),e),{imageResourcesPath:r,linkService:s,onGetAnnotationsError:i,onGetAnnotationsSuccess:a,onRenderAnnotationLayerError:o,onRenderAnnotationLayerSuccess:c,page:u,pdf:f,renderForms:l,rotate:d,scale:m=1}=n;Rn(f),Rn(u),Rn(s);const[p,h]=vv(),{value:y,error:g}=p,v=_.useRef(null);ks(Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10)===1,"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations");function w(){y&&a&&a(y)}function x(){g&&(ks(!1,g.toString()),i&&i(g))}_.useEffect(function(){h({type:"RESET"})},[h,u]),_.useEffect(function(){if(!u)return;const T=B_(u.getAnnotations()),D=T;return T.promise.then(M=>{h({type:"RESOLVE",value:M})}).catch(M=>{h({type:"REJECT",error:M})}),()=>{ap(D)}},[h,u]),_.useEffect(()=>{if(y!==void 0){if(y===!1){x();return}w()}},[y]);function A(){c&&c()}function k(E){ks(!1,`${E}`),o&&o(E)}const R=_.useMemo(()=>u.getViewport({scale:m,rotation:d}),[u,d,m]);return _.useEffect(function(){if(!f||!u||!s||!y)return;const{current:T}=v;if(!T)return;const D=R.clone({dontFlip:!0}),M={accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,div:T,l10n:null,page:u,viewport:D},L={annotations:y,annotationStorage:f.annotationStorage,div:T,imageResourcesPath:r,linkService:s,page:u,renderForms:l,viewport:D};T.innerHTML="";try{new Eee(M).render(L),A()}catch(I){k(I)}return()=>{}},[y,r,s,u,f,l,R]),P.jsx("div",{className:hp("react-pdf__Page__annotations","annotationLayer"),ref:v})}var Bze=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n};const AU=1;function RU(t){const e=Mee(),n=Object.assign(Object.assign({},e),t),{_className:r="react-pdf__Page",_enableRegisterUnregisterPage:s=!0,canvasBackground:i,canvasRef:a,children:o,className:c,customRenderer:u,customTextRenderer:f,devicePixelRatio:l,error:d="Failed to load the page.",height:m,inputRef:p,loading:h="Loading page…",noData:y="No page specified.",onGetAnnotationsError:g,onGetAnnotationsSuccess:v,onGetStructTreeError:w,onGetStructTreeSuccess:x,onGetTextError:A,onGetTextSuccess:k,onLoadError:R,onLoadSuccess:E,onRenderAnnotationLayerError:T,onRenderAnnotationLayerSuccess:D,onRenderError:M,onRenderSuccess:L,onRenderTextLayerError:I,onRenderTextLayerSuccess:F,pageIndex:U,pageNumber:Y,pdf:W,registerPage:H,renderAnnotationLayer:ee=!0,renderForms:re=!1,renderMode:X="canvas",renderTextLayer:G=!0,rotate:K,scale:J=AU,unregisterPage:ue,width:de}=n,ie=Bze(n,["_className","_enableRegisterUnregisterPage","canvasBackground","canvasRef","children","className","customRenderer","customTextRenderer","devicePixelRatio","error","height","inputRef","loading","noData","onGetAnnotationsError","onGetAnnotationsSuccess","onGetStructTreeError","onGetStructTreeSuccess","onGetTextError","onGetTextSuccess","onLoadError","onLoadSuccess","onRenderAnnotationLayerError","onRenderAnnotationLayerSuccess","onRenderError","onRenderSuccess","onRenderTextLayerError","onRenderTextLayerSuccess","pageIndex","pageNumber","pdf","registerPage","renderAnnotationLayer","renderForms","renderMode","renderTextLayer","rotate","scale","unregisterPage","width"]),[be,Ae]=vv(),{value:_e,error:Oe}=be,Ne=_.useRef(null);Rn(W);const ye=uf(Y)?Y-1:U??null,$e=Y??(uf(U)?U+1:null),ut=K??(_e?_e.rotate:null),Qe=_.useMemo(()=>{if(!_e)return null;let xe=1;const Te=J??AU;if(de||m){const Ye=_e.getViewport({scale:1,rotation:ut});de?xe=de/Ye.width:m&&(xe=m/Ye.height)}return Te*xe},[m,_e,ut,J,de]);_.useEffect(function(){return()=>{uf(ye)&&s&&ue&&ue(ye)}},[s,W,ye,ue]);function yt(){if(E){if(!_e||!Qe)return;E(tO(_e,Qe))}if(s&&H){if(!uf(ye)||!Ne.current)return;H(ye,Ne.current)}}function En(){Oe&&(ks(!1,Oe.toString()),R&&R(Oe))}_.useEffect(function(){Ae({type:"RESET"})},[Ae,W,ye]),_.useEffect(function(){if(!W||!$e)return;const Te=B_(W.getPage($e)),Ye=Te;return Te.promise.then(Pt=>{Ae({type:"RESOLVE",value:Pt})}).catch(Pt=>{Ae({type:"REJECT",error:Pt})}),()=>ap(Ye)},[Ae,W,$e]),_.useEffect(()=>{if(_e!==void 0){if(_e===!1){En();return}yt()}},[_e,Qe]);const Xt=_.useMemo(()=>_e&&uf(ye)&&$e&&uf(ut)&&uf(Qe)?{_className:r,canvasBackground:i,customTextRenderer:f,devicePixelRatio:l,onGetAnnotationsError:g,onGetAnnotationsSuccess:v,onGetStructTreeError:w,onGetStructTreeSuccess:x,onGetTextError:A,onGetTextSuccess:k,onRenderAnnotationLayerError:T,onRenderAnnotationLayerSuccess:D,onRenderError:M,onRenderSuccess:L,onRenderTextLayerError:I,onRenderTextLayerSuccess:F,page:_e,pageIndex:ye,pageNumber:$e,renderForms:re,renderTextLayer:G,rotate:ut,scale:Qe}:null,[r,i,f,l,g,v,w,x,A,k,T,D,M,L,I,F,_e,ye,$e,re,G,ut,Qe]),gn=_.useMemo(()=>Tee(ie,()=>_e&&(Qe?tO(_e,Qe):void 0)),[ie,_e,Qe]),Qt=`${ye}@${Qe}/${ut}`;function Z(){switch(X){case"custom":return Rn(u),P.jsx(u,{},`${Qt}_custom`);case"none":return null;case"canvas":default:return P.jsx($ze,{canvasRef:a},`${Qt}_canvas`)}}function fe(){return G?P.jsx(jze,{},`${Qt}_text`):null}function ge(){return ee?P.jsx(zze,{},`${Qt}_annotations`):null}function Pe(){return P.jsxs(Lee.Provider,{value:Xt,children:[Z(),fe(),ge(),o]})}function Me(){return $e?W===null||_e===void 0||_e===null?P.jsx(qm,{type:"loading",children:typeof h=="function"?h():h}):W===!1||_e===!1?P.jsx(qm,{type:"error",children:typeof d=="function"?d():d}):Pe():P.jsx(qm,{type:"no-data",children:typeof y=="function"?y():y})}return P.jsx("div",Object.assign({className:hp(r,c),"data-page-number":$e,ref:Oee(p,Ne),style:{"--scale-factor":`${Qe}`,backgroundColor:i||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},gn,{children:Me()}))}Eze();Z$.workerSrc="pdf.worker.mjs";Z$.workerSrc=`//unpkg.com/pdfjs-dist@${Pee}/build/pdf.worker.min.mjs`;const Jp=800,Uze={},F5e=({file:t,onThumbnailClick:e,className:n})=>{const[r,s]=_.useState(0),[i,a]=_.useState(1),[o,c]=_.useState(void 0),[u,f]=_.useState(null),[l,d]=_.useState(),m=_.useCallback(A=>{const[k]=A;k&&d(k.contentRect.width)},[]);aFe(u,Uze,m);const p=_.useCallback(()=>{c(i)},[c,i]);function h({numPages:A}){a(1),s(A)}const y=_.useCallback(A=>a(k=>A>0?Math.min(k+A,r):Math.max(k+A,1)),[r]),g=_.useCallback(()=>y(1),[y]),v=_.useCallback(()=>y(-1),[y]),w=_.useMemo(()=>o!==i,[o,i]),x=_.useMemo(()=>({cMapUrl:"/cmaps/",standardFontDataUrl:"/standard_fonts/"}),[]);return P.jsxs("div",{className:ce("flex flex-col cursor-default text-center",n),ref:f,children:[P.jsxs(Dze,{file:t,onLoadSuccess:h,loading:P.jsx(RJ,{className:"w-full mx-auto mt-32"}),options:x,className:ce(`w-full aspect-[3/4] relative bg-white shadow w-[${l?Math.min(l,Jp):Jp}]`,e?"cursor-pointer":""),children:[P.jsx(RU,{className:w&&o?"visible":"hidden",pageNumber:o,canvasBackground:"white",width:l?Math.min(l,Jp):Jp,onClick:()=>e?e():null},`page_${o}`),P.jsx(RU,{className:ce(w&&o?"hidden":"visible","text-center"),pageNumber:i,canvasBackground:"white",onRenderSuccess:p,width:l?Math.min(l,Jp):Jp,onClick:()=>e?e():null},i)]}),P.jsxs("div",{className:"flex flex-row justify-center w-full mt-4 space-x-4",children:[P.jsxs(Ci,{type:"button",variant:"outline",className:"w-8 h-8 p-0",onClick:v,disabled:w,children:[P.jsx("span",{className:"sr-only",children:ft("common.go_to_prev_page")}),P.jsx(pL,{className:"w-4 h-4"})]}),P.jsxs(Ci,{type:"button",variant:"outline",className:"w-8 h-8 p-0",onClick:g,disabled:w,children:[P.jsx("span",{className:"sr-only",children:ft("common.go_to_next_page")}),P.jsx(s_,{className:"w-4 h-4"})]})]}),P.jsx("p",{className:"mt-4 text-sm font-medium text-center",children:ft("common.num_page_of_total",{count:i,total:r})})]})},PU=({children:t})=>{const e=Vd(),{i18n:n}=SJ(),r=_.useId(),{isSuccess:s,isLoading:i,data:{authenticated:a=!1,redirectTo:o="/login"}={}}=Wde(),{isSuccess:c,isLoading:u,isFetching:f,error:l,data:d}=qW({enabled:s&&a}),m=d==null?void 0:d.lang_code,p=n.resolvedLanguage??n.language,h=!m||p===m;return se.useEffect(()=>{c&&m&&!h&&n.changeLanguage(m)},[c,m,h,n]),i||u||c&&d===null&&f||c&&(d!=null&&d.id)&&!h?P.jsx(Es,{}):l?(console.error("Error loading profile:",l),P.jsx(hJ,{subtitle:l.message})):s&&!a||c&&!(d!=null&&d.id)?(console.debug("Not authenticated, redirecting to:",o),P.jsx(PQ,{to:o,state:{from:e},replace:!0})):P.jsx("div",{id:`${r}-${d==null?void 0:d.lang_code}`,children:t??null})},PS={draft:{color:"text-gray-700",bgColor:"bg-gray-200",hoverColor:"hover:text-gray-900",hoverBgColor:"hover:bg-gray-300"},ready:{color:"text-blue-700",bgColor:"bg-blue-200",hoverColor:"hover:text-blue-900",hoverBgColor:"hover:bg-blue-300"},delivered:{color:"text-yellow-700",bgColor:"bg-yellow-200",hoverColor:"hover:text-yellow-900",hoverBgColor:"hover:bg-yellow-300"},accepted:{color:"text-green-700",bgColor:"bg-green-200",hoverColor:"hover:text-green-900",hoverBgColor:"hover:bg-green-300"},rejected:{color:"text-red-700",bgColor:"bg-red-200",hoverColor:"hover:text-red-900",hoverBgColor:"hover:bg-red-300"},archived:{color:"text-purple-700",bgColor:"bg-purple-200",hoverColor:"hover:text-purple-900",hoverBgColor:"hover:bg-purple-300"}},j5e=_.forwardRef(({status:t,isEditable:e,className:n,...r},s)=>P.jsx("div",{ref:s,children:P.jsxs(Kpe,{className:ce(PS[t].bgColor,PS[t].color,PS[t].hoverBgColor,PS[t].hoverColor,"transition-colors duration-200 cursor-pointer flex items-center group",n),...r,children:[ft(`quotes.status.${t}`),e&&P.jsx(Lfe,{className:"w-3 h-3 ml-2 transition-opacity opacity-0 group-hover:opacity-100"})]})}));function Hze(){return null}var e2={},U_={},zee={exports:{}};function Wze(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pk={exports:{}};const Vze={},ib=Object.freeze(Object.defineProperty({__proto__:null,default:Vze},Symbol.toStringTag,{value:"Module"})),qze=Ale(ib);var TU;function Gd(){return TU||(TU=1,function(t,e){(function(n,r){t.exports=r()})(yr,function(){var n=n||function(r,s){var i;if(typeof window<"u"&&window.crypto&&(i=window.crypto),typeof self<"u"&&self.crypto&&(i=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window<"u"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof yr<"u"&&yr.crypto&&(i=yr.crypto),!i&&typeof Wze=="function")try{i=qze}catch{}var a=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function v(){}return function(w){var x;return v.prototype=w,x=new v,v.prototype=null,x}}(),c={},u=c.lib={},f=u.Base=function(){return{extend:function(v){var w=o(this);return v&&w.mixIn(v),(!w.hasOwnProperty("init")||this.init===w.init)&&(w.init=function(){w.$super.init.apply(this,arguments)}),w.init.prototype=w,w.$super=this,w},create:function(){var v=this.extend();return v.init.apply(v,arguments),v},init:function(){},mixIn:function(v){for(var w in v)v.hasOwnProperty(w)&&(this[w]=v[w]);v.hasOwnProperty("toString")&&(this.toString=v.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),l=u.WordArray=f.extend({init:function(v,w){v=this.words=v||[],w!=s?this.sigBytes=w:this.sigBytes=v.length*4},toString:function(v){return(v||m).stringify(this)},concat:function(v){var w=this.words,x=v.words,A=this.sigBytes,k=v.sigBytes;if(this.clamp(),A%4)for(var R=0;R<k;R++){var E=x[R>>>2]>>>24-R%4*8&255;w[A+R>>>2]|=E<<24-(A+R)%4*8}else for(var T=0;T<k;T+=4)w[A+T>>>2]=x[T>>>2];return this.sigBytes+=k,this},clamp:function(){var v=this.words,w=this.sigBytes;v[w>>>2]&=4294967295<<32-w%4*8,v.length=r.ceil(w/4)},clone:function(){var v=f.clone.call(this);return v.words=this.words.slice(0),v},random:function(v){for(var w=[],x=0;x<v;x+=4)w.push(a());return new l.init(w,v)}}),d=c.enc={},m=d.Hex={stringify:function(v){for(var w=v.words,x=v.sigBytes,A=[],k=0;k<x;k++){var R=w[k>>>2]>>>24-k%4*8&255;A.push((R>>>4).toString(16)),A.push((R&15).toString(16))}return A.join("")},parse:function(v){for(var w=v.length,x=[],A=0;A<w;A+=2)x[A>>>3]|=parseInt(v.substr(A,2),16)<<24-A%8*4;return new l.init(x,w/2)}},p=d.Latin1={stringify:function(v){for(var w=v.words,x=v.sigBytes,A=[],k=0;k<x;k++){var R=w[k>>>2]>>>24-k%4*8&255;A.push(String.fromCharCode(R))}return A.join("")},parse:function(v){for(var w=v.length,x=[],A=0;A<w;A++)x[A>>>2]|=(v.charCodeAt(A)&255)<<24-A%4*8;return new l.init(x,w)}},h=d.Utf8={stringify:function(v){try{return decodeURIComponent(escape(p.stringify(v)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(v){return p.parse(unescape(encodeURIComponent(v)))}},y=u.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(v){typeof v=="string"&&(v=h.parse(v)),this._data.concat(v),this._nDataBytes+=v.sigBytes},_process:function(v){var w,x=this._data,A=x.words,k=x.sigBytes,R=this.blockSize,E=R*4,T=k/E;v?T=r.ceil(T):T=r.max((T|0)-this._minBufferSize,0);var D=T*R,M=r.min(D*4,k);if(D){for(var L=0;L<D;L+=R)this._doProcessBlock(A,L);w=A.splice(0,D),x.sigBytes-=M}return new l.init(w,M)},clone:function(){var v=f.clone.call(this);return v._data=this._data.clone(),v},_minBufferSize:0});u.Hasher=y.extend({cfg:f.extend(),init:function(v){this.cfg=this.cfg.extend(v),this.reset()},reset:function(){y.reset.call(this),this._doReset()},update:function(v){return this._append(v),this._process(),this},finalize:function(v){v&&this._append(v);var w=this._doFinalize();return w},blockSize:16,_createHelper:function(v){return function(w,x){return new v.init(x).finalize(w)}},_createHmacHelper:function(v){return function(w,x){return new g.HMAC.init(v,x).finalize(w)}}});var g=c.algo={};return c}(Math);return n})}(pk)),pk.exports}(function(t,e){(function(n,r){t.exports=r(Gd())})(yr,function(n){return n.enc.Utf8})})(zee);var Gze=zee.exports,Bee={exports:{}},mk={exports:{}},kU;function Kze(){return kU||(kU=1,function(t,e){(function(n,r){t.exports=r(Gd())})(yr,function(n){return function(){var r=n,s=r.lib,i=s.WordArray,a=r.enc;a.Base64={stringify:function(c){var u=c.words,f=c.sigBytes,l=this._map;c.clamp();for(var d=[],m=0;m<f;m+=3)for(var p=u[m>>>2]>>>24-m%4*8&255,h=u[m+1>>>2]>>>24-(m+1)%4*8&255,y=u[m+2>>>2]>>>24-(m+2)%4*8&255,g=p<<16|h<<8|y,v=0;v<4&&m+v*.75<f;v++)d.push(l.charAt(g>>>6*(3-v)&63));var w=l.charAt(64);if(w)for(;d.length%4;)d.push(w);return d.join("")},parse:function(c){var u=c.length,f=this._map,l=this._reverseMap;if(!l){l=this._reverseMap=[];for(var d=0;d<f.length;d++)l[f.charCodeAt(d)]=d}var m=f.charAt(64);if(m){var p=c.indexOf(m);p!==-1&&(u=p)}return o(c,u,l)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function o(c,u,f){for(var l=[],d=0,m=0;m<u;m++)if(m%4){var p=f[c.charCodeAt(m-1)]<<m%4*2,h=f[c.charCodeAt(m)]>>>6-m%4*2,y=p|h;l[d>>>2]|=y<<24-d%4*8,d++}return i.create(l,d)}}(),n.enc.Base64})}(mk)),mk.exports}var gk={exports:{}},DU;function Yze(){return DU||(DU=1,function(t,e){(function(n,r){t.exports=r(Gd())})(yr,function(n){return function(r){var s=n,i=s.lib,a=i.WordArray,o=i.Hasher,c=s.algo,u=[];(function(){for(var h=0;h<64;h++)u[h]=r.abs(r.sin(h+1))*4294967296|0})();var f=c.MD5=o.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(h,y){for(var g=0;g<16;g++){var v=y+g,w=h[v];h[v]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360}var x=this._hash.words,A=h[y+0],k=h[y+1],R=h[y+2],E=h[y+3],T=h[y+4],D=h[y+5],M=h[y+6],L=h[y+7],I=h[y+8],F=h[y+9],U=h[y+10],Y=h[y+11],W=h[y+12],H=h[y+13],ee=h[y+14],re=h[y+15],X=x[0],G=x[1],K=x[2],J=x[3];X=l(X,G,K,J,A,7,u[0]),J=l(J,X,G,K,k,12,u[1]),K=l(K,J,X,G,R,17,u[2]),G=l(G,K,J,X,E,22,u[3]),X=l(X,G,K,J,T,7,u[4]),J=l(J,X,G,K,D,12,u[5]),K=l(K,J,X,G,M,17,u[6]),G=l(G,K,J,X,L,22,u[7]),X=l(X,G,K,J,I,7,u[8]),J=l(J,X,G,K,F,12,u[9]),K=l(K,J,X,G,U,17,u[10]),G=l(G,K,J,X,Y,22,u[11]),X=l(X,G,K,J,W,7,u[12]),J=l(J,X,G,K,H,12,u[13]),K=l(K,J,X,G,ee,17,u[14]),G=l(G,K,J,X,re,22,u[15]),X=d(X,G,K,J,k,5,u[16]),J=d(J,X,G,K,M,9,u[17]),K=d(K,J,X,G,Y,14,u[18]),G=d(G,K,J,X,A,20,u[19]),X=d(X,G,K,J,D,5,u[20]),J=d(J,X,G,K,U,9,u[21]),K=d(K,J,X,G,re,14,u[22]),G=d(G,K,J,X,T,20,u[23]),X=d(X,G,K,J,F,5,u[24]),J=d(J,X,G,K,ee,9,u[25]),K=d(K,J,X,G,E,14,u[26]),G=d(G,K,J,X,I,20,u[27]),X=d(X,G,K,J,H,5,u[28]),J=d(J,X,G,K,R,9,u[29]),K=d(K,J,X,G,L,14,u[30]),G=d(G,K,J,X,W,20,u[31]),X=m(X,G,K,J,D,4,u[32]),J=m(J,X,G,K,I,11,u[33]),K=m(K,J,X,G,Y,16,u[34]),G=m(G,K,J,X,ee,23,u[35]),X=m(X,G,K,J,k,4,u[36]),J=m(J,X,G,K,T,11,u[37]),K=m(K,J,X,G,L,16,u[38]),G=m(G,K,J,X,U,23,u[39]),X=m(X,G,K,J,H,4,u[40]),J=m(J,X,G,K,A,11,u[41]),K=m(K,J,X,G,E,16,u[42]),G=m(G,K,J,X,M,23,u[43]),X=m(X,G,K,J,F,4,u[44]),J=m(J,X,G,K,W,11,u[45]),K=m(K,J,X,G,re,16,u[46]),G=m(G,K,J,X,R,23,u[47]),X=p(X,G,K,J,A,6,u[48]),J=p(J,X,G,K,L,10,u[49]),K=p(K,J,X,G,ee,15,u[50]),G=p(G,K,J,X,D,21,u[51]),X=p(X,G,K,J,W,6,u[52]),J=p(J,X,G,K,E,10,u[53]),K=p(K,J,X,G,U,15,u[54]),G=p(G,K,J,X,k,21,u[55]),X=p(X,G,K,J,I,6,u[56]),J=p(J,X,G,K,re,10,u[57]),K=p(K,J,X,G,M,15,u[58]),G=p(G,K,J,X,H,21,u[59]),X=p(X,G,K,J,T,6,u[60]),J=p(J,X,G,K,Y,10,u[61]),K=p(K,J,X,G,R,15,u[62]),G=p(G,K,J,X,F,21,u[63]),x[0]=x[0]+X|0,x[1]=x[1]+G|0,x[2]=x[2]+K|0,x[3]=x[3]+J|0},_doFinalize:function(){var h=this._data,y=h.words,g=this._nDataBytes*8,v=h.sigBytes*8;y[v>>>5]|=128<<24-v%32;var w=r.floor(g/4294967296),x=g;y[(v+64>>>9<<4)+15]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,y[(v+64>>>9<<4)+14]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,h.sigBytes=(y.length+1)*4,this._process();for(var A=this._hash,k=A.words,R=0;R<4;R++){var E=k[R];k[R]=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360}return A},clone:function(){var h=o.clone.call(this);return h._hash=this._hash.clone(),h}});function l(h,y,g,v,w,x,A){var k=h+(y&g|~y&v)+w+A;return(k<<x|k>>>32-x)+y}function d(h,y,g,v,w,x,A){var k=h+(y&v|g&~v)+w+A;return(k<<x|k>>>32-x)+y}function m(h,y,g,v,w,x,A){var k=h+(y^g^v)+w+A;return(k<<x|k>>>32-x)+y}function p(h,y,g,v,w,x,A){var k=h+(g^(y|~v))+w+A;return(k<<x|k>>>32-x)+y}s.MD5=o._createHelper(f),s.HmacMD5=o._createHmacHelper(f)}(Math),n.MD5})}(gk)),gk.exports}var vk={exports:{}},yk={exports:{}},NU;function Xze(){return NU||(NU=1,function(t,e){(function(n,r){t.exports=r(Gd())})(yr,function(n){return function(){var r=n,s=r.lib,i=s.WordArray,a=s.Hasher,o=r.algo,c=[],u=o.SHA1=a.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(f,l){for(var d=this._hash.words,m=d[0],p=d[1],h=d[2],y=d[3],g=d[4],v=0;v<80;v++){if(v<16)c[v]=f[l+v]|0;else{var w=c[v-3]^c[v-8]^c[v-14]^c[v-16];c[v]=w<<1|w>>>31}var x=(m<<5|m>>>27)+g+c[v];v<20?x+=(p&h|~p&y)+1518500249:v<40?x+=(p^h^y)+1859775393:v<60?x+=(p&h|p&y|h&y)-1894007588:x+=(p^h^y)-899497514,g=y,y=h,h=p<<30|p>>>2,p=m,m=x}d[0]=d[0]+m|0,d[1]=d[1]+p|0,d[2]=d[2]+h|0,d[3]=d[3]+y|0,d[4]=d[4]+g|0},_doFinalize:function(){var f=this._data,l=f.words,d=this._nDataBytes*8,m=f.sigBytes*8;return l[m>>>5]|=128<<24-m%32,l[(m+64>>>9<<4)+14]=Math.floor(d/4294967296),l[(m+64>>>9<<4)+15]=d,f.sigBytes=l.length*4,this._process(),this._hash},clone:function(){var f=a.clone.call(this);return f._hash=this._hash.clone(),f}});r.SHA1=a._createHelper(u),r.HmacSHA1=a._createHmacHelper(u)}(),n.SHA1})}(yk)),yk.exports}var bk={exports:{}},MU;function Qze(){return MU||(MU=1,function(t,e){(function(n,r){t.exports=r(Gd())})(yr,function(n){(function(){var r=n,s=r.lib,i=s.Base,a=r.enc,o=a.Utf8,c=r.algo;c.HMAC=i.extend({init:function(u,f){u=this._hasher=new u.init,typeof f=="string"&&(f=o.parse(f));var l=u.blockSize,d=l*4;f.sigBytes>d&&(f=u.finalize(f)),f.clamp();for(var m=this._oKey=f.clone(),p=this._iKey=f.clone(),h=m.words,y=p.words,g=0;g<l;g++)h[g]^=1549556828,y[g]^=909522486;m.sigBytes=p.sigBytes=d,this.reset()},reset:function(){var u=this._hasher;u.reset(),u.update(this._iKey)},update:function(u){return this._hasher.update(u),this},finalize:function(u){var f=this._hasher,l=f.finalize(u);f.reset();var d=f.finalize(this._oKey.clone().concat(l));return d}})})()})}(bk)),bk.exports}var OU;function Uee(){return OU||(OU=1,function(t,e){(function(n,r,s){t.exports=r(Gd(),Xze(),Qze())})(yr,function(n){return function(){var r=n,s=r.lib,i=s.Base,a=s.WordArray,o=r.algo,c=o.MD5,u=o.EvpKDF=i.extend({cfg:i.extend({keySize:128/32,hasher:c,iterations:1}),init:function(f){this.cfg=this.cfg.extend(f)},compute:function(f,l){for(var d,m=this.cfg,p=m.hasher.create(),h=a.create(),y=h.words,g=m.keySize,v=m.iterations;y.length<g;){d&&p.update(d),d=p.update(f).finalize(l),p.reset();for(var w=1;w<v;w++)d=p.finalize(d),p.reset();h.concat(d)}return h.sigBytes=g*4,h}});r.EvpKDF=function(f,l,d){return u.create(d).compute(f,l)}}(),n.EvpKDF})}(vk)),vk.exports}var wk={exports:{}},LU;function Jze(){return LU||(LU=1,function(t,e){(function(n,r,s){t.exports=r(Gd(),Uee())})(yr,function(n){n.lib.Cipher||function(r){var s=n,i=s.lib,a=i.Base,o=i.WordArray,c=i.BufferedBlockAlgorithm,u=s.enc;u.Utf8;var f=u.Base64,l=s.algo,d=l.EvpKDF,m=i.Cipher=c.extend({cfg:a.extend(),createEncryptor:function(D,M){return this.create(this._ENC_XFORM_MODE,D,M)},createDecryptor:function(D,M){return this.create(this._DEC_XFORM_MODE,D,M)},init:function(D,M,L){this.cfg=this.cfg.extend(L),this._xformMode=D,this._key=M,this.reset()},reset:function(){c.reset.call(this),this._doReset()},process:function(D){return this._append(D),this._process()},finalize:function(D){D&&this._append(D);var M=this._doFinalize();return M},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function D(M){return typeof M=="string"?T:k}return function(M){return{encrypt:function(L,I,F){return D(I).encrypt(M,L,I,F)},decrypt:function(L,I,F){return D(I).decrypt(M,L,I,F)}}}}()});i.StreamCipher=m.extend({_doFinalize:function(){var D=this._process(!0);return D},blockSize:1});var p=s.mode={},h=i.BlockCipherMode=a.extend({createEncryptor:function(D,M){return this.Encryptor.create(D,M)},createDecryptor:function(D,M){return this.Decryptor.create(D,M)},init:function(D,M){this._cipher=D,this._iv=M}}),y=p.CBC=function(){var D=h.extend();D.Encryptor=D.extend({processBlock:function(L,I){var F=this._cipher,U=F.blockSize;M.call(this,L,I,U),F.encryptBlock(L,I),this._prevBlock=L.slice(I,I+U)}}),D.Decryptor=D.extend({processBlock:function(L,I){var F=this._cipher,U=F.blockSize,Y=L.slice(I,I+U);F.decryptBlock(L,I),M.call(this,L,I,U),this._prevBlock=Y}});function M(L,I,F){var U,Y=this._iv;Y?(U=Y,this._iv=r):U=this._prevBlock;for(var W=0;W<F;W++)L[I+W]^=U[W]}return D}(),g=s.pad={},v=g.Pkcs7={pad:function(D,M){for(var L=M*4,I=L-D.sigBytes%L,F=I<<24|I<<16|I<<8|I,U=[],Y=0;Y<I;Y+=4)U.push(F);var W=o.create(U,I);D.concat(W)},unpad:function(D){var M=D.words[D.sigBytes-1>>>2]&255;D.sigBytes-=M}};i.BlockCipher=m.extend({cfg:m.cfg.extend({mode:y,padding:v}),reset:function(){var D;m.reset.call(this);var M=this.cfg,L=M.iv,I=M.mode;this._xformMode==this._ENC_XFORM_MODE?D=I.createEncryptor:(D=I.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==D?this._mode.init(this,L&&L.words):(this._mode=D.call(I,this,L&&L.words),this._mode.__creator=D)},_doProcessBlock:function(D,M){this._mode.processBlock(D,M)},_doFinalize:function(){var D,M=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(M.pad(this._data,this.blockSize),D=this._process(!0)):(D=this._process(!0),M.unpad(D)),D},blockSize:128/32});var w=i.CipherParams=a.extend({init:function(D){this.mixIn(D)},toString:function(D){return(D||this.formatter).stringify(this)}}),x=s.format={},A=x.OpenSSL={stringify:function(D){var M,L=D.ciphertext,I=D.salt;return I?M=o.create([1398893684,1701076831]).concat(I).concat(L):M=L,M.toString(f)},parse:function(D){var M,L=f.parse(D),I=L.words;return I[0]==1398893684&&I[1]==1701076831&&(M=o.create(I.slice(2,4)),I.splice(0,4),L.sigBytes-=16),w.create({ciphertext:L,salt:M})}},k=i.SerializableCipher=a.extend({cfg:a.extend({format:A}),encrypt:function(D,M,L,I){I=this.cfg.extend(I);var F=D.createEncryptor(L,I),U=F.finalize(M),Y=F.cfg;return w.create({ciphertext:U,key:L,iv:Y.iv,algorithm:D,mode:Y.mode,padding:Y.padding,blockSize:D.blockSize,formatter:I.format})},decrypt:function(D,M,L,I){I=this.cfg.extend(I),M=this._parse(M,I.format);var F=D.createDecryptor(L,I).finalize(M.ciphertext);return F},_parse:function(D,M){return typeof D=="string"?M.parse(D,this):D}}),R=s.kdf={},E=R.OpenSSL={execute:function(D,M,L,I,F){if(I||(I=o.random(64/8)),F)var U=d.create({keySize:M+L,hasher:F}).compute(D,I);else var U=d.create({keySize:M+L}).compute(D,I);var Y=o.create(U.words.slice(M),L*4);return U.sigBytes=M*4,w.create({key:U,iv:Y,salt:I})}},T=i.PasswordBasedCipher=k.extend({cfg:k.cfg.extend({kdf:E}),encrypt:function(D,M,L,I){I=this.cfg.extend(I);var F=I.kdf.execute(L,D.keySize,D.ivSize,I.salt,I.hasher);I.iv=F.iv;var U=k.encrypt.call(this,D,M,F.key,I);return U.mixIn(F),U},decrypt:function(D,M,L,I){I=this.cfg.extend(I),M=this._parse(M,I.format);var F=I.kdf.execute(L,D.keySize,D.ivSize,M.salt,I.hasher);I.iv=F.iv;var U=k.decrypt.call(this,D,M,F.key,I);return U}})}()})}(wk)),wk.exports}(function(t,e){(function(n,r,s){t.exports=r(Gd(),Kze(),Yze(),Uee(),Jze())})(yr,function(n){return function(){var r=n,s=r.lib,i=s.BlockCipher,a=r.algo,o=[],c=[],u=[],f=[],l=[],d=[],m=[],p=[],h=[],y=[];(function(){for(var w=[],x=0;x<256;x++)x<128?w[x]=x<<1:w[x]=x<<1^283;for(var A=0,k=0,x=0;x<256;x++){var R=k^k<<1^k<<2^k<<3^k<<4;R=R>>>8^R&255^99,o[A]=R,c[R]=A;var E=w[A],T=w[E],D=w[T],M=w[R]*257^R*16843008;u[A]=M<<24|M>>>8,f[A]=M<<16|M>>>16,l[A]=M<<8|M>>>24,d[A]=M;var M=D*16843009^T*65537^E*257^A*16843008;m[R]=M<<24|M>>>8,p[R]=M<<16|M>>>16,h[R]=M<<8|M>>>24,y[R]=M,A?(A=E^w[w[w[D^E]]],k^=w[w[k]]):A=k=1}})();var g=[0,1,2,4,8,16,32,64,128,27,54],v=a.AES=i.extend({_doReset:function(){var w;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var x=this._keyPriorReset=this._key,A=x.words,k=x.sigBytes/4,R=this._nRounds=k+6,E=(R+1)*4,T=this._keySchedule=[],D=0;D<E;D++)D<k?T[D]=A[D]:(w=T[D-1],D%k?k>6&&D%k==4&&(w=o[w>>>24]<<24|o[w>>>16&255]<<16|o[w>>>8&255]<<8|o[w&255]):(w=w<<8|w>>>24,w=o[w>>>24]<<24|o[w>>>16&255]<<16|o[w>>>8&255]<<8|o[w&255],w^=g[D/k|0]<<24),T[D]=T[D-k]^w);for(var M=this._invKeySchedule=[],L=0;L<E;L++){var D=E-L;if(L%4)var w=T[D];else var w=T[D-4];L<4||D<=4?M[L]=w:M[L]=m[o[w>>>24]]^p[o[w>>>16&255]]^h[o[w>>>8&255]]^y[o[w&255]]}}},encryptBlock:function(w,x){this._doCryptBlock(w,x,this._keySchedule,u,f,l,d,o)},decryptBlock:function(w,x){var A=w[x+1];w[x+1]=w[x+3],w[x+3]=A,this._doCryptBlock(w,x,this._invKeySchedule,m,p,h,y,c);var A=w[x+1];w[x+1]=w[x+3],w[x+3]=A},_doCryptBlock:function(w,x,A,k,R,E,T,D){for(var M=this._nRounds,L=w[x]^A[0],I=w[x+1]^A[1],F=w[x+2]^A[2],U=w[x+3]^A[3],Y=4,W=1;W<M;W++){var H=k[L>>>24]^R[I>>>16&255]^E[F>>>8&255]^T[U&255]^A[Y++],ee=k[I>>>24]^R[F>>>16&255]^E[U>>>8&255]^T[L&255]^A[Y++],re=k[F>>>24]^R[U>>>16&255]^E[L>>>8&255]^T[I&255]^A[Y++],X=k[U>>>24]^R[L>>>16&255]^E[I>>>8&255]^T[F&255]^A[Y++];L=H,I=ee,F=re,U=X}var H=(D[L>>>24]<<24|D[I>>>16&255]<<16|D[F>>>8&255]<<8|D[U&255])^A[Y++],ee=(D[I>>>24]<<24|D[F>>>16&255]<<16|D[U>>>8&255]<<8|D[L&255])^A[Y++],re=(D[F>>>24]<<24|D[U>>>16&255]<<16|D[L>>>8&255]<<8|D[I&255])^A[Y++],X=(D[U>>>24]<<24|D[L>>>16&255]<<16|D[I>>>8&255]<<8|D[F&255])^A[Y++];w[x]=H,w[x+1]=ee,w[x+2]=re,w[x+3]=X},keySize:256/32});r.AES=i._createHelper(v)}(),n.AES})})(Bee);var Zze=Bee.exports,iR={},H_={},Ys={};Object.defineProperty(H_,"__esModule",{value:!0});H_.default=void 0;var eBe=function(){var e=null;try{typeof Cypress<"u"?e=Cypress.env("SECURE_LOCAL_STORAGE_HASH_KEY")||Cypress.env("REACT_APP_SECURE_LOCAL_STORAGE_HASH_KEY")||Cypress.env("NEXT_PUBLIC_SECURE_LOCAL_STORAGE_HASH_KEY")||Cypress.env("VITE_SECURE_LOCAL_STORAGE_HASH_KEY"):typeof Ys<"u"?e=Ys.SECURE_LOCAL_STORAGE_HASH_KEY||Ys.REACT_APP_SECURE_LOCAL_STORAGE_HASH_KEY||Ys.NEXT_PUBLIC_SECURE_LOCAL_STORAGE_HASH_KEY||Ys.VITE_SECURE_LOCAL_STORAGE_HASH_KEY:console.warn("react-secure-storage : process is not defined! Just a warning!")}catch{return null}return e},tBe=function(){var e=null;try{typeof Cypress<"u"?e=Cypress.env("SECURE_LOCAL_STORAGE_PREFIX")||Cypress.env("REACT_APP_SECURE_LOCAL_STORAGE_PREFIX")||Cypress.env("NEXT_PUBLIC_SECURE_LOCAL_STORAGE_PREFIX")||Cypress.env("VITE_SECURE_LOCAL_STORAGE_PREFIX"):typeof Ys<"u"?e=Ys.SECURE_LOCAL_STORAGE_PREFIX||Ys.REACT_APP_SECURE_LOCAL_STORAGE_PREFIX||Ys.NEXT_PUBLIC_SECURE_LOCAL_STORAGE_PREFIX||Ys.VITE_SECURE_LOCAL_STORAGE_PREFIX:console.warn("react-secure-storage : process is not defined! Just a warning!")}catch{return null}return e},nBe=function(){var e=null;try{typeof Cypress<"u"?e=Cypress.env("SECURE_LOCAL_STORAGE_DISABLED_KEYS")||Cypress.env("REACT_APP_SECURE_LOCAL_STORAGE_DISABLED_KEYS")||Cypress.env("NEXT_PUBLIC_SECURE_LOCAL_STORAGE_DISABLED_KEYS")||Cypress.env("VITE_SECURE_LOCAL_STORAGE_DISABLED_KEYS"):typeof Ys<"u"?e=Ys.SECURE_LOCAL_STORAGE_DISABLED_KEYS||Ys.REACT_APP_SECURE_LOCAL_STORAGE_DISABLED_KEYS||Ys.NEXT_PUBLIC_SECURE_LOCAL_STORAGE_DISABLED_KEYS||Ys.VITE_SECURE_LOCAL_STORAGE_DISABLED_KEYS:console.warn("react-secure-storage : process is not defined! Just a warning!")}catch{return null}return e},rBe={getHashKey:eBe,getStoragePrefix:tBe,getDisabledKeys:nBe},sBe=rBe;H_.default=sBe;var oR={},Hee={exports:{}};(function(t){function e(n,r){var s,i,a,o,c,u,f,l;for(s=n.length&3,i=n.length-s,a=r,c=3432918353,u=461845907,l=0;l<i;)f=n.charCodeAt(l)&255|(n.charCodeAt(++l)&255)<<8|(n.charCodeAt(++l)&255)<<16|(n.charCodeAt(++l)&255)<<24,++l,f=(f&65535)*c+(((f>>>16)*c&65535)<<16)&4294967295,f=f<<15|f>>>17,f=(f&65535)*u+(((f>>>16)*u&65535)<<16)&4294967295,a^=f,a=a<<13|a>>>19,o=(a&65535)*5+(((a>>>16)*5&65535)<<16)&4294967295,a=(o&65535)+27492+(((o>>>16)+58964&65535)<<16);switch(f=0,s){case 3:f^=(n.charCodeAt(l+2)&255)<<16;case 2:f^=(n.charCodeAt(l+1)&255)<<8;case 1:f^=n.charCodeAt(l)&255,f=(f&65535)*c+(((f>>>16)*c&65535)<<16)&4294967295,f=f<<15|f>>>17,f=(f&65535)*u+(((f>>>16)*u&65535)<<16)&4294967295,a^=f}return a^=n.length,a^=a>>>16,a=(a&65535)*2246822507+(((a>>>16)*2246822507&65535)<<16)&4294967295,a^=a>>>13,a=(a&65535)*3266489909+(((a>>>16)*3266489909&65535)<<16)&4294967295,a^=a>>>16,a>>>0}t.exports=e})(Hee);var iBe=Hee.exports,bl={};Object.defineProperty(bl,"__esModule",{value:!0});bl.getSecurePrefix=bl.getDisabledKeys=bl.FINGERPRINT_KEYS=void 0;var Wee=oBe(H_);function oBe(t){return t&&t.__esModule?t:{default:t}}var aBe=function(){var e=Wee.default.getStoragePrefix()||"@secure.";return e.endsWith(".")?e:e+"."};bl.getSecurePrefix=aBe;var Bi={USERAGENT:"UserAgent",SCREEN_PRINT:"ScreenPrint",PLUGINS:"Plugins",FONTS:"Fonts",LOCAL_STORAGE:"LocalStorage",SESSION_STORAGE:"SessionStorage",TIMEZONE:"TimeZone",LANGUAGE:"Language",SYSTEM_LANGUAGE:"SystemLanguage",COOKIE:"Cookie",CANVAS:"Canvas",HOSTNAME:"Hostname"};bl.FINGERPRINT_KEYS=Bi;var lBe=function(){var e=Wee.default.getDisabledKeys()||"";if(e==="")return[];var n=[Bi.USERAGENT,Bi.SCREEN_PRINT,Bi.PLUGINS,Bi.FONTS,Bi.LOCAL_STORAGE,Bi.SESSION_STORAGE,Bi.TIMEZONE,Bi.LANGUAGE,Bi.SYSTEM_LANGUAGE,Bi.COOKIE,Bi.CANVAS,Bi.HOSTNAME],r=[];return e.split("|").forEach(function(s){s===""||(n.includes(s)?r.push(s):console.warn("react-secure-storage : ".concat(s," is not present in the available disabled keys options! Please go through the documentation")))}),r};bl.getDisabledKeys=lBe;Object.defineProperty(oR,"__esModule",{value:!0});oR.default=void 0;var cBe=uBe(iBe),ji=bl;function uBe(t){return t&&t.__esModule?t:{default:t}}function dBe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fBe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function hBe(t,e,n){return e&&fBe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var pBe=function(){function t(){dBe(this,t)}return hBe(t,[{key:"getFingerprint",value:function(){var n="|",r=(0,ji.getDisabledKeys)(),s="";r.includes(ji.FINGERPRINT_KEYS.USERAGENT)||(s+=navigator.userAgent+n),r.includes(ji.FINGERPRINT_KEYS.HOSTNAME)||(s+=window.location.hostname+n),r.includes(ji.FINGERPRINT_KEYS.SCREEN_PRINT)||(s+=this.getScreenPrint()+n),r.includes(ji.FINGERPRINT_KEYS.PLUGINS)||(s+=this.getPlugins()+n),r.includes(ji.FINGERPRINT_KEYS.FONTS)||(s+=this.getFonts()+n),r.includes(ji.FINGERPRINT_KEYS.LOCAL_STORAGE)||(s+=this.isLocalStorage()+n),r.includes(ji.FINGERPRINT_KEYS.SESSION_STORAGE)||(s+=this.isSessionStorage()+n),r.includes(ji.FINGERPRINT_KEYS.TIMEZONE)||(s+=this.getTimeZone()+n),r.includes(ji.FINGERPRINT_KEYS.LANGUAGE)||(s+=this.getLanguage()+n),r.includes(ji.FINGERPRINT_KEYS.SYSTEM_LANGUAGE)||(s+=this.getSystemLanguage()+n),r.includes(ji.FINGERPRINT_KEYS.COOKIE)||(s+=this.isCookie()+n),r.includes(ji.FINGERPRINT_KEYS.CANVAS)||(s+=this.getCanvasPrint()),s.endsWith(n)&&(s=s.substring(0,s.length-1));var i=256;return(0,cBe.default)(s,i)}},{key:"getScreenPrint",value:function(){return"Color Depth: "+this.getColorDepth()+", Device XDPI: "+this.getDeviceXDPI()+", Device YDPI: "+this.getDeviceYDPI()}},{key:"getColorDepth",value:function(){return window.screen.colorDepth}},{key:"getCurrentResolution",value:function(){return window.screen.width+"x"+window.screen.height}},{key:"getAvailableResolution",value:function(){return window.screen.availWidth+"x"+window.screen.availHeight}},{key:"getDeviceXDPI",value:function(){return""}},{key:"getDeviceYDPI",value:function(){return""}},{key:"getPlugins",value:function(){for(var n="",r=0;r<navigator.plugins.length;r++)r===navigator.plugins.length-1?n+=navigator.plugins[r].name:n+=navigator.plugins[r].name+", ";return n}},{key:"getFonts",value:function(){var n="";return n}},{key:"isLocalStorage",value:function(){try{return!!localStorage}catch{return!0}}},{key:"isSessionStorage",value:function(){try{return!!sessionStorage}catch{return!0}}},{key:"isCookie",value:function(){return navigator.cookieEnabled}},{key:"getTimeZone",value:function(){var n,r,s,i;return n=new Date,r=String(-(n.getTimezoneOffset()/60)),r<0?(r=r*-1,s=("0"+r).slice(-2),i="-"+s):(s=("0"+r).slice(-2),i="+"+s),i}},{key:"getLanguage",value:function(){return navigator.language}},{key:"getSystemLanguage",value:function(){return navigator.language||window.navigator.language}},{key:"getCanvasPrint",value:function(){var n=document.createElement("canvas"),r;try{r=n.getContext("2d")}catch{return""}var s="ClientJS,org <canvas> 1.0";return r.textBaseline="top",r.font="14px 'Arial'",r.textBaseline="alphabetic",r.fillStyle="#f60",r.fillRect(125,1,62,20),r.fillStyle="#069",r.fillText(s,2,15),r.fillStyle="rgba(102, 204, 0, 0.7)",r.fillText(s,4,17),n.toDataURL()}}]),t}(),mBe=new pBe,gBe=mBe;oR.default=gBe;Object.defineProperty(iR,"__esModule",{value:!0});iR.default=void 0;var vBe=Vee(H_),yBe=Vee(oR);function Vee(t){return t&&t.__esModule?t:{default:t}}var bBe="E86E2612010258B35137",wBe=function(){var e=vBe.default.getHashKey()||bBe;return typeof window>"u"?e:yBe.default.getFingerprint()+e},_Be=wBe;iR.default=_Be;Object.defineProperty(U_,"__esModule",{value:!0});U_.default=void 0;var xBe=t2(Gze),IU=t2(Zze),SBe=t2(iR);function t2(t){return t&&t.__esModule?t:{default:t}}function EBe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function CBe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ABe(t,e,n){return e&&CBe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function RBe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var PBe=function(){function t(){EBe(this,t),RBe(this,"secureKey",""),this.secureKey=(0,SBe.default)()}return ABe(t,[{key:"encrypt",value:function(n){return IU.default.encrypt(n,this.secureKey).toString()}},{key:"decrypt",value:function(n){try{var r=IU.default.decrypt(n,this.secureKey);return r.toString(xBe.default)||null}catch{return null}}}]),t}(),TBe=PBe;U_.default=TBe;var aR={};Object.defineProperty(aR,"__esModule",{value:!0});aR.default=void 0;var kBe=NBe(U_),DBe=bl;function NBe(t){return t&&t.__esModule?t:{default:t}}function MBe(t,e){return $Be(t)||IBe(t,e)||LBe(t,e)||OBe()}function OBe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LBe(t,e){if(t){if(typeof t=="string")return $U(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 $U(t,e)}}function $U(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function IBe(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],s=!0,i=!1,a,o;try{for(n=n.call(t);!(s=(a=n.next()).done)&&(r.push(a.value),!(e&&r.length===e));s=!0);}catch(c){i=!0,o=c}finally{try{!s&&n.return!=null&&n.return()}finally{if(i)throw o}}return r}}function $Be(t){if(Array.isArray(t))return t}var FU=(0,DBe.getSecurePrefix)(),FBe=function(){var e={};if(typeof window<"u")for(var n=new kBe.default,r=0,s=Object.entries(localStorage);r<s.length;r++){var i=MBe(s[r],2),a=i[0],o=i[1];if(a.startsWith(FU)){var c=a.replace(FU,"")[0],u=a.replace(/[.][bjns][.]/,"."),f=n.decrypt(o),l=null;if(f!=null)switch(c){case"b":l=f==="true";break;case"j":try{l=JSON.parse(f)}catch{l=null}break;case"n":try{l=Number(f)}catch{l=null}break;default:l=f}e[u]=l}}return e},jBe=FBe;aR.default=jBe;Object.defineProperty(e2,"__esModule",{value:!0});var Po=e2.default=void 0,zBe=qee(U_),BBe=qee(aR),UBe=bl;function qee(t){return t&&t.__esModule?t:{default:t}}function HBe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function WBe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function VBe(t,e,n){return e&&WBe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function qBe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Y1(t){"@babel/helpers - typeof";return Y1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Y1(t)}var SE=(0,UBe.getSecurePrefix)(),GBe=function(e){return Y1(e)==="object"?"j":typeof e=="boolean"?"b":typeof e=="number"?"n":"s"},jU=function(e,n){var r=GBe(n);return SE+"".concat(r,".")+e},KBe=function(){function t(){HBe(this,t),qBe(this,"_localStorageItems",{}),this._localStorageItems=(0,BBe.default)()}return VBe(t,[{key:"setItem",value:function(n,r){if(r==null)this.removeItem(n);else{var s=Y1(r)==="object"?JSON.stringify(r):r+"",i=jU(n,r),a=SE+n;n!=null&&(this._localStorageItems[a]=r);var o=new zBe.default;localStorage.setItem(i,o.encrypt(s))}}},{key:"getItem",value:function(n){var r,s=SE+n;return(r=this._localStorageItems[s])!==null&&r!==void 0?r:null}},{key:"removeItem",value:function(n){var r=SE+n,s=this._localStorageItems[r],i=jU(n,s);this._localStorageItems[r]!==void 0&&delete this._localStorageItems[r],localStorage.removeItem(i)}},{key:"clear",value:function(){this._localStorageItems={},localStorage.clear()}}]),t}(),YBe=new KBe,XBe=YBe;Po=e2.default=XBe;const QBe={theme:"system",setTheme:()=>null},JBe=_.createContext(QBe);function ZBe({children:t,defaultTheme:e="system",storageKey:n="vite-ui-theme",...r}){const[s,i]=_.useState(()=>Po.getItem(n)||e);_.useEffect(()=>{const o=window.document.documentElement;if(o.classList.remove("light","dark"),s==="system"){const c=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";o.classList.add(c);return}o.classList.add(s)},[s]);const a={theme:s,setTheme:o=>{Po.setItem(n,o),i(o)}};return P.jsx(JBe.Provider,{...r,value:a,children:t})}const e4e=_.createContext(null),Gee=({children:t})=>{const[e,n]=_.useState(null),[r,s]=_.useState(!1),i=_.useCallback(u=>{n(u),s(!0)},[s,n]),a=()=>{var u;(u=e==null?void 0:e.onConfirm)==null||u.call(e),s(!1)},o=()=>{var u;(u=e==null?void 0:e.onCancel)==null||u.call(e),s(!1)},c=_.useMemo(()=>({show:i}),[i]);return P.jsxs(e4e.Provider,{value:c,children:[t,P.jsx(TQ,{onCancel:()=>{o()},onConfirm:()=>a(),title:e==null?void 0:e.title,description:e==null?void 0:e.subtitle,confirmLabel:e==null?void 0:e.confirmText,cancelLabel:e==null?void 0:e.cancelText,isOpen:r})]})},t4e=_.lazy(()=>Jr(()=>import("./index-DfxjigQf.js"),__vite__mapDeps([0,1])).then(t=>({default:t.DealerLayout}))),n4e=_.lazy(()=>Jr(()=>import("./index-DfxjigQf.js"),__vite__mapDeps([0,1])).then(t=>({default:t.DealersList}))),r4e=_.lazy(()=>Jr(()=>import("./index-DfxjigQf.js"),__vite__mapDeps([0,1])).then(t=>({default:t.ErrorPage}))),s4e=_.lazy(()=>Jr(()=>import("./index-DfxjigQf.js"),__vite__mapDeps([0,1])).then(t=>({default:t.LoginPageWithLanguageSelector}))),i4e=_.lazy(()=>Jr(()=>import("./index-DfxjigQf.js"),__vite__mapDeps([0,1])).then(t=>({default:t.LogoutPage}))),o4e=_.lazy(()=>Jr(()=>import("./index-DfxjigQf.js"),__vite__mapDeps([0,1])).then(t=>({default:t.QuoteCreate}))),a4e=_.lazy(()=>Jr(()=>import("./index-DfxjigQf.js"),__vite__mapDeps([0,1])).then(t=>({default:t.QuoteEdit}))),l4e=_.lazy(()=>Jr(()=>import("./index-DfxjigQf.js"),__vite__mapDeps([0,1])).then(t=>({default:t.SettingsEditor}))),c4e=_.lazy(()=>Jr(()=>import("./index-DfxjigQf.js"),__vite__mapDeps([0,1])).then(t=>({default:t.SettingsLayout}))),u4e=_.lazy(()=>Jr(()=>import("./index-DfxjigQf.js"),__vite__mapDeps([0,1])).then(t=>({default:t.CatalogLayout}))),d4e=_.lazy(()=>Jr(()=>import("./index-DfxjigQf.js"),__vite__mapDeps([0,1])).then(t=>({default:t.CatalogList}))),f4e=_.lazy(()=>Jr(()=>import("./index-DfxjigQf.js"),__vite__mapDeps([0,1])).then(t=>({default:t.DashboardPage}))),h4e=_.lazy(()=>Jr(()=>import("./index-DfxjigQf.js"),__vite__mapDeps([0,1])).then(t=>({default:t.QuotesLayout}))),p4e=_.lazy(()=>Jr(()=>import("./index-DfxjigQf.js"),__vite__mapDeps([0,1])).then(t=>({default:t.QuotesList}))),m4e=()=>{const t=[{path:"*",Element:P.jsx(_.Suspense,{fallback:P.jsx(Es,{}),children:P.jsx(r4e,{})})}],e=[{path:"/",element:P.jsx(PU,{children:P.jsx(PQ,{to:"/quotes",replace:!0})})},{path:"/home",element:P.jsx(PU,{children:P.jsx(_.Suspense,{fallback:P.jsx(Es,{}),children:P.jsx(f4e,{})})})},{path:"/catalog",element:P.jsx(_.Suspense,{fallback:P.jsx(Es,{}),children:P.jsx(u4e,{children:P.jsx(bS,{})})}),children:[{index:!0,element:P.jsx(_.Suspense,{fallback:P.jsx(Es,{}),children:P.jsx(d4e,{})})}]},{path:"/dealers",element:P.jsx(_.Suspense,{fallback:P.jsx(Es,{}),children:P.jsx(t4e,{children:P.jsx(bS,{})})}),children:[{index:!0,element:P.jsx(_.Suspense,{fallback:P.jsx(Es,{}),children:P.jsx(n4e,{})})}]},{path:"/quotes",element:P.jsx(_.Suspense,{fallback:P.jsx(Es,{}),children:P.jsx(h4e,{children:P.jsx(bS,{})})}),children:[{index:!0,element:P.jsx(_.Suspense,{fallback:P.jsx(Es,{}),children:P.jsx(p4e,{})})},{path:"add",element:P.jsx(_.Suspense,{fallback:P.jsx(Es,{}),children:P.jsx(o4e,{})})},{path:"edit/:id",element:P.jsx(_.Suspense,{fallback:P.jsx(Es,{}),children:P.jsx(a4e,{})})}]},{path:"/settings",element:P.jsx(_.Suspense,{fallback:P.jsx(Es,{}),children:P.jsx(c4e,{children:P.jsx(bS,{})})}),children:[{index:!0,element:P.jsx(_.Suspense,{fallback:P.jsx(Es,{}),children:P.jsx(l4e,{})})}]},{path:"/logout",element:P.jsx(i4e,{})}],n=[{path:"/login",element:P.jsx(_.Suspense,{fallback:P.jsx(Es,{}),children:P.jsx(s4e,{})})}],r=gLe([...e,...n,...t],{});return P.jsx(CLe,{router:r})};function Kee(t,e){return function(){return t.apply(e,arguments)}}const{toString:g4e}=Object.prototype,{getPrototypeOf:n2}=Object,lR=(t=>e=>{const n=g4e.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),$a=t=>(t=t.toLowerCase(),e=>lR(e)===t),cR=t=>e=>typeof e===t,{isArray:Uv}=Array,fw=cR("undefined");function v4e(t){return t!==null&&!fw(t)&&t.constructor!==null&&!fw(t.constructor)&&oo(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Yee=$a("ArrayBuffer");function y4e(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Yee(t.buffer),e}const b4e=cR("string"),oo=cR("function"),Xee=cR("number"),uR=t=>t!==null&&typeof t=="object",w4e=t=>t===!0||t===!1,EE=t=>{if(lR(t)!=="object")return!1;const e=n2(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},_4e=$a("Date"),x4e=$a("File"),S4e=$a("Blob"),E4e=$a("FileList"),C4e=t=>uR(t)&&oo(t.pipe),A4e=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||oo(t.append)&&((e=lR(t))==="formdata"||e==="object"&&oo(t.toString)&&t.toString()==="[object FormData]"))},R4e=$a("URLSearchParams"),[P4e,T4e,k4e,D4e]=["ReadableStream","Request","Response","Headers"].map($a),N4e=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function W_(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,s;if(typeof t!="object"&&(t=[t]),Uv(t))for(r=0,s=t.length;r<s;r++)e.call(null,t[r],r,t);else{const i=n?Object.getOwnPropertyNames(t):Object.keys(t),a=i.length;let o;for(r=0;r<a;r++)o=i[r],e.call(null,t[o],o,t)}}function Qee(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length,s;for(;r-- >0;)if(s=n[r],e===s.toLowerCase())return s;return null}const Tf=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Jee=t=>!fw(t)&&t!==Tf;function nO(){const{caseless:t}=Jee(this)&&this||{},e={},n=(r,s)=>{const i=t&&Qee(e,s)||s;EE(e[i])&&EE(r)?e[i]=nO(e[i],r):EE(r)?e[i]=nO({},r):Uv(r)?e[i]=r.slice():e[i]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&W_(arguments[r],n);return e}const M4e=(t,e,n,{allOwnKeys:r}={})=>(W_(e,(s,i)=>{n&&oo(s)?t[i]=Kee(s,n):t[i]=s},{allOwnKeys:r}),t),O4e=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),L4e=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},I4e=(t,e,n,r)=>{let s,i,a;const o={};if(e=e||{},t==null)return e;do{for(s=Object.getOwnPropertyNames(t),i=s.length;i-- >0;)a=s[i],(!r||r(a,t,e))&&!o[a]&&(e[a]=t[a],o[a]=!0);t=n!==!1&&n2(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},$4e=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},F4e=t=>{if(!t)return null;if(Uv(t))return t;let e=t.length;if(!Xee(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},j4e=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&n2(Uint8Array)),z4e=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let s;for(;(s=r.next())&&!s.done;){const i=s.value;e.call(t,i[0],i[1])}},B4e=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},U4e=$a("HTMLFormElement"),H4e=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),zU=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),W4e=$a("RegExp"),Zee=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};W_(n,(s,i)=>{let a;(a=e(s,i,t))!==!1&&(r[i]=a||s)}),Object.defineProperties(t,r)},V4e=t=>{Zee(t,(e,n)=>{if(oo(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(oo(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},q4e=(t,e)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return Uv(t)?r(t):r(String(t).split(e)),n},G4e=()=>{},K4e=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function Y4e(t){return!!(t&&oo(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const X4e=t=>{const e=new Array(10),n=(r,s)=>{if(uR(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[s]=r;const i=Uv(r)?[]:{};return W_(r,(a,o)=>{const c=n(a,s+1);!fw(c)&&(i[o]=c)}),e[s]=void 0,i}}return r};return n(t,0)},Q4e=$a("AsyncFunction"),J4e=t=>t&&(uR(t)||oo(t))&&oo(t.then)&&oo(t.catch),ete=((t,e)=>t?setImmediate:e?((n,r)=>(Tf.addEventListener("message",({source:s,data:i})=>{s===Tf&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),Tf.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",oo(Tf.postMessage)),Z4e=typeof queueMicrotask<"u"?queueMicrotask.bind(Tf):typeof process<"u"&&process.nextTick||ete,ve={isArray:Uv,isArrayBuffer:Yee,isBuffer:v4e,isFormData:A4e,isArrayBufferView:y4e,isString:b4e,isNumber:Xee,isBoolean:w4e,isObject:uR,isPlainObject:EE,isReadableStream:P4e,isRequest:T4e,isResponse:k4e,isHeaders:D4e,isUndefined:fw,isDate:_4e,isFile:x4e,isBlob:S4e,isRegExp:W4e,isFunction:oo,isStream:C4e,isURLSearchParams:R4e,isTypedArray:j4e,isFileList:E4e,forEach:W_,merge:nO,extend:M4e,trim:N4e,stripBOM:O4e,inherits:L4e,toFlatObject:I4e,kindOf:lR,kindOfTest:$a,endsWith:$4e,toArray:F4e,forEachEntry:z4e,matchAll:B4e,isHTMLForm:U4e,hasOwnProperty:zU,hasOwnProp:zU,reduceDescriptors:Zee,freezeMethods:V4e,toObjectSet:q4e,toCamelCase:H4e,noop:G4e,toFiniteNumber:K4e,findKey:Qee,global:Tf,isContextDefined:Jee,isSpecCompliantForm:Y4e,toJSONObject:X4e,isAsyncFn:Q4e,isThenable:J4e,setImmediate:ete,asap:Z4e};function _t(t,e,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}ve.inherits(_t,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ve.toJSONObject(this.config),code:this.code,status:this.status}}});const tte=_t.prototype,nte={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{nte[t]={value:t}});Object.defineProperties(_t,nte);Object.defineProperty(tte,"isAxiosError",{value:!0});_t.from=(t,e,n,r,s,i)=>{const a=Object.create(tte);return ve.toFlatObject(t,a,function(c){return c!==Error.prototype},o=>o!=="isAxiosError"),_t.call(a,t.message,e,n,r,s),a.cause=t,a.name=t.name,i&&Object.assign(a,i),a};const eUe=null;function rO(t){return ve.isPlainObject(t)||ve.isArray(t)}function rte(t){return ve.endsWith(t,"[]")?t.slice(0,-2):t}function BU(t,e,n){return t?t.concat(e).map(function(s,i){return s=rte(s),!n&&i?"["+s+"]":s}).join(n?".":""):e}function tUe(t){return ve.isArray(t)&&!t.some(rO)}const nUe=ve.toFlatObject(ve,{},null,function(e){return/^is[A-Z]/.test(e)});function dR(t,e,n){if(!ve.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=ve.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,y){return!ve.isUndefined(y[h])});const r=n.metaTokens,s=n.visitor||f,i=n.dots,a=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&ve.isSpecCompliantForm(e);if(!ve.isFunction(s))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(ve.isDate(p))return p.toISOString();if(!c&&ve.isBlob(p))throw new _t("Blob is not supported. Use a Buffer instead.");return ve.isArrayBuffer(p)||ve.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function f(p,h,y){let g=p;if(p&&!y&&typeof p=="object"){if(ve.endsWith(h,"{}"))h=r?h:h.slice(0,-2),p=JSON.stringify(p);else if(ve.isArray(p)&&tUe(p)||(ve.isFileList(p)||ve.endsWith(h,"[]"))&&(g=ve.toArray(p)))return h=rte(h),g.forEach(function(w,x){!(ve.isUndefined(w)||w===null)&&e.append(a===!0?BU([h],x,i):a===null?h:h+"[]",u(w))}),!1}return rO(p)?!0:(e.append(BU(y,h,i),u(p)),!1)}const l=[],d=Object.assign(nUe,{defaultVisitor:f,convertValue:u,isVisitable:rO});function m(p,h){if(!ve.isUndefined(p)){if(l.indexOf(p)!==-1)throw Error("Circular reference detected in "+h.join("."));l.push(p),ve.forEach(p,function(g,v){(!(ve.isUndefined(g)||g===null)&&s.call(e,g,ve.isString(v)?v.trim():v,h,d))===!0&&m(g,h?h.concat(v):[v])}),l.pop()}}if(!ve.isObject(t))throw new TypeError("data must be an object");return m(t),e}function UU(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function r2(t,e){this._pairs=[],t&&dR(t,this,e)}const ste=r2.prototype;ste.append=function(e,n){this._pairs.push([e,n])};ste.toString=function(e){const n=e?function(r){return e.call(this,r,UU)}:UU;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function rUe(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ite(t,e,n){if(!e)return t;const r=n&&n.encode||rUe;ve.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(e,n):i=ve.isURLSearchParams(e)?e.toString():new r2(e,n).toString(r),i){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class HU{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ve.forEach(this.handlers,function(r){r!==null&&e(r)})}}const ote={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},sUe=typeof URLSearchParams<"u"?URLSearchParams:r2,iUe=typeof FormData<"u"?FormData:null,oUe=typeof Blob<"u"?Blob:null,aUe={isBrowser:!0,classes:{URLSearchParams:sUe,FormData:iUe,Blob:oUe},protocols:["http","https","file","blob","url","data"]},s2=typeof window<"u"&&typeof document<"u",sO=typeof navigator=="object"&&navigator||void 0,lUe=s2&&(!sO||["ReactNative","NativeScript","NS"].indexOf(sO.product)<0),cUe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",uUe=s2&&window.location.href||"http://localhost",dUe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:s2,hasStandardBrowserEnv:lUe,hasStandardBrowserWebWorkerEnv:cUe,navigator:sO,origin:uUe},Symbol.toStringTag,{value:"Module"})),Ds={...dUe,...aUe};function fUe(t,e){return dR(t,new Ds.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,i){return Ds.isNode&&ve.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function hUe(t){return ve.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function pUe(t){const e={},n=Object.keys(t);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],e[i]=t[i];return e}function ate(t){function e(n,r,s,i){let a=n[i++];if(a==="__proto__")return!0;const o=Number.isFinite(+a),c=i>=n.length;return a=!a&&ve.isArray(s)?s.length:a,c?(ve.hasOwnProp(s,a)?s[a]=[s[a],r]:s[a]=r,!o):((!s[a]||!ve.isObject(s[a]))&&(s[a]=[]),e(n,r,s[a],i)&&ve.isArray(s[a])&&(s[a]=pUe(s[a])),!o)}if(ve.isFormData(t)&&ve.isFunction(t.entries)){const n={};return ve.forEachEntry(t,(r,s)=>{e(hUe(r),s,n,0)}),n}return null}function mUe(t,e,n){if(ve.isString(t))try{return(e||JSON.parse)(t),ve.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const V_={transitional:ote,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=ve.isObject(e);if(i&&ve.isHTMLForm(e)&&(e=new FormData(e)),ve.isFormData(e))return s?JSON.stringify(ate(e)):e;if(ve.isArrayBuffer(e)||ve.isBuffer(e)||ve.isStream(e)||ve.isFile(e)||ve.isBlob(e)||ve.isReadableStream(e))return e;if(ve.isArrayBufferView(e))return e.buffer;if(ve.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return fUe(e,this.formSerializer).toString();if((o=ve.isFileList(e))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return dR(o?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),mUe(e)):e}],transformResponse:[function(e){const n=this.transitional||V_.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(ve.isResponse(e)||ve.isReadableStream(e))return e;if(e&&ve.isString(e)&&(r&&!this.responseType||s)){const a=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(e)}catch(o){if(a)throw o.name==="SyntaxError"?_t.from(o,_t.ERR_BAD_RESPONSE,this,null,this.response):o}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ds.classes.FormData,Blob:Ds.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ve.forEach(["delete","get","head","post","put","patch"],t=>{V_.headers[t]={}});const gUe=ve.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),vUe=t=>{const e={};let n,r,s;return t&&t.split(`
|
||
`).forEach(function(a){s=a.indexOf(":"),n=a.substring(0,s).trim().toLowerCase(),r=a.substring(s+1).trim(),!(!n||e[n]&&gUe[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},WU=Symbol("internals");function Ny(t){return t&&String(t).trim().toLowerCase()}function CE(t){return t===!1||t==null?t:ve.isArray(t)?t.map(CE):String(t)}function yUe(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const bUe=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function _k(t,e,n,r,s){if(ve.isFunction(r))return r.call(this,e,n);if(s&&(e=n),!!ve.isString(e)){if(ve.isString(r))return e.indexOf(r)!==-1;if(ve.isRegExp(r))return r.test(e)}}function wUe(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function _Ue(t,e){const n=ve.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(s,i,a){return this[r].call(this,e,s,i,a)},configurable:!0})})}let Pi=class{constructor(e){e&&this.set(e)}set(e,n,r){const s=this;function i(o,c,u){const f=Ny(c);if(!f)throw new Error("header name must be a non-empty string");const l=ve.findKey(s,f);(!l||s[l]===void 0||u===!0||u===void 0&&s[l]!==!1)&&(s[l||c]=CE(o))}const a=(o,c)=>ve.forEach(o,(u,f)=>i(u,f,c));if(ve.isPlainObject(e)||e instanceof this.constructor)a(e,n);else if(ve.isString(e)&&(e=e.trim())&&!bUe(e))a(vUe(e),n);else if(ve.isHeaders(e))for(const[o,c]of e.entries())i(c,o,r);else e!=null&&i(n,e,r);return this}get(e,n){if(e=Ny(e),e){const r=ve.findKey(this,e);if(r){const s=this[r];if(!n)return s;if(n===!0)return yUe(s);if(ve.isFunction(n))return n.call(this,s,r);if(ve.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Ny(e),e){const r=ve.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||_k(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let s=!1;function i(a){if(a=Ny(a),a){const o=ve.findKey(r,a);o&&(!n||_k(r,r[o],o,n))&&(delete r[o],s=!0)}}return ve.isArray(e)?e.forEach(i):i(e),s}clear(e){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!e||_k(this,this[i],i,e,!0))&&(delete this[i],s=!0)}return s}normalize(e){const n=this,r={};return ve.forEach(this,(s,i)=>{const a=ve.findKey(r,i);if(a){n[a]=CE(s),delete n[i];return}const o=e?wUe(i):String(i).trim();o!==i&&delete n[i],n[o]=CE(s),r[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return ve.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=e&&ve.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
|
||
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(s=>r.set(s)),r}static accessor(e){const r=(this[WU]=this[WU]={accessors:{}}).accessors,s=this.prototype;function i(a){const o=Ny(a);r[o]||(_Ue(s,a),r[o]=!0)}return ve.isArray(e)?e.forEach(i):i(e),this}};Pi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ve.reduceDescriptors(Pi.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});ve.freezeMethods(Pi);function xk(t,e){const n=this||V_,r=e||n,s=Pi.from(r.headers);let i=r.data;return ve.forEach(t,function(o){i=o.call(n,i,s.normalize(),e?e.status:void 0)}),s.normalize(),i}function lte(t){return!!(t&&t.__CANCEL__)}function Hv(t,e,n){_t.call(this,t??"canceled",_t.ERR_CANCELED,e,n),this.name="CanceledError"}ve.inherits(Hv,_t,{__CANCEL__:!0});function cte(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new _t("Request failed with status code "+n.status,[_t.ERR_BAD_REQUEST,_t.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function xUe(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function SUe(t,e){t=t||10;const n=new Array(t),r=new Array(t);let s=0,i=0,a;return e=e!==void 0?e:1e3,function(c){const u=Date.now(),f=r[i];a||(a=u),n[s]=c,r[s]=u;let l=i,d=0;for(;l!==s;)d+=n[l++],l=l%t;if(s=(s+1)%t,s===i&&(i=(i+1)%t),u-a<e)return;const m=f&&u-f;return m?Math.round(d*1e3/m):void 0}}function EUe(t,e){let n=0,r=1e3/e,s,i;const a=(u,f=Date.now())=>{n=f,s=null,i&&(clearTimeout(i),i=null),t.apply(null,u)};return[(...u)=>{const f=Date.now(),l=f-n;l>=r?a(u,f):(s=u,i||(i=setTimeout(()=>{i=null,a(s)},r-l)))},()=>s&&a(s)]}const X1=(t,e,n=3)=>{let r=0;const s=SUe(50,250);return EUe(i=>{const a=i.loaded,o=i.lengthComputable?i.total:void 0,c=a-r,u=s(c),f=a<=o;r=a;const l={loaded:a,total:o,progress:o?a/o:void 0,bytes:c,rate:u||void 0,estimated:u&&o&&f?(o-a)/u:void 0,event:i,lengthComputable:o!=null,[e?"download":"upload"]:!0};t(l)},n)},VU=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},qU=t=>(...e)=>ve.asap(()=>t(...e)),CUe=Ds.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,Ds.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(Ds.origin),Ds.navigator&&/(msie|trident)/i.test(Ds.navigator.userAgent)):()=>!0,AUe=Ds.hasStandardBrowserEnv?{write(t,e,n,r,s,i){const a=[t+"="+encodeURIComponent(e)];ve.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),ve.isString(r)&&a.push("path="+r),ve.isString(s)&&a.push("domain="+s),i===!0&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function RUe(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function PUe(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function ute(t,e,n){let r=!RUe(e);return t&&(r||n==!1)?PUe(t,e):e}const GU=t=>t instanceof Pi?{...t}:t;function lp(t,e){e=e||{};const n={};function r(u,f,l,d){return ve.isPlainObject(u)&&ve.isPlainObject(f)?ve.merge.call({caseless:d},u,f):ve.isPlainObject(f)?ve.merge({},f):ve.isArray(f)?f.slice():f}function s(u,f,l,d){if(ve.isUndefined(f)){if(!ve.isUndefined(u))return r(void 0,u,l,d)}else return r(u,f,l,d)}function i(u,f){if(!ve.isUndefined(f))return r(void 0,f)}function a(u,f){if(ve.isUndefined(f)){if(!ve.isUndefined(u))return r(void 0,u)}else return r(void 0,f)}function o(u,f,l){if(l in e)return r(u,f);if(l in t)return r(void 0,u)}const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(u,f,l)=>s(GU(u),GU(f),l,!0)};return ve.forEach(Object.keys(Object.assign({},t,e)),function(f){const l=c[f]||s,d=l(t[f],e[f],f);ve.isUndefined(d)&&l!==o||(n[f]=d)}),n}const dte=t=>{const e=lp({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:a,auth:o}=e;e.headers=a=Pi.from(a),e.url=ite(ute(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),o&&a.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):"")));let c;if(ve.isFormData(n)){if(Ds.hasStandardBrowserEnv||Ds.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((c=a.getContentType())!==!1){const[u,...f]=c?c.split(";").map(l=>l.trim()).filter(Boolean):[];a.setContentType([u||"multipart/form-data",...f].join("; "))}}if(Ds.hasStandardBrowserEnv&&(r&&ve.isFunction(r)&&(r=r(e)),r||r!==!1&&CUe(e.url))){const u=s&&i&&AUe.read(i);u&&a.set(s,u)}return e},TUe=typeof XMLHttpRequest<"u",kUe=TUe&&function(t){return new Promise(function(n,r){const s=dte(t);let i=s.data;const a=Pi.from(s.headers).normalize();let{responseType:o,onUploadProgress:c,onDownloadProgress:u}=s,f,l,d,m,p;function h(){m&&m(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(f),s.signal&&s.signal.removeEventListener("abort",f)}let y=new XMLHttpRequest;y.open(s.method.toUpperCase(),s.url,!0),y.timeout=s.timeout;function g(){if(!y)return;const w=Pi.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),A={data:!o||o==="text"||o==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:w,config:t,request:y};cte(function(R){n(R),h()},function(R){r(R),h()},A),y=null}"onloadend"in y?y.onloadend=g:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(g)},y.onabort=function(){y&&(r(new _t("Request aborted",_t.ECONNABORTED,t,y)),y=null)},y.onerror=function(){r(new _t("Network Error",_t.ERR_NETWORK,t,y)),y=null},y.ontimeout=function(){let x=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const A=s.transitional||ote;s.timeoutErrorMessage&&(x=s.timeoutErrorMessage),r(new _t(x,A.clarifyTimeoutError?_t.ETIMEDOUT:_t.ECONNABORTED,t,y)),y=null},i===void 0&&a.setContentType(null),"setRequestHeader"in y&&ve.forEach(a.toJSON(),function(x,A){y.setRequestHeader(A,x)}),ve.isUndefined(s.withCredentials)||(y.withCredentials=!!s.withCredentials),o&&o!=="json"&&(y.responseType=s.responseType),u&&([d,p]=X1(u,!0),y.addEventListener("progress",d)),c&&y.upload&&([l,m]=X1(c),y.upload.addEventListener("progress",l),y.upload.addEventListener("loadend",m)),(s.cancelToken||s.signal)&&(f=w=>{y&&(r(!w||w.type?new Hv(null,t,y):w),y.abort(),y=null)},s.cancelToken&&s.cancelToken.subscribe(f),s.signal&&(s.signal.aborted?f():s.signal.addEventListener("abort",f)));const v=xUe(s.url);if(v&&Ds.protocols.indexOf(v)===-1){r(new _t("Unsupported protocol "+v+":",_t.ERR_BAD_REQUEST,t));return}y.send(i||null)})},DUe=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,s;const i=function(u){if(!s){s=!0,o();const f=u instanceof Error?u:this.reason;r.abort(f instanceof _t?f:new Hv(f instanceof Error?f.message:f))}};let a=e&&setTimeout(()=>{a=null,i(new _t(`timeout ${e} of ms exceeded`,_t.ETIMEDOUT))},e);const o=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),t=null)};t.forEach(u=>u.addEventListener("abort",i));const{signal:c}=r;return c.unsubscribe=()=>ve.asap(o),c}},NUe=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,s;for(;r<n;)s=r+e,yield t.slice(r,s),r=s},MUe=async function*(t,e){for await(const n of OUe(t))yield*NUe(n,e)},OUe=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},KU=(t,e,n,r)=>{const s=MUe(t,e);let i=0,a,o=c=>{a||(a=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:u,value:f}=await s.next();if(u){o(),c.close();return}let l=f.byteLength;if(n){let d=i+=l;n(d)}c.enqueue(new Uint8Array(f))}catch(u){throw o(u),u}},cancel(c){return o(c),s.return()}},{highWaterMark:2})},fR=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",fte=fR&&typeof ReadableStream=="function",LUe=fR&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),hte=(t,...e)=>{try{return!!t(...e)}catch{return!1}},IUe=fte&&hte(()=>{let t=!1;const e=new Request(Ds.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),YU=64*1024,iO=fte&&hte(()=>ve.isReadableStream(new Response("").body)),Q1={stream:iO&&(t=>t.body)};fR&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Q1[e]&&(Q1[e]=ve.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new _t(`Response type '${e}' is not supported`,_t.ERR_NOT_SUPPORT,r)})})})(new Response);const $Ue=async t=>{if(t==null)return 0;if(ve.isBlob(t))return t.size;if(ve.isSpecCompliantForm(t))return(await new Request(Ds.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(ve.isArrayBufferView(t)||ve.isArrayBuffer(t))return t.byteLength;if(ve.isURLSearchParams(t)&&(t=t+""),ve.isString(t))return(await LUe(t)).byteLength},FUe=async(t,e)=>{const n=ve.toFiniteNumber(t.getContentLength());return n??$Ue(e)},jUe=fR&&(async t=>{let{url:e,method:n,data:r,signal:s,cancelToken:i,timeout:a,onDownloadProgress:o,onUploadProgress:c,responseType:u,headers:f,withCredentials:l="same-origin",fetchOptions:d}=dte(t);u=u?(u+"").toLowerCase():"text";let m=DUe([s,i&&i.toAbortSignal()],a),p;const h=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let y;try{if(c&&IUe&&n!=="get"&&n!=="head"&&(y=await FUe(f,r))!==0){let A=new Request(e,{method:"POST",body:r,duplex:"half"}),k;if(ve.isFormData(r)&&(k=A.headers.get("content-type"))&&f.setContentType(k),A.body){const[R,E]=VU(y,X1(qU(c)));r=KU(A.body,YU,R,E)}}ve.isString(l)||(l=l?"include":"omit");const g="credentials"in Request.prototype;p=new Request(e,{...d,signal:m,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:g?l:void 0});let v=await fetch(p);const w=iO&&(u==="stream"||u==="response");if(iO&&(o||w&&h)){const A={};["status","statusText","headers"].forEach(T=>{A[T]=v[T]});const k=ve.toFiniteNumber(v.headers.get("content-length")),[R,E]=o&&VU(k,X1(qU(o),!0))||[];v=new Response(KU(v.body,YU,R,()=>{E&&E(),h&&h()}),A)}u=u||"text";let x=await Q1[ve.findKey(Q1,u)||"text"](v,t);return!w&&h&&h(),await new Promise((A,k)=>{cte(A,k,{data:x,headers:Pi.from(v.headers),status:v.status,statusText:v.statusText,config:t,request:p})})}catch(g){throw h&&h(),g&&g.name==="TypeError"&&/fetch/i.test(g.message)?Object.assign(new _t("Network Error",_t.ERR_NETWORK,t,p),{cause:g.cause||g}):_t.from(g,g&&g.code,t,p)}}),oO={http:eUe,xhr:kUe,fetch:jUe};ve.forEach(oO,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const XU=t=>`- ${t}`,zUe=t=>ve.isFunction(t)||t===null||t===!1,pte={getAdapter:t=>{t=ve.isArray(t)?t:[t];const{length:e}=t;let n,r;const s={};for(let i=0;i<e;i++){n=t[i];let a;if(r=n,!zUe(n)&&(r=oO[(a=String(n)).toLowerCase()],r===void 0))throw new _t(`Unknown adapter '${a}'`);if(r)break;s[a||"#"+i]=r}if(!r){const i=Object.entries(s).map(([o,c])=>`adapter ${o} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=e?i.length>1?`since :
|
||
`+i.map(XU).join(`
|
||
`):" "+XU(i[0]):"as no adapter specified";throw new _t("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:oO};function Sk(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Hv(null,t)}function QU(t){return Sk(t),t.headers=Pi.from(t.headers),t.data=xk.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),pte.getAdapter(t.adapter||V_.adapter)(t).then(function(r){return Sk(t),r.data=xk.call(t,t.transformResponse,r),r.headers=Pi.from(r.headers),r},function(r){return lte(r)||(Sk(t),r&&r.response&&(r.response.data=xk.call(t,t.transformResponse,r.response),r.response.headers=Pi.from(r.response.headers))),Promise.reject(r)})}const mte="1.8.4",hR={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{hR[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const JU={};hR.transitional=function(e,n,r){function s(i,a){return"[Axios v"+mte+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,o)=>{if(e===!1)throw new _t(s(a," has been removed"+(n?" in "+n:"")),_t.ERR_DEPRECATED);return n&&!JU[a]&&(JU[a]=!0,console.warn(s(a," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,a,o):!0}};hR.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function BUe(t,e,n){if(typeof t!="object")throw new _t("options must be an object",_t.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let s=r.length;for(;s-- >0;){const i=r[s],a=e[i];if(a){const o=t[i],c=o===void 0||a(o,i,t);if(c!==!0)throw new _t("option "+i+" must be "+c,_t.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new _t("Unknown option "+i,_t.ERR_BAD_OPTION)}}const AE={assertOptions:BUe,validators:hR},Wa=AE.validators;let Fh=class{constructor(e){this.defaults=e,this.interceptors={request:new HU,response:new HU}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
||
`+i):r.stack=i}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=lp(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&AE.assertOptions(r,{silentJSONParsing:Wa.transitional(Wa.boolean),forcedJSONParsing:Wa.transitional(Wa.boolean),clarifyTimeoutError:Wa.transitional(Wa.boolean)},!1),s!=null&&(ve.isFunction(s)?n.paramsSerializer={serialize:s}:AE.assertOptions(s,{encode:Wa.function,serialize:Wa.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),AE.assertOptions(n,{baseUrl:Wa.spelling("baseURL"),withXsrfToken:Wa.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&ve.merge(i.common,i[n.method]);i&&ve.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=Pi.concat(a,i);const o=[];let c=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(c=c&&h.synchronous,o.unshift(h.fulfilled,h.rejected))});const u=[];this.interceptors.response.forEach(function(h){u.push(h.fulfilled,h.rejected)});let f,l=0,d;if(!c){const p=[QU.bind(this),void 0];for(p.unshift.apply(p,o),p.push.apply(p,u),d=p.length,f=Promise.resolve(n);l<d;)f=f.then(p[l++],p[l++]);return f}d=o.length;let m=n;for(l=0;l<d;){const p=o[l++],h=o[l++];try{m=p(m)}catch(y){h.call(this,y);break}}try{f=QU.call(this,m)}catch(p){return Promise.reject(p)}for(l=0,d=u.length;l<d;)f=f.then(u[l++],u[l++]);return f}getUri(e){e=lp(this.defaults,e);const n=ute(e.baseURL,e.url,e.allowAbsoluteUrls);return ite(n,e.params,e.paramsSerializer)}};ve.forEach(["delete","get","head","options"],function(e){Fh.prototype[e]=function(n,r){return this.request(lp(r||{},{method:e,url:n,data:(r||{}).data}))}});ve.forEach(["post","put","patch"],function(e){function n(r){return function(i,a,o){return this.request(lp(o||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}Fh.prototype[e]=n(),Fh.prototype[e+"Form"]=n(!0)});let UUe=class gte{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const a=new Promise(o=>{r.subscribe(o),i=o}).then(s);return a.cancel=function(){r.unsubscribe(i)},a},e(function(i,a,o){r.reason||(r.reason=new Hv(i,a,o),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new gte(function(s){e=s}),cancel:e}}};function HUe(t){return function(n){return t.apply(null,n)}}function WUe(t){return ve.isObject(t)&&t.isAxiosError===!0}const aO={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(aO).forEach(([t,e])=>{aO[e]=t});function vte(t){const e=new Fh(t),n=Kee(Fh.prototype.request,e);return ve.extend(n,Fh.prototype,e,{allOwnKeys:!0}),ve.extend(n,e,null,{allOwnKeys:!0}),n.create=function(s){return vte(lp(t,s))},n}const _r=vte(V_);_r.Axios=Fh;_r.CanceledError=Hv;_r.CancelToken=UUe;_r.isCancel=lte;_r.VERSION=mte;_r.toFormData=dR;_r.AxiosError=_t;_r.Cancel=_r.CanceledError;_r.all=function(e){return Promise.all(e)};_r.spread=HUe;_r.isAxiosError=WUe;_r.mergeConfig=lp;_r.AxiosHeaders=Pi;_r.formToJSON=t=>ate(ve.isHTMLForm(t)?new FormData(t):t);_r.getAdapter=pte.getAdapter;_r.HttpStatusCode=aO;_r.default=_r;const{Axios:U5e,AxiosError:H5e,CanceledError:W5e,isCancel:V5e,CancelToken:q5e,VERSION:G5e,all:K5e,Cancel:Y5e,isAxiosError:X5e,spread:Q5e,toFormData:J5e,AxiosHeaders:Z5e,HttpStatusCode:eWe,formToJSON:tWe,getAdapter:nWe,mergeConfig:rWe}=_r,yte=()=>{const t=Po.getItem("uecko.auth");return t&&t.token?`Bearer ${t.token}`:""},VUe=t=>(t.headers.Authorization=yte(),t),qUe=t=>Promise.reject(t),GUe=t=>((t==null?void 0:t.config).raw,t),KUe=t=>{if(console.debug("[response error]"),t.response){console.debug("1 => El servidor respondió con un código de estado > 200");const e=t.response.data,n=t.response.status;switch(console.debug(e),console.debug(n),n){case 400:console.error("Bad Request");break;case 401:console.error("UnAuthorized");break;case 403:console.error("Forbidden");break;case 404:console.error("Not found");break;case 422:console.error("Unprocessable Content");break}return Promise.reject(e)}else t.request?(console.debug("2 => El servidor no respondió"),console.error(t)):t.code==="ERR_CANCELED"?console.debug("3 => Petición cancelada"):(console.debug("4 => Error desconocido"),console.error(t));return console.groupEnd(),Promise.reject(t)};function YUe(t){return t.interceptors.request.use(VUe,qUe),t.interceptors.response.use(GUe,KUe),t}const bte={mode:"cors",cache:"no-cache",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json; charset=utf-8","Cache-Control":"no-cache","Access-Control-Allow-Origin":"*"}},wte=()=>YUe(_r.create(bte)),XUe=(t,e=wte())=>({login:async({email:n,password:r})=>{Po.clear();try{const s=await e.request({url:`${t}/auth/login`,method:"POST",data:{email:n,password:r}}),{data:i}=s;return Po.setItem("uecko.auth",i),{success:!0,data:i}}catch{return{success:!1,error:{message:"Login failed",name:"Invalid email or password"}}}},logout:()=>(Po.clear(),Promise.resolve({success:!0,redirectTo:"/login"})),check:()=>{const n=Po.getItem("uecko.auth"),r=!!(n!=null&&n.token);return r||Po.clear(),Promise.resolve(r?{authenticated:!0}:{authenticated:!1,redirectTo:"/login"})},getProfile:async()=>{try{const n=await e.request({url:`${t}/profile`,method:"GET"}),{data:r}=n,s=Po.getItem("uecko.auth");return(s==null?void 0:s.id)===(r==null?void 0:r.id)?(Po.setItem("uecko.profile",r),Promise.resolve(r)):Promise.resolve(null)}catch(n){throw n}},onError:n=>(Po.clear(),Promise.resolve({error:n,logout:!0}))}),QUe=(t,e=wte())=>({name:()=>"AxiosDataProvider",getApiUrl:()=>t,getApiAuthorization:yte,getList:async n=>{const{resource:r,quickSearchTerm:s,pagination:i,filters:a=[],sort:o=[]}=n,c=`${t}/${r}`,u=new URLSearchParams,{page:f,limit:l}=tHe(i);u.append("page",String(f)),u.append("limit",String(l));const d=JUe(o);d.length&&u.append("$sort_by",d.join(","));const m=eHe(s,a);m.length&&u.append("q",m.join(","));const p=ZUe(a);return p.length&&u.append("$filters",p.join(",")),(await e.request({url:`${c}?${u.toString()}`,method:"GET"})).data},getOne:async n=>{const{resource:r,id:s}=n;return(await e.request({url:`${t}/${r}/${s}`,method:"GET"})).data},createOne:async n=>{const{resource:r,data:s}=n;return(await e.request({url:`${t}/${r}`,method:"POST",data:s})).data},updateOne:async n=>{const{resource:r,data:s,id:i}=n;return(await e.request({url:`${t}/${r}/${i}`,method:"PUT",data:s})).data},removeOne:async n=>{const{resource:r,id:s}=n;await e.request({url:`${t}/${r}/${s}`,method:"DELETE"})},uploadFile:async n=>{const{path:r,file:s,key:i,onUploadProgress:a}=n,o=`${t}/${r}`,c=new FormData;return c.append(i||"file",s),(await e.post(o,c,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:a})).data},downloadPDF:async n=>{const{url:r,config:s}=n,i=await e.get(r,{responseType:"arraybuffer",...s}),a=i.headers["content-disposition"];let o="downloaded-file.pdf";if(a){const u=a.match(/filename="?(.+)"?/);u&&u[1]&&(o=u[1])}const c=new Blob([i.data],{type:"application/pdf"});return{filename:o,filedata:c}},custom:async n=>{const{url:r,path:s,method:i,responseType:a,headers:o,signal:c,data:u,...f}=n;let l;if(s)l=`${t}/${s}`;else if(r)l=r;else throw new Error('"url" or "path" param is missing');let d;const m={url:l.toString(),method:i,responseType:a,signal:c,...f,...bte};switch(i){case"put":case"post":case"patch":d=await e.request({...m,data:u});break;case"delete":d=await e.delete(l.toString(),{responseType:a,headers:o,...f});break;default:d=await e.get(l.toString(),{responseType:a,signal:c,headers:o,...f});break}return d.data}}),JUe=(t=[])=>t.map(({field:e,order:n})=>`${n==="DESC"?"-":"+"}${e}`),ZUe=(t=[])=>t.filter(({field:e})=>e!=="q").map(({field:e,operator:n,value:r})=>`${e}[${n}]${r}`),eHe=(t=[],e=[])=>{var n;return(n=e.find(({field:r})=>r==="q"))!=null&&n.value?[e.find(({field:r})=>r==="q").value]:t},tHe=t=>{const{pageIndex:e=bb,pageSize:n=M$}=t||{};return{page:e,limit:n}},{slice:nHe,forEach:rHe}=[];function sHe(t){return rHe.call(nHe.call(arguments,1),e=>{if(e)for(const n in e)t[n]===void 0&&(t[n]=e[n])}),t}const ZU=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,iHe=function(t,e){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},s=encodeURIComponent(e);let i=`${t}=${s}`;if(r.maxAge>0){const a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(a)}`}if(r.domain){if(!ZU.test(r.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${r.domain}`}if(r.path){if(!ZU.test(r.path))throw new TypeError("option path is invalid");i+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");i+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i},eH={create(t,e,n,r){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+n*60*1e3)),r&&(s.domain=r),document.cookie=iHe(t,encodeURIComponent(e),s)},read(t){const e=`${t}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let s=n[r];for(;s.charAt(0)===" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return s.substring(e.length,s.length)}return null},remove(t){this.create(t,"",-1)}};var oHe={name:"cookie",lookup(t){let{lookupCookie:e}=t;if(e&&typeof document<"u")return eH.read(e)||void 0},cacheUserLanguage(t,e){let{lookupCookie:n,cookieMinutes:r,cookieDomain:s,cookieOptions:i}=e;n&&typeof document<"u"&&eH.create(n,t,r,s,i)}},aHe={name:"querystring",lookup(t){var r;let{lookupQuerystring:e}=t,n;if(typeof window<"u"){let{search:s}=window.location;!window.location.search&&((r=window.location.hash)==null?void 0:r.indexOf("?"))>-1&&(s=window.location.hash.substring(window.location.hash.indexOf("?")));const a=s.substring(1).split("&");for(let o=0;o<a.length;o++){const c=a[o].indexOf("=");c>0&&a[o].substring(0,c)===e&&(n=a[o].substring(c+1))}}return n}};let Zp=null;const tH=()=>{if(Zp!==null)return Zp;try{if(Zp=typeof window<"u"&&window.localStorage!==null,!Zp)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Zp=!1}return Zp};var lHe={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&tH())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:n}=e;n&&tH()&&window.localStorage.setItem(n,t)}};let em=null;const nH=()=>{if(em!==null)return em;try{if(em=typeof window<"u"&&window.sessionStorage!==null,!em)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{em=!1}return em};var cHe={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&nH())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:n}=e;n&&nH()&&window.sessionStorage.setItem(n,t)}},uHe={name:"navigator",lookup(t){const e=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:s}=navigator;if(n)for(let i=0;i<n.length;i++)e.push(n[i]);r&&e.push(r),s&&e.push(s)}return e.length>0?e:void 0}},dHe={name:"htmlTag",lookup(t){let{htmlTag:e}=t,n;const r=e||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},fHe={name:"path",lookup(t){var s;let{lookupFromPathIndex:e}=t;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(s=n[typeof e=="number"?e:0])==null?void 0:s.replace("/",""):void 0}},hHe={name:"subdomain",lookup(t){var s,i;let{lookupFromSubdomainIndex:e}=t;const n=typeof e=="number"?e+1:1,r=typeof window<"u"&&((i=(s=window.location)==null?void 0:s.hostname)==null?void 0:i.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};let _te=!1;try{document.cookie,_te=!0}catch{}const xte=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];_te||xte.splice(1,1);const pHe=()=>({order:xte,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t});class Ste{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,n)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=sHe(n,this.options||{},pHe()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=s=>s.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(oHe),this.addDetector(aHe),this.addDetector(lHe),this.addDetector(cHe),this.addDetector(uHe),this.addDetector(dHe),this.addDetector(fHe),this.addDetector(hHe)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return e.forEach(r=>{if(this.detectors[r]){let s=this.detectors[r].lookup(this.options);s&&typeof s=="string"&&(s=[s]),s&&(n=n.concat(s))}}),n=n.map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(e,this.options)}))}}Ste.type="languageDetector";const mHe={common:{today:"Avui"},title:"Presupuestador para distribuidores",LoginPage:{title:"Pressupostador per a distribuïdors",description:"Introdueixi la seva adreça de correu electrònic i contrasenya per accedir-hi"}},gHe={translation:mHe},vHe={common:{required:"required",cancel:"Cancel",no:"No",yes:"Yes",save:"Save",save_close:"Save and Close",discard:"Discard",hide:"Hide",back:"Back",upload:"Upload",continue:"Continue",close:"Close",more:"More",pagination:"Pagination",breadcrumb:"Breadcrumb",previous:"Previous",next:"Next",more_pages:"More pages",previous_slide:"Previous slide",next_slide:"Next slide",add:"Add",submit:"Submit",download:"Download",help:"Help",select_all:"Select all",select_row:"Select row",sort_asc:"Asc",sort_asc_description:"In ascending order. Click to sort descending order.",sort_desc:"Desc",sort_desc_description:"In descending order. Click to sort in ascending order.",sort_none_description:"No sorting order. Click to sort in ascending order.",rows_selected:"{{count}} row(s) selected.",rows_selected_of_total:"{{count}} of {{total}} row(s) selected.",rows_per_page:"Rows per page",num_page_of_total:"Page {{count}} of {{total}}",go_to_first_page:"Go to first page",go_to_prev_page:"Go to previous page",go_to_next_page:"Go to next page",go_to_last_page:"Go to last page",error:"Error",actions:"Actions",open_menu:"Open menu",duplicate_row:"Duplicate",duplicate_selected_rows:"Duplicate",duplicate_selected_rows_tooltip:"Duplicate selected row(s)",append_empty_row:"Append row",append_empty_row_tooltip:"Append a empty row",append_article:"Append article",append_article_tooltip:"Select and add an item from the catalog",append_block:"Append text block",append_block_tooltip:"Select and add a text block",move_row:"Move row",remove_row:"Remove",remove_selected_rows:"Remove",remove_selected_rows_tooltip:"Remove selected row(s)",reset_selected_rows:"Reset selection",reset_selected_rows_tooltip:"Reset selected row(s)",insert_row_above:"Insert row above",insert_row_below:"Insert row below",pick_date:"Select a date",today:"Today",required_field:"This field is required",edit:"Edit",remove:"Remove",archive:"Archive",duplicate:"Duplicate",disable_preview:"Hide preview",enable_preview:"Show preview",filter:{reset_filter:"Reset filter",badget_remove_tooltip:"Remove this filter term",input_placeholder:"Type here to filter...",button_add_term:"Add filter term",button_add_term_tooltip:"Add filter term (or press Enter)",help_text:"Press Enter or click the + button to add a term to the filter. Use multiple terms for a broader search."}},components:{loading_indicator:{title:"Loading..."},loading_overlay:{title:"Loading...",subtitle:"This may take a few seconds. Please do not close this page."},error_overlay:{title:"An error occurred",go_home:"Go home"},empty_state:{title:"There is nothing here yet",subtitle:"Start by requesting the catalog upload",button:"Request catalog upload"},data_table:{columns:"Columns",no_results:"No results found.",clear_filters:"Clear filters",selected_count:"{{count}} selected"}},hooks:{use_unsaved_changes_notifier:{title:"Changes detected",subtitle:`Caution, there are pending changes to save on this page.
|
||
If you continue, you will lose the changes.`,confirm_text:"Continue",cancel_text:"Cancel"}},main_menu:{toggle_navigation:"Toggle navigation menu",settings:"Settings",catalog:"Catalog",quotes:"Quotes",search_placeholder:"Search products, quotes, etc.",user:{user_menu:"User menu",my_account:"My account",profile:"Profile",settings:"Settings",support:"Support",logout:"Logout"},logout_dialog:{title:"Log out",description:"Are you sure you want to log out?",confirm_label:"Log out",cancel_label:"Cancel"}},login_page:{title:"Quoting tool for distributors",description:"Enter your email address and password to login",email_label:"Email",email_placeholder:"myemail@sample.com",password_label:"Password",forgotten_password:"Forgot your password?",become_dealer:"Do you want to become a Uecko partner?",contact_us:"Contact us",login:"Log in"},dashboard:{welcome:"Welcome"},catalog:{list:{title:"Catalog of articles",empty_state:{subtitle:"Start by loading catalog items"},columns:{description:"Description",points:"Points",retail_price:"Retail price",quantity:"Quantity"}}},quotes:{list:{title:"Quotes",subtitle:"",tabs_title:"Statuses",select_status:"Select status",preview_aria:"Show quote preview",empty_state:{subtitle:"Start by creating a quote"},status_help:{title:"Quote status help",intro:"A quote status indicates its current position in the business process.",possible:"The possible statuses are:",outro:"Use these statuses to track quotes efficiently and improve your sales process. The Archived status helps keep history without interfering with active quotes."},tabs:{all:"All",draft:"Draft",ready:"Ready",delivered:"Delivered",accepted:"Accepted",rejected:"Rejected",archived:"Archived"},columns:{date:"Date",date_sent:"Sent to Uecko",reference:"Reference",status:"Status",customer_reference:"Customer Ref.",customer_information:"Customer",total_price:"Total amount"},resume:{title:"Quote",tabs:{resume:"Summary",preview:"Preview"},quote_information:"Quote Information",customer_information:"Customer Information",price_information:"Quote totals",select_quote:"Select a quote"}},notifications:{created:"Quote created",saved:"Quote saved",saving:"Saving quote"},pdf_generation:{title:"Generating PDF",error:"Error generating PDF",progress:"Progress: {{percentage}}%",elapsed:"Elapsed time: {{elapsed}} seconds",remaining:"Estimated time remaining: {{estimatedTime}} seconds",cancel:"Cancel generation"},create:{title:"New quote",form_groups:{general:{title:"General Data",desc:"General information and the quote's customer"},status:{title:"Status",desc:"Quote status"},documents:{title:"Attached Documents",desc:"Attach documents such as photos, drawings, sketches, etc. to your quotation.",images:"Images"}}},edit:{title:"Quote",buttons:{save_quote:"Save quote"}},duplicate_action:{toast_success:"Quote duplicated"},downloading_dialog:{title:"Downloading quote",description:"Please wait while your quotation is generated and downloaded in PDF format...",progress:{label:"Download is in {{status}}",status_in_progress:"in progress",status_stopped:"stopped"},cancel_button:"Cancel the download",toast_success:"Quote downloaded"},catalog_picker_dialog:{title:"Select catalog items",description:"To complete your quote, you can add items from the catalog.",toast_article_added:"Catalog item added:"},blocks_picker_dialog:{title:"Select a text block",description:"To help complete your quote, you can add predefined text blocks from this list.",toast_article_added:"Text block added:"},quote_sent_to_editor:{trigger_button:"Send to Uecko",title:"Send quote to Uecko",description:"Do you want to send this quote to Uecko? This action cannot be undone.",toast_status_changed:"Quote sent to Uecko"},quote_status_editor:{trigger_button:"Change quote status",title:"Change quote status",status:{draft:{title:"Draft",description:"The quote is in the initial stages of creation."},ready:{title:"Ready",description:"The quote is completed and ready to be delivered to the customer."},delivered:{title:"Delivered",description:"The quote has been sent to the client and a response is awaited."},accepted:{title:"Accepted",description:"The customer has approved the quote."},rejected:{title:"Rejected",description:"The customer has not accepted the quotation."},archived:{title:"Archived",description:"The quote has been saved for future reference."}},submit_button:"Change status",toast_status_changed:"Quote status changed to: {{newStatus}}"},discount_column:{label:"Show discount column",description:"Shows or hides the discount column in quote lines.",confirmation:{title:"Hide line discounts",description:"There are lines with discounts applied. Hiding the column will not remove those discounts: they will still affect the quote amount, but will no longer be shown in the lines or PDF.",confirm:"Hide column"}},additional_currency:{title:"Additional currency",description:"Optionally show the quote total in another currency.",enabled:"Show in another currency",currency:"Currency",date:"Exchange date",rate:"Exchange rate (1 EUR = …)",refresh:"Refresh exchange rate",total:"Total in {{code}}"},inline_row_actions:{delete_confirmation:{title:"Remove row",description:"Are you sure you want to remove this row? This action cannot be undone.",confirm:"Remove row"}},status:{draft:"Draft",ready:"Ready",delivered:"Delivered",accepted:"Accepted",rejected:"Rejected",archived:"Archived"},form_fields:{date:{label:"Date",desc:"Quote's date",placeholder:""},reference:{label:"Reference",desc:"Quote reference",placeholder:""},lang_code:{label:"Document language",desc:"Language used to generate the quote PDF",placeholder:"",options:{es:"Spanish",en:"English",fr:"French"}},currency_code:{label:"Currency",desc:"Quote currency",placeholder:""},customer_reference:{label:"Customer reference",desc:"Customer reference for this quote",placeholder:""},customer_information:{label:"Customer details",desc:"Recommendation: enter the customer's name on the first line, the address on the second line, and the zip code and city/state on the third line.",placeholder:`Name and surname
|
||
Street and number
|
||
zip code and city or state...`},payment_method:{label:"Payment method",placeholder:"placeholder",desc:"Method of payment for this quote"},notes:{label:"Notes",placeholder:"",desc:"Quote's notes"},validity:{label:"Validity time",placeholder:"",desc:"Quote's validity time"},subtotal_price:{label:"Subtotal",placeholder:"",desc:"Quote subtotal"},discount:{label:"Discount (%)",placeholder:"",desc:"Percentage discount"},discount_value:{label:"Discount ({{value}}%)",placeholder:"",desc:"Percentage discount"},discount_price:{label:"Discount amount",placeholder:"",desc:"Discount amount"},before_tax_price:{label:"Taxable amount",placeholder:"",desc:"Taxable amount"},tax:{label:"Tax (%)",placeholder:"",desc:"Percentage Tax"},tax_value:{label:"{{label}} ({{value}}%)",placeholder:"",desc:"Percentage Tax"},tax_price:{label:"Tax amount",placeholder:"",desc:"Tax amount"},total_price:{label:"Total price",placeholder:"",desc:"Quote total price"},items:{quantity:{label:"Quantity",placeholder:"",desc:""},description:{label:"Description",placeholder:"",desc:""},unit_price:{label:"Unit price",placeholder:"",desc:"Item unit price"},subtotal_price:{label:"Subtotal",placeholder:"",desc:""},discount:{label:"Discount (%)",placeholder:"",desc:"Percentage discount"},total_price:{label:"Total price",placeholder:"",desc:"Total price with percentage discount"}}}},settings:{edit:{title:"Settings",tabs:{profile:"Profile settings",quotes:"Quote settings",legal:"Legal settings"}},form_fields:{language:{label:"Language",placeholder:"Select a language",desc:"Preferred language for the interface",options:{es:"Spanish",en:"English",fr:"French"}},logo:{label:"Logo",desc:"This logo will appear in PDF-exported proposals",requirements:"JPG or PNG files are allowed. The logo dimensions must be 200x100 pixels or proportional.",upload:"Upload logo",invalid_format:"Only JPG or PNG files are allowed",invalid_dimensions:"The logo dimensions must be 200x100 pixels or proportional."},contact_information:{label:"Your contact information",placeholder:"",desc:"Your contact information as a dealer that will appear on the quotes given to your customers."},default_tax:{label:"Default tax (%)",placeholder:"",desc:"Default tax rate for your quotes"},default_tax_label:{placeholder:"% VAT",desc:"Name or label shown alongside the tax"},default_show_line_discount_column:{label:"Show discount column by default",desc:"New quotes will initially show the discount column in their lines. You can change this option later for each quote."},default_legal_terms:{label:"Legal terms",placeholder:"",desc:"Legal text to include in all new quotes"},default_payment_method:{label:"Payment method",placeholder:"",desc:"Default payment method to be used for new quotes"},default_notes:{label:"Notes",placeholder:"",desc:"Default notes to be used for new quotes"},default_quote_validity:{label:"Quote validity",placeholder:"",desc:"Default validity time to be used for new quotes"}},notifications:{saved:"Settings saved",saving:"Saving settings"}},support:{modal:{title:"Send an issue",subtitle:"Use this form to report any problem you encountered while using the application. Our development team will review your issue and try to resolve it.",open:"Open support window",placeholder:"Describe the issue here...",submit:"Send issue",validation:{empty:"Write something before sending",min:"The text is too short. It must contain at least 10 characters",max:"The text is too long.",required:"A description is required"},notifications:{sent_title:"Issue sent",sent_description:"The issue was sent successfully",error_title:"Sending error",error_description:"The issue could not be sent. Please try again."},cancel_confirmation:{title:"Are you sure you want to cancel?",description:"You have entered text in the description field. Closing the window will discard your unsaved changes.",back:"Return to form",confirm:"Yes, close"}},form_fields:{}}},yHe={translation:vHe},bHe={common:{required:"obligatorio",cancel:"Cancelar",no:"No",yes:"Sí",save:"Guardar",save_close:"Guardar y Cerrar",discard:"Descartar",hide:"Ocultar",back:"Volver",upload:"Cargar",continue:"Continuar",close:"Cerrar",more:"More",pagination:"Paginación",breadcrumb:"Migas de pan",previous:"Anterior",next:"Siguiente",more_pages:"Más páginas",previous_slide:"Diapositiva anterior",next_slide:"Diapositiva siguiente",add:"Añadir",submit:"Enviar",download:"Descargar",help:"Ayuda",select_all:"Seleccionar todo",select_row:"Seleccionar fila",sort_asc:"Asc",sort_asc_description:"En order ascendente. Click para ordenar descendentemente.",sort_desc:"Desc",sort_desc_description:"En orden descendente. Click para ordenar ascendentemente.",sort_none_description:"Sin orden. Click para ordenar ascendentemente.",rows_selected:"{{count}} fila(s) seleccionadas.",rows_selected_of_total:"{{count}} de {{total}} fila(s) seleccionadas.",rows_per_page:"Filas por página",num_page_of_total:"Página {{count}} de {{total}}",go_to_first_page:"Ir a la primera página",go_to_prev_page:"Ir a la página anterior",go_to_next_page:"Ir a la página siguiente",go_to_last_page:"Ir a la última página",error:"Error",actions:"Acciones",open_menu:"Abrir el menú",duplicate_row:"Duplicar",duplicate_selected_rows:"Duplicar",duplicate_selected_rows_tooltip:"Duplica las fila(s) seleccionadas(s)",append_empty_row:"Añadir fila",append_empty_row_tooltip:"Añadir una fila vacía",append_article:"Añadir artículo",append_article_tooltip:"Elegir un artículo del catálogo y añadirlo",append_block:"Añadir bloque de texto",append_block_tooltip:"Elegir un bloque de texto y añadirlo",move_row:"Mover fila",remove_row:"Eliminar",remove_selected_rows:"Eliminar",remove_selected_rows_tooltip:"Elimina las fila(s) seleccionadas(s)",reset_selected_rows:"Quitar selection",reset_selected_rows_tooltip:"Dejar de seleccionar la(s) fila(s)",insert_row_above:"Insertar fila encima",insert_row_below:"Insertar fila debajo",pick_date:"Elige una fecha",today:"Hoy",required_field:"Este campo es obligatorio",edit:"Editar",remove:"Eliminar",archive:"Archivar",duplicate:"Duplicar",disable_preview:"Ocultar vista previa",enable_preview:"Mostrar vista previa",filter:{reset_filter:"Quitar el filtro",badget_remove_tooltip:"Quitar este término del filtro",input_placeholder:"Escribe aquí para filtrar...",button_add_term:"Añadir término al filtro",button_add_term_tooltip:"Añadir término al filtro (o pulsa Enter)",help_text:"Presiona Enter o haz clic en el botón + para añadir un término al filtro. Usa múltiples términos para una búsqueda más amplia."}},components:{loading_indicator:{title:"Cargando..."},loading_overlay:{title:"Cargando...",subtitle:"Esto puede tardar unos segundos. Por favor, no cierre esta página."},error_overlay:{title:"Se ha producido un error",go_home:"Ir al inicio"},empty_state:{title:"Esto está muy vacío",subtitle:"Empieza solicitando la carga del catálogo",button:"Solicitar carga del catálogo"},data_table:{columns:"Columnas",no_results:"No se han encontrado resultados.",clear_filters:"Limpiar filtros",selected_count:"{{count}} seleccionados"}},hooks:{use_unsaved_changes_notifier:{title:"Se han detectado cambios",subtitle:`Atención, hay cambios pendientes de guardar en esta página.
|
||
Si continúa, perderá los cambios.`,confirm_text:"Continuar",cancel_text:"No continuar"}},main_menu:{toggle_navigation:"Alternar el menú de navegación",settings:"Ajustes",catalog:"Catálogo",quotes:"Cotizaciones",search_placeholder:"Buscar productos, cotizaciones, etc...",user:{user_menu:"Menú del usuario",my_account:"Mi cuenta",profile:"Perfil",settings:"Ajustes",support:"Soporte",logout:"Salir"},logout_dialog:{title:"Salir de la cuenta",description:"¿Desea salir de su cuenta?",confirm_label:"Salir",cancel_label:"Cancelar"}},login_page:{title:"Presupuestador para distribuidores",description:"Introduzca su dirección de correo electrónico y contraseña para acceder",email_label:"Email",email_placeholder:"micorreo@ejemplo.com",password_label:"Contraseña",forgotten_password:"¿Has olvidado tu contraseña?",become_dealer:"¿Quieres ser distribuidor de Uecko?",contact_us:"Contacta con nosotros",login:"Entrar"},dashboard:{welcome:"Bienvenido"},catalog:{list:{title:"Catálogo de artículos",empty_state:{subtitle:"Empieza cargando los artículos del catálogo"},columns:{description:"Descripción",points:"Puntos",retail_price:"PVP",quantity:"Cantidad"}}},quotes:{list:{title:"Cotizaciones",subtitle:"",tabs_title:"Estados",select_status:"Seleccionar estado",preview_aria:"Mostrar vista previa de la cotización",empty_state:{subtitle:"Empieza creando alguna cotización"},status_help:{title:"Ayuda sobre el estado de las cotizaciones",intro:"El estado de una cotización indica su posición actual en el proceso de negocio.",possible:"Los estados posibles son:",outro:"Utiliza estos estados para hacer un seguimiento eficiente de tus cotizaciones y optimizar tu proceso de ventas. El estado Archivado ayuda a conservar el historial sin interferir con las cotizaciones activas."},tabs:{all:"Todas",draft:"Borradores",ready:"Preparados",delivered:"Entregado",accepted:"Aceptados",rejected:"Rechazados",archived:"Archivados"},columns:{date:"Fecha",date_sent:"Enviado a Uecko",reference:"Referencia",status:"Estado",customer_reference:"Ref. cliente",customer_information:"Cliente",total_price:"Imp. total"},resume:{title:"Cotización",tabs:{resume:"Resumen",preview:"Previsualización"},quote_information:"Información",customer_information:"Cliente",price_information:"Importes",select_quote:"Selecciona una cotización"}},notifications:{created:"Cotización creada",saved:"Cotización guardada",saving:"Guardando cotización"},pdf_generation:{title:"Generando PDF",error:"Error al generar el PDF",progress:"Progreso: {{percentage}}%",elapsed:"Tiempo transcurrido: {{elapsed}} segundos",remaining:"Tiempo estimado restante: {{estimatedTime}} segundos",cancel:"Cancelar generación"},create:{title:"Nueva cotización",form_groups:{general:{title:"Datos generales",desc:"Datos generales y cliente al que va la cotización"},status:{title:"Estado",desc:"Estado de la cotización"},documents:{title:"Documentos",desc:"Añada adjuntar con su cotización documentos como fotos, planos, croquis, etc.",images:"Imágenes"}}},edit:{title:"Cotización",buttons:{save_quote:"Guardar cotización"}},duplicate_action:{toast_success:"Cotización duplicada"},downloading_dialog:{title:"Descargando cotización",description:"Espere mientras se genera la cotización y se descarga en formato PDF...",progress:{label:"La descarga está {{status}}",status_in_progress:"en marcha",status_stopped:"parada"},cancel_button:"Cancelar la descarga",toast_success:"Cotización descargada"},catalog_picker_dialog:{title:"Seleccionar artículos del catálogo",description:"Para rellenar su cotización, puede añadir artículos del catálogo.",toast_article_added:"Artículo del catálogo añadido:"},blocks_picker_dialog:{title:"Selecctionar bloques de texto",description:"Para ayudar a rellenar la cotización, puede añadir bloques de texto predefinidos de esta lista.",toast_article_added:"Bloque de texto añadido:"},quote_sent_to_editor:{trigger_button:"Enviar a Uecko",title:"Enviar la cotización a Uecko",description:"¿Desea enviar esta cotización a Uecko? Esta acción no se puede deshacer.",toast_status_changed:"Cotización enviada a Uecko"},quote_status_editor:{trigger_button:"Cambiar el estado",title:"Cambiar el estado de la cotización",status:{draft:{title:"Borrador",description:"La cotización está en fase inicial de creación."},ready:{title:"Preparado",description:"La cotización está completo y listo para ser entregado al cliente."},delivered:{title:"Entregado",description:"La cotización ha sido enviado al cliente y se espera su respuesta."},accepted:{title:"Aceptado",description:"El cliente ha aprobado la cotización."},rejected:{title:"Rechazado",description:"El cliente no ha aceptado la cotización."},archived:{title:"Archivado",description:"La cotización se ha guardado para referencia futura."}},submit_button:"Cambiar estado",toast_status_changed:"Estado de la cotización cambiado a: {{newStatus}}"},discount_column:{label:"Mostrar columna descuento",description:"Muestra u oculta la columna de descuento en las líneas.",confirmation:{title:"Ocultar descuentos de línea",description:"Hay líneas con descuento aplicado. Ocultar la columna no eliminará esos descuentos: seguirán afectando al importe de la cotización, pero dejarán de mostrarse en las líneas y en el PDF.",confirm:"Ocultar columna"}},additional_currency:{title:"Moneda adicional",description:"Muestra el total del presupuesto en otra moneda de forma opcional.",enabled:"Mostrar en otra moneda",currency:"Moneda",date:"Fecha de cambio",rate:"Tipo de cambio (1 EUR = …)",refresh:"Refrescar cambio",total:"Total en {{code}}"},inline_row_actions:{delete_confirmation:{title:"Eliminar fila",description:"¿Seguro que quieres eliminar esta fila? Esta acción no se puede deshacer.",confirm:"Eliminar fila"}},status:{draft:"Borrador",ready:"Preparado",delivered:"Entregado",accepted:"Aceptado",rejected:"Rechazado",archived:"Archivado"},form_fields:{date:{label:"Fecha",desc:"Fecha de esta cotización",placeholder:""},reference:{label:"Referencia",desc:"Referencia para esta cotización",placeholder:""},lang_code:{label:"Idioma del documento",desc:"Idioma utilizado para generar el presupuesto en PDF",placeholder:"",options:{es:"Español",en:"Inglés",fr:"Francés"}},currency_code:{label:"Moneda",desc:"Moneda de la cotización",placeholder:""},customer_reference:{label:"Referencia del cliente",desc:"Referencia para el cliente de esta cotización",placeholder:""},customer_information:{label:"Datos del cliente",desc:"Recomensación: escriba el nombre del cliente en la primera línea, la direccion en la segunda y el código postal y ciudad en la tercera.",placeholder:`Nombre y apellidos
|
||
Calle y número
|
||
Código postal y ciudad...`},payment_method:{label:"Forma de pago",placeholder:"placeholder",desc:"Forma de pago que se utilizará en esta cotización"},notes:{label:"Notas",placeholder:"",desc:"Notas a incluir en la cotización"},validity:{label:"Validez de la cotización",placeholder:"",desc:"Validez de la cotización"},subtotal_price:{label:"Importe neto",placeholder:"",desc:""},discount:{label:"Descuento (%)",placeholder:"",desc:"Porcentaje de descuento"},discount_value:{label:"Descuento ({{value}}%)",placeholder:"",desc:"Porcentaje de descuento"},discount_price:{label:"Imp. descuento",placeholder:"",desc:"Importe del descuento"},before_tax_price:{label:"Base imponible",placeholder:"",desc:""},tax:{label:"Impuesto (%)",placeholder:"",desc:"Porcentaje de impuesto"},tax_value:{label:"{{label}} ({{value}}%)",placeholder:"",desc:"Porcentaje de impuesto"},tax_price:{label:"Imp. impuesto",placeholder:"",desc:"Importe del impuesto"},total_price:{label:"Imp. total",placeholder:"",desc:"Importe total"},items:{quantity:{label:"Cantidad",placeholder:"",desc:""},description:{label:"Descripción",placeholder:"",desc:""},unit_price:{label:"Imp. unitario",placeholder:"",desc:"Importe unitario del artículo"},subtotal_price:{label:"Subtotal",placeholder:"",desc:""},discount:{label:"Dto (%)",placeholder:"",desc:"Porcentaje de descuento"},total_price:{label:"Imp. total",placeholder:"",desc:"Importe total con el descuento ya aplicado"}}}},settings:{edit:{title:"Ajustes",tabs:{profile:"Ajustes de perfil",quotes:"Ajustes para cotizaciones",legal:"Ajustes legales"}},form_fields:{language:{label:"Idioma",placeholder:"Selecciona un idioma",desc:"Idioma preferido para la interfaz",options:{es:"Español",en:"Inglés",fr:"Francés"}},logo:{label:"Logotipo",desc:"Este logotipo aparecerá en las propuestas exportadas en PDF",requirements:"Se permiten ficheros JPG o PNG. Las dimensiones del logotipo deben ser 200x100 píxeles o proporcionales.",upload:"Subir logotipo",invalid_format:"Sólo se permiten ficheros JPG o PNG",invalid_dimensions:"Las dimensiones del logotipo deben ser 200x100 píxeles o proporcionales."},contact_information:{label:"Información de contacto",placeholder:"",desc:"Esta información de contacto aparecerá en las cotizaciones que entregue a sus clientes."},default_tax:{label:"Impuesto por defecto (%)",placeholder:"",desc:"Porcentaje de impuesto por defecto en las cotizaciones"},default_tax_label:{placeholder:"% IVA",desc:"Nombre o etiqueta que se mostrará junto al impuesto"},default_show_line_discount_column:{label:"Mostrar columna descuento por defecto",desc:"Los nuevos presupuestos mostrarán inicialmente la columna de descuento en las líneas. Podrás cambiar esta opción posteriormente en cada presupuesto."},default_legal_terms:{label:"Cláusulas legales",placeholder:"",desc:"Texto de texto legal que desee incluir en todas las cotizaciones nuevas"},default_payment_method:{label:"Forma de pago",placeholder:"",desc:"Texto para la forma de pago que se utilizará en las cotizaciones nuevas"},default_notes:{label:"Notas",placeholder:"",desc:"Notas a incluir en todas las cotizaciones nuevas"},default_quote_validity:{label:"Validez por defecto",placeholder:"",desc:"Texto para indicar el tiempo de validez de la cotización"}},notifications:{saved:"Ajustes guardados",saving:"Guardando ajustes"}},support:{modal:{title:"Enviar una incidencia",subtitle:"Utiliza este formulario para informar sobre cualquier problema que hayas encontrado mientras usabas la aplicación. Nuestro equipo de desarrollo revisará tu incidencia y tratará de resolverla.",open:"Abrir ventana de soporte",placeholder:"Describe la incidencia aquí...",submit:"Enviar incidencia",validation:{empty:"Debe escribir algo antes de enviar",min:"El texto es demasiado corto. Debe tener al menos 10 caracteres",max:"El texto es demasiado largo.",required:"La descripción es requerida"},notifications:{sent_title:"Incidencia enviada",sent_description:"La incidencia se ha enviado correctamente",error_title:"Error en el envío",error_description:"No se ha podido enviar la incidencia correctamente. Por favor, inténtalo de nuevo."},cancel_confirmation:{title:"¿Estás seguro de que quieres cancelar?",description:"Has escrito texto en el campo de descripción. Si cierras la ventana, perderás los cambios no guardados.",back:"Volver al formulario",confirm:"Sí, cerrar"}},form_fields:{}}},wHe={translation:bHe},_He={common:{required:"obligatoire",cancel:"Annuler",no:"Non",yes:"Oui",save:"Enregistrer",save_close:"Enregistrer et fermer",discard:"Abandonner",hide:"Masquer",back:"Retour",upload:"Téléverser",continue:"Continuer",close:"Fermer",more:"Plus",pagination:"Pagination",previous:"Précédent",next:"Suivant",add:"Ajouter",submit:"Envoyer",download:"Télécharger",help:"Aide",error:"Erreur",actions:"Actions",edit:"Modifier",remove:"Supprimer",archive:"Archiver",duplicate:"Dupliquer",pick_date:"Choisir une date",today:"Aujourd’hui",required_field:"Ce champ est obligatoire"},components:{loading_indicator:{title:"Chargement…"},loading_overlay:{title:"Chargement…",subtitle:"Cela peut prendre quelques secondes. Veuillez ne pas fermer cette page."},error_overlay:{title:"Une erreur s’est produite",go_home:"Aller à l’accueil"},empty_state:{title:"C’est très vide ici",subtitle:"Commencez par demander le chargement du catalogue",button:"Demander le chargement du catalogue"},data_table:{columns:"Colonnes",no_results:"Aucun résultat trouvé.",clear_filters:"Effacer les filtres",selected_count:"{{count}} sélectionné(s)"}},hooks:{use_unsaved_changes_notifier:{title:"Des modifications ont été détectées",subtitle:`Attention, des modifications ne sont pas enregistrées sur cette page.
|
||
Si vous continuez, vous les perdrez.`,confirm_text:"Continuer",cancel_text:"Ne pas continuer"}},main_menu:{toggle_navigation:"Basculer le menu de navigation",settings:"Paramètres",catalog:"Catalogue",quotes:"Devis",search_placeholder:"Rechercher des produits, devis, etc.",user:{user_menu:"Menu utilisateur",my_account:"Mon compte",profile:"Profil",settings:"Paramètres",support:"Assistance",logout:"Se déconnecter"},logout_dialog:{title:"Se déconnecter",description:"Voulez-vous vous déconnecter ?",confirm_label:"Se déconnecter",cancel_label:"Annuler"}},login_page:{title:"Outil de devis pour distributeurs",description:"Saisissez votre adresse e-mail et votre mot de passe pour accéder",email_label:"E-mail",email_placeholder:"monemail@exemple.com",password_label:"Mot de passe",forgotten_password:"Mot de passe oublié ?",become_dealer:"Vous souhaitez devenir distributeur Uecko ?",contact_us:"Contactez-nous",login:"Se connecter"},dashboard:{welcome:"Bienvenue"},catalog:{list:{title:"Catalogue d’articles",empty_state:{subtitle:"Commencez par charger les articles du catalogue"},columns:{description:"Description",points:"Points",retail_price:"Prix public",quantity:"Quantité"}}},quotes:{list:{title:"Devis",subtitle:"",tabs_title:"États",select_status:"Sélectionner un état",preview_aria:"Afficher l’aperçu du devis",empty_state:{subtitle:"Commencez par créer un devis"},tabs:{all:"Tous",draft:"Brouillons",ready:"Prêts",delivered:"Livrés",accepted:"Acceptés",rejected:"Refusés",archived:"Archivés"},columns:{date:"Date",date_sent:"Envoyé à Uecko",reference:"Référence",status:"État",customer_reference:"Réf. client",customer_information:"Client",total_price:"Montant total"},resume:{title:"Devis",tabs:{resume:"Résumé",preview:"Aperçu"},quote_information:"Informations",customer_information:"Client",price_information:"Montants",select_quote:"Sélectionnez un devis"}},notifications:{created:"Devis créé",saved:"Devis enregistré",saving:"Enregistrement du devis"},pdf_generation:{title:"Génération du PDF",error:"Erreur lors de la génération du PDF",progress:"Progression : {{percentage}}%",elapsed:"Temps écoulé : {{elapsed}} secondes",remaining:"Temps restant estimé : {{estimatedTime}} secondes",cancel:"Annuler la génération"},create:{title:"Nouveau devis",form_groups:{general:{title:"Données générales",desc:"Données générales et client auquel le devis est destiné"},status:{title:"État",desc:"État du devis"},documents:{title:"Documents",desc:"Ajoutez à votre devis des documents tels que photos, plans, croquis, etc.",images:"Images"}}},edit:{title:"Devis",buttons:{save_quote:"Enregistrer le devis"}},duplicate_action:{toast_success:"Devis dupliqué"},downloading_dialog:{title:"Téléchargement du devis",description:"Veuillez patienter pendant la génération et le téléchargement du devis au format PDF…",progress:{label:"Le téléchargement est {{status}}",status_in_progress:"en cours",status_stopped:"arrêté"},cancel_button:"Annuler le téléchargement",toast_success:"Devis téléchargé"},catalog_picker_dialog:{title:"Sélectionner des articles du catalogue",description:"Pour compléter votre devis, vous pouvez ajouter des articles du catalogue.",toast_article_added:"Article du catalogue ajouté :"},blocks_picker_dialog:{title:"Sélectionner des blocs de texte",description:"Pour vous aider à compléter le devis, vous pouvez ajouter des blocs de texte prédéfinis de cette liste.",toast_article_added:"Bloc de texte ajouté :"},quote_sent_to_editor:{trigger_button:"Envoyer à Uecko",title:"Envoyer le devis à Uecko",description:"Voulez-vous envoyer ce devis à Uecko ? Cette action est irréversible.",toast_status_changed:"Devis envoyé à Uecko"},status:{draft:"Brouillon",ready:"Prêt",delivered:"Livré",accepted:"Accepté",rejected:"Refusé",archived:"Archivé"},form_fields:{date:{label:"Date",desc:"Date de ce devis",placeholder:""},reference:{label:"Référence",desc:"Référence de ce devis",placeholder:""},lang_code:{label:"Langue du document",desc:"Langue utilisée pour générer le devis au format PDF",placeholder:"",options:{es:"Espagnol",en:"Anglais",fr:"Français"}},currency_code:{label:"Devise",desc:"Devise du devis",placeholder:""},customer_reference:{label:"Référence client",desc:"Référence client de ce devis",placeholder:""},customer_information:{label:"Informations client",desc:"Indiquez le nom, l’adresse, le code postal et la ville du client.",placeholder:`Nom et prénom
|
||
Rue et numéro
|
||
Code postal et ville…`},payment_method:{label:"Mode de paiement",placeholder:"",desc:"Mode de paiement utilisé pour ce devis"},notes:{label:"Notes",placeholder:"",desc:"Notes à inclure dans le devis"},validity:{label:"Validité du devis",placeholder:"",desc:"Validité de ce devis"},subtotal_price:{label:"Montant net",placeholder:"",desc:""},discount:{label:"Remise (%)",placeholder:"",desc:"Pourcentage de remise"},discount_price:{label:"Montant de la remise",placeholder:"",desc:"Montant de la remise"},before_tax_price:{label:"Base imposable",placeholder:"",desc:""},tax:{label:"Taxe (%)",placeholder:"",desc:"Pourcentage de taxe"},tax_price:{label:"Montant de la taxe",placeholder:"",desc:"Montant de la taxe"},total_price:{label:"Montant total",placeholder:"",desc:"Montant total"},items:{quantity:{label:"Quantité",placeholder:"",desc:""},description:{label:"Description",placeholder:"",desc:""},unit_price:{label:"Prix unitaire",placeholder:"",desc:"Prix unitaire de l’article"},subtotal_price:{label:"Sous-total",placeholder:"",desc:""},discount:{label:"Remise (%)",placeholder:"",desc:"Pourcentage de remise"},total_price:{label:"Montant total",placeholder:"",desc:"Montant total après application de la remise"}}}},settings:{edit:{title:"Paramètres",tabs:{profile:"Paramètres du profil",quotes:"Paramètres des devis",legal:"Paramètres juridiques"}},form_fields:{language:{label:"Langue",placeholder:"Sélectionnez une langue",desc:"Langue préférée de l’interface",options:{es:"Espagnol",en:"Anglais",fr:"Français"}},logo:{label:"Logo",desc:"Ce logo apparaîtra dans les propositions exportées au format PDF",requirements:"Les fichiers JPG ou PNG sont acceptés.",upload:"Téléverser le logo",invalid_format:"Seuls les fichiers JPG ou PNG sont acceptés",invalid_dimensions:"Les dimensions du logo sont invalides."},contact_information:{label:"Informations de contact",placeholder:"",desc:"Ces coordonnées apparaîtront dans les devis remis à vos clients."},default_tax:{label:"Taxe par défaut (%)",placeholder:"",desc:"Pourcentage de taxe par défaut dans les devis"},default_tax_label:{placeholder:"% TVA",desc:"Libellé affiché à côté de la taxe"},default_show_line_discount_column:{label:"Afficher la colonne de remise par défaut",desc:"Les nouveaux devis afficheront initialement la colonne de remise."},default_legal_terms:{label:"Clauses juridiques",placeholder:"",desc:"Texte juridique à inclure dans les nouveaux devis"},default_payment_method:{label:"Mode de paiement",placeholder:"",desc:"Texte utilisé dans les nouveaux devis"},default_notes:{label:"Notes",placeholder:"",desc:"Notes à inclure dans les nouveaux devis"},default_quote_validity:{label:"Validité par défaut",placeholder:"",desc:"Durée de validité du devis"}},notifications:{saved:"Paramètres enregistrés",saving:"Enregistrement des paramètres"}},support:{modal:{title:"Envoyer une incidence",subtitle:"Utilisez ce formulaire pour signaler un problème rencontré pendant l’utilisation de l’application.",open:"Ouvrir la fenêtre d’assistance",placeholder:"Décrivez l’incidence ici…",submit:"Envoyer l’incidence",validation:{empty:"Vous devez écrire quelque chose avant d’envoyer",min:"Le texte est trop court.",max:"Le texte est trop long.",required:"La description est obligatoire"},notifications:{sent_title:"Incident envoyé",sent_description:"L’incident a été envoyé correctement",error_title:"Erreur d’envoi",error_description:"L’incident n’a pas pu être envoyé. Veuillez réessayer."},cancel_confirmation:{title:"Voulez-vous annuler ?",description:"Vous perdrez les modifications non enregistrées.",back:"Retour au formulaire",confirm:"Oui, fermer"}},form_fields:{}}},xHe={translation:_He};ps.use(Ste).use(L2e).init({detection:{order:["navigator"]},debug:!1,fallbackLng:"es",interpolation:{escapeValue:!1},resources:{ca:gHe,en:yHe,es:wHe,fr:xHe}});function SHe(){const t=new mde({defaultOptions:{queries:{retry:!1,staleTime:1e4}}});return P.jsx(j2e,{i18n:ps,children:P.jsx(wde,{client:t,children:P.jsx(rIe,{dataSource:QUe("https://presupuestos.uecko.com:13001/api/v1"),children:P.jsx(Zue,{authActions:XUe("https://presupuestos.uecko.com:13001/api/v1"),children:P.jsxs(ZBe,{defaultTheme:"light",storageKey:"vite-ui-theme",children:[P.jsx(KMe,{delayDuration:0,children:P.jsx(Gee,{children:P.jsx(_.Suspense,{fallback:P.jsx(Es,{}),children:P.jsx(m4e,{})})})}),P.jsx(WX,{}),P.jsx(Hze,{}),!1]})})})})})}Ek.createRoot(document.getElementById("uecko")).render(P.jsx(se.StrictMode,{children:P.jsx(SHe,{})}));export{JTe as $,mK as A,Ci as B,Pfe as C,ow as D,eN as E,tN as F,e5e as G,eNe as H,t5e as I,dr as J,tNe as K,C5e as L,O1 as M,LLe as N,rNe as O,Bke as P,bb as Q,nc as R,RDe as S,pL as T,s_ as U,MQ as V,H6 as W,W6 as X,V6 as Y,q6 as Z,G6 as _,BW as a,Y$e as a$,INe as a0,HNe as a1,$Ne as a2,zNe as a3,BNe as a4,FNe as a5,UNe as a6,K6 as a7,gK as a8,oPe as a9,Q4 as aA,q4 as aB,kPe as aC,bf as aD,whe as aE,_he as aF,xhe as aG,Es as aH,jQ as aI,PU as aJ,U2e as aK,Z2e as aL,H2e as aM,K2e as aN,KMe as aO,Ife as aP,u5e as aQ,d5e as aR,mL as aS,YMe as aT,aIe as aU,hJ as aV,A5e as aW,qW as aX,sPe as aY,O5e as aZ,rp as a_,qxe as aa,jd as ab,KI as ac,gA as ad,VA as ae,vA as af,mJ as ag,Ho as ah,yA as ai,WA as aj,jPe as ak,oIe as al,se as am,SJ as an,nIe as ao,e4e as ap,h5e as aq,uPe as ar,uIe as as,Fv as at,HX as au,RPe as av,q2e as aw,X4 as ax,fIe as ay,IC as az,Nde as b,Od as b0,yr as b1,hIe as b2,z2e as b3,L5e as b4,OK as b5,hPe as b6,B2e as b7,f5e as b8,dPe as b9,e$e as bA,z$e as bB,ARe as bC,PRe as bD,TRe as bE,DRe as bF,NRe as bG,kRe as bH,zHe as bI,UHe as bJ,h2e as bK,N1 as bL,sNe as bM,Lfe as bN,j5e as bO,zV as bP,i5e as bQ,GNe as bR,KNe as bS,YNe as bT,x5e as bU,lIe as bV,SMe as bW,H8 as ba,xke as bb,F5e as bc,LNe as bd,Rfe as be,u6 as bf,THe as bg,TL as bh,kL as bi,NL as bj,ML as bk,DL as bl,LL as bm,OL as bn,P5e as bo,R5e as bp,k5e as bq,T5e as br,cw as bs,Ns as bt,M5e as bu,N5e as bv,D5e as bw,tJ as bx,eJ as by,t$e as bz,VW as c,es as d,dDe as e,ce as f,hDe as g,Ca as h,DQ as i,P as j,WW as k,tIe as l,CHe as m,CEe as n,AEe as o,j8 as p,z8 as q,_ as r,U8 as s,B8 as t,TW as u,OHe as v,ft as w,Kpe as x,ZRe as y,ePe as z};
|