537 lines
1.8 MiB
537 lines
1.8 MiB
var Rue=Object.defineProperty;var z4=t=>{throw TypeError(t)};var Nue=(t,e,n)=>e in t?Rue(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Te=(t,e,n)=>Nue(t,typeof e!="symbol"?e+"":e,n),uT=(t,e,n)=>e.has(t)||z4("Cannot "+n);var R=(t,e,n)=>(uT(t,e,"read from private field"),n?n.call(t):e.get(t)),B=(t,e,n)=>e.has(t)?z4("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),$=(t,e,n,r)=>(uT(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),z=(t,e,n)=>(uT(t,e,"access private method"),n);var Rs=(t,e,n,r)=>({set _(s){$(t,e,s,n)},get _(){return R(t,e,r)}});function v6(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 o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var pr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _u(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Pue(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 y6={exports:{}},IA={},b6={exports:{}},zt={};/**
|
||
* @license React
|
||
* react.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var i_=Symbol.for("react.element"),Tue=Symbol.for("react.portal"),kue=Symbol.for("react.fragment"),Due=Symbol.for("react.strict_mode"),Mue=Symbol.for("react.profiler"),Oue=Symbol.for("react.provider"),Iue=Symbol.for("react.context"),jue=Symbol.for("react.forward_ref"),Lue=Symbol.for("react.suspense"),$ue=Symbol.for("react.memo"),Fue=Symbol.for("react.lazy"),B4=Symbol.iterator;function zue(t){return t===null||typeof t!="object"?null:(t=B4&&t[B4]||t["@@iterator"],typeof t=="function"?t:null)}var x6={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w6=Object.assign,_6={};function ay(t,e,n){this.props=t,this.context=e,this.refs=_6,this.updater=n||x6}ay.prototype.isReactComponent={};ay.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")};ay.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function S6(){}S6.prototype=ay.prototype;function lj(t,e,n){this.props=t,this.context=e,this.refs=_6,this.updater=n||x6}var cj=lj.prototype=new S6;cj.constructor=lj;w6(cj,ay.prototype);cj.isPureReactComponent=!0;var U4=Array.isArray,C6=Object.prototype.hasOwnProperty,uj={current:null},E6={key:!0,ref:!0,__self:!0,__source:!0};function A6(t,e,n){var r,s={},i=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(i=""+e.key),e)C6.call(e,r)&&!E6.hasOwnProperty(r)&&(s[r]=e[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var c=Array(a),u=0;u<a;u++)c[u]=arguments[u+2];s.children=c}if(t&&t.defaultProps)for(r in a=t.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return{$$typeof:i_,type:t,key:i,ref:o,props:s,_owner:uj.current}}function Bue(t,e){return{$$typeof:i_,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function dj(t){return typeof t=="object"&&t!==null&&t.$$typeof===i_}function Uue(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var H4=/\/+/g;function dT(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Uue(""+t.key):e.toString(36)}function q1(t,e,n,r,s){var i=typeof t;(i==="undefined"||i==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case i_:case Tue:o=!0}}if(o)return o=t,s=s(o),t=r===""?"."+dT(o,0):r,U4(s)?(n="",t!=null&&(n=t.replace(H4,"$&/")+"/"),q1(s,e,n,"",function(u){return u})):s!=null&&(dj(s)&&(s=Bue(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(H4,"$&/")+"/")+t)),e.push(s)),1;if(o=0,r=r===""?".":r+":",U4(t))for(var a=0;a<t.length;a++){i=t[a];var c=r+dT(i,a);o+=q1(i,e,n,c,s)}else if(c=zue(t),typeof c=="function")for(t=c.call(t),a=0;!(i=t.next()).done;)i=i.value,c=r+dT(i,a++),o+=q1(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 o}function qS(t,e,n){if(t==null)return t;var r=[],s=0;return q1(t,r,"","",function(i){return e.call(n,i,s++)}),r}function Hue(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 ci={current:null},W1={transition:null},Vue={ReactCurrentDispatcher:ci,ReactCurrentBatchConfig:W1,ReactCurrentOwner:uj};function R6(){throw Error("act(...) is not supported in production builds of React.")}zt.Children={map:qS,forEach:function(t,e,n){qS(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return qS(t,function(){e++}),e},toArray:function(t){return qS(t,function(e){return e})||[]},only:function(t){if(!dj(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};zt.Component=ay;zt.Fragment=kue;zt.Profiler=Mue;zt.PureComponent=lj;zt.StrictMode=Due;zt.Suspense=Lue;zt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Vue;zt.act=R6;zt.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=w6({},t.props),s=t.key,i=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(i=e.ref,o=uj.current),e.key!==void 0&&(s=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(c in e)C6.call(e,c)&&!E6.hasOwnProperty(c)&&(r[c]=e[c]===void 0&&a!==void 0?a[c]:e[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){a=Array(c);for(var u=0;u<c;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:i_,type:t.type,key:s,ref:i,props:r,_owner:o}};zt.createContext=function(t){return t={$$typeof:Iue,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:Oue,_context:t},t.Consumer=t};zt.createElement=A6;zt.createFactory=function(t){var e=A6.bind(null,t);return e.type=t,e};zt.createRef=function(){return{current:null}};zt.forwardRef=function(t){return{$$typeof:jue,render:t}};zt.isValidElement=dj;zt.lazy=function(t){return{$$typeof:Fue,_payload:{_status:-1,_result:t},_init:Hue}};zt.memo=function(t,e){return{$$typeof:$ue,type:t,compare:e===void 0?null:e}};zt.startTransition=function(t){var e=W1.transition;W1.transition={};try{t()}finally{W1.transition=e}};zt.unstable_act=R6;zt.useCallback=function(t,e){return ci.current.useCallback(t,e)};zt.useContext=function(t){return ci.current.useContext(t)};zt.useDebugValue=function(){};zt.useDeferredValue=function(t){return ci.current.useDeferredValue(t)};zt.useEffect=function(t,e){return ci.current.useEffect(t,e)};zt.useId=function(){return ci.current.useId()};zt.useImperativeHandle=function(t,e,n){return ci.current.useImperativeHandle(t,e,n)};zt.useInsertionEffect=function(t,e){return ci.current.useInsertionEffect(t,e)};zt.useLayoutEffect=function(t,e){return ci.current.useLayoutEffect(t,e)};zt.useMemo=function(t,e){return ci.current.useMemo(t,e)};zt.useReducer=function(t,e,n){return ci.current.useReducer(t,e,n)};zt.useRef=function(t){return ci.current.useRef(t)};zt.useState=function(t){return ci.current.useState(t)};zt.useSyncExternalStore=function(t,e,n){return ci.current.useSyncExternalStore(t,e,n)};zt.useTransition=function(){return ci.current.useTransition()};zt.version="18.3.1";b6.exports=zt;var S=b6.exports;const oe=_u(S),o_=v6({__proto__:null,default:oe},[S]);/**
|
||
* @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 que=S,Wue=Symbol.for("react.element"),Gue=Symbol.for("react.fragment"),Kue=Object.prototype.hasOwnProperty,Yue=que.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Xue={key:!0,ref:!0,__self:!0,__source:!0};function N6(t,e,n){var r,s={},i=null,o=null;n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(o=e.ref);for(r in e)Kue.call(e,r)&&!Xue.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:Wue,type:t,key:i,ref:o,props:s,_owner:Yue.current}}IA.Fragment=Gue;IA.jsx=N6;IA.jsxs=N6;y6.exports=IA;var b=y6.exports,wD={},P6={exports:{}},Ro={},T6={exports:{}},k6={};/**
|
||
* @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(U,Q){var ne=U.length;U.push(Q);e:for(;0<ne;){var X=ne-1>>>1,G=U[X];if(0<s(G,Q))U[X]=Q,U[ne]=G,ne=X;else break e}}function n(U){return U.length===0?null:U[0]}function r(U){if(U.length===0)return null;var Q=U[0],ne=U.pop();if(ne!==Q){U[0]=ne;e:for(var X=0,G=U.length,Y=G>>>1;X<Y;){var Z=2*(X+1)-1,he=U[Z],fe=Z+1,ce=U[fe];if(0>s(he,ne))fe<G&&0>s(ce,he)?(U[X]=ce,U[fe]=ne,X=fe):(U[X]=he,U[Z]=ne,X=Z);else if(fe<G&&0>s(ce,ne))U[X]=ce,U[fe]=ne,X=fe;else break e}}return Q}function s(U,Q){var ne=U.sortIndex-Q.sortIndex;return ne!==0?ne:U.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var c=[],u=[],f=1,l=null,d=3,p=!1,h=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(U){for(var Q=n(u);Q!==null;){if(Q.callback===null)r(u);else if(Q.startTime<=U)r(u),Q.sortIndex=Q.expirationTime,e(c,Q);else break;Q=n(u)}}function _(U){if(m=!1,x(U),!h)if(n(c)!==null)h=!0,K(A);else{var Q=n(u);Q!==null&&V(_,Q.startTime-U)}}function A(U,Q){h=!1,m&&(m=!1,g(E),E=-1),p=!0;var ne=d;try{for(x(Q),l=n(c);l!==null&&(!(l.expirationTime>Q)||U&&!M());){var X=l.callback;if(typeof X=="function"){l.callback=null,d=l.priorityLevel;var G=X(l.expirationTime<=Q);Q=t.unstable_now(),typeof G=="function"?l.callback=G:l===n(c)&&r(c),x(Q)}else r(c);l=n(c)}if(l!==null)var Y=!0;else{var Z=n(u);Z!==null&&V(_,Z.startTime-Q),Y=!1}return Y}finally{l=null,d=ne,p=!1}}var N=!1,T=null,E=-1,P=5,k=-1;function M(){return!(t.unstable_now()-k<P)}function I(){if(T!==null){var U=t.unstable_now();k=U;var Q=!0;try{Q=T(!0,U)}finally{Q?j():(N=!1,T=null)}}else N=!1}var j;if(typeof v=="function")j=function(){v(I)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,H=L.port2;L.port1.onmessage=I,j=function(){H.postMessage(null)}}else j=function(){y(I,0)};function K(U){T=U,N||(N=!0,j())}function V(U,Q){E=y(function(){U(t.unstable_now())},Q)}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(U){U.callback=null},t.unstable_continueExecution=function(){h||p||(h=!0,K(A))},t.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<U?Math.floor(1e3/U):5},t.unstable_getCurrentPriorityLevel=function(){return d},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function(U){switch(d){case 1:case 2:case 3:var Q=3;break;default:Q=d}var ne=d;d=Q;try{return U()}finally{d=ne}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(U,Q){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var ne=d;d=U;try{return Q()}finally{d=ne}},t.unstable_scheduleCallback=function(U,Q,ne){var X=t.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?X+ne:X):ne=X,U){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=ne+G,U={id:f++,callback:Q,priorityLevel:U,startTime:ne,expirationTime:G,sortIndex:-1},ne>X?(U.sortIndex=ne,e(u,U),n(c)===null&&U===n(u)&&(m?(g(E),E=-1):m=!0,V(_,ne-X))):(U.sortIndex=G,e(c,U),h||p||(h=!0,K(A))),U},t.unstable_shouldYield=M,t.unstable_wrapCallback=function(U){var Q=d;return function(){var ne=d;d=Q;try{return U.apply(this,arguments)}finally{d=ne}}}})(k6);T6.exports=k6;var Que=T6.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 Zue=S,Co=Que;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 D6=new Set,O0={};function Lp(t,e){Iv(t,e),Iv(t+"Capture",e)}function Iv(t,e){for(O0[t]=e,t=0;t<e.length;t++)D6.add(e[t])}var hu=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_D=Object.prototype.hasOwnProperty,Jue=/^[: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]*$/,V4={},q4={};function ede(t){return _D.call(q4,t)?!0:_D.call(V4,t)?!1:Jue.test(t)?q4[t]=!0:(V4[t]=!0,!1)}function tde(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 nde(t,e,n,r){if(e===null||typeof e>"u"||tde(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 ui(t,e,n,r,s,i,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=o}var Ss={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Ss[t]=new ui(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Ss[e]=new ui(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Ss[t]=new ui(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Ss[t]=new ui(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){Ss[t]=new ui(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Ss[t]=new ui(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Ss[t]=new ui(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Ss[t]=new ui(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Ss[t]=new ui(t,5,!1,t.toLowerCase(),null,!1,!1)});var fj=/[\-:]([a-z])/g;function hj(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(fj,hj);Ss[e]=new ui(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(fj,hj);Ss[e]=new ui(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(fj,hj);Ss[e]=new ui(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Ss[t]=new ui(t,1,!1,t.toLowerCase(),null,!1,!1)});Ss.xlinkHref=new ui("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Ss[t]=new ui(t,1,!1,t.toLowerCase(),null,!0,!0)});function pj(t,e,n,r){var s=Ss.hasOwnProperty(e)?Ss[e]:null;(s!==null?s.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(nde(e,n,s,r)&&(n=null),r||s===null?ede(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 Su=Zue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,WS=Symbol.for("react.element"),Bm=Symbol.for("react.portal"),Um=Symbol.for("react.fragment"),mj=Symbol.for("react.strict_mode"),SD=Symbol.for("react.profiler"),M6=Symbol.for("react.provider"),O6=Symbol.for("react.context"),gj=Symbol.for("react.forward_ref"),CD=Symbol.for("react.suspense"),ED=Symbol.for("react.suspense_list"),vj=Symbol.for("react.memo"),Ju=Symbol.for("react.lazy"),I6=Symbol.for("react.offscreen"),W4=Symbol.iterator;function ab(t){return t===null||typeof t!="object"?null:(t=W4&&t[W4]||t["@@iterator"],typeof t=="function"?t:null)}var sr=Object.assign,fT;function Lb(t){if(fT===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);fT=e&&e[1]||""}return`
|
||
`+fT+t}var hT=!1;function pT(t,e){if(!t||hT)return"";hT=!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(`
|
||
`),o=s.length-1,a=i.length-1;1<=o&&0<=a&&s[o]!==i[a];)a--;for(;1<=o&&0<=a;o--,a--)if(s[o]!==i[a]){if(o!==1||a!==1)do if(o--,a--,0>a||s[o]!==i[a]){var c=`
|
||
`+s[o].replace(" at new "," at ");return t.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",t.displayName)),c}while(1<=o&&0<=a);break}}}finally{hT=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Lb(t):""}function rde(t){switch(t.tag){case 5:return Lb(t.type);case 16:return Lb("Lazy");case 13:return Lb("Suspense");case 19:return Lb("SuspenseList");case 0:case 2:case 15:return t=pT(t.type,!1),t;case 11:return t=pT(t.type.render,!1),t;case 1:return t=pT(t.type,!0),t;default:return""}}function AD(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 Um:return"Fragment";case Bm:return"Portal";case SD:return"Profiler";case mj:return"StrictMode";case CD:return"Suspense";case ED:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case O6:return(t.displayName||"Context")+".Consumer";case M6:return(t._context.displayName||"Context")+".Provider";case gj:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case vj:return e=t.displayName||null,e!==null?e:AD(t.type)||"Memo";case Ju:e=t._payload,t=t._init;try{return AD(t(e))}catch{}}return null}function sde(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 AD(e);case 8:return e===mj?"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 Zd(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function j6(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function ide(t){var e=j6(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function GS(t){t._valueTracker||(t._valueTracker=ide(t))}function L6(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=j6(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function VC(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function RD(t,e){var n=e.checked;return sr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function G4(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Zd(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 $6(t,e){e=e.checked,e!=null&&pj(t,"checked",e,!1)}function ND(t,e){$6(t,e);var n=Zd(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?PD(t,e.type,n):e.hasOwnProperty("defaultValue")&&PD(t,e.type,Zd(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function K4(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function PD(t,e,n){(e!=="number"||VC(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var $b=Array.isArray;function ig(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=""+Zd(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 TD(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(ke(91));return sr({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function Y4(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($b(n)){if(1<n.length)throw Error(ke(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:Zd(n)}}function F6(t,e){var n=Zd(e.value),r=Zd(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 X4(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function z6(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 kD(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?z6(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var KS,B6=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(KS=KS||document.createElement("div"),KS.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=KS.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function I0(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var u0={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},ode=["Webkit","ms","Moz","O"];Object.keys(u0).forEach(function(t){ode.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),u0[e]=u0[t]})});function U6(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||u0.hasOwnProperty(t)&&u0[t]?(""+e).trim():e+"px"}function H6(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=U6(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,s):t[n]=s}}var ade=sr({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function DD(t,e){if(e){if(ade[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 MD(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 OD=null;function yj(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ID=null,og=null,ag=null;function Q4(t){if(t=c_(t)){if(typeof ID!="function")throw Error(ke(280));var e=t.stateNode;e&&(e=zA(e),ID(t.stateNode,t.type,e))}}function V6(t){og?ag?ag.push(t):ag=[t]:og=t}function q6(){if(og){var t=og,e=ag;if(ag=og=null,Q4(t),e)for(t=0;t<e.length;t++)Q4(e[t])}}function W6(t,e){return t(e)}function G6(){}var mT=!1;function K6(t,e,n){if(mT)return t(e,n);mT=!0;try{return W6(t,e,n)}finally{mT=!1,(og!==null||ag!==null)&&(G6(),q6())}}function j0(t,e){var n=t.stateNode;if(n===null)return null;var r=zA(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 jD=!1;if(hu)try{var lb={};Object.defineProperty(lb,"passive",{get:function(){jD=!0}}),window.addEventListener("test",lb,lb),window.removeEventListener("test",lb,lb)}catch{jD=!1}function lde(t,e,n,r,s,i,o,a,c){var u=Array.prototype.slice.call(arguments,3);try{e.apply(n,u)}catch(f){this.onError(f)}}var d0=!1,qC=null,WC=!1,LD=null,cde={onError:function(t){d0=!0,qC=t}};function ude(t,e,n,r,s,i,o,a,c){d0=!1,qC=null,lde.apply(cde,arguments)}function dde(t,e,n,r,s,i,o,a,c){if(ude.apply(this,arguments),d0){if(d0){var u=qC;d0=!1,qC=null}else throw Error(ke(198));WC||(WC=!0,LD=u)}}function $p(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 Y6(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 Z4(t){if($p(t)!==t)throw Error(ke(188))}function fde(t){var e=t.alternate;if(!e){if(e=$p(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 Z4(s),t;if(i===r)return Z4(s),e;i=i.sibling}throw Error(ke(188))}if(n.return!==r.return)n=s,r=i;else{for(var o=!1,a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o)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 X6(t){return t=fde(t),t!==null?Q6(t):null}function Q6(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=Q6(t);if(e!==null)return e;t=t.sibling}return null}var Z6=Co.unstable_scheduleCallback,J4=Co.unstable_cancelCallback,hde=Co.unstable_shouldYield,pde=Co.unstable_requestPaint,_r=Co.unstable_now,mde=Co.unstable_getCurrentPriorityLevel,bj=Co.unstable_ImmediatePriority,J6=Co.unstable_UserBlockingPriority,GC=Co.unstable_NormalPriority,gde=Co.unstable_LowPriority,eV=Co.unstable_IdlePriority,jA=null,Fl=null;function vde(t){if(Fl&&typeof Fl.onCommitFiberRoot=="function")try{Fl.onCommitFiberRoot(jA,t,void 0,(t.current.flags&128)===128)}catch{}}var Ua=Math.clz32?Math.clz32:xde,yde=Math.log,bde=Math.LN2;function xde(t){return t>>>=0,t===0?32:31-(yde(t)/bde|0)|0}var YS=64,XS=4194304;function Fb(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function KC(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,s=t.suspendedLanes,i=t.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=Fb(a):(i&=o,i!==0&&(r=Fb(i)))}else o=n&~s,o!==0?r=Fb(o):i!==0&&(r=Fb(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-Ua(e),s=1<<n,r|=t[n],e&=~s;return r}function wde(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 _de(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,s=t.expirationTimes,i=t.pendingLanes;0<i;){var o=31-Ua(i),a=1<<o,c=s[o];c===-1?(!(a&n)||a&r)&&(s[o]=wde(a,e)):c<=e&&(t.expiredLanes|=a),i&=~a}}function $D(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function tV(){var t=YS;return YS<<=1,!(YS&4194240)&&(YS=64),t}function gT(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function a_(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Ua(e),t[e]=n}function Sde(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-Ua(n),i=1<<s;e[s]=0,r[s]=-1,t[s]=-1,n&=~i}}function xj(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-Ua(n),s=1<<r;s&e|t[r]&e&&(t[r]|=e),n&=~s}}var xn=0;function nV(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var rV,wj,sV,iV,oV,FD=!1,QS=[],Ud=null,Hd=null,Vd=null,L0=new Map,$0=new Map,id=[],Cde="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 ez(t,e){switch(t){case"focusin":case"focusout":Ud=null;break;case"dragenter":case"dragleave":Hd=null;break;case"mouseover":case"mouseout":Vd=null;break;case"pointerover":case"pointerout":L0.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":$0.delete(e.pointerId)}}function cb(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=c_(e),e!==null&&wj(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,s!==null&&e.indexOf(s)===-1&&e.push(s),t)}function Ede(t,e,n,r,s){switch(e){case"focusin":return Ud=cb(Ud,t,e,n,r,s),!0;case"dragenter":return Hd=cb(Hd,t,e,n,r,s),!0;case"mouseover":return Vd=cb(Vd,t,e,n,r,s),!0;case"pointerover":var i=s.pointerId;return L0.set(i,cb(L0.get(i)||null,t,e,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,$0.set(i,cb($0.get(i)||null,t,e,n,r,s)),!0}return!1}function aV(t){var e=Qf(t.target);if(e!==null){var n=$p(e);if(n!==null){if(e=n.tag,e===13){if(e=Y6(n),e!==null){t.blockedOn=e,oV(t.priority,function(){sV(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 G1(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=zD(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);OD=r,n.target.dispatchEvent(r),OD=null}else return e=c_(n),e!==null&&wj(e),t.blockedOn=n,!1;e.shift()}return!0}function tz(t,e,n){G1(t)&&n.delete(e)}function Ade(){FD=!1,Ud!==null&&G1(Ud)&&(Ud=null),Hd!==null&&G1(Hd)&&(Hd=null),Vd!==null&&G1(Vd)&&(Vd=null),L0.forEach(tz),$0.forEach(tz)}function ub(t,e){t.blockedOn===e&&(t.blockedOn=null,FD||(FD=!0,Co.unstable_scheduleCallback(Co.unstable_NormalPriority,Ade)))}function F0(t){function e(s){return ub(s,t)}if(0<QS.length){ub(QS[0],t);for(var n=1;n<QS.length;n++){var r=QS[n];r.blockedOn===t&&(r.blockedOn=null)}}for(Ud!==null&&ub(Ud,t),Hd!==null&&ub(Hd,t),Vd!==null&&ub(Vd,t),L0.forEach(e),$0.forEach(e),n=0;n<id.length;n++)r=id[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<id.length&&(n=id[0],n.blockedOn===null);)aV(n),n.blockedOn===null&&id.shift()}var lg=Su.ReactCurrentBatchConfig,YC=!0;function Rde(t,e,n,r){var s=xn,i=lg.transition;lg.transition=null;try{xn=1,_j(t,e,n,r)}finally{xn=s,lg.transition=i}}function Nde(t,e,n,r){var s=xn,i=lg.transition;lg.transition=null;try{xn=4,_j(t,e,n,r)}finally{xn=s,lg.transition=i}}function _j(t,e,n,r){if(YC){var s=zD(t,e,n,r);if(s===null)AT(t,e,r,XC,n),ez(t,r);else if(Ede(s,t,e,n,r))r.stopPropagation();else if(ez(t,r),e&4&&-1<Cde.indexOf(t)){for(;s!==null;){var i=c_(s);if(i!==null&&rV(i),i=zD(t,e,n,r),i===null&&AT(t,e,r,XC,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else AT(t,e,r,null,n)}}var XC=null;function zD(t,e,n,r){if(XC=null,t=yj(r),t=Qf(t),t!==null)if(e=$p(t),e===null)t=null;else if(n=e.tag,n===13){if(t=Y6(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 XC=t,null}function lV(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(mde()){case bj:return 1;case J6:return 4;case GC:case gde:return 16;case eV:return 536870912;default:return 16}default:return 16}}var $d=null,Sj=null,K1=null;function cV(){if(K1)return K1;var t,e=Sj,n=e.length,r,s="value"in $d?$d.value:$d.textContent,i=s.length;for(t=0;t<n&&e[t]===s[t];t++);var o=n-t;for(r=1;r<=o&&e[n-r]===s[i-r];r++);return K1=s.slice(t,1<r?1-r:void 0)}function Y1(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 ZS(){return!0}function nz(){return!1}function No(t){function e(n,r,s,i,o){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var a in t)t.hasOwnProperty(a)&&(n=t[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?ZS:nz,this.isPropagationStopped=nz,this}return sr(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=ZS)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ZS)},persist:function(){},isPersistent:ZS}),e}var ly={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cj=No(ly),l_=sr({},ly,{view:0,detail:0}),Pde=No(l_),vT,yT,db,LA=sr({},l_,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ej,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!==db&&(db&&t.type==="mousemove"?(vT=t.screenX-db.screenX,yT=t.screenY-db.screenY):yT=vT=0,db=t),vT)},movementY:function(t){return"movementY"in t?t.movementY:yT}}),rz=No(LA),Tde=sr({},LA,{dataTransfer:0}),kde=No(Tde),Dde=sr({},l_,{relatedTarget:0}),bT=No(Dde),Mde=sr({},ly,{animationName:0,elapsedTime:0,pseudoElement:0}),Ode=No(Mde),Ide=sr({},ly,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),jde=No(Ide),Lde=sr({},ly,{data:0}),sz=No(Lde),$de={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Fde={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"},zde={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Bde(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=zde[t])?!!e[t]:!1}function Ej(){return Bde}var Ude=sr({},l_,{key:function(t){if(t.key){var e=$de[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Y1(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Fde[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ej,charCode:function(t){return t.type==="keypress"?Y1(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Y1(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Hde=No(Ude),Vde=sr({},LA,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),iz=No(Vde),qde=sr({},l_,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ej}),Wde=No(qde),Gde=sr({},ly,{propertyName:0,elapsedTime:0,pseudoElement:0}),Kde=No(Gde),Yde=sr({},LA,{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}),Xde=No(Yde),Qde=[9,13,27,32],Aj=hu&&"CompositionEvent"in window,f0=null;hu&&"documentMode"in document&&(f0=document.documentMode);var Zde=hu&&"TextEvent"in window&&!f0,uV=hu&&(!Aj||f0&&8<f0&&11>=f0),oz=" ",az=!1;function dV(t,e){switch(t){case"keyup":return Qde.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fV(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Hm=!1;function Jde(t,e){switch(t){case"compositionend":return fV(e);case"keypress":return e.which!==32?null:(az=!0,oz);case"textInput":return t=e.data,t===oz&&az?null:t;default:return null}}function efe(t,e){if(Hm)return t==="compositionend"||!Aj&&dV(t,e)?(t=cV(),K1=Sj=$d=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 uV&&e.locale!=="ko"?null:e.data;default:return null}}var tfe={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 lz(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!tfe[t.type]:e==="textarea"}function hV(t,e,n,r){V6(r),e=QC(e,"onChange"),0<e.length&&(n=new Cj("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var h0=null,z0=null;function nfe(t){CV(t,0)}function $A(t){var e=Wm(t);if(L6(e))return t}function rfe(t,e){if(t==="change")return e}var pV=!1;if(hu){var xT;if(hu){var wT="oninput"in document;if(!wT){var cz=document.createElement("div");cz.setAttribute("oninput","return;"),wT=typeof cz.oninput=="function"}xT=wT}else xT=!1;pV=xT&&(!document.documentMode||9<document.documentMode)}function uz(){h0&&(h0.detachEvent("onpropertychange",mV),z0=h0=null)}function mV(t){if(t.propertyName==="value"&&$A(z0)){var e=[];hV(e,z0,t,yj(t)),K6(nfe,e)}}function sfe(t,e,n){t==="focusin"?(uz(),h0=e,z0=n,h0.attachEvent("onpropertychange",mV)):t==="focusout"&&uz()}function ife(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return $A(z0)}function ofe(t,e){if(t==="click")return $A(e)}function afe(t,e){if(t==="input"||t==="change")return $A(e)}function lfe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Ga=typeof Object.is=="function"?Object.is:lfe;function B0(t,e){if(Ga(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(!_D.call(e,s)||!Ga(t[s],e[s]))return!1}return!0}function dz(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function fz(t,e){var n=dz(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=dz(n)}}function gV(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?gV(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function vV(){for(var t=window,e=VC();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=VC(t.document)}return e}function Rj(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 cfe(t){var e=vV(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&gV(n.ownerDocument.documentElement,n)){if(r!==null&&Rj(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=fz(n,i);var o=fz(n,r);s&&o&&(t.rangeCount!==1||t.anchorNode!==s.node||t.anchorOffset!==s.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),t.removeAllRanges(),i>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var ufe=hu&&"documentMode"in document&&11>=document.documentMode,Vm=null,BD=null,p0=null,UD=!1;function hz(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;UD||Vm==null||Vm!==VC(r)||(r=Vm,"selectionStart"in r&&Rj(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}),p0&&B0(p0,r)||(p0=r,r=QC(BD,"onSelect"),0<r.length&&(e=new Cj("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=Vm)))}function JS(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var qm={animationend:JS("Animation","AnimationEnd"),animationiteration:JS("Animation","AnimationIteration"),animationstart:JS("Animation","AnimationStart"),transitionend:JS("Transition","TransitionEnd")},_T={},yV={};hu&&(yV=document.createElement("div").style,"AnimationEvent"in window||(delete qm.animationend.animation,delete qm.animationiteration.animation,delete qm.animationstart.animation),"TransitionEvent"in window||delete qm.transitionend.transition);function FA(t){if(_T[t])return _T[t];if(!qm[t])return t;var e=qm[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in yV)return _T[t]=e[n];return t}var bV=FA("animationend"),xV=FA("animationiteration"),wV=FA("animationstart"),_V=FA("transitionend"),SV=new Map,pz="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 ff(t,e){SV.set(t,e),Lp(e,[t])}for(var ST=0;ST<pz.length;ST++){var CT=pz[ST],dfe=CT.toLowerCase(),ffe=CT[0].toUpperCase()+CT.slice(1);ff(dfe,"on"+ffe)}ff(bV,"onAnimationEnd");ff(xV,"onAnimationIteration");ff(wV,"onAnimationStart");ff("dblclick","onDoubleClick");ff("focusin","onFocus");ff("focusout","onBlur");ff(_V,"onTransitionEnd");Iv("onMouseEnter",["mouseout","mouseover"]);Iv("onMouseLeave",["mouseout","mouseover"]);Iv("onPointerEnter",["pointerout","pointerover"]);Iv("onPointerLeave",["pointerout","pointerover"]);Lp("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Lp("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Lp("onBeforeInput",["compositionend","keypress","textInput","paste"]);Lp("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Lp("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Lp("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zb="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(" "),hfe=new Set("cancel close invalid load scroll toggle".split(" ").concat(zb));function mz(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,dde(r,e,void 0,t),t.currentTarget=null}function CV(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 o=r.length-1;0<=o;o--){var a=r[o],c=a.instance,u=a.currentTarget;if(a=a.listener,c!==i&&s.isPropagationStopped())break e;mz(s,a,u),i=c}else for(o=0;o<r.length;o++){if(a=r[o],c=a.instance,u=a.currentTarget,a=a.listener,c!==i&&s.isPropagationStopped())break e;mz(s,a,u),i=c}}}if(WC)throw t=LD,WC=!1,LD=null,t}function qn(t,e){var n=e[GD];n===void 0&&(n=e[GD]=new Set);var r=t+"__bubble";n.has(r)||(EV(e,t,2,!1),n.add(r))}function ET(t,e,n){var r=0;e&&(r|=4),EV(n,t,r,e)}var e1="_reactListening"+Math.random().toString(36).slice(2);function U0(t){if(!t[e1]){t[e1]=!0,D6.forEach(function(n){n!=="selectionchange"&&(hfe.has(n)||ET(n,!1,t),ET(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[e1]||(e[e1]=!0,ET("selectionchange",!1,e))}}function EV(t,e,n,r){switch(lV(e)){case 1:var s=Rde;break;case 4:s=Nde;break;default:s=_j}n=s.bind(null,e,n,t),s=void 0,!jD||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 AT(t,e,n,r,s){var i=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;o=o.return}for(;a!==null;){if(o=Qf(a),o===null)return;if(c=o.tag,c===5||c===6){r=i=o;continue e}a=a.parentNode}}r=r.return}K6(function(){var u=i,f=yj(n),l=[];e:{var d=SV.get(t);if(d!==void 0){var p=Cj,h=t;switch(t){case"keypress":if(Y1(n)===0)break e;case"keydown":case"keyup":p=Hde;break;case"focusin":h="focus",p=bT;break;case"focusout":h="blur",p=bT;break;case"beforeblur":case"afterblur":p=bT;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=rz;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=kde;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=Wde;break;case bV:case xV:case wV:p=Ode;break;case _V:p=Kde;break;case"scroll":p=Pde;break;case"wheel":p=Xde;break;case"copy":case"cut":case"paste":p=jde;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=iz}var m=(e&4)!==0,y=!m&&t==="scroll",g=m?d!==null?d+"Capture":null:d;m=[];for(var v=u,x;v!==null;){x=v;var _=x.stateNode;if(x.tag===5&&_!==null&&(x=_,g!==null&&(_=j0(v,g),_!=null&&m.push(H0(v,_,x)))),y)break;v=v.return}0<m.length&&(d=new p(d,h,null,n,f),l.push({event:d,listeners:m}))}}if(!(e&7)){e:{if(d=t==="mouseover"||t==="pointerover",p=t==="mouseout"||t==="pointerout",d&&n!==OD&&(h=n.relatedTarget||n.fromElement)&&(Qf(h)||h[pu]))break e;if((p||d)&&(d=f.window===f?f:(d=f.ownerDocument)?d.defaultView||d.parentWindow:window,p?(h=n.relatedTarget||n.toElement,p=u,h=h?Qf(h):null,h!==null&&(y=$p(h),h!==y||h.tag!==5&&h.tag!==6)&&(h=null)):(p=null,h=u),p!==h)){if(m=rz,_="onMouseLeave",g="onMouseEnter",v="mouse",(t==="pointerout"||t==="pointerover")&&(m=iz,_="onPointerLeave",g="onPointerEnter",v="pointer"),y=p==null?d:Wm(p),x=h==null?d:Wm(h),d=new m(_,v+"leave",p,n,f),d.target=y,d.relatedTarget=x,_=null,Qf(f)===u&&(m=new m(g,v+"enter",h,n,f),m.target=x,m.relatedTarget=y,_=m),y=_,p&&h)t:{for(m=p,g=h,v=0,x=m;x;x=vm(x))v++;for(x=0,_=g;_;_=vm(_))x++;for(;0<v-x;)m=vm(m),v--;for(;0<x-v;)g=vm(g),x--;for(;v--;){if(m===g||g!==null&&m===g.alternate)break t;m=vm(m),g=vm(g)}m=null}else m=null;p!==null&&gz(l,d,p,m,!1),h!==null&&y!==null&&gz(l,y,h,m,!0)}}e:{if(d=u?Wm(u):window,p=d.nodeName&&d.nodeName.toLowerCase(),p==="select"||p==="input"&&d.type==="file")var A=rfe;else if(lz(d))if(pV)A=afe;else{A=ife;var N=sfe}else(p=d.nodeName)&&p.toLowerCase()==="input"&&(d.type==="checkbox"||d.type==="radio")&&(A=ofe);if(A&&(A=A(t,u))){hV(l,A,n,f);break e}N&&N(t,d,u),t==="focusout"&&(N=d._wrapperState)&&N.controlled&&d.type==="number"&&PD(d,"number",d.value)}switch(N=u?Wm(u):window,t){case"focusin":(lz(N)||N.contentEditable==="true")&&(Vm=N,BD=u,p0=null);break;case"focusout":p0=BD=Vm=null;break;case"mousedown":UD=!0;break;case"contextmenu":case"mouseup":case"dragend":UD=!1,hz(l,n,f);break;case"selectionchange":if(ufe)break;case"keydown":case"keyup":hz(l,n,f)}var T;if(Aj)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?dV(t,n)&&(E="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(uV&&n.locale!=="ko"&&(Hm||E!=="onCompositionStart"?E==="onCompositionEnd"&&Hm&&(T=cV()):($d=f,Sj="value"in $d?$d.value:$d.textContent,Hm=!0)),N=QC(u,E),0<N.length&&(E=new sz(E,t,null,n,f),l.push({event:E,listeners:N}),T?E.data=T:(T=fV(n),T!==null&&(E.data=T)))),(T=Zde?Jde(t,n):efe(t,n))&&(u=QC(u,"onBeforeInput"),0<u.length&&(f=new sz("onBeforeInput","beforeinput",null,n,f),l.push({event:f,listeners:u}),f.data=T))}CV(l,e)})}function H0(t,e,n){return{instance:t,listener:e,currentTarget:n}}function QC(t,e){for(var n=e+"Capture",r=[];t!==null;){var s=t,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=j0(t,n),i!=null&&r.unshift(H0(t,i,s)),i=j0(t,e),i!=null&&r.push(H0(t,i,s))),t=t.return}return r}function vm(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function gz(t,e,n,r,s){for(var i=e._reactName,o=[];n!==null&&n!==r;){var a=n,c=a.alternate,u=a.stateNode;if(c!==null&&c===r)break;a.tag===5&&u!==null&&(a=u,s?(c=j0(n,i),c!=null&&o.unshift(H0(n,c,a))):s||(c=j0(n,i),c!=null&&o.push(H0(n,c,a)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var pfe=/\r\n?/g,mfe=/\u0000|\uFFFD/g;function vz(t){return(typeof t=="string"?t:""+t).replace(pfe,`
|
||
`).replace(mfe,"")}function t1(t,e,n){if(e=vz(e),vz(t)!==e&&n)throw Error(ke(425))}function ZC(){}var HD=null,VD=null;function qD(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 WD=typeof setTimeout=="function"?setTimeout:void 0,gfe=typeof clearTimeout=="function"?clearTimeout:void 0,yz=typeof Promise=="function"?Promise:void 0,vfe=typeof queueMicrotask=="function"?queueMicrotask:typeof yz<"u"?function(t){return yz.resolve(null).then(t).catch(yfe)}:WD;function yfe(t){setTimeout(function(){throw t})}function RT(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),F0(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);F0(e)}function qd(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 bz(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 cy=Math.random().toString(36).slice(2),kl="__reactFiber$"+cy,V0="__reactProps$"+cy,pu="__reactContainer$"+cy,GD="__reactEvents$"+cy,bfe="__reactListeners$"+cy,xfe="__reactHandles$"+cy;function Qf(t){var e=t[kl];if(e)return e;for(var n=t.parentNode;n;){if(e=n[pu]||n[kl]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=bz(t);t!==null;){if(n=t[kl])return n;t=bz(t)}return e}t=n,n=t.parentNode}return null}function c_(t){return t=t[kl]||t[pu],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Wm(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(ke(33))}function zA(t){return t[V0]||null}var KD=[],Gm=-1;function hf(t){return{current:t}}function Gn(t){0>Gm||(t.current=KD[Gm],KD[Gm]=null,Gm--)}function zn(t,e){Gm++,KD[Gm]=t.current,t.current=e}var Jd={},Bs=hf(Jd),Li=hf(!1),pp=Jd;function jv(t,e){var n=t.type.contextTypes;if(!n)return Jd;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 $i(t){return t=t.childContextTypes,t!=null}function JC(){Gn(Li),Gn(Bs)}function xz(t,e,n){if(Bs.current!==Jd)throw Error(ke(168));zn(Bs,e),zn(Li,n)}function AV(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,sde(t)||"Unknown",s));return sr({},n,r)}function eE(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Jd,pp=Bs.current,zn(Bs,t),zn(Li,Li.current),!0}function wz(t,e,n){var r=t.stateNode;if(!r)throw Error(ke(169));n?(t=AV(t,e,pp),r.__reactInternalMemoizedMergedChildContext=t,Gn(Li),Gn(Bs),zn(Bs,t)):Gn(Li),zn(Li,n)}var Ac=null,BA=!1,NT=!1;function RV(t){Ac===null?Ac=[t]:Ac.push(t)}function wfe(t){BA=!0,RV(t)}function pf(){if(!NT&&Ac!==null){NT=!0;var t=0,e=xn;try{var n=Ac;for(xn=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}Ac=null,BA=!1}catch(s){throw Ac!==null&&(Ac=Ac.slice(t+1)),Z6(bj,pf),s}finally{xn=e,NT=!1}}return null}var Km=[],Ym=0,tE=null,nE=0,Qo=[],Zo=0,mp=null,tu=1,nu="";function Bf(t,e){Km[Ym++]=nE,Km[Ym++]=tE,tE=t,nE=e}function NV(t,e,n){Qo[Zo++]=tu,Qo[Zo++]=nu,Qo[Zo++]=mp,mp=t;var r=tu;t=nu;var s=32-Ua(r)-1;r&=~(1<<s),n+=1;var i=32-Ua(e)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,tu=1<<32-Ua(e)+s|n<<s|r,nu=i+t}else tu=1<<i|n<<s|r,nu=t}function Nj(t){t.return!==null&&(Bf(t,1),NV(t,1,0))}function Pj(t){for(;t===tE;)tE=Km[--Ym],Km[Ym]=null,nE=Km[--Ym],Km[Ym]=null;for(;t===mp;)mp=Qo[--Zo],Qo[Zo]=null,nu=Qo[--Zo],Qo[Zo]=null,tu=Qo[--Zo],Qo[Zo]=null}var wo=null,xo=null,Qn=!1,Fa=null;function PV(t,e){var n=na(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 _z(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,wo=t,xo=qd(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,wo=t,xo=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=mp!==null?{id:tu,overflow:nu}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=na(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,wo=t,xo=null,!0):!1;default:return!1}}function YD(t){return(t.mode&1)!==0&&(t.flags&128)===0}function XD(t){if(Qn){var e=xo;if(e){var n=e;if(!_z(t,e)){if(YD(t))throw Error(ke(418));e=qd(n.nextSibling);var r=wo;e&&_z(t,e)?PV(r,n):(t.flags=t.flags&-4097|2,Qn=!1,wo=t)}}else{if(YD(t))throw Error(ke(418));t.flags=t.flags&-4097|2,Qn=!1,wo=t}}}function Sz(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;wo=t}function n1(t){if(t!==wo)return!1;if(!Qn)return Sz(t),Qn=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!qD(t.type,t.memoizedProps)),e&&(e=xo)){if(YD(t))throw TV(),Error(ke(418));for(;e;)PV(t,e),e=qd(e.nextSibling)}if(Sz(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){xo=qd(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}xo=null}}else xo=wo?qd(t.stateNode.nextSibling):null;return!0}function TV(){for(var t=xo;t;)t=qd(t.nextSibling)}function Lv(){xo=wo=null,Qn=!1}function Tj(t){Fa===null?Fa=[t]:Fa.push(t)}var _fe=Su.ReactCurrentBatchConfig;function fb(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(o){var a=s.refs;o===null?delete a[i]:a[i]=o},e._stringRef=i,e)}if(typeof t!="string")throw Error(ke(284));if(!n._owner)throw Error(ke(290,t))}return t}function r1(t,e){throw t=Object.prototype.toString.call(e),Error(ke(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function Cz(t){var e=t._init;return e(t._payload)}function kV(t){function e(g,v){if(t){var x=g.deletions;x===null?(g.deletions=[v],g.flags|=16):x.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=Yd(g,v),g.index=0,g.sibling=null,g}function i(g,v,x){return g.index=x,t?(x=g.alternate,x!==null?(x=x.index,x<v?(g.flags|=2,v):x):(g.flags|=2,v)):(g.flags|=1048576,v)}function o(g){return t&&g.alternate===null&&(g.flags|=2),g}function a(g,v,x,_){return v===null||v.tag!==6?(v=IT(x,g.mode,_),v.return=g,v):(v=s(v,x),v.return=g,v)}function c(g,v,x,_){var A=x.type;return A===Um?f(g,v,x.props.children,_,x.key):v!==null&&(v.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===Ju&&Cz(A)===v.type)?(_=s(v,x.props),_.ref=fb(g,v,x),_.return=g,_):(_=nC(x.type,x.key,x.props,null,g.mode,_),_.ref=fb(g,v,x),_.return=g,_)}function u(g,v,x,_){return v===null||v.tag!==4||v.stateNode.containerInfo!==x.containerInfo||v.stateNode.implementation!==x.implementation?(v=jT(x,g.mode,_),v.return=g,v):(v=s(v,x.children||[]),v.return=g,v)}function f(g,v,x,_,A){return v===null||v.tag!==7?(v=cp(x,g.mode,_,A),v.return=g,v):(v=s(v,x),v.return=g,v)}function l(g,v,x){if(typeof v=="string"&&v!==""||typeof v=="number")return v=IT(""+v,g.mode,x),v.return=g,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case WS:return x=nC(v.type,v.key,v.props,null,g.mode,x),x.ref=fb(g,null,v),x.return=g,x;case Bm:return v=jT(v,g.mode,x),v.return=g,v;case Ju:var _=v._init;return l(g,_(v._payload),x)}if($b(v)||ab(v))return v=cp(v,g.mode,x,null),v.return=g,v;r1(g,v)}return null}function d(g,v,x,_){var A=v!==null?v.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return A!==null?null:a(g,v,""+x,_);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case WS:return x.key===A?c(g,v,x,_):null;case Bm:return x.key===A?u(g,v,x,_):null;case Ju:return A=x._init,d(g,v,A(x._payload),_)}if($b(x)||ab(x))return A!==null?null:f(g,v,x,_,null);r1(g,x)}return null}function p(g,v,x,_,A){if(typeof _=="string"&&_!==""||typeof _=="number")return g=g.get(x)||null,a(v,g,""+_,A);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case WS:return g=g.get(_.key===null?x:_.key)||null,c(v,g,_,A);case Bm:return g=g.get(_.key===null?x:_.key)||null,u(v,g,_,A);case Ju:var N=_._init;return p(g,v,x,N(_._payload),A)}if($b(_)||ab(_))return g=g.get(x)||null,f(v,g,_,A,null);r1(v,_)}return null}function h(g,v,x,_){for(var A=null,N=null,T=v,E=v=0,P=null;T!==null&&E<x.length;E++){T.index>E?(P=T,T=null):P=T.sibling;var k=d(g,T,x[E],_);if(k===null){T===null&&(T=P);break}t&&T&&k.alternate===null&&e(g,T),v=i(k,v,E),N===null?A=k:N.sibling=k,N=k,T=P}if(E===x.length)return n(g,T),Qn&&Bf(g,E),A;if(T===null){for(;E<x.length;E++)T=l(g,x[E],_),T!==null&&(v=i(T,v,E),N===null?A=T:N.sibling=T,N=T);return Qn&&Bf(g,E),A}for(T=r(g,T);E<x.length;E++)P=p(T,g,E,x[E],_),P!==null&&(t&&P.alternate!==null&&T.delete(P.key===null?E:P.key),v=i(P,v,E),N===null?A=P:N.sibling=P,N=P);return t&&T.forEach(function(M){return e(g,M)}),Qn&&Bf(g,E),A}function m(g,v,x,_){var A=ab(x);if(typeof A!="function")throw Error(ke(150));if(x=A.call(x),x==null)throw Error(ke(151));for(var N=A=null,T=v,E=v=0,P=null,k=x.next();T!==null&&!k.done;E++,k=x.next()){T.index>E?(P=T,T=null):P=T.sibling;var M=d(g,T,k.value,_);if(M===null){T===null&&(T=P);break}t&&T&&M.alternate===null&&e(g,T),v=i(M,v,E),N===null?A=M:N.sibling=M,N=M,T=P}if(k.done)return n(g,T),Qn&&Bf(g,E),A;if(T===null){for(;!k.done;E++,k=x.next())k=l(g,k.value,_),k!==null&&(v=i(k,v,E),N===null?A=k:N.sibling=k,N=k);return Qn&&Bf(g,E),A}for(T=r(g,T);!k.done;E++,k=x.next())k=p(T,g,E,k.value,_),k!==null&&(t&&k.alternate!==null&&T.delete(k.key===null?E:k.key),v=i(k,v,E),N===null?A=k:N.sibling=k,N=k);return t&&T.forEach(function(I){return e(g,I)}),Qn&&Bf(g,E),A}function y(g,v,x,_){if(typeof x=="object"&&x!==null&&x.type===Um&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case WS:e:{for(var A=x.key,N=v;N!==null;){if(N.key===A){if(A=x.type,A===Um){if(N.tag===7){n(g,N.sibling),v=s(N,x.props.children),v.return=g,g=v;break e}}else if(N.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===Ju&&Cz(A)===N.type){n(g,N.sibling),v=s(N,x.props),v.ref=fb(g,N,x),v.return=g,g=v;break e}n(g,N);break}else e(g,N);N=N.sibling}x.type===Um?(v=cp(x.props.children,g.mode,_,x.key),v.return=g,g=v):(_=nC(x.type,x.key,x.props,null,g.mode,_),_.ref=fb(g,v,x),_.return=g,g=_)}return o(g);case Bm:e:{for(N=x.key;v!==null;){if(v.key===N)if(v.tag===4&&v.stateNode.containerInfo===x.containerInfo&&v.stateNode.implementation===x.implementation){n(g,v.sibling),v=s(v,x.children||[]),v.return=g,g=v;break e}else{n(g,v);break}else e(g,v);v=v.sibling}v=jT(x,g.mode,_),v.return=g,g=v}return o(g);case Ju:return N=x._init,y(g,v,N(x._payload),_)}if($b(x))return h(g,v,x,_);if(ab(x))return m(g,v,x,_);r1(g,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,v!==null&&v.tag===6?(n(g,v.sibling),v=s(v,x),v.return=g,g=v):(n(g,v),v=IT(x,g.mode,_),v.return=g,g=v),o(g)):n(g,v)}return y}var $v=kV(!0),DV=kV(!1),rE=hf(null),sE=null,Xm=null,kj=null;function Dj(){kj=Xm=sE=null}function Mj(t){var e=rE.current;Gn(rE),t._currentValue=e}function QD(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 cg(t,e){sE=t,kj=Xm=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(ki=!0),t.firstContext=null)}function oa(t){var e=t._currentValue;if(kj!==t)if(t={context:t,memoizedValue:e,next:null},Xm===null){if(sE===null)throw Error(ke(308));Xm=t,sE.dependencies={lanes:0,firstContext:t}}else Xm=Xm.next=t;return e}var Zf=null;function Oj(t){Zf===null?Zf=[t]:Zf.push(t)}function MV(t,e,n,r){var s=e.interleaved;return s===null?(n.next=n,Oj(e)):(n.next=s.next,s.next=n),e.interleaved=n,mu(t,r)}function mu(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 ed=!1;function Ij(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function OV(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 su(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Wd(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Xt&2){var s=r.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),r.pending=e,mu(t,n)}return s=r.interleaved,s===null?(e.next=e,Oj(r)):(e.next=s.next,s.next=e),r.interleaved=e,mu(t,n)}function X1(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,xj(t,n)}}function Ez(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=e:i=i.next=e}else s=i=e;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function iE(t,e,n,r){var s=t.updateQueue;ed=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var c=a,u=c.next;c.next=null,o===null?i=u:o.next=u,o=c;var f=t.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==o&&(a===null?f.firstBaseUpdate=u:a.next=u,f.lastBaseUpdate=c))}if(i!==null){var l=s.baseState;o=0,f=u=c=null,a=i;do{var d=a.lane,p=a.eventTime;if((r&d)===d){f!==null&&(f=f.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var h=t,m=a;switch(d=e,p=n,m.tag){case 1:if(h=m.payload,typeof h=="function"){l=h.call(p,l,d);break e}l=h;break e;case 3:h.flags=h.flags&-65537|128;case 0:if(h=m.payload,d=typeof h=="function"?h.call(p,l,d):h,d==null)break e;l=sr({},l,d);break e;case 2:ed=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,d=s.effects,d===null?s.effects=[a]:d.push(a))}else p={eventTime:p,lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(u=f=p,c=l):f=f.next=p,o|=d;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;d=a,a=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 o|=s.lane,s=s.next;while(s!==e)}else i===null&&(s.shared.lanes=0);vp|=o,t.lanes=o,t.memoizedState=l}}function Az(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 u_={},zl=hf(u_),q0=hf(u_),W0=hf(u_);function Jf(t){if(t===u_)throw Error(ke(174));return t}function jj(t,e){switch(zn(W0,e),zn(q0,t),zn(zl,u_),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:kD(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=kD(e,t)}Gn(zl),zn(zl,e)}function Fv(){Gn(zl),Gn(q0),Gn(W0)}function IV(t){Jf(W0.current);var e=Jf(zl.current),n=kD(e,t.type);e!==n&&(zn(q0,t),zn(zl,n))}function Lj(t){q0.current===t&&(Gn(zl),Gn(q0))}var nr=hf(0);function oE(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 PT=[];function $j(){for(var t=0;t<PT.length;t++)PT[t]._workInProgressVersionPrimary=null;PT.length=0}var Q1=Su.ReactCurrentDispatcher,TT=Su.ReactCurrentBatchConfig,gp=0,rr=null,Hr=null,es=null,aE=!1,m0=!1,G0=0,Sfe=0;function Ns(){throw Error(ke(321))}function Fj(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Ga(t[n],e[n]))return!1;return!0}function zj(t,e,n,r,s,i){if(gp=i,rr=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Q1.current=t===null||t.memoizedState===null?Rfe:Nfe,t=n(r,s),m0){i=0;do{if(m0=!1,G0=0,25<=i)throw Error(ke(301));i+=1,es=Hr=null,e.updateQueue=null,Q1.current=Pfe,t=n(r,s)}while(m0)}if(Q1.current=lE,e=Hr!==null&&Hr.next!==null,gp=0,es=Hr=rr=null,aE=!1,e)throw Error(ke(300));return t}function Bj(){var t=G0!==0;return G0=0,t}function ul(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return es===null?rr.memoizedState=es=t:es=es.next=t,es}function aa(){if(Hr===null){var t=rr.alternate;t=t!==null?t.memoizedState:null}else t=Hr.next;var e=es===null?rr.memoizedState:es.next;if(e!==null)es=e,Hr=t;else{if(t===null)throw Error(ke(310));Hr=t,t={memoizedState:Hr.memoizedState,baseState:Hr.baseState,baseQueue:Hr.baseQueue,queue:Hr.queue,next:null},es===null?rr.memoizedState=es=t:es=es.next=t}return es}function K0(t,e){return typeof e=="function"?e(t):e}function kT(t){var e=aa(),n=e.queue;if(n===null)throw Error(ke(311));n.lastRenderedReducer=t;var r=Hr,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var a=o=null,c=null,u=i;do{var f=u.lane;if((gp&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?(a=c=l,o=r):c=c.next=l,rr.lanes|=f,vp|=f}u=u.next}while(u!==null&&u!==i);c===null?o=r:c.next=a,Ga(r,e.memoizedState)||(ki=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=c,n.lastRenderedState=r}if(t=n.interleaved,t!==null){s=t;do i=s.lane,rr.lanes|=i,vp|=i,s=s.next;while(s!==t)}else s===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function DT(t){var e=aa(),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 o=s=s.next;do i=t(i,o.action),o=o.next;while(o!==s);Ga(i,e.memoizedState)||(ki=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),n.lastRenderedState=i}return[i,r]}function jV(){}function LV(t,e){var n=rr,r=aa(),s=e(),i=!Ga(r.memoizedState,s);if(i&&(r.memoizedState=s,ki=!0),r=r.queue,Uj(zV.bind(null,n,r,t),[t]),r.getSnapshot!==e||i||es!==null&&es.memoizedState.tag&1){if(n.flags|=2048,Y0(9,FV.bind(null,n,r,s,e),void 0,null),is===null)throw Error(ke(349));gp&30||$V(n,e,s)}return s}function $V(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=rr.updateQueue,e===null?(e={lastEffect:null,stores:null},rr.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function FV(t,e,n,r){e.value=n,e.getSnapshot=r,BV(e)&&UV(t)}function zV(t,e,n){return n(function(){BV(e)&&UV(t)})}function BV(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Ga(t,n)}catch{return!0}}function UV(t){var e=mu(t,1);e!==null&&Ha(e,t,1,-1)}function Rz(t){var e=ul();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:K0,lastRenderedState:t},e.queue=t,t=t.dispatch=Afe.bind(null,rr,t),[e.memoizedState,t]}function Y0(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=rr.updateQueue,e===null?(e={lastEffect:null,stores:null},rr.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 HV(){return aa().memoizedState}function Z1(t,e,n,r){var s=ul();rr.flags|=t,s.memoizedState=Y0(1|e,n,void 0,r===void 0?null:r)}function UA(t,e,n,r){var s=aa();r=r===void 0?null:r;var i=void 0;if(Hr!==null){var o=Hr.memoizedState;if(i=o.destroy,r!==null&&Fj(r,o.deps)){s.memoizedState=Y0(e,n,i,r);return}}rr.flags|=t,s.memoizedState=Y0(1|e,n,i,r)}function Nz(t,e){return Z1(8390656,8,t,e)}function Uj(t,e){return UA(2048,8,t,e)}function VV(t,e){return UA(4,2,t,e)}function qV(t,e){return UA(4,4,t,e)}function WV(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 GV(t,e,n){return n=n!=null?n.concat([t]):null,UA(4,4,WV.bind(null,e,t),n)}function Hj(){}function KV(t,e){var n=aa();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&Fj(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function YV(t,e){var n=aa();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&Fj(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function XV(t,e,n){return gp&21?(Ga(n,e)||(n=tV(),rr.lanes|=n,vp|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,ki=!0),t.memoizedState=n)}function Cfe(t,e){var n=xn;xn=n!==0&&4>n?n:4,t(!0);var r=TT.transition;TT.transition={};try{t(!1),e()}finally{xn=n,TT.transition=r}}function QV(){return aa().memoizedState}function Efe(t,e,n){var r=Kd(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ZV(t))JV(e,n);else if(n=MV(t,e,n,r),n!==null){var s=ii();Ha(n,t,r,s),e8(n,e,r)}}function Afe(t,e,n){var r=Kd(t),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ZV(t))JV(e,s);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var o=e.lastRenderedState,a=i(o,n);if(s.hasEagerState=!0,s.eagerState=a,Ga(a,o)){var c=e.interleaved;c===null?(s.next=s,Oj(e)):(s.next=c.next,c.next=s),e.interleaved=s;return}}catch{}finally{}n=MV(t,e,s,r),n!==null&&(s=ii(),Ha(n,t,r,s),e8(n,e,r))}}function ZV(t){var e=t.alternate;return t===rr||e!==null&&e===rr}function JV(t,e){m0=aE=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function e8(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,xj(t,n)}}var lE={readContext:oa,useCallback:Ns,useContext:Ns,useEffect:Ns,useImperativeHandle:Ns,useInsertionEffect:Ns,useLayoutEffect:Ns,useMemo:Ns,useReducer:Ns,useRef:Ns,useState:Ns,useDebugValue:Ns,useDeferredValue:Ns,useTransition:Ns,useMutableSource:Ns,useSyncExternalStore:Ns,useId:Ns,unstable_isNewReconciler:!1},Rfe={readContext:oa,useCallback:function(t,e){return ul().memoizedState=[t,e===void 0?null:e],t},useContext:oa,useEffect:Nz,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Z1(4194308,4,WV.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Z1(4194308,4,t,e)},useInsertionEffect:function(t,e){return Z1(4,2,t,e)},useMemo:function(t,e){var n=ul();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=ul();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=Efe.bind(null,rr,t),[r.memoizedState,t]},useRef:function(t){var e=ul();return t={current:t},e.memoizedState=t},useState:Rz,useDebugValue:Hj,useDeferredValue:function(t){return ul().memoizedState=t},useTransition:function(){var t=Rz(!1),e=t[0];return t=Cfe.bind(null,t[1]),ul().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=rr,s=ul();if(Qn){if(n===void 0)throw Error(ke(407));n=n()}else{if(n=e(),is===null)throw Error(ke(349));gp&30||$V(r,e,n)}s.memoizedState=n;var i={value:n,getSnapshot:e};return s.queue=i,Nz(zV.bind(null,r,i,t),[t]),r.flags|=2048,Y0(9,FV.bind(null,r,i,n,e),void 0,null),n},useId:function(){var t=ul(),e=is.identifierPrefix;if(Qn){var n=nu,r=tu;n=(r&~(1<<32-Ua(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=G0++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=Sfe++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},Nfe={readContext:oa,useCallback:KV,useContext:oa,useEffect:Uj,useImperativeHandle:GV,useInsertionEffect:VV,useLayoutEffect:qV,useMemo:YV,useReducer:kT,useRef:HV,useState:function(){return kT(K0)},useDebugValue:Hj,useDeferredValue:function(t){var e=aa();return XV(e,Hr.memoizedState,t)},useTransition:function(){var t=kT(K0)[0],e=aa().memoizedState;return[t,e]},useMutableSource:jV,useSyncExternalStore:LV,useId:QV,unstable_isNewReconciler:!1},Pfe={readContext:oa,useCallback:KV,useContext:oa,useEffect:Uj,useImperativeHandle:GV,useInsertionEffect:VV,useLayoutEffect:qV,useMemo:YV,useReducer:DT,useRef:HV,useState:function(){return DT(K0)},useDebugValue:Hj,useDeferredValue:function(t){var e=aa();return Hr===null?e.memoizedState=t:XV(e,Hr.memoizedState,t)},useTransition:function(){var t=DT(K0)[0],e=aa().memoizedState;return[t,e]},useMutableSource:jV,useSyncExternalStore:LV,useId:QV,unstable_isNewReconciler:!1};function wa(t,e){if(t&&t.defaultProps){e=sr({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function ZD(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:sr({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var HA={isMounted:function(t){return(t=t._reactInternals)?$p(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=ii(),s=Kd(t),i=su(r,s);i.payload=e,n!=null&&(i.callback=n),e=Wd(t,i,s),e!==null&&(Ha(e,t,s,r),X1(e,t,s))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=ii(),s=Kd(t),i=su(r,s);i.tag=1,i.payload=e,n!=null&&(i.callback=n),e=Wd(t,i,s),e!==null&&(Ha(e,t,s,r),X1(e,t,s))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=ii(),r=Kd(t),s=su(n,r);s.tag=2,e!=null&&(s.callback=e),e=Wd(t,s,r),e!==null&&(Ha(e,t,r,n),X1(e,t,r))}};function Pz(t,e,n,r,s,i,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,i,o):e.prototype&&e.prototype.isPureReactComponent?!B0(n,r)||!B0(s,i):!0}function t8(t,e,n){var r=!1,s=Jd,i=e.contextType;return typeof i=="object"&&i!==null?i=oa(i):(s=$i(e)?pp:Bs.current,r=e.contextTypes,i=(r=r!=null)?jv(t,s):Jd),e=new e(n,i),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=HA,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=s,t.__reactInternalMemoizedMaskedChildContext=i),e}function Tz(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&&HA.enqueueReplaceState(e,e.state,null)}function JD(t,e,n,r){var s=t.stateNode;s.props=n,s.state=t.memoizedState,s.refs={},Ij(t);var i=e.contextType;typeof i=="object"&&i!==null?s.context=oa(i):(i=$i(e)?pp:Bs.current,s.context=jv(t,i)),s.state=t.memoizedState,i=e.getDerivedStateFromProps,typeof i=="function"&&(ZD(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&&HA.enqueueReplaceState(s,s.state,null),iE(t,n,s,r),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308)}function zv(t,e){try{var n="",r=e;do n+=rde(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 MT(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function eM(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var Tfe=typeof WeakMap=="function"?WeakMap:Map;function n8(t,e,n){n=su(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){uE||(uE=!0,uM=r),eM(t,e)},n}function r8(t,e,n){n=su(-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(){eM(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){eM(t,e),typeof r!="function"&&(Gd===null?Gd=new Set([this]):Gd.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),n}function kz(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new Tfe;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=Vfe.bind(null,t,e,n),e.then(t,t))}function Dz(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 Mz(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=su(-1,1),e.tag=2,Wd(n,e,1))),n.lanes|=1),t)}var kfe=Su.ReactCurrentOwner,ki=!1;function ei(t,e,n,r){e.child=t===null?DV(e,null,n,r):$v(e,t.child,n,r)}function Oz(t,e,n,r,s){n=n.render;var i=e.ref;return cg(e,s),r=zj(t,e,n,r,i,s),n=Bj(),t!==null&&!ki?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,gu(t,e,s)):(Qn&&n&&Nj(e),e.flags|=1,ei(t,e,r,s),e.child)}function Iz(t,e,n,r,s){if(t===null){var i=n.type;return typeof i=="function"&&!Qj(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=i,s8(t,e,i,r,s)):(t=nC(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 o=i.memoizedProps;if(n=n.compare,n=n!==null?n:B0,n(o,r)&&t.ref===e.ref)return gu(t,e,s)}return e.flags|=1,t=Yd(i,r),t.ref=e.ref,t.return=e,e.child=t}function s8(t,e,n,r,s){if(t!==null){var i=t.memoizedProps;if(B0(i,r)&&t.ref===e.ref)if(ki=!1,e.pendingProps=r=i,(t.lanes&s)!==0)t.flags&131072&&(ki=!0);else return e.lanes=t.lanes,gu(t,e,s)}return tM(t,e,n,r,s)}function i8(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},zn(Zm,mo),mo|=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,zn(Zm,mo),mo|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,zn(Zm,mo),mo|=r}else i!==null?(r=i.baseLanes|n,e.memoizedState=null):r=n,zn(Zm,mo),mo|=r;return ei(t,e,s,n),e.child}function o8(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function tM(t,e,n,r,s){var i=$i(n)?pp:Bs.current;return i=jv(e,i),cg(e,s),n=zj(t,e,n,r,i,s),r=Bj(),t!==null&&!ki?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,gu(t,e,s)):(Qn&&r&&Nj(e),e.flags|=1,ei(t,e,n,s),e.child)}function jz(t,e,n,r,s){if($i(n)){var i=!0;eE(e)}else i=!1;if(cg(e,s),e.stateNode===null)J1(t,e),t8(e,n,r),JD(e,n,r,s),r=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=oa(u):(u=$i(n)?pp:Bs.current,u=jv(e,u));var f=n.getDerivedStateFromProps,l=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function";l||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||c!==u)&&Tz(e,o,r,u),ed=!1;var d=e.memoizedState;o.state=d,iE(e,r,o,s),c=e.memoizedState,a!==r||d!==c||Li.current||ed?(typeof f=="function"&&(ZD(e,n,f,r),c=e.memoizedState),(a=ed||Pz(e,n,a,r,d,c,u))?(l||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=c),o.props=r,o.state=c,o.context=u,r=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,OV(t,e),a=e.memoizedProps,u=e.type===e.elementType?a:wa(e.type,a),o.props=u,l=e.pendingProps,d=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=oa(c):(c=$i(n)?pp:Bs.current,c=jv(e,c));var p=n.getDerivedStateFromProps;(f=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==l||d!==c)&&Tz(e,o,r,c),ed=!1,d=e.memoizedState,o.state=d,iE(e,r,o,s);var h=e.memoizedState;a!==l||d!==h||Li.current||ed?(typeof p=="function"&&(ZD(e,n,p,r),h=e.memoizedState),(u=ed||Pz(e,n,u,r,d,h,c)||!1)?(f||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,h,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,h,c)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=h),o.props=r,o.state=h,o.context=c,r=u):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),r=!1)}return nM(t,e,n,r,i,s)}function nM(t,e,n,r,s,i){o8(t,e);var o=(e.flags&128)!==0;if(!r&&!o)return s&&wz(e,n,!1),gu(t,e,i);r=e.stateNode,kfe.current=e;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&o?(e.child=$v(e,t.child,null,i),e.child=$v(e,null,a,i)):ei(t,e,a,i),e.memoizedState=r.state,s&&wz(e,n,!0),e.child}function a8(t){var e=t.stateNode;e.pendingContext?xz(t,e.pendingContext,e.pendingContext!==e.context):e.context&&xz(t,e.context,!1),jj(t,e.containerInfo)}function Lz(t,e,n,r,s){return Lv(),Tj(s),e.flags|=256,ei(t,e,n,r),e.child}var rM={dehydrated:null,treeContext:null,retryLane:0};function sM(t){return{baseLanes:t,cachePool:null,transitions:null}}function l8(t,e,n){var r=e.pendingProps,s=nr.current,i=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(s&2)!==0),a?(i=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(s|=1),zn(nr,s&1),t===null)return XD(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):(o=r.children,t=r.fallback,i?(r=e.mode,i=e.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=WA(o,r,0,null),t=cp(t,r,n,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=sM(n),e.memoizedState=rM,t):Vj(e,o));if(s=t.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return Dfe(t,e,o,r,a,s,n);if(i){i=r.fallback,o=e.mode,s=t.child,a=s.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&e.child!==s?(r=e.child,r.childLanes=0,r.pendingProps=c,e.deletions=null):(r=Yd(s,c),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=Yd(a,i):(i=cp(i,o,n,null),i.flags|=2),i.return=e,r.return=e,r.sibling=i,e.child=r,r=i,i=e.child,o=t.child.memoizedState,o=o===null?sM(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=t.childLanes&~n,e.memoizedState=rM,r}return i=t.child,t=i.sibling,r=Yd(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 Vj(t,e){return e=WA({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function s1(t,e,n,r){return r!==null&&Tj(r),$v(e,t.child,null,n),t=Vj(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Dfe(t,e,n,r,s,i,o){if(n)return e.flags&256?(e.flags&=-257,r=MT(Error(ke(422))),s1(t,e,o,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=r.fallback,s=e.mode,r=WA({mode:"visible",children:r.children},s,0,null),i=cp(i,s,o,null),i.flags|=2,r.return=e,i.return=e,r.sibling=i,e.child=r,e.mode&1&&$v(e,t.child,null,o),e.child.memoizedState=sM(o),e.memoizedState=rM,i);if(!(e.mode&1))return s1(t,e,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(ke(419)),r=MT(i,r,void 0),s1(t,e,o,r)}if(a=(o&t.childLanes)!==0,ki||a){if(r=is,r!==null){switch(o&-o){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|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,mu(t,s),Ha(r,t,s,-1))}return Xj(),r=MT(Error(ke(421))),s1(t,e,o,r)}return s.data==="$?"?(e.flags|=128,e.child=t.child,e=qfe.bind(null,t),s._reactRetry=e,null):(t=i.treeContext,xo=qd(s.nextSibling),wo=e,Qn=!0,Fa=null,t!==null&&(Qo[Zo++]=tu,Qo[Zo++]=nu,Qo[Zo++]=mp,tu=t.id,nu=t.overflow,mp=e),e=Vj(e,r.children),e.flags|=4096,e)}function $z(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),QD(t.return,e,n)}function OT(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 c8(t,e,n){var r=e.pendingProps,s=r.revealOrder,i=r.tail;if(ei(t,e,r.children,n),r=nr.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&&$z(t,n,e);else if(t.tag===19)$z(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(zn(nr,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&&oE(t)===null&&(s=n),n=n.sibling;n=s,n===null?(s=e.child,e.child=null):(s=n.sibling,n.sibling=null),OT(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&&oE(t)===null){e.child=s;break}t=s.sibling,s.sibling=n,n=s,s=t}OT(e,!0,n,null,i);break;case"together":OT(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function J1(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function gu(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),vp|=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=Yd(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Yd(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function Mfe(t,e,n){switch(e.tag){case 3:a8(e),Lv();break;case 5:IV(e);break;case 1:$i(e.type)&&eE(e);break;case 4:jj(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,s=e.memoizedProps.value;zn(rE,r._currentValue),r._currentValue=s;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(zn(nr,nr.current&1),e.flags|=128,null):n&e.child.childLanes?l8(t,e,n):(zn(nr,nr.current&1),t=gu(t,e,n),t!==null?t.sibling:null);zn(nr,nr.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return c8(t,e,n);e.flags|=128}if(s=e.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),zn(nr,nr.current),r)break;return null;case 22:case 23:return e.lanes=0,i8(t,e,n)}return gu(t,e,n)}var u8,iM,d8,f8;u8=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}};iM=function(){};d8=function(t,e,n,r){var s=t.memoizedProps;if(s!==r){t=e.stateNode,Jf(zl.current);var i=null;switch(n){case"input":s=RD(t,s),r=RD(t,r),i=[];break;case"select":s=sr({},s,{value:void 0}),r=sr({},r,{value:void 0}),i=[];break;case"textarea":s=TD(t,s),r=TD(t,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=ZC)}DD(n,r);var o;n=null;for(u in s)if(!r.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var a=s[u];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(O0.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var c=r[u];if(a=s!=null?s[u]:void 0,r.hasOwnProperty(u)&&c!==a&&(c!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&a[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(i||(i=[]),i.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(O0.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&qn("scroll",t),i||a===c||(i=[])):(i=i||[]).push(u,c))}n&&(i=i||[]).push("style",n);var u=i;(e.updateQueue=u)&&(e.flags|=4)}};f8=function(t,e,n,r){n!==r&&(e.flags|=4)};function hb(t,e){if(!Qn)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 Ps(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 Ofe(t,e,n){var r=e.pendingProps;switch(Pj(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ps(e),null;case 1:return $i(e.type)&&JC(),Ps(e),null;case 3:return r=e.stateNode,Fv(),Gn(Li),Gn(Bs),$j(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(n1(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Fa!==null&&(hM(Fa),Fa=null))),iM(t,e),Ps(e),null;case 5:Lj(e);var s=Jf(W0.current);if(n=e.type,t!==null&&e.stateNode!=null)d8(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 Ps(e),null}if(t=Jf(zl.current),n1(e)){r=e.stateNode,n=e.type;var i=e.memoizedProps;switch(r[kl]=e,r[V0]=i,t=(e.mode&1)!==0,n){case"dialog":qn("cancel",r),qn("close",r);break;case"iframe":case"object":case"embed":qn("load",r);break;case"video":case"audio":for(s=0;s<zb.length;s++)qn(zb[s],r);break;case"source":qn("error",r);break;case"img":case"image":case"link":qn("error",r),qn("load",r);break;case"details":qn("toggle",r);break;case"input":G4(r,i),qn("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},qn("invalid",r);break;case"textarea":Y4(r,i),qn("invalid",r)}DD(n,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];o==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&t1(r.textContent,a,t),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&t1(r.textContent,a,t),s=["children",""+a]):O0.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&qn("scroll",r)}switch(n){case"input":GS(r),K4(r,i,!0);break;case"textarea":GS(r),X4(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=ZC)}r=s,e.updateQueue=r,r!==null&&(e.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=z6(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[kl]=e,t[V0]=r,u8(t,e,!1,!1),e.stateNode=t;e:{switch(o=MD(n,r),n){case"dialog":qn("cancel",t),qn("close",t),s=r;break;case"iframe":case"object":case"embed":qn("load",t),s=r;break;case"video":case"audio":for(s=0;s<zb.length;s++)qn(zb[s],t);s=r;break;case"source":qn("error",t),s=r;break;case"img":case"image":case"link":qn("error",t),qn("load",t),s=r;break;case"details":qn("toggle",t),s=r;break;case"input":G4(t,r),s=RD(t,r),qn("invalid",t);break;case"option":s=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},s=sr({},r,{value:void 0}),qn("invalid",t);break;case"textarea":Y4(t,r),s=TD(t,r),qn("invalid",t);break;default:s=r}DD(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var c=a[i];i==="style"?H6(t,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&B6(t,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&I0(t,c):typeof c=="number"&&I0(t,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(O0.hasOwnProperty(i)?c!=null&&i==="onScroll"&&qn("scroll",t):c!=null&&pj(t,i,c,o))}switch(n){case"input":GS(t),K4(t,r,!1);break;case"textarea":GS(t),X4(t);break;case"option":r.value!=null&&t.setAttribute("value",""+Zd(r.value));break;case"select":t.multiple=!!r.multiple,i=r.value,i!=null?ig(t,!!r.multiple,i,!1):r.defaultValue!=null&&ig(t,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(t.onclick=ZC)}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 Ps(e),null;case 6:if(t&&e.stateNode!=null)f8(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(ke(166));if(n=Jf(W0.current),Jf(zl.current),n1(e)){if(r=e.stateNode,n=e.memoizedProps,r[kl]=e,(i=r.nodeValue!==n)&&(t=wo,t!==null))switch(t.tag){case 3:t1(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&t1(r.nodeValue,n,(t.mode&1)!==0)}i&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[kl]=e,e.stateNode=r}return Ps(e),null;case 13:if(Gn(nr),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Qn&&xo!==null&&e.mode&1&&!(e.flags&128))TV(),Lv(),e.flags|=98560,i=!1;else if(i=n1(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[kl]=e}else Lv(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Ps(e),i=!1}else Fa!==null&&(hM(Fa),Fa=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||nr.current&1?Gr===0&&(Gr=3):Xj())),e.updateQueue!==null&&(e.flags|=4),Ps(e),null);case 4:return Fv(),iM(t,e),t===null&&U0(e.stateNode.containerInfo),Ps(e),null;case 10:return Mj(e.type._context),Ps(e),null;case 17:return $i(e.type)&&JC(),Ps(e),null;case 19:if(Gn(nr),i=e.memoizedState,i===null)return Ps(e),null;if(r=(e.flags&128)!==0,o=i.rendering,o===null)if(r)hb(i,!1);else{if(Gr!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=oE(t),o!==null){for(e.flags|=128,hb(i,!1),r=o.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,o=i.alternate,o===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=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,t=o.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return zn(nr,nr.current&1|2),e.child}t=t.sibling}i.tail!==null&&_r()>Bv&&(e.flags|=128,r=!0,hb(i,!1),e.lanes=4194304)}else{if(!r)if(t=oE(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),hb(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Qn)return Ps(e),null}else 2*_r()-i.renderingStartTime>Bv&&n!==1073741824&&(e.flags|=128,r=!0,hb(i,!1),e.lanes=4194304);i.isBackwards?(o.sibling=e.child,e.child=o):(n=i.last,n!==null?n.sibling=o:e.child=o,i.last=o)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=_r(),e.sibling=null,n=nr.current,zn(nr,r?n&1|2:n&1),e):(Ps(e),null);case 22:case 23:return Yj(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?mo&1073741824&&(Ps(e),e.subtreeFlags&6&&(e.flags|=8192)):Ps(e),null;case 24:return null;case 25:return null}throw Error(ke(156,e.tag))}function Ife(t,e){switch(Pj(e),e.tag){case 1:return $i(e.type)&&JC(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Fv(),Gn(Li),Gn(Bs),$j(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Lj(e),null;case 13:if(Gn(nr),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(ke(340));Lv()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Gn(nr),null;case 4:return Fv(),null;case 10:return Mj(e.type._context),null;case 22:case 23:return Yj(),null;case 24:return null;default:return null}}var i1=!1,js=!1,jfe=typeof WeakSet=="function"?WeakSet:Set,Ge=null;function Qm(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){hr(t,e,r)}else n.current=null}function oM(t,e,n){try{n()}catch(r){hr(t,e,r)}}var Fz=!1;function Lfe(t,e){if(HD=YC,t=vV(),Rj(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,c=-1,u=0,f=0,l=t,d=null;t:for(;;){for(var p;l!==n||s!==0&&l.nodeType!==3||(a=o+s),l!==i||r!==0&&l.nodeType!==3||(c=o+r),l.nodeType===3&&(o+=l.nodeValue.length),(p=l.firstChild)!==null;)d=l,l=p;for(;;){if(l===t)break t;if(d===n&&++u===s&&(a=o),d===i&&++f===r&&(c=o),(p=l.nextSibling)!==null)break;l=d,d=l.parentNode}l=p}n=a===-1||c===-1?null:{start:a,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(VD={focusedElem:t,selectionRange:n},YC=!1,Ge=e;Ge!==null;)if(e=Ge,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ge=t;else for(;Ge!==null;){e=Ge;try{var h=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var m=h.memoizedProps,y=h.memoizedState,g=e.stateNode,v=g.getSnapshotBeforeUpdate(e.elementType===e.type?m:wa(e.type,m),y);g.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var x=e.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ke(163))}}catch(_){hr(e,e.return,_)}if(t=e.sibling,t!==null){t.return=e.return,Ge=t;break}Ge=e.return}return h=Fz,Fz=!1,h}function g0(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&&oM(e,n,i)}s=s.next}while(s!==r)}}function VA(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 aM(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 h8(t){var e=t.alternate;e!==null&&(t.alternate=null,h8(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[kl],delete e[V0],delete e[GD],delete e[bfe],delete e[xfe])),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 p8(t){return t.tag===5||t.tag===3||t.tag===4}function zz(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||p8(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 lM(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=ZC));else if(r!==4&&(t=t.child,t!==null))for(lM(t,e,n),t=t.sibling;t!==null;)lM(t,e,n),t=t.sibling}function cM(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(cM(t,e,n),t=t.sibling;t!==null;)cM(t,e,n),t=t.sibling}var vs=null,La=!1;function zu(t,e,n){for(n=n.child;n!==null;)m8(t,e,n),n=n.sibling}function m8(t,e,n){if(Fl&&typeof Fl.onCommitFiberUnmount=="function")try{Fl.onCommitFiberUnmount(jA,n)}catch{}switch(n.tag){case 5:js||Qm(n,e);case 6:var r=vs,s=La;vs=null,zu(t,e,n),vs=r,La=s,vs!==null&&(La?(t=vs,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):vs.removeChild(n.stateNode));break;case 18:vs!==null&&(La?(t=vs,n=n.stateNode,t.nodeType===8?RT(t.parentNode,n):t.nodeType===1&&RT(t,n),F0(t)):RT(vs,n.stateNode));break;case 4:r=vs,s=La,vs=n.stateNode.containerInfo,La=!0,zu(t,e,n),vs=r,La=s;break;case 0:case 11:case 14:case 15:if(!js&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&oM(n,e,o),s=s.next}while(s!==r)}zu(t,e,n);break;case 1:if(!js&&(Qm(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){hr(n,e,a)}zu(t,e,n);break;case 21:zu(t,e,n);break;case 22:n.mode&1?(js=(r=js)||n.memoizedState!==null,zu(t,e,n),js=r):zu(t,e,n);break;default:zu(t,e,n)}}function Bz(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new jfe),e.forEach(function(r){var s=Wfe.bind(null,t,r);n.has(r)||(n.add(r),r.then(s,s))})}}function ba(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,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:vs=a.stateNode,La=!1;break e;case 3:vs=a.stateNode.containerInfo,La=!0;break e;case 4:vs=a.stateNode.containerInfo,La=!0;break e}a=a.return}if(vs===null)throw Error(ke(160));m8(i,o,s),vs=null,La=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(u){hr(s,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)g8(e,t),e=e.sibling}function g8(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(ba(e,t),ll(t),r&4){try{g0(3,t,t.return),VA(3,t)}catch(m){hr(t,t.return,m)}try{g0(5,t,t.return)}catch(m){hr(t,t.return,m)}}break;case 1:ba(e,t),ll(t),r&512&&n!==null&&Qm(n,n.return);break;case 5:if(ba(e,t),ll(t),r&512&&n!==null&&Qm(n,n.return),t.flags&32){var s=t.stateNode;try{I0(s,"")}catch(m){hr(t,t.return,m)}}if(r&4&&(s=t.stateNode,s!=null)){var i=t.memoizedProps,o=n!==null?n.memoizedProps:i,a=t.type,c=t.updateQueue;if(t.updateQueue=null,c!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&$6(s,i),MD(a,o);var u=MD(a,i);for(o=0;o<c.length;o+=2){var f=c[o],l=c[o+1];f==="style"?H6(s,l):f==="dangerouslySetInnerHTML"?B6(s,l):f==="children"?I0(s,l):pj(s,f,l,u)}switch(a){case"input":ND(s,i);break;case"textarea":F6(s,i);break;case"select":var d=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?ig(s,!!i.multiple,p,!1):d!==!!i.multiple&&(i.defaultValue!=null?ig(s,!!i.multiple,i.defaultValue,!0):ig(s,!!i.multiple,i.multiple?[]:"",!1))}s[V0]=i}catch(m){hr(t,t.return,m)}}break;case 6:if(ba(e,t),ll(t),r&4){if(t.stateNode===null)throw Error(ke(162));s=t.stateNode,i=t.memoizedProps;try{s.nodeValue=i}catch(m){hr(t,t.return,m)}}break;case 3:if(ba(e,t),ll(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{F0(e.containerInfo)}catch(m){hr(t,t.return,m)}break;case 4:ba(e,t),ll(t);break;case 13:ba(e,t),ll(t),s=t.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(Gj=_r())),r&4&&Bz(t);break;case 22:if(f=n!==null&&n.memoizedState!==null,t.mode&1?(js=(u=js)||f,ba(e,t),js=u):ba(e,t),ll(t),r&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!f&&t.mode&1)for(Ge=t,f=t.child;f!==null;){for(l=Ge=f;Ge!==null;){switch(d=Ge,p=d.child,d.tag){case 0:case 11:case 14:case 15:g0(4,d,d.return);break;case 1:Qm(d,d.return);var h=d.stateNode;if(typeof h.componentWillUnmount=="function"){r=d,n=d.return;try{e=r,h.props=e.memoizedProps,h.state=e.memoizedState,h.componentWillUnmount()}catch(m){hr(r,n,m)}}break;case 5:Qm(d,d.return);break;case 22:if(d.memoizedState!==null){Hz(l);continue}}p!==null?(p.return=d,Ge=p):Hz(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"):(a=l.stateNode,c=l.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=U6("display",o))}catch(m){hr(t,t.return,m)}}}else if(l.tag===6){if(f===null)try{l.stateNode.nodeValue=u?"":l.memoizedProps}catch(m){hr(t,t.return,m)}}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:ba(e,t),ll(t),r&4&&Bz(t);break;case 21:break;default:ba(e,t),ll(t)}}function ll(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(p8(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&&(I0(s,""),r.flags&=-33);var i=zz(t);cM(t,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=zz(t);lM(t,a,o);break;default:throw Error(ke(161))}}catch(c){hr(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function $fe(t,e,n){Ge=t,v8(t)}function v8(t,e,n){for(var r=(t.mode&1)!==0;Ge!==null;){var s=Ge,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||i1;if(!o){var a=s.alternate,c=a!==null&&a.memoizedState!==null||js;a=i1;var u=js;if(i1=o,(js=c)&&!u)for(Ge=s;Ge!==null;)o=Ge,c=o.child,o.tag===22&&o.memoizedState!==null?Vz(s):c!==null?(c.return=o,Ge=c):Vz(s);for(;i!==null;)Ge=i,v8(i),i=i.sibling;Ge=s,i1=a,js=u}Uz(t)}else s.subtreeFlags&8772&&i!==null?(i.return=s,Ge=i):Uz(t)}}function Uz(t){for(;Ge!==null;){var e=Ge;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:js||VA(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!js)if(n===null)r.componentDidMount();else{var s=e.elementType===e.type?n.memoizedProps:wa(e.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=e.updateQueue;i!==null&&Az(e,i,r);break;case 3:var o=e.updateQueue;if(o!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}Az(e,o,n)}break;case 5:var a=e.stateNode;if(n===null&&e.flags&4){n=a;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&&F0(l)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ke(163))}js||e.flags&512&&aM(e)}catch(d){hr(e,e.return,d)}}if(e===t){Ge=null;break}if(n=e.sibling,n!==null){n.return=e.return,Ge=n;break}Ge=e.return}}function Hz(t){for(;Ge!==null;){var e=Ge;if(e===t){Ge=null;break}var n=e.sibling;if(n!==null){n.return=e.return,Ge=n;break}Ge=e.return}}function Vz(t){for(;Ge!==null;){var e=Ge;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{VA(4,e)}catch(c){hr(e,n,c)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var s=e.return;try{r.componentDidMount()}catch(c){hr(e,s,c)}}var i=e.return;try{aM(e)}catch(c){hr(e,i,c)}break;case 5:var o=e.return;try{aM(e)}catch(c){hr(e,o,c)}}}catch(c){hr(e,e.return,c)}if(e===t){Ge=null;break}var a=e.sibling;if(a!==null){a.return=e.return,Ge=a;break}Ge=e.return}}var Ffe=Math.ceil,cE=Su.ReactCurrentDispatcher,qj=Su.ReactCurrentOwner,ra=Su.ReactCurrentBatchConfig,Xt=0,is=null,Pr=null,ws=0,mo=0,Zm=hf(0),Gr=0,X0=null,vp=0,qA=0,Wj=0,v0=null,Ti=null,Gj=0,Bv=1/0,xc=null,uE=!1,uM=null,Gd=null,o1=!1,Fd=null,dE=0,y0=0,dM=null,eC=-1,tC=0;function ii(){return Xt&6?_r():eC!==-1?eC:eC=_r()}function Kd(t){return t.mode&1?Xt&2&&ws!==0?ws&-ws:_fe.transition!==null?(tC===0&&(tC=tV()),tC):(t=xn,t!==0||(t=window.event,t=t===void 0?16:lV(t.type)),t):1}function Ha(t,e,n,r){if(50<y0)throw y0=0,dM=null,Error(ke(185));a_(t,n,r),(!(Xt&2)||t!==is)&&(t===is&&(!(Xt&2)&&(qA|=n),Gr===4&&od(t,ws)),Fi(t,r),n===1&&Xt===0&&!(e.mode&1)&&(Bv=_r()+500,BA&&pf()))}function Fi(t,e){var n=t.callbackNode;_de(t,e);var r=KC(t,t===is?ws:0);if(r===0)n!==null&&J4(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&J4(n),e===1)t.tag===0?wfe(qz.bind(null,t)):RV(qz.bind(null,t)),vfe(function(){!(Xt&6)&&pf()}),n=null;else{switch(nV(r)){case 1:n=bj;break;case 4:n=J6;break;case 16:n=GC;break;case 536870912:n=eV;break;default:n=GC}n=E8(n,y8.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function y8(t,e){if(eC=-1,tC=0,Xt&6)throw Error(ke(327));var n=t.callbackNode;if(ug()&&t.callbackNode!==n)return null;var r=KC(t,t===is?ws:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=fE(t,r);else{e=r;var s=Xt;Xt|=2;var i=x8();(is!==t||ws!==e)&&(xc=null,Bv=_r()+500,lp(t,e));do try{Ufe();break}catch(a){b8(t,a)}while(!0);Dj(),cE.current=i,Xt=s,Pr!==null?e=0:(is=null,ws=0,e=Gr)}if(e!==0){if(e===2&&(s=$D(t),s!==0&&(r=s,e=fM(t,s))),e===1)throw n=X0,lp(t,0),od(t,r),Fi(t,_r()),n;if(e===6)od(t,r);else{if(s=t.current.alternate,!(r&30)&&!zfe(s)&&(e=fE(t,r),e===2&&(i=$D(t),i!==0&&(r=i,e=fM(t,i))),e===1))throw n=X0,lp(t,0),od(t,r),Fi(t,_r()),n;switch(t.finishedWork=s,t.finishedLanes=r,e){case 0:case 1:throw Error(ke(345));case 2:Uf(t,Ti,xc);break;case 3:if(od(t,r),(r&130023424)===r&&(e=Gj+500-_r(),10<e)){if(KC(t,0)!==0)break;if(s=t.suspendedLanes,(s&r)!==r){ii(),t.pingedLanes|=t.suspendedLanes&s;break}t.timeoutHandle=WD(Uf.bind(null,t,Ti,xc),e);break}Uf(t,Ti,xc);break;case 4:if(od(t,r),(r&4194240)===r)break;for(e=t.eventTimes,s=-1;0<r;){var o=31-Ua(r);i=1<<o,o=e[o],o>s&&(s=o),r&=~i}if(r=s,r=_r()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ffe(r/1960))-r,10<r){t.timeoutHandle=WD(Uf.bind(null,t,Ti,xc),r);break}Uf(t,Ti,xc);break;case 5:Uf(t,Ti,xc);break;default:throw Error(ke(329))}}}return Fi(t,_r()),t.callbackNode===n?y8.bind(null,t):null}function fM(t,e){var n=v0;return t.current.memoizedState.isDehydrated&&(lp(t,e).flags|=256),t=fE(t,e),t!==2&&(e=Ti,Ti=n,e!==null&&hM(e)),t}function hM(t){Ti===null?Ti=t:Ti.push.apply(Ti,t)}function zfe(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(!Ga(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 od(t,e){for(e&=~Wj,e&=~qA,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-Ua(e),r=1<<n;t[n]=-1,e&=~r}}function qz(t){if(Xt&6)throw Error(ke(327));ug();var e=KC(t,0);if(!(e&1))return Fi(t,_r()),null;var n=fE(t,e);if(t.tag!==0&&n===2){var r=$D(t);r!==0&&(e=r,n=fM(t,r))}if(n===1)throw n=X0,lp(t,0),od(t,e),Fi(t,_r()),n;if(n===6)throw Error(ke(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Uf(t,Ti,xc),Fi(t,_r()),null}function Kj(t,e){var n=Xt;Xt|=1;try{return t(e)}finally{Xt=n,Xt===0&&(Bv=_r()+500,BA&&pf())}}function yp(t){Fd!==null&&Fd.tag===0&&!(Xt&6)&&ug();var e=Xt;Xt|=1;var n=ra.transition,r=xn;try{if(ra.transition=null,xn=1,t)return t()}finally{xn=r,ra.transition=n,Xt=e,!(Xt&6)&&pf()}}function Yj(){mo=Zm.current,Gn(Zm)}function lp(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,gfe(n)),Pr!==null)for(n=Pr.return;n!==null;){var r=n;switch(Pj(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&JC();break;case 3:Fv(),Gn(Li),Gn(Bs),$j();break;case 5:Lj(r);break;case 4:Fv();break;case 13:Gn(nr);break;case 19:Gn(nr);break;case 10:Mj(r.type._context);break;case 22:case 23:Yj()}n=n.return}if(is=t,Pr=t=Yd(t.current,null),ws=mo=e,Gr=0,X0=null,Wj=qA=vp=0,Ti=v0=null,Zf!==null){for(e=0;e<Zf.length;e++)if(n=Zf[e],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=s,r.next=o}n.pending=r}Zf=null}return t}function b8(t,e){do{var n=Pr;try{if(Dj(),Q1.current=lE,aE){for(var r=rr.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}aE=!1}if(gp=0,es=Hr=rr=null,m0=!1,G0=0,qj.current=null,n===null||n.return===null){Gr=1,X0=e,Pr=null;break}e:{var i=t,o=n.return,a=n,c=e;if(e=ws,a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,f=a,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 p=Dz(o);if(p!==null){p.flags&=-257,Mz(p,o,a,i,e),p.mode&1&&kz(i,u,e),e=p,c=u;var h=e.updateQueue;if(h===null){var m=new Set;m.add(c),e.updateQueue=m}else h.add(c);break e}else{if(!(e&1)){kz(i,u,e),Xj();break e}c=Error(ke(426))}}else if(Qn&&a.mode&1){var y=Dz(o);if(y!==null){!(y.flags&65536)&&(y.flags|=256),Mz(y,o,a,i,e),Tj(zv(c,a));break e}}i=c=zv(c,a),Gr!==4&&(Gr=2),v0===null?v0=[i]:v0.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,e&=-e,i.lanes|=e;var g=n8(i,c,e);Ez(i,g);break e;case 1:a=c;var v=i.type,x=i.stateNode;if(!(i.flags&128)&&(typeof v.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Gd===null||!Gd.has(x)))){i.flags|=65536,e&=-e,i.lanes|=e;var _=r8(i,a,e);Ez(i,_);break e}}i=i.return}while(i!==null)}_8(n)}catch(A){e=A,Pr===n&&n!==null&&(Pr=n=n.return);continue}break}while(!0)}function x8(){var t=cE.current;return cE.current=lE,t===null?lE:t}function Xj(){(Gr===0||Gr===3||Gr===2)&&(Gr=4),is===null||!(vp&268435455)&&!(qA&268435455)||od(is,ws)}function fE(t,e){var n=Xt;Xt|=2;var r=x8();(is!==t||ws!==e)&&(xc=null,lp(t,e));do try{Bfe();break}catch(s){b8(t,s)}while(!0);if(Dj(),Xt=n,cE.current=r,Pr!==null)throw Error(ke(261));return is=null,ws=0,Gr}function Bfe(){for(;Pr!==null;)w8(Pr)}function Ufe(){for(;Pr!==null&&!hde();)w8(Pr)}function w8(t){var e=C8(t.alternate,t,mo);t.memoizedProps=t.pendingProps,e===null?_8(t):Pr=e,qj.current=null}function _8(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=Ife(n,e),n!==null){n.flags&=32767,Pr=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Gr=6,Pr=null;return}}else if(n=Ofe(n,e,mo),n!==null){Pr=n;return}if(e=e.sibling,e!==null){Pr=e;return}Pr=e=t}while(e!==null);Gr===0&&(Gr=5)}function Uf(t,e,n){var r=xn,s=ra.transition;try{ra.transition=null,xn=1,Hfe(t,e,n,r)}finally{ra.transition=s,xn=r}return null}function Hfe(t,e,n,r){do ug();while(Fd!==null);if(Xt&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(Sde(t,i),t===is&&(Pr=is=null,ws=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||o1||(o1=!0,E8(GC,function(){return ug(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=ra.transition,ra.transition=null;var o=xn;xn=1;var a=Xt;Xt|=4,qj.current=null,Lfe(t,n),g8(n,t),cfe(VD),YC=!!HD,VD=HD=null,t.current=n,$fe(n),pde(),Xt=a,xn=o,ra.transition=i}else t.current=n;if(o1&&(o1=!1,Fd=t,dE=s),i=t.pendingLanes,i===0&&(Gd=null),vde(n.stateNode),Fi(t,_r()),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(uE)throw uE=!1,t=uM,uM=null,t;return dE&1&&t.tag!==0&&ug(),i=t.pendingLanes,i&1?t===dM?y0++:(y0=0,dM=t):y0=0,pf(),null}function ug(){if(Fd!==null){var t=nV(dE),e=ra.transition,n=xn;try{if(ra.transition=null,xn=16>t?16:t,Fd===null)var r=!1;else{if(t=Fd,Fd=null,dE=0,Xt&6)throw Error(ke(331));var s=Xt;for(Xt|=4,Ge=t.current;Ge!==null;){var i=Ge,o=i.child;if(Ge.flags&16){var a=i.deletions;if(a!==null){for(var c=0;c<a.length;c++){var u=a[c];for(Ge=u;Ge!==null;){var f=Ge;switch(f.tag){case 0:case 11:case 15:g0(8,f,i)}var l=f.child;if(l!==null)l.return=f,Ge=l;else for(;Ge!==null;){f=Ge;var d=f.sibling,p=f.return;if(h8(f),f===u){Ge=null;break}if(d!==null){d.return=p,Ge=d;break}Ge=p}}}var h=i.alternate;if(h!==null){var m=h.child;if(m!==null){h.child=null;do{var y=m.sibling;m.sibling=null,m=y}while(m!==null)}}Ge=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,Ge=o;else e:for(;Ge!==null;){if(i=Ge,i.flags&2048)switch(i.tag){case 0:case 11:case 15:g0(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,Ge=g;break e}Ge=i.return}}var v=t.current;for(Ge=v;Ge!==null;){o=Ge;var x=o.child;if(o.subtreeFlags&2064&&x!==null)x.return=o,Ge=x;else e:for(o=v;Ge!==null;){if(a=Ge,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:VA(9,a)}}catch(A){hr(a,a.return,A)}if(a===o){Ge=null;break e}var _=a.sibling;if(_!==null){_.return=a.return,Ge=_;break e}Ge=a.return}}if(Xt=s,pf(),Fl&&typeof Fl.onPostCommitFiberRoot=="function")try{Fl.onPostCommitFiberRoot(jA,t)}catch{}r=!0}return r}finally{xn=n,ra.transition=e}}return!1}function Wz(t,e,n){e=zv(n,e),e=n8(t,e,1),t=Wd(t,e,1),e=ii(),t!==null&&(a_(t,1,e),Fi(t,e))}function hr(t,e,n){if(t.tag===3)Wz(t,t,n);else for(;e!==null;){if(e.tag===3){Wz(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Gd===null||!Gd.has(r))){t=zv(n,t),t=r8(e,t,1),e=Wd(e,t,1),t=ii(),e!==null&&(a_(e,1,t),Fi(e,t));break}}e=e.return}}function Vfe(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=ii(),t.pingedLanes|=t.suspendedLanes&n,is===t&&(ws&n)===n&&(Gr===4||Gr===3&&(ws&130023424)===ws&&500>_r()-Gj?lp(t,0):Wj|=n),Fi(t,e)}function S8(t,e){e===0&&(t.mode&1?(e=XS,XS<<=1,!(XS&130023424)&&(XS=4194304)):e=1);var n=ii();t=mu(t,e),t!==null&&(a_(t,e,n),Fi(t,n))}function qfe(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),S8(t,n)}function Wfe(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),S8(t,n)}var C8;C8=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Li.current)ki=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return ki=!1,Mfe(t,e,n);ki=!!(t.flags&131072)}else ki=!1,Qn&&e.flags&1048576&&NV(e,nE,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;J1(t,e),t=e.pendingProps;var s=jv(e,Bs.current);cg(e,n),s=zj(null,e,r,t,s,n);var i=Bj();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,$i(r)?(i=!0,eE(e)):i=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Ij(e),s.updater=HA,e.stateNode=s,s._reactInternals=e,JD(e,r,t,n),e=nM(null,e,r,!0,i,n)):(e.tag=0,Qn&&i&&Nj(e),ei(null,e,s,n),e=e.child),e;case 16:r=e.elementType;e:{switch(J1(t,e),t=e.pendingProps,s=r._init,r=s(r._payload),e.type=r,s=e.tag=Kfe(r),t=wa(r,t),s){case 0:e=tM(null,e,r,t,n);break e;case 1:e=jz(null,e,r,t,n);break e;case 11:e=Oz(null,e,r,t,n);break e;case 14:e=Iz(null,e,r,wa(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:wa(r,s),tM(t,e,r,s,n);case 1:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:wa(r,s),jz(t,e,r,s,n);case 3:e:{if(a8(e),t===null)throw Error(ke(387));r=e.pendingProps,i=e.memoizedState,s=i.element,OV(t,e),iE(e,r,null,n);var o=e.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){s=zv(Error(ke(423)),e),e=Lz(t,e,r,n,s);break e}else if(r!==s){s=zv(Error(ke(424)),e),e=Lz(t,e,r,n,s);break e}else for(xo=qd(e.stateNode.containerInfo.firstChild),wo=e,Qn=!0,Fa=null,n=DV(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Lv(),r===s){e=gu(t,e,n);break e}ei(t,e,r,n)}e=e.child}return e;case 5:return IV(e),t===null&&XD(e),r=e.type,s=e.pendingProps,i=t!==null?t.memoizedProps:null,o=s.children,qD(r,s)?o=null:i!==null&&qD(r,i)&&(e.flags|=32),o8(t,e),ei(t,e,o,n),e.child;case 6:return t===null&&XD(e),null;case 13:return l8(t,e,n);case 4:return jj(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=$v(e,null,r,n):ei(t,e,r,n),e.child;case 11:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:wa(r,s),Oz(t,e,r,s,n);case 7:return ei(t,e,e.pendingProps,n),e.child;case 8:return ei(t,e,e.pendingProps.children,n),e.child;case 12:return ei(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,s=e.pendingProps,i=e.memoizedProps,o=s.value,zn(rE,r._currentValue),r._currentValue=o,i!==null)if(Ga(i.value,o)){if(i.children===s.children&&!Li.current){e=gu(t,e,n);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var c=a.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=su(-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),QD(i.return,n,e),a.lanes|=n;break}c=c.next}}else if(i.tag===10)o=i.type===e.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(ke(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),QD(o,n,e),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}ei(t,e,s.children,n),e=e.child}return e;case 9:return s=e.type,r=e.pendingProps.children,cg(e,n),s=oa(s),r=r(s),e.flags|=1,ei(t,e,r,n),e.child;case 14:return r=e.type,s=wa(r,e.pendingProps),s=wa(r.type,s),Iz(t,e,r,s,n);case 15:return s8(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:wa(r,s),J1(t,e),e.tag=1,$i(r)?(t=!0,eE(e)):t=!1,cg(e,n),t8(e,r,s),JD(e,r,s,n),nM(null,e,r,!0,t,n);case 19:return c8(t,e,n);case 22:return i8(t,e,n)}throw Error(ke(156,e.tag))};function E8(t,e){return Z6(t,e)}function Gfe(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function na(t,e,n,r){return new Gfe(t,e,n,r)}function Qj(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Kfe(t){if(typeof t=="function")return Qj(t)?1:0;if(t!=null){if(t=t.$$typeof,t===gj)return 11;if(t===vj)return 14}return 2}function Yd(t,e){var n=t.alternate;return n===null?(n=na(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function nC(t,e,n,r,s,i){var o=2;if(r=t,typeof t=="function")Qj(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Um:return cp(n.children,s,i,e);case mj:o=8,s|=8;break;case SD:return t=na(12,n,e,s|2),t.elementType=SD,t.lanes=i,t;case CD:return t=na(13,n,e,s),t.elementType=CD,t.lanes=i,t;case ED:return t=na(19,n,e,s),t.elementType=ED,t.lanes=i,t;case I6:return WA(n,s,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case M6:o=10;break e;case O6:o=9;break e;case gj:o=11;break e;case vj:o=14;break e;case Ju:o=16,r=null;break e}throw Error(ke(130,t==null?t:typeof t,""))}return e=na(o,n,e,s),e.elementType=t,e.type=r,e.lanes=i,e}function cp(t,e,n,r){return t=na(7,t,r,e),t.lanes=n,t}function WA(t,e,n,r){return t=na(22,t,r,e),t.elementType=I6,t.lanes=n,t.stateNode={isHidden:!1},t}function IT(t,e,n){return t=na(6,t,null,e),t.lanes=n,t}function jT(t,e,n){return e=na(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Yfe(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=gT(0),this.expirationTimes=gT(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gT(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Zj(t,e,n,r,s,i,o,a,c){return t=new Yfe(t,e,n,a,c),e===1?(e=1,i===!0&&(e|=8)):e=0,i=na(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ij(i),t}function Xfe(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Bm,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function A8(t){if(!t)return Jd;t=t._reactInternals;e:{if($p(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($i(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($i(n))return AV(t,n,e)}return e}function R8(t,e,n,r,s,i,o,a,c){return t=Zj(n,r,!0,t,s,i,o,a,c),t.context=A8(null),n=t.current,r=ii(),s=Kd(n),i=su(r,s),i.callback=e??null,Wd(n,i,s),t.current.lanes=s,a_(t,s,r),Fi(t,r),t}function GA(t,e,n,r){var s=e.current,i=ii(),o=Kd(s);return n=A8(n),e.context===null?e.context=n:e.pendingContext=n,e=su(i,o),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=Wd(s,e,o),t!==null&&(Ha(t,s,o,i),X1(t,s,o)),o}function hE(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 Gz(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function Jj(t,e){Gz(t,e),(t=t.alternate)&&Gz(t,e)}function Qfe(){return null}var N8=typeof reportError=="function"?reportError:function(t){console.error(t)};function eL(t){this._internalRoot=t}KA.prototype.render=eL.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(ke(409));GA(t,e,null,null)};KA.prototype.unmount=eL.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;yp(function(){GA(null,t,null,null)}),e[pu]=null}};function KA(t){this._internalRoot=t}KA.prototype.unstable_scheduleHydration=function(t){if(t){var e=iV();t={blockedOn:null,target:t,priority:e};for(var n=0;n<id.length&&e!==0&&e<id[n].priority;n++);id.splice(n,0,t),n===0&&aV(t)}};function tL(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function YA(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function Kz(){}function Zfe(t,e,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var u=hE(o);i.call(u)}}var o=R8(e,r,t,0,null,!1,!1,"",Kz);return t._reactRootContainer=o,t[pu]=o.current,U0(t.nodeType===8?t.parentNode:t),yp(),o}for(;s=t.lastChild;)t.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var u=hE(c);a.call(u)}}var c=Zj(t,0,!1,null,null,!1,!1,"",Kz);return t._reactRootContainer=c,t[pu]=c.current,U0(t.nodeType===8?t.parentNode:t),yp(function(){GA(e,c,n,r)}),c}function XA(t,e,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var a=s;s=function(){var c=hE(o);a.call(c)}}GA(e,o,t,s)}else o=Zfe(n,e,t,s,r);return hE(o)}rV=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=Fb(e.pendingLanes);n!==0&&(xj(e,n|1),Fi(e,_r()),!(Xt&6)&&(Bv=_r()+500,pf()))}break;case 13:yp(function(){var r=mu(t,1);if(r!==null){var s=ii();Ha(r,t,1,s)}}),Jj(t,1)}};wj=function(t){if(t.tag===13){var e=mu(t,134217728);if(e!==null){var n=ii();Ha(e,t,134217728,n)}Jj(t,134217728)}};sV=function(t){if(t.tag===13){var e=Kd(t),n=mu(t,e);if(n!==null){var r=ii();Ha(n,t,e,r)}Jj(t,e)}};iV=function(){return xn};oV=function(t,e){var n=xn;try{return xn=t,e()}finally{xn=n}};ID=function(t,e,n){switch(e){case"input":if(ND(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=zA(r);if(!s)throw Error(ke(90));L6(r),ND(r,s)}}}break;case"textarea":F6(t,n);break;case"select":e=n.value,e!=null&&ig(t,!!n.multiple,e,!1)}};W6=Kj;G6=yp;var Jfe={usingClientEntryPoint:!1,Events:[c_,Wm,zA,V6,q6,Kj]},pb={findFiberByHostInstance:Qf,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ehe={bundleType:pb.bundleType,version:pb.version,rendererPackageName:pb.rendererPackageName,rendererConfig:pb.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Su.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=X6(t),t===null?null:t.stateNode},findFiberByHostInstance:pb.findFiberByHostInstance||Qfe,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 a1=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!a1.isDisabled&&a1.supportsFiber)try{jA=a1.inject(ehe),Fl=a1}catch{}}Ro.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Jfe;Ro.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!tL(e))throw Error(ke(200));return Xfe(t,e,null,n)};Ro.createRoot=function(t,e){if(!tL(t))throw Error(ke(299));var n=!1,r="",s=N8;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(s=e.onRecoverableError)),e=Zj(t,1,!1,null,null,n,!1,r,s),t[pu]=e.current,U0(t.nodeType===8?t.parentNode:t),new eL(e)};Ro.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=X6(e),t=t===null?null:t.stateNode,t};Ro.flushSync=function(t){return yp(t)};Ro.hydrate=function(t,e,n){if(!YA(e))throw Error(ke(200));return XA(null,t,e,!0,n)};Ro.hydrateRoot=function(t,e,n){if(!tL(t))throw Error(ke(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=N8;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),e=R8(e,null,t,1,n??null,s,!1,i,o),t[pu]=e.current,U0(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 KA(e)};Ro.render=function(t,e,n){if(!YA(e))throw Error(ke(200));return XA(null,t,e,!1,n)};Ro.unmountComponentAtNode=function(t){if(!YA(t))throw Error(ke(40));return t._reactRootContainer?(yp(function(){XA(null,null,t,!1,function(){t._reactRootContainer=null,t[pu]=null})}),!0):!1};Ro.unstable_batchedUpdates=Kj;Ro.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!YA(n))throw Error(ke(200));if(t==null||t._reactInternals===void 0)throw Error(ke(38));return XA(t,e,n,!1,r)};Ro.version="18.3.1-next-f1338f8080-20240426";function P8(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(P8)}catch(t){console.error(t)}}P8(),P6.exports=Ro;var ss=P6.exports;const QA=_u(ss),the=v6({__proto__:null,default:QA},[ss]);var Yz=ss;wD.createRoot=Yz.createRoot,wD.hydrateRoot=Yz.hydrateRoot;const T8=S.createContext({}),nhe=({children:t,authActions:e})=>{const n=i=>{var o;try{return Promise.resolve((o=e.login)==null?void 0:o.call(e,i))}catch(a){return console.error(a),Promise.reject(a)}},r=i=>{var o;try{return Promise.resolve((o=e.logout)==null?void 0:o.call(e,i))}catch(a){return console.error(a),Promise.reject(a)}},s=async()=>{var i;try{return Promise.resolve((i=e.check)==null?void 0:i.call(e))}catch(o){return console.error(o),Promise.reject(o)}};return b.jsx(T8.Provider,{value:{...e,login:n,logout:r,check:s},children:t})},ZA=()=>{const t=S.useContext(T8);if(t===null)throw new Error("useAuth must be used within a AuthProvider");return t};var uy=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(){}},Uv=typeof window>"u"||"Deno"in globalThis;function Wo(){}function rhe(t,e){return typeof t=="function"?t(e):t}function pM(t){return typeof t=="number"&&t>=0&&t!==1/0}function k8(t,e){return Math.max(t+(e||0)-Date.now(),0)}function dg(t,e){return typeof t=="function"?t(e):t}function za(t,e){return typeof t=="function"?t(e):t}function Xz(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:a}=t;if(o){if(r){if(e.queryHash!==nL(o,e.options))return!1}else if(!Q0(e.queryKey,o))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||s&&s!==e.state.fetchStatus||i&&!i(e))}function Qz(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(bp(e.options.mutationKey)!==bp(i))return!1}else if(!Q0(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)||bp)(t)}function bp(t){return JSON.stringify(t,(e,n)=>mM(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Q0(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(n=>!Q0(t[n],e[n])):!1}function D8(t,e){if(t===e)return t;const n=Zz(t)&&Zz(e);if(n||mM(t)&&mM(e)){const r=n?t:Object.keys(t),s=r.length,i=n?e:Object.keys(e),o=i.length,a=n?[]:{};let c=0;for(let u=0;u<o;u++){const f=n?u:i[u];(!n&&r.includes(f)||n)&&t[f]===void 0&&e[f]===void 0?(a[f]=void 0,c++):(a[f]=D8(t[f],e[f]),a[f]===t[f]&&t[f]!==void 0&&c++)}return s===o&&c===s?t:a}return e}function pE(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 Zz(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function mM(t){if(!Jz(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!Jz(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Jz(t){return Object.prototype.toString.call(t)==="[object Object]"}function she(t){return new Promise(e=>{setTimeout(e,t)})}function gM(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?D8(t,e):e}function M8(t){return t}function ihe(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function ohe(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var O8=Symbol();function I8(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===O8?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var oh,cd,Rg,i6,ahe=(i6=class extends uy{constructor(){super();B(this,oh);B(this,cd);B(this,Rg);$(this,Rg,e=>{if(!Uv&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){R(this,cd)||this.setEventListener(R(this,Rg))}onUnsubscribe(){var e;this.hasListeners()||((e=R(this,cd))==null||e.call(this),$(this,cd,void 0))}setEventListener(e){var n;$(this,Rg,e),(n=R(this,cd))==null||n.call(this),$(this,cd,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){R(this,oh)!==e&&($(this,oh,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof R(this,oh)=="boolean"?R(this,oh):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},oh=new WeakMap,cd=new WeakMap,Rg=new WeakMap,i6),rL=new ahe,Ng,ud,Pg,o6,lhe=(o6=class extends uy{constructor(){super();B(this,Ng,!0);B(this,ud);B(this,Pg);$(this,Pg,e=>{if(!Uv&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){R(this,ud)||this.setEventListener(R(this,Pg))}onUnsubscribe(){var e;this.hasListeners()||((e=R(this,ud))==null||e.call(this),$(this,ud,void 0))}setEventListener(e){var n;$(this,Pg,e),(n=R(this,ud))==null||n.call(this),$(this,ud,e(this.setOnline.bind(this)))}setOnline(e){R(this,Ng)!==e&&($(this,Ng,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return R(this,Ng)}},Ng=new WeakMap,ud=new WeakMap,Pg=new WeakMap,o6),mE=new lhe;function che(t){return Math.min(1e3*2**t,3e4)}function j8(t){return(t??"online")==="online"?mE.isOnline():!0}var L8=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function LT(t){return t instanceof L8}function $8(t){let e=!1,n=0,r=!1,s,i,o;const a=new Promise((g,v)=>{i=g,o=v}),c=g=>{var v;r||(h(new L8(g)),(v=t.abort)==null||v.call(t))},u=()=>{e=!0},f=()=>{e=!1},l=()=>rL.isFocused()&&(t.networkMode==="always"||mE.isOnline())&&t.canRun(),d=()=>j8(t.networkMode)&&t.canRun(),p=g=>{var v;r||(r=!0,(v=t.onSuccess)==null||v.call(t,g),s==null||s(),i(g))},h=g=>{var v;r||(r=!0,(v=t.onError)==null||v.call(t,g),s==null||s(),o(g))},m=()=>new Promise(g=>{var v;s=x=>{(r||l())&&g(x)},(v=t.onPause)==null||v.call(t)}).then(()=>{var g;s=void 0,r||(g=t.onContinue)==null||g.call(t)}),y=()=>{if(r)return;let g;const v=n===0?t.initialPromise:void 0;try{g=v??t.fn()}catch(x){g=Promise.reject(x)}Promise.resolve(g).then(p).catch(x=>{var E;if(r)return;const _=t.retry??(Uv?0:3),A=t.retryDelay??che,N=typeof A=="function"?A(n,x):A,T=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,x);if(e||!T){h(x);return}n++,(E=t.onFail)==null||E.call(t,n,x),she(N).then(()=>l()?void 0:m()).then(()=>{e?h(x):y()})})};return{promise:a,cancel:c,continue:()=>(s==null||s(),a),cancelRetry:u,continueRetry:f,canStart:d,start:()=>(d()?y():m().then(y),a)}}function uhe(){let t=[],e=0,n=d=>{d()},r=d=>{d()},s=d=>setTimeout(d,0);const i=d=>{s=d},o=d=>{let p;e++;try{p=d()}finally{e--,e||u()}return p},a=d=>{e?t.push(d):s(()=>{n(d)})},c=d=>(...p)=>{a(()=>{d(...p)})},u=()=>{const d=t;t=[],d.length&&s(()=>{r(()=>{d.forEach(p=>{n(p)})})})};return{batch:o,batchCalls:c,schedule:a,setNotifyFunction:d=>{n=d},setBatchNotifyFunction:d=>{r=d},setScheduler:i}}var qr=uhe(),ah,a6,F8=(a6=class{constructor(){B(this,ah)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),pM(this.gcTime)&&$(this,ah,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Uv?1/0:5*60*1e3))}clearGcTimeout(){R(this,ah)&&(clearTimeout(R(this,ah)),$(this,ah,void 0))}},ah=new WeakMap,a6),Tg,kg,Bo,Ms,Sx,lh,Sa,yc,l6,dhe=(l6=class extends F8{constructor(e){super();B(this,Sa);B(this,Tg);B(this,kg);B(this,Bo);B(this,Ms);B(this,Sx);B(this,lh);$(this,lh,!1),$(this,Sx,e.defaultOptions),this.setOptions(e.options),this.observers=[],$(this,Bo,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,$(this,Tg,fhe(this.options)),this.state=e.state??R(this,Tg),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=R(this,Ms))==null?void 0:e.promise}setOptions(e){this.options={...R(this,Sx),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&R(this,Bo).remove(this)}setData(e,n){const r=gM(this.state.data,e,this.options);return z(this,Sa,yc).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){z(this,Sa,yc).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,s;const n=(r=R(this,Ms))==null?void 0:r.promise;return(s=R(this,Ms))==null||s.cancel(e),n?n.then(Wo).catch(Wo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(R(this,Tg))}isActive(){return this.observers.some(e=>za(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!k8(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=R(this,Ms))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=R(this,Ms))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),R(this,Bo).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(R(this,Ms)&&(R(this,lh)?R(this,Ms).cancel({revert:!0}):R(this,Ms).cancelRetry()),this.scheduleGc()),R(this,Bo).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||z(this,Sa,yc).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(R(this,Ms))return R(this,Ms).continueRetry(),R(this,Ms).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,lh,!0),r.signal)})},i=()=>{const l=I8(this.options,n),d={queryKey:this.queryKey,meta:this.meta};return s(d),$(this,lh,!1),this.options.persister?this.options.persister(l,d,this):l(d)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:i};s(o),(c=this.options.behavior)==null||c.onFetch(o,this),$(this,kg,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=o.fetchOptions)==null?void 0:u.meta))&&z(this,Sa,yc).call(this,{type:"fetch",meta:(f=o.fetchOptions)==null?void 0:f.meta});const a=l=>{var d,p,h,m;LT(l)&&l.silent||z(this,Sa,yc).call(this,{type:"error",error:l}),LT(l)||((p=(d=R(this,Bo).config).onError)==null||p.call(d,l,this),(m=(h=R(this,Bo).config).onSettled)==null||m.call(h,this.state.data,l,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return $(this,Ms,$8({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:l=>{var d,p,h,m;if(l===void 0){a(new Error(`${this.queryHash} data is undefined`));return}this.setData(l),(p=(d=R(this,Bo).config).onSuccess)==null||p.call(d,l,this),(m=(h=R(this,Bo).config).onSettled)==null||m.call(h,l,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:a,onFail:(l,d)=>{z(this,Sa,yc).call(this,{type:"failed",failureCount:l,error:d})},onPause:()=>{z(this,Sa,yc).call(this,{type:"pause"})},onContinue:()=>{z(this,Sa,yc).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),R(this,Ms).start()}},Tg=new WeakMap,kg=new WeakMap,Bo=new WeakMap,Ms=new WeakMap,Sx=new WeakMap,lh=new WeakMap,Sa=new WeakSet,yc=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,...z8(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 LT(s)&&s.revert&&R(this,kg)?{...R(this,kg),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),qr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),R(this,Bo).notify({query:this,type:"updated",action:e})})},l6);function z8(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:j8(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function fhe(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 dl,c6,hhe=(c6=class extends uy{constructor(e={}){super();B(this,dl);this.config=e,$(this,dl,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??nL(s,n);let o=this.get(i);return o||(o=new dhe({cache:this,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){R(this,dl).has(e.queryHash)||(R(this,dl).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=R(this,dl).get(e.queryHash);n&&(e.destroy(),n===e&&R(this,dl).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){qr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return R(this,dl).get(e)}getAll(){return[...R(this,dl).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>Xz(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>Xz(e,r)):n}notify(e){qr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){qr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){qr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},dl=new WeakMap,c6),fl,Ks,ch,hl,Wu,u6,phe=(u6=class extends F8{constructor(e){super();B(this,hl);B(this,fl);B(this,Ks);B(this,ch);this.mutationId=e.mutationId,$(this,Ks,e.mutationCache),$(this,fl,[]),this.state=e.state||B8(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){R(this,fl).includes(e)||(R(this,fl).push(e),this.clearGcTimeout(),R(this,Ks).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){$(this,fl,R(this,fl).filter(n=>n!==e)),this.scheduleGc(),R(this,Ks).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){R(this,fl).length||(this.state.status==="pending"?this.scheduleGc():R(this,Ks).remove(this))}continue(){var e;return((e=R(this,ch))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var s,i,o,a,c,u,f,l,d,p,h,m,y,g,v,x,_,A,N,T;$(this,ch,$8({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(E,P)=>{z(this,hl,Wu).call(this,{type:"failed",failureCount:E,error:P})},onPause:()=>{z(this,hl,Wu).call(this,{type:"pause"})},onContinue:()=>{z(this,hl,Wu).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>R(this,Ks).canRun(this)}));const n=this.state.status==="pending",r=!R(this,ch).canStart();try{if(!n){z(this,hl,Wu).call(this,{type:"pending",variables:e,isPaused:r}),await((i=(s=R(this,Ks).config).onMutate)==null?void 0:i.call(s,e,this));const P=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,e));P!==this.state.context&&z(this,hl,Wu).call(this,{type:"pending",context:P,variables:e,isPaused:r})}const E=await R(this,ch).start();return await((u=(c=R(this,Ks).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((p=(d=R(this,Ks).config).onSettled)==null?void 0:p.call(d,E,null,this.state.variables,this.state.context,this)),await((m=(h=this.options).onSettled)==null?void 0:m.call(h,E,null,e,this.state.context)),z(this,hl,Wu).call(this,{type:"success",data:E}),E}catch(E){try{throw await((g=(y=R(this,Ks).config).onError)==null?void 0:g.call(y,E,e,this.state.context,this)),await((x=(v=this.options).onError)==null?void 0:x.call(v,E,e,this.state.context)),await((A=(_=R(this,Ks).config).onSettled)==null?void 0:A.call(_,void 0,E,this.state.variables,this.state.context,this)),await((T=(N=this.options).onSettled)==null?void 0:T.call(N,void 0,E,e,this.state.context)),E}finally{z(this,hl,Wu).call(this,{type:"error",error:E})}}finally{R(this,Ks).runNext(this)}}},fl=new WeakMap,Ks=new WeakMap,ch=new WeakMap,hl=new WeakSet,Wu=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),qr.batch(()=>{R(this,fl).forEach(r=>{r.onMutationUpdate(e)}),R(this,Ks).notify({mutation:this,type:"updated",action:e})})},u6);function B8(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var io,Cx,d6,mhe=(d6=class extends uy{constructor(e={}){super();B(this,io);B(this,Cx);this.config=e,$(this,io,new Map),$(this,Cx,Date.now())}build(e,n,r){const s=new phe({mutationCache:this,mutationId:++Rs(this,Cx)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){const n=l1(e),r=R(this,io).get(n)??[];r.push(e),R(this,io).set(n,r),this.notify({type:"added",mutation:e})}remove(e){var r;const n=l1(e);if(R(this,io).has(n)){const s=(r=R(this,io).get(n))==null?void 0:r.filter(i=>i!==e);s&&(s.length===0?R(this,io).delete(n):R(this,io).set(n,s))}this.notify({type:"removed",mutation:e})}canRun(e){var r;const n=(r=R(this,io).get(l1(e)))==null?void 0:r.find(s=>s.state.status==="pending");return!n||n===e}runNext(e){var r;const n=(r=R(this,io).get(l1(e)))==null?void 0:r.find(s=>s!==e&&s.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){qr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...R(this,io).values()].flat()}find(e){const n={exact:!0,...e};return this.getAll().find(r=>Qz(n,r))}findAll(e={}){return this.getAll().filter(n=>Qz(e,n))}notify(e){qr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return qr.batch(()=>Promise.all(e.map(n=>n.continue().catch(Wo))))}},io=new WeakMap,Cx=new WeakMap,d6);function l1(t){var e;return((e=t.options.scope)==null?void 0:e.id)??String(t.mutationId)}function ghe(t){return{onFetch:(e,n)=>{const r=async()=>{var h,m,y,g,v;const s=e.options,i=(y=(m=(h=e.fetchOptions)==null?void 0:h.meta)==null?void 0:m.fetchMore)==null?void 0:y.direction,o=((g=e.state.data)==null?void 0:g.pages)||[],a=((v=e.state.data)==null?void 0:v.pageParams)||[],c={pages:[],pageParams:[]};let u=!1;const f=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(e.signal.aborted?u=!0:e.signal.addEventListener("abort",()=>{u=!0}),e.signal)})},l=I8(e.options,e.fetchOptions),d=async(x,_,A)=>{if(u)return Promise.reject();if(_==null&&x.pages.length)return Promise.resolve(x);const N={queryKey:e.queryKey,pageParam:_,direction:A?"backward":"forward",meta:e.options.meta};f(N);const T=await l(N),{maxPages:E}=e.options,P=A?ohe:ihe;return{pages:P(x.pages,T,E),pageParams:P(x.pageParams,_,E)}};let p;if(i&&o.length){const x=i==="backward",_=x?vhe:eB,A={pages:o,pageParams:a},N=_(s,A);p=await d(A,N,x)}else{p=await d(c,a[0]??s.initialPageParam);const x=t??o.length;for(let _=1;_<x;_++){const A=eB(s,p);if(A==null)break;p=await d(p,A)}}return p};e.options.persister?e.fetchFn=()=>{var s,i;return(i=(s=e.options).persister)==null?void 0:i.call(s,r,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=r}}}function eB(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 vhe(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var dr,dd,fd,Dg,Mg,hd,Og,Ig,f6,yhe=(f6=class{constructor(t={}){B(this,dr);B(this,dd);B(this,fd);B(this,Dg);B(this,Mg);B(this,hd);B(this,Og);B(this,Ig);$(this,dr,t.queryCache||new hhe),$(this,dd,t.mutationCache||new mhe),$(this,fd,t.defaultOptions||{}),$(this,Dg,new Map),$(this,Mg,new Map),$(this,hd,0)}mount(){Rs(this,hd)._++,R(this,hd)===1&&($(this,Og,rL.subscribe(async t=>{t&&(await this.resumePausedMutations(),R(this,dr).onFocus())})),$(this,Ig,mE.subscribe(async t=>{t&&(await this.resumePausedMutations(),R(this,dr).onOnline())})))}unmount(){var t,e;Rs(this,hd)._--,R(this,hd)===0&&((t=R(this,Og))==null||t.call(this),$(this,Og,void 0),(e=R(this,Ig))==null||e.call(this),$(this,Ig,void 0))}isFetching(t){return R(this,dr).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return R(this,dd).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=R(this,dr).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.getQueryData(t.queryKey);if(e===void 0)return this.fetchQuery(t);{const n=this.defaultQueryOptions(t),r=R(this,dr).build(this,n);return t.revalidateIfStale&&r.isStaleByTime(dg(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(e)}}getQueriesData(t){return R(this,dr).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),s=R(this,dr).get(r.queryHash),i=s==null?void 0:s.state.data,o=rhe(e,i);if(o!==void 0)return R(this,dr).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return qr.batch(()=>R(this,dr).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=R(this,dr).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=R(this,dr);qr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=R(this,dr),r={type:"active",...t};return qr.batch(()=>(n.findAll(t).forEach(s=>{s.reset()}),this.refetchQueries(r,e)))}cancelQueries(t={},e={}){const n={revert:!0,...e},r=qr.batch(()=>R(this,dr).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Wo).catch(Wo)}invalidateQueries(t={},e={}){return qr.batch(()=>{if(R(this,dr).findAll(t).forEach(r=>{r.invalidate()}),t.refetchType==="none")return Promise.resolve();const n={...t,type:t.refetchType??t.type??"active"};return this.refetchQueries(n,e)})}refetchQueries(t={},e){const n={...e,cancelRefetch:(e==null?void 0:e.cancelRefetch)??!0},r=qr.batch(()=>R(this,dr).findAll(t).filter(s=>!s.isDisabled()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Wo)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Wo)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=R(this,dr).build(this,e);return n.isStaleByTime(dg(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Wo).catch(Wo)}fetchInfiniteQuery(t){return t.behavior=ghe(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Wo).catch(Wo)}resumePausedMutations(){return mE.isOnline()?R(this,dd).resumePausedMutations():Promise.resolve()}getQueryCache(){return R(this,dr)}getMutationCache(){return R(this,dd)}getDefaultOptions(){return R(this,fd)}setDefaultOptions(t){$(this,fd,t)}setQueryDefaults(t,e){R(this,Dg).set(bp(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...R(this,Dg).values()];let n={};return e.forEach(r=>{Q0(t,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(t,e){R(this,Mg).set(bp(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...R(this,Mg).values()];let n={};return e.forEach(r=>{Q0(t,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...R(this,fd).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.enabled!==!0&&e.queryFn===O8&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...R(this,fd).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){R(this,dr).clear(),R(this,dd).clear()}},dr=new WeakMap,dd=new WeakMap,fd=new WeakMap,Dg=new WeakMap,Mg=new WeakMap,hd=new WeakMap,Og=new WeakMap,Ig=new WeakMap,f6),Si,Ht,Ex,Ys,uh,jg,pl,Ax,Lg,$g,dh,fh,pd,Fg,fn,Bb,vM,yM,bM,xM,wM,_M,SM,U8,h6,bhe=(h6=class extends uy{constructor(e,n){super();B(this,fn);B(this,Si);B(this,Ht);B(this,Ex);B(this,Ys);B(this,uh);B(this,jg);B(this,pl);B(this,Ax);B(this,Lg);B(this,$g);B(this,dh);B(this,fh);B(this,pd);B(this,Fg,new Set);this.options=n,$(this,Si,e),$(this,pl,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(R(this,Ht).addObserver(this),tB(R(this,Ht),this.options)?z(this,fn,Bb).call(this):this.updateResult(),z(this,fn,xM).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return CM(R(this,Ht),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return CM(R(this,Ht),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,z(this,fn,wM).call(this),z(this,fn,_M).call(this),R(this,Ht).removeObserver(this)}setOptions(e,n){const r=this.options,s=R(this,Ht);if(this.options=R(this,Si).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof za(this.options.enabled,R(this,Ht))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");z(this,fn,SM).call(this),R(this,Ht).setOptions(this.options),r._defaulted&&!pE(this.options,r)&&R(this,Si).getQueryCache().notify({type:"observerOptionsUpdated",query:R(this,Ht),observer:this});const i=this.hasListeners();i&&nB(R(this,Ht),s,this.options,r)&&z(this,fn,Bb).call(this),this.updateResult(n),i&&(R(this,Ht)!==s||za(this.options.enabled,R(this,Ht))!==za(r.enabled,R(this,Ht))||dg(this.options.staleTime,R(this,Ht))!==dg(r.staleTime,R(this,Ht)))&&z(this,fn,vM).call(this);const o=z(this,fn,yM).call(this);i&&(R(this,Ht)!==s||za(this.options.enabled,R(this,Ht))!==za(r.enabled,R(this,Ht))||o!==R(this,pd))&&z(this,fn,bM).call(this,o)}getOptimisticResult(e){const n=R(this,Si).getQueryCache().build(R(this,Si),e),r=this.createResult(n,e);return whe(this,r)&&($(this,Ys,r),$(this,jg,this.options),$(this,uh,R(this,Ht).state)),r}getCurrentResult(){return R(this,Ys)}trackResult(e,n){const r={};return Object.keys(e).forEach(s=>{Object.defineProperty(r,s,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(s),n==null||n(s),e[s])})}),r}trackProp(e){R(this,Fg).add(e)}getCurrentQuery(){return R(this,Ht)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=R(this,Si).defaultQueryOptions(e),r=R(this,Si).getQueryCache().build(R(this,Si),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(e){return z(this,fn,Bb).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),R(this,Ys)))}createResult(e,n){var T;const r=R(this,Ht),s=this.options,i=R(this,Ys),o=R(this,uh),a=R(this,jg),u=e!==r?e.state:R(this,Ex),{state:f}=e;let l={...f},d=!1,p;if(n._optimisticResults){const E=this.hasListeners(),P=!E&&tB(e,n),k=E&&nB(e,r,n,s);(P||k)&&(l={...l,...z8(f.data,e.options)}),n._optimisticResults==="isRestoring"&&(l.fetchStatus="idle")}let{error:h,errorUpdatedAt:m,status:y}=l;if(n.select&&l.data!==void 0)if(i&&l.data===(o==null?void 0:o.data)&&n.select===R(this,Ax))p=R(this,Lg);else try{$(this,Ax,n.select),p=n.select(l.data),p=gM(i==null?void 0:i.data,p,n),$(this,Lg,p),$(this,pl,null)}catch(E){$(this,pl,E)}else p=l.data;if(n.placeholderData!==void 0&&p===void 0&&y==="pending"){let E;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))E=i.data;else if(E=typeof n.placeholderData=="function"?n.placeholderData((T=R(this,$g))==null?void 0:T.state.data,R(this,$g)):n.placeholderData,n.select&&E!==void 0)try{E=n.select(E),$(this,pl,null)}catch(P){$(this,pl,P)}E!==void 0&&(y="success",p=gM(i==null?void 0:i.data,E,n),d=!0)}R(this,pl)&&(h=R(this,pl),p=R(this,Lg),m=Date.now(),y="error");const g=l.fetchStatus==="fetching",v=y==="pending",x=y==="error",_=v&&g,A=p!==void 0;return{status:y,fetchStatus:l.fetchStatus,isPending:v,isSuccess:y==="success",isError:x,isInitialLoading:_,isLoading:_,data:p,dataUpdatedAt:l.dataUpdatedAt,error:h,errorUpdatedAt:m,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:l.dataUpdateCount>0||l.errorUpdateCount>0,isFetchedAfterMount:l.dataUpdateCount>u.dataUpdateCount||l.errorUpdateCount>u.errorUpdateCount,isFetching:g,isRefetching:g&&!v,isLoadingError:x&&!A,isPaused:l.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:x&&A,isStale:sL(e,n),refetch:this.refetch}}updateResult(e){const n=R(this,Ys),r=this.createResult(R(this,Ht),this.options);if($(this,uh,R(this,Ht).state),$(this,jg,this.options),R(this,uh).data!==void 0&&$(this,$g,R(this,Ht)),pE(r,n))return;$(this,Ys,r);const s={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!R(this,Fg).size)return!0;const c=new Set(a??R(this,Fg));return this.options.throwOnError&&c.add("error"),Object.keys(R(this,Ys)).some(u=>{const f=u;return R(this,Ys)[f]!==n[f]&&c.has(f)})};(e==null?void 0:e.listeners)!==!1&&i()&&(s.listeners=!0),z(this,fn,U8).call(this,{...s,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&z(this,fn,xM).call(this)}},Si=new WeakMap,Ht=new WeakMap,Ex=new WeakMap,Ys=new WeakMap,uh=new WeakMap,jg=new WeakMap,pl=new WeakMap,Ax=new WeakMap,Lg=new WeakMap,$g=new WeakMap,dh=new WeakMap,fh=new WeakMap,pd=new WeakMap,Fg=new WeakMap,fn=new WeakSet,Bb=function(e){z(this,fn,SM).call(this);let n=R(this,Ht).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Wo)),n},vM=function(){z(this,fn,wM).call(this);const e=dg(this.options.staleTime,R(this,Ht));if(Uv||R(this,Ys).isStale||!pM(e))return;const r=k8(R(this,Ys).dataUpdatedAt,e)+1;$(this,dh,setTimeout(()=>{R(this,Ys).isStale||this.updateResult()},r))},yM=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(R(this,Ht)):this.options.refetchInterval)??!1},bM=function(e){z(this,fn,_M).call(this),$(this,pd,e),!(Uv||za(this.options.enabled,R(this,Ht))===!1||!pM(R(this,pd))||R(this,pd)===0)&&$(this,fh,setInterval(()=>{(this.options.refetchIntervalInBackground||rL.isFocused())&&z(this,fn,Bb).call(this)},R(this,pd)))},xM=function(){z(this,fn,vM).call(this),z(this,fn,bM).call(this,z(this,fn,yM).call(this))},wM=function(){R(this,dh)&&(clearTimeout(R(this,dh)),$(this,dh,void 0))},_M=function(){R(this,fh)&&(clearInterval(R(this,fh)),$(this,fh,void 0))},SM=function(){const e=R(this,Si).getQueryCache().build(R(this,Si),this.options);if(e===R(this,Ht))return;const n=R(this,Ht);$(this,Ht,e),$(this,Ex,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},U8=function(e){qr.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(R(this,Ys))}),R(this,Si).getQueryCache().notify({query:R(this,Ht),type:"observerResultsUpdated"})})},h6);function xhe(t,e){return za(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function tB(t,e){return xhe(t,e)||t.state.data!==void 0&&CM(t,e,e.refetchOnMount)}function CM(t,e,n){if(za(e.enabled,t)!==!1){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&sL(t,e)}return!1}function nB(t,e,n,r){return(t!==e||za(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&sL(t,n)}function sL(t,e){return za(e.enabled,t)!==!1&&t.isStaleByTime(dg(e.staleTime,t))}function whe(t,e){return!pE(t.getCurrentResult(),e)}var md,gd,Ci,Nc,uu,rC,EM,p6,_he=(p6=class extends uy{constructor(n,r){super();B(this,uu);B(this,md);B(this,gd);B(this,Ci);B(this,Nc);$(this,md,n),this.setOptions(r),this.bindMethods(),z(this,uu,rC).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=R(this,md).defaultMutationOptions(n),pE(this.options,r)||R(this,md).getMutationCache().notify({type:"observerOptionsUpdated",mutation:R(this,Ci),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&bp(r.mutationKey)!==bp(this.options.mutationKey)?this.reset():((s=R(this,Ci))==null?void 0:s.state.status)==="pending"&&R(this,Ci).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=R(this,Ci))==null||n.removeObserver(this)}onMutationUpdate(n){z(this,uu,rC).call(this),z(this,uu,EM).call(this,n)}getCurrentResult(){return R(this,gd)}reset(){var n;(n=R(this,Ci))==null||n.removeObserver(this),$(this,Ci,void 0),z(this,uu,rC).call(this),z(this,uu,EM).call(this)}mutate(n,r){var s;return $(this,Nc,r),(s=R(this,Ci))==null||s.removeObserver(this),$(this,Ci,R(this,md).getMutationCache().build(R(this,md),this.options)),R(this,Ci).addObserver(this),R(this,Ci).execute(n)}},md=new WeakMap,gd=new WeakMap,Ci=new WeakMap,Nc=new WeakMap,uu=new WeakSet,rC=function(){var r;const n=((r=R(this,Ci))==null?void 0:r.state)??B8();$(this,gd,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},EM=function(n){qr.batch(()=>{var r,s,i,o,a,c,u,f;if(R(this,Nc)&&this.hasListeners()){const l=R(this,gd).variables,d=R(this,gd).context;(n==null?void 0:n.type)==="success"?((s=(r=R(this,Nc)).onSuccess)==null||s.call(r,n.data,l,d),(o=(i=R(this,Nc)).onSettled)==null||o.call(i,n.data,null,l,d)):(n==null?void 0:n.type)==="error"&&((c=(a=R(this,Nc)).onError)==null||c.call(a,n.error,l,d),(f=(u=R(this,Nc)).onSettled)==null||f.call(u,void 0,n.error,l,d))}this.listeners.forEach(l=>{l(R(this,gd))})})},p6),H8=S.createContext(void 0),Dl=t=>{const e=S.useContext(H8);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},She=({client:t,children:e})=>(S.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),b.jsx(H8.Provider,{value:t,children:e})),V8=S.createContext(!1),Che=()=>S.useContext(V8);V8.Provider;function Ehe(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Ahe=S.createContext(Ehe()),Rhe=()=>S.useContext(Ahe);function q8(t,e){return typeof t=="function"?t(...e):!!t}function Nhe(){}var Phe=(t,e)=>{(t.suspense||t.throwOnError)&&(e.isReset()||(t.retryOnMount=!1))},The=t=>{S.useEffect(()=>{t.clearReset()},[t])},khe=({result:t,errorResetBoundary:e,throwOnError:n,query:r})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&q8(n,[t.error,r]),Dhe=t=>{t.suspense&&(typeof t.staleTime!="number"&&(t.staleTime=1e3),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3)))},Mhe=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,Ohe=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function Ihe(t,e,n){var u,f,l,d;const r=Dl(),s=Che(),i=Rhe(),o=r.defaultQueryOptions(t);(f=(u=r.getDefaultOptions().queries)==null?void 0:u._experimental_beforeQuery)==null||f.call(u,o),o._optimisticResults=s?"isRestoring":"optimistic",Dhe(o),Phe(o,i),The(i);const[a]=S.useState(()=>new e(r,o)),c=a.getOptimisticResult(o);if(S.useSyncExternalStore(S.useCallback(p=>{const h=s?()=>{}:a.subscribe(qr.batchCalls(p));return a.updateResult(),h},[a,s]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),S.useEffect(()=>{a.setOptions(o,{listeners:!1})},[o,a]),Mhe(o,c))throw Ohe(o,a,i);if(khe({result:c,errorResetBoundary:i,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash)}))throw c.error;return(d=(l=r.getDefaultOptions().queries)==null?void 0:l._experimental_afterQuery)==null||d.call(l,o,c),o.notifyOnChangeProps?c:a.trackResult(c)}function JA(t,e){return Ihe(t,bhe)}function Ol(t,e){const n=Dl(),[r]=S.useState(()=>new _he(n,t));S.useEffect(()=>{r.setOptions(t)},[r,t]);const s=S.useSyncExternalStore(S.useCallback(o=>r.subscribe(qr.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=S.useCallback((o,a)=>{r.mutate(o,a).catch(Nhe)},[r]);if(s.error&&q8(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}class la{constructor(e=[]){Te(this,"segments",[]);this.segments=e}key(){return this.segments}get(){return this.segments}}class mf extends la{params(e){return new la([...this.segments,e])}}class jhe extends la{id(e){return new mf([...this.segments,e?String(e):void 0])}}class Lhe extends la{ids(...e){return new mf([...this.segments,...e.length?[e.map(n=>String(n))]:[]])}}class $he extends la{action(e){if(["one","report"].includes(e))return new jhe([...this.segments,e]);if(e==="many")return new Lhe([...this.segments,e]);if(["list","infinite"].includes(e))return new mf([...this.segments,e]);throw new Error("Invalid action type")}}class Fhe extends la{resource(e){return new $he([...this.segments,e])}mutation(e){return new mf([...e==="custom"?this.segments:[this.segments[0]],e])}}class zhe extends la{action(e){return new mf([...this.segments,e])}}class Bhe extends la{action(e){return new mf([...this.segments,e])}}class Uhe extends la{resource(e){return new Bhe([...this.segments,e])}}class Hhe extends la{action(e){return new mf([...this.segments,e])}}class Vhe extends la{resource(e){return new Hhe([...this.segments,e])}action(e){return new mf([...this.segments,e])}}class qhe extends la{data(e){return new Fhe(["data",e||"default"])}auth(){return new zhe(["auth"])}access(){return new Uhe(["access"])}audit(){return new Vhe(["audit"])}}const Whe=()=>new qhe([]),vu=()=>Whe,iL=t=>{const e=vu(),{getProfile:n}=ZA();return JA({queryKey:e().auth().action("profile").get(),queryFn:n,...t})},Ghe=t=>{const e=vu(),{check:n}=ZA();return JA({queryKey:e().auth().action("check").get(),queryFn:n,retry:!1,...t})},Khe=t=>{const e=vu(),{login:n}=ZA();return Ol({mutationKey:e().auth().action("login").get(),mutationFn:n,...t})};function Yhe(t,e){const n=S.createContext(e);function r(i){const{children:o,...a}=i,c=S.useMemo(()=>a,Object.values(a));return b.jsx(n.Provider,{value:c,children:o})}function s(i){const o=S.useContext(n);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return r.displayName=t+"Provider",[r,s]}function In(t,e=[]){let n=[];function r(i,o){const a=S.createContext(o),c=n.length;n=[...n,o];function u(l){const{scope:d,children:p,...h}=l,m=(d==null?void 0:d[t][c])||a,y=S.useMemo(()=>h,Object.values(h));return b.jsx(m.Provider,{value:y,children:p})}function f(l,d){const p=(d==null?void 0:d[t][c])||a,h=S.useContext(p);if(h)return h;if(o!==void 0)return o;throw new Error(`\`${l}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,f]}const s=()=>{const i=n.map(o=>S.createContext(o));return function(a){const c=(a==null?void 0:a[t])||i;return S.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return s.scopeName=t,[r,Xhe(s,...e)]}function Xhe(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:c,scopeName:u})=>{const l=c(i)[`__scope${u}`];return{...a,...l}},{});return S.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function Qhe(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function d_(...t){return e=>t.forEach(n=>Qhe(n,e))}function et(...t){return S.useCallback(d_(...t),t)}var Ka=S.forwardRef((t,e)=>{const{children:n,...r}=t,s=S.Children.toArray(n),i=s.find(Zhe);if(i){const o=i.props.children,a=s.map(c=>c===i?S.Children.count(o)>1?S.Children.only(null):S.isValidElement(o)?o.props.children:null:c);return b.jsx(AM,{...r,ref:e,children:S.isValidElement(o)?S.cloneElement(o,void 0,a):null})}return b.jsx(AM,{...r,ref:e,children:n})});Ka.displayName="Slot";var AM=S.forwardRef((t,e)=>{const{children:n,...r}=t;if(S.isValidElement(n)){const s=epe(n);return S.cloneElement(n,{...Jhe(r,n.props),ref:e?d_(e,s):s})}return S.Children.count(n)>1?S.Children.only(null):null});AM.displayName="SlotClone";var oL=({children:t})=>b.jsx(b.Fragment,{children:t});function Zhe(t){return S.isValidElement(t)&&t.type===oL}function Jhe(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...a)=>{i(...a),s(...a)}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function epe(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 Cu(t){const e=t+"CollectionProvider",[n,r]=In(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:h,children:m}=p,y=oe.useRef(null),g=oe.useRef(new Map).current;return b.jsx(s,{scope:h,itemMap:g,collectionRef:y,children:m})};o.displayName=e;const a=t+"CollectionSlot",c=oe.forwardRef((p,h)=>{const{scope:m,children:y}=p,g=i(a,m),v=et(h,g.collectionRef);return b.jsx(Ka,{ref:v,children:y})});c.displayName=a;const u=t+"CollectionItemSlot",f="data-radix-collection-item",l=oe.forwardRef((p,h)=>{const{scope:m,children:y,...g}=p,v=oe.useRef(null),x=et(h,v),_=i(u,m);return oe.useEffect(()=>(_.itemMap.set(v,{ref:v,...g}),()=>void _.itemMap.delete(v))),b.jsx(Ka,{[f]:"",ref:x,children:y})});l.displayName=u;function d(p){const h=i(t+"CollectionConsumer",p);return oe.useCallback(()=>{const y=h.collectionRef.current;if(!y)return[];const g=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(h.itemMap.values()).sort((_,A)=>g.indexOf(_.ref.current)-g.indexOf(A.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:o,Slot:c,ItemSlot:l},d,r]}function ye(t,e,{checkForDefaultPrevented:n=!0}={}){return function(s){if(t==null||t(s),n===!1||!s.defaultPrevented)return e==null?void 0:e(s)}}function on(t){const e=S.useRef(t);return S.useEffect(()=>{e.current=t}),S.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function mr({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,s]=tpe({defaultProp:e,onChange:n}),i=t!==void 0,o=i?t:r,a=on(n),c=S.useCallback(u=>{if(i){const l=typeof u=="function"?u(t):u;l!==t&&a(l)}else s(u)},[i,t,s,a]);return[o,c]}function tpe({defaultProp:t,onChange:e}){const n=S.useState(t),[r]=n,s=S.useRef(r),i=on(e);return S.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}var npe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],De=npe.reduce((t,e)=>{const n=S.forwardRef((r,s)=>{const{asChild:i,...o}=r,a=i?Ka:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(a,{...o,ref:s})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function Z0(t,e){t&&ss.flushSync(()=>t.dispatchEvent(e))}var ir=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{};function rpe(t,e){return S.useReducer((n,r)=>e[n][r]??n,t)}var Kn=t=>{const{present:e,children:n}=t,r=spe(e),s=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),i=et(r.ref,ipe(s));return typeof n=="function"||r.isPresent?S.cloneElement(s,{ref:i}):null};Kn.displayName="Presence";function spe(t){const[e,n]=S.useState(),r=S.useRef({}),s=S.useRef(t),i=S.useRef("none"),o=t?"mounted":"unmounted",[a,c]=rpe(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const u=c1(r.current);i.current=a==="mounted"?u:"none"},[a]),ir(()=>{const u=r.current,f=s.current;if(f!==t){const d=i.current,p=c1(u);t?c("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&d!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,c]),ir(()=>{if(e){const u=l=>{const p=c1(r.current).includes(l.animationName);l.target===e&&p&&ss.flushSync(()=>c("ANIMATION_END"))},f=l=>{l.target===e&&(i.current=c1(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(a),ref:S.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function c1(t){return(t==null?void 0:t.animationName)||"none"}function ipe(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 ope=o_.useId||(()=>{}),ape=0;function zs(t){const[e,n]=S.useState(ope());return ir(()=>{n(r=>r??String(ape++))},[t]),e?`radix-${e}`:""}var aL="Collapsible",[lpe,W8]=In(aL),[cpe,lL]=lpe(aL),G8=S.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:o,...a}=t,[c=!1,u]=mr({prop:r,defaultProp:s,onChange:o});return b.jsx(cpe,{scope:n,disabled:i,contentId:zs(),open:c,onOpenToggle:S.useCallback(()=>u(f=>!f),[u]),children:b.jsx(De.div,{"data-state":uL(c),"data-disabled":i?"":void 0,...a,ref:e})})});G8.displayName=aL;var K8="CollapsibleTrigger",Y8=S.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,s=lL(K8,n);return b.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:ye(t.onClick,s.onOpenToggle)})});Y8.displayName=K8;var cL="CollapsibleContent",X8=S.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=lL(cL,t.__scopeCollapsible);return b.jsx(Kn,{present:n||s.open,children:({present:i})=>b.jsx(upe,{...r,ref:e,present:i})})});X8.displayName=cL;var upe=S.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=t,o=lL(cL,n),[a,c]=S.useState(r),u=S.useRef(null),f=et(e,u),l=S.useRef(0),d=l.current,p=S.useRef(0),h=p.current,m=o.open||a,y=S.useRef(m),g=S.useRef();return S.useEffect(()=>{const v=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(v)},[]),ir(()=>{const v=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 x=v.getBoundingClientRect();l.current=x.height,p.current=x.width,y.current||(v.style.transitionDuration=g.current.transitionDuration,v.style.animationName=g.current.animationName),c(r)}},[o.open,r]),b.jsx(De.div,{"data-state":uL(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!m,...i,ref:f,style:{"--radix-collapsible-content-height":d?`${d}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...t.style},children:m&&s})});function uL(t){return t?"open":"closed"}var dpe=G8,fpe=Y8,hpe=X8,ppe=S.createContext(void 0);function el(t){const e=S.useContext(ppe);return t||e||"ltr"}var Eu="Accordion",mpe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[dL,gpe,vpe]=Cu(Eu),[eR,BUe]=In(Eu,[vpe,W8]),fL=W8(),ype=oe.forwardRef((t,e)=>{const{type:n,...r}=t,s=r,i=r;return b.jsx(dL.Provider,{scope:t.__scopeAccordion,children:n==="multiple"?b.jsx(_pe,{...i,ref:e}):b.jsx(wpe,{...s,ref:e})})});ype.displayName=Eu;var[Q8,bpe]=eR(Eu),[Z8,xpe]=eR(Eu,{collapsible:!1}),wpe=oe.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:i=!1,...o}=t,[a,c]=mr({prop:n,defaultProp:r,onChange:s});return b.jsx(Q8,{scope:t.__scopeAccordion,value:a?[a]:[],onItemOpen:c,onItemClose:oe.useCallback(()=>i&&c(""),[i,c]),children:b.jsx(Z8,{scope:t.__scopeAccordion,collapsible:i,children:b.jsx(J8,{...o,ref:e})})})}),_pe=oe.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=t,[o=[],a]=mr({prop:n,defaultProp:r,onChange:s}),c=oe.useCallback(f=>a((l=[])=>[...l,f]),[a]),u=oe.useCallback(f=>a((l=[])=>l.filter(d=>d!==f)),[a]);return b.jsx(Q8,{scope:t.__scopeAccordion,value:o,onItemOpen:c,onItemClose:u,children:b.jsx(Z8,{scope:t.__scopeAccordion,collapsible:!0,children:b.jsx(J8,{...i,ref:e})})})}),[Spe,tR]=eR(Eu),J8=oe.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:i="vertical",...o}=t,a=oe.useRef(null),c=et(a,e),u=gpe(n),l=el(s)==="ltr",d=ye(t.onKeyDown,p=>{var E;if(!mpe.includes(p.key))return;const h=p.target,m=u().filter(P=>{var k;return!((k=P.ref.current)!=null&&k.disabled)}),y=m.findIndex(P=>P.ref.current===h),g=m.length;if(y===-1)return;p.preventDefault();let v=y;const x=0,_=g-1,A=()=>{v=y+1,v>_&&(v=x)},N=()=>{v=y-1,v<x&&(v=_)};switch(p.key){case"Home":v=x;break;case"End":v=_;break;case"ArrowRight":i==="horizontal"&&(l?A():N());break;case"ArrowDown":i==="vertical"&&A();break;case"ArrowLeft":i==="horizontal"&&(l?N():A());break;case"ArrowUp":i==="vertical"&&N();break}const T=v%g;(E=m[T].ref.current)==null||E.focus()});return b.jsx(Spe,{scope:n,disabled:r,direction:s,orientation:i,children:b.jsx(dL.Slot,{scope:n,children:b.jsx(De.div,{...o,"data-orientation":i,ref:c,onKeyDown:r?void 0:d})})})}),gE="AccordionItem",[Cpe,hL]=eR(gE),eq=oe.forwardRef((t,e)=>{const{__scopeAccordion:n,value:r,...s}=t,i=tR(gE,n),o=bpe(gE,n),a=fL(n),c=zs(),u=r&&o.value.includes(r)||!1,f=i.disabled||t.disabled;return b.jsx(Cpe,{scope:n,open:u,disabled:f,triggerId:c,children:b.jsx(dpe,{"data-orientation":i.orientation,"data-state":oq(u),...a,...s,ref:e,disabled:f,open:u,onOpenChange:l=>{l?o.onItemOpen(r):o.onItemClose(r)}})})});eq.displayName=gE;var tq="AccordionHeader",nq=oe.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=tR(Eu,n),i=hL(tq,n);return b.jsx(De.h3,{"data-orientation":s.orientation,"data-state":oq(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:e})});nq.displayName=tq;var RM="AccordionTrigger",rq=oe.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=tR(Eu,n),i=hL(RM,n),o=xpe(RM,n),a=fL(n);return b.jsx(dL.ItemSlot,{scope:n,children:b.jsx(fpe,{"aria-disabled":i.open&&!o.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...a,...r,ref:e})})});rq.displayName=RM;var sq="AccordionContent",iq=oe.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=tR(Eu,n),i=hL(sq,n),o=fL(n);return b.jsx(hpe,{role:"region","aria-labelledby":i.triggerId,"data-orientation":s.orientation,...o,...r,ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}})});iq.displayName=sq;function oq(t){return t?"open":"closed"}var Epe=eq,Ape=nq,aq=rq,lq=iq;/**
|
||
* @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 Rpe=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),cq=(...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 Npe={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 Ppe=S.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...a},c)=>S.createElement("svg",{ref:c,...Npe,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:cq("lucide",s),...a},[...o.map(([u,f])=>S.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 _t=(t,e)=>{const n=S.forwardRef(({className:r,...s},i)=>S.createElement(Ppe,{ref:i,iconNode:e,className:cq(`lucide-${Rpe(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 uq=_t("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Tpe=_t("ArrowDownUp",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"m21 8-4-4-4 4",key:"1c9v7m"}],["path",{d:"M17 4v16",key:"7dpous"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const rB=_t("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const sB=_t("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const kpe=_t("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const f_=_t("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const dy=_t("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const nR=_t("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const fy=_t("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const dq=_t("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Dpe=_t("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Mpe=_t("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const fq=_t("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const hq=_t("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ope=_t("CirclePlus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ipe=_t("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const jpe=_t("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const rR=_t("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Lpe=_t("CopyPlus",[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const pL=_t("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const pq=_t("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const $pe=_t("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const mq=_t("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Fpe=_t("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const zpe=_t("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const gq=_t("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Bpe=_t("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Upe=_t("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Hpe=_t("Loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Vpe=_t("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const qpe=_t("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Wpe=_t("Package2",[["path",{d:"M3 9h18v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9Z",key:"1ront0"}],["path",{d:"m3 9 2.45-4.9A2 2 0 0 1 7.24 3h9.52a2 2 0 0 1 1.8 1.1L21 9",key:"19h2x1"}],["path",{d:"M12 3v6",key:"1holv5"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const mL=_t("PackagePlus",[["path",{d:"M16 16h6",key:"100bgy"}],["path",{d:"M19 13v6",key:"85cyf1"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const gL=_t("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const vq=_t("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Gpe=_t("Scan",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const vL=_t("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Kpe=_t("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ype=_t("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Xpe=_t("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const yq=_t("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const bq=_t("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
||
* @license lucide-react v0.427.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Hv=_t("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function xq(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=xq(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function hy(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=xq(t))&&(r&&(r+=" "),r+=e);return r}const yL="-",Qpe=t=>{const e=Jpe(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{const a=o.split(yL);return a[0]===""&&a.length!==1&&a.shift(),wq(a,e)||Zpe(o)},getConflictingClassGroupIds:(o,a)=>{const c=n[o]||[];return a&&r[o]?[...c,...r[o]]:c}}},wq=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),s=r?wq(t.slice(1),r):void 0;if(s)return s;if(e.validators.length===0)return;const i=t.join(yL);return(o=e.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},iB=/^\[(.+)\]$/,Zpe=t=>{if(iB.test(t)){const e=iB.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},Jpe=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return tme(Object.entries(t.classGroups),n).forEach(([i,o])=>{NM(o,r,i,e)}),r},NM=(t,e,n,r)=>{t.forEach(s=>{if(typeof s=="string"){const i=s===""?e:oB(e,s);i.classGroupId=n;return}if(typeof s=="function"){if(eme(s)){NM(s(r),e,n,r);return}e.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{NM(o,oB(e,i),n,r)})})},oB=(t,e)=>{let n=t;return e.split(yL).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},eme=t=>t.isThemeGetter,tme=(t,e)=>e?t.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[e+o,a])):i);return[n,s]}):t,nme=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),e++,e>t&&(e=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return s(i,o),o},set(i,o){n.has(i)?n.set(i,o):s(i,o)}}},_q="!",rme=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,s=e[0],i=e.length,o=a=>{const c=[];let u=0,f=0,l;for(let y=0;y<a.length;y++){let g=a[y];if(u===0){if(g===s&&(r||a.slice(y,y+i)===e)){c.push(a.slice(f,y)),f=y+i;continue}if(g==="/"){l=y;continue}}g==="["?u++:g==="]"&&u--}const d=c.length===0?a:a.substring(f),p=d.startsWith(_q),h=p?d.substring(1):d,m=l&&l>f?l-f:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:m}};return n?a=>n({className:a,parseClassName:o}):o},sme=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},ime=t=>({cache:nme(t.cacheSize),parseClassName:rme(t),...Qpe(t)}),ome=/\s+/,ame=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=e,i=[],o=t.trim().split(ome);let a="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:f,hasImportantModifier:l,baseClassName:d,maybePostfixModifierPosition:p}=n(u);let h=!!p,m=r(h?d.substring(0,p):d);if(!m){if(!h){a=u+(a.length>0?" "+a:a);continue}if(m=r(d),!m){a=u+(a.length>0?" "+a:a);continue}h=!1}const y=sme(f).join(":"),g=l?y+_q:y,v=g+m;if(i.includes(v))continue;i.push(v);const x=s(m,h);for(let _=0;_<x.length;++_){const A=x[_];i.push(g+A)}a=u+(a.length>0?" "+a:a)}return a};function lme(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=Sq(e))&&(r&&(r+=" "),r+=n);return r}const Sq=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=Sq(t[r]))&&(n&&(n+=" "),n+=e);return n};function cme(t,...e){let n,r,s,i=o;function o(c){const u=e.reduce((f,l)=>l(f),t());return n=ime(u),r=n.cache.get,s=n.cache.set,i=a,a(c)}function a(c){const u=r(c);if(u)return u;const f=ame(c,n);return s(c,f),f}return function(){return i(lme.apply(null,arguments))}}const Hn=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},Cq=/^\[(?:([a-z-]+):)?(.+)\]$/i,ume=/^\d+\/\d+$/,dme=new Set(["px","full","screen"]),fme=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hme=/\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$/,pme=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,mme=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,gme=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,hc=t=>fg(t)||dme.has(t)||ume.test(t),Bu=t=>py(t,"length",Cme),fg=t=>!!t&&!Number.isNaN(Number(t)),$T=t=>py(t,"number",fg),mb=t=>!!t&&Number.isInteger(Number(t)),vme=t=>t.endsWith("%")&&fg(t.slice(0,-1)),Nt=t=>Cq.test(t),Uu=t=>fme.test(t),yme=new Set(["length","size","percentage"]),bme=t=>py(t,yme,Eq),xme=t=>py(t,"position",Eq),wme=new Set(["image","url"]),_me=t=>py(t,wme,Ame),Sme=t=>py(t,"",Eme),gb=()=>!0,py=(t,e,n)=>{const r=Cq.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},Cme=t=>hme.test(t)&&!pme.test(t),Eq=()=>!1,Eme=t=>mme.test(t),Ame=t=>gme.test(t),Rme=()=>{const t=Hn("colors"),e=Hn("spacing"),n=Hn("blur"),r=Hn("brightness"),s=Hn("borderColor"),i=Hn("borderRadius"),o=Hn("borderSpacing"),a=Hn("borderWidth"),c=Hn("contrast"),u=Hn("grayscale"),f=Hn("hueRotate"),l=Hn("invert"),d=Hn("gap"),p=Hn("gradientColorStops"),h=Hn("gradientColorStopPositions"),m=Hn("inset"),y=Hn("margin"),g=Hn("opacity"),v=Hn("padding"),x=Hn("saturate"),_=Hn("scale"),A=Hn("sepia"),N=Hn("skew"),T=Hn("space"),E=Hn("translate"),P=()=>["auto","contain","none"],k=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",Nt,e],I=()=>[Nt,e],j=()=>["",hc,Bu],L=()=>["auto",fg,Nt],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],K=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>["start","end","center","between","around","evenly","stretch"],Q=()=>["","0",Nt],ne=()=>["auto","avoid","all","avoid-page","page","left","right","column"],X=()=>[fg,Nt];return{cacheSize:500,separator:":",theme:{colors:[gb],spacing:[hc,Bu],blur:["none","",Uu,Nt],brightness:X(),borderColor:[t],borderRadius:["none","","full",Uu,Nt],borderSpacing:I(),borderWidth:j(),contrast:X(),grayscale:Q(),hueRotate:X(),invert:Q(),gap:I(),gradientColorStops:[t],gradientColorStopPositions:[vme,Bu],inset:M(),margin:M(),opacity:X(),padding:I(),saturate:X(),scale:X(),sepia:Q(),skew:X(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",Nt]}],container:["container"],columns:[{columns:[Uu]}],"break-after":[{"break-after":ne()}],"break-before":[{"break-before":ne()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...H(),Nt]}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",mb,Nt]}],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",Nt]}],grow:[{grow:Q()}],shrink:[{shrink:Q()}],order:[{order:["first","last","none",mb,Nt]}],"grid-cols":[{"grid-cols":[gb]}],"col-start-end":[{col:["auto",{span:["full",mb,Nt]},Nt]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[gb]}],"row-start-end":[{row:["auto",{span:[mb,Nt]},Nt]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Nt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Nt]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...U()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...U(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...U(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Nt,e]}],"min-w":[{"min-w":[Nt,e,"min","max","fit"]}],"max-w":[{"max-w":[Nt,e,"none","full","min","max","fit","prose",{screen:[Uu]},Uu]}],h:[{h:[Nt,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Nt,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Nt,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Nt,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Uu,Bu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",$T]}],"font-family":[{font:[gb]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Nt]}],"line-clamp":[{"line-clamp":["none",fg,$T]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",hc,Nt]}],"list-image":[{"list-image":["none",Nt]}],"list-style-type":[{list:["none","disc","decimal",Nt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",hc,Bu]}],"underline-offset":[{"underline-offset":["auto",hc,Nt]}],"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:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Nt]}],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",Nt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),xme]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",bme]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},_me]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...K(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:K()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...K()]}],"outline-offset":[{"outline-offset":[hc,Nt]}],"outline-w":[{outline:[hc,Bu]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:j()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[hc,Bu]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Uu,Sme]}],"shadow-color":[{shadow:[gb]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Uu,Nt]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[l]}],saturate:[{saturate:[x]}],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":[x]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Nt]}],duration:[{duration:X()}],ease:[{ease:["linear","in","out","in-out",Nt]}],delay:[{delay:X()}],animate:[{animate:["none","spin","ping","pulse","bounce",Nt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[mb,Nt]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Nt]}],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",Nt]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",Nt]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[hc,Bu,$T]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Nme=cme(Rme);function ie(...t){return Nme(hy(t))}const Pme=S.forwardRef(({className:t,...e},n)=>b.jsx(Epe,{ref:n,className:ie("border-b",t),...e}));Pme.displayName="AccordionItem";const Tme=S.forwardRef(({className:t,children:e,...n},r)=>b.jsx(Ape,{className:"flex",children:b.jsxs(aq,{ref:r,className:ie("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",t),...n,children:[e,b.jsx(dy,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Tme.displayName=aq.displayName;const kme=S.forwardRef(({className:t,children:e,...n},r)=>b.jsx(lq,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:b.jsx("div",{className:ie("pb-4 pt-0",t),children:e})}));kme.displayName=lq.displayName;function Aq(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=Aq(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function Dme(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=Aq(t))&&(r&&(r+=" "),r+=e);return r}const aB=t=>typeof t=="boolean"?"".concat(t):t===0?"0":t,lB=Dme,di=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return lB(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=e,o=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=aB(f)||aB(l);return s[u][d]}),a=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,...p}=f;return Object.entries(p).every(h=>{let[m,y]=h;return Array.isArray(y)?y.includes({...i,...a}[m]):{...i,...a}[m]===y})?[...u,l,d]:u},[]);return lB(t,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},Mme=di("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),bL=S.forwardRef(({className:t,variant:e,...n},r)=>b.jsx("div",{ref:r,role:"alert",className:ie(Mme({variant:e}),t),...n}));bL.displayName="Alert";const xL=S.forwardRef(({className:t,...e},n)=>b.jsx("h5",{ref:n,className:ie("mb-1 font-medium leading-none tracking-tight",t),...e}));xL.displayName="AlertTitle";const wL=S.forwardRef(({className:t,...e},n)=>b.jsx("div",{ref:n,className:ie("text-sm [&_p]:leading-relaxed",t),...e}));wL.displayName="AlertDescription";function Ome(t,e=globalThis==null?void 0:globalThis.document){const n=on(t);S.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var Ime="DismissableLayer",PM="dismissableLayer.update",jme="dismissableLayer.pointerDownOutside",Lme="dismissableLayer.focusOutside",cB,Rq=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Au=S.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...c}=t,u=S.useContext(Rq),[f,l]=S.useState(null),d=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=S.useState({}),h=et(e,T=>l(T)),m=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(y),v=f?m.indexOf(f):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,_=v>=g,A=Fme(T=>{const E=T.target,P=[...u.branches].some(k=>k.contains(E));!_||P||(s==null||s(T),o==null||o(T),T.defaultPrevented||a==null||a())},d),N=zme(T=>{const E=T.target;[...u.branches].some(k=>k.contains(E))||(i==null||i(T),o==null||o(T),T.defaultPrevented||a==null||a())},d);return Ome(T=>{v===u.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&a&&(T.preventDefault(),a()))},d),S.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(cB=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),uB(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=cB)}},[f,d,n,u]),S.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),uB())},[f,u]),S.useEffect(()=>{const T=()=>p({});return document.addEventListener(PM,T),()=>document.removeEventListener(PM,T)},[]),b.jsx(De.div,{...c,ref:h,style:{pointerEvents:x?_?"auto":"none":void 0,...t.style},onFocusCapture:ye(t.onFocusCapture,N.onFocusCapture),onBlurCapture:ye(t.onBlurCapture,N.onBlurCapture),onPointerDownCapture:ye(t.onPointerDownCapture,A.onPointerDownCapture)})});Au.displayName=Ime;var $me="DismissableLayerBranch",Nq=S.forwardRef((t,e)=>{const n=S.useContext(Rq),r=S.useRef(null),s=et(e,r);return S.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),b.jsx(De.div,{...t,ref:s})});Nq.displayName=$me;function Fme(t,e=globalThis==null?void 0:globalThis.document){const n=on(t),r=S.useRef(!1),s=S.useRef(()=>{});return S.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let c=function(){Pq(jme,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=c,e.addEventListener("click",s.current,{once:!0})):c()}else e.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function zme(t,e=globalThis==null?void 0:globalThis.document){const n=on(t),r=S.useRef(!1);return S.useEffect(()=>{const s=i=>{i.target&&!r.current&&Pq(Lme,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 uB(){const t=new CustomEvent(PM);document.dispatchEvent(t)}function Pq(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?Z0(s,i):s.dispatchEvent(i)}var Bme=Au,Ume=Nq,FT="focusScope.autoFocusOnMount",zT="focusScope.autoFocusOnUnmount",dB={bubbles:!1,cancelable:!0},Hme="FocusScope",h_=S.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=t,[a,c]=S.useState(null),u=on(s),f=on(i),l=S.useRef(null),d=et(e,m=>c(m)),p=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(r){let m=function(x){if(p.paused||!a)return;const _=x.target;a.contains(_)?l.current=_:Gu(l.current,{select:!0})},y=function(x){if(p.paused||!a)return;const _=x.relatedTarget;_!==null&&(a.contains(_)||Gu(l.current,{select:!0}))},g=function(x){if(document.activeElement===document.body)for(const A of x)A.removedNodes.length>0&&Gu(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const v=new MutationObserver(g);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),v.disconnect()}}},[r,a,p.paused]),S.useEffect(()=>{if(a){hB.add(p);const m=document.activeElement;if(!a.contains(m)){const g=new CustomEvent(FT,dB);a.addEventListener(FT,u),a.dispatchEvent(g),g.defaultPrevented||(Vme(Yme(Tq(a)),{select:!0}),document.activeElement===m&&Gu(a))}return()=>{a.removeEventListener(FT,u),setTimeout(()=>{const g=new CustomEvent(zT,dB);a.addEventListener(zT,f),a.dispatchEvent(g),g.defaultPrevented||Gu(m??document.body,{select:!0}),a.removeEventListener(zT,f),hB.remove(p)},0)}}},[a,u,f,p]);const h=S.useCallback(m=>{if(!n&&!r||p.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,g=document.activeElement;if(y&&g){const v=m.currentTarget,[x,_]=qme(v);x&&_?!m.shiftKey&&g===_?(m.preventDefault(),n&&Gu(x,{select:!0})):m.shiftKey&&g===x&&(m.preventDefault(),n&&Gu(_,{select:!0})):g===v&&m.preventDefault()}},[n,r,p.paused]);return b.jsx(De.div,{tabIndex:-1,...o,ref:d,onKeyDown:h})});h_.displayName=Hme;function Vme(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Gu(r,{select:e}),document.activeElement!==n)return}function qme(t){const e=Tq(t),n=fB(e,t),r=fB(e.reverse(),t);return[n,r]}function Tq(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 fB(t,e){for(const n of t)if(!Wme(n,{upTo:e}))return n}function Wme(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 Gme(t){return t instanceof HTMLInputElement&&"select"in t}function Gu(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&Gme(t)&&e&&t.select()}}var hB=Kme();function Kme(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=pB(t,e),t.unshift(e)},remove(e){var n;t=pB(t,e),(n=t[0])==null||n.resume()}}}function pB(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function Yme(t){return t.filter(e=>e.tagName!=="A")}var Xme="Portal",my=S.forwardRef((t,e)=>{var a;const{container:n,...r}=t,[s,i]=S.useState(!1);ir(()=>i(!0),[]);const o=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?QA.createPortal(b.jsx(De.div,{...r,ref:e}),o):null});my.displayName=Xme;var BT=0;function sR(){S.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??mB()),document.body.insertAdjacentElement("beforeend",t[1]??mB()),BT++,()=>{BT===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),BT--}},[])}function mB(){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 Ls=function(){return Ls=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},Ls.apply(this,arguments)};function _L(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 kq(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 b0="right-scroll-bar-position",x0="width-before-scroll-bar",Qme="with-scroll-bars-hidden",Zme="--removed-body-scroll-bar-size";function UT(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function Jme(t,e){var n=S.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 ege=typeof window<"u"?S.useLayoutEffect:S.useEffect,gB=new WeakMap;function Dq(t,e){var n=Jme(null,function(r){return t.forEach(function(s){return UT(s,r)})});return ege(function(){var r=gB.get(n);if(r){var s=new Set(r),i=new Set(t),o=n.current;s.forEach(function(a){i.has(a)||UT(a,null)}),i.forEach(function(a){s.has(a)||UT(a,o)})}gB.set(n,t)},[t]),n}function tge(t){return t}function nge(t,e){e===void 0&&(e=tge);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 o=e(i,r);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(i),o=n}var c=function(){var f=o;o=[],f.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(f){o.push(f),u()},filter:function(f){return o=o.filter(f),n}}}};return s}function Mq(t){t===void 0&&(t={});var e=nge(null);return e.options=Ls({async:!0,ssr:!1},t),e}var Oq=function(t){var e=t.sideCar,n=_L(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 S.createElement(r,Ls({},n))};Oq.isSideCarExport=!0;function Iq(t,e){return t.useMedium(e),Oq}var jq=Mq(),HT=function(){},iR=S.forwardRef(function(t,e){var n=S.useRef(null),r=S.useState({onScrollCapture:HT,onWheelCapture:HT,onTouchMoveCapture:HT}),s=r[0],i=r[1],o=t.forwardProps,a=t.children,c=t.className,u=t.removeScrollBar,f=t.enabled,l=t.shards,d=t.sideCar,p=t.noIsolation,h=t.inert,m=t.allowPinchZoom,y=t.as,g=y===void 0?"div":y,v=t.gapMode,x=_L(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=d,A=Dq([n,e]),N=Ls(Ls({},x),s);return S.createElement(S.Fragment,null,f&&S.createElement(_,{sideCar:jq,removeScrollBar:u,shards:l,noIsolation:p,inert:h,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:v}),o?S.cloneElement(S.Children.only(a),Ls(Ls({},N),{ref:A})):S.createElement(g,Ls({},N,{className:c,ref:A}),a))});iR.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};iR.classNames={fullWidth:x0,zeroRight:b0};var rge=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function sge(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=rge();return e&&t.setAttribute("nonce",e),t}function ige(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function oge(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var age=function(){var t=0,e=null;return{add:function(n){t==0&&(e=sge())&&(ige(e,n),oge(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},lge=function(){var t=age();return function(e,n){S.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},SL=function(){var t=lge(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},cge={left:0,top:0,right:0,gap:0},VT=function(t){return parseInt(t||"",10)||0},uge=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[VT(n),VT(r),VT(s)]},dge=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return cge;var e=uge(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])}},fge=SL(),hg="data-scroll-locked",hge=function(t,e,n,r){var s=t.left,i=t.top,o=t.right,a=t.gap;return n===void 0&&(n="margin"),`
|
||
.`.concat(Qme,` {
|
||
overflow: hidden `).concat(r,`;
|
||
padding-right: `).concat(a,"px ").concat(r,`;
|
||
}
|
||
body[`).concat(hg,`] {
|
||
overflow: hidden `).concat(r,`;
|
||
overscroll-behavior: contain;
|
||
`).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
|
||
padding-left: `.concat(s,`px;
|
||
padding-top: `).concat(i,`px;
|
||
padding-right: `).concat(o,`px;
|
||
margin-left:0;
|
||
margin-top:0;
|
||
margin-right: `).concat(a,"px ").concat(r,`;
|
||
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
||
}
|
||
|
||
.`).concat(b0,` {
|
||
right: `).concat(a,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(x0,` {
|
||
margin-right: `).concat(a,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(b0," .").concat(b0,` {
|
||
right: 0 `).concat(r,`;
|
||
}
|
||
|
||
.`).concat(x0," .").concat(x0,` {
|
||
margin-right: 0 `).concat(r,`;
|
||
}
|
||
|
||
body[`).concat(hg,`] {
|
||
`).concat(Zme,": ").concat(a,`px;
|
||
}
|
||
`)},vB=function(){var t=parseInt(document.body.getAttribute(hg)||"0",10);return isFinite(t)?t:0},pge=function(){S.useEffect(function(){return document.body.setAttribute(hg,(vB()+1).toString()),function(){var t=vB()-1;t<=0?document.body.removeAttribute(hg):document.body.setAttribute(hg,t.toString())}},[])},Lq=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;pge();var i=S.useMemo(function(){return dge(s)},[s]);return S.createElement(fge,{styles:hge(i,!e,s,n?"":"!important")})},TM=!1;if(typeof window<"u")try{var u1=Object.defineProperty({},"passive",{get:function(){return TM=!0,!0}});window.addEventListener("test",u1,u1),window.removeEventListener("test",u1,u1)}catch{TM=!1}var ym=TM?{passive:!1}:!1,mge=function(t){return t.tagName==="TEXTAREA"},$q=function(t,e){var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!mge(t)&&n[e]==="visible")},gge=function(t){return $q(t,"overflowY")},vge=function(t){return $q(t,"overflowX")},yB=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=Fq(t,r);if(s){var i=zq(t,r),o=i[1],a=i[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},yge=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},bge=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},Fq=function(t,e){return t==="v"?gge(e):vge(e)},zq=function(t,e){return t==="v"?yge(e):bge(e)},xge=function(t,e){return t==="h"&&e==="rtl"?-1:1},wge=function(t,e,n,r,s){var i=xge(t,window.getComputedStyle(e).direction),o=i*r,a=n.target,c=e.contains(a),u=!1,f=o>0,l=0,d=0;do{var p=zq(t,a),h=p[0],m=p[1],y=p[2],g=m-y-i*h;(h||g)&&Fq(t,a)&&(l+=g,d+=h),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(f&&(Math.abs(l)<1||!s)||!f&&(Math.abs(d)<1||!s))&&(u=!0),u},d1=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},bB=function(t){return[t.deltaX,t.deltaY]},xB=function(t){return t&&"current"in t?t.current:t},_ge=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Sge=function(t){return`
|
||
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
||
`)},Cge=0,bm=[];function Ege(t){var e=S.useRef([]),n=S.useRef([0,0]),r=S.useRef(),s=S.useState(Cge++)[0],i=S.useState(SL)[0],o=S.useRef(t);S.useEffect(function(){o.current=t},[t]),S.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var m=kq([t.lockRef.current],(t.shards||[]).map(xB),!0).filter(Boolean);return m.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var a=S.useCallback(function(m,y){if("touches"in m&&m.touches.length===2)return!o.current.allowPinchZoom;var g=d1(m),v=n.current,x="deltaX"in m?m.deltaX:v[0]-g[0],_="deltaY"in m?m.deltaY:v[1]-g[1],A,N=m.target,T=Math.abs(x)>Math.abs(_)?"h":"v";if("touches"in m&&T==="h"&&N.type==="range")return!1;var E=yB(T,N);if(!E)return!0;if(E?A=T:(A=T==="v"?"h":"v",E=yB(T,N)),!E)return!1;if(!r.current&&"changedTouches"in m&&(x||_)&&(r.current=A),!A)return!0;var P=r.current||A;return wge(P,y,m,P==="h"?x:_,!0)},[]),c=S.useCallback(function(m){var y=m;if(!(!bm.length||bm[bm.length-1]!==i)){var g="deltaY"in y?bB(y):d1(y),v=e.current.filter(function(A){return A.name===y.type&&(A.target===y.target||y.target===A.shadowParent)&&_ge(A.delta,g)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var x=(o.current.shards||[]).map(xB).filter(Boolean).filter(function(A){return A.contains(y.target)}),_=x.length>0?a(y,x[0]):!o.current.noIsolation;_&&y.cancelable&&y.preventDefault()}}},[]),u=S.useCallback(function(m,y,g,v){var x={name:m,delta:y,target:g,should:v,shadowParent:Age(g)};e.current.push(x),setTimeout(function(){e.current=e.current.filter(function(_){return _!==x})},1)},[]),f=S.useCallback(function(m){n.current=d1(m),r.current=void 0},[]),l=S.useCallback(function(m){u(m.type,bB(m),m.target,a(m,t.lockRef.current))},[]),d=S.useCallback(function(m){u(m.type,d1(m),m.target,a(m,t.lockRef.current))},[]);S.useEffect(function(){return bm.push(i),t.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:d}),document.addEventListener("wheel",c,ym),document.addEventListener("touchmove",c,ym),document.addEventListener("touchstart",f,ym),function(){bm=bm.filter(function(m){return m!==i}),document.removeEventListener("wheel",c,ym),document.removeEventListener("touchmove",c,ym),document.removeEventListener("touchstart",f,ym)}},[]);var p=t.removeScrollBar,h=t.inert;return S.createElement(S.Fragment,null,h?S.createElement(i,{styles:Sge(s)}):null,p?S.createElement(Lq,{gapMode:t.gapMode}):null)}function Age(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Rge=Iq(jq,Ege);var p_=S.forwardRef(function(t,e){return S.createElement(iR,Ls({},t,{ref:e,sideCar:Rge}))});p_.classNames=iR.classNames;var Nge=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},xm=new WeakMap,f1=new WeakMap,h1={},qT=0,Bq=function(t){return t&&(t.host||Bq(t.parentNode))},Pge=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=Bq(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})},Tge=function(t,e,n,r){var s=Pge(e,Array.isArray(t)?t:[t]);h1[n]||(h1[n]=new WeakMap);var i=h1[n],o=[],a=new Set,c=new Set(s),u=function(l){!l||a.has(l)||(a.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(a.has(d))f(d);else try{var p=d.getAttribute(r),h=p!==null&&p!=="false",m=(xm.get(d)||0)+1,y=(i.get(d)||0)+1;xm.set(d,m),i.set(d,y),o.push(d),m===1&&h&&f1.set(d,!0),y===1&&d.setAttribute(n,"true"),h||d.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",d,g)}})};return f(e),a.clear(),qT++,function(){o.forEach(function(l){var d=xm.get(l)-1,p=i.get(l)-1;xm.set(l,d),i.set(l,p),d||(f1.has(l)||l.removeAttribute(r),f1.delete(l)),p||l.removeAttribute(n)}),qT--,qT||(xm=new WeakMap,xm=new WeakMap,f1=new WeakMap,h1={})}},m_=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=Nge(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),Tge(r,s,n,"aria-hidden")):function(){return null}},CL="Dialog",[Uq,Hq]=In(CL),[kge,tl]=Uq(CL),Vq=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=t,a=S.useRef(null),c=S.useRef(null),[u=!1,f]=mr({prop:r,defaultProp:s,onChange:i});return b.jsx(kge,{scope:e,triggerRef:a,contentRef:c,contentId:zs(),titleId:zs(),descriptionId:zs(),open:u,onOpenChange:f,onOpenToggle:S.useCallback(()=>f(l=>!l),[f]),modal:o,children:n})};Vq.displayName=CL;var qq="DialogTrigger",Wq=S.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=tl(qq,n),i=et(e,s.triggerRef);return b.jsx(De.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":NL(s.open),...r,ref:i,onClick:ye(t.onClick,s.onOpenToggle)})});Wq.displayName=qq;var EL="DialogPortal",[Dge,Gq]=Uq(EL,{forceMount:void 0}),Kq=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=tl(EL,e);return b.jsx(Dge,{scope:e,forceMount:n,children:S.Children.map(r,o=>b.jsx(Kn,{present:n||i.open,children:b.jsx(my,{asChild:!0,container:s,children:o})}))})};Kq.displayName=EL;var vE="DialogOverlay",Yq=S.forwardRef((t,e)=>{const n=Gq(vE,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=tl(vE,t.__scopeDialog);return i.modal?b.jsx(Kn,{present:r||i.open,children:b.jsx(Mge,{...s,ref:e})}):null});Yq.displayName=vE;var Mge=S.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=tl(vE,n);return b.jsx(p_,{as:Ka,allowPinchZoom:!0,shards:[s.contentRef],children:b.jsx(De.div,{"data-state":NL(s.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),xp="DialogContent",Xq=S.forwardRef((t,e)=>{const n=Gq(xp,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=tl(xp,t.__scopeDialog);return b.jsx(Kn,{present:r||i.open,children:i.modal?b.jsx(Oge,{...s,ref:e}):b.jsx(Ige,{...s,ref:e})})});Xq.displayName=xp;var Oge=S.forwardRef((t,e)=>{const n=tl(xp,t.__scopeDialog),r=S.useRef(null),s=et(e,n.contentRef,r);return S.useEffect(()=>{const i=r.current;if(i)return m_(i)},[]),b.jsx(Qq,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ye(t.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ye(t.onPointerDownOutside,i=>{const o=i.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&i.preventDefault()}),onFocusOutside:ye(t.onFocusOutside,i=>i.preventDefault())})}),Ige=S.forwardRef((t,e)=>{const n=tl(xp,t.__scopeDialog),r=S.useRef(!1),s=S.useRef(!1);return b.jsx(Qq,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),Qq=S.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=t,a=tl(xp,n),c=S.useRef(null),u=et(e,c);return sR(),b.jsxs(b.Fragment,{children:[b.jsx(h_,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:b.jsx(Au,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":NL(a.open),...o,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),b.jsxs(b.Fragment,{children:[b.jsx(Lge,{titleId:a.titleId}),b.jsx(Fge,{contentRef:c,descriptionId:a.descriptionId})]})]})}),AL="DialogTitle",Zq=S.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=tl(AL,n);return b.jsx(De.h2,{id:s.titleId,...r,ref:e})});Zq.displayName=AL;var Jq="DialogDescription",RL=S.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=tl(Jq,n);return b.jsx(De.p,{id:s.descriptionId,...r,ref:e})});RL.displayName=Jq;var eW="DialogClose",tW=S.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=tl(eW,n);return b.jsx(De.button,{type:"button",...r,ref:e,onClick:ye(t.onClick,()=>s.onOpenChange(!1))})});tW.displayName=eW;function NL(t){return t?"open":"closed"}var nW="DialogTitleWarning",[jge,rW]=Yhe(nW,{contentName:xp,titleName:AL,docsSlug:"dialog"}),Lge=({titleId:t})=>{const e=rW(nW),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
||
|
||
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
|
||
|
||
For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return S.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},$ge="DialogDescriptionWarning",Fge=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${rW($ge).contentName}}.`;return S.useEffect(()=>{var i;const s=(i=t.current)==null?void 0:i.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},oR=Vq,aR=Wq,lR=Kq,gy=Yq,vy=Xq,yy=Zq,by=RL,xy=tW,sW="AlertDialog",[zge,UUe]=In(sW,[Hq]),Ru=Hq(),iW=t=>{const{__scopeAlertDialog:e,...n}=t,r=Ru(e);return b.jsx(oR,{...r,...n,modal:!0})};iW.displayName=sW;var Bge="AlertDialogTrigger",oW=S.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Ru(n);return b.jsx(aR,{...s,...r,ref:e})});oW.displayName=Bge;var Uge="AlertDialogPortal",aW=t=>{const{__scopeAlertDialog:e,...n}=t,r=Ru(e);return b.jsx(lR,{...r,...n})};aW.displayName=Uge;var Hge="AlertDialogOverlay",lW=S.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Ru(n);return b.jsx(gy,{...s,...r,ref:e})});lW.displayName=Hge;var pg="AlertDialogContent",[Vge,qge]=zge(pg),cW=S.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...s}=t,i=Ru(n),o=S.useRef(null),a=et(e,o),c=S.useRef(null);return b.jsx(jge,{contentName:pg,titleName:uW,docsSlug:"alert-dialog",children:b.jsx(Vge,{scope:n,cancelRef:c,children:b.jsxs(vy,{role:"alertdialog",...i,...s,ref:a,onOpenAutoFocus:ye(s.onOpenAutoFocus,u=>{var f;u.preventDefault(),(f=c.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[b.jsx(oL,{children:r}),b.jsx(Gge,{contentRef:o})]})})})});cW.displayName=pg;var uW="AlertDialogTitle",dW=S.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Ru(n);return b.jsx(yy,{...s,...r,ref:e})});dW.displayName=uW;var fW="AlertDialogDescription",hW=S.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Ru(n);return b.jsx(by,{...s,...r,ref:e})});hW.displayName=fW;var Wge="AlertDialogAction",pW=S.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Ru(n);return b.jsx(xy,{...s,...r,ref:e})});pW.displayName=Wge;var mW="AlertDialogCancel",gW=S.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:s}=qge(mW,n),i=Ru(n),o=et(e,s);return b.jsx(xy,{...i,...r,ref:o})});gW.displayName=mW;var Gge=({contentRef:t})=>{const e=`\`${pg}\` requires a description for the component to be accessible for screen reader users.
|
||
|
||
You can add a description to the \`${pg}\` by passing a \`${fW}\` 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 \`${pg}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
||
|
||
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return S.useEffect(()=>{var r;document.getElementById((r=t.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},Kge=iW,Yge=oW,Xge=aW,vW=lW,yW=cW,bW=pW,xW=gW,wW=dW,_W=hW;const J0=di("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"}}),qe=S.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...s},i)=>{const o=r?Ka:"button";return b.jsx(o,{className:ie(J0({variant:e,size:n,className:t})),ref:i,...s})});qe.displayName="Button";const PL=Kge,Qge=Yge,Zge=Xge,SW=S.forwardRef(({className:t,...e},n)=>b.jsx(vW,{className:ie("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));SW.displayName=vW.displayName;const cR=S.forwardRef(({className:t,...e},n)=>b.jsxs(Zge,{children:[b.jsx(SW,{}),b.jsx(yW,{ref:n,className:ie("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...e})]}));cR.displayName=yW.displayName;const uR=({className:t,...e})=>b.jsx("div",{className:ie("flex flex-col space-y-2 text-center sm:text-left",t),...e});uR.displayName="AlertDialogHeader";const dR=({className:t,...e})=>b.jsx("div",{className:ie("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});dR.displayName="AlertDialogFooter";const fR=S.forwardRef(({className:t,...e},n)=>b.jsx(wW,{ref:n,className:ie("text-lg font-semibold",t),...e}));fR.displayName=wW.displayName;const hR=S.forwardRef(({className:t,...e},n)=>b.jsx(_W,{ref:n,className:ie("text-sm text-muted-foreground",t),...e}));hR.displayName=_W.displayName;const pR=S.forwardRef(({className:t,...e},n)=>b.jsx(bW,{ref:n,className:ie(J0(),t),...e}));pR.displayName=bW.displayName;const mR=S.forwardRef(({className:t,...e},n)=>b.jsx(xW,{ref:n,className:ie(J0({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));mR.displayName=xW.displayName;const Jge=({textAreaRef:t,triggerAutoSize:e,maxHeight:n=Number.MAX_SAFE_INTEGER,minHeight:r=0})=>{const[s,i]=S.useState(!0);S.useEffect(()=>{if(t){s&&(t.style.minHeight=`${r+2}px`,n>r&&(t.style.maxHeight=`${n}px`),i(!1)),t.style.height=`${r+2}px`;const a=t.scrollHeight;a>n?t.style.height=`${n}px`:t.style.height=`${a+2}px`}},[t,e,s,n,r])},CW=S.forwardRef(({maxHeight:t=Number.MAX_SAFE_INTEGER,minHeight:e=52,className:n,onChange:r,value:s,...i},o)=>{const a=S.useRef(null),[c,u]=S.useState("");return Jge({textAreaRef:a.current,triggerAutoSize:c,maxHeight:t,minHeight:e}),S.useImperativeHandle(o,()=>({textArea:a.current,focus:()=>{var f;return(f=a.current)==null?void 0:f.focus()},maxHeight:t,minHeight:e})),S.useEffect(()=>{(s||i!=null&&i.defaultValue)&&u(s)},[s||(i==null?void 0:i.defaultValue)]),b.jsx("textarea",{...i,value:s,ref:a,className:ie("flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n),onChange:f=>{u(f.target.value),r==null||r(f)}})});CW.displayName="AutosizeTextarea";var TL="Avatar",[eve,HUe]=In(TL),[tve,EW]=eve(TL),AW=S.forwardRef((t,e)=>{const{__scopeAvatar:n,...r}=t,[s,i]=S.useState("idle");return b.jsx(tve,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:i,children:b.jsx(De.span,{...r,ref:e})})});AW.displayName=TL;var RW="AvatarImage",NW=S.forwardRef((t,e)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s=()=>{},...i}=t,o=EW(RW,n),a=nve(r),c=on(u=>{s(u),o.onImageLoadingStatusChange(u)});return ir(()=>{a!=="idle"&&c(a)},[a,c]),a==="loaded"?b.jsx(De.img,{...i,ref:e,src:r}):null});NW.displayName=RW;var PW="AvatarFallback",TW=S.forwardRef((t,e)=>{const{__scopeAvatar:n,delayMs:r,...s}=t,i=EW(PW,n),[o,a]=S.useState(r===void 0);return S.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(c)}},[r]),o&&i.imageLoadingStatus!=="loaded"?b.jsx(De.span,{...s,ref:e}):null});TW.displayName=PW;function nve(t){const[e,n]=S.useState("idle");return ir(()=>{if(!t){n("error");return}let r=!0;const s=new window.Image,i=o=>()=>{r&&n(o)};return n("loading"),s.onload=i("loaded"),s.onerror=i("error"),s.src=t,()=>{r=!1}},[t]),e}var kW=AW,DW=NW,MW=TW;const rve=S.forwardRef(({className:t,...e},n)=>b.jsx(kW,{ref:n,className:ie("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...e}));rve.displayName=kW.displayName;const sve=S.forwardRef(({className:t,...e},n)=>b.jsx(DW,{ref:n,className:ie("aspect-square h-full w-full",t),...e}));sve.displayName=DW.displayName;const ive=S.forwardRef(({className:t,...e},n)=>b.jsx(MW,{ref:n,className:ie("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...e}));ive.displayName=MW.displayName;const ove=di("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 gR({className:t,variant:e,...n}){return b.jsx("div",{className:ie(ove({variant:e}),t),...n})}const ave=S.forwardRef(({...t},e)=>b.jsx("nav",{ref:e,"aria-label":"breadcrumb",...t}));ave.displayName="Breadcrumb";const lve=S.forwardRef(({className:t,...e},n)=>b.jsx("ol",{ref:n,className:ie("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",t),...e}));lve.displayName="BreadcrumbList";const cve=S.forwardRef(({className:t,...e},n)=>b.jsx("li",{ref:n,className:ie("inline-flex items-center gap-1.5",t),...e}));cve.displayName="BreadcrumbItem";const uve=S.forwardRef(({asChild:t,className:e,...n},r)=>{const s=t?Ka:"a";return b.jsx(s,{ref:r,className:ie("transition-colors hover:text-foreground",e),...n})});uve.displayName="BreadcrumbLink";const dve=S.forwardRef(({className:t,...e},n)=>b.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:ie("font-normal text-foreground",t),...e}));dve.displayName="BreadcrumbPage";function Qt(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function Eo(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function ti(t,e){const n=Qt(t);return isNaN(e)?Eo(t,NaN):(e&&n.setDate(n.getDate()+e),n)}function Ya(t,e){const n=Qt(t);if(isNaN(e))return Eo(t,NaN);if(!e)return n;const r=n.getDate(),s=Eo(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 kL=6048e5,fve=864e5;let hve={};function g_(){return hve}function Vl(t,e){var a,c,u,f;const n=g_(),r=(e==null?void 0:e.weekStartsOn)??((c=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((f=(u=n.locale)==null?void 0:u.options)==null?void 0:f.weekStartsOn)??0,s=Qt(t),i=s.getDay(),o=(i<r?7:0)+i-r;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function wp(t){return Vl(t,{weekStartsOn:1})}function OW(t){const e=Qt(t),n=e.getFullYear(),r=Eo(t,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const s=wp(r),i=Eo(t,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const o=wp(i);return e.getTime()>=s.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function Vv(t){const e=Qt(t);return e.setHours(0,0,0,0),e}function yE(t){const e=Qt(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function Il(t,e){const n=Vv(t),r=Vv(e),s=+n-yE(n),i=+r-yE(r);return Math.round((s-i)/fve)}function pve(t){const e=OW(t),n=Eo(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),wp(n)}function kM(t,e){const n=e*7;return ti(t,n)}function mve(t,e){return Ya(t,e*12)}function gve(t){let e;return t.forEach(function(n){const r=Qt(n);(e===void 0||e<r||isNaN(Number(r)))&&(e=r)}),e||new Date(NaN)}function vve(t){let e;return t.forEach(n=>{const r=Qt(n);(!e||e>r||isNaN(+r))&&(e=r)}),e||new Date(NaN)}function Di(t,e){const n=Vv(t),r=Vv(e);return+n==+r}function DL(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function yve(t){if(!DL(t)&&typeof t!="number")return!1;const e=Qt(t);return!isNaN(Number(e))}function ex(t,e){const n=Qt(t),r=Qt(e),s=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return s*12+i}function bve(t,e,n){const r=Vl(t,n),s=Vl(e,n),i=+r-yE(r),o=+s-yE(s);return Math.round((i-o)/kL)}function ML(t){const e=Qt(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function zi(t){const e=Qt(t);return e.setDate(1),e.setHours(0,0,0,0),e}function IW(t){const e=Qt(t),n=Eo(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}function OL(t,e){var a,c,u,f;const n=g_(),r=(e==null?void 0:e.weekStartsOn)??((c=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((f=(u=n.locale)==null?void 0:u.options)==null?void 0:f.weekStartsOn)??0,s=Qt(t),i=s.getDay(),o=(i<r?-7:0)+6-(i-r);return s.setDate(s.getDate()+o),s.setHours(23,59,59,999),s}function jW(t){return OL(t,{weekStartsOn:1})}const xve={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"}},wve=(t,e,n)=>{let r;const s=xve[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 WT(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const _ve={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Sve={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Cve={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Eve={date:WT({formats:_ve,defaultWidth:"full"}),time:WT({formats:Sve,defaultWidth:"full"}),dateTime:WT({formats:Cve,defaultWidth:"full"})},Ave={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Rve=(t,e,n,r)=>Ave[t];function vb(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,a=n!=null&&n.width?String(n.width):o;s=t.formattingValues[a]||t.formattingValues[o]}else{const o=t.defaultWidth,a=n!=null&&n.width?String(n.width):t.defaultWidth;s=t.values[a]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return s[i]}}const Nve={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Pve={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Tve={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"]},kve={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"]},Dve={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"}},Mve={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"}},Ove=(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"},Ive={ordinalNumber:Ove,era:vb({values:Nve,defaultWidth:"wide"}),quarter:vb({values:Pve,defaultWidth:"wide",argumentCallback:t=>t-1}),month:vb({values:Tve,defaultWidth:"wide"}),day:vb({values:kve,defaultWidth:"wide"}),dayPeriod:vb({values:Dve,defaultWidth:"wide",formattingValues:Mve,defaultFormattingWidth:"wide"})};function yb(t){return(e,n={})=>{const r=n.width,s=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(s);if(!i)return null;const o=i[0],a=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(a)?Lve(a,l=>l.test(o)):jve(a,l=>l.test(o));let u;u=t.valueCallback?t.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const f=e.slice(o.length);return{value:u,rest:f}}}function jve(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Lve(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function $ve(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 o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const a=e.slice(s.length);return{value:o,rest:a}}}const Fve=/^(\d+)(th|st|nd|rd)?/i,zve=/\d+/i,Bve={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},Uve={any:[/^b/i,/^(a|c)/i]},Hve={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Vve={any:[/1/i,/2/i,/3/i,/4/i]},qve={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},Wve={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]},Gve={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},Kve={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]},Yve={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},Xve={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}},Qve={ordinalNumber:$ve({matchPattern:Fve,parsePattern:zve,valueCallback:t=>parseInt(t,10)}),era:yb({matchPatterns:Bve,defaultMatchWidth:"wide",parsePatterns:Uve,defaultParseWidth:"any"}),quarter:yb({matchPatterns:Hve,defaultMatchWidth:"wide",parsePatterns:Vve,defaultParseWidth:"any",valueCallback:t=>t+1}),month:yb({matchPatterns:qve,defaultMatchWidth:"wide",parsePatterns:Wve,defaultParseWidth:"any"}),day:yb({matchPatterns:Gve,defaultMatchWidth:"wide",parsePatterns:Kve,defaultParseWidth:"any"}),dayPeriod:yb({matchPatterns:Yve,defaultMatchWidth:"any",parsePatterns:Xve,defaultParseWidth:"any"})},LW={code:"en-US",formatDistance:wve,formatLong:Eve,formatRelative:Rve,localize:Ive,match:Qve,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Zve(t){const e=Qt(t);return Il(e,IW(e))+1}function $W(t){const e=Qt(t),n=+wp(e)-+pve(e);return Math.round(n/kL)+1}function FW(t,e){var f,l,d,p;const n=Qt(t),r=n.getFullYear(),s=g_(),i=(e==null?void 0:e.firstWeekContainsDate)??((l=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:l.firstWeekContainsDate)??s.firstWeekContainsDate??((p=(d=s.locale)==null?void 0:d.options)==null?void 0:p.firstWeekContainsDate)??1,o=Eo(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const a=Vl(o,e),c=Eo(t,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const u=Vl(c,e);return n.getTime()>=a.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function Jve(t,e){var a,c,u,f;const n=g_(),r=(e==null?void 0:e.firstWeekContainsDate)??((c=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(u=n.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,s=FW(t,e),i=Eo(t,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),Vl(i,e)}function zW(t,e){const n=Qt(t),r=+Vl(n,e)-+Jve(n,e);return Math.round(r/kL)+1}function vn(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const Hu={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return vn(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):vn(n+1,2)},d(t,e){return vn(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return vn(t.getHours()%12||12,e.length)},H(t,e){return vn(t.getHours(),e.length)},m(t,e){return vn(t.getMinutes(),e.length)},s(t,e){return vn(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return vn(s,e.length)}},wm={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wB={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 Hu.y(t,e)},Y:function(t,e,n,r){const s=FW(t,r),i=s>0?s:1-s;if(e==="YY"){const o=i%100;return vn(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):vn(i,e.length)},R:function(t,e){const n=OW(t);return vn(n,e.length)},u:function(t,e){const n=t.getFullYear();return vn(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return vn(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return vn(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return Hu.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return vn(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const s=zW(t,r);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):vn(s,e.length)},I:function(t,e,n){const r=$W(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):vn(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Hu.d(t,e)},D:function(t,e,n){const r=Zve(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):vn(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return vn(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return vn(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),s=r===0?7:r;switch(e){case"i":return String(s);case"ii":return vn(s,e.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const s=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let s;switch(r===12?s=wm.noon:r===0?s=wm.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=wm.evening:r>=12?s=wm.afternoon:r>=4?s=wm.morning:s=wm.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 Hu.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Hu.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):vn(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):vn(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Hu.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Hu.s(t,e)},S:function(t,e){return Hu.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return SB(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 SB(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"+_B(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"+_B(r,":");case"zzzz":default:return"GMT"+Hf(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return vn(r,e.length)},T:function(t,e,n){const r=t.getTime();return vn(r,e.length)}};function _B(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=Math.trunc(r/60),i=r%60;return i===0?n+String(s):n+String(s)+e+vn(i,2)}function SB(t,e){return t%60===0?(t>0?"-":"+")+vn(Math.abs(t)/60,2):Hf(t,e)}function Hf(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=vn(Math.trunc(r/60),2),i=vn(r%60,2);return n+s+e+i}const CB=(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"})}},BW=(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"})}},eye=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return CB(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}}",CB(r,e)).replace("{{time}}",BW(s,e))},tye={p:BW,P:eye},nye=/^D+$/,rye=/^Y+$/,sye=["D","DD","YY","YYYY"];function iye(t){return nye.test(t)}function oye(t){return rye.test(t)}function aye(t,e,n){const r=lye(t,e,n);if(console.warn(r),sye.includes(t))throw new RangeError(r)}function lye(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 cye=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,uye=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,dye=/^'([^]*?)'?$/,fye=/''/g,hye=/[a-zA-Z]/;function Fp(t,e,n){var f,l,d,p,h,m,y,g;const r=g_(),s=(n==null?void 0:n.locale)??r.locale??LW,i=(n==null?void 0:n.firstWeekContainsDate)??((l=(f=n==null?void 0:n.locale)==null?void 0:f.options)==null?void 0:l.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(d=r.locale)==null?void 0:d.options)==null?void 0:p.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((m=(h=n==null?void 0:n.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??r.weekStartsOn??((g=(y=r.locale)==null?void 0:y.options)==null?void 0:g.weekStartsOn)??0,a=Qt(t);if(!yve(a))throw new RangeError("Invalid time value");let c=e.match(uye).map(v=>{const x=v[0];if(x==="p"||x==="P"){const _=tye[x];return _(v,s.formatLong)}return v}).join("").match(cye).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const x=v[0];if(x==="'")return{isToken:!1,value:pye(v)};if(wB[x])return{isToken:!0,value:v};if(x.match(hye))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:v}});s.localize.preprocessor&&(c=s.localize.preprocessor(a,c));const u={firstWeekContainsDate:i,weekStartsOn:o,locale:s};return c.map(v=>{if(!v.isToken)return v.value;const x=v.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&oye(x)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&iye(x))&&aye(x,e,String(t));const _=wB[x[0]];return _(a,x,s.localize,u)}).join("")}function pye(t){const e=t.match(dye);return e?e[1].replace(fye,"'"):t}function mye(t){const e=Qt(t),n=e.getFullYear(),r=e.getMonth(),s=Eo(t,0);return s.setFullYear(n,r+1,0),s.setHours(0,0,0,0),s.getDate()}function gye(t){return Math.trunc(+Qt(t)/1e3)}function vye(t){const e=Qt(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(0,0,0,0),e}function yye(t,e){return bve(vye(t),zi(t),e)+1}function DM(t,e){const n=Qt(t),r=Qt(e);return n.getTime()>r.getTime()}function UW(t,e){const n=Qt(t),r=Qt(e);return+n<+r}function IL(t,e){const n=Qt(t),r=Qt(e);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function bye(t,e){const n=Qt(t),r=Qt(e);return n.getFullYear()===r.getFullYear()}function GT(t,e){return ti(t,-e)}function KT(t,e){const n=Qt(t),r=n.getFullYear(),s=n.getDate(),i=Eo(t,0);i.setFullYear(r,e,15),i.setHours(0,0,0,0);const o=mye(i);return n.setMonth(e,Math.min(s,o)),n}function EB(t,e){const n=Qt(t);return isNaN(+n)?Eo(t,NaN):(n.setFullYear(e),n)}var pt=function(){return pt=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},pt.apply(this,arguments)};function xye(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 HW(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 v_(t){return t.mode==="multiple"}function y_(t){return t.mode==="range"}function vR(t){return t.mode==="single"}var wye={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 _ye(t,e){return Fp(t,"LLLL y",e)}function Sye(t,e){return Fp(t,"d",e)}function Cye(t,e){return Fp(t,"LLLL",e)}function Eye(t){return"".concat(t)}function Aye(t,e){return Fp(t,"cccccc",e)}function Rye(t,e){return Fp(t,"yyyy",e)}var Nye=Object.freeze({__proto__:null,formatCaption:_ye,formatDay:Sye,formatMonthCaption:Cye,formatWeekNumber:Eye,formatWeekdayName:Aye,formatYearCaption:Rye}),Pye=function(t,e,n){return Fp(t,"do MMMM (EEEE)",n)},Tye=function(){return"Month: "},kye=function(){return"Go to next month"},Dye=function(){return"Go to previous month"},Mye=function(t,e){return Fp(t,"cccc",e)},Oye=function(t){return"Week n. ".concat(t)},Iye=function(){return"Year: "},jye=Object.freeze({__proto__:null,labelDay:Pye,labelMonthDropdown:Tye,labelNext:kye,labelPrevious:Dye,labelWeekNumber:Oye,labelWeekday:Mye,labelYearDropdown:Iye});function Lye(){var t="buttons",e=wye,n=LW,r={},s={},i=1,o={},a=new Date;return{captionLayout:t,classNames:e,formatters:Nye,labels:jye,locale:n,modifiersClassNames:r,modifiers:s,numberOfMonths:i,styles:o,today:a,mode:"default"}}function $ye(t){var e=t.fromYear,n=t.toYear,r=t.fromMonth,s=t.toMonth,i=t.fromDate,o=t.toDate;return r?i=zi(r):e&&(i=new Date(e,0,1)),s?o=ML(s):n&&(o=new Date(n,11,31)),{fromDate:i?Vv(i):void 0,toDate:o?Vv(o):void 0}}var VW=S.createContext(void 0);function Fye(t){var e,n=t.initialProps,r=Lye(),s=$ye(n),i=s.fromDate,o=s.toDate,a=(e=n.captionLayout)!==null&&e!==void 0?e:r.captionLayout;a!=="buttons"&&(!i||!o)&&(a="buttons");var c;(vR(n)||v_(n)||y_(n))&&(c=n.onSelect);var u=pt(pt(pt({},r),n),{captionLayout:a,classNames:pt(pt({},r.classNames),n.classNames),components:pt({},n.components),formatters:pt(pt({},r.formatters),n.formatters),fromDate:i,labels:pt(pt({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:pt(pt({},r.modifiers),n.modifiers),modifiersClassNames:pt(pt({},r.modifiersClassNames),n.modifiersClassNames),onSelect:c,styles:pt(pt({},r.styles),n.styles),toDate:o});return b.jsx(VW.Provider,{value:u,children:t.children})}function Bn(){var t=S.useContext(VW);if(!t)throw new Error("useDayPicker must be used within a DayPickerProvider.");return t}function qW(t){var e=Bn(),n=e.locale,r=e.classNames,s=e.styles,i=e.formatters.formatCaption;return b.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 zye(t){return b.jsx("svg",pt({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},t,{children:b.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 WW(t){var e,n,r=t.onChange,s=t.value,i=t.children,o=t.caption,a=t.className,c=t.style,u=Bn(),f=(n=(e=u.components)===null||e===void 0?void 0:e.IconDropdown)!==null&&n!==void 0?n:zye;return b.jsxs("div",{className:a,style:c,children:[b.jsx("span",{className:u.classNames.vhidden,children:t["aria-label"]}),b.jsx("select",{name:t.name,"aria-label":t["aria-label"],className:u.classNames.dropdown,style:u.styles.dropdown,value:s,onChange:r,children:i}),b.jsxs("div",{className:u.classNames.caption_label,style:u.styles.caption_label,"aria-hidden":"true",children:[o,b.jsx(f,{className:u.classNames.dropdown_icon,style:u.styles.dropdown_icon})]})]})}function Bye(t){var e,n=Bn(),r=n.fromDate,s=n.toDate,i=n.styles,o=n.locale,a=n.formatters.formatMonthCaption,c=n.classNames,u=n.components,f=n.labels.labelMonthDropdown;if(!r)return b.jsx(b.Fragment,{});if(!s)return b.jsx(b.Fragment,{});var l=[];if(bye(r,s))for(var d=zi(r),p=r.getMonth();p<=s.getMonth();p++)l.push(KT(d,p));else for(var d=zi(new Date),p=0;p<=11;p++)l.push(KT(d,p));var h=function(y){var g=Number(y.target.value),v=KT(zi(t.displayMonth),g);t.onChange(v)},m=(e=u==null?void 0:u.Dropdown)!==null&&e!==void 0?e:WW;return b.jsx(m,{name:"months","aria-label":f(),className:c.dropdown_month,style:i.dropdown_month,onChange:h,value:t.displayMonth.getMonth(),caption:a(t.displayMonth,{locale:o}),children:l.map(function(y){return b.jsx("option",{value:y.getMonth(),children:a(y,{locale:o})},y.getMonth())})})}function Uye(t){var e,n=t.displayMonth,r=Bn(),s=r.fromDate,i=r.toDate,o=r.locale,a=r.styles,c=r.classNames,u=r.components,f=r.formatters.formatYearCaption,l=r.labels.labelYearDropdown,d=[];if(!s)return b.jsx(b.Fragment,{});if(!i)return b.jsx(b.Fragment,{});for(var p=s.getFullYear(),h=i.getFullYear(),m=p;m<=h;m++)d.push(EB(IW(new Date),m));var y=function(v){var x=EB(zi(n),Number(v.target.value));t.onChange(x)},g=(e=u==null?void 0:u.Dropdown)!==null&&e!==void 0?e:WW;return b.jsx(g,{name:"years","aria-label":l(),className:c.dropdown_year,style:a.dropdown_year,onChange:y,value:n.getFullYear(),caption:f(n,{locale:o}),children:d.map(function(v){return b.jsx("option",{value:v.getFullYear(),children:f(v,{locale:o})},v.getFullYear())})})}function Hye(t,e){var n=S.useState(t),r=n[0],s=n[1],i=e===void 0?r:e;return[i,s]}function Vye(t){var e=t.month,n=t.defaultMonth,r=t.today,s=e||n||r||new Date,i=t.toDate,o=t.fromDate,a=t.numberOfMonths,c=a===void 0?1:a;if(i&&ex(i,s)<0){var u=-1*(c-1);s=Ya(i,u)}return o&&ex(s,o)<0&&(s=o),zi(s)}function qye(){var t=Bn(),e=Vye(t),n=Hye(e,t.month),r=n[0],s=n[1],i=function(o){var a;if(!t.disableNavigation){var c=zi(o);s(c),(a=t.onMonthChange)===null||a===void 0||a.call(t,c)}};return[r,i]}function Wye(t,e){for(var n=e.reverseMonths,r=e.numberOfMonths,s=zi(t),i=zi(Ya(s,r)),o=ex(i,s),a=[],c=0;c<o;c++){var u=Ya(s,c);a.push(u)}return n&&(a=a.reverse()),a}function Gye(t,e){if(!e.disableNavigation){var n=e.toDate,r=e.pagedNavigation,s=e.numberOfMonths,i=s===void 0?1:s,o=r?i:1,a=zi(t);if(!n)return Ya(a,o);var c=ex(n,t);if(!(c<i))return Ya(a,o)}}function Kye(t,e){if(!e.disableNavigation){var n=e.fromDate,r=e.pagedNavigation,s=e.numberOfMonths,i=s===void 0?1:s,o=r?i:1,a=zi(t);if(!n)return Ya(a,-o);var c=ex(a,n);if(!(c<=0))return Ya(a,-o)}}var GW=S.createContext(void 0);function Yye(t){var e=Bn(),n=qye(),r=n[0],s=n[1],i=Wye(r,e),o=Gye(r,e),a=Kye(r,e),c=function(l){return i.some(function(d){return IL(l,d)})},u=function(l,d){c(l)||(d&&UW(l,d)?s(Ya(l,1+e.numberOfMonths*-1)):s(l))},f={currentMonth:r,displayMonths:i,goToMonth:s,goToDate:u,previousMonth:a,nextMonth:o,isDateDisplayed:c};return b.jsx(GW.Provider,{value:f,children:t.children})}function b_(){var t=S.useContext(GW);if(!t)throw new Error("useNavigation must be used within a NavigationProvider");return t}function AB(t){var e,n=Bn(),r=n.classNames,s=n.styles,i=n.components,o=b_().goToMonth,a=function(f){o(Ya(f,t.displayIndex?-t.displayIndex:0))},c=(e=i==null?void 0:i.CaptionLabel)!==null&&e!==void 0?e:qW,u=b.jsx(c,{id:t.id,displayMonth:t.displayMonth});return b.jsxs("div",{className:r.caption_dropdowns,style:s.caption_dropdowns,children:[b.jsx("div",{className:r.vhidden,children:u}),b.jsx(Bye,{onChange:a,displayMonth:t.displayMonth}),b.jsx(Uye,{onChange:a,displayMonth:t.displayMonth})]})}function Xye(t){return b.jsx("svg",pt({width:"16px",height:"16px",viewBox:"0 0 120 120"},t,{children:b.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 Qye(t){return b.jsx("svg",pt({width:"16px",height:"16px",viewBox:"0 0 120 120"},t,{children:b.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 bE=S.forwardRef(function(t,e){var n=Bn(),r=n.classNames,s=n.styles,i=[r.button_reset,r.button];t.className&&i.push(t.className);var o=i.join(" "),a=pt(pt({},s.button_reset),s.button);return t.style&&Object.assign(a,t.style),b.jsx("button",pt({},t,{ref:e,type:"button",className:o,style:a}))});function Zye(t){var e,n,r=Bn(),s=r.dir,i=r.locale,o=r.classNames,a=r.styles,c=r.labels,u=c.labelPrevious,f=c.labelNext,l=r.components;if(!t.nextMonth&&!t.previousMonth)return b.jsx(b.Fragment,{});var d=u(t.previousMonth,{locale:i}),p=[o.nav_button,o.nav_button_previous].join(" "),h=f(t.nextMonth,{locale:i}),m=[o.nav_button,o.nav_button_next].join(" "),y=(e=l==null?void 0:l.IconRight)!==null&&e!==void 0?e:Qye,g=(n=l==null?void 0:l.IconLeft)!==null&&n!==void 0?n:Xye;return b.jsxs("div",{className:o.nav,style:a.nav,children:[!t.hidePrevious&&b.jsx(bE,{name:"previous-month","aria-label":d,className:p,style:a.nav_button_previous,disabled:!t.previousMonth,onClick:t.onPreviousClick,children:s==="rtl"?b.jsx(y,{className:o.nav_icon,style:a.nav_icon}):b.jsx(g,{className:o.nav_icon,style:a.nav_icon})}),!t.hideNext&&b.jsx(bE,{name:"next-month","aria-label":h,className:m,style:a.nav_button_next,disabled:!t.nextMonth,onClick:t.onNextClick,children:s==="rtl"?b.jsx(g,{className:o.nav_icon,style:a.nav_icon}):b.jsx(y,{className:o.nav_icon,style:a.nav_icon})})]})}function RB(t){var e=Bn().numberOfMonths,n=b_(),r=n.previousMonth,s=n.nextMonth,i=n.goToMonth,o=n.displayMonths,a=o.findIndex(function(h){return IL(t.displayMonth,h)}),c=a===0,u=a===o.length-1,f=e>1&&(c||!u),l=e>1&&(u||!c),d=function(){r&&i(r)},p=function(){s&&i(s)};return b.jsx(Zye,{displayMonth:t.displayMonth,hideNext:f,hidePrevious:l,nextMonth:s,previousMonth:r,onPreviousClick:d,onNextClick:p})}function Jye(t){var e,n=Bn(),r=n.classNames,s=n.disableNavigation,i=n.styles,o=n.captionLayout,a=n.components,c=(e=a==null?void 0:a.CaptionLabel)!==null&&e!==void 0?e:qW,u;return s?u=b.jsx(c,{id:t.id,displayMonth:t.displayMonth}):o==="dropdown"?u=b.jsx(AB,{displayMonth:t.displayMonth,id:t.id}):o==="dropdown-buttons"?u=b.jsxs(b.Fragment,{children:[b.jsx(AB,{displayMonth:t.displayMonth,displayIndex:t.displayIndex,id:t.id}),b.jsx(RB,{displayMonth:t.displayMonth,displayIndex:t.displayIndex,id:t.id})]}):u=b.jsxs(b.Fragment,{children:[b.jsx(c,{id:t.id,displayMonth:t.displayMonth,displayIndex:t.displayIndex}),b.jsx(RB,{displayMonth:t.displayMonth,id:t.id})]}),b.jsx("div",{className:r.caption,style:i.caption,children:u})}function ebe(t){var e=Bn(),n=e.footer,r=e.styles,s=e.classNames.tfoot;return n?b.jsx("tfoot",{className:s,style:r.tfoot,children:b.jsx("tr",{children:b.jsx("td",{colSpan:8,children:n})})}):b.jsx(b.Fragment,{})}function tbe(t,e,n){for(var r=n?wp(new Date):Vl(new Date,{locale:t,weekStartsOn:e}),s=[],i=0;i<7;i++){var o=ti(r,i);s.push(o)}return s}function nbe(){var t=Bn(),e=t.classNames,n=t.styles,r=t.showWeekNumber,s=t.locale,i=t.weekStartsOn,o=t.ISOWeek,a=t.formatters.formatWeekdayName,c=t.labels.labelWeekday,u=tbe(s,i,o);return b.jsxs("tr",{style:n.head_row,className:e.head_row,children:[r&&b.jsx("td",{style:n.head_cell,className:e.head_cell}),u.map(function(f,l){return b.jsx("th",{scope:"col",className:e.head_cell,style:n.head_cell,"aria-label":c(f,{locale:s}),children:a(f,{locale:s})},l)})]})}function rbe(){var t,e=Bn(),n=e.classNames,r=e.styles,s=e.components,i=(t=s==null?void 0:s.HeadRow)!==null&&t!==void 0?t:nbe;return b.jsx("thead",{style:r.head,className:n.head,children:b.jsx(i,{})})}function sbe(t){var e=Bn(),n=e.locale,r=e.formatters.formatDay;return b.jsx(b.Fragment,{children:r(t.date,{locale:n})})}var jL=S.createContext(void 0);function ibe(t){if(!v_(t.initialProps)){var e={selected:void 0,modifiers:{disabled:[]}};return b.jsx(jL.Provider,{value:e,children:t.children})}return b.jsx(obe,{initialProps:t.initialProps,children:t.children})}function obe(t){var e=t.initialProps,n=t.children,r=e.selected,s=e.min,i=e.max,o=function(u,f,l){var d,p;(d=e.onDayClick)===null||d===void 0||d.call(e,u,f,l);var h=!!(f.selected&&s&&(r==null?void 0:r.length)===s);if(!h){var m=!!(!f.selected&&i&&(r==null?void 0:r.length)===i);if(!m){var y=r?HW([],r):[];if(f.selected){var g=y.findIndex(function(v){return Di(u,v)});y.splice(g,1)}else y.push(u);(p=e.onSelect)===null||p===void 0||p.call(e,y,u,f,l)}}},a={disabled:[]};r&&a.disabled.push(function(u){var f=i&&r.length>i-1,l=r.some(function(d){return Di(d,u)});return!!(f&&!l)});var c={selected:r,onDayClick:o,modifiers:a};return b.jsx(jL.Provider,{value:c,children:n})}function LL(){var t=S.useContext(jL);if(!t)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return t}function abe(t,e){var n=e||{},r=n.from,s=n.to;return r&&s?Di(s,t)&&Di(r,t)?void 0:Di(s,t)?{from:s,to:void 0}:Di(r,t)?void 0:DM(r,t)?{from:t,to:s}:{from:r,to:t}:s?DM(t,s)?{from:s,to:t}:{from:t,to:s}:r?UW(t,r)?{from:t,to:r}:{from:r,to:t}:{from:t,to:void 0}}var $L=S.createContext(void 0);function lbe(t){if(!y_(t.initialProps)){var e={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return b.jsx($L.Provider,{value:e,children:t.children})}return b.jsx(cbe,{initialProps:t.initialProps,children:t.children})}function cbe(t){var e=t.initialProps,n=t.children,r=e.selected,s=r||{},i=s.from,o=s.to,a=e.min,c=e.max,u=function(p,h,m){var y,g;(y=e.onDayClick)===null||y===void 0||y.call(e,p,h,m);var v=abe(p,r);(g=e.onSelect)===null||g===void 0||g.call(e,v,p,h,m)},f={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(f.range_start=[i],o?(f.range_end=[o],Di(i,o)||(f.range_middle=[{after:i,before:o}])):f.range_end=[i]):o&&(f.range_start=[o],f.range_end=[o]),a&&(i&&!o&&f.disabled.push({after:GT(i,a-1),before:ti(i,a-1)}),i&&o&&f.disabled.push({after:i,before:ti(i,a-1)}),!i&&o&&f.disabled.push({after:GT(o,a-1),before:ti(o,a-1)})),c){if(i&&!o&&(f.disabled.push({before:ti(i,-c+1)}),f.disabled.push({after:ti(i,c-1)})),i&&o){var l=Il(o,i)+1,d=c-l;f.disabled.push({before:GT(i,d)}),f.disabled.push({after:ti(o,d)})}!i&&o&&(f.disabled.push({before:ti(o,-c+1)}),f.disabled.push({after:ti(o,c-1)}))}return b.jsx($L.Provider,{value:{selected:r,onDayClick:u,modifiers:f},children:n})}function FL(){var t=S.useContext($L);if(!t)throw new Error("useSelectRange must be used within a SelectRangeProvider");return t}function sC(t){return Array.isArray(t)?HW([],t):t!==void 0?[t]:[]}function ube(t){var e={};return Object.entries(t).forEach(function(n){var r=n[0],s=n[1];e[r]=sC(s)}),e}var Xa;(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"})(Xa||(Xa={}));var dbe=Xa.Selected,pc=Xa.Disabled,fbe=Xa.Hidden,hbe=Xa.Today,YT=Xa.RangeEnd,XT=Xa.RangeMiddle,QT=Xa.RangeStart,pbe=Xa.Outside;function mbe(t,e,n){var r,s=(r={},r[dbe]=sC(t.selected),r[pc]=sC(t.disabled),r[fbe]=sC(t.hidden),r[hbe]=[t.today],r[YT]=[],r[XT]=[],r[QT]=[],r[pbe]=[],r);return t.fromDate&&s[pc].push({before:t.fromDate}),t.toDate&&s[pc].push({after:t.toDate}),v_(t)?s[pc]=s[pc].concat(e.modifiers[pc]):y_(t)&&(s[pc]=s[pc].concat(n.modifiers[pc]),s[QT]=n.modifiers[QT],s[XT]=n.modifiers[XT],s[YT]=n.modifiers[YT]),s}var KW=S.createContext(void 0);function gbe(t){var e=Bn(),n=LL(),r=FL(),s=mbe(e,n,r),i=ube(e.modifiers),o=pt(pt({},s),i);return b.jsx(KW.Provider,{value:o,children:t.children})}function YW(){var t=S.useContext(KW);if(!t)throw new Error("useModifiers must be used within a ModifiersProvider");return t}function vbe(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function ybe(t){return!!(t&&typeof t=="object"&&"from"in t)}function bbe(t){return!!(t&&typeof t=="object"&&"after"in t)}function xbe(t){return!!(t&&typeof t=="object"&&"before"in t)}function wbe(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function _be(t,e){var n,r=e.from,s=e.to;if(r&&s){var i=Il(s,r)<0;i&&(n=[s,r],r=n[0],s=n[1]);var o=Il(t,r)>=0&&Il(s,t)>=0;return o}return s?Di(s,t):r?Di(r,t):!1}function Sbe(t){return DL(t)}function Cbe(t){return Array.isArray(t)&&t.every(DL)}function Ebe(t,e){return e.some(function(n){if(typeof n=="boolean")return n;if(Sbe(n))return Di(t,n);if(Cbe(n))return n.includes(t);if(ybe(n))return _be(t,n);if(wbe(n))return n.dayOfWeek.includes(t.getDay());if(vbe(n)){var r=Il(n.before,t),s=Il(n.after,t),i=r>0,o=s<0,a=DM(n.before,n.after);return a?o&&i:i||o}return bbe(n)?Il(t,n.after)>0:xbe(n)?Il(n.before,t)>0:typeof n=="function"?n(t):!1})}function zL(t,e,n){var r=Object.keys(e).reduce(function(i,o){var a=e[o];return Ebe(t,a)&&i.push(o),i},[]),s={};return r.forEach(function(i){return s[i]=!0}),n&&!IL(t,n)&&(s.outside=!0),s}function Abe(t,e){for(var n=zi(t[0]),r=ML(t[t.length-1]),s,i,o=n;o<=r;){var a=zL(o,e),c=!a.disabled&&!a.hidden;if(!c){o=ti(o,1);continue}if(a.selected)return o;a.today&&!i&&(i=o),s||(s=o),o=ti(o,1)}return i||s}var Rbe=365;function XW(t,e){var n=e.moveBy,r=e.direction,s=e.context,i=e.modifiers,o=e.retry,a=o===void 0?{count:0,lastFocused:t}:o,c=s.weekStartsOn,u=s.fromDate,f=s.toDate,l=s.locale,d={day:ti,week:kM,month:Ya,year:mve,startOfWeek:function(y){return s.ISOWeek?wp(y):Vl(y,{locale:l,weekStartsOn:c})},endOfWeek:function(y){return s.ISOWeek?jW(y):OL(y,{locale:l,weekStartsOn:c})}},p=d[n](t,r==="after"?1:-1);r==="before"&&u?p=gve([u,p]):r==="after"&&f&&(p=vve([f,p]));var h=!0;if(i){var m=zL(p,i);h=!m.disabled&&!m.hidden}return h?p:a.count>Rbe?a.lastFocused:XW(p,{moveBy:n,direction:r,context:s,modifiers:i,retry:pt(pt({},a),{count:a.count+1})})}var QW=S.createContext(void 0);function Nbe(t){var e=b_(),n=YW(),r=S.useState(),s=r[0],i=r[1],o=S.useState(),a=o[0],c=o[1],u=Abe(e.displayMonths,n),f=s??(a&&e.isDateDisplayed(a))?a:u,l=function(){c(s),i(void 0)},d=function(y){i(y)},p=Bn(),h=function(y,g){if(s){var v=XW(s,{moveBy:y,direction:g,context:p,modifiers:n});Di(s,v)||(e.goToDate(v,s),d(v))}},m={focusedDay:s,focusTarget:f,blur:l,focus:d,focusDayAfter:function(){return h("day","after")},focusDayBefore:function(){return h("day","before")},focusWeekAfter:function(){return h("week","after")},focusWeekBefore:function(){return h("week","before")},focusMonthBefore:function(){return h("month","before")},focusMonthAfter:function(){return h("month","after")},focusYearBefore:function(){return h("year","before")},focusYearAfter:function(){return h("year","after")},focusStartOfWeek:function(){return h("startOfWeek","before")},focusEndOfWeek:function(){return h("endOfWeek","after")}};return b.jsx(QW.Provider,{value:m,children:t.children})}function BL(){var t=S.useContext(QW);if(!t)throw new Error("useFocusContext must be used within a FocusProvider");return t}function Pbe(t,e){var n=YW(),r=zL(t,n,e);return r}var UL=S.createContext(void 0);function Tbe(t){if(!vR(t.initialProps)){var e={selected:void 0};return b.jsx(UL.Provider,{value:e,children:t.children})}return b.jsx(kbe,{initialProps:t.initialProps,children:t.children})}function kbe(t){var e=t.initialProps,n=t.children,r=function(i,o,a){var c,u,f;if((c=e.onDayClick)===null||c===void 0||c.call(e,i,o,a),o.selected&&!e.required){(u=e.onSelect)===null||u===void 0||u.call(e,void 0,i,o,a);return}(f=e.onSelect)===null||f===void 0||f.call(e,i,i,o,a)},s={selected:e.selected,onDayClick:r};return b.jsx(UL.Provider,{value:s,children:n})}function ZW(){var t=S.useContext(UL);if(!t)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return t}function Dbe(t,e){var n=Bn(),r=ZW(),s=LL(),i=FL(),o=BL(),a=o.focusDayAfter,c=o.focusDayBefore,u=o.focusWeekAfter,f=o.focusWeekBefore,l=o.blur,d=o.focus,p=o.focusMonthBefore,h=o.focusMonthAfter,m=o.focusYearBefore,y=o.focusYearAfter,g=o.focusStartOfWeek,v=o.focusEndOfWeek,x=function(V){var U,Q,ne,X;vR(n)?(U=r.onDayClick)===null||U===void 0||U.call(r,t,e,V):v_(n)?(Q=s.onDayClick)===null||Q===void 0||Q.call(s,t,e,V):y_(n)?(ne=i.onDayClick)===null||ne===void 0||ne.call(i,t,e,V):(X=n.onDayClick)===null||X===void 0||X.call(n,t,e,V)},_=function(V){var U;d(t),(U=n.onDayFocus)===null||U===void 0||U.call(n,t,e,V)},A=function(V){var U;l(),(U=n.onDayBlur)===null||U===void 0||U.call(n,t,e,V)},N=function(V){var U;(U=n.onDayMouseEnter)===null||U===void 0||U.call(n,t,e,V)},T=function(V){var U;(U=n.onDayMouseLeave)===null||U===void 0||U.call(n,t,e,V)},E=function(V){var U;(U=n.onDayPointerEnter)===null||U===void 0||U.call(n,t,e,V)},P=function(V){var U;(U=n.onDayPointerLeave)===null||U===void 0||U.call(n,t,e,V)},k=function(V){var U;(U=n.onDayTouchCancel)===null||U===void 0||U.call(n,t,e,V)},M=function(V){var U;(U=n.onDayTouchEnd)===null||U===void 0||U.call(n,t,e,V)},I=function(V){var U;(U=n.onDayTouchMove)===null||U===void 0||U.call(n,t,e,V)},j=function(V){var U;(U=n.onDayTouchStart)===null||U===void 0||U.call(n,t,e,V)},L=function(V){var U;(U=n.onDayKeyUp)===null||U===void 0||U.call(n,t,e,V)},H=function(V){var U;switch(V.key){case"ArrowLeft":V.preventDefault(),V.stopPropagation(),n.dir==="rtl"?a():c();break;case"ArrowRight":V.preventDefault(),V.stopPropagation(),n.dir==="rtl"?c():a();break;case"ArrowDown":V.preventDefault(),V.stopPropagation(),u();break;case"ArrowUp":V.preventDefault(),V.stopPropagation(),f();break;case"PageUp":V.preventDefault(),V.stopPropagation(),V.shiftKey?m():p();break;case"PageDown":V.preventDefault(),V.stopPropagation(),V.shiftKey?y():h();break;case"Home":V.preventDefault(),V.stopPropagation(),g();break;case"End":V.preventDefault(),V.stopPropagation(),v();break}(U=n.onDayKeyDown)===null||U===void 0||U.call(n,t,e,V)},K={onClick:x,onFocus:_,onBlur:A,onKeyDown:H,onKeyUp:L,onMouseEnter:N,onMouseLeave:T,onPointerEnter:E,onPointerLeave:P,onTouchCancel:k,onTouchEnd:M,onTouchMove:I,onTouchStart:j};return K}function Mbe(){var t=Bn(),e=ZW(),n=LL(),r=FL(),s=vR(t)?e.selected:v_(t)?n.selected:y_(t)?r.selected:void 0;return s}function Obe(t){return Object.values(Xa).includes(t)}function Ibe(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(Obe(r)){var i=t.classNames["day_".concat(r)];i&&n.push(i)}}),n}function jbe(t,e){var n=pt({},t.styles.day);return Object.keys(e).forEach(function(r){var s;n=pt(pt({},n),(s=t.modifiersStyles)===null||s===void 0?void 0:s[r])}),n}function Lbe(t,e,n){var r,s,i,o=Bn(),a=BL(),c=Pbe(t,e),u=Dbe(t,c),f=Mbe(),l=!!(o.onDayClick||o.mode!=="default");S.useEffect(function(){var N;c.outside||a.focusedDay&&l&&Di(a.focusedDay,t)&&((N=n.current)===null||N===void 0||N.focus())},[a.focusedDay,t,n,l,c.outside]);var d=Ibe(o,c).join(" "),p=jbe(o,c),h=!!(c.outside&&!o.showOutsideDays||c.hidden),m=(i=(s=o.components)===null||s===void 0?void 0:s.DayContent)!==null&&i!==void 0?i:sbe,y=b.jsx(m,{date:t,displayMonth:e,activeModifiers:c}),g={style:p,className:d,children:y,role:"gridcell"},v=a.focusTarget&&Di(a.focusTarget,t)&&!c.outside,x=a.focusedDay&&Di(a.focusedDay,t),_=pt(pt(pt({},g),(r={disabled:c.disabled,role:"gridcell"},r["aria-selected"]=c.selected,r.tabIndex=x||v?0:-1,r)),u),A={isButton:l,isHidden:h,activeModifiers:c,selectedDays:f,buttonProps:_,divProps:g};return A}function $be(t){var e=S.useRef(null),n=Lbe(t.date,t.displayMonth,e);return n.isHidden?b.jsx("div",{role:"gridcell"}):n.isButton?b.jsx(bE,pt({name:"day",ref:e},n.buttonProps)):b.jsx("div",pt({},n.divProps))}function Fbe(t){var e=t.number,n=t.dates,r=Bn(),s=r.onWeekNumberClick,i=r.styles,o=r.classNames,a=r.locale,c=r.labels.labelWeekNumber,u=r.formatters.formatWeekNumber,f=u(Number(e),{locale:a});if(!s)return b.jsx("span",{className:o.weeknumber,style:i.weeknumber,children:f});var l=c(Number(e),{locale:a}),d=function(p){s(e,n,p)};return b.jsx(bE,{name:"week-number","aria-label":l,className:o.weeknumber,style:i.weeknumber,onClick:d,children:f})}function zbe(t){var e,n,r=Bn(),s=r.styles,i=r.classNames,o=r.showWeekNumber,a=r.components,c=(e=a==null?void 0:a.Day)!==null&&e!==void 0?e:$be,u=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:Fbe,f;return o&&(f=b.jsx("td",{className:i.cell,style:s.cell,children:b.jsx(u,{number:t.weekNumber,dates:t.dates})})),b.jsxs("tr",{className:i.row,style:s.row,children:[f,t.dates.map(function(l){return b.jsx("td",{className:i.cell,style:s.cell,role:"presentation",children:b.jsx(c,{displayMonth:t.displayMonth,date:l})},gye(l))})]})}function NB(t,e,n){for(var r=n!=null&&n.ISOWeek?jW(e):OL(e,n),s=n!=null&&n.ISOWeek?wp(t):Vl(t,n),i=Il(r,s),o=[],a=0;a<=i;a++)o.push(ti(s,a));var c=o.reduce(function(u,f){var l=n!=null&&n.ISOWeek?$W(f):zW(f,n),d=u.find(function(p){return p.weekNumber===l});return d?(d.dates.push(f),u):(u.push({weekNumber:l,dates:[f]}),u)},[]);return c}function Bbe(t,e){var n=NB(zi(t),ML(t),e);if(e!=null&&e.useFixedWeeks){var r=yye(t,e);if(r<6){var s=n[n.length-1],i=s.dates[s.dates.length-1],o=kM(i,6-r),a=NB(kM(i,1),o,e);n.push.apply(n,a)}}return n}function Ube(t){var e,n,r,s=Bn(),i=s.locale,o=s.classNames,a=s.styles,c=s.hideHead,u=s.fixedWeeks,f=s.components,l=s.weekStartsOn,d=s.firstWeekContainsDate,p=s.ISOWeek,h=Bbe(t.displayMonth,{useFixedWeeks:!!u,ISOWeek:p,locale:i,weekStartsOn:l,firstWeekContainsDate:d}),m=(e=f==null?void 0:f.Head)!==null&&e!==void 0?e:rbe,y=(n=f==null?void 0:f.Row)!==null&&n!==void 0?n:zbe,g=(r=f==null?void 0:f.Footer)!==null&&r!==void 0?r:ebe;return b.jsxs("table",{id:t.id,className:o.table,style:a.table,role:"grid","aria-labelledby":t["aria-labelledby"],children:[!c&&b.jsx(m,{}),b.jsx("tbody",{className:o.tbody,style:a.tbody,children:h.map(function(v){return b.jsx(y,{displayMonth:t.displayMonth,dates:v.dates,weekNumber:v.weekNumber},v.weekNumber)})}),b.jsx(g,{displayMonth:t.displayMonth})]})}function Hbe(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var Vbe=Hbe()?S.useLayoutEffect:S.useEffect,ZT=!1,qbe=0;function PB(){return"react-day-picker-".concat(++qbe)}function Wbe(t){var e,n=t??(ZT?PB():null),r=S.useState(n),s=r[0],i=r[1];return Vbe(function(){s===null&&i(PB())},[]),S.useEffect(function(){ZT===!1&&(ZT=!0)},[]),(e=t??s)!==null&&e!==void 0?e:void 0}function Gbe(t){var e,n,r=Bn(),s=r.dir,i=r.classNames,o=r.styles,a=r.components,c=b_().displayMonths,u=Wbe(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=o.month,p=t.displayIndex===0,h=t.displayIndex===c.length-1,m=!p&&!h;s==="rtl"&&(e=[p,h],h=e[0],p=e[1]),p&&(l.push(i.caption_start),d=pt(pt({},d),o.caption_start)),h&&(l.push(i.caption_end),d=pt(pt({},d),o.caption_end)),m&&(l.push(i.caption_between),d=pt(pt({},d),o.caption_between));var y=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:Jye;return b.jsxs("div",{className:l.join(" "),style:d,children:[b.jsx(y,{id:u,displayMonth:t.displayMonth,displayIndex:t.displayIndex}),b.jsx(Ube,{id:f,"aria-labelledby":u,displayMonth:t.displayMonth})]},t.displayIndex)}function Kbe(t){var e=Bn(),n=e.classNames,r=e.styles;return b.jsx("div",{className:n.months,style:r.months,children:t.children})}function Ybe(t){var e,n,r=t.initialProps,s=Bn(),i=BL(),o=b_(),a=S.useState(!1),c=a[0],u=a[1];S.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=pt(pt({},s.styles.root),s.style),d=Object.keys(r).filter(function(h){return h.startsWith("data-")}).reduce(function(h,m){var y;return pt(pt({},h),(y={},y[m]=r[m],y))},{}),p=(n=(e=r.components)===null||e===void 0?void 0:e.Months)!==null&&n!==void 0?n:Kbe;return b.jsx("div",pt({className:f.join(" "),style:l,dir:s.dir,id:s.id,nonce:r.nonce,title:r.title,lang:r.lang},d,{children:b.jsx(p,{children:o.displayMonths.map(function(h,m){return b.jsx(Gbe,{displayIndex:m,displayMonth:h},m)})})}))}function Xbe(t){var e=t.children,n=xye(t,["children"]);return b.jsx(Fye,{initialProps:n,children:b.jsx(Yye,{children:b.jsx(Tbe,{initialProps:n,children:b.jsx(ibe,{initialProps:n,children:b.jsx(lbe,{initialProps:n,children:b.jsx(gbe,{children:b.jsx(Nbe,{children:e})})})})})})})}function Qbe(t){return b.jsx(Xbe,pt({},t,{children:b.jsx(Ybe,{initialProps:t})}))}function JW({className:t,classNames:e,showOutsideDays:n=!0,...r}){return b.jsx(Qbe,{showOutsideDays:n,className:ie("p-3",t),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:ie(J0({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:ie(J0({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:()=>b.jsx(nR,{className:"w-4 h-4"}),IconRight:()=>b.jsx(fy,{className:"w-4 h-4"})},...r})}JW.displayName="Calendar";const xr=S.forwardRef(({className:t,...e},n)=>b.jsx("div",{ref:n,className:ie("rounded-md border bg-card text-card-foreground shadow",t),...e}));xr.displayName="Card";const Ni=S.forwardRef(({className:t,...e},n)=>b.jsx("div",{ref:n,className:ie("flex flex-col space-y-1.5 p-6",t),...e}));Ni.displayName="CardHeader";const ns=S.forwardRef(({className:t,...e},n)=>b.jsx("h3",{ref:n,className:ie("font-semibold leading-none tracking-tight",t),...e}));ns.displayName="CardTitle";const ys=S.forwardRef(({className:t,...e},n)=>b.jsx("p",{ref:n,className:ie("text-sm text-muted-foreground",t),...e}));ys.displayName="CardDescription";const wr=S.forwardRef(({className:t,...e},n)=>b.jsx("div",{ref:n,className:ie("p-6 pt-0",t),...e}));wr.displayName="CardContent";const Yo=S.forwardRef(({className:t,...e},n)=>b.jsx("div",{ref:n,className:ie("flex items-center p-6 pt-0",t),...e}));Yo.displayName="CardFooter";var Zbe=Array.isArray,Jbe=Zbe,e0e=typeof pr=="object"&&pr&&pr.Object===Object&&pr,t0e=e0e,n0e=t0e,r0e=typeof self=="object"&&self&&self.Object===Object&&self,s0e=n0e||r0e||Function("return this")(),yR=s0e,i0e=yR,o0e=i0e.Symbol,HL=o0e,TB=HL,eG=Object.prototype,a0e=eG.hasOwnProperty,l0e=eG.toString,bb=TB?TB.toStringTag:void 0;function c0e(t){var e=a0e.call(t,bb),n=t[bb];try{t[bb]=void 0;var r=!0}catch{}var s=l0e.call(t);return r&&(e?t[bb]=n:delete t[bb]),s}var u0e=c0e,d0e=Object.prototype,f0e=d0e.toString;function h0e(t){return f0e.call(t)}var p0e=h0e,kB=HL,m0e=u0e,g0e=p0e,v0e="[object Null]",y0e="[object Undefined]",DB=kB?kB.toStringTag:void 0;function b0e(t){return t==null?t===void 0?y0e:v0e:DB&&DB in Object(t)?m0e(t):g0e(t)}var VL=b0e;function x0e(t){return t!=null&&typeof t=="object"}var tG=x0e,w0e=VL,_0e=tG,S0e="[object Symbol]";function C0e(t){return typeof t=="symbol"||_0e(t)&&w0e(t)==S0e}var E0e=C0e;function A0e(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var x_=A0e,R0e=VL,N0e=x_,P0e="[object AsyncFunction]",T0e="[object Function]",k0e="[object GeneratorFunction]",D0e="[object Proxy]";function M0e(t){if(!N0e(t))return!1;var e=R0e(t);return e==T0e||e==k0e||e==P0e||e==D0e}var O0e=M0e,I0e=yR,j0e=I0e["__core-js_shared__"],L0e=j0e,JT=L0e,MB=function(){var t=/[^.]+$/.exec(JT&&JT.keys&&JT.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function $0e(t){return!!MB&&MB in t}var F0e=$0e,z0e=Function.prototype,B0e=z0e.toString;function U0e(t){if(t!=null){try{return B0e.call(t)}catch{}try{return t+""}catch{}}return""}var H0e=U0e,V0e=O0e,q0e=F0e,W0e=x_,G0e=H0e,K0e=/[\\^$.*+?()[\]{}|]/g,Y0e=/^\[object .+?Constructor\]$/,X0e=Function.prototype,Q0e=Object.prototype,Z0e=X0e.toString,J0e=Q0e.hasOwnProperty,exe=RegExp("^"+Z0e.call(J0e).replace(K0e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function txe(t){if(!W0e(t)||q0e(t))return!1;var e=V0e(t)?exe:Y0e;return e.test(G0e(t))}var nxe=txe;function rxe(t,e){return t==null?void 0:t[e]}var sxe=rxe,ixe=nxe,oxe=sxe;function axe(t,e){var n=oxe(t,e);return ixe(n)?n:void 0}var nG=axe,lxe=nG,cxe=lxe(Object,"create"),bR=cxe,OB=bR;function uxe(){this.__data__=OB?OB(null):{},this.size=0}var dxe=uxe;function fxe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var hxe=fxe,pxe=bR,mxe="__lodash_hash_undefined__",gxe=Object.prototype,vxe=gxe.hasOwnProperty;function yxe(t){var e=this.__data__;if(pxe){var n=e[t];return n===mxe?void 0:n}return vxe.call(e,t)?e[t]:void 0}var bxe=yxe,xxe=bR,wxe=Object.prototype,_xe=wxe.hasOwnProperty;function Sxe(t){var e=this.__data__;return xxe?e[t]!==void 0:_xe.call(e,t)}var Cxe=Sxe,Exe=bR,Axe="__lodash_hash_undefined__";function Rxe(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Exe&&e===void 0?Axe:e,this}var Nxe=Rxe,Pxe=dxe,Txe=hxe,kxe=bxe,Dxe=Cxe,Mxe=Nxe;function wy(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])}}wy.prototype.clear=Pxe;wy.prototype.delete=Txe;wy.prototype.get=kxe;wy.prototype.has=Dxe;wy.prototype.set=Mxe;var Oxe=wy;function Ixe(){this.__data__=[],this.size=0}var jxe=Ixe;function Lxe(t,e){return t===e||t!==t&&e!==e}var $xe=Lxe,Fxe=$xe;function zxe(t,e){for(var n=t.length;n--;)if(Fxe(t[n][0],e))return n;return-1}var xR=zxe,Bxe=xR,Uxe=Array.prototype,Hxe=Uxe.splice;function Vxe(t){var e=this.__data__,n=Bxe(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():Hxe.call(e,n,1),--this.size,!0}var qxe=Vxe,Wxe=xR;function Gxe(t){var e=this.__data__,n=Wxe(e,t);return n<0?void 0:e[n][1]}var Kxe=Gxe,Yxe=xR;function Xxe(t){return Yxe(this.__data__,t)>-1}var Qxe=Xxe,Zxe=xR;function Jxe(t,e){var n=this.__data__,r=Zxe(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var ewe=Jxe,twe=jxe,nwe=qxe,rwe=Kxe,swe=Qxe,iwe=ewe;function _y(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])}}_y.prototype.clear=twe;_y.prototype.delete=nwe;_y.prototype.get=rwe;_y.prototype.has=swe;_y.prototype.set=iwe;var owe=_y,awe=nG,lwe=yR,cwe=awe(lwe,"Map"),uwe=cwe,IB=Oxe,dwe=owe,fwe=uwe;function hwe(){this.size=0,this.__data__={hash:new IB,map:new(fwe||dwe),string:new IB}}var pwe=hwe;function mwe(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var gwe=mwe,vwe=gwe;function ywe(t,e){var n=t.__data__;return vwe(e)?n[typeof e=="string"?"string":"hash"]:n.map}var wR=ywe,bwe=wR;function xwe(t){var e=bwe(this,t).delete(t);return this.size-=e?1:0,e}var wwe=xwe,_we=wR;function Swe(t){return _we(this,t).get(t)}var Cwe=Swe,Ewe=wR;function Awe(t){return Ewe(this,t).has(t)}var Rwe=Awe,Nwe=wR;function Pwe(t,e){var n=Nwe(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var Twe=Pwe,kwe=pwe,Dwe=wwe,Mwe=Cwe,Owe=Rwe,Iwe=Twe;function Sy(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])}}Sy.prototype.clear=kwe;Sy.prototype.delete=Dwe;Sy.prototype.get=Mwe;Sy.prototype.has=Owe;Sy.prototype.set=Iwe;var jwe=Sy,rG=jwe,Lwe="Expected a function";function qL(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Lwe);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 o=t.apply(this,r);return n.cache=i.set(s,o)||i,o};return n.cache=new(qL.Cache||rG),n}qL.Cache=rG;var $we=qL,Fwe=$we,zwe=500;function Bwe(t){var e=Fwe(t,function(r){return n.size===zwe&&n.clear(),r}),n=e.cache;return e}var Uwe=Bwe,Hwe=Uwe,Vwe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qwe=/\\(\\)?/g;Hwe(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Vwe,function(n,r,s,i){e.push(s?i.replace(qwe,"$1"):r||n)}),e});var jB=HL,LB=jB?jB.prototype:void 0;LB&&LB.toString;var Wwe=VL,Gwe=Jbe,Kwe=tG,Ywe="[object String]";function Xwe(t){return typeof t=="string"||!Gwe(t)&&Kwe(t)&&Wwe(t)==Ywe}var Qwe=Xwe;const Zwe=_u(Qwe);var sG={exports:{}},wn={};/** @license React v16.13.1
|
||
* 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 os=typeof Symbol=="function"&&Symbol.for,WL=os?Symbol.for("react.element"):60103,GL=os?Symbol.for("react.portal"):60106,_R=os?Symbol.for("react.fragment"):60107,SR=os?Symbol.for("react.strict_mode"):60108,CR=os?Symbol.for("react.profiler"):60114,ER=os?Symbol.for("react.provider"):60109,AR=os?Symbol.for("react.context"):60110,KL=os?Symbol.for("react.async_mode"):60111,RR=os?Symbol.for("react.concurrent_mode"):60111,NR=os?Symbol.for("react.forward_ref"):60112,PR=os?Symbol.for("react.suspense"):60113,Jwe=os?Symbol.for("react.suspense_list"):60120,TR=os?Symbol.for("react.memo"):60115,kR=os?Symbol.for("react.lazy"):60116,e_e=os?Symbol.for("react.block"):60121,t_e=os?Symbol.for("react.fundamental"):60117,n_e=os?Symbol.for("react.responder"):60118,r_e=os?Symbol.for("react.scope"):60119;function Po(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case WL:switch(t=t.type,t){case KL:case RR:case _R:case CR:case SR:case PR:return t;default:switch(t=t&&t.$$typeof,t){case AR:case NR:case kR:case TR:case ER:return t;default:return e}}case GL:return e}}}function iG(t){return Po(t)===RR}wn.AsyncMode=KL;wn.ConcurrentMode=RR;wn.ContextConsumer=AR;wn.ContextProvider=ER;wn.Element=WL;wn.ForwardRef=NR;wn.Fragment=_R;wn.Lazy=kR;wn.Memo=TR;wn.Portal=GL;wn.Profiler=CR;wn.StrictMode=SR;wn.Suspense=PR;wn.isAsyncMode=function(t){return iG(t)||Po(t)===KL};wn.isConcurrentMode=iG;wn.isContextConsumer=function(t){return Po(t)===AR};wn.isContextProvider=function(t){return Po(t)===ER};wn.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===WL};wn.isForwardRef=function(t){return Po(t)===NR};wn.isFragment=function(t){return Po(t)===_R};wn.isLazy=function(t){return Po(t)===kR};wn.isMemo=function(t){return Po(t)===TR};wn.isPortal=function(t){return Po(t)===GL};wn.isProfiler=function(t){return Po(t)===CR};wn.isStrictMode=function(t){return Po(t)===SR};wn.isSuspense=function(t){return Po(t)===PR};wn.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===_R||t===RR||t===CR||t===SR||t===PR||t===Jwe||typeof t=="object"&&t!==null&&(t.$$typeof===kR||t.$$typeof===TR||t.$$typeof===ER||t.$$typeof===AR||t.$$typeof===NR||t.$$typeof===t_e||t.$$typeof===n_e||t.$$typeof===r_e||t.$$typeof===e_e)};wn.typeOf=Po;sG.exports=wn;var $B=sG.exports,p1=function(e){return Zwe(e)&&e.indexOf("%")===e.length-1},s_e=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},ek=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]},i_e=yR,o_e=function(){return i_e.Date.now()},a_e=o_e,l_e=/\s/;function c_e(t){for(var e=t.length;e--&&l_e.test(t.charAt(e)););return e}var u_e=c_e,d_e=u_e,f_e=/^\s+/;function h_e(t){return t&&t.slice(0,d_e(t)+1).replace(f_e,"")}var p_e=h_e,m_e=p_e,FB=x_,g_e=E0e,zB=NaN,v_e=/^[-+]0x[0-9a-f]+$/i,y_e=/^0b[01]+$/i,b_e=/^0o[0-7]+$/i,x_e=parseInt;function w_e(t){if(typeof t=="number")return t;if(g_e(t))return zB;if(FB(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=FB(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=m_e(t);var n=y_e.test(t);return n||b_e.test(t)?x_e(t.slice(2),n?2:8):v_e.test(t)?zB:+t}var __e=w_e,S_e=x_,tk=a_e,BB=__e,C_e="Expected a function",E_e=Math.max,A_e=Math.min;function R_e(t,e,n){var r,s,i,o,a,c,u=0,f=!1,l=!1,d=!0;if(typeof t!="function")throw new TypeError(C_e);e=BB(e)||0,S_e(n)&&(f=!!n.leading,l="maxWait"in n,i=l?E_e(BB(n.maxWait)||0,e):i,d="trailing"in n?!!n.trailing:d);function p(N){var T=r,E=s;return r=s=void 0,u=N,o=t.apply(E,T),o}function h(N){return u=N,a=setTimeout(g,e),f?p(N):o}function m(N){var T=N-c,E=N-u,P=e-T;return l?A_e(P,i-E):P}function y(N){var T=N-c,E=N-u;return c===void 0||T>=e||T<0||l&&E>=i}function g(){var N=tk();if(y(N))return v(N);a=setTimeout(g,m(N))}function v(N){return a=void 0,d&&r?p(N):(r=s=void 0,o)}function x(){a!==void 0&&clearTimeout(a),u=0,r=c=s=a=void 0}function _(){return a===void 0?o:v(tk())}function A(){var N=tk(),T=y(N);if(r=arguments,s=this,c=N,T){if(a===void 0)return h(c);if(l)return clearTimeout(a),a=setTimeout(g,e),p(c)}return a===void 0&&(a=setTimeout(g,e)),o}return A.cancel=x,A.flush=_,A}var N_e=R_e,P_e=N_e,T_e=x_,k_e="Expected a function";function D_e(t,e,n){var r=!0,s=!0;if(typeof t!="function")throw new TypeError(k_e);return T_e(n)&&(r="leading"in n?!!n.leading:r,s="trailing"in n?!!n.trailing:s),P_e(t,e,{leading:r,maxWait:e,trailing:s})}var M_e=D_e;const O_e=_u(M_e);function tx(t){"@babel/helpers - typeof";return tx=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},tx(t)}function UB(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 m1(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?UB(Object(n),!0).forEach(function(r){I_e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):UB(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function I_e(t,e,n){return e=j_e(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function j_e(t){var e=L_e(t,"string");return tx(e)=="symbol"?e:String(e)}function L_e(t,e){if(tx(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(tx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $_e(t,e){return U_e(t)||B_e(t,e)||z_e(t,e)||F_e()}function F_e(){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 z_e(t,e){if(t){if(typeof t=="string")return HB(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 HB(t,e)}}function HB(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 B_e(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,s,i,o,a=[],c=!0,u=!1;try{if(i=(n=n.call(t)).next,e!==0)for(;!(c=(r=i.call(n)).done)&&(a.push(r.value),a.length!==e);c=!0);}catch(f){u=!0,s=f}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return a}}function U_e(t){if(Array.isArray(t))return t}var H_e=S.forwardRef(function(t,e){var n=t.aspect,r=t.initialDimension,s=r===void 0?{width:-1,height:-1}:r,i=t.width,o=i===void 0?"100%":i,a=t.height,c=a===void 0?"100%":a,u=t.minWidth,f=u===void 0?0:u,l=t.minHeight,d=t.maxHeight,p=t.children,h=t.debounce,m=h===void 0?0:h,y=t.id,g=t.className,v=t.onResize,x=t.style,_=x===void 0?{}:x,A=S.useRef(null),N=S.useRef();N.current=v,S.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 T=S.useState({containerWidth:s.width,containerHeight:s.height}),E=$_e(T,2),P=E[0],k=E[1],M=S.useCallback(function(j,L){k(function(H){var K=Math.round(j),V=Math.round(L);return H.containerWidth===K&&H.containerHeight===V?H:{containerWidth:K,containerHeight:V}})},[]);S.useEffect(function(){var j=function(Q){var ne,X=Q[0].contentRect,G=X.width,Y=X.height;M(G,Y),(ne=N.current)===null||ne===void 0||ne.call(N,G,Y)};m>0&&(j=O_e(j,m,{trailing:!0,leading:!1}));var L=new ResizeObserver(j),H=A.current.getBoundingClientRect(),K=H.width,V=H.height;return M(K,V),L.observe(A.current),function(){L.disconnect()}},[M,m]);var I=S.useMemo(function(){var j=P.containerWidth,L=P.containerHeight;if(j<0||L<0)return null;ek(p1(o)||p1(c),`The width(%s) and height(%s) are both fixed numbers,
|
||
maybe you don't need to use a ResponsiveContainer.`,o,c),ek(!n||n>0,"The aspect(%s) must be greater than zero.",n);var H=p1(o)?j:o,K=p1(c)?L:c;n&&n>0&&(H?K=H/n:K&&(H=K*n),d&&K>d&&(K=d)),ek(H>0||K>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
||
please check the style of container, or the props width(%s) and height(%s),
|
||
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
||
height and width.`,H,K,o,c,f,l,n);var V=!Array.isArray(p)&&$B.isElement(p)&&s_e(p.type).endsWith("Chart");return oe.Children.map(p,function(U){return $B.isElement(U)?S.cloneElement(U,m1({width:H,height:K},V?{style:m1({height:"100%",width:"100%",maxHeight:K,maxWidth:H},U.props.style)}:{})):U})},[n,p,c,d,l,f,P,o]);return oe.createElement("div",{id:y?"".concat(y):void 0,className:hy("recharts-responsive-container",g),style:m1(m1({},_),{},{width:o,height:c,minWidth:f,minHeight:l,maxHeight:d}),ref:A},I)}),V_e="Invariant failed";function Mn(t,e){if(!t)throw new Error(V_e)}const q_e={light:"",dark:".dark"},oG=S.createContext(null);function aG(){const t=S.useContext(oG);if(!t)throw new Error("useChart must be used within a <ChartContainer />");return t}const W_e=S.forwardRef(({id:t,className:e,children:n,config:r,...s},i)=>{const o=S.useId(),a=`chart-${t||o.replace(/:/g,"")}`;return b.jsx(oG.Provider,{value:{config:r},children:b.jsxs("div",{"data-chart":a,ref:i,className:ie("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",e),...s,children:[b.jsx(G_e,{id:a,config:r}),b.jsx(H_e,{children:n})]})})});W_e.displayName="Chart";const G_e=({id:t,config:e})=>{const n=Object.entries(e).filter(([r,s])=>s.theme||s.color);return n.length?b.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(q_e).map(([r,s])=>`
|
||
${s} [data-chart=${t}] {
|
||
${n.map(([i,o])=>{var c;const a=((c=o.theme)==null?void 0:c[r])||o.color;return a?` --color-${i}: ${a};`:null}).join(`
|
||
`)}
|
||
}
|
||
`).join(`
|
||
`)}}):null},K_e=S.forwardRef(({active:t,payload:e,className:n,indicator:r="dot",hideLabel:s=!1,hideIndicator:i=!1,label:o,labelFormatter:a,labelClassName:c,formatter:u,color:f,nameKey:l,labelKey:d},p)=>{const{config:h}=aG(),m=S.useMemo(()=>{var A;if(s||!(e!=null&&e.length))return null;const[g]=e,v=`${d||g.dataKey||g.name||"value"}`,x=MM(h,g,v),_=!d&&typeof o=="string"?((A=h[o])==null?void 0:A.label)||o:x==null?void 0:x.label;return a?b.jsx("div",{className:ie("font-medium",c),children:a(_,e)}):_?b.jsx("div",{className:ie("font-medium",c),children:_}):null},[o,a,e,s,c,h,d]);if(!t||!(e!=null&&e.length))return null;const y=e.length===1&&r!=="dot";return b.jsxs("div",{ref:p,className:ie("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",n),children:[y?null:m,b.jsx("div",{className:"grid gap-1.5",children:e.map((g,v)=>{const x=`${l||g.name||g.dataKey||"value"}`,_=MM(h,g,x),A=f||g.payload.fill||g.color;return b.jsx("div",{className:ie("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",r==="dot"&&"items-center"),children:u&&(g==null?void 0:g.value)!==void 0&&g.name?u(g.value,g.name,g,v,g.payload):b.jsxs(b.Fragment,{children:[_!=null&&_.icon?b.jsx(_.icon,{}):!i&&b.jsx("div",{className:ie("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":r==="dot","w-1":r==="line","w-0 border-[1.5px] border-dashed bg-transparent":r==="dashed","my-0.5":y&&r==="dashed"}),style:{"--color-bg":A,"--color-border":A}}),b.jsxs("div",{className:ie("flex flex-1 justify-between leading-none",y?"items-end":"items-center"),children:[b.jsxs("div",{className:"grid gap-1.5",children:[y?m:null,b.jsx("span",{className:"text-muted-foreground",children:(_==null?void 0:_.label)||g.name})]}),g.value&&b.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:g.value.toLocaleString()})]})]})},g.dataKey)})})]})});K_e.displayName="ChartTooltip";const Y_e=S.forwardRef(({className:t,hideIcon:e=!1,payload:n,verticalAlign:r="bottom",nameKey:s},i)=>{const{config:o}=aG();return n!=null&&n.length?b.jsx("div",{ref:i,className:ie("flex items-center justify-center gap-4",r==="top"?"pb-3":"pt-3",t),children:n.map(a=>{const c=`${s||a.dataKey||"value"}`,u=MM(o,a,c);return b.jsxs("div",{className:ie("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[u!=null&&u.icon&&!e?b.jsx(u.icon,{}):b.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:a.color}}),u==null?void 0:u.label]},a.value)})}):null});Y_e.displayName="ChartLegend";function MM(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 Cy(t){const e=S.useRef({value:t,previous:t});return S.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function w_(t){const[e,n]=S.useState(void 0);return ir(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,a;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,a=u.blockSize}else o=t.offsetWidth,a=t.offsetHeight;n({width:o,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var YL="Checkbox",[X_e,VUe]=In(YL),[Q_e,Z_e]=X_e(YL),lG=S.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:i,required:o,disabled:a,value:c="on",onCheckedChange:u,...f}=t,[l,d]=S.useState(null),p=et(e,x=>d(x)),h=S.useRef(!1),m=l?!!l.closest("form"):!0,[y=!1,g]=mr({prop:s,defaultProp:i,onChange:u}),v=S.useRef(y);return S.useEffect(()=>{const x=l==null?void 0:l.form;if(x){const _=()=>g(v.current);return x.addEventListener("reset",_),()=>x.removeEventListener("reset",_)}},[l,g]),b.jsxs(Q_e,{scope:n,state:y,disabled:a,children:[b.jsx(De.button,{type:"button",role:"checkbox","aria-checked":up(y)?"mixed":y,"aria-required":o,"data-state":dG(y),"data-disabled":a?"":void 0,disabled:a,value:c,...f,ref:p,onKeyDown:ye(t.onKeyDown,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:ye(t.onClick,x=>{g(_=>up(_)?!0:!_),m&&(h.current=x.isPropagationStopped(),h.current||x.stopPropagation())})}),m&&b.jsx(J_e,{control:l,bubbles:!h.current,name:r,value:c,checked:y,required:o,disabled:a,style:{transform:"translateX(-100%)"}})]})});lG.displayName=YL;var cG="CheckboxIndicator",uG=S.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...s}=t,i=Z_e(cG,n);return b.jsx(Kn,{present:r||up(i.state)||i.state===!0,children:b.jsx(De.span,{"data-state":dG(i.state),"data-disabled":i.disabled?"":void 0,...s,ref:e,style:{pointerEvents:"none",...t.style}})})});uG.displayName=cG;var J_e=t=>{const{control:e,checked:n,bubbles:r=!0,...s}=t,i=S.useRef(null),o=Cy(n),a=w_(e);return S.useEffect(()=>{const c=i.current,u=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(u,"checked").set;if(o!==n&&l){const d=new Event("click",{bubbles:r});c.indeterminate=up(n),l.call(c,up(n)?!1:n),c.dispatchEvent(d)}},[o,n,r]),b.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:up(n)?!1:n,...s,tabIndex:-1,ref:i,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function up(t){return t==="indeterminate"}function dG(t){return up(t)?"indeterminate":t?"checked":"unchecked"}var fG=lG,eSe=uG;const nx=S.forwardRef(({className:t,...e},n)=>b.jsx(fG,{ref:n,className:ie("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...e,children:b.jsx(eSe,{className:ie("flex items-center justify-center text-current"),children:b.jsx(f_,{className:"h-4 w-4"})})}));nx.displayName=fG.displayName;var VB=1,tSe=.9,nSe=.8,rSe=.17,nk=.1,rk=.999,sSe=.9999,iSe=.99,oSe=/[\\\/_+.#"@\[\(\{&]/,aSe=/[\\\/_+.#"@\[\(\{&]/g,lSe=/[\s-]/,hG=/[\s-]/g;function OM(t,e,n,r,s,i,o){if(i===e.length)return s===t.length?VB:iSe;var a=`${s},${i}`;if(o[a]!==void 0)return o[a];for(var c=r.charAt(i),u=n.indexOf(c,s),f=0,l,d,p,h;u>=0;)l=OM(t,e,n,r,u+1,i+1,o),l>f&&(u===s?l*=VB:oSe.test(t.charAt(u-1))?(l*=nSe,p=t.slice(s,u-1).match(aSe),p&&s>0&&(l*=Math.pow(rk,p.length))):lSe.test(t.charAt(u-1))?(l*=tSe,h=t.slice(s,u-1).match(hG),h&&s>0&&(l*=Math.pow(rk,h.length))):(l*=rSe,s>0&&(l*=Math.pow(rk,u-s))),t.charAt(u)!==e.charAt(i)&&(l*=sSe)),(l<nk&&n.charAt(u-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(u-1)!==r.charAt(i))&&(d=OM(t,e,n,r,u+1,i+2,o),d*nk>l&&(l=d*nk)),l>f&&(f=l),u=n.indexOf(c,u+1);return o[a]=f,f}function qB(t){return t.toLowerCase().replace(hG," ")}function cSe(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,OM(t,e,qB(t),qB(e),0,0,{})}function li(){return li=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},li.apply(null,arguments)}function mg(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 uSe(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function pG(...t){return e=>t.forEach(n=>uSe(n,e))}function __(...t){return S.useCallback(pG(...t),t)}function dSe(t,e=[]){let n=[];function r(i,o){const a=S.createContext(o),c=n.length;n=[...n,o];function u(l){const{scope:d,children:p,...h}=l,m=(d==null?void 0:d[t][c])||a,y=S.useMemo(()=>h,Object.values(h));return S.createElement(m.Provider,{value:y},p)}function f(l,d){const p=(d==null?void 0:d[t][c])||a,h=S.useContext(p);if(h)return h;if(o!==void 0)return o;throw new Error(`\`${l}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,f]}const s=()=>{const i=n.map(o=>S.createContext(o));return function(a){const c=(a==null?void 0:a[t])||i;return S.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return s.scopeName=t,[r,fSe(s,...e)]}function fSe(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:c,scopeName:u})=>{const l=c(i)[`__scope${u}`];return{...a,...l}},{});return S.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}const IM=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},hSe=o_.useId||(()=>{});let pSe=0;function sk(t){const[e,n]=S.useState(hSe());return IM(()=>{t||n(r=>r??String(pSe++))},[t]),t||(e?`radix-${e}`:"")}function _p(t){const e=S.useRef(t);return S.useEffect(()=>{e.current=t}),S.useMemo(()=>(...n)=>{var r;return(r=e.current)===null||r===void 0?void 0:r.call(e,...n)},[])}function mSe({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,s]=gSe({defaultProp:e,onChange:n}),i=t!==void 0,o=i?t:r,a=_p(n),c=S.useCallback(u=>{if(i){const l=typeof u=="function"?u(t):u;l!==t&&a(l)}else s(u)},[i,t,s,a]);return[o,c]}function gSe({defaultProp:t,onChange:e}){const n=S.useState(t),[r]=n,s=S.useRef(r),i=_p(e);return S.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}const XL=S.forwardRef((t,e)=>{const{children:n,...r}=t,s=S.Children.toArray(n),i=s.find(ySe);if(i){const o=i.props.children,a=s.map(c=>c===i?S.Children.count(o)>1?S.Children.only(null):S.isValidElement(o)?o.props.children:null:c);return S.createElement(jM,li({},r,{ref:e}),S.isValidElement(o)?S.cloneElement(o,void 0,a):null)}return S.createElement(jM,li({},r,{ref:e}),n)});XL.displayName="Slot";const jM=S.forwardRef((t,e)=>{const{children:n,...r}=t;return S.isValidElement(n)?S.cloneElement(n,{...bSe(r,n.props),ref:e?pG(e,n.ref):n.ref}):S.Children.count(n)>1?S.Children.only(null):null});jM.displayName="SlotClone";const vSe=({children:t})=>S.createElement(S.Fragment,null,t);function ySe(t){return S.isValidElement(t)&&t.type===vSe}function bSe(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...a)=>{i(...a),s(...a)}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}const xSe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ua=xSe.reduce((t,e)=>{const n=S.forwardRef((r,s)=>{const{asChild:i,...o}=r,a=i?XL:e;return S.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),S.createElement(a,li({},o,{ref:s}))});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function wSe(t,e){t&&ss.flushSync(()=>t.dispatchEvent(e))}function _Se(t,e=globalThis==null?void 0:globalThis.document){const n=_p(t);S.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",r),()=>e.removeEventListener("keydown",r)},[n,e])}const LM="dismissableLayer.update",SSe="dismissableLayer.pointerDownOutside",CSe="dismissableLayer.focusOutside";let WB;const ESe=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ASe=S.forwardRef((t,e)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...u}=t,f=S.useContext(ESe),[l,d]=S.useState(null),p=(n=l==null?void 0:l.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,h]=S.useState({}),m=__(e,E=>d(E)),y=Array.from(f.layers),[g]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),v=y.indexOf(g),x=l?y.indexOf(l):-1,_=f.layersWithOutsidePointerEventsDisabled.size>0,A=x>=v,N=RSe(E=>{const P=E.target,k=[...f.branches].some(M=>M.contains(P));!A||k||(i==null||i(E),a==null||a(E),E.defaultPrevented||c==null||c())},p),T=NSe(E=>{const P=E.target;[...f.branches].some(M=>M.contains(P))||(o==null||o(E),a==null||a(E),E.defaultPrevented||c==null||c())},p);return _Se(E=>{x===f.layers.size-1&&(s==null||s(E),!E.defaultPrevented&&c&&(E.preventDefault(),c()))},p),S.useEffect(()=>{if(l)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(WB=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(l)),f.layers.add(l),GB(),()=>{r&&f.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=WB)}},[l,p,r,f]),S.useEffect(()=>()=>{l&&(f.layers.delete(l),f.layersWithOutsidePointerEventsDisabled.delete(l),GB())},[l,f]),S.useEffect(()=>{const E=()=>h({});return document.addEventListener(LM,E),()=>document.removeEventListener(LM,E)},[]),S.createElement(ua.div,li({},u,{ref:m,style:{pointerEvents:_?A?"auto":"none":void 0,...t.style},onFocusCapture:mg(t.onFocusCapture,T.onFocusCapture),onBlurCapture:mg(t.onBlurCapture,T.onBlurCapture),onPointerDownCapture:mg(t.onPointerDownCapture,N.onPointerDownCapture)}))});function RSe(t,e=globalThis==null?void 0:globalThis.document){const n=_p(t),r=S.useRef(!1),s=S.useRef(()=>{});return S.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let f=function(){mG(SSe,n,u,{discrete:!0})};var c=f;const u={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=f,e.addEventListener("click",s.current,{once:!0})):f()}else e.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function NSe(t,e=globalThis==null?void 0:globalThis.document){const n=_p(t),r=S.useRef(!1);return S.useEffect(()=>{const s=i=>{i.target&&!r.current&&mG(CSe,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 GB(){const t=new CustomEvent(LM);document.dispatchEvent(t)}function mG(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?wSe(s,i):s.dispatchEvent(i)}const ik="focusScope.autoFocusOnMount",ok="focusScope.autoFocusOnUnmount",KB={bubbles:!1,cancelable:!0},PSe=S.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=t,[a,c]=S.useState(null),u=_p(s),f=_p(i),l=S.useRef(null),d=__(e,m=>c(m)),p=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(r){let v=function(N){if(p.paused||!a)return;const T=N.target;a.contains(T)?l.current=T:Ku(l.current,{select:!0})},x=function(N){if(p.paused||!a)return;const T=N.relatedTarget;T!==null&&(a.contains(T)||Ku(l.current,{select:!0}))},_=function(N){if(document.activeElement===document.body)for(const E of N)E.removedNodes.length>0&&Ku(a)};var m=v,y=x,g=_;document.addEventListener("focusin",v),document.addEventListener("focusout",x);const A=new MutationObserver(_);return a&&A.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",x),A.disconnect()}}},[r,a,p.paused]),S.useEffect(()=>{if(a){XB.add(p);const m=document.activeElement;if(!a.contains(m)){const g=new CustomEvent(ik,KB);a.addEventListener(ik,u),a.dispatchEvent(g),g.defaultPrevented||(TSe(ISe(gG(a)),{select:!0}),document.activeElement===m&&Ku(a))}return()=>{a.removeEventListener(ik,u),setTimeout(()=>{const g=new CustomEvent(ok,KB);a.addEventListener(ok,f),a.dispatchEvent(g),g.defaultPrevented||Ku(m??document.body,{select:!0}),a.removeEventListener(ok,f),XB.remove(p)},0)}}},[a,u,f,p]);const h=S.useCallback(m=>{if(!n&&!r||p.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,g=document.activeElement;if(y&&g){const v=m.currentTarget,[x,_]=kSe(v);x&&_?!m.shiftKey&&g===_?(m.preventDefault(),n&&Ku(x,{select:!0})):m.shiftKey&&g===x&&(m.preventDefault(),n&&Ku(_,{select:!0})):g===v&&m.preventDefault()}},[n,r,p.paused]);return S.createElement(ua.div,li({tabIndex:-1},o,{ref:d,onKeyDown:h}))});function TSe(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Ku(r,{select:e}),document.activeElement!==n)return}function kSe(t){const e=gG(t),n=YB(e,t),r=YB(e.reverse(),t);return[n,r]}function gG(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 YB(t,e){for(const n of t)if(!DSe(n,{upTo:e}))return n}function DSe(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 MSe(t){return t instanceof HTMLInputElement&&"select"in t}function Ku(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&MSe(t)&&e&&t.select()}}const XB=OSe();function OSe(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=QB(t,e),t.unshift(e)},remove(e){var n;t=QB(t,e),(n=t[0])===null||n===void 0||n.resume()}}}function QB(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function ISe(t){return t.filter(e=>e.tagName!=="A")}const jSe=S.forwardRef((t,e)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...s}=t;return r?QA.createPortal(S.createElement(ua.div,li({},s,{ref:e})),r):null});function LSe(t,e){return S.useReducer((n,r)=>{const s=e[n][r];return s??n},t)}const DR=t=>{const{present:e,children:n}=t,r=$Se(e),s=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),i=__(r.ref,s.ref);return typeof n=="function"||r.isPresent?S.cloneElement(s,{ref:i}):null};DR.displayName="Presence";function $Se(t){const[e,n]=S.useState(),r=S.useRef({}),s=S.useRef(t),i=S.useRef("none"),o=t?"mounted":"unmounted",[a,c]=LSe(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const u=g1(r.current);i.current=a==="mounted"?u:"none"},[a]),IM(()=>{const u=r.current,f=s.current;if(f!==t){const d=i.current,p=g1(u);t?c("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&d!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,c]),IM(()=>{if(e){const u=l=>{const p=g1(r.current).includes(l.animationName);l.target===e&&p&&ss.flushSync(()=>c("ANIMATION_END"))},f=l=>{l.target===e&&(i.current=g1(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(a),ref:S.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function g1(t){return(t==null?void 0:t.animationName)||"none"}let ak=0;function FSe(){S.useEffect(()=>{var t,e;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=n[0])!==null&&t!==void 0?t:ZB()),document.body.insertAdjacentElement("beforeend",(e=n[1])!==null&&e!==void 0?e:ZB()),ak++,()=>{ak===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),ak--}},[])}function ZB(){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 vG=Mq(),lk=function(){},MR=S.forwardRef(function(t,e){var n=S.useRef(null),r=S.useState({onScrollCapture:lk,onWheelCapture:lk,onTouchMoveCapture:lk}),s=r[0],i=r[1],o=t.forwardProps,a=t.children,c=t.className,u=t.removeScrollBar,f=t.enabled,l=t.shards,d=t.sideCar,p=t.noIsolation,h=t.inert,m=t.allowPinchZoom,y=t.as,g=y===void 0?"div":y,v=_L(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),x=d,_=Dq([n,e]),A=Ls(Ls({},v),s);return S.createElement(S.Fragment,null,f&&S.createElement(x,{sideCar:vG,removeScrollBar:u,shards:l,noIsolation:p,inert:h,setCallbacks:i,allowPinchZoom:!!m,lockRef:n}),o?S.cloneElement(S.Children.only(a),Ls(Ls({},A),{ref:_})):S.createElement(g,Ls({},A,{className:c,ref:_}),a))});MR.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};MR.classNames={fullWidth:x0,zeroRight:b0};var $M=!1;if(typeof window<"u")try{var v1=Object.defineProperty({},"passive",{get:function(){return $M=!0,!0}});window.addEventListener("test",v1,v1),window.removeEventListener("test",v1,v1)}catch{$M=!1}var _m=$M?{passive:!1}:!1,zSe=function(t){return t.tagName==="TEXTAREA"},yG=function(t,e){var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!zSe(t)&&n[e]==="visible")},BSe=function(t){return yG(t,"overflowY")},USe=function(t){return yG(t,"overflowX")},JB=function(t,e){var n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=bG(t,n);if(r){var s=xG(t,n),i=s[1],o=s[2];if(i>o)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},HSe=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},VSe=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},bG=function(t,e){return t==="v"?BSe(e):USe(e)},xG=function(t,e){return t==="v"?HSe(e):VSe(e)},qSe=function(t,e){return t==="h"&&e==="rtl"?-1:1},WSe=function(t,e,n,r,s){var i=qSe(t,window.getComputedStyle(e).direction),o=i*r,a=n.target,c=e.contains(a),u=!1,f=o>0,l=0,d=0;do{var p=xG(t,a),h=p[0],m=p[1],y=p[2],g=m-y-i*h;(h||g)&&bG(t,a)&&(l+=g,d+=h),a=a.parentNode}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(f&&(l===0||!s)||!f&&(d===0||!s))&&(u=!0),u},y1=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},e5=function(t){return[t.deltaX,t.deltaY]},t5=function(t){return t&&"current"in t?t.current:t},GSe=function(t,e){return t[0]===e[0]&&t[1]===e[1]},KSe=function(t){return`
|
||
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
||
`)},YSe=0,Sm=[];function XSe(t){var e=S.useRef([]),n=S.useRef([0,0]),r=S.useRef(),s=S.useState(YSe++)[0],i=S.useState(function(){return SL()})[0],o=S.useRef(t);S.useEffect(function(){o.current=t},[t]),S.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var m=kq([t.lockRef.current],(t.shards||[]).map(t5),!0).filter(Boolean);return m.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var a=S.useCallback(function(m,y){if("touches"in m&&m.touches.length===2)return!o.current.allowPinchZoom;var g=y1(m),v=n.current,x="deltaX"in m?m.deltaX:v[0]-g[0],_="deltaY"in m?m.deltaY:v[1]-g[1],A,N=m.target,T=Math.abs(x)>Math.abs(_)?"h":"v";if("touches"in m&&T==="h"&&N.type==="range")return!1;var E=JB(T,N);if(!E)return!0;if(E?A=T:(A=T==="v"?"h":"v",E=JB(T,N)),!E)return!1;if(!r.current&&"changedTouches"in m&&(x||_)&&(r.current=A),!A)return!0;var P=r.current||A;return WSe(P,y,m,P==="h"?x:_,!0)},[]),c=S.useCallback(function(m){var y=m;if(!(!Sm.length||Sm[Sm.length-1]!==i)){var g="deltaY"in y?e5(y):y1(y),v=e.current.filter(function(A){return A.name===y.type&&A.target===y.target&&GSe(A.delta,g)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var x=(o.current.shards||[]).map(t5).filter(Boolean).filter(function(A){return A.contains(y.target)}),_=x.length>0?a(y,x[0]):!o.current.noIsolation;_&&y.cancelable&&y.preventDefault()}}},[]),u=S.useCallback(function(m,y,g,v){var x={name:m,delta:y,target:g,should:v};e.current.push(x),setTimeout(function(){e.current=e.current.filter(function(_){return _!==x})},1)},[]),f=S.useCallback(function(m){n.current=y1(m),r.current=void 0},[]),l=S.useCallback(function(m){u(m.type,e5(m),m.target,a(m,t.lockRef.current))},[]),d=S.useCallback(function(m){u(m.type,y1(m),m.target,a(m,t.lockRef.current))},[]);S.useEffect(function(){return Sm.push(i),t.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:d}),document.addEventListener("wheel",c,_m),document.addEventListener("touchmove",c,_m),document.addEventListener("touchstart",f,_m),function(){Sm=Sm.filter(function(m){return m!==i}),document.removeEventListener("wheel",c,_m),document.removeEventListener("touchmove",c,_m),document.removeEventListener("touchstart",f,_m)}},[]);var p=t.removeScrollBar,h=t.inert;return S.createElement(S.Fragment,null,h?S.createElement(i,{styles:KSe(s)}):null,p?S.createElement(Lq,{gapMode:"margin"}):null)}const QSe=Iq(vG,XSe);var wG=S.forwardRef(function(t,e){return S.createElement(MR,Ls({},t,{ref:e,sideCar:QSe}))});wG.classNames=MR.classNames;const _G="Dialog",[SG,qUe]=dSe(_G),[ZSe,zp]=SG(_G),JSe=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=t,a=S.useRef(null),c=S.useRef(null),[u=!1,f]=mSe({prop:r,defaultProp:s,onChange:i});return S.createElement(ZSe,{scope:e,triggerRef:a,contentRef:c,contentId:sk(),titleId:sk(),descriptionId:sk(),open:u,onOpenChange:f,onOpenToggle:S.useCallback(()=>f(l=>!l),[f]),modal:o},n)},CG="DialogPortal",[e1e,EG]=SG(CG,{forceMount:void 0}),t1e=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=zp(CG,e);return S.createElement(e1e,{scope:e,forceMount:n},S.Children.map(r,o=>S.createElement(DR,{present:n||i.open},S.createElement(jSe,{asChild:!0,container:s},o))))},FM="DialogOverlay",n1e=S.forwardRef((t,e)=>{const n=EG(FM,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=zp(FM,t.__scopeDialog);return i.modal?S.createElement(DR,{present:r||i.open},S.createElement(r1e,li({},s,{ref:e}))):null}),r1e=S.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=zp(FM,n);return S.createElement(wG,{as:XL,allowPinchZoom:!0,shards:[s.contentRef]},S.createElement(ua.div,li({"data-state":RG(s.open)},r,{ref:e,style:{pointerEvents:"auto",...r.style}})))}),rx="DialogContent",s1e=S.forwardRef((t,e)=>{const n=EG(rx,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=zp(rx,t.__scopeDialog);return S.createElement(DR,{present:r||i.open},i.modal?S.createElement(i1e,li({},s,{ref:e})):S.createElement(o1e,li({},s,{ref:e})))}),i1e=S.forwardRef((t,e)=>{const n=zp(rx,t.__scopeDialog),r=S.useRef(null),s=__(e,n.contentRef,r);return S.useEffect(()=>{const i=r.current;if(i)return m_(i)},[]),S.createElement(AG,li({},t,{ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:mg(t.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)===null||o===void 0||o.focus()}),onPointerDownOutside:mg(t.onPointerDownOutside,i=>{const o=i.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&i.preventDefault()}),onFocusOutside:mg(t.onFocusOutside,i=>i.preventDefault())}))}),o1e=S.forwardRef((t,e)=>{const n=zp(rx,t.__scopeDialog),r=S.useRef(!1),s=S.useRef(!1);return S.createElement(AG,li({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o;if((o=t.onCloseAutoFocus)===null||o===void 0||o.call(t,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,s.current=!1},onInteractOutside:i=>{var o,a;(o=t.onInteractOutside)===null||o===void 0||o.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(c))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}}))}),AG=S.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=t,a=zp(rx,n),c=S.useRef(null),u=__(e,c);return FSe(),S.createElement(S.Fragment,null,S.createElement(PSe,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i},S.createElement(ASe,li({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":RG(a.open)},o,{ref:u,onDismiss:()=>a.onOpenChange(!1)}))),!1)});function RG(t){return t?"open":"closed"}const a1e=JSe,l1e=t1e,c1e=n1e,u1e=s1e;var xb='[cmdk-group=""]',ck='[cmdk-group-items=""]',d1e='[cmdk-group-heading=""]',QL='[cmdk-item=""]',n5=`${QL}:not([aria-disabled="true"])`,zM="cmdk-item-select",Gf="data-value",f1e=(t,e,n)=>cSe(t,e,n),NG=S.createContext(void 0),S_=()=>S.useContext(NG),PG=S.createContext(void 0),ZL=()=>S.useContext(PG),TG=S.createContext(void 0),kG=S.forwardRef((t,e)=>{let n=Dm(()=>{var G,Y;return{search:"",value:(Y=(G=t.value)!=null?G:t.defaultValue)!=null?Y:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=Dm(()=>new Set),s=Dm(()=>new Map),i=Dm(()=>new Map),o=Dm(()=>new Set),a=DG(t),{label:c,children:u,value:f,onValueChange:l,filter:d,shouldFilter:p,loop:h,disablePointerSelection:m=!1,vimBindings:y=!0,...g}=t,v=S.useId(),x=S.useId(),_=S.useId(),A=S.useRef(null),N=S1e();Sp(()=>{if(f!==void 0){let G=f.trim();n.current.value=G,T.emit()}},[f]),Sp(()=>{N(6,j)},[]);let T=S.useMemo(()=>({subscribe:G=>(o.current.add(G),()=>o.current.delete(G)),snapshot:()=>n.current,setState:(G,Y,Z)=>{var he,fe,ce;if(!Object.is(n.current[G],Y)){if(n.current[G]=Y,G==="search")I(),k(),N(1,M);else if(G==="value"&&(Z||N(5,j),((he=a.current)==null?void 0:he.value)!==void 0)){let xe=Y??"";(ce=(fe=a.current).onValueChange)==null||ce.call(fe,xe);return}T.emit()}},emit:()=>{o.current.forEach(G=>G())}}),[]),E=S.useMemo(()=>({value:(G,Y,Z)=>{var he;Y!==((he=i.current.get(G))==null?void 0:he.value)&&(i.current.set(G,{value:Y,keywords:Z}),n.current.filtered.items.set(G,P(Y,Z)),N(2,()=>{k(),T.emit()}))},item:(G,Y)=>(r.current.add(G),Y&&(s.current.has(Y)?s.current.get(Y).add(G):s.current.set(Y,new Set([G]))),N(3,()=>{I(),k(),n.current.value||M(),T.emit()}),()=>{i.current.delete(G),r.current.delete(G),n.current.filtered.items.delete(G);let Z=L();N(4,()=>{I(),(Z==null?void 0:Z.getAttribute("id"))===G&&M(),T.emit()})}),group:G=>(s.current.has(G)||s.current.set(G,new Set),()=>{i.current.delete(G),s.current.delete(G)}),filter:()=>a.current.shouldFilter,label:c||t["aria-label"],disablePointerSelection:m,listId:v,inputId:_,labelId:x,listInnerRef:A}),[]);function P(G,Y){var Z,he;let fe=(he=(Z=a.current)==null?void 0:Z.filter)!=null?he:f1e;return G?fe(G,n.current.search,Y):0}function k(){if(!n.current.search||a.current.shouldFilter===!1)return;let G=n.current.filtered.items,Y=[];n.current.filtered.groups.forEach(he=>{let fe=s.current.get(he),ce=0;fe.forEach(xe=>{let Ne=G.get(xe);ce=Math.max(Ne,ce)}),Y.push([he,ce])});let Z=A.current;H().sort((he,fe)=>{var ce,xe;let Ne=he.getAttribute("id"),pe=fe.getAttribute("id");return((ce=G.get(pe))!=null?ce:0)-((xe=G.get(Ne))!=null?xe:0)}).forEach(he=>{let fe=he.closest(ck);fe?fe.appendChild(he.parentElement===fe?he:he.closest(`${ck} > *`)):Z.appendChild(he.parentElement===Z?he:he.closest(`${ck} > *`))}),Y.sort((he,fe)=>fe[1]-he[1]).forEach(he=>{let fe=A.current.querySelector(`${xb}[${Gf}="${encodeURIComponent(he[0])}"]`);fe==null||fe.parentElement.appendChild(fe)})}function M(){let G=H().find(Z=>Z.getAttribute("aria-disabled")!=="true"),Y=G==null?void 0:G.getAttribute(Gf);T.setState("value",Y||void 0)}function I(){var G,Y,Z,he;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let fe=0;for(let ce of r.current){let xe=(Y=(G=i.current.get(ce))==null?void 0:G.value)!=null?Y:"",Ne=(he=(Z=i.current.get(ce))==null?void 0:Z.keywords)!=null?he:[],pe=P(xe,Ne);n.current.filtered.items.set(ce,pe),pe>0&&fe++}for(let[ce,xe]of s.current)for(let Ne of xe)if(n.current.filtered.items.get(Ne)>0){n.current.filtered.groups.add(ce);break}n.current.filtered.count=fe}function j(){var G,Y,Z;let he=L();he&&(((G=he.parentElement)==null?void 0:G.firstChild)===he&&((Z=(Y=he.closest(xb))==null?void 0:Y.querySelector(d1e))==null||Z.scrollIntoView({block:"nearest"})),he.scrollIntoView({block:"nearest"}))}function L(){var G;return(G=A.current)==null?void 0:G.querySelector(`${QL}[aria-selected="true"]`)}function H(){var G;return Array.from((G=A.current)==null?void 0:G.querySelectorAll(n5))}function K(G){let Y=H()[G];Y&&T.setState("value",Y.getAttribute(Gf))}function V(G){var Y;let Z=L(),he=H(),fe=he.findIndex(xe=>xe===Z),ce=he[fe+G];(Y=a.current)!=null&&Y.loop&&(ce=fe+G<0?he[he.length-1]:fe+G===he.length?he[0]:he[fe+G]),ce&&T.setState("value",ce.getAttribute(Gf))}function U(G){let Y=L(),Z=Y==null?void 0:Y.closest(xb),he;for(;Z&&!he;)Z=G>0?w1e(Z,xb):_1e(Z,xb),he=Z==null?void 0:Z.querySelector(n5);he?T.setState("value",he.getAttribute(Gf)):V(G)}let Q=()=>K(H().length-1),ne=G=>{G.preventDefault(),G.metaKey?Q():G.altKey?U(1):V(1)},X=G=>{G.preventDefault(),G.metaKey?K(0):G.altKey?U(-1):V(-1)};return S.createElement(ua.div,{ref:e,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:G=>{var Y;if((Y=g.onKeyDown)==null||Y.call(g,G),!G.defaultPrevented)switch(G.key){case"n":case"j":{y&&G.ctrlKey&&ne(G);break}case"ArrowDown":{ne(G);break}case"p":case"k":{y&&G.ctrlKey&&X(G);break}case"ArrowUp":{X(G);break}case"Home":{G.preventDefault(),K(0);break}case"End":{G.preventDefault(),Q();break}case"Enter":if(!G.nativeEvent.isComposing&&G.keyCode!==229){G.preventDefault();let Z=L();if(Z){let he=new Event(zM);Z.dispatchEvent(he)}}}}},S.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:E1e},c),OR(t,G=>S.createElement(PG.Provider,{value:T},S.createElement(NG.Provider,{value:E},G))))}),h1e=S.forwardRef((t,e)=>{var n,r;let s=S.useId(),i=S.useRef(null),o=S.useContext(TG),a=S_(),c=DG(t),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:o==null?void 0:o.forceMount;Sp(()=>{if(!u)return a.item(s,o==null?void 0:o.id)},[u]);let f=MG(s,i,[t.value,t.children,i],t.keywords),l=ZL(),d=Cp(N=>N.value&&N.value===f.current),p=Cp(N=>u||a.filter()===!1?!0:N.search?N.filtered.items.get(s)>0:!0);S.useEffect(()=>{let N=i.current;if(!(!N||t.disabled))return N.addEventListener(zM,h),()=>N.removeEventListener(zM,h)},[p,t.onSelect,t.disabled]);function h(){var N,T;m(),(T=(N=c.current).onSelect)==null||T.call(N,f.current)}function m(){l.setState("value",f.current,!0)}if(!p)return null;let{disabled:y,value:g,onSelect:v,forceMount:x,keywords:_,...A}=t;return S.createElement(ua.div,{ref:sx([i,e]),...A,id:s,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!d,"data-disabled":!!y,"data-selected":!!d,onPointerMove:y||a.disablePointerSelection?void 0:m,onClick:y?void 0:h},t.children)}),p1e=S.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:s,...i}=t,o=S.useId(),a=S.useRef(null),c=S.useRef(null),u=S.useId(),f=S_(),l=Cp(p=>s||f.filter()===!1?!0:p.search?p.filtered.groups.has(o):!0);Sp(()=>f.group(o),[]),MG(o,a,[t.value,t.heading,c]);let d=S.useMemo(()=>({id:o,forceMount:s}),[s]);return S.createElement(ua.div,{ref:sx([a,e]),...i,"cmdk-group":"",role:"presentation",hidden:l?void 0:!0},n&&S.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),OR(t,p=>S.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},S.createElement(TG.Provider,{value:d},p))))}),m1e=S.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,s=S.useRef(null),i=Cp(o=>!o.search);return!n&&!i?null:S.createElement(ua.div,{ref:sx([s,e]),...r,"cmdk-separator":"",role:"separator"})}),g1e=S.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,s=t.value!=null,i=ZL(),o=Cp(f=>f.search),a=Cp(f=>f.value),c=S_(),u=S.useMemo(()=>{var f;let l=(f=c.listInnerRef.current)==null?void 0:f.querySelector(`${QL}[${Gf}="${encodeURIComponent(a)}"]`);return l==null?void 0:l.getAttribute("id")},[]);return S.useEffect(()=>{t.value!=null&&i.setState("search",t.value)},[t.value]),S.createElement(ua.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":u,id:c.inputId,type:"text",value:s?t.value:o,onChange:f=>{s||i.setState("search",f.target.value),n==null||n(f.target.value)}})}),v1e=S.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...s}=t,i=S.useRef(null),o=S.useRef(null),a=S_();return S.useEffect(()=>{if(o.current&&i.current){let c=o.current,u=i.current,f,l=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let d=c.offsetHeight;u.style.setProperty("--cmdk-list-height",d.toFixed(1)+"px")})});return l.observe(c),()=>{cancelAnimationFrame(f),l.unobserve(c)}}},[]),S.createElement(ua.div,{ref:sx([i,e]),...s,"cmdk-list":"",role:"listbox","aria-label":r,id:a.listId},OR(t,c=>S.createElement("div",{ref:sx([o,a.listInnerRef]),"cmdk-list-sizer":""},c)))}),y1e=S.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:o,...a}=t;return S.createElement(a1e,{open:n,onOpenChange:r},S.createElement(l1e,{container:o},S.createElement(c1e,{"cmdk-overlay":"",className:s}),S.createElement(u1e,{"aria-label":t.label,"cmdk-dialog":"",className:i},S.createElement(kG,{ref:e,...a}))))}),b1e=S.forwardRef((t,e)=>Cp(n=>n.filtered.count===0)?S.createElement(ua.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),x1e=S.forwardRef((t,e)=>{let{progress:n,children:r,label:s="Loading...",...i}=t;return S.createElement(ua.div,{ref:e,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},OR(t,o=>S.createElement("div",{"aria-hidden":!0},o)))}),Hi=Object.assign(kG,{List:v1e,Item:h1e,Input:g1e,Group:p1e,Separator:m1e,Dialog:y1e,Empty:b1e,Loading:x1e});function w1e(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function _1e(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function DG(t){let e=S.useRef(t);return Sp(()=>{e.current=t}),e}var Sp=typeof window>"u"?S.useEffect:S.useLayoutEffect;function Dm(t){let e=S.useRef();return e.current===void 0&&(e.current=t()),e}function sx(t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}function Cp(t){let e=ZL(),n=()=>t(e.snapshot());return S.useSyncExternalStore(e.subscribe,n,n)}function MG(t,e,n,r=[]){let s=S.useRef(),i=S_();return Sp(()=>{var o;let a=(()=>{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,a,c),(o=e.current)==null||o.setAttribute(Gf,a),s.current=a}),s}var S1e=()=>{let[t,e]=S.useState(),n=Dm(()=>new Map);return Sp(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,s)=>{n.current.set(r,s),e({})}};function C1e(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function OR({asChild:t,children:e},n){return t&&S.isValidElement(e)?S.cloneElement(C1e(e),{ref:e.ref},n(e.props.children)):n(e)}var E1e={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ey=oR,JL=aR,A1e=lR,xE=xy,OG=S.forwardRef(({className:t,...e},n)=>b.jsx(gy,{ref:n,className:ie("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));OG.displayName=gy.displayName;const Bp=S.forwardRef(({className:t,children:e,...n},r)=>b.jsxs(A1e,{children:[b.jsx(OG,{}),b.jsxs(vy,{ref:r,className:ie("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...n,children:[e,b.jsxs(xy,{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:[b.jsx(Hv,{className:"h-4 w-4"}),b.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Bp.displayName=vy.displayName;const Up=({className:t,...e})=>b.jsx("div",{className:ie("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});Up.displayName="DialogHeader";const Hp=({className:t,...e})=>b.jsx("div",{className:ie("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});Hp.displayName="DialogFooter";const Vp=S.forwardRef(({className:t,...e},n)=>b.jsx(yy,{ref:n,className:ie("text-lg font-semibold leading-none tracking-tight",t),...e}));Vp.displayName=yy.displayName;const C_=S.forwardRef(({className:t,...e},n)=>b.jsx(by,{ref:n,className:ie("text-sm text-muted-foreground",t),...e}));C_.displayName=by.displayName;const R1e=S.forwardRef(({className:t,...e},n)=>b.jsx(Hi,{ref:n,className:ie("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));R1e.displayName=Hi.displayName;const N1e=S.forwardRef(({className:t,...e},n)=>b.jsxs("div",{className:"flex items-center px-3 border-b","cmdk-input-wrapper":"",children:[b.jsx(vL,{className:"w-4 h-4 mr-2 opacity-50 shrink-0"}),b.jsx(Hi.Input,{ref:n,className:ie("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...e})]}));N1e.displayName=Hi.Input.displayName;const P1e=S.forwardRef(({className:t,...e},n)=>b.jsx(Hi.List,{ref:n,className:ie("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));P1e.displayName=Hi.List.displayName;const T1e=S.forwardRef((t,e)=>b.jsx(Hi.Empty,{ref:e,className:"py-6 text-sm text-center",...t}));T1e.displayName=Hi.Empty.displayName;const k1e=S.forwardRef(({className:t,...e},n)=>b.jsx(Hi.Group,{ref:n,className:ie("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...e}));k1e.displayName=Hi.Group.displayName;const D1e=S.forwardRef(({className:t,...e},n)=>b.jsx(Hi.Separator,{ref:n,className:ie("-mx-1 h-px bg-border",t),...e}));D1e.displayName=Hi.Separator.displayName;const M1e=S.forwardRef(({className:t,...e},n)=>b.jsx(Hi.Item,{ref:n,className:ie("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...e}));M1e.displayName=Hi.Item.displayName;const O1e=["top","right","bottom","left"],jl=Math.min,yo=Math.max,wE=Math.round,b1=Math.floor,ef=t=>({x:t,y:t}),I1e={left:"right",right:"left",bottom:"top",top:"bottom"},j1e={start:"end",end:"start"};function BM(t,e,n){return yo(t,jl(e,n))}function yu(t,e){return typeof t=="function"?t(e):t}function bu(t){return t.split("-")[0]}function Ay(t){return t.split("-")[1]}function e2(t){return t==="x"?"y":"x"}function t2(t){return t==="y"?"height":"width"}function tf(t){return["top","bottom"].includes(bu(t))?"y":"x"}function n2(t){return e2(tf(t))}function L1e(t,e,n){n===void 0&&(n=!1);const r=Ay(t),s=n2(t),i=t2(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=_E(o)),[o,_E(o)]}function $1e(t){const e=_E(t);return[UM(t),e,UM(e)]}function UM(t){return t.replace(/start|end/g,e=>j1e[e])}function F1e(t,e,n){const r=["left","right"],s=["right","left"],i=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return n?e?s:r:e?r:s;case"left":case"right":return e?i:o;default:return[]}}function z1e(t,e,n,r){const s=Ay(t);let i=F1e(bu(t),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(UM)))),i}function _E(t){return t.replace(/left|right|bottom|top/g,e=>I1e[e])}function B1e(t){return{top:0,right:0,bottom:0,left:0,...t}}function IG(t){return typeof t!="number"?B1e(t):{top:t,right:t,bottom:t,left:t}}function SE(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 r5(t,e,n){let{reference:r,floating:s}=t;const i=tf(e),o=n2(e),a=t2(o),c=bu(e),u=i==="y",f=r.x+r.width/2-s.width/2,l=r.y+r.height/2-s.height/2,d=r[a]/2-s[a]/2;let p;switch(c){case"top":p={x:f,y:r.y-s.height};break;case"bottom":p={x:f,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:l};break;case"left":p={x:r.x-s.width,y:l};break;default:p={x:r.x,y:r.y}}switch(Ay(e)){case"start":p[o]-=d*(n&&u?-1:1);break;case"end":p[o]+=d*(n&&u?-1:1);break}return p}const U1e=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,a=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:s}),{x:f,y:l}=r5(u,r,c),d=r,p={},h=0;for(let m=0;m<a.length;m++){const{name:y,fn:g}=a[m],{x:v,y:x,data:_,reset:A}=await g({x:f,y:l,initialPlacement:r,placement:d,strategy:s,middlewareData:p,rects:u,platform:o,elements:{reference:t,floating:e}});f=v??f,l=x??l,p={...p,[y]:{...p[y],..._}},A&&h<=50&&(h++,typeof A=="object"&&(A.placement&&(d=A.placement),A.rects&&(u=A.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:s}):A.rects),{x:f,y:l}=r5(u,d,c)),m=-1)}return{x:f,y:l,placement:d,strategy:s,middlewareData:p}};async function ix(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:o,elements:a,strategy:c}=t,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:l="floating",altBoundary:d=!1,padding:p=0}=yu(e,t),h=IG(p),y=a[d?l==="floating"?"reference":"floating":l],g=SE(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(a.floating)),boundary:u,rootBoundary:f,strategy:c})),v=l==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),_=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},A=SE(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:x,strategy:c}):v);return{top:(g.top-A.top+h.top)/_.y,bottom:(A.bottom-g.bottom+h.bottom)/_.y,left:(g.left-A.left+h.left)/_.x,right:(A.right-g.right+h.right)/_.x}}const H1e=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:o,elements:a,middlewareData:c}=e,{element:u,padding:f=0}=yu(t,e)||{};if(u==null)return{};const l=IG(f),d={x:n,y:r},p=n2(s),h=t2(p),m=await o.getDimensions(u),y=p==="y",g=y?"top":"left",v=y?"bottom":"right",x=y?"clientHeight":"clientWidth",_=i.reference[h]+i.reference[p]-d[p]-i.floating[h],A=d[p]-i.reference[p],N=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let T=N?N[x]:0;(!T||!await(o.isElement==null?void 0:o.isElement(N)))&&(T=a.floating[x]||i.floating[h]);const E=_/2-A/2,P=T/2-m[h]/2-1,k=jl(l[g],P),M=jl(l[v],P),I=k,j=T-m[h]-M,L=T/2-m[h]/2+E,H=BM(I,L,j),K=!c.arrow&&Ay(s)!=null&&L!==H&&i.reference[h]/2-(L<I?k:M)-m[h]/2<0,V=K?L<I?L-I:L-j:0;return{[p]:d[p]+V,data:{[p]:H,centerOffset:L-H-V,...K&&{alignmentOffset:V}},reset:K}}}),V1e=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:a,platform:c,elements:u}=e,{mainAxis:f=!0,crossAxis:l=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...y}=yu(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=bu(s),v=tf(a),x=bu(a)===a,_=await(c.isRTL==null?void 0:c.isRTL(u.floating)),A=d||(x||!m?[_E(a)]:$1e(a)),N=h!=="none";!d&&N&&A.push(...z1e(a,m,h,_));const T=[a,...A],E=await ix(e,y),P=[];let k=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&P.push(E[g]),l){const L=L1e(s,o,_);P.push(E[L[0]],E[L[1]])}if(k=[...k,{placement:s,overflows:P}],!P.every(L=>L<=0)){var M,I;const L=(((M=i.flip)==null?void 0:M.index)||0)+1,H=T[L];if(H)return{data:{index:L,overflows:k},reset:{placement:H}};let K=(I=k.filter(V=>V.overflows[0]<=0).sort((V,U)=>V.overflows[1]-U.overflows[1])[0])==null?void 0:I.placement;if(!K)switch(p){case"bestFit":{var j;const V=(j=k.filter(U=>{if(N){const Q=tf(U.placement);return Q===v||Q==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(Q=>Q>0).reduce((Q,ne)=>Q+ne,0)]).sort((U,Q)=>U[1]-Q[1])[0])==null?void 0:j[0];V&&(K=V);break}case"initialPlacement":K=a;break}if(s!==K)return{reset:{placement:K}}}return{}}}};function s5(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function i5(t){return O1e.some(e=>t[e]>=0)}const q1e=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...s}=yu(t,e);switch(r){case"referenceHidden":{const i=await ix(e,{...s,elementContext:"reference"}),o=s5(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:i5(o)}}}case"escaped":{const i=await ix(e,{...s,altBoundary:!0}),o=s5(i,n.floating);return{data:{escapedOffsets:o,escaped:i5(o)}}}default:return{}}}}};async function W1e(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=bu(n),a=Ay(n),c=tf(n)==="y",u=["left","top"].includes(o)?-1:1,f=i&&c?-1:1,l=yu(e,t);let{mainAxis:d,crossAxis:p,alignmentAxis:h}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...l};return a&&typeof h=="number"&&(p=a==="end"?h*-1:h),c?{x:p*f,y:d*u}:{x:d*u,y:p*f}}const G1e=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:o,middlewareData:a}=e,c=await W1e(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:o}}}}},K1e=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:s}=e,{mainAxis:i=!0,crossAxis:o=!1,limiter:a={fn:y=>{let{x:g,y:v}=y;return{x:g,y:v}}},...c}=yu(t,e),u={x:n,y:r},f=await ix(e,c),l=tf(bu(s)),d=e2(l);let p=u[d],h=u[l];if(i){const y=d==="y"?"top":"left",g=d==="y"?"bottom":"right",v=p+f[y],x=p-f[g];p=BM(v,p,x)}if(o){const y=l==="y"?"top":"left",g=l==="y"?"bottom":"right",v=h+f[y],x=h-f[g];h=BM(v,h,x)}const m=a.fn({...e,[d]:p,[l]:h});return{...m,data:{x:m.x-n,y:m.y-r}}}}},Y1e=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:s,rects:i,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=yu(t,e),f={x:n,y:r},l=tf(s),d=e2(l);let p=f[d],h=f[l];const m=yu(a,e),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const x=d==="y"?"height":"width",_=i.reference[d]-i.floating[x]+y.mainAxis,A=i.reference[d]+i.reference[x]-y.mainAxis;p<_?p=_:p>A&&(p=A)}if(u){var g,v;const x=d==="y"?"width":"height",_=["top","left"].includes(bu(s)),A=i.reference[l]-i.floating[x]+(_&&((g=o.offset)==null?void 0:g[l])||0)+(_?0:y.crossAxis),N=i.reference[l]+i.reference[x]+(_?0:((v=o.offset)==null?void 0:v[l])||0)-(_?y.crossAxis:0);h<A?h=A:h>N&&(h=N)}return{[d]:p,[l]:h}}}},X1e=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:s,elements:i}=e,{apply:o=()=>{},...a}=yu(t,e),c=await ix(e,a),u=bu(n),f=Ay(n),l=tf(n)==="y",{width:d,height:p}=r.floating;let h,m;u==="top"||u==="bottom"?(h=u,m=f===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(m=u,h=f==="end"?"top":"bottom");const y=p-c.top-c.bottom,g=d-c.left-c.right,v=jl(p-c[h],y),x=jl(d-c[m],g),_=!e.middlewareData.shift;let A=v,N=x;if(l?N=f||_?jl(x,g):g:A=f||_?jl(v,y):y,_&&!f){const E=yo(c.left,0),P=yo(c.right,0),k=yo(c.top,0),M=yo(c.bottom,0);l?N=d-2*(E!==0||P!==0?E+P:yo(c.left,c.right)):A=p-2*(k!==0||M!==0?k+M:yo(c.top,c.bottom))}await o({...e,availableWidth:N,availableHeight:A});const T=await s.getDimensions(i.floating);return d!==T.width||p!==T.height?{reset:{rects:!0}}:{}}}};function Ry(t){return jG(t)?(t.nodeName||"").toLowerCase():"#document"}function _o(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Nu(t){var e;return(e=(jG(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function jG(t){return t instanceof Node||t instanceof _o(t).Node}function ql(t){return t instanceof Element||t instanceof _o(t).Element}function Wl(t){return t instanceof HTMLElement||t instanceof _o(t).HTMLElement}function o5(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof _o(t).ShadowRoot}function E_(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=Qa(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(s)}function Q1e(t){return["table","td","th"].includes(Ry(t))}function IR(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function r2(t){const e=s2(),n=Qa(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 Z1e(t){let e=nf(t);for(;Wl(e)&&!qv(e);){if(IR(e))return null;if(r2(e))return e;e=nf(e)}return null}function s2(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function qv(t){return["html","body","#document"].includes(Ry(t))}function Qa(t){return _o(t).getComputedStyle(t)}function jR(t){return ql(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function nf(t){if(Ry(t)==="html")return t;const e=t.assignedSlot||t.parentNode||o5(t)&&t.host||Nu(t);return o5(e)?e.host:e}function LG(t){const e=nf(t);return qv(e)?t.ownerDocument?t.ownerDocument.body:t.body:Wl(e)&&E_(e)?e:LG(e)}function ox(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=LG(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),o=_o(s);return i?e.concat(o,o.visualViewport||[],E_(s)?s:[],o.frameElement&&n?ox(o.frameElement):[]):e.concat(s,ox(s,[],n))}function $G(t){const e=Qa(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=Wl(t),i=s?t.offsetWidth:n,o=s?t.offsetHeight:r,a=wE(n)!==i||wE(r)!==o;return a&&(n=i,r=o),{width:n,height:r,$:a}}function i2(t){return ql(t)?t:t.contextElement}function gg(t){const e=i2(t);if(!Wl(e))return ef(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=$G(e);let o=(i?wE(n.width):n.width)/r,a=(i?wE(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const J1e=ef(0);function FG(t){const e=_o(t);return!s2()||!e.visualViewport?J1e:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function eCe(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==_o(t)?!1:e}function Ep(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=i2(t);let o=ef(1);e&&(r?ql(r)&&(o=gg(r)):o=gg(t));const a=eCe(i,n,r)?FG(i):ef(0);let c=(s.left+a.x)/o.x,u=(s.top+a.y)/o.y,f=s.width/o.x,l=s.height/o.y;if(i){const d=_o(i),p=r&&ql(r)?_o(r):r;let h=d,m=h.frameElement;for(;m&&r&&p!==h;){const y=gg(m),g=m.getBoundingClientRect(),v=Qa(m),x=g.left+(m.clientLeft+parseFloat(v.paddingLeft))*y.x,_=g.top+(m.clientTop+parseFloat(v.paddingTop))*y.y;c*=y.x,u*=y.y,f*=y.x,l*=y.y,c+=x,u+=_,h=_o(m),m=h.frameElement}}return SE({width:f,height:l,x:c,y:u})}function tCe(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",o=Nu(r),a=e?IR(e.floating):!1;if(r===o||a&&i)return n;let c={scrollLeft:0,scrollTop:0},u=ef(1);const f=ef(0),l=Wl(r);if((l||!l&&!i)&&((Ry(r)!=="body"||E_(o))&&(c=jR(r)),Wl(r))){const d=Ep(r);u=gg(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 nCe(t){return Array.from(t.getClientRects())}function zG(t){return Ep(Nu(t)).left+jR(t).scrollLeft}function rCe(t){const e=Nu(t),n=jR(t),r=t.ownerDocument.body,s=yo(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=yo(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+zG(t);const a=-n.scrollTop;return Qa(r).direction==="rtl"&&(o+=yo(e.clientWidth,r.clientWidth)-s),{width:s,height:i,x:o,y:a}}function sCe(t,e){const n=_o(t),r=Nu(t),s=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,a=0,c=0;if(s){i=s.width,o=s.height;const u=s2();(!u||u&&e==="fixed")&&(a=s.offsetLeft,c=s.offsetTop)}return{width:i,height:o,x:a,y:c}}function iCe(t,e){const n=Ep(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Wl(t)?gg(t):ef(1),o=t.clientWidth*i.x,a=t.clientHeight*i.y,c=s*i.x,u=r*i.y;return{width:o,height:a,x:c,y:u}}function a5(t,e,n){let r;if(e==="viewport")r=sCe(t,n);else if(e==="document")r=rCe(Nu(t));else if(ql(e))r=iCe(e,n);else{const s=FG(t);r={...e,x:e.x-s.x,y:e.y-s.y}}return SE(r)}function BG(t,e){const n=nf(t);return n===e||!ql(n)||qv(n)?!1:Qa(n).position==="fixed"||BG(n,e)}function oCe(t,e){const n=e.get(t);if(n)return n;let r=ox(t,[],!1).filter(a=>ql(a)&&Ry(a)!=="body"),s=null;const i=Qa(t).position==="fixed";let o=i?nf(t):t;for(;ql(o)&&!qv(o);){const a=Qa(o),c=r2(o);!c&&a.position==="fixed"&&(s=null),(i?!c&&!s:!c&&a.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||E_(o)&&!c&&BG(t,o))?r=r.filter(f=>f!==o):s=a,o=nf(o)}return e.set(t,r),r}function aCe(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const o=[...n==="clippingAncestors"?IR(e)?[]:oCe(e,this._c):[].concat(n),r],a=o[0],c=o.reduce((u,f)=>{const l=a5(e,f,s);return u.top=yo(l.top,u.top),u.right=jl(l.right,u.right),u.bottom=jl(l.bottom,u.bottom),u.left=yo(l.left,u.left),u},a5(e,a,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function lCe(t){const{width:e,height:n}=$G(t);return{width:e,height:n}}function cCe(t,e,n){const r=Wl(e),s=Nu(e),i=n==="fixed",o=Ep(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const c=ef(0);if(r||!r&&!i)if((Ry(e)!=="body"||E_(s))&&(a=jR(e)),r){const l=Ep(e,!0,i,e);c.x=l.x+e.clientLeft,c.y=l.y+e.clientTop}else s&&(c.x=zG(s));const u=o.left+a.scrollLeft-c.x,f=o.top+a.scrollTop-c.y;return{x:u,y:f,width:o.width,height:o.height}}function uk(t){return Qa(t).position==="static"}function l5(t,e){return!Wl(t)||Qa(t).position==="fixed"?null:e?e(t):t.offsetParent}function UG(t,e){const n=_o(t);if(IR(t))return n;if(!Wl(t)){let s=nf(t);for(;s&&!qv(s);){if(ql(s)&&!uk(s))return s;s=nf(s)}return n}let r=l5(t,e);for(;r&&Q1e(r)&&uk(r);)r=l5(r,e);return r&&qv(r)&&uk(r)&&!r2(r)?n:r||Z1e(t)||n}const uCe=async function(t){const e=this.getOffsetParent||UG,n=this.getDimensions,r=await n(t.floating);return{reference:cCe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function dCe(t){return Qa(t).direction==="rtl"}const fCe={convertOffsetParentRelativeRectToViewportRelativeRect:tCe,getDocumentElement:Nu,getClippingRect:aCe,getOffsetParent:UG,getElementRects:uCe,getClientRects:nCe,getDimensions:lCe,getScale:gg,isElement:ql,isRTL:dCe};function hCe(t,e){let n=null,r;const s=Nu(t);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const{left:u,top:f,width:l,height:d}=t.getBoundingClientRect();if(a||e(),!l||!d)return;const p=b1(f),h=b1(s.clientWidth-(u+l)),m=b1(s.clientHeight-(f+d)),y=b1(u),v={rootMargin:-p+"px "+-h+"px "+-m+"px "+-y+"px",threshold:yo(0,jl(1,c))||1};let x=!0;function _(A){const N=A[0].intersectionRatio;if(N!==c){if(!x)return o();N?o(!1,N):r=setTimeout(()=>{o(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(_,{...v,root:s.ownerDocument})}catch{n=new IntersectionObserver(_,v)}n.observe(t)}return o(!0),i}function pCe(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=i2(t),f=s||i?[...u?ox(u):[],...ox(e)]:[];f.forEach(g=>{s&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const l=u&&a?hCe(u,n):null;let d=-1,p=null;o&&(p=new ResizeObserver(g=>{let[v]=g;v&&v.target===u&&p&&(p.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(e)})),n()}),u&&!c&&p.observe(u),p.observe(e));let h,m=c?Ep(t):null;c&&y();function y(){const g=Ep(t);m&&(g.x!==m.x||g.y!==m.y||g.width!==m.width||g.height!==m.height)&&n(),m=g,h=requestAnimationFrame(y)}return n(),()=>{var g;f.forEach(v=>{s&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),l==null||l(),(g=p)==null||g.disconnect(),p=null,c&&cancelAnimationFrame(h)}}const mCe=G1e,gCe=K1e,vCe=V1e,yCe=X1e,bCe=q1e,c5=H1e,xCe=Y1e,wCe=(t,e,n)=>{const r=new Map,s={platform:fCe,...n},i={...s.platform,_c:r};return U1e(t,e,{...s,platform:i})};var iC=typeof document<"u"?S.useLayoutEffect:S.useEffect;function CE(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(!CE(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)&&!CE(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function HG(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function u5(t,e){const n=HG(t);return Math.round(e*n)/n}function d5(t){const e=S.useRef(t);return iC(()=>{e.current=t}),e}function _Ce(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:a=!0,whileElementsMounted:c,open:u}=t,[f,l]=S.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[d,p]=S.useState(r);CE(d,r)||p(r);const[h,m]=S.useState(null),[y,g]=S.useState(null),v=S.useCallback(V=>{V!==N.current&&(N.current=V,m(V))},[]),x=S.useCallback(V=>{V!==T.current&&(T.current=V,g(V))},[]),_=i||h,A=o||y,N=S.useRef(null),T=S.useRef(null),E=S.useRef(f),P=c!=null,k=d5(c),M=d5(s),I=S.useCallback(()=>{if(!N.current||!T.current)return;const V={placement:e,strategy:n,middleware:d};M.current&&(V.platform=M.current),wCe(N.current,T.current,V).then(U=>{const Q={...U,isPositioned:!0};j.current&&!CE(E.current,Q)&&(E.current=Q,ss.flushSync(()=>{l(Q)}))})},[d,e,n,M]);iC(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,l(V=>({...V,isPositioned:!1})))},[u]);const j=S.useRef(!1);iC(()=>(j.current=!0,()=>{j.current=!1}),[]),iC(()=>{if(_&&(N.current=_),A&&(T.current=A),_&&A){if(k.current)return k.current(_,A,I);I()}},[_,A,I,k,P]);const L=S.useMemo(()=>({reference:N,floating:T,setReference:v,setFloating:x}),[v,x]),H=S.useMemo(()=>({reference:_,floating:A}),[_,A]),K=S.useMemo(()=>{const V={position:n,left:0,top:0};if(!H.floating)return V;const U=u5(H.floating,f.x),Q=u5(H.floating,f.y);return a?{...V,transform:"translate("+U+"px, "+Q+"px)",...HG(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:U,top:Q}},[n,a,H.floating,f.x,f.y]);return S.useMemo(()=>({...f,update:I,refs:L,elements:H,floatingStyles:K}),[f,I,L,H,K])}const SCe=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?c5({element:r.current,padding:s}).fn(n):{}:r?c5({element:r,padding:s}).fn(n):{}}}},CCe=(t,e)=>({...mCe(t),options:[t,e]}),ECe=(t,e)=>({...gCe(t),options:[t,e]}),ACe=(t,e)=>({...xCe(t),options:[t,e]}),RCe=(t,e)=>({...vCe(t),options:[t,e]}),NCe=(t,e)=>({...yCe(t),options:[t,e]}),PCe=(t,e)=>({...bCe(t),options:[t,e]}),TCe=(t,e)=>({...SCe(t),options:[t,e]});var kCe="Arrow",VG=S.forwardRef((t,e)=>{const{children:n,width:r=10,height:s=5,...i}=t;return b.jsx(De.svg,{...i,ref:e,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:b.jsx("polygon",{points:"0,0 30,0 15,10"})})});VG.displayName=kCe;var DCe=VG,o2="Popper",[qG,Ql]=In(o2),[MCe,WG]=qG(o2),GG=t=>{const{__scopePopper:e,children:n}=t,[r,s]=S.useState(null);return b.jsx(MCe,{scope:e,anchor:r,onAnchorChange:s,children:n})};GG.displayName=o2;var KG="PopperAnchor",YG=S.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...s}=t,i=WG(KG,n),o=S.useRef(null),a=et(e,o);return S.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:b.jsx(De.div,{...s,ref:a})});YG.displayName=KG;var a2="PopperContent",[OCe,ICe]=qG(a2),XG=S.forwardRef((t,e)=>{var ce,xe,Ne,pe,Le,Me;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:l="partial",hideWhenDetached:d=!1,updatePositionStrategy:p="optimized",onPlaced:h,...m}=t,y=WG(a2,n),[g,v]=S.useState(null),x=et(e,Oe=>v(Oe)),[_,A]=S.useState(null),N=w_(_),T=(N==null?void 0:N.width)??0,E=(N==null?void 0:N.height)??0,P=r+(i!=="center"?"-"+i:""),k=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},M=Array.isArray(u)?u:[u],I=M.length>0,j={padding:k,boundary:M.filter(LCe),altBoundary:I},{refs:L,floatingStyles:H,placement:K,isPositioned:V,middlewareData:U}=_Ce({strategy:"fixed",placement:P,whileElementsMounted:(...Oe)=>pCe(...Oe,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[CCe({mainAxis:s+E,alignmentAxis:o}),c&&ECe({mainAxis:!0,crossAxis:!1,limiter:l==="partial"?ACe():void 0,...j}),c&&RCe({...j}),NCe({...j,apply:({elements:Oe,rects:Fe,availableWidth:ot,availableHeight:nt})=>{const{width:At,height:ee}=Fe.reference,de=Oe.floating.style;de.setProperty("--radix-popper-available-width",`${ot}px`),de.setProperty("--radix-popper-available-height",`${nt}px`),de.setProperty("--radix-popper-anchor-width",`${At}px`),de.setProperty("--radix-popper-anchor-height",`${ee}px`)}}),_&&TCe({element:_,padding:a}),$Ce({arrowWidth:T,arrowHeight:E}),d&&PCe({strategy:"referenceHidden",...j})]}),[Q,ne]=JG(K),X=on(h);ir(()=>{V&&(X==null||X())},[V,X]);const G=(ce=U.arrow)==null?void 0:ce.x,Y=(xe=U.arrow)==null?void 0:xe.y,Z=((Ne=U.arrow)==null?void 0:Ne.centerOffset)!==0,[he,fe]=S.useState();return ir(()=>{g&&fe(window.getComputedStyle(g).zIndex)},[g]),b.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:V?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:he,"--radix-popper-transform-origin":[(pe=U.transformOrigin)==null?void 0:pe.x,(Le=U.transformOrigin)==null?void 0:Le.y].join(" "),...((Me=U.hide)==null?void 0:Me.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:b.jsx(OCe,{scope:n,placedSide:Q,onArrowChange:A,arrowX:G,arrowY:Y,shouldHideArrow:Z,children:b.jsx(De.div,{"data-side":Q,"data-align":ne,...m,ref:x,style:{...m.style,animation:V?void 0:"none"}})})})});XG.displayName=a2;var QG="PopperArrow",jCe={top:"bottom",right:"left",bottom:"top",left:"right"},ZG=S.forwardRef(function(e,n){const{__scopePopper:r,...s}=e,i=ICe(QG,r),o=jCe[i.placedSide];return b.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:b.jsx(DCe,{...s,ref:n,style:{...s.style,display:"block"}})})});ZG.displayName=QG;function LCe(t){return t!==null}var $Ce=t=>({name:"transformOrigin",options:t,fn(e){var y,g,v;const{placement:n,rects:r,middlewareData:s}=e,o=((y=s.arrow)==null?void 0:y.centerOffset)!==0,a=o?0:t.arrowWidth,c=o?0:t.arrowHeight,[u,f]=JG(n),l={start:"0%",center:"50%",end:"100%"}[f],d=(((g=s.arrow)==null?void 0:g.x)??0)+a/2,p=(((v=s.arrow)==null?void 0:v.y)??0)+c/2;let h="",m="";return u==="bottom"?(h=o?l:`${d}px`,m=`${-c}px`):u==="top"?(h=o?l:`${d}px`,m=`${r.floating.height+c}px`):u==="right"?(h=`${-c}px`,m=o?l:`${p}px`):u==="left"&&(h=`${r.floating.width+c}px`,m=o?l:`${p}px`),{data:{x:h,y:m}}}});function JG(t){const[e,n="center"]=t.split("-");return[e,n]}var LR=GG,Ny=YG,A_=XG,R_=ZG,dk="rovingFocusGroup.onEntryFocus",FCe={bubbles:!1,cancelable:!0},$R="RovingFocusGroup",[HM,e7,zCe]=Cu($R),[BCe,Zl]=In($R,[zCe]),[UCe,HCe]=BCe($R),t7=S.forwardRef((t,e)=>b.jsx(HM.Provider,{scope:t.__scopeRovingFocusGroup,children:b.jsx(HM.Slot,{scope:t.__scopeRovingFocusGroup,children:b.jsx(VCe,{...t,ref:e})})}));t7.displayName=$R;var VCe=S.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...l}=t,d=S.useRef(null),p=et(e,d),h=el(i),[m=null,y]=mr({prop:o,defaultProp:a,onChange:c}),[g,v]=S.useState(!1),x=on(u),_=e7(n),A=S.useRef(!1),[N,T]=S.useState(0);return S.useEffect(()=>{const E=d.current;if(E)return E.addEventListener(dk,x),()=>E.removeEventListener(dk,x)},[x]),b.jsx(UCe,{scope:n,orientation:r,dir:h,loop:s,currentTabStopId:m,onItemFocus:S.useCallback(E=>y(E),[y]),onItemShiftTab:S.useCallback(()=>v(!0),[]),onFocusableItemAdd:S.useCallback(()=>T(E=>E+1),[]),onFocusableItemRemove:S.useCallback(()=>T(E=>E-1),[]),children:b.jsx(De.div,{tabIndex:g||N===0?-1:0,"data-orientation":r,...l,ref:p,style:{outline:"none",...t.style},onMouseDown:ye(t.onMouseDown,()=>{A.current=!0}),onFocus:ye(t.onFocus,E=>{const P=!A.current;if(E.target===E.currentTarget&&P&&!g){const k=new CustomEvent(dk,FCe);if(E.currentTarget.dispatchEvent(k),!k.defaultPrevented){const M=_().filter(K=>K.focusable),I=M.find(K=>K.active),j=M.find(K=>K.id===m),H=[I,j,...M].filter(Boolean).map(K=>K.ref.current);s7(H,f)}}A.current=!1}),onBlur:ye(t.onBlur,()=>v(!1))})})}),n7="RovingFocusGroupItem",r7=S.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,...o}=t,a=zs(),c=i||a,u=HCe(n7,n),f=u.currentTabStopId===c,l=e7(n),{onFocusableItemAdd:d,onFocusableItemRemove:p}=u;return S.useEffect(()=>{if(r)return d(),()=>p()},[r,d,p]),b.jsx(HM.ItemSlot,{scope:n,id:c,focusable:r,active:s,children:b.jsx(De.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...o,ref:e,onMouseDown:ye(t.onMouseDown,h=>{r?u.onItemFocus(c):h.preventDefault()}),onFocus:ye(t.onFocus,()=>u.onItemFocus(c)),onKeyDown:ye(t.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){u.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const m=GCe(h,u.orientation,u.dir);if(m!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let g=l().filter(v=>v.focusable).map(v=>v.ref.current);if(m==="last")g.reverse();else if(m==="prev"||m==="next"){m==="prev"&&g.reverse();const v=g.indexOf(h.currentTarget);g=u.loop?KCe(g,v+1):g.slice(v+1)}setTimeout(()=>s7(g))}})})})});r7.displayName=n7;var qCe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function WCe(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function GCe(t,e,n){const r=WCe(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return qCe[r]}function s7(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function KCe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var N_=t7,P_=r7,VM=["Enter"," "],YCe=["ArrowDown","PageUp","Home"],i7=["ArrowUp","PageDown","End"],XCe=[...YCe,...i7],QCe={ltr:[...VM,"ArrowRight"],rtl:[...VM,"ArrowLeft"]},ZCe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},T_="Menu",[ax,JCe,eEe]=Cu(T_),[qp,k_]=In(T_,[eEe,Ql,Zl]),FR=Ql(),o7=Zl(),[tEe,Wp]=qp(T_),[nEe,D_]=qp(T_),a7=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:s,onOpenChange:i,modal:o=!0}=t,a=FR(e),[c,u]=S.useState(null),f=S.useRef(!1),l=on(i),d=el(s);return S.useEffect(()=>{const p=()=>{f.current=!0,document.addEventListener("pointerdown",h,{capture:!0,once:!0}),document.addEventListener("pointermove",h,{capture:!0,once:!0})},h=()=>f.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",h,{capture:!0}),document.removeEventListener("pointermove",h,{capture:!0})}},[]),b.jsx(LR,{...a,children:b.jsx(tEe,{scope:e,open:n,onOpenChange:l,content:c,onContentChange:u,children:b.jsx(nEe,{scope:e,onClose:S.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:f,dir:d,modal:o,children:r})})})};a7.displayName=T_;var rEe="MenuAnchor",l2=S.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=FR(n);return b.jsx(Ny,{...s,...r,ref:e})});l2.displayName=rEe;var c2="MenuPortal",[sEe,l7]=qp(c2,{forceMount:void 0}),c7=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:s}=t,i=Wp(c2,e);return b.jsx(sEe,{scope:e,forceMount:n,children:b.jsx(Kn,{present:n||i.open,children:b.jsx(my,{asChild:!0,container:s,children:r})})})};c7.displayName=c2;var sa="MenuContent",[iEe,u2]=qp(sa),u7=S.forwardRef((t,e)=>{const n=l7(sa,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=Wp(sa,t.__scopeMenu),o=D_(sa,t.__scopeMenu);return b.jsx(ax.Provider,{scope:t.__scopeMenu,children:b.jsx(Kn,{present:r||i.open,children:b.jsx(ax.Slot,{scope:t.__scopeMenu,children:o.modal?b.jsx(oEe,{...s,ref:e}):b.jsx(aEe,{...s,ref:e})})})})}),oEe=S.forwardRef((t,e)=>{const n=Wp(sa,t.__scopeMenu),r=S.useRef(null),s=et(e,r);return S.useEffect(()=>{const i=r.current;if(i)return m_(i)},[]),b.jsx(d2,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ye(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),aEe=S.forwardRef((t,e)=>{const n=Wp(sa,t.__scopeMenu);return b.jsx(d2,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),d2=S.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:l,onInteractOutside:d,onDismiss:p,disableOutsideScroll:h,...m}=t,y=Wp(sa,n),g=D_(sa,n),v=FR(n),x=o7(n),_=JCe(n),[A,N]=S.useState(null),T=S.useRef(null),E=et(e,T,y.onContentChange),P=S.useRef(0),k=S.useRef(""),M=S.useRef(0),I=S.useRef(null),j=S.useRef("right"),L=S.useRef(0),H=h?p_:S.Fragment,K=h?{as:Ka,allowPinchZoom:!0}:void 0,V=Q=>{var ce,xe;const ne=k.current+Q,X=_().filter(Ne=>!Ne.disabled),G=document.activeElement,Y=(ce=X.find(Ne=>Ne.ref.current===G))==null?void 0:ce.textValue,Z=X.map(Ne=>Ne.textValue),he=bEe(Z,ne,Y),fe=(xe=X.find(Ne=>Ne.textValue===he))==null?void 0:xe.ref.current;(function Ne(pe){k.current=pe,window.clearTimeout(P.current),pe!==""&&(P.current=window.setTimeout(()=>Ne(""),1e3))})(ne),fe&&setTimeout(()=>fe.focus())};S.useEffect(()=>()=>window.clearTimeout(P.current),[]),sR();const U=S.useCallback(Q=>{var X,G;return j.current===((X=I.current)==null?void 0:X.side)&&wEe(Q,(G=I.current)==null?void 0:G.area)},[]);return b.jsx(iEe,{scope:n,searchRef:k,onItemEnter:S.useCallback(Q=>{U(Q)&&Q.preventDefault()},[U]),onItemLeave:S.useCallback(Q=>{var ne;U(Q)||((ne=T.current)==null||ne.focus(),N(null))},[U]),onTriggerLeave:S.useCallback(Q=>{U(Q)&&Q.preventDefault()},[U]),pointerGraceTimerRef:M,onPointerGraceIntentChange:S.useCallback(Q=>{I.current=Q},[]),children:b.jsx(H,{...K,children:b.jsx(h_,{asChild:!0,trapped:s,onMountAutoFocus:ye(i,Q=>{var ne;Q.preventDefault(),(ne=T.current)==null||ne.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:b.jsx(Au,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:l,onInteractOutside:d,onDismiss:p,children:b.jsx(N_,{asChild:!0,...x,dir:g.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:N,onEntryFocus:ye(c,Q=>{g.isUsingKeyboardRef.current||Q.preventDefault()}),preventScrollOnEntryFocus:!0,children:b.jsx(A_,{role:"menu","aria-orientation":"vertical","data-state":A7(y.open),"data-radix-menu-content":"",dir:g.dir,...v,...m,ref:E,style:{outline:"none",...m.style},onKeyDown:ye(m.onKeyDown,Q=>{const X=Q.target.closest("[data-radix-menu-content]")===Q.currentTarget,G=Q.ctrlKey||Q.altKey||Q.metaKey,Y=Q.key.length===1;X&&(Q.key==="Tab"&&Q.preventDefault(),!G&&Y&&V(Q.key));const Z=T.current;if(Q.target!==Z||!XCe.includes(Q.key))return;Q.preventDefault();const fe=_().filter(ce=>!ce.disabled).map(ce=>ce.ref.current);i7.includes(Q.key)&&fe.reverse(),vEe(fe)}),onBlur:ye(t.onBlur,Q=>{Q.currentTarget.contains(Q.target)||(window.clearTimeout(P.current),k.current="")}),onPointerMove:ye(t.onPointerMove,lx(Q=>{const ne=Q.target,X=L.current!==Q.clientX;if(Q.currentTarget.contains(ne)&&X){const G=Q.clientX>L.current?"right":"left";j.current=G,L.current=Q.clientX}}))})})})})})})});u7.displayName=sa;var lEe="MenuGroup",f2=S.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return b.jsx(De.div,{role:"group",...r,ref:e})});f2.displayName=lEe;var cEe="MenuLabel",d7=S.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return b.jsx(De.div,{...r,ref:e})});d7.displayName=cEe;var EE="MenuItem",f5="menu.itemSelect",zR=S.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...s}=t,i=S.useRef(null),o=D_(EE,t.__scopeMenu),a=u2(EE,t.__scopeMenu),c=et(e,i),u=S.useRef(!1),f=()=>{const l=i.current;if(!n&&l){const d=new CustomEvent(f5,{bubbles:!0,cancelable:!0});l.addEventListener(f5,p=>r==null?void 0:r(p),{once:!0}),Z0(l,d),d.defaultPrevented?u.current=!1:o.onClose()}};return b.jsx(f7,{...s,ref:c,disabled:n,onClick:ye(t.onClick,f),onPointerDown:l=>{var d;(d=t.onPointerDown)==null||d.call(t,l),u.current=!0},onPointerUp:ye(t.onPointerUp,l=>{var d;u.current||(d=l.currentTarget)==null||d.click()}),onKeyDown:ye(t.onKeyDown,l=>{const d=a.searchRef.current!=="";n||d&&l.key===" "||VM.includes(l.key)&&(l.currentTarget.click(),l.preventDefault())})})});zR.displayName=EE;var f7=S.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=t,o=u2(EE,n),a=o7(n),c=S.useRef(null),u=et(e,c),[f,l]=S.useState(!1),[d,p]=S.useState("");return S.useEffect(()=>{const h=c.current;h&&p((h.textContent??"").trim())},[i.children]),b.jsx(ax.ItemSlot,{scope:n,disabled:r,textValue:s??d,children:b.jsx(P_,{asChild:!0,...a,focusable:!r,children:b.jsx(De.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:u,onPointerMove:ye(t.onPointerMove,lx(h=>{r?o.onItemLeave(h):(o.onItemEnter(h),h.defaultPrevented||h.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ye(t.onPointerLeave,lx(h=>o.onItemLeave(h))),onFocus:ye(t.onFocus,()=>l(!0)),onBlur:ye(t.onBlur,()=>l(!1))})})})}),uEe="MenuCheckboxItem",h7=S.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...s}=t;return b.jsx(y7,{scope:t.__scopeMenu,checked:n,children:b.jsx(zR,{role:"menuitemcheckbox","aria-checked":AE(n)?"mixed":n,...s,ref:e,"data-state":p2(n),onSelect:ye(s.onSelect,()=>r==null?void 0:r(AE(n)?!0:!n),{checkForDefaultPrevented:!1})})})});h7.displayName=uEe;var p7="MenuRadioGroup",[dEe,fEe]=qp(p7,{value:void 0,onValueChange:()=>{}}),m7=S.forwardRef((t,e)=>{const{value:n,onValueChange:r,...s}=t,i=on(r);return b.jsx(dEe,{scope:t.__scopeMenu,value:n,onValueChange:i,children:b.jsx(f2,{...s,ref:e})})});m7.displayName=p7;var g7="MenuRadioItem",v7=S.forwardRef((t,e)=>{const{value:n,...r}=t,s=fEe(g7,t.__scopeMenu),i=n===s.value;return b.jsx(y7,{scope:t.__scopeMenu,checked:i,children:b.jsx(zR,{role:"menuitemradio","aria-checked":i,...r,ref:e,"data-state":p2(i),onSelect:ye(r.onSelect,()=>{var o;return(o=s.onValueChange)==null?void 0:o.call(s,n)},{checkForDefaultPrevented:!1})})})});v7.displayName=g7;var h2="MenuItemIndicator",[y7,hEe]=qp(h2,{checked:!1}),b7=S.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...s}=t,i=hEe(h2,n);return b.jsx(Kn,{present:r||AE(i.checked)||i.checked===!0,children:b.jsx(De.span,{...s,ref:e,"data-state":p2(i.checked)})})});b7.displayName=h2;var pEe="MenuSeparator",x7=S.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return b.jsx(De.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});x7.displayName=pEe;var mEe="MenuArrow",w7=S.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=FR(n);return b.jsx(R_,{...s,...r,ref:e})});w7.displayName=mEe;var gEe="MenuSub",[WUe,_7]=qp(gEe),Ub="MenuSubTrigger",S7=S.forwardRef((t,e)=>{const n=Wp(Ub,t.__scopeMenu),r=D_(Ub,t.__scopeMenu),s=_7(Ub,t.__scopeMenu),i=u2(Ub,t.__scopeMenu),o=S.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=i,u={__scopeMenu:t.__scopeMenu},f=S.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return S.useEffect(()=>f,[f]),S.useEffect(()=>{const l=a.current;return()=>{window.clearTimeout(l),c(null)}},[a,c]),b.jsx(l2,{asChild:!0,...u,children:b.jsx(f7,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":A7(n.open),...t,ref:d_(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:ye(t.onPointerMove,lx(l=>{i.onItemEnter(l),!l.defaultPrevented&&!t.disabled&&!n.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:ye(t.onPointerLeave,lx(l=>{var p,h;f();const d=(p=n.content)==null?void 0:p.getBoundingClientRect();if(d){const m=(h=n.content)==null?void 0:h.dataset.side,y=m==="right",g=y?-5:5,v=d[y?"left":"right"],x=d[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:l.clientX+g,y:l.clientY},{x:v,y:d.top},{x,y:d.top},{x,y:d.bottom},{x:v,y:d.bottom}],side:m}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(l),l.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ye(t.onKeyDown,l=>{var p;const d=i.searchRef.current!=="";t.disabled||d&&l.key===" "||QCe[r.dir].includes(l.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),l.preventDefault())})})})});S7.displayName=Ub;var C7="MenuSubContent",E7=S.forwardRef((t,e)=>{const n=l7(sa,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=Wp(sa,t.__scopeMenu),o=D_(sa,t.__scopeMenu),a=_7(C7,t.__scopeMenu),c=S.useRef(null),u=et(e,c);return b.jsx(ax.Provider,{scope:t.__scopeMenu,children:b.jsx(Kn,{present:r||i.open,children:b.jsx(ax.Slot,{scope:t.__scopeMenu,children:b.jsx(d2,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var l;o.isUsingKeyboardRef.current&&((l=c.current)==null||l.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:ye(t.onFocusOutside,f=>{f.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ye(t.onEscapeKeyDown,f=>{o.onClose(),f.preventDefault()}),onKeyDown:ye(t.onKeyDown,f=>{var p;const l=f.currentTarget.contains(f.target),d=ZCe[o.dir].includes(f.key);l&&d&&(i.onOpenChange(!1),(p=a.trigger)==null||p.focus(),f.preventDefault())})})})})})});E7.displayName=C7;function A7(t){return t?"open":"closed"}function AE(t){return t==="indeterminate"}function p2(t){return AE(t)?"indeterminate":t?"checked":"unchecked"}function vEe(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function yEe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function bEe(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 o=yEe(t,Math.max(i,0));s.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function xEe(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const a=e[i].x,c=e[i].y,u=e[o].x,f=e[o].y;c>r!=f>r&&n<(u-a)*(r-c)/(f-c)+a&&(s=!s)}return s}function wEe(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return xEe(n,e)}function lx(t){return e=>e.pointerType==="mouse"?t(e):void 0}var _Ee=a7,m2=l2,g2=c7,v2=u7,y2=f2,b2=d7,x2=zR,w2=h7,_2=m7,S2=v7,C2=b7,E2=x7,A2=w7,R2=S7,N2=E7,R7="ContextMenu",[SEe,GUe]=In(R7,[k_]),Vi=k_(),[KUe,N7]=SEe(R7),P7="ContextMenuTrigger",CEe=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=t,i=N7(P7,n),o=Vi(n),a=S.useRef({x:0,y:0}),c=S.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),u=S.useRef(0),f=S.useCallback(()=>window.clearTimeout(u.current),[]),l=d=>{a.current={x:d.clientX,y:d.clientY},i.onOpenChange(!0)};return S.useEffect(()=>f,[f]),S.useEffect(()=>void(r&&f()),[r,f]),b.jsxs(b.Fragment,{children:[b.jsx(m2,{...o,virtualRef:c}),b.jsx(De.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:ye(t.onContextMenu,d=>{f(),l(d),d.preventDefault()}),onPointerDown:r?t.onPointerDown:ye(t.onPointerDown,x1(d=>{f(),u.current=window.setTimeout(()=>l(d),700)})),onPointerMove:r?t.onPointerMove:ye(t.onPointerMove,x1(f)),onPointerCancel:r?t.onPointerCancel:ye(t.onPointerCancel,x1(f)),onPointerUp:r?t.onPointerUp:ye(t.onPointerUp,x1(f))})]})});CEe.displayName=P7;var EEe="ContextMenuPortal",T7=t=>{const{__scopeContextMenu:e,...n}=t,r=Vi(e);return b.jsx(g2,{...r,...n})};T7.displayName=EEe;var k7="ContextMenuContent",D7=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=N7(k7,n),i=Vi(n),o=S.useRef(!1);return b.jsx(v2,{...i,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:a=>{var c;(c=t.onCloseAutoFocus)==null||c.call(t,a),!a.defaultPrevented&&o.current&&a.preventDefault(),o.current=!1},onInteractOutside:a=>{var c;(c=t.onInteractOutside)==null||c.call(t,a),!a.defaultPrevented&&!s.modal&&(o.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});D7.displayName=k7;var AEe="ContextMenuGroup",REe=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Vi(n);return b.jsx(y2,{...s,...r,ref:e})});REe.displayName=AEe;var NEe="ContextMenuLabel",M7=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Vi(n);return b.jsx(b2,{...s,...r,ref:e})});M7.displayName=NEe;var PEe="ContextMenuItem",O7=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Vi(n);return b.jsx(x2,{...s,...r,ref:e})});O7.displayName=PEe;var TEe="ContextMenuCheckboxItem",I7=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Vi(n);return b.jsx(w2,{...s,...r,ref:e})});I7.displayName=TEe;var kEe="ContextMenuRadioGroup",DEe=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Vi(n);return b.jsx(_2,{...s,...r,ref:e})});DEe.displayName=kEe;var MEe="ContextMenuRadioItem",j7=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Vi(n);return b.jsx(S2,{...s,...r,ref:e})});j7.displayName=MEe;var OEe="ContextMenuItemIndicator",L7=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Vi(n);return b.jsx(C2,{...s,...r,ref:e})});L7.displayName=OEe;var IEe="ContextMenuSeparator",$7=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Vi(n);return b.jsx(E2,{...s,...r,ref:e})});$7.displayName=IEe;var jEe="ContextMenuArrow",LEe=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Vi(n);return b.jsx(A2,{...s,...r,ref:e})});LEe.displayName=jEe;var $Ee="ContextMenuSubTrigger",F7=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Vi(n);return b.jsx(R2,{...s,...r,ref:e})});F7.displayName=$Ee;var FEe="ContextMenuSubContent",z7=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Vi(n);return b.jsx(N2,{...s,...r,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});z7.displayName=FEe;function x1(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var zEe=T7,B7=D7,U7=M7,H7=O7,V7=I7,q7=j7,W7=L7,G7=$7,K7=F7,Y7=z7;const BEe=S.forwardRef(({className:t,inset:e,children:n,...r},s)=>b.jsxs(K7,{ref:s,className:ie("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e&&"pl-8",t),...r,children:[n,b.jsx(fy,{className:"ml-auto h-4 w-4"})]}));BEe.displayName=K7.displayName;const UEe=S.forwardRef(({className:t,...e},n)=>b.jsx(Y7,{ref:n,className:ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));UEe.displayName=Y7.displayName;const HEe=S.forwardRef(({className:t,...e},n)=>b.jsx(zEe,{children:b.jsx(B7,{ref:n,className:ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e})}));HEe.displayName=B7.displayName;const VEe=S.forwardRef(({className:t,inset:e,...n},r)=>b.jsx(H7,{ref:r,className:ie("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...n}));VEe.displayName=H7.displayName;const qEe=S.forwardRef(({className:t,children:e,checked:n,...r},s)=>b.jsxs(V7,{ref:s,className:ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:n,...r,children:[b.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(W7,{children:b.jsx(f_,{className:"h-4 w-4"})})}),e]}));qEe.displayName=V7.displayName;const WEe=S.forwardRef(({className:t,children:e,...n},r)=>b.jsxs(q7,{ref:r,className:ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[b.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(W7,{children:b.jsx(rR,{className:"h-2 w-2 fill-current"})})}),e]}));WEe.displayName=q7.displayName;const GEe=S.forwardRef(({className:t,inset:e,...n},r)=>b.jsx(U7,{ref:r,className:ie("px-2 py-1.5 text-sm font-semibold text-foreground",e&&"pl-8",t),...n}));GEe.displayName=U7.displayName;const KEe=S.forwardRef(({className:t,...e},n)=>b.jsx(G7,{ref:n,className:ie("-mx-1 my-1 h-px bg-border",t),...e}));KEe.displayName=G7.displayName;function YEe(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 X7=oe.createContext({drawerRef:{current:null},overlayRef:{current:null},scaleBackground:()=>{},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,handleOnly:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},visible:!1,closeDrawer:()=>{},setVisible:()=>{},direction:"bottom"}),BR=()=>{const t=oe.useContext(X7);if(!t)throw new Error("useDrawerContext must be used within a Drawer.Root");return t};YEe("[vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1)}[vaul-drawer][vaul-drawer-direction=bottom]{transform:translate3d(0,100%,0)}[vaul-drawer][vaul-drawer-direction=top]{transform:translate3d(0,-100%,0)}[vaul-drawer][vaul-drawer-direction=left]{transform:translate3d(-100%,0,0)}[vaul-drawer][vaul-drawer-direction=right]{transform:translate3d(100%,0,0)}.vaul-dragging .vaul-scrollable [vault-drawer-direction=top]{overflow-y:hidden!important}.vaul-dragging .vaul-scrollable [vault-drawer-direction=bottom]{overflow-y:hidden!important}.vaul-dragging .vaul-scrollable [vault-drawer-direction=left]{overflow-x:hidden!important}.vaul-dragging .vaul-scrollable [vault-drawer-direction=right]{overflow-x:hidden!important}[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[vaul-overlay]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[vaul-overlay][vaul-drawer-visible=true]{opacity:1}[vaul-drawer]::after{content:'';position:absolute;background:inherit;background-color:inherit}[vaul-drawer][vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[vaul-drawer][vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[vaul-drawer][vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[vaul-drawer][vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[vaul-handle]{display:block;position:relative;opacity:.8;margin-left:auto;margin-right:auto;height:5px;width:56px;border-radius:1rem;touch-action:pan-y;cursor:grab}[vaul-handle]:active,[vaul-handle]:hover{opacity:1}[vaul-handle]:active{cursor:grabbing}[vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}[vaul-overlay][vaul-snap-points=true]:not([vaul-snap-points-overlay=true]):not([data-state=closed]){opacity:0}[vaul-overlay][vaul-snap-points-overlay=true]:not([vaul-drawer-visible=false]){opacity:1}@media (hover:hover) and (pointer:fine){[vaul-drawer]{user-select:none}}@media (pointer:fine){[vaul-handle-hitarea]:{width:100%;height:100%}}");const XEe=typeof window<"u"?S.useLayoutEffect:S.useEffect;function qM(...t){return(...e)=>{for(let n of t)typeof n=="function"&&n(...e)}}function QEe(){return P2(/^Mac/)}function ZEe(){return P2(/^iPhone/)}function JEe(){return P2(/^iPad/)||QEe()&&navigator.maxTouchPoints>1}function Q7(){return ZEe()||JEe()}function P2(t){return typeof window<"u"&&window.navigator!=null?t.test(window.navigator.platform):void 0}const fk=typeof document<"u"&&window.visualViewport;function h5(t){let e=window.getComputedStyle(t);return/(auto|scroll)/.test(e.overflow+e.overflowX+e.overflowY)}function Z7(t){for(h5(t)&&(t=t.parentElement);t&&!h5(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}const eAe=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let w1=0,hk;function tAe(t={}){let{isDisabled:e}=t;XEe(()=>{if(!e)return w1++,w1===1&&(Q7()?hk=rAe():hk=nAe()),()=>{w1--,w1===0&&hk()}},[e])}function nAe(){return qM(J7(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`))}function rAe(){let t,e=0,n=l=>{t=Z7(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,p=t.scrollTop,h=t.scrollHeight-t.clientHeight;h!==0&&((p<=0&&d>e||p>=h&&d<e)&&l.preventDefault(),e=d)},s=l=>{let d=l.target;WM(d)&&d!==document.activeElement&&(l.preventDefault(),d.style.transform="translateY(-2000px)",d.focus(),requestAnimationFrame(()=>{d.style.transform=""}))},i=l=>{let d=l.target;WM(d)&&(d.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{d.style.transform="",fk&&(fk.height<window.innerHeight?requestAnimationFrame(()=>{p5(d)}):fk.addEventListener("resize",()=>p5(d),{once:!0}))}))},o=()=>{window.scrollTo(0,0)},a=window.pageXOffset,c=window.pageYOffset,u=qM(J7(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let f=qM(wb(document,"touchstart",n,{passive:!1,capture:!0}),wb(document,"touchmove",r,{passive:!1,capture:!0}),wb(document,"touchend",s,{passive:!1,capture:!0}),wb(document,"focus",i,!0),wb(window,"scroll",o));return()=>{u(),f(),window.scrollTo(a,c)}}function J7(t,e,n){let r=t.style[e];return t.style[e]=n,()=>{t.style[e]=r}}function wb(t,e,n,r){return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}}function p5(t){let e=document.scrollingElement||document.documentElement;for(;t&&t!==e;){let n=Z7(t);if(n!==document.documentElement&&n!==document.body&&n!==t){let r=n.getBoundingClientRect().top,s=t.getBoundingClientRect().top,i=t.getBoundingClientRect().bottom;const o=n.getBoundingClientRect().bottom;i>o&&(n.scrollTop+=s-r)}t=n.parentElement}}function WM(t){return t instanceof HTMLInputElement&&!eAe.has(t.type)||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable}function sAe(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function iAe(...t){return e=>t.forEach(n=>sAe(n,e))}function eK(...t){return S.useCallback(iAe(...t),t)}let _b=null;function oAe({isOpen:t,modal:e,nested:n,hasBeenOpened:r,preventScrollRestoration:s,noBodyStyles:i}){const[o,a]=oe.useState(()=>typeof window<"u"?window.location.href:""),c=oe.useRef(0),u=oe.useCallback(()=>{if(_b===null&&t&&!i){_b={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 p=d-window.innerHeight;p&&c.current>=d&&(document.body.style.top=`${-(c.current+p)}px`)}),300)}},[t]),f=oe.useCallback(()=>{if(_b!==null&&!i){const l=-parseInt(document.body.style.top,10),d=-parseInt(document.body.style.left,10);Object.assign(document.body.style,_b),window.requestAnimationFrame(()=>{if(s&&o!==window.location.href){a(window.location.href);return}window.scrollTo(d,l)}),_b=null}},[o]);return oe.useEffect(()=>{function l(){c.current=window.scrollY}return l(),window.addEventListener("scroll",l),()=>{window.removeEventListener("scroll",l)}},[]),oe.useEffect(()=>{n||!r||(t?(!window.matchMedia("(display-mode: standalone)").matches&&u(),e||window.setTimeout(()=>{f()},500)):f())},[t,r,o,e,n,u,f]),{restorePositionSetting:f}}const tK=new WeakMap;function Wn(t,e,n=!1){if(!t||!(t instanceof HTMLElement))return;let r={};Object.entries(e).forEach(([s,i])=>{if(s.startsWith("--")){t.style.setProperty(s,i);return}r[s]=t.style[s],t.style[s]=i}),!n&&tK.set(t,r)}function _1(t,e){if(!t||!(t instanceof HTMLElement))return;let n=tK.get(t);n&&(e?t.style[e]=n[e]:Object.entries(n).forEach(([r,s])=>{t.style[r]=s}))}const Rr=t=>{switch(t){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return t}};function S1(t,e){if(!t)return null;const n=window.getComputedStyle(t),r=n.transform||n.webkitTransform||n.mozTransform;let s=r.match(/^matrix3d\((.+)\)$/);return s?parseFloat(s[1].split(", ")[Rr(e)?13:12]):(s=r.match(/^matrix\((.+)\)$/),s?parseFloat(s[1].split(", ")[Rr(e)?5:4]):null)}function aAe(t){return 8*(Math.log(t+1)-2)}const Dn={DURATION:.5,EASE:[.32,.72,0,1]},nK=.4;function rK(t){const e=oe.useRef(t);return oe.useEffect(()=>{e.current=t}),oe.useMemo(()=>(...n)=>e.current==null?void 0:e.current.call(e,...n),[])}function lAe({defaultProp:t,onChange:e}){const n=oe.useState(t),[r]=n,s=oe.useRef(r),i=rK(e);return oe.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}function cAe({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,s]=lAe({defaultProp:e,onChange:n}),i=t!==void 0,o=i?t:r,a=rK(n),c=oe.useCallback(u=>{if(i){const l=typeof u=="function"?u(t):u;l!==t&&a(l)}else s(u)},[i,t,s,a]);return[o,c]}function uAe({activeSnapPointProp:t,setActiveSnapPointProp:e,snapPoints:n,drawerRef:r,overlayRef:s,fadeFromIndex:i,onSnapPointChange:o,direction:a="bottom"}){const[c,u]=cAe({prop:t,defaultProp:n==null?void 0:n[0],onChange:e}),f=oe.useMemo(()=>c===(n==null?void 0:n[n.length-1])||null,[n,c]),l=n&&n.length>0&&(i||i===0)&&!Number.isNaN(i)&&n[i]===c||!n,d=oe.useMemo(()=>n==null?void 0:n.findIndex(x=>x===c),[n,c]),p=oe.useMemo(()=>{var x;return(x=n==null?void 0:n.map(_=>{const A=typeof window<"u",N=typeof _=="string";let T=0;if(N&&(T=parseInt(_,10)),Rr(a)){const P=N?T:A?_*window.innerHeight:0;return A?a==="bottom"?window.innerHeight-P:-window.innerHeight+P:P}const E=N?T:A?_*window.innerWidth:0;return A?a==="right"?window.innerWidth-E:-window.innerWidth+E:E}))!=null?x:[]},[n]),h=oe.useMemo(()=>d!==null?p==null?void 0:p[d]:null,[p,d]),m=oe.useCallback(x=>{var _;const A=(_=p==null?void 0:p.findIndex(N=>N===x))!=null?_:null;o(A),Wn(r.current,{transition:`transform ${Dn.DURATION}s cubic-bezier(${Dn.EASE.join(",")})`,transform:Rr(a)?`translate3d(0, ${x}px, 0)`:`translate3d(${x}px, 0, 0)`}),p&&A!==p.length-1&&A!==i?Wn(s.current,{transition:`opacity ${Dn.DURATION}s cubic-bezier(${Dn.EASE.join(",")})`,opacity:"0"}):Wn(s.current,{transition:`opacity ${Dn.DURATION}s cubic-bezier(${Dn.EASE.join(",")})`,opacity:"1"}),u(A!==null?n==null?void 0:n[A]:null)},[r.current,n,p,i,s,u]);oe.useEffect(()=>{if(c||t){var x;const _=(x=n==null?void 0:n.findIndex(A=>A===t||A===c))!=null?x:-1;p&&_!==-1&&typeof p[_]=="number"&&m(p[_])}},[c,t,n,p,m]);function y({draggedDistance:x,closeDrawer:_,velocity:A,dismissible:N}){if(i===void 0)return;const T=a==="bottom"||a==="right"?(h??0)-x:(h??0)+x,E=d===i-1,P=d===0,k=x>0;if(E&&Wn(s.current,{transition:`opacity ${Dn.DURATION}s cubic-bezier(${Dn.EASE.join(",")})`}),A>2&&!k){N?_():m(p[0]);return}if(A>2&&k&&p&&n){m(p[n.length-1]);return}const M=p==null?void 0:p.reduce((j,L)=>typeof j!="number"||typeof L!="number"?j:Math.abs(L-T)<Math.abs(j-T)?L:j),I=Rr(a)?window.innerHeight:window.innerWidth;if(A>nK&&Math.abs(x)<I*.4){const j=k?1:-1;if(j>0&&f){m(p[n.length-1]);return}if(P&&j<0&&N&&_(),d===null)return;m(p[d+j]);return}m(M)}function g({draggedDistance:x}){if(h===null)return;const _=a==="bottom"||a==="right"?h-x:h+x;(a==="bottom"||a==="right")&&_<p[p.length-1]||(a==="top"||a==="left")&&_>p[p.length-1]||Wn(r.current,{transform:Rr(a)?`translate3d(0, ${_}px, 0)`:`translate3d(${_}px, 0, 0)`})}function v(x,_){if(!n||typeof d!="number"||!p||i===void 0)return null;const A=d===i-1;if(d>=i&&_)return 0;if(A&&!_)return 1;if(!l&&!A)return null;const T=A?d+1:d-1,E=A?p[T]-p[T-1]:p[T+1]-p[T],P=x/Math.abs(E);return A?1-P:P}return{isLastSnapPoint:f,activeSnapPoint:c,shouldFade:l,getPercentageDragged:v,setActiveSnapPoint:u,activeSnapPointIndex:d,onRelease:y,onDrag:g,snapPointsOffset:p}}const dAe=.25,fAe=100,m5=8,Lf=16,g5=26,pk="vaul-dragging";function sK({open:t,onOpenChange:e,children:n,shouldScaleBackground:r,onDrag:s,onRelease:i,snapPoints:o,nested:a=!1,setBackgroundColorOnScale:c=!0,closeThreshold:u=dAe,scrollLockTimeout:f=fAe,dismissible:l=!0,handleOnly:d=!1,fadeFromIndex:p=o&&o.length-1,activeSnapPoint:h,setActiveSnapPoint:m,fixed:y,modal:g=!0,onClose:v,noBodyStyles:x,direction:_="bottom",preventScrollRestoration:A=!0,disablePreventScroll:N=!1}){var T;const[E=!1,P]=oe.useState(!1),[k,M]=oe.useState(!1),[I,j]=oe.useState(!1),[L,H]=oe.useState(!1),[K,V]=oe.useState(!1),[U,Q]=oe.useState(!1),ne=oe.useRef(null),X=oe.useRef(null),G=oe.useRef(null),Y=oe.useRef(null),Z=oe.useRef(null),he=oe.useRef(!1),fe=oe.useRef(null),ce=oe.useRef(0),xe=oe.useRef(!1),Ne=oe.useRef(0),pe=oe.useRef(null),Le=oe.useRef(((T=pe.current)==null?void 0:T.getBoundingClientRect().height)||0),Me=oe.useRef(0),Oe=oe.useCallback($e=>{o&&$e===ee.length-1&&(X.current=new Date)},[]),{activeSnapPoint:Fe,activeSnapPointIndex:ot,setActiveSnapPoint:nt,onRelease:At,snapPointsOffset:ee,onDrag:de,shouldFade:me,getPercentageDragged:Re}=uAe({snapPoints:o,activeSnapPointProp:h,setActiveSnapPointProp:m,drawerRef:pe,fadeFromIndex:p,overlayRef:ne,onSnapPointChange:Oe,direction:_});tAe({isDisabled:!E||K||!g||U||!k||N});const{restorePositionSetting:Pe}=oAe({isOpen:E,modal:g,nested:a,hasBeenOpened:k,preventScrollRestoration:A,noBodyStyles:x});function Ee(){return(window.innerWidth-g5)/window.innerWidth}function Ve($e){var Xe;!l&&!o||pe.current&&!pe.current.contains($e.target)||(Le.current=((Xe=pe.current)==null?void 0:Xe.getBoundingClientRect().height)||0,V(!0),G.current=new Date,Q7()&&window.addEventListener("touchend",()=>he.current=!1,{once:!0}),$e.target.setPointerCapture($e.pointerId),ce.current=Rr(_)?$e.clientY:$e.clientX)}function tt($e,Xe){var ht;let Ze=$e;const yt=(ht=window.getSelection())==null?void 0:ht.toString(),Pt=pe.current?S1(pe.current,_):null,St=new Date;if(Ze.hasAttribute("data-vaul-no-drag")||Ze.closest("[data-vaul-no-drag]"))return!1;if(_==="right"||_==="left")return!0;if(X.current&&St.getTime()-X.current.getTime()<500)return!1;if(Pt!==null&&(_==="bottom"?Pt>0:Pt<0))return!0;if(yt&&yt.length>0)return!1;if(Z.current&&St.getTime()-Z.current.getTime()<f&&Pt===0||Xe)return Z.current=St,!1;for(;Ze;){if(Ze.scrollHeight>Ze.clientHeight){if(Ze.scrollTop!==0)return Z.current=new Date,!1;if(Ze.getAttribute("role")==="dialog")return!0}Ze=Ze.parentNode}return!0}function qt($e){if(pe.current&&K){const Xe=_==="bottom"||_==="right"?1:-1,ht=(ce.current-(Rr(_)?$e.clientY:$e.clientX))*Xe,Ze=ht>0,yt=o&&!l&&!Ze;if(yt&&ot===0)return;const Pt=Math.abs(ht),St=document.querySelector("[vaul-drawer-wrapper]");let Wt=Pt/Le.current;const Zt=Re(Pt,Ze);if(Zt!==null&&(Wt=Zt),yt&&Wt>=1||!he.current&&!tt($e.target,Ze))return;if(pe.current.classList.add(pk),he.current=!0,Wn(pe.current,{transition:"none"}),Wn(ne.current,{transition:"none"}),o&&de({draggedDistance:ht}),Ze&&!o){const Pn=aAe(ht),Cr=Math.min(Pn*-1,0)*Xe;Wn(pe.current,{transform:Rr(_)?`translate3d(0, ${Cr}px, 0)`:`translate3d(${Cr}px, 0, 0)`});return}const ar=1-Wt;if((me||p&&ot===p-1)&&(s==null||s($e,Wt),Wn(ne.current,{opacity:`${ar}`,transition:"none"},!0)),St&&ne.current&&r){const Pn=Math.min(Ee()+Wt*(1-Ee()),1),Cr=8-Wt*8,Dr=Math.max(0,14-Wt*14);Wn(St,{borderRadius:`${Cr}px`,transform:Rr(_)?`scale(${Pn}) translate3d(0, ${Dr}px, 0)`:`scale(${Pn}) translate3d(${Dr}px, 0, 0)`,transition:"none"},!0)}if(!o){const Pn=Pt*Xe;Wn(pe.current,{transform:Rr(_)?`translate3d(0, ${Pn}px, 0)`:`translate3d(${Pn}px, 0, 0)`})}}}oe.useEffect(()=>()=>{_n(!1),Pe()},[]),oe.useEffect(()=>{var $e;function Xe(){if(!pe.current)return;const ht=document.activeElement;if(WM(ht)||xe.current){var Ze;const yt=((Ze=window.visualViewport)==null?void 0:Ze.height)||0;let Pt=window.innerHeight-yt;const St=pe.current.getBoundingClientRect().height||0;Me.current||(Me.current=St);const Wt=pe.current.getBoundingClientRect().top;if(Math.abs(Ne.current-Pt)>60&&(xe.current=!xe.current),o&&o.length>0&&ee&&ot){const Zt=ee[ot]||0;Pt+=Zt}if(Ne.current=Pt,St>yt||xe.current){const Zt=pe.current.getBoundingClientRect().height;let ar=Zt;Zt>yt&&(ar=yt-g5),y?pe.current.style.height=`${Zt-Math.max(Pt,0)}px`:pe.current.style.height=`${Math.max(ar,yt-Wt)}px`}else pe.current.style.height=`${Me.current}px`;o&&o.length>0&&!xe.current?pe.current.style.bottom="0px":pe.current.style.bottom=`${Math.max(Pt,0)}px`}}return($e=window.visualViewport)==null||$e.addEventListener("resize",Xe),()=>{var ht;return(ht=window.visualViewport)==null?void 0:ht.removeEventListener("resize",Xe)}},[ot,o,ee]);function gt(){pe.current&&(ln(),v==null||v(),Wn(pe.current,{transform:Rr(_)?`translate3d(0, ${_==="bottom"?"100%":"-100%"}, 0)`:`translate3d(${_==="right"?"100%":"-100%"}, 0, 0)`,transition:`transform ${Dn.DURATION}s cubic-bezier(${Dn.EASE.join(",")})`}),Wn(ne.current,{opacity:"0",transition:`opacity ${Dn.DURATION}s cubic-bezier(${Dn.EASE.join(",")})`}),_n(!1),setTimeout(()=>{j(!1),P(!1)},300),setTimeout(()=>{o&&nt(o[0])},Dn.DURATION*1e3))}oe.useEffect(()=>{if(!E&&r){const $e=setTimeout(()=>{_1(document.body)},200);return()=>clearTimeout($e)}},[E,r]),oe.useLayoutEffect(()=>{t?(P(!0),M(!0)):gt()},[t]),oe.useEffect(()=>{L&&(e==null||e(E))},[E]),oe.useEffect(()=>{H(!0)},[]);function kt(){if(!pe.current)return;const $e=document.querySelector("[vaul-drawer-wrapper]"),Xe=S1(pe.current,_);Wn(pe.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${Dn.DURATION}s cubic-bezier(${Dn.EASE.join(",")})`}),Wn(ne.current,{transition:`opacity ${Dn.DURATION}s cubic-bezier(${Dn.EASE.join(",")})`,opacity:"1"}),r&&Xe&&Xe>0&&E&&Wn($e,{borderRadius:`${m5}px`,overflow:"hidden",...Rr(_)?{transform:`scale(${Ee()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${Ee()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${Dn.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Dn.EASE.join(",")})`},!0)}function ln(){!K||!pe.current||(pe.current.classList.remove(pk),he.current=!1,V(!1),Y.current=new Date)}function gr($e){if(!K||!pe.current)return;pe.current.classList.remove(pk),he.current=!1,V(!1),Y.current=new Date;const Xe=S1(pe.current,_);if(!tt($e.target,!1)||!Xe||Number.isNaN(Xe)||G.current===null)return;const ht=Y.current.getTime()-G.current.getTime(),Ze=ce.current-(Rr(_)?$e.clientY:$e.clientX),yt=Math.abs(Ze)/ht;if(yt>.05&&(Q(!0),setTimeout(()=>{Q(!1)},200)),o){At({draggedDistance:Ze*(_==="bottom"||_==="right"?1:-1),closeDrawer:gt,velocity:yt,dismissible:l}),i==null||i($e,!0);return}if(_==="bottom"||_==="right"?Ze>0:Ze<0){kt(),i==null||i($e,!0);return}if(yt>nK){gt(),i==null||i($e,!1);return}var Pt;const St=Math.min((Pt=pe.current.getBoundingClientRect().height)!=null?Pt:0,window.innerHeight);if(Xe>=St*u){gt(),i==null||i($e,!1);return}i==null||i($e,!0),kt()}oe.useEffect(()=>{E&&(Wn(document.documentElement,{scrollBehavior:"auto"}),X.current=new Date,_n(!0))},[E]),oe.useEffect(()=>{if(pe.current&&I){var $e;const Xe=pe==null||($e=pe.current)==null?void 0:$e.querySelectorAll("*");Xe==null||Xe.forEach(ht=>{const Ze=ht;(Ze.scrollHeight>Ze.clientHeight||Ze.scrollWidth>Ze.clientWidth)&&Ze.classList.add("vaul-scrollable")})}},[I]);function _n($e){const Xe=document.querySelector("[vaul-drawer-wrapper]");!Xe||!r||($e?(c&&(x||(Wn(document.body,{background:document.body.style.backgroundColor||document.body.style.background}),Wn(document.body,{background:"black"},!0))),Wn(Xe,{borderRadius:`${m5}px`,overflow:"hidden",...Rr(_)?{transform:`scale(${Ee()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${Ee()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${Dn.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Dn.EASE.join(",")})`})):(_1(Xe,"overflow"),_1(Xe,"transform"),_1(Xe,"borderRadius"),Wn(Xe,{transitionProperty:"transform, border-radius",transitionDuration:`${Dn.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Dn.EASE.join(",")})`})))}function pi($e){const Xe=$e?(window.innerWidth-Lf)/window.innerWidth:1,ht=$e?-Lf:0;fe.current&&window.clearTimeout(fe.current),Wn(pe.current,{transition:`transform ${Dn.DURATION}s cubic-bezier(${Dn.EASE.join(",")})`,transform:`scale(${Xe}) translate3d(0, ${ht}px, 0)`}),!$e&&pe.current&&(fe.current=setTimeout(()=>{const Ze=S1(pe.current,_);Wn(pe.current,{transition:"none",transform:Rr(_)?`translate3d(0, ${Ze}px, 0)`:`translate3d(${Ze}px, 0, 0)`})},500))}function or($e,Xe){if(Xe<0)return;const ht=Rr(_)?window.innerHeight:window.innerWidth,Ze=(ht-Lf)/ht,yt=Ze+Xe*(1-Ze),Pt=-Lf+Xe*Lf;Wn(pe.current,{transform:Rr(_)?`scale(${yt}) translate3d(0, ${Pt}px, 0)`:`scale(${yt}) translate3d(${Pt}px, 0, 0)`,transition:"none"})}function mi($e,Xe){const ht=Rr(_)?window.innerHeight:window.innerWidth,Ze=Xe?(ht-Lf)/ht:1,yt=Xe?-Lf:0;Xe&&Wn(pe.current,{transition:`transform ${Dn.DURATION}s cubic-bezier(${Dn.EASE.join(",")})`,transform:Rr(_)?`scale(${Ze}) translate3d(0, ${yt}px, 0)`:`scale(${Ze}) translate3d(${yt}px, 0, 0)`})}return oe.createElement(oR,{modal:g,onOpenChange:$e=>{if(t!==void 0){e==null||e($e);return}$e?(M(!0),P($e)):gt()},open:E},oe.createElement(X7.Provider,{value:{visible:I,activeSnapPoint:Fe,snapPoints:o,setActiveSnapPoint:nt,drawerRef:pe,overlayRef:ne,scaleBackground:_n,onOpenChange:e,onPress:Ve,setVisible:j,onRelease:gr,onDrag:qt,dismissible:l,handleOnly:d,isOpen:E,isDragging:K,shouldFade:me,closeDrawer:gt,onNestedDrag:or,onNestedOpenChange:pi,onNestedRelease:mi,keyboardIsOpen:xe,openProp:t,modal:g,snapPointsOffset:ee,direction:_}},n))}const hAe=250,pAe=120,iK=oe.forwardRef(function({preventCycle:t=!1,children:e,...n},r){const{visible:s,closeDrawer:i,isDragging:o,snapPoints:a,activeSnapPoint:c,setActiveSnapPoint:u,dismissible:f,handleOnly:l,onPress:d,onDrag:p}=BR(),h=oe.useRef(null),m=oe.useRef(!1);function y(){if(m.current){x();return}window.setTimeout(()=>{g()},pAe)}function g(){if(o||t||m.current){x();return}if(x(),(!a||a.length===0)&&f){i();return}if(c===a[a.length-1]&&f){i();return}const A=a.findIndex(T=>T===c);if(A===-1)return;const N=a[A+1];u(N)}function v(){h.current=window.setTimeout(()=>{m.current=!0},hAe)}function x(){window.clearTimeout(h.current),m.current=!1}return oe.createElement("div",{onClick:y,onDoubleClick:()=>{m.current=!0,i()},onPointerCancel:x,onPointerDown:_=>{l&&d(_),v()},onPointerMove:_=>{l&&p(_)},ref:r,"vaul-drawer-visible":s?"true":"false","vaul-handle":"","aria-hidden":"true",...n},oe.createElement("span",{"vaul-handle-hitarea":"","aria-hidden":"true"},e))});iK.displayName="Drawer.Handle";const oK=oe.forwardRef(function({children:t,...e},n){const{overlayRef:r,snapPoints:s,onRelease:i,shouldFade:o,isOpen:a,visible:c}=BR(),u=eK(n,r),f=s&&s.length>0;return oe.createElement(gy,{onMouseUp:i,ref:u,"vaul-drawer-visible":c?"true":"false","vaul-overlay":"","vaul-snap-points":a&&f?"true":"false","vaul-snap-points-overlay":a&&o?"true":"false",...e})});oK.displayName="Drawer.Overlay";const aK=oe.forwardRef(function({onOpenAutoFocus:t,onPointerDownOutside:e,onAnimationEnd:n,style:r,...s},i){const{drawerRef:o,onPress:a,onRelease:c,onDrag:u,dismissible:f,keyboardIsOpen:l,snapPointsOffset:d,visible:p,closeDrawer:h,modal:m,openProp:y,onOpenChange:g,setVisible:v,handleOnly:x,direction:_}=BR(),A=eK(i,o),N=oe.useRef(null),T=oe.useRef(!1),E=(P,k,M=0)=>{if(T.current)return!0;const I=Math.abs(P.y),j=Math.abs(P.x),L=j>I,H=["bottom","right"].includes(k)?1:-1;if(k==="left"||k==="right"){if(!(P.x*H<0)&&j>=0&&j<=M)return L}else if(!(P.y*H<0)&&I>=0&&I<=M)return!L;return T.current=!0,!0};return oe.useEffect(()=>{v(!0)},[]),oe.createElement(vy,{"vaul-drawer":"","vaul-drawer-direction":_,"vaul-drawer-visible":p?"true":"false",...s,ref:A,style:d&&d.length>0?{"--snap-point-height":`${d[0]}px`,...r}:r,onOpenAutoFocus:P=>{if(t)t(P);else{var k;P.preventDefault(),(k=o.current)==null||k.focus()}},onPointerDown:P=>{x||(s.onPointerDown==null||s.onPointerDown.call(s,P),N.current={x:P.clientX,y:P.clientY},a(P))},onPointerDownOutside:P=>{if(e==null||e(P),!m||P.defaultPrevented){P.preventDefault();return}l.current&&(l.current=!1),P.preventDefault(),g==null||g(!1),!(!f||y!==void 0)&&h()},onFocusOutside:P=>{if(!m){P.preventDefault();return}},onEscapeKeyDown:P=>{if(!m){P.preventDefault();return}},onPointerMove:P=>{if(x||(s.onPointerMove==null||s.onPointerMove.call(s,P),!N.current))return;const k=P.clientY-N.current.y,M=P.clientX-N.current.x,I=P.pointerType==="touch"?10:2;E({x:M,y:k},_,I)?u(P):(Math.abs(M)>I||Math.abs(k)>I)&&(N.current=null)},onPointerUp:P=>{s.onPointerUp==null||s.onPointerUp.call(s,P),N.current=null,T.current=!1,c(P)}})});aK.displayName="Drawer.Content";function mAe({onDrag:t,onOpenChange:e,...n}){const{onNestedDrag:r,onNestedOpenChange:s,onNestedRelease:i}=BR();if(!r)throw new Error("Drawer.NestedRoot must be placed in another drawer");return oe.createElement(sK,{nested:!0,onClose:()=>{s(!1)},onDrag:(o,a)=>{r(o,a),t==null||t(o,a)},onOpenChange:o=>{o&&s(o),e==null||e(o)},onRelease:i,...n})}const Jl={Root:sK,NestedRoot:mAe,Content:aK,Handle:iK,Overlay:oK,Trigger:aR,Portal:lR,Close:xy,Title:yy,Description:by},T2=({shouldScaleBackground:t=!0,...e})=>b.jsx(Jl.Root,{shouldScaleBackground:t,...e});T2.displayName="Drawer";const gAe=Jl.Portal,lK=Jl.Close,cK=S.forwardRef(({className:t,...e},n)=>b.jsx(Jl.Overlay,{ref:n,className:ie("fixed inset-0 z-50 bg-black/80",t),...e}));cK.displayName=Jl.Overlay.displayName;const k2=S.forwardRef(({className:t,children:e,...n},r)=>b.jsxs(gAe,{children:[b.jsx(cK,{}),b.jsxs(Jl.Content,{ref:r,className:ie("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",t),...n,children:[b.jsx("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),e]})]}));k2.displayName="DrawerContent";const D2=({className:t,...e})=>b.jsx("div",{className:ie("grid gap-1.5 p-4 text-center sm:text-left",t),...e});D2.displayName="DrawerHeader";const M2=({className:t,...e})=>b.jsx("div",{className:ie("mt-auto flex flex-col gap-2 p-4",t),...e});M2.displayName="DrawerFooter";const O2=S.forwardRef(({className:t,...e},n)=>b.jsx(Jl.Title,{ref:n,className:ie("text-lg font-semibold leading-none tracking-tight",t),...e}));O2.displayName=Jl.Title.displayName;const I2=S.forwardRef(({className:t,...e},n)=>b.jsx(Jl.Description,{ref:n,className:ie("text-sm text-muted-foreground",t),...e}));I2.displayName=Jl.Description.displayName;var j2="DropdownMenu",[vAe,YUe]=In(j2,[k_]),fi=k_(),[yAe,uK]=vAe(j2),dK=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:o,modal:a=!0}=t,c=fi(e),u=S.useRef(null),[f=!1,l]=mr({prop:s,defaultProp:i,onChange:o});return b.jsx(yAe,{scope:e,triggerId:zs(),triggerRef:u,contentId:zs(),open:f,onOpenChange:l,onOpenToggle:S.useCallback(()=>l(d=>!d),[l]),modal:a,children:b.jsx(_Ee,{...c,open:f,onOpenChange:l,dir:r,modal:a,children:n})})};dK.displayName=j2;var fK="DropdownMenuTrigger",hK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=t,i=uK(fK,n),o=fi(n);return b.jsx(m2,{asChild:!0,...o,children:b.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:d_(e,i.triggerRef),onPointerDown:ye(t.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:ye(t.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});hK.displayName=fK;var bAe="DropdownMenuPortal",pK=t=>{const{__scopeDropdownMenu:e,...n}=t,r=fi(e);return b.jsx(g2,{...r,...n})};pK.displayName=bAe;var mK="DropdownMenuContent",gK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=uK(mK,n),i=fi(n),o=S.useRef(!1);return b.jsx(v2,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:e,onCloseAutoFocus:ye(t.onCloseAutoFocus,a=>{var c;o.current||(c=s.triggerRef.current)==null||c.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:ye(t.onInteractOutside,a=>{const c=a.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,f=c.button===2||u;(!s.modal||f)&&(o.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});gK.displayName=mK;var xAe="DropdownMenuGroup",vK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=fi(n);return b.jsx(y2,{...s,...r,ref:e})});vK.displayName=xAe;var wAe="DropdownMenuLabel",yK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=fi(n);return b.jsx(b2,{...s,...r,ref:e})});yK.displayName=wAe;var _Ae="DropdownMenuItem",bK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=fi(n);return b.jsx(x2,{...s,...r,ref:e})});bK.displayName=_Ae;var SAe="DropdownMenuCheckboxItem",xK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=fi(n);return b.jsx(w2,{...s,...r,ref:e})});xK.displayName=SAe;var CAe="DropdownMenuRadioGroup",EAe=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=fi(n);return b.jsx(_2,{...s,...r,ref:e})});EAe.displayName=CAe;var AAe="DropdownMenuRadioItem",wK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=fi(n);return b.jsx(S2,{...s,...r,ref:e})});wK.displayName=AAe;var RAe="DropdownMenuItemIndicator",_K=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=fi(n);return b.jsx(C2,{...s,...r,ref:e})});_K.displayName=RAe;var NAe="DropdownMenuSeparator",SK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=fi(n);return b.jsx(E2,{...s,...r,ref:e})});SK.displayName=NAe;var PAe="DropdownMenuArrow",TAe=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=fi(n);return b.jsx(A2,{...s,...r,ref:e})});TAe.displayName=PAe;var kAe="DropdownMenuSubTrigger",CK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=fi(n);return b.jsx(R2,{...s,...r,ref:e})});CK.displayName=kAe;var DAe="DropdownMenuSubContent",EK=S.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=fi(n);return b.jsx(N2,{...s,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});EK.displayName=DAe;var MAe=dK,OAe=hK,IAe=pK,AK=gK,jAe=vK,RK=yK,NK=bK,PK=xK,TK=wK,kK=_K,DK=SK,MK=CK,OK=EK;const M_=MAe,O_=OAe,LAe=jAe,$Ae=S.forwardRef(({className:t,inset:e,children:n,...r},s)=>b.jsxs(MK,{ref:s,className:ie("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",e&&"pl-8",t),...r,children:[n,b.jsx(fy,{className:"w-4 h-4 ml-auto"})]}));$Ae.displayName=MK.displayName;const FAe=S.forwardRef(({className:t,...e},n)=>b.jsx(OK,{ref:n,className:ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));FAe.displayName=OK.displayName;const Py=S.forwardRef(({className:t,sideOffset:e=4,...n},r)=>b.jsx(IAe,{children:b.jsx(AK,{ref:r,sideOffset:e,className:ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));Py.displayName=AK.displayName;const Xd=S.forwardRef(({className:t,inset:e,...n},r)=>b.jsx(NK,{ref:r,className:ie("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...n}));Xd.displayName=NK.displayName;const IK=S.forwardRef(({className:t,children:e,checked:n,...r},s)=>b.jsxs(PK,{ref:s,className:ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:n,...r,children:[b.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(kK,{children:b.jsx(f_,{className:"w-4 h-4"})})}),e]}));IK.displayName=PK.displayName;const zAe=S.forwardRef(({className:t,children:e,...n},r)=>b.jsxs(TK,{ref:r,className:ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[b.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(kK,{children:b.jsx(rR,{className:"w-2 h-2 fill-current"})})}),e]}));zAe.displayName=TK.displayName;const UR=S.forwardRef(({className:t,inset:e,...n},r)=>b.jsx(RK,{ref:r,className:ie("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));UR.displayName=RK.displayName;const Wv=S.forwardRef(({className:t,...e},n)=>b.jsx(DK,{ref:n,className:ie("-mx-1 my-1 h-px bg-muted",t),...e}));Wv.displayName=DK.displayName;const jK=({className:t,...e})=>b.jsx("span",{className:ie("ml-auto text-xs tracking-widest opacity-60",t),...e});jK.displayName="DropdownMenuShortcut";var I_=t=>t.type==="checkbox",Jm=t=>t instanceof Date,ni=t=>t==null;const LK=t=>typeof t=="object";var Kr=t=>!ni(t)&&!Array.isArray(t)&&LK(t)&&!Jm(t),$K=t=>Kr(t)&&t.target?I_(t.target)?t.target.checked:t.target.value:t,BAe=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,FK=(t,e)=>t.has(BAe(e)),UAe=t=>{const e=t.constructor&&t.constructor.prototype;return Kr(e)&&e.hasOwnProperty("isPrototypeOf")},L2=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Br(t){let e;const n=Array.isArray(t);if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else if(!(L2&&(t instanceof Blob||t instanceof FileList))&&(n||Kr(t)))if(e=n?[]:{},!n&&!UAe(t))e=t;else for(const r in t)t.hasOwnProperty(r)&&(e[r]=Br(t[r]));else return t;return e}var j_=t=>Array.isArray(t)?t.filter(Boolean):[],Fn=t=>t===void 0,Ie=(t,e,n)=>{if(!e||!Kr(t))return n;const r=j_(e.split(/[,[\].]+?/)).reduce((s,i)=>ni(s)?s:s[i],t);return Fn(r)||r===t?Fn(t[e])?n:t[e]:r},Ml=t=>typeof t=="boolean",$2=t=>/^\w*$/.test(t),zK=t=>j_(t.replace(/["|']|\]/g,"").split(/\.|\[/)),sn=(t,e,n)=>{let r=-1;const s=$2(e)?[e]:zK(e),i=s.length,o=i-1;for(;++r<i;){const a=s[r];let c=n;if(r!==o){const u=t[a];c=Kr(u)||Array.isArray(u)?u:isNaN(+s[r+1])?{}:[]}if(a==="__proto__")return;t[a]=c,t=t[a]}return t};const RE={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Jo={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},mc={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},BK=oe.createContext(null),qi=()=>oe.useContext(BK),HAe=t=>{const{children:e,...n}=t;return oe.createElement(BK.Provider,{value:n},e)};var UK=(t,e,n,r=!0)=>{const s={defaultValues:e._defaultValues};for(const i in t)Object.defineProperty(s,i,{get:()=>{const o=i;return e._proxyFormState[o]!==Jo.all&&(e._proxyFormState[o]=!r||Jo.all),n&&(n[o]=!0),t[o]}});return s},Js=t=>Kr(t)&&!Object.keys(t).length,HK=(t,e,n,r)=>{n(t);const{name:s,...i}=t;return Js(i)||Object.keys(i).length>=Object.keys(e).length||Object.keys(i).find(o=>e[o]===(!r||Jo.all))},Mi=t=>Array.isArray(t)?t:[t],VK=(t,e,n)=>!t||!e||t===e||Mi(t).some(r=>r&&(n?r===e:r.startsWith(e)||e.startsWith(r)));function HR(t){const e=oe.useRef(t);e.current=t,oe.useEffect(()=>{const n=!t.disabled&&e.current.subject&&e.current.subject.subscribe({next:e.current.next});return()=>{n&&n.unsubscribe()}},[t.disabled])}function qK(t){const e=qi(),{control:n=e.control,disabled:r,name:s,exact:i}=t||{},[o,a]=oe.useState(n._formState),c=oe.useRef(!0),u=oe.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),f=oe.useRef(s);return f.current=s,HR({disabled:r,next:l=>c.current&&VK(f.current,l.name,i)&&HK(l,u.current,n._updateFormState)&&a({...n._formState,...l}),subject:n._subjects.state}),oe.useEffect(()=>(c.current=!0,u.current.isValid&&n._updateValid(!0),()=>{c.current=!1}),[n]),UK(o,n,u.current,!1)}var Ll=t=>typeof t=="string",WK=(t,e,n,r,s)=>Ll(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 VAe(t){const e=qi(),{control:n=e.control,name:r,defaultValue:s,disabled:i,exact:o}=t||{},a=oe.useRef(r);a.current=r,HR({disabled:i,subject:n._subjects.values,next:f=>{VK(a.current,f.name,o)&&u(Br(WK(a.current,n._names,f.values||n._formValues,!1,s)))}});const[c,u]=oe.useState(n._getWatch(r,s));return oe.useEffect(()=>n._removeUnmounted()),c}function qAe(t){const e=qi(),{name:n,disabled:r,control:s=e.control,shouldUnregister:i}=t,o=FK(s._names.array,n),a=VAe({control:s,name:n,defaultValue:Ie(s._formValues,n,Ie(s._defaultValues,n,t.defaultValue)),exact:!0}),c=qK({control:s,name:n,exact:!0}),u=oe.useRef(s.register(n,{...t.rules,value:a,...Ml(t.disabled)?{disabled:t.disabled}:{}}));return oe.useEffect(()=>{const f=s._options.shouldUnregister||i,l=(d,p)=>{const h=Ie(s._fields,d);h&&h._f&&(h._f.mount=p)};if(l(n,!0),f){const d=Br(Ie(s._options.defaultValues,n));sn(s._defaultValues,n,d),Fn(Ie(s._formValues,n))&&sn(s._formValues,n,d)}return()=>{(o?f&&!s._state.action:f)?s.unregister(n):l(n,!1)}},[n,s,o,i]),oe.useEffect(()=>{Ie(s._fields,n)&&s._updateDisabledField({disabled:r,fields:s._fields,name:n,value:Ie(s._fields,n)._f.value})},[r,n,s]),{field:{name:n,value:a,...Ml(r)||c.disabled?{disabled:c.disabled||r}:{},onChange:oe.useCallback(f=>u.current.onChange({target:{value:$K(f),name:n},type:RE.CHANGE}),[n]),onBlur:oe.useCallback(()=>u.current.onBlur({target:{value:Ie(s._formValues,n),name:n},type:RE.BLUR}),[n,s]),ref:oe.useCallback(f=>{const l=Ie(s._fields,n);l&&f&&(l._f.ref={focus:()=>f.focus(),select:()=>f.select(),setCustomValidity:d=>f.setCustomValidity(d),reportValidity:()=>f.reportValidity()})},[s._fields,n])},formState:c,fieldState: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)}})}}const WAe=t=>t.render(qAe(t));var GK=(t,e,n,r,s)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:s||!0}}:{},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)})},mk=(t,e,n={})=>n.shouldFocus||Fn(n.shouldFocus)?n.focusName||`${t}.${Fn(n.focusIndex)?e:n.focusIndex}.`:"",w0=t=>({isOnSubmit:!t||t===Jo.onSubmit,isOnBlur:t===Jo.onBlur,isOnChange:t===Jo.onChange,isOnAll:t===Jo.all,isOnTouch:t===Jo.onTouched}),GM=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const vg=(t,e,n,r)=>{for(const s of n||Object.keys(t)){const i=Ie(t,s);if(i){const{_f:o,...a}=i;if(o){if(o.refs&&o.refs[0]&&e(o.refs[0],s)&&!r)break;if(o.ref&&e(o.ref,o.name)&&!r)break;vg(a,e)}else Kr(a)&&vg(a,e)}}};var KK=(t,e,n)=>{const r=Mi(Ie(t,n));return sn(r,"root",e[n]),sn(t,n,r),t},F2=t=>t.type==="file",zd=t=>typeof t=="function",NE=t=>{if(!L2)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},oC=t=>Ll(t),z2=t=>t.type==="radio",PE=t=>t instanceof RegExp;const v5={value:!1,isValid:!1},y5={value:!0,isValid:!0};var YK=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!Fn(t[0].attributes.value)?Fn(t[0].value)||t[0].value===""?y5:{value:t[0].value,isValid:!0}:y5:v5}return v5};const b5={isValid:!1,value:null};var XK=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,b5):b5;function x5(t,e,n="validate"){if(oC(t)||Array.isArray(t)&&t.every(oC)||Ml(t)&&!t)return{type:n,message:oC(t)?t:"",ref:e}}var Cm=t=>Kr(t)&&!PE(t)?t:{value:t,message:""},KM=async(t,e,n,r,s)=>{const{ref:i,refs:o,required:a,maxLength:c,minLength:u,min:f,max:l,pattern:d,validate:p,name:h,valueAsNumber:m,mount:y,disabled:g}=t._f,v=Ie(e,h);if(!y||g)return{};const x=o?o[0]:i,_=I=>{r&&x.reportValidity&&(x.setCustomValidity(Ml(I)?"":I||""),x.reportValidity())},A={},N=z2(i),T=I_(i),E=N||T,P=(m||F2(i))&&Fn(i.value)&&Fn(v)||NE(i)&&i.value===""||v===""||Array.isArray(v)&&!v.length,k=GK.bind(null,h,n,A),M=(I,j,L,H=mc.maxLength,K=mc.minLength)=>{const V=I?j:L;A[h]={type:I?H:K,message:V,ref:i,...k(I?H:K,V)}};if(s?!Array.isArray(v)||!v.length:a&&(!E&&(P||ni(v))||Ml(v)&&!v||T&&!YK(o).isValid||N&&!XK(o).isValid)){const{value:I,message:j}=oC(a)?{value:!!a,message:a}:Cm(a);if(I&&(A[h]={type:mc.required,message:j,ref:x,...k(mc.required,j)},!n))return _(j),A}if(!P&&(!ni(f)||!ni(l))){let I,j;const L=Cm(l),H=Cm(f);if(!ni(v)&&!isNaN(v)){const K=i.valueAsNumber||v&&+v;ni(L.value)||(I=K>L.value),ni(H.value)||(j=K<H.value)}else{const K=i.valueAsDate||new Date(v),V=ne=>new Date(new Date().toDateString()+" "+ne),U=i.type=="time",Q=i.type=="week";Ll(L.value)&&v&&(I=U?V(v)>V(L.value):Q?v>L.value:K>new Date(L.value)),Ll(H.value)&&v&&(j=U?V(v)<V(H.value):Q?v<H.value:K<new Date(H.value))}if((I||j)&&(M(!!I,L.message,H.message,mc.max,mc.min),!n))return _(A[h].message),A}if((c||u)&&!P&&(Ll(v)||s&&Array.isArray(v))){const I=Cm(c),j=Cm(u),L=!ni(I.value)&&v.length>+I.value,H=!ni(j.value)&&v.length<+j.value;if((L||H)&&(M(L,I.message,j.message),!n))return _(A[h].message),A}if(d&&!P&&Ll(v)){const{value:I,message:j}=Cm(d);if(PE(I)&&!v.match(I)&&(A[h]={type:mc.pattern,message:j,ref:i,...k(mc.pattern,j)},!n))return _(j),A}if(p){if(zd(p)){const I=await p(v,e),j=x5(I,x);if(j&&(A[h]={...j,...k(mc.validate,j.message)},!n))return _(j.message),A}else if(Kr(p)){let I={};for(const j in p){if(!Js(I)&&!n)break;const L=x5(await p[j](v,e),x,j);L&&(I={...L,...k(j,L.message)},_(L.message),n&&(A[h]=I))}if(!Js(I)&&(A[h]={ref:x,...I},!n))return A}}return _(!0),A},gk=(t,e)=>[...t,...Mi(e)],vk=t=>Array.isArray(t)?t.map(()=>{}):void 0;function yk(t,e,n){return[...t.slice(0,e),...Mi(n),...t.slice(e)]}var bk=(t,e,n)=>Array.isArray(t)?(Fn(t[n])&&(t[n]=void 0),t.splice(n,0,t.splice(e,1)[0]),t):[],xk=(t,e)=>[...Mi(e),...Mi(t)];function GAe(t,e){let n=0;const r=[...t];for(const s of e)r.splice(s-n,1),n++;return j_(r).length?r:[]}var wk=(t,e)=>Fn(e)?[]:GAe(t,Mi(e).sort((n,r)=>n-r)),_k=(t,e,n)=>{[t[e],t[n]]=[t[n],t[e]]};function KAe(t,e){const n=e.slice(0,-1).length;let r=0;for(;r<n;)t=Fn(t)?r++:t[e[r++]];return t}function YAe(t){for(const e in t)if(t.hasOwnProperty(e)&&!Fn(t[e]))return!1;return!0}function Ar(t,e){const n=Array.isArray(e)?e:$2(e)?[e]:zK(e),r=n.length===1?t:KAe(t,n),s=n.length-1,i=n[s];return r&&delete r[i],s!==0&&(Kr(r)&&Js(r)||Array.isArray(r)&&YAe(r))&&Ar(t,n.slice(0,-1)),t}var w5=(t,e,n)=>(t[e]=n,t);function XAe(t){const e=qi(),{control:n=e.control,name:r,keyName:s="id",shouldUnregister:i}=t,[o,a]=oe.useState(n._getFieldArray(r)),c=oe.useRef(n._getFieldArray(r).map(Vu)),u=oe.useRef(o),f=oe.useRef(r),l=oe.useRef(!1);f.current=r,u.current=o,n._names.array.add(r),t.rules&&n.register(r,t.rules),HR({next:({values:A,name:N})=>{if(N===f.current||!N){const T=Ie(A,f.current);Array.isArray(T)&&(a(T),c.current=T.map(Vu))}},subject:n._subjects.array});const d=oe.useCallback(A=>{l.current=!0,n._updateFieldArray(r,A)},[n,r]),p=(A,N)=>{const T=Mi(Br(A)),E=gk(n._getFieldArray(r),T);n._names.focus=mk(r,E.length-1,N),c.current=gk(c.current,T.map(Vu)),d(E),a(E),n._updateFieldArray(r,E,gk,{argA:vk(A)})},h=(A,N)=>{const T=Mi(Br(A)),E=xk(n._getFieldArray(r),T);n._names.focus=mk(r,0,N),c.current=xk(c.current,T.map(Vu)),d(E),a(E),n._updateFieldArray(r,E,xk,{argA:vk(A)})},m=A=>{const N=wk(n._getFieldArray(r),A);c.current=wk(c.current,A),d(N),a(N),n._updateFieldArray(r,N,wk,{argA:A})},y=(A,N,T)=>{const E=Mi(Br(N)),P=yk(n._getFieldArray(r),A,E);n._names.focus=mk(r,A,T),c.current=yk(c.current,A,E.map(Vu)),d(P),a(P),n._updateFieldArray(r,P,yk,{argA:A,argB:vk(N)})},g=(A,N)=>{const T=n._getFieldArray(r);_k(T,A,N),_k(c.current,A,N),d(T),a(T),n._updateFieldArray(r,T,_k,{argA:A,argB:N},!1)},v=(A,N)=>{const T=n._getFieldArray(r);bk(T,A,N),bk(c.current,A,N),d(T),a(T),n._updateFieldArray(r,T,bk,{argA:A,argB:N},!1)},x=(A,N)=>{const T=Br(N),E=w5(n._getFieldArray(r),A,T);c.current=[...E].map((P,k)=>!P||k===A?Vu():c.current[k]),d(E),a([...E]),n._updateFieldArray(r,E,w5,{argA:A,argB:T},!0,!1)},_=A=>{const N=Mi(Br(A));c.current=N.map(Vu),d([...N]),a([...N]),n._updateFieldArray(r,[...N],T=>T,{},!0,!1)};return oe.useEffect(()=>{if(n._state.action=!1,GM(r,n._names)&&n._subjects.state.next({...n._formState}),l.current&&(!w0(n._options.mode).isOnSubmit||n._formState.isSubmitted))if(n._options.resolver)n._executeSchema([r]).then(A=>{const N=Ie(A.errors,r),T=Ie(n._formState.errors,r);(T?!N&&T.type||N&&(T.type!==N.type||T.message!==N.message):N&&N.type)&&(N?sn(n._formState.errors,r,N):Ar(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const A=Ie(n._fields,r);A&&A._f&&!(w0(n._options.reValidateMode).isOnSubmit&&w0(n._options.mode).isOnSubmit)&&KM(A,n._formValues,n._options.criteriaMode===Jo.all,n._options.shouldUseNativeValidation,!0).then(N=>!Js(N)&&n._subjects.state.next({errors:KK(n._formState.errors,N,r)}))}n._subjects.values.next({name:r,values:{...n._formValues}}),n._names.focus&&vg(n._fields,(A,N)=>{if(n._names.focus&&N.startsWith(n._names.focus)&&A.focus)return A.focus(),1}),n._names.focus="",n._updateValid(),l.current=!1},[o,r,n]),oe.useEffect(()=>(!Ie(n._formValues,r)&&n._updateFieldArray(r),()=>{(n._options.shouldUnregister||i)&&n.unregister(r)}),[r,n,s,i]),{swap:oe.useCallback(g,[d,r,n]),move:oe.useCallback(v,[d,r,n]),prepend:oe.useCallback(h,[d,r,n]),append:oe.useCallback(p,[d,r,n]),remove:oe.useCallback(m,[d,r,n]),insert:oe.useCallback(y,[d,r,n]),update:oe.useCallback(x,[d,r,n]),replace:oe.useCallback(_,[d,r,n]),fields:oe.useMemo(()=>o.map((A,N)=>({...A,[s]:c.current[N]||Vu()})),[o,s])}}var Sk=()=>{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=[]}}},TE=t=>ni(t)||!LK(t);function eh(t,e){if(TE(t)||TE(e))return t===e;if(Jm(t)&&Jm(e))return t.getTime()===e.getTime();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const s of n){const i=t[s];if(!r.includes(s))return!1;if(s!=="ref"){const o=e[s];if(Jm(i)&&Jm(o)||Kr(i)&&Kr(o)||Array.isArray(i)&&Array.isArray(o)?!eh(i,o):i!==o)return!1}}return!0}var QK=t=>t.type==="select-multiple",QAe=t=>z2(t)||I_(t),Ck=t=>NE(t)&&t.isConnected,ZK=t=>{for(const e in t)if(zd(t[e]))return!0;return!1};function kE(t,e={}){const n=Array.isArray(t);if(Kr(t)||n)for(const r in t)Array.isArray(t[r])||Kr(t[r])&&!ZK(t[r])?(e[r]=Array.isArray(t[r])?[]:{},kE(t[r],e[r])):ni(t[r])||(e[r]=!0);return e}function JK(t,e,n){const r=Array.isArray(t);if(Kr(t)||r)for(const s in t)Array.isArray(t[s])||Kr(t[s])&&!ZK(t[s])?Fn(e)||TE(n[s])?n[s]=Array.isArray(t[s])?kE(t[s],[]):{...kE(t[s])}:JK(t[s],ni(e)?{}:e[s],n[s]):n[s]=!eh(t[s],e[s]);return n}var C1=(t,e)=>JK(t,e,kE(e)),e9=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>Fn(t)?t:e?t===""?NaN:t&&+t:n&&Ll(t)?new Date(t):r?r(t):t;function Ek(t){const e=t.ref;if(!(t.refs?t.refs.every(n=>n.disabled):e.disabled))return F2(e)?e.files:z2(e)?XK(t.refs).value:QK(e)?[...e.selectedOptions].map(({value:n})=>n):I_(e)?YK(t.refs).value:e9(Fn(e.value)?t.ref.value:e.value,t)}var ZAe=(t,e,n,r)=>{const s={};for(const i of t){const o=Ie(e,i);o&&sn(s,i,o._f)}return{criteriaMode:n,names:[...t],fields:s,shouldUseNativeValidation:r}},Sb=t=>Fn(t)?t:PE(t)?t.source:Kr(t)?PE(t.value)?t.value.source:t.value:t,JAe=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate);function _5(t,e,n){const r=Ie(t,n);if(r||$2(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const i=s.join("."),o=Ie(e,i),a=Ie(t,i);if(o&&!Array.isArray(o)&&n!==i)return{name:n};if(a&&a.type)return{name:i,error:a};s.pop()}return{name:n}}var eRe=(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,tRe=(t,e)=>!j_(Ie(t,e)).length&&Ar(t,e);const nRe={mode:Jo.onSubmit,reValidateMode:Jo.onChange,shouldFocusError:!0};function rRe(t={}){let e={...nRe,...t},n={submitCount:0,isDirty:!1,isLoading:zd(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},r={},s=Kr(e.defaultValues)||Kr(e.values)?Br(e.defaultValues||e.values)||{}:{},i=e.shouldUnregister?{}:Br(s),o={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},l={values:Sk(),array:Sk(),state:Sk()},d=w0(e.mode),p=w0(e.reValidateMode),h=e.criteriaMode===Jo.all,m=ee=>de=>{clearTimeout(u),u=setTimeout(ee,de)},y=async ee=>{if(f.isValid||ee){const de=e.resolver?Js((await E()).errors):await k(r,!0);de!==n.isValid&&l.state.next({isValid:de})}},g=(ee,de)=>{(f.isValidating||f.validatingFields)&&((ee||Array.from(a.mount)).forEach(me=>{me&&(de?sn(n.validatingFields,me,de):Ar(n.validatingFields,me))}),l.state.next({validatingFields:n.validatingFields,isValidating:!Js(n.validatingFields)}))},v=(ee,de=[],me,Re,Pe=!0,Ee=!0)=>{if(Re&&me){if(o.action=!0,Ee&&Array.isArray(Ie(r,ee))){const Ve=me(Ie(r,ee),Re.argA,Re.argB);Pe&&sn(r,ee,Ve)}if(Ee&&Array.isArray(Ie(n.errors,ee))){const Ve=me(Ie(n.errors,ee),Re.argA,Re.argB);Pe&&sn(n.errors,ee,Ve),tRe(n.errors,ee)}if(f.touchedFields&&Ee&&Array.isArray(Ie(n.touchedFields,ee))){const Ve=me(Ie(n.touchedFields,ee),Re.argA,Re.argB);Pe&&sn(n.touchedFields,ee,Ve)}f.dirtyFields&&(n.dirtyFields=C1(s,i)),l.state.next({name:ee,isDirty:I(ee,de),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else sn(i,ee,de)},x=(ee,de)=>{sn(n.errors,ee,de),l.state.next({errors:n.errors})},_=ee=>{n.errors=ee,l.state.next({errors:n.errors,isValid:!1})},A=(ee,de,me,Re)=>{const Pe=Ie(r,ee);if(Pe){const Ee=Ie(i,ee,Fn(me)?Ie(s,ee):me);Fn(Ee)||Re&&Re.defaultChecked||de?sn(i,ee,de?Ee:Ek(Pe._f)):H(ee,Ee),o.mount&&y()}},N=(ee,de,me,Re,Pe)=>{let Ee=!1,Ve=!1;const tt={name:ee},qt=!!(Ie(r,ee)&&Ie(r,ee)._f&&Ie(r,ee)._f.disabled);if(!me||Re){f.isDirty&&(Ve=n.isDirty,n.isDirty=tt.isDirty=I(),Ee=Ve!==tt.isDirty);const gt=qt||eh(Ie(s,ee),de);Ve=!!(!qt&&Ie(n.dirtyFields,ee)),gt||qt?Ar(n.dirtyFields,ee):sn(n.dirtyFields,ee,!0),tt.dirtyFields=n.dirtyFields,Ee=Ee||f.dirtyFields&&Ve!==!gt}if(me){const gt=Ie(n.touchedFields,ee);gt||(sn(n.touchedFields,ee,me),tt.touchedFields=n.touchedFields,Ee=Ee||f.touchedFields&>!==me)}return Ee&&Pe&&l.state.next(tt),Ee?tt:{}},T=(ee,de,me,Re)=>{const Pe=Ie(n.errors,ee),Ee=f.isValid&&Ml(de)&&n.isValid!==de;if(t.delayError&&me?(c=m(()=>x(ee,me)),c(t.delayError)):(clearTimeout(u),c=null,me?sn(n.errors,ee,me):Ar(n.errors,ee)),(me?!eh(Pe,me):Pe)||!Js(Re)||Ee){const Ve={...Re,...Ee&&Ml(de)?{isValid:de}:{},errors:n.errors,name:ee};n={...n,...Ve},l.state.next(Ve)}},E=async ee=>{g(ee,!0);const de=await e.resolver(i,e.context,ZAe(ee||a.mount,r,e.criteriaMode,e.shouldUseNativeValidation));return g(ee),de},P=async ee=>{const{errors:de}=await E(ee);if(ee)for(const me of ee){const Re=Ie(de,me);Re?sn(n.errors,me,Re):Ar(n.errors,me)}else n.errors=de;return de},k=async(ee,de,me={valid:!0})=>{for(const Re in ee){const Pe=ee[Re];if(Pe){const{_f:Ee,...Ve}=Pe;if(Ee){const tt=a.array.has(Ee.name);g([Re],!0);const qt=await KM(Pe,i,h,e.shouldUseNativeValidation&&!de,tt);if(g([Re]),qt[Ee.name]&&(me.valid=!1,de))break;!de&&(Ie(qt,Ee.name)?tt?KK(n.errors,qt,Ee.name):sn(n.errors,Ee.name,qt[Ee.name]):Ar(n.errors,Ee.name))}!Js(Ve)&&await k(Ve,de,me)}}return me.valid},M=()=>{for(const ee of a.unMount){const de=Ie(r,ee);de&&(de._f.refs?de._f.refs.every(me=>!Ck(me)):!Ck(de._f.ref))&&fe(ee)}a.unMount=new Set},I=(ee,de)=>(ee&&de&&sn(i,ee,de),!eh(X(),s)),j=(ee,de,me)=>WK(ee,a,{...o.mount?i:Fn(de)?s:Ll(ee)?{[ee]:de}:de},me,de),L=ee=>j_(Ie(o.mount?i:s,ee,t.shouldUnregister?Ie(s,ee,[]):[])),H=(ee,de,me={})=>{const Re=Ie(r,ee);let Pe=de;if(Re){const Ee=Re._f;Ee&&(!Ee.disabled&&sn(i,ee,e9(de,Ee)),Pe=NE(Ee.ref)&&ni(de)?"":de,QK(Ee.ref)?[...Ee.ref.options].forEach(Ve=>Ve.selected=Pe.includes(Ve.value)):Ee.refs?I_(Ee.ref)?Ee.refs.length>1?Ee.refs.forEach(Ve=>(!Ve.defaultChecked||!Ve.disabled)&&(Ve.checked=Array.isArray(Pe)?!!Pe.find(tt=>tt===Ve.value):Pe===Ve.value)):Ee.refs[0]&&(Ee.refs[0].checked=!!Pe):Ee.refs.forEach(Ve=>Ve.checked=Ve.value===Pe):F2(Ee.ref)?Ee.ref.value="":(Ee.ref.value=Pe,Ee.ref.type||l.values.next({name:ee,values:{...i}})))}(me.shouldDirty||me.shouldTouch)&&N(ee,Pe,me.shouldTouch,me.shouldDirty,!0),me.shouldValidate&&ne(ee)},K=(ee,de,me)=>{for(const Re in de){const Pe=de[Re],Ee=`${ee}.${Re}`,Ve=Ie(r,Ee);(a.array.has(ee)||!TE(Pe)||Ve&&!Ve._f)&&!Jm(Pe)?K(Ee,Pe,me):H(Ee,Pe,me)}},V=(ee,de,me={})=>{const Re=Ie(r,ee),Pe=a.array.has(ee),Ee=Br(de);sn(i,ee,Ee),Pe?(l.array.next({name:ee,values:{...i}}),(f.isDirty||f.dirtyFields)&&me.shouldDirty&&l.state.next({name:ee,dirtyFields:C1(s,i),isDirty:I(ee,Ee)})):Re&&!Re._f&&!ni(Ee)?K(ee,Ee,me):H(ee,Ee,me),GM(ee,a)&&l.state.next({...n}),l.values.next({name:o.mount?ee:void 0,values:{...i}})},U=async ee=>{o.mount=!0;const de=ee.target;let me=de.name,Re=!0;const Pe=Ie(r,me),Ee=()=>de.type?Ek(Pe._f):$K(ee),Ve=tt=>{Re=Number.isNaN(tt)||tt===Ie(i,me,tt)};if(Pe){let tt,qt;const gt=Ee(),kt=ee.type===RE.BLUR||ee.type===RE.FOCUS_OUT,ln=!JAe(Pe._f)&&!e.resolver&&!Ie(n.errors,me)&&!Pe._f.deps||eRe(kt,Ie(n.touchedFields,me),n.isSubmitted,p,d),gr=GM(me,a,kt);sn(i,me,gt),kt?(Pe._f.onBlur&&Pe._f.onBlur(ee),c&&c(0)):Pe._f.onChange&&Pe._f.onChange(ee);const _n=N(me,gt,kt,!1),pi=!Js(_n)||gr;if(!kt&&l.values.next({name:me,type:ee.type,values:{...i}}),ln)return f.isValid&&y(),pi&&l.state.next({name:me,...gr?{}:_n});if(!kt&&gr&&l.state.next({...n}),e.resolver){const{errors:or}=await E([me]);if(Ve(gt),Re){const mi=_5(n.errors,r,me),$e=_5(or,r,mi.name||me);tt=$e.error,me=$e.name,qt=Js(or)}}else g([me],!0),tt=(await KM(Pe,i,h,e.shouldUseNativeValidation))[me],g([me]),Ve(gt),Re&&(tt?qt=!1:f.isValid&&(qt=await k(r,!0)));Re&&(Pe._f.deps&&ne(Pe._f.deps),T(me,qt,tt,_n))}},Q=(ee,de)=>{if(Ie(n.errors,de)&&ee.focus)return ee.focus(),1},ne=async(ee,de={})=>{let me,Re;const Pe=Mi(ee);if(e.resolver){const Ee=await P(Fn(ee)?ee:Pe);me=Js(Ee),Re=ee?!Pe.some(Ve=>Ie(Ee,Ve)):me}else ee?(Re=(await Promise.all(Pe.map(async Ee=>{const Ve=Ie(r,Ee);return await k(Ve&&Ve._f?{[Ee]:Ve}:Ve)}))).every(Boolean),!(!Re&&!n.isValid)&&y()):Re=me=await k(r);return l.state.next({...!Ll(ee)||f.isValid&&me!==n.isValid?{}:{name:ee},...e.resolver||!ee?{isValid:me}:{},errors:n.errors}),de.shouldFocus&&!Re&&vg(r,Q,ee?Pe:a.mount),Re},X=ee=>{const de={...o.mount?i:s};return Fn(ee)?de:Ll(ee)?Ie(de,ee):ee.map(me=>Ie(de,me))},G=(ee,de)=>({invalid:!!Ie((de||n).errors,ee),isDirty:!!Ie((de||n).dirtyFields,ee),error:Ie((de||n).errors,ee),isValidating:!!Ie(n.validatingFields,ee),isTouched:!!Ie((de||n).touchedFields,ee)}),Y=ee=>{ee&&Mi(ee).forEach(de=>Ar(n.errors,de)),l.state.next({errors:ee?n.errors:{}})},Z=(ee,de,me)=>{const Re=(Ie(r,ee,{_f:{}})._f||{}).ref,Pe=Ie(n.errors,ee)||{},{ref:Ee,message:Ve,type:tt,...qt}=Pe;sn(n.errors,ee,{...qt,...de,ref:Re}),l.state.next({name:ee,errors:n.errors,isValid:!1}),me&&me.shouldFocus&&Re&&Re.focus&&Re.focus()},he=(ee,de)=>zd(ee)?l.values.subscribe({next:me=>ee(j(void 0,de),me)}):j(ee,de,!0),fe=(ee,de={})=>{for(const me of ee?Mi(ee):a.mount)a.mount.delete(me),a.array.delete(me),de.keepValue||(Ar(r,me),Ar(i,me)),!de.keepError&&Ar(n.errors,me),!de.keepDirty&&Ar(n.dirtyFields,me),!de.keepTouched&&Ar(n.touchedFields,me),!de.keepIsValidating&&Ar(n.validatingFields,me),!e.shouldUnregister&&!de.keepDefaultValue&&Ar(s,me);l.values.next({values:{...i}}),l.state.next({...n,...de.keepDirty?{isDirty:I()}:{}}),!de.keepIsValid&&y()},ce=({disabled:ee,name:de,field:me,fields:Re,value:Pe})=>{if(Ml(ee)&&o.mount||ee){const Ee=ee?void 0:Fn(Pe)?Ek(me?me._f:Ie(Re,de)._f):Pe;sn(i,de,Ee),N(de,Ee,!1,!1,!0)}},xe=(ee,de={})=>{let me=Ie(r,ee);const Re=Ml(de.disabled);return sn(r,ee,{...me||{},_f:{...me&&me._f?me._f:{ref:{name:ee}},name:ee,mount:!0,...de}}),a.mount.add(ee),me?ce({field:me,disabled:de.disabled,name:ee,value:de.value}):A(ee,!0,de.value),{...Re?{disabled:de.disabled}:{},...e.progressive?{required:!!de.required,min:Sb(de.min),max:Sb(de.max),minLength:Sb(de.minLength),maxLength:Sb(de.maxLength),pattern:Sb(de.pattern)}:{},name:ee,onChange:U,onBlur:U,ref:Pe=>{if(Pe){xe(ee,de),me=Ie(r,ee);const Ee=Fn(Pe.value)&&Pe.querySelectorAll&&Pe.querySelectorAll("input,select,textarea")[0]||Pe,Ve=QAe(Ee),tt=me._f.refs||[];if(Ve?tt.find(qt=>qt===Ee):Ee===me._f.ref)return;sn(r,ee,{_f:{...me._f,...Ve?{refs:[...tt.filter(Ck),Ee,...Array.isArray(Ie(s,ee))?[{}]:[]],ref:{type:Ee.type,name:ee}}:{ref:Ee}}}),A(ee,!1,void 0,Ee)}else me=Ie(r,ee,{}),me._f&&(me._f.mount=!1),(e.shouldUnregister||de.shouldUnregister)&&!(FK(a.array,ee)&&o.action)&&a.unMount.add(ee)}}},Ne=()=>e.shouldFocusError&&vg(r,Q,a.mount),pe=ee=>{Ml(ee)&&(l.state.next({disabled:ee}),vg(r,(de,me)=>{const Re=Ie(r,me);Re&&(de.disabled=Re._f.disabled||ee,Array.isArray(Re._f.refs)&&Re._f.refs.forEach(Pe=>{Pe.disabled=Re._f.disabled||ee}))},0,!1))},Le=(ee,de)=>async me=>{let Re;me&&(me.preventDefault&&me.preventDefault(),me.persist&&me.persist());let Pe=Br(i);if(l.state.next({isSubmitting:!0}),e.resolver){const{errors:Ee,values:Ve}=await E();n.errors=Ee,Pe=Ve}else await k(r);if(Ar(n.errors,"root"),Js(n.errors)){l.state.next({errors:{}});try{await ee(Pe,me)}catch(Ee){Re=Ee}}else de&&await de({...n.errors},me),Ne(),setTimeout(Ne);if(l.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Js(n.errors)&&!Re,submitCount:n.submitCount+1,errors:n.errors}),Re)throw Re},Me=(ee,de={})=>{Ie(r,ee)&&(Fn(de.defaultValue)?V(ee,Br(Ie(s,ee))):(V(ee,de.defaultValue),sn(s,ee,Br(de.defaultValue))),de.keepTouched||Ar(n.touchedFields,ee),de.keepDirty||(Ar(n.dirtyFields,ee),n.isDirty=de.defaultValue?I(ee,Br(Ie(s,ee))):I()),de.keepError||(Ar(n.errors,ee),f.isValid&&y()),l.state.next({...n}))},Oe=(ee,de={})=>{const me=ee?Br(ee):s,Re=Br(me),Pe=Js(ee),Ee=Pe?s:Re;if(de.keepDefaultValues||(s=me),!de.keepValues){if(de.keepDirtyValues)for(const Ve of a.mount)Ie(n.dirtyFields,Ve)?sn(Ee,Ve,Ie(i,Ve)):V(Ve,Ie(Ee,Ve));else{if(L2&&Fn(ee))for(const Ve of a.mount){const tt=Ie(r,Ve);if(tt&&tt._f){const qt=Array.isArray(tt._f.refs)?tt._f.refs[0]:tt._f.ref;if(NE(qt)){const gt=qt.closest("form");if(gt){gt.reset();break}}}}r={}}i=t.shouldUnregister?de.keepDefaultValues?Br(s):{}:Br(Ee),l.array.next({values:{...Ee}}),l.values.next({values:{...Ee}})}a={mount:de.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!f.isValid||!!de.keepIsValid||!!de.keepDirtyValues,o.watch=!!t.shouldUnregister,l.state.next({submitCount:de.keepSubmitCount?n.submitCount:0,isDirty:Pe?!1:de.keepDirty?n.isDirty:!!(de.keepDefaultValues&&!eh(ee,s)),isSubmitted:de.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Pe?{}:de.keepDirtyValues?de.keepDefaultValues&&i?C1(s,i):n.dirtyFields:de.keepDefaultValues&&ee?C1(s,ee):de.keepDirty?n.dirtyFields:{},touchedFields:de.keepTouched?n.touchedFields:{},errors:de.keepErrors?n.errors:{},isSubmitSuccessful:de.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Fe=(ee,de)=>Oe(zd(ee)?ee(i):ee,de);return{control:{register:xe,unregister:fe,getFieldState:G,handleSubmit:Le,setError:Z,_executeSchema:E,_getWatch:j,_getDirty:I,_updateValid:y,_removeUnmounted:M,_updateFieldArray:v,_updateDisabledField:ce,_getFieldArray:L,_reset:Oe,_resetDefaultValues:()=>zd(e.defaultValues)&&e.defaultValues().then(ee=>{Fe(ee,e.resetOptions),l.state.next({isLoading:!1})}),_updateFormState:ee=>{n={...n,...ee}},_disableForm:pe,_subjects:l,_proxyFormState:f,_setErrors:_,get _fields(){return r},get _formValues(){return i},get _state(){return o},set _state(ee){o=ee},get _defaultValues(){return s},get _names(){return a},set _names(ee){a=ee},get _formState(){return n},set _formState(ee){n=ee},get _options(){return e},set _options(ee){e={...e,...ee}}},trigger:ne,register:xe,handleSubmit:Le,watch:he,setValue:V,getValues:X,reset:Fe,resetField:Me,clearErrors:Y,unregister:fe,setError:Z,setFocus:(ee,de={})=>{const me=Ie(r,ee),Re=me&&me._f;if(Re){const Pe=Re.refs?Re.refs[0]:Re.ref;Pe.focus&&(Pe.focus(),de.shouldSelect&&Pe.select())}},getFieldState:G}}function L_(t={}){const e=oe.useRef(),n=oe.useRef(),[r,s]=oe.useState({isDirty:!1,isValidating:!1,isLoading:zd(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,defaultValues:zd(t.defaultValues)?void 0:t.defaultValues});e.current||(e.current={...rRe(t),formState:r});const i=e.current.control;return i._options=t,HR({subject:i._subjects.state,next:o=>{HK(o,i._proxyFormState,i._updateFormState,!0)&&s({...i._formState})}}),oe.useEffect(()=>i._disableForm(t.disabled),[i,t.disabled]),oe.useEffect(()=>{if(i._proxyFormState.isDirty){const o=i._getDirty();o!==r.isDirty&&i._subjects.state.next({isDirty:o})}},[i,r.isDirty]),oe.useEffect(()=>{t.values&&!eh(t.values,n.current)?(i._reset(t.values,i._options.resetOptions),n.current=t.values,s(o=>({...o}))):i._resetDefaultValues()},[t.values,i]),oe.useEffect(()=>{t.errors&&i._setErrors(t.errors)},[t.errors,i]),oe.useEffect(()=>{i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),oe.useEffect(()=>{t.shouldUnregister&&i._subjects.values.next({values:i._getWatch()})},[t.shouldUnregister,i]),e.current.formState=UK(r,i),e.current}var sRe="Label",t9=S.forwardRef((t,e)=>b.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())}}));t9.displayName=sRe;var n9=t9;const iRe=di("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Gp=S.forwardRef(({className:t,...e},n)=>b.jsx(n9,{ref:n,className:ie(iRe(),t),...e}));Gp.displayName=n9.displayName;const $_=HAe,r9=S.createContext({}),Ty=({...t})=>b.jsx(r9.Provider,{value:{name:t.name},children:b.jsx(WAe,{...t})}),ky=()=>{const t=S.useContext(r9),e=S.useContext(s9),{getFieldState:n,formState:r}=qi(),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}},s9=S.createContext({}),Kp=S.forwardRef(({className:t,...e},n)=>{const r=S.useId();return b.jsx(s9.Provider,{value:{id:r},children:b.jsx("div",{ref:n,className:ie("space-y-2",t),...e})})});Kp.displayName="FormItem";const i9=S.forwardRef(({className:t,...e},n)=>{const{error:r,formItemId:s}=ky();return b.jsx(Gp,{ref:n,className:ie(r&&"text-destructive",t),htmlFor:s,...e})});i9.displayName="FormLabel";const Yp=S.forwardRef(({...t},e)=>{const{error:n,formItemId:r,formDescriptionId:s,formMessageId:i}=ky();return b.jsx(Ka,{ref:e,id:r,"aria-describedby":n?`${s} ${i}`:`${s}`,"aria-invalid":!!n,...t})});Yp.displayName="FormControl";const Xp=S.forwardRef(({className:t,...e},n)=>{const{formDescriptionId:r}=ky();return b.jsx("p",{ref:n,id:r,className:ie("text-sm text-muted-foreground",t),...e})});Xp.displayName="FormDescription";const o9=S.forwardRef(({className:t,children:e,...n},r)=>{var a;const{error:s,formMessageId:i}=ky(),o=s&&s.message?String((s==null?void 0:s.message)||((a=s.root)==null?void 0:a.message)):e;return o?b.jsx("p",{ref:r,id:i,className:ie("text-sm font-medium text-destructive",t),...n,children:o}):null});o9.displayName="FormMessage";var Ak,a9="HoverCard",[l9,XUe]=In(a9,[Ql]),B2=Ql(),[QUe,U2]=l9(a9),c9="HoverCardTrigger",oRe=S.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,s=U2(c9,n),i=B2(n);return b.jsx(Ny,{asChild:!0,...i,children:b.jsx(De.a,{"data-state":s.open?"open":"closed",...r,ref:e,onPointerEnter:ye(t.onPointerEnter,ME(s.onOpen)),onPointerLeave:ye(t.onPointerLeave,ME(s.onClose)),onFocus:ye(t.onFocus,s.onOpen),onBlur:ye(t.onBlur,s.onClose),onTouchStart:ye(t.onTouchStart,o=>o.preventDefault())})})});oRe.displayName=c9;var aRe="HoverCardPortal",[ZUe,lRe]=l9(aRe,{forceMount:void 0}),DE="HoverCardContent",u9=S.forwardRef((t,e)=>{const n=lRe(DE,t.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=t,i=U2(DE,t.__scopeHoverCard);return b.jsx(Kn,{present:r||i.open,children:b.jsx(cRe,{"data-state":i.open?"open":"closed",...s,onPointerEnter:ye(t.onPointerEnter,ME(i.onOpen)),onPointerLeave:ye(t.onPointerLeave,ME(i.onClose)),ref:e})})});u9.displayName=DE;var cRe=S.forwardRef((t,e)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,...a}=t,c=U2(DE,n),u=B2(n),f=S.useRef(null),l=et(e,f),[d,p]=S.useState(!1);return S.useEffect(()=>{if(d){const h=document.body;return Ak=h.style.userSelect||h.style.webkitUserSelect,h.style.userSelect="none",h.style.webkitUserSelect="none",()=>{h.style.userSelect=Ak,h.style.webkitUserSelect=Ak}}},[d]),S.useEffect(()=>{if(f.current){const h=()=>{p(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var y;((y=document.getSelection())==null?void 0:y.toString())!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",h),()=>{document.removeEventListener("pointerup",h),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),S.useEffect(()=>{f.current&&fRe(f.current).forEach(m=>m.setAttribute("tabindex","-1"))}),b.jsx(Au,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:o,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:ye(i,h=>{h.preventDefault()}),onDismiss:c.onDismiss,children:b.jsx(A_,{...u,...a,onPointerDown:ye(a.onPointerDown,h=>{h.currentTarget.contains(h.target)&&p(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:l,style:{...a.style,userSelect: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)"}})})}),uRe="HoverCardArrow",dRe=S.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,s=B2(n);return b.jsx(R_,{...s,...r,ref:e})});dRe.displayName=uRe;function ME(t){return e=>e.pointerType==="touch"?void 0:t()}function fRe(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 d9=u9;const hRe=S.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},s)=>b.jsx(d9,{ref:s,align:e,sideOffset:n,className:ie("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r}));hRe.displayName=d9.displayName;const F_=S.forwardRef(({className:t,type:e,...n},r)=>b.jsx("input",{type:e,className:ie("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:r,...n}));F_.displayName="Input";var VR="Menubar",[YM,pRe,mRe]=Cu(VR),[f9,JUe]=In(VR,[mRe,Zl]),Wi=k_(),h9=Zl(),[gRe,p9]=f9(VR),m9=S.forwardRef((t,e)=>{const{__scopeMenubar:n,value:r,onValueChange:s,defaultValue:i,loop:o=!0,dir:a,...c}=t,u=el(a),f=h9(n),[l="",d]=mr({prop:r,onChange:s,defaultProp:i}),[p,h]=S.useState(null);return b.jsx(gRe,{scope:n,value:l,onMenuOpen:S.useCallback(m=>{d(m),h(m)},[d]),onMenuClose:S.useCallback(()=>d(""),[d]),onMenuToggle:S.useCallback(m=>{d(y=>y?"":m),h(m)},[d]),dir:u,loop:o,children:b.jsx(YM.Provider,{scope:n,children:b.jsx(YM.Slot,{scope:n,children:b.jsx(N_,{asChild:!0,...f,orientation:"horizontal",loop:o,dir:u,currentTabStopId:p,onCurrentTabStopIdChange:h,children:b.jsx(De.div,{role:"menubar",...c,ref:e})})})})})});m9.displayName=VR;var vRe="MenubarMenu",[eHe,g9]=f9(vRe),XM="MenubarTrigger",v9=S.forwardRef((t,e)=>{const{__scopeMenubar:n,disabled:r=!1,...s}=t,i=h9(n),o=Wi(n),a=p9(XM,n),c=g9(XM,n),u=S.useRef(null),f=et(e,u,c.triggerRef),[l,d]=S.useState(!1),p=a.value===c.value;return b.jsx(YM.ItemSlot,{scope:n,value:c.value,disabled:r,children:b.jsx(P_,{asChild:!0,...i,focusable:!r,tabStopId:c.value,children:b.jsx(m2,{asChild:!0,...o,children:b.jsx(De.button,{type:"button",role:"menuitem",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":p,"aria-controls":p?c.contentId:void 0,"data-highlighted":l?"":void 0,"data-state":p?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:f,onPointerDown:ye(t.onPointerDown,h=>{!r&&h.button===0&&h.ctrlKey===!1&&(a.onMenuOpen(c.value),p||h.preventDefault())}),onPointerEnter:ye(t.onPointerEnter,()=>{var m;!!a.value&&!p&&(a.onMenuOpen(c.value),(m=u.current)==null||m.focus())}),onKeyDown:ye(t.onKeyDown,h=>{r||(["Enter"," "].includes(h.key)&&a.onMenuToggle(c.value),h.key==="ArrowDown"&&a.onMenuOpen(c.value),["Enter"," ","ArrowDown"].includes(h.key)&&(c.wasKeyboardTriggerOpenRef.current=!0,h.preventDefault()))}),onFocus:ye(t.onFocus,()=>d(!0)),onBlur:ye(t.onBlur,()=>d(!1))})})})})});v9.displayName=XM;var yRe="MenubarPortal",y9=t=>{const{__scopeMenubar:e,...n}=t,r=Wi(e);return b.jsx(g2,{...r,...n})};y9.displayName=yRe;var QM="MenubarContent",b9=S.forwardRef((t,e)=>{const{__scopeMenubar:n,align:r="start",...s}=t,i=Wi(n),o=p9(QM,n),a=g9(QM,n),c=pRe(n),u=S.useRef(!1);return b.jsx(v2,{id:a.contentId,"aria-labelledby":a.triggerId,"data-radix-menubar-content":"",...i,...s,ref:e,align:r,onCloseAutoFocus:ye(t.onCloseAutoFocus,f=>{var d;!!!o.value&&!u.current&&((d=a.triggerRef.current)==null||d.focus()),u.current=!1,f.preventDefault()}),onFocusOutside:ye(t.onFocusOutside,f=>{const l=f.target;c().some(p=>{var h;return(h=p.ref.current)==null?void 0:h.contains(l)})&&f.preventDefault()}),onInteractOutside:ye(t.onInteractOutside,()=>{u.current=!0}),onEntryFocus:f=>{a.wasKeyboardTriggerOpenRef.current||f.preventDefault()},onKeyDown:ye(t.onKeyDown,f=>{if(["ArrowRight","ArrowLeft"].includes(f.key)){const l=f.target,d=l.hasAttribute("data-radix-menubar-subtrigger"),p=l.closest("[data-radix-menubar-content]")!==f.currentTarget,m=(o.dir==="rtl"?"ArrowRight":"ArrowLeft")===f.key;if(!m&&d||p&&m)return;let v=c().filter(A=>!A.disabled).map(A=>A.value);m&&v.reverse();const x=v.indexOf(a.value);v=o.loop?MRe(v,x+1):v.slice(x+1);const[_]=v;_&&o.onMenuOpen(_)}},{checkForDefaultPrevented:!1}),style:{...t.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});b9.displayName=QM;var bRe="MenubarGroup",xRe=S.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Wi(n);return b.jsx(y2,{...s,...r,ref:e})});xRe.displayName=bRe;var wRe="MenubarLabel",x9=S.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Wi(n);return b.jsx(b2,{...s,...r,ref:e})});x9.displayName=wRe;var _Re="MenubarItem",w9=S.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Wi(n);return b.jsx(x2,{...s,...r,ref:e})});w9.displayName=_Re;var SRe="MenubarCheckboxItem",_9=S.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Wi(n);return b.jsx(w2,{...s,...r,ref:e})});_9.displayName=SRe;var CRe="MenubarRadioGroup",ERe=S.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Wi(n);return b.jsx(_2,{...s,...r,ref:e})});ERe.displayName=CRe;var ARe="MenubarRadioItem",S9=S.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Wi(n);return b.jsx(S2,{...s,...r,ref:e})});S9.displayName=ARe;var RRe="MenubarItemIndicator",C9=S.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Wi(n);return b.jsx(C2,{...s,...r,ref:e})});C9.displayName=RRe;var NRe="MenubarSeparator",E9=S.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Wi(n);return b.jsx(E2,{...s,...r,ref:e})});E9.displayName=NRe;var PRe="MenubarArrow",TRe=S.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Wi(n);return b.jsx(A2,{...s,...r,ref:e})});TRe.displayName=PRe;var kRe="MenubarSubTrigger",A9=S.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Wi(n);return b.jsx(R2,{"data-radix-menubar-subtrigger":"",...s,...r,ref:e})});A9.displayName=kRe;var DRe="MenubarSubContent",R9=S.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Wi(n);return b.jsx(N2,{...s,"data-radix-menubar-content":"",...r,ref:e,style:{...t.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});R9.displayName=DRe;function MRe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var N9=m9,P9=v9,ORe=y9,T9=b9,k9=x9,D9=w9,M9=_9,O9=S9,I9=C9,j9=E9,L9=A9,$9=R9;const IRe=S.forwardRef(({className:t,...e},n)=>b.jsx(N9,{ref:n,className:ie("flex h-10 items-center space-x-1 rounded-md border bg-background p-1",t),...e}));IRe.displayName=N9.displayName;const jRe=S.forwardRef(({className:t,...e},n)=>b.jsx(P9,{ref:n,className:ie("flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t),...e}));jRe.displayName=P9.displayName;const LRe=S.forwardRef(({className:t,inset:e,children:n,...r},s)=>b.jsxs(L9,{ref:s,className:ie("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e&&"pl-8",t),...r,children:[n,b.jsx(fy,{className:"ml-auto h-4 w-4"})]}));LRe.displayName=L9.displayName;const $Re=S.forwardRef(({className:t,...e},n)=>b.jsx($9,{ref:n,className:ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));$Re.displayName=$9.displayName;const FRe=S.forwardRef(({className:t,align:e="start",alignOffset:n=-4,sideOffset:r=8,...s},i)=>b.jsx(ORe,{children:b.jsx(T9,{ref:i,align:e,alignOffset:n,sideOffset:r,className:ie("z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...s})}));FRe.displayName=T9.displayName;const zRe=S.forwardRef(({className:t,inset:e,...n},r)=>b.jsx(D9,{ref:r,className:ie("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...n}));zRe.displayName=D9.displayName;const BRe=S.forwardRef(({className:t,children:e,checked:n,...r},s)=>b.jsxs(M9,{ref:s,className:ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:n,...r,children:[b.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(I9,{children:b.jsx(f_,{className:"h-4 w-4"})})}),e]}));BRe.displayName=M9.displayName;const URe=S.forwardRef(({className:t,children:e,...n},r)=>b.jsxs(O9,{ref:r,className:ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[b.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(I9,{children:b.jsx(rR,{className:"h-2 w-2 fill-current"})})}),e]}));URe.displayName=O9.displayName;const HRe=S.forwardRef(({className:t,inset:e,...n},r)=>b.jsx(k9,{ref:r,className:ie("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));HRe.displayName=k9.displayName;const VRe=S.forwardRef(({className:t,...e},n)=>b.jsx(j9,{ref:n,className:ie("-mx-1 my-1 h-px bg-muted",t),...e}));VRe.displayName=j9.displayName;var qRe="VisuallyHidden",z_=S.forwardRef((t,e)=>b.jsx(De.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));z_.displayName=qRe;var F9=z_,Dy="NavigationMenu",[H2,z9,WRe]=Cu(Dy),[ZM,GRe,KRe]=Cu(Dy),[V2,tHe]=In(Dy,[WRe,KRe]),[YRe,da]=V2(Dy),[XRe,QRe]=V2(Dy),B9=S.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:s,defaultValue:i,delayDuration:o=200,skipDelayDuration:a=300,orientation:c="horizontal",dir:u,...f}=t,[l,d]=S.useState(null),p=et(e,P=>d(P)),h=el(u),m=S.useRef(0),y=S.useRef(0),g=S.useRef(0),[v,x]=S.useState(!0),[_="",A]=mr({prop:r,onChange:P=>{const k=P!=="",M=a>0;k?(window.clearTimeout(g.current),M&&x(!1)):(window.clearTimeout(g.current),g.current=window.setTimeout(()=>x(!0),a)),s==null||s(P)},defaultProp:i}),N=S.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>A(""),150)},[A]),T=S.useCallback(P=>{window.clearTimeout(y.current),A(P)},[A]),E=S.useCallback(P=>{_===P?window.clearTimeout(y.current):m.current=window.setTimeout(()=>{window.clearTimeout(y.current),A(P)},o)},[_,A,o]);return S.useEffect(()=>()=>{window.clearTimeout(m.current),window.clearTimeout(y.current),window.clearTimeout(g.current)},[]),b.jsx(H9,{scope:n,isRootMenu:!0,value:_,dir:h,orientation:c,rootNavigationMenu:l,onTriggerEnter:P=>{window.clearTimeout(m.current),v?E(P):T(P)},onTriggerLeave:()=>{window.clearTimeout(m.current),N()},onContentEnter:()=>window.clearTimeout(y.current),onContentLeave:N,onItemSelect:P=>{A(k=>k===P?"":P)},onItemDismiss:()=>A(""),children:b.jsx(De.nav,{"aria-label":"Main","data-orientation":c,dir:h,...f,ref:p})})});B9.displayName=Dy;var U9="NavigationMenuSub",ZRe=S.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:s,defaultValue:i,orientation:o="horizontal",...a}=t,c=da(U9,n),[u="",f]=mr({prop:r,onChange:s,defaultProp:i});return b.jsx(H9,{scope:n,isRootMenu:!1,value:u,dir:c.dir,orientation:o,rootNavigationMenu:c.rootNavigationMenu,onTriggerEnter:l=>f(l),onItemSelect:l=>f(l),onItemDismiss:()=>f(""),children:b.jsx(De.div,{"data-orientation":o,...a,ref:e})})});ZRe.displayName=U9;var H9=t=>{const{scope:e,isRootMenu:n,rootNavigationMenu:r,dir:s,orientation:i,children:o,value:a,onItemSelect:c,onItemDismiss:u,onTriggerEnter:f,onTriggerLeave:l,onContentEnter:d,onContentLeave:p}=t,[h,m]=S.useState(null),[y,g]=S.useState(new Map),[v,x]=S.useState(null);return b.jsx(YRe,{scope:e,isRootMenu:n,rootNavigationMenu:r,value:a,previousValue:Cy(a),baseId:zs(),dir:s,orientation:i,viewport:h,onViewportChange:m,indicatorTrack:v,onIndicatorTrackChange:x,onTriggerEnter:on(f),onTriggerLeave:on(l),onContentEnter:on(d),onContentLeave:on(p),onItemSelect:on(c),onItemDismiss:on(u),onViewportContentChange:S.useCallback((_,A)=>{g(N=>(N.set(_,A),new Map(N)))},[]),onViewportContentRemove:S.useCallback(_=>{g(A=>A.has(_)?(A.delete(_),new Map(A)):A)},[]),children:b.jsx(H2.Provider,{scope:e,children:b.jsx(XRe,{scope:e,items:y,children:o})})})},V9="NavigationMenuList",q9=S.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=da(V9,n),i=b.jsx(De.ul,{"data-orientation":s.orientation,...r,ref:e});return b.jsx(De.div,{style:{position:"relative"},ref:s.onIndicatorTrackChange,children:b.jsx(H2.Slot,{scope:n,children:s.isRootMenu?b.jsx(J9,{asChild:!0,children:i}):i})})});q9.displayName=V9;var W9="NavigationMenuItem",[JRe,G9]=V2(W9),eNe=S.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,...s}=t,i=zs(),o=r||i||"LEGACY_REACT_AUTO_VALUE",a=S.useRef(null),c=S.useRef(null),u=S.useRef(null),f=S.useRef(()=>{}),l=S.useRef(!1),d=S.useCallback((h="start")=>{if(a.current){f.current();const m=eO(a.current);m.length&&G2(h==="start"?m:m.reverse())}},[]),p=S.useCallback(()=>{if(a.current){const h=eO(a.current);h.length&&(f.current=lNe(h))}},[]);return b.jsx(JRe,{scope:n,value:o,triggerRef:c,contentRef:a,focusProxyRef:u,wasEscapeCloseRef:l,onEntryKeyDown:d,onFocusProxyEnter:d,onRootContentClose:p,onContentFocusOutside:p,children:b.jsx(De.li,{...s,ref:e})})});eNe.displayName=W9;var JM="NavigationMenuTrigger",K9=S.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,disabled:r,...s}=t,i=da(JM,t.__scopeNavigationMenu),o=G9(JM,t.__scopeNavigationMenu),a=S.useRef(null),c=et(a,o.triggerRef,e),u=tY(i.baseId,o.value),f=nY(i.baseId,o.value),l=S.useRef(!1),d=S.useRef(!1),p=o.value===i.value;return b.jsxs(b.Fragment,{children:[b.jsx(H2.ItemSlot,{scope:n,value:o.value,children:b.jsx(eY,{asChild:!0,children:b.jsx(De.button,{id:u,disabled:r,"data-disabled":r?"":void 0,"data-state":K2(p),"aria-expanded":p,"aria-controls":f,...s,ref:c,onPointerEnter:ye(t.onPointerEnter,()=>{d.current=!1,o.wasEscapeCloseRef.current=!1}),onPointerMove:ye(t.onPointerMove,OE(()=>{r||d.current||o.wasEscapeCloseRef.current||l.current||(i.onTriggerEnter(o.value),l.current=!0)})),onPointerLeave:ye(t.onPointerLeave,OE(()=>{r||(i.onTriggerLeave(),l.current=!1)})),onClick:ye(t.onClick,()=>{i.onItemSelect(o.value),d.current=p}),onKeyDown:ye(t.onKeyDown,h=>{const y={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];p&&h.key===y&&(o.onEntryKeyDown(),h.preventDefault())})})})}),p&&b.jsxs(b.Fragment,{children:[b.jsx(F9,{"aria-hidden":!0,tabIndex:0,ref:o.focusProxyRef,onFocus:h=>{const m=o.contentRef.current,y=h.relatedTarget,g=y===a.current,v=m==null?void 0:m.contains(y);(g||!v)&&o.onFocusProxyEnter(g?"start":"end")}}),i.viewport&&b.jsx("span",{"aria-owns":f})]})]})});K9.displayName=JM;var tNe="NavigationMenuLink",S5="navigationMenu.linkSelect",nNe=S.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,active:r,onSelect:s,...i}=t;return b.jsx(eY,{asChild:!0,children:b.jsx(De.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...i,ref:e,onClick:ye(t.onClick,o=>{const a=o.target,c=new CustomEvent(S5,{bubbles:!0,cancelable:!0});if(a.addEventListener(S5,u=>s==null?void 0:s(u),{once:!0}),Z0(a,c),!c.defaultPrevented&&!o.metaKey){const u=new CustomEvent(aC,{bubbles:!0,cancelable:!0});Z0(a,u)}},{checkForDefaultPrevented:!1})})})});nNe.displayName=tNe;var q2="NavigationMenuIndicator",Y9=S.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=da(q2,t.__scopeNavigationMenu),i=!!s.value;return s.indicatorTrack?QA.createPortal(b.jsx(Kn,{present:n||i,children:b.jsx(rNe,{...r,ref:e})}),s.indicatorTrack):null});Y9.displayName=q2;var rNe=S.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=da(q2,n),i=z9(n),[o,a]=S.useState(null),[c,u]=S.useState(null),f=s.orientation==="horizontal",l=!!s.value;S.useEffect(()=>{var m;const h=(m=i().find(y=>y.value===s.value))==null?void 0:m.ref.current;h&&a(h)},[i,s.value]);const d=()=>{o&&u({size:f?o.offsetWidth:o.offsetHeight,offset:f?o.offsetLeft:o.offsetTop})};return tO(o,d),tO(s.indicatorTrack,d),c?b.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}),Gv="NavigationMenuContent",X9=S.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=da(Gv,t.__scopeNavigationMenu),i=G9(Gv,t.__scopeNavigationMenu),o=et(i.contentRef,e),a=i.value===s.value,c={value:i.value,triggerRef:i.triggerRef,focusProxyRef:i.focusProxyRef,wasEscapeCloseRef:i.wasEscapeCloseRef,onContentFocusOutside:i.onContentFocusOutside,onRootContentClose:i.onRootContentClose,...r};return s.viewport?b.jsx(sNe,{forceMount:n,...c,ref:o}):b.jsx(Kn,{present:n||a,children:b.jsx(Q9,{"data-state":K2(a),...c,ref:o,onPointerEnter:ye(t.onPointerEnter,s.onContentEnter),onPointerLeave:ye(t.onPointerLeave,OE(s.onContentLeave)),style:{pointerEvents:!a&&s.isRootMenu?"none":void 0,...c.style}})})});X9.displayName=Gv;var sNe=S.forwardRef((t,e)=>{const n=da(Gv,t.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:s}=n;return ir(()=>{r(t.value,{ref:e,...t})},[t,e,r]),ir(()=>()=>s(t.value),[t.value,s]),null}),aC="navigationMenu.rootContentDismiss",Q9=S.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:s,focusProxyRef:i,wasEscapeCloseRef:o,onRootContentClose:a,onContentFocusOutside:c,...u}=t,f=da(Gv,n),l=S.useRef(null),d=et(l,e),p=tY(f.baseId,r),h=nY(f.baseId,r),m=z9(n),y=S.useRef(null),{onItemDismiss:g}=f;S.useEffect(()=>{const x=l.current;if(f.isRootMenu&&x){const _=()=>{var A;g(),a(),x.contains(document.activeElement)&&((A=s.current)==null||A.focus())};return x.addEventListener(aC,_),()=>x.removeEventListener(aC,_)}},[f.isRootMenu,t.value,s,g,a]);const v=S.useMemo(()=>{const _=m().map(k=>k.value);f.dir==="rtl"&&_.reverse();const A=_.indexOf(f.value),N=_.indexOf(f.previousValue),T=r===f.value,E=N===_.indexOf(r);if(!T&&!E)return y.current;const P=(()=>{if(A!==N){if(T&&N!==-1)return A>N?"from-end":"from-start";if(E&&A!==-1)return A>N?"to-start":"to-end"}return null})();return y.current=P,P},[f.previousValue,f.value,f.dir,m,r]);return b.jsx(J9,{asChild:!0,children:b.jsx(Au,{id:h,"aria-labelledby":p,"data-motion":v,"data-orientation":f.orientation,...u,ref:d,disableOutsidePointerEvents:!1,onDismiss:()=>{var _;const x=new Event(aC,{bubbles:!0,cancelable:!0});(_=l.current)==null||_.dispatchEvent(x)},onFocusOutside:ye(t.onFocusOutside,x=>{var A;c();const _=x.target;(A=f.rootNavigationMenu)!=null&&A.contains(_)&&x.preventDefault()}),onPointerDownOutside:ye(t.onPointerDownOutside,x=>{var T;const _=x.target,A=m().some(E=>{var P;return(P=E.ref.current)==null?void 0:P.contains(_)}),N=f.isRootMenu&&((T=f.viewport)==null?void 0:T.contains(_));(A||N||!f.isRootMenu)&&x.preventDefault()}),onKeyDown:ye(t.onKeyDown,x=>{var N;const _=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!_){const T=eO(x.currentTarget),E=document.activeElement,P=T.findIndex(I=>I===E),M=x.shiftKey?T.slice(0,P).reverse():T.slice(P+1,T.length);G2(M)?x.preventDefault():(N=i.current)==null||N.focus()}}),onEscapeKeyDown:ye(t.onEscapeKeyDown,x=>{o.current=!0})})})}),W2="NavigationMenuViewport",Z9=S.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=!!da(W2,t.__scopeNavigationMenu).value;return b.jsx(Kn,{present:n||i,children:b.jsx(iNe,{...r,ref:e})})});Z9.displayName=W2;var iNe=S.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,children:r,...s}=t,i=da(W2,n),o=et(e,i.onViewportChange),a=QRe(Gv,t.__scopeNavigationMenu),[c,u]=S.useState(null),[f,l]=S.useState(null),d=c?(c==null?void 0:c.width)+"px":void 0,p=c?(c==null?void 0:c.height)+"px":void 0,h=!!i.value,m=h?i.value:i.previousValue;return tO(f,()=>{f&&u({width:f.offsetWidth,height:f.offsetHeight})}),b.jsx(De.div,{"data-state":K2(h),"data-orientation":i.orientation,...s,ref:o,style:{pointerEvents:!h&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":d,"--radix-navigation-menu-viewport-height":p,...s.style},onPointerEnter:ye(t.onPointerEnter,i.onContentEnter),onPointerLeave:ye(t.onPointerLeave,OE(i.onContentLeave)),children:Array.from(a.items).map(([g,{ref:v,forceMount:x,..._}])=>{const A=m===g;return b.jsx(Kn,{present:x||A,children:b.jsx(Q9,{..._,ref:d_(v,N=>{A&&N&&l(N)})})},g)})})}),oNe="FocusGroup",J9=S.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=da(oNe,n);return b.jsx(ZM.Provider,{scope:n,children:b.jsx(ZM.Slot,{scope:n,children:b.jsx(De.div,{dir:s.dir,...r,ref:e})})})}),C5=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],aNe="FocusGroupItem",eY=S.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=GRe(n),i=da(aNe,n);return b.jsx(ZM.ItemSlot,{scope:n,children:b.jsx(De.button,{...r,ref:e,onKeyDown:ye(t.onKeyDown,o=>{if(["Home","End",...C5].includes(o.key)){let c=s().map(l=>l.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(o.key)&&c.reverse(),C5.includes(o.key)){const l=c.indexOf(o.currentTarget);c=c.slice(l+1)}setTimeout(()=>G2(c)),o.preventDefault()}})})})});function eO(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 G2(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}function lNe(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 tO(t,e){const n=on(e);ir(()=>{let r=0;if(t){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(t),()=>{window.cancelAnimationFrame(r),s.unobserve(t)}}},[t,n])}function K2(t){return t?"open":"closed"}function tY(t,e){return`${t}-trigger-${e}`}function nY(t,e){return`${t}-content-${e}`}function OE(t){return e=>e.pointerType==="mouse"?t(e):void 0}var rY=B9,sY=q9,iY=K9,oY=Y9,aY=X9,lY=Z9;const cNe=S.forwardRef(({className:t,children:e,...n},r)=>b.jsxs(rY,{ref:r,className:ie("relative z-10 flex max-w-max flex-1 items-center justify-center",t),...n,children:[e,b.jsx(cY,{})]}));cNe.displayName=rY.displayName;const uNe=S.forwardRef(({className:t,...e},n)=>b.jsx(sY,{ref:n,className:ie("group flex flex-1 list-none items-center justify-center space-x-1",t),...e}));uNe.displayName=sY.displayName;const dNe=di("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"),fNe=S.forwardRef(({className:t,children:e,...n},r)=>b.jsxs(iY,{ref:r,className:ie(dNe(),"group",t),...n,children:[e," ",b.jsx(dy,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));fNe.displayName=iY.displayName;const hNe=S.forwardRef(({className:t,...e},n)=>b.jsx(aY,{ref:n,className:ie("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",t),...e}));hNe.displayName=aY.displayName;const cY=S.forwardRef(({className:t,...e},n)=>b.jsx("div",{className:ie("absolute left-0 top-full flex justify-center"),children:b.jsx(lY,{className:ie("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",t),ref:n,...e})}));cY.displayName=lY.displayName;const pNe=S.forwardRef(({className:t,...e},n)=>b.jsx(oY,{ref:n,className:ie("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",t),...e,children:b.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));pNe.displayName=oY.displayName;var mNe=typeof window>"u",nO=mNe?oe.useEffect:oe.useLayoutEffect,gNe=0,E5=()=>++gNe,A5=!1;function vNe(){let[t,e]=oe.useState(A5?E5:void 0);return nO(()=>{t===void 0&&e(E5()),A5=!0},[]),t===void 0?t:`rwb-${t.toString(32)}`}function yNe(){return oe.useMemo(()=>"useId"in oe?oe.useId:vNe,[])()}var rO="__wrap_b",_0="__wrap_n",R5="__wrap_o",uY=(t,e,n)=>{n=n||document.querySelector(`[data-br="${t}"]`);let r=n==null?void 0:n.parentElement;if(!r)return;let s=f=>n.style.maxWidth=f+"px";n.style.maxWidth="";let i=r.clientWidth,o=r.clientHeight,a=i/2-.25,c=i+.5,u;if(i){for(s(a),a=Math.max(n.scrollWidth,a);a+1<c;)u=Math.round((a+c)/2),s(u),r.clientHeight===o?c=u:a=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)},bNe=uY.toString(),xNe='(self.CSS&&CSS.supports("text-wrap","balance")?1:2)',wNe=(t,e,n="")=>(n&&(n=`self.${_0}!=1&&${n}`),oe.createElement("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:(t?"":`self.${_0}=self.${_0}||${xNe};self.${rO}=${bNe};`)+n},nonce:e})),_Ne=oe.createContext({preferNative:!0,hasProvider:!1});oe.forwardRef(({ratio:t=1,preferNative:e,nonce:n,children:r,as:s,...i},o)=>{let a=yNe(),c=oe.useRef(),u=oe.useContext(_Ne),f=e??u.preferNative,l=s||"span";return oe.useImperativeHandle(o,()=>c.current,[]),nO(()=>{f&&self[_0]===1||c.current&&(self[rO]=uY)(0,t,c.current)},[r,f,t]),nO(()=>{if(!(f&&self[_0]===1))return()=>{if(!c.current)return;let d=c.current[R5];d&&(d.disconnect(),delete c.current[R5])}},[f]),oe.createElement(oe.Fragment,null,oe.createElement(l,{...i,"data-br":a,"data-brr":t,ref:c,style:{display:"inline-block",verticalAlign:"top",textDecoration:"inherit",textWrap:f?"balance":"initial"},suppressHydrationWarning:!0},r),wNe(u.hasProvider,n,`self.${rO}("${a}",${t})`))});var SNe="Separator",N5="horizontal",CNe=["horizontal","vertical"],dY=S.forwardRef((t,e)=>{const{decorative:n,orientation:r=N5,...s}=t,i=ENe(r)?r:N5,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return b.jsx(De.div,{"data-orientation":i,...a,...s,ref:e})});dY.displayName=SNe;function ENe(t){return CNe.includes(t)}var fY=dY;const iu=S.forwardRef(({className:t,orientation:e="horizontal",decorative:n=!0,...r},s)=>b.jsx(fY,{ref:s,decorative:n,orientation:e,className:ie("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));iu.displayName=fY.displayName;const ANe=S.forwardRef(({className:t,...e},n)=>b.jsx("ul",{ref:n,className:ie("flex flex-row items-center gap-1",t),...e}));ANe.displayName="PaginationContent";const RNe=S.forwardRef(({className:t,...e},n)=>b.jsx("li",{ref:n,className:ie("",t),...e}));RNe.displayName="PaginationItem";var Y2="Popover",[hY,nHe]=In(Y2,[Ql]),B_=Ql(),[NNe,gf]=hY(Y2),pY=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!1}=t,a=B_(e),c=S.useRef(null),[u,f]=S.useState(!1),[l=!1,d]=mr({prop:r,defaultProp:s,onChange:i});return b.jsx(LR,{...a,children:b.jsx(NNe,{scope:e,contentId:zs(),triggerRef:c,open:l,onOpenChange:d,onOpenToggle:S.useCallback(()=>d(p=>!p),[d]),hasCustomAnchor:u,onCustomAnchorAdd:S.useCallback(()=>f(!0),[]),onCustomAnchorRemove:S.useCallback(()=>f(!1),[]),modal:o,children:n})})};pY.displayName=Y2;var mY="PopoverAnchor",PNe=S.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=gf(mY,n),i=B_(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=s;return S.useEffect(()=>(o(),()=>a()),[o,a]),b.jsx(Ny,{...i,...r,ref:e})});PNe.displayName=mY;var gY="PopoverTrigger",vY=S.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=gf(gY,n),i=B_(n),o=et(e,s.triggerRef),a=b.jsx(De.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":_Y(s.open),...r,ref:o,onClick:ye(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?a:b.jsx(Ny,{asChild:!0,...i,children:a})});vY.displayName=gY;var X2="PopoverPortal",[TNe,kNe]=hY(X2,{forceMount:void 0}),yY=t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=gf(X2,e);return b.jsx(TNe,{scope:e,forceMount:n,children:b.jsx(Kn,{present:n||i.open,children:b.jsx(my,{asChild:!0,container:s,children:r})})})};yY.displayName=X2;var Kv="PopoverContent",bY=S.forwardRef((t,e)=>{const n=kNe(Kv,t.__scopePopover),{forceMount:r=n.forceMount,...s}=t,i=gf(Kv,t.__scopePopover);return b.jsx(Kn,{present:r||i.open,children:i.modal?b.jsx(DNe,{...s,ref:e}):b.jsx(MNe,{...s,ref:e})})});bY.displayName=Kv;var DNe=S.forwardRef((t,e)=>{const n=gf(Kv,t.__scopePopover),r=S.useRef(null),s=et(e,r),i=S.useRef(!1);return S.useEffect(()=>{const o=r.current;if(o)return m_(o)},[]),b.jsx(p_,{as:Ka,allowPinchZoom:!0,children:b.jsx(xY,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ye(t.onCloseAutoFocus,o=>{var a;o.preventDefault(),i.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:ye(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,u=a.button===2||c;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:ye(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),MNe=S.forwardRef((t,e)=>{const n=gf(Kv,t.__scopePopover),r=S.useRef(!1),s=S.useRef(!1);return b.jsx(xY,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),xY=S.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:f,...l}=t,d=gf(Kv,n),p=B_(n);return sR(),b.jsx(h_,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:b.jsx(Au,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:f,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>d.onOpenChange(!1),children:b.jsx(A_,{"data-state":_Y(d.open),role:"dialog",id:d.contentId,...p,...l,ref:e,style:{...l.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),wY="PopoverClose",ONe=S.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=gf(wY,n);return b.jsx(De.button,{type:"button",...r,ref:e,onClick:ye(t.onClick,()=>s.onOpenChange(!1))})});ONe.displayName=wY;var INe="PopoverArrow",jNe=S.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=B_(n);return b.jsx(R_,{...s,...r,ref:e})});jNe.displayName=INe;function _Y(t){return t?"open":"closed"}var LNe=pY,$Ne=vY,FNe=yY,SY=bY;const zNe=LNe,BNe=$Ne,CY=S.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},s)=>b.jsx(FNe,{children:b.jsx(SY,{ref:s,align:e,sideOffset:n,className:ie("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));CY.displayName=SY.displayName;var Q2="Progress",Z2=100,[UNe,rHe]=In(Q2),[HNe,VNe]=UNe(Q2),EY=S.forwardRef((t,e)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:i=qNe,...o}=t;(s||s===0)&&!P5(s)&&console.error(WNe(`${s}`,"Progress"));const a=P5(s)?s:Z2;r!==null&&!T5(r,a)&&console.error(GNe(`${r}`,"Progress"));const c=T5(r,a)?r:null,u=IE(c)?i(c,a):void 0;return b.jsx(HNe,{scope:n,value:c,max:a,children:b.jsx(De.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":IE(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":NY(c,a),"data-value":c??void 0,"data-max":a,...o,ref:e})})});EY.displayName=Q2;var AY="ProgressIndicator",RY=S.forwardRef((t,e)=>{const{__scopeProgress:n,...r}=t,s=VNe(AY,n);return b.jsx(De.div,{"data-state":NY(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:e})});RY.displayName=AY;function qNe(t,e){return`${Math.round(t/e*100)}%`}function NY(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function IE(t){return typeof t=="number"}function P5(t){return IE(t)&&!isNaN(t)&&t>0}function T5(t,e){return IE(t)&&!isNaN(t)&&t<=e&&t>=0}function WNe(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Z2}\`.`}function GNe(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 ${Z2} if no \`max\` prop is set)
|
||
- \`null\` or \`undefined\` if the progress is indeterminate.
|
||
|
||
Defaulting to \`null\`.`}var PY=EY,KNe=RY;const J2=S.forwardRef(({className:t,value:e,...n},r)=>b.jsx(PY,{ref:r,className:ie("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...n,children:b.jsx(KNe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));J2.displayName=PY.displayName;var e$="Radio",[YNe,TY]=In(e$),[XNe,QNe]=YNe(e$),kY=S.forwardRef((t,e)=>{const{__scopeRadio:n,name:r,checked:s=!1,required:i,disabled:o,value:a="on",onCheck:c,...u}=t,[f,l]=S.useState(null),d=et(e,m=>l(m)),p=S.useRef(!1),h=f?!!f.closest("form"):!0;return b.jsxs(XNe,{scope:n,checked:s,disabled:o,children:[b.jsx(De.button,{type:"button",role:"radio","aria-checked":s,"data-state":OY(s),"data-disabled":o?"":void 0,disabled:o,value:a,...u,ref:d,onClick:ye(t.onClick,m=>{s||c==null||c(),h&&(p.current=m.isPropagationStopped(),p.current||m.stopPropagation())})}),h&&b.jsx(ZNe,{control:f,bubbles:!p.current,name:r,value:a,checked:s,required:i,disabled:o,style:{transform:"translateX(-100%)"}})]})});kY.displayName=e$;var DY="RadioIndicator",MY=S.forwardRef((t,e)=>{const{__scopeRadio:n,forceMount:r,...s}=t,i=QNe(DY,n);return b.jsx(Kn,{present:r||i.checked,children:b.jsx(De.span,{"data-state":OY(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:e})})});MY.displayName=DY;var ZNe=t=>{const{control:e,checked:n,bubbles:r=!0,...s}=t,i=S.useRef(null),o=Cy(n),a=w_(e);return S.useEffect(()=>{const c=i.current,u=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(u,"checked").set;if(o!==n&&l){const d=new Event("click",{bubbles:r});l.call(c,n),c.dispatchEvent(d)}},[o,n,r]),b.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:i,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function OY(t){return t?"checked":"unchecked"}var JNe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],t$="RadioGroup",[ePe,sHe]=In(t$,[Zl,TY]),IY=Zl(),jY=TY(),[tPe,nPe]=ePe(t$),LY=S.forwardRef((t,e)=>{const{__scopeRadioGroup:n,name:r,defaultValue:s,value:i,required:o=!1,disabled:a=!1,orientation:c,dir:u,loop:f=!0,onValueChange:l,...d}=t,p=IY(n),h=el(u),[m,y]=mr({prop:i,defaultProp:s,onChange:l});return b.jsx(tPe,{scope:n,name:r,required:o,disabled:a,value:m,onValueChange:y,children:b.jsx(N_,{asChild:!0,...p,orientation:c,dir:h,loop:f,children:b.jsx(De.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":a?"":void 0,dir:h,...d,ref:e})})})});LY.displayName=t$;var $Y="RadioGroupItem",FY=S.forwardRef((t,e)=>{const{__scopeRadioGroup:n,disabled:r,...s}=t,i=nPe($Y,n),o=i.disabled||r,a=IY(n),c=jY(n),u=S.useRef(null),f=et(e,u),l=i.value===s.value,d=S.useRef(!1);return S.useEffect(()=>{const p=m=>{JNe.includes(m.key)&&(d.current=!0)},h=()=>d.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",h),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",h)}},[]),b.jsx(P_,{asChild:!0,...a,focusable:!o,active:l,children:b.jsx(kY,{disabled:o,required:i.required,checked:l,...c,...s,name:i.name,ref:f,onCheck:()=>i.onValueChange(s.value),onKeyDown:ye(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:ye(s.onFocus,()=>{var p;d.current&&((p=u.current)==null||p.click())})})})});FY.displayName=$Y;var rPe="RadioGroupIndicator",zY=S.forwardRef((t,e)=>{const{__scopeRadioGroup:n,...r}=t,s=jY(n);return b.jsx(MY,{...s,...r,ref:e})});zY.displayName=rPe;var BY=LY,UY=FY,sPe=zY;const iPe=S.forwardRef(({className:t,...e},n)=>b.jsx(BY,{className:ie("grid gap-2",t),...e,ref:n}));iPe.displayName=BY.displayName;const oPe=S.forwardRef(({className:t,...e},n)=>b.jsx(UY,{ref:n,className:ie("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:b.jsx(sPe,{className:"flex items-center justify-center",children:b.jsx(rR,{className:"h-2.5 w-2.5 fill-current text-current"})})}));oPe.displayName=UY.displayName;const{createElement:Yv,createContext:aPe,createRef:iHe,forwardRef:HY,useCallback:wi,useContext:VY,useEffect:dp,useImperativeHandle:qY,useLayoutEffect:lPe,useMemo:cPe,useRef:Pi,useState:yg}=o_,k5=o_[`useId${Math.random()}`.slice(0,5)],uPe=lPe,qR=aPe(null);qR.displayName="PanelGroupContext";const fp=uPe,dPe=typeof k5=="function"?k5:()=>null;let fPe=0;function n$(t=null){const e=dPe(),n=Pi(t||e||null);return n.current===null&&(n.current=""+fPe++),t??n.current}function WY({children:t,className:e="",collapsedSize:n,collapsible:r,defaultSize:s,forwardedRef:i,id:o,maxSize:a,minSize:c,onCollapse:u,onExpand:f,onResize:l,order:d,style:p,tagName:h="div",...m}){const y=VY(qR);if(y===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:g,expandPanel:v,getPanelSize:x,getPanelStyle:_,groupId:A,isPanelCollapsed:N,reevaluatePanelConstraints:T,registerPanel:E,resizePanel:P,unregisterPanel:k}=y,M=n$(o),I=Pi({callbacks:{onCollapse:u,onExpand:f,onResize:l},constraints:{collapsedSize:n,collapsible:r,defaultSize:s,maxSize:a,minSize:c},id:M,idIsFromProps:o!==void 0,order:d});Pi({didLogMissingDefaultSizeWarning:!1}),fp(()=>{const{callbacks:L,constraints:H}=I.current,K={...H};I.current.id=M,I.current.idIsFromProps=o!==void 0,I.current.order=d,L.onCollapse=u,L.onExpand=f,L.onResize=l,H.collapsedSize=n,H.collapsible=r,H.defaultSize=s,H.maxSize=a,H.minSize=c,(K.collapsedSize!==H.collapsedSize||K.collapsible!==H.collapsible||K.maxSize!==H.maxSize||K.minSize!==H.minSize)&&T(I.current,K)}),fp(()=>{const L=I.current;return E(L),()=>{k(L)}},[d,M,E,k]),qY(i,()=>({collapse:()=>{g(I.current)},expand:L=>{v(I.current,L)},getId(){return M},getSize(){return x(I.current)},isCollapsed(){return N(I.current)},isExpanded(){return!N(I.current)},resize:L=>{P(I.current,L)}}),[g,v,x,N,M,P]);const j=_(I.current,s);return Yv(h,{...m,children:t,className:e,id:o,style:{...j,...p},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":A,"data-panel-id":M,"data-panel-size":parseFloat(""+j.flexGrow).toFixed(1)})}const GY=HY((t,e)=>Yv(WY,{...t,forwardedRef:e}));WY.displayName="Panel";GY.displayName="forwardRef(Panel)";let sO=null,th=null;function hPe(t,e){if(e){const n=(e&ZY)!==0,r=(e&JY)!==0,s=(e&eX)!==0,i=(e&tX)!==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 pPe(){th!==null&&(document.head.removeChild(th),sO=null,th=null)}function Rk(t,e){const n=hPe(t,e);sO!==n&&(sO=n,th===null&&(th=document.createElement("style"),document.head.appendChild(th)),th.innerHTML=`*{cursor: ${n}!important;}`)}function KY(t){return t.type==="keydown"}function YY(t){return t.type.startsWith("pointer")}function XY(t){return t.type.startsWith("mouse")}function WR(t){if(YY(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(XY(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function mPe(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function gPe(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 vPe(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:O5(t),b:O5(e)};let r;for(;n.a.at(-1)===n.b.at(-1);)t=n.a.pop(),e=n.b.pop(),r=t;It(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:M5(D5(n.a)),b:M5(D5(n.b))};if(s.a===s.b){const i=r.childNodes,o={a:n.a.at(-1),b:n.b.at(-1)};let a=i.length;for(;a--;){const c=i[a];if(c===o.a)return 1;if(c===o.b)return-1}}return Math.sign(s.a-s.b)}const yPe=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function bPe(t){var e;const n=getComputedStyle((e=QY(t))!==null&&e!==void 0?e:t).display;return n==="flex"||n==="inline-flex"}function xPe(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||bPe(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"||yPe.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function D5(t){let e=t.length;for(;e--;){const n=t[e];if(It(n,"Missing node"),xPe(n))return n}return null}function M5(t){return t&&Number(getComputedStyle(t).zIndex)||0}function O5(t){const e=[];for(;t;)e.push(t),t=QY(t);return e}function QY(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const ZY=1,JY=2,eX=4,tX=8,wPe=mPe()==="coarse";let Va=[],cx=!1,ad=new Map,GR=new Map;const ux=new Set;function _Pe(t,e,n,r,s){var i;const{ownerDocument:o}=e,a={direction:n,element:e,hitAreaMargins:r,setResizeHandlerState:s},c=(i=ad.get(o))!==null&&i!==void 0?i:0;return ad.set(o,c+1),ux.add(a),jE(),function(){var f;GR.delete(t),ux.delete(a);const l=(f=ad.get(o))!==null&&f!==void 0?f:1;if(ad.set(o,l-1),jE(),l===1&&ad.delete(o),Va.includes(a)){const d=Va.indexOf(a);d>=0&&Va.splice(d,1),s$()}}}function I5(t){const{target:e}=t,{x:n,y:r}=WR(t);cx=!0,r$({target:e,x:n,y:r}),jE(),Va.length>0&&(LE("down",t),t.preventDefault(),t.stopPropagation())}function Cb(t){const{x:e,y:n}=WR(t);if(t.buttons===0&&(cx=!1,LE("up",t)),!cx){const{target:r}=t;r$({target:r,x:e,y:n})}LE("move",t),s$(),Va.length>0&&t.preventDefault()}function Em(t){const{target:e}=t,{x:n,y:r}=WR(t);GR.clear(),cx=!1,Va.length>0&&t.preventDefault(),LE("up",t),r$({target:e,x:n,y:r}),s$(),jE()}function r$({target:t,x:e,y:n}){Va.splice(0);let r=null;t instanceof HTMLElement&&(r=t),ux.forEach(s=>{const{element:i,hitAreaMargins:o}=s,a=i.getBoundingClientRect(),{bottom:c,left:u,right:f,top:l}=a,d=wPe?o.coarse:o.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)&&vPe(r,i)>0){let h=r,m=!1;for(;h&&!h.contains(i);){if(gPe(h.getBoundingClientRect(),a)){m=!0;break}h=h.parentElement}if(m)return}Va.push(s)}})}function Nk(t,e){GR.set(t,e)}function s$(){let t=!1,e=!1;Va.forEach(r=>{const{direction:s}=r;s==="horizontal"?t=!0:e=!0});let n=0;GR.forEach(r=>{n|=r}),t&&e?Rk("intersection",n):t?Rk("horizontal",n):e?Rk("vertical",n):pPe()}function jE(){ad.forEach((t,e)=>{const{body:n}=e;n.removeEventListener("contextmenu",Em),n.removeEventListener("pointerdown",I5),n.removeEventListener("pointerleave",Cb),n.removeEventListener("pointermove",Cb)}),window.removeEventListener("pointerup",Em),window.removeEventListener("pointercancel",Em),ux.size>0&&(cx?(Va.length>0&&ad.forEach((t,e)=>{const{body:n}=e;t>0&&(n.addEventListener("contextmenu",Em),n.addEventListener("pointerleave",Cb),n.addEventListener("pointermove",Cb))}),window.addEventListener("pointerup",Em),window.addEventListener("pointercancel",Em)):ad.forEach((t,e)=>{const{body:n}=e;t>0&&(n.addEventListener("pointerdown",I5,{capture:!0}),n.addEventListener("pointermove",Cb))}))}function LE(t,e){ux.forEach(n=>{const{setResizeHandlerState:r}=n,s=Va.includes(n);r(t,s,e)})}function SPe(){const[t,e]=yg(0);return wi(()=>e(n=>n+1),[])}function It(t,e){if(!t)throw console.error(e),Error(e)}const i$=10;function Ap(t,e,n=i$){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function Jc(t,e,n=i$){return Ap(t,e,n)===0}function go(t,e,n){return Ap(t,e,n)===0}function CPe(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(!go(s,i,n))return!1}return!0}function eg({panelConstraints:t,panelIndex:e,size:n}){const r=t[e];It(r!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:s=0,collapsible:i,maxSize:o=100,minSize:a=0}=r;if(Ap(n,a)<0)if(i){const c=(s+a)/2;Ap(n,c)<0?n=s:n=a}else n=a;return n=Math.min(o,n),n=parseFloat(n.toFixed(i$)),n}function Hb({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:r,prevLayout:s,trigger:i}){if(go(t,0))return e;const o=[...e],[a,c]=r;It(a!=null,"Invalid first pivot index"),It(c!=null,"Invalid second pivot index");let u=0;if(i==="keyboard"){{const l=t<0?c:a,d=n[l];It(d,`Panel constraints not found for index ${l}`);const{collapsedSize:p=0,collapsible:h,minSize:m=0}=d;if(h){const y=e[l];if(It(y!=null,`Previous layout not found for panel index ${l}`),go(y,p)){const g=m-y;Ap(g,Math.abs(t))>0&&(t=t<0?0-g:g)}}}{const l=t<0?a:c,d=n[l];It(d,`No panel constraints found for index ${l}`);const{collapsedSize:p=0,collapsible:h,minSize:m=0}=d;if(h){const y=e[l];if(It(y!=null,`Previous layout not found for panel index ${l}`),go(y,m)){const g=y-p;Ap(g,Math.abs(t))>0&&(t=t<0?0-g:g)}}}}{const l=t<0?1:-1;let d=t<0?c:a,p=0;for(;;){const m=e[d];It(m!=null,`Previous layout not found for panel index ${d}`);const g=eg({panelConstraints:n,panelIndex:d,size:100})-m;if(p+=g,d+=l,d<0||d>=n.length)break}const h=Math.min(Math.abs(t),Math.abs(p));t=t<0?0-h:h}{let d=t<0?a:c;for(;d>=0&&d<n.length;){const p=Math.abs(t)-Math.abs(u),h=e[d];It(h!=null,`Previous layout not found for panel index ${d}`);const m=h-p,y=eg({panelConstraints:n,panelIndex:d,size:m});if(!go(h,y)&&(u+=h-y,o[d]=y,u.toPrecision(3).localeCompare(Math.abs(t).toPrecision(3),void 0,{numeric:!0})>=0))break;t<0?d--:d++}}if(CPe(s,o))return s;{const l=t<0?c:a,d=e[l];It(d!=null,`Previous layout not found for panel index ${l}`);const p=d+u,h=eg({panelConstraints:n,panelIndex:l,size:p});if(o[l]=h,!go(h,p)){let m=p-h,g=t<0?c:a;for(;g>=0&&g<n.length;){const v=o[g];It(v!=null,`Previous layout not found for panel index ${g}`);const x=v+m,_=eg({panelConstraints:n,panelIndex:g,size:x});if(go(v,_)||(m-=_-v,o[g]=_),go(m,0))break;t>0?g--:g++}}}const f=o.reduce((l,d)=>d+l,0);return go(f,100)?o:s}function EPe({layout:t,panelsArray:e,pivotIndices:n}){let r=0,s=100,i=0,o=0;const a=n[0];It(a!=null,"No pivot index found"),e.forEach((l,d)=>{const{constraints:p}=l,{maxSize:h=100,minSize:m=0}=p;d===a?(r=m,s=h):(i+=m,o+=h)});const c=Math.min(s,100-i),u=Math.max(r,100-o),f=t[a];return{valueMax:c,valueMin:u,valueNow:f}}function dx(t,e=document){return Array.from(e.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${t}"]`))}function nX(t,e,n=document){const s=dx(t,n).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===e);return s??null}function rX(t,e,n){const r=nX(t,e,n);return r!=null?[r,r+1]:[-1,-1]}function sX(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 KR(t,e=document){const n=e.querySelector(`[data-panel-resize-handle-id="${t}"]`);return n||null}function APe(t,e,n,r=document){var s,i,o,a;const c=KR(e,r),u=dx(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=(o=(a=n[f+1])===null||a===void 0?void 0:a.id)!==null&&o!==void 0?o:null;return[l,d]}function RPe({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:r,panelDataArray:s,panelGroupElement:i,setLayout:o}){Pi({didWarnAboutMissingResizeHandle:!1}),fp(()=>{if(!i)return;const a=dx(n,i);for(let c=0;c<s.length-1;c++){const{valueMax:u,valueMin:f,valueNow:l}=EPe({layout:r,panelsArray:s,pivotIndices:[c,c+1]}),d=a[c];if(d!=null){const p=s[c];It(p,`No panel data found for index "${c}"`),d.setAttribute("aria-controls",p.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()=>{a.forEach((c,u)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[n,r,s,i]),dp(()=>{if(!i)return;const a=e.current;It(a,"Eager values not found");const{panelDataArray:c}=a,u=sX(n,i);It(u!=null,`No group found for id "${n}"`);const f=dx(n,i);It(f,`No resize handles found for group id "${n}"`);const l=f.map(d=>{const p=d.getAttribute("data-panel-resize-handle-id");It(p,"Resize handle element has no handle id attribute");const[h,m]=APe(n,p,c,i);if(h==null||m==null)return()=>{};const y=g=>{if(!g.defaultPrevented)switch(g.key){case"Enter":{g.preventDefault();const v=c.findIndex(x=>x.id===h);if(v>=0){const x=c[v];It(x,`No panel data found for index ${v}`);const _=r[v],{collapsedSize:A=0,collapsible:N,minSize:T=0}=x.constraints;if(_!=null&&N){const E=Hb({delta:go(_,A)?T-A:A-_,initialLayout:r,panelConstraints:c.map(P=>P.constraints),pivotIndices:rX(n,p,i),prevLayout:r,trigger:"keyboard"});r!==E&&o(E)}}break}}};return d.addEventListener("keydown",y),()=>{d.removeEventListener("keydown",y)}});return()=>{l.forEach(d=>d())}},[i,t,e,n,r,s,o])}function j5(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 iX(t,e){const n=t==="horizontal",{x:r,y:s}=WR(e);return n?r:s}function NPe(t,e,n,r,s){const i=n==="horizontal",o=KR(e,s);It(o,`No resize handle element found for id "${e}"`);const a=o.getAttribute("data-panel-group-id");It(a,"Resize handle element has no group id attribute");let{initialCursorPosition:c}=r;const u=iX(n,t),f=sX(a,s);It(f,`No group element found for id "${a}"`);const l=f.getBoundingClientRect(),d=i?l.width:l.height;return(u-c)/d*100}function PPe(t,e,n,r,s,i){if(KY(t)){const o=n==="horizontal";let a=0;t.shiftKey?a=100:s!=null?a=s:a=10;let c=0;switch(t.key){case"ArrowDown":c=o?0:a;break;case"ArrowLeft":c=o?-a:0;break;case"ArrowRight":c=o?a:0;break;case"ArrowUp":c=o?0:-a;break;case"End":c=100;break;case"Home":c=-100;break}return c}else return r==null?0:NPe(t,e,n,r,i)}function TPe({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 o=n[i];It(o,`Panel constraints not found for index ${i}`);const{defaultSize:a}=o;a!=null&&(r++,e[i]=a,s-=a)}for(let i=0;i<t.length;i++){const o=n[i];It(o,`Panel constraints not found for index ${i}`);const{defaultSize:a}=o;if(a!=null)continue;const c=t.length-r,u=s/c;r++,e[i]=u,s-=u}return e}function Am(t,e,n){e.forEach((r,s)=>{const i=t[s];It(i,`Panel data not found for index ${s}`);const{callbacks:o,constraints:a,id:c}=i,{collapsedSize:u=0,collapsible:f}=a,l=n[c];if(l==null||r!==l){n[c]=r;const{onCollapse:d,onExpand:p,onResize:h}=o;h&&h(r,l),f&&(d||p)&&(p&&(l==null||Jc(l,u))&&!Jc(r,u)&&p(),d&&(l==null||!Jc(l,u))&&Jc(r,u)&&d())}})}function E1(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 kPe({defaultSize:t,dragState:e,layout:n,panelData:r,panelIndex:s,precision:i=3}){const o=n[s];let a;return o==null?a=t!=null?t.toPrecision(i):"1":r.length===1?a="1":a=o.toPrecision(i),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function DPe(t,e=10){let n=null;return(...s)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...s)},e)}}function L5(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 oX(t){return`react-resizable-panels:${t}`}function aX(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 lX(t,e){try{const n=oX(t),r=e.getItem(n);if(r){const s=JSON.parse(r);if(typeof s=="object"&&s!=null)return s}}catch{}return null}function MPe(t,e,n){var r,s;const i=(r=lX(t,n))!==null&&r!==void 0?r:{},o=aX(e);return(s=i[o])!==null&&s!==void 0?s:null}function OPe(t,e,n,r,s){var i;const o=oX(t),a=aX(e),c=(i=lX(t,s))!==null&&i!==void 0?i:{};c[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{s.setItem(o,JSON.stringify(c))}catch(u){console.error(u)}}function $5({layout:t,panelConstraints:e}){const n=[...t],r=n.reduce((i,o)=>i+o,0);if(n.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!go(r,100))for(let i=0;i<e.length;i++){const o=n[i];It(o!=null,`No layout data found for index ${i}`);const a=100/r*o;n[i]=a}let s=0;for(let i=0;i<e.length;i++){const o=n[i];It(o!=null,`No layout data found for index ${i}`);const a=eg({panelConstraints:e,panelIndex:i,size:o});o!=a&&(s+=o-a,n[i]=a)}if(!go(s,0))for(let i=0;i<e.length;i++){const o=n[i];It(o!=null,`No layout data found for index ${i}`);const a=o+s,c=eg({panelConstraints:e,panelIndex:i,size:a});if(o!==c&&(s-=c-o,n[i]=c,go(s,0)))break}return n}const IPe=100,Vb={getItem:t=>(L5(Vb),Vb.getItem(t)),setItem:(t,e)=>{L5(Vb),Vb.setItem(t,e)}},F5={};function cX({autoSaveId:t=null,children:e,className:n="",direction:r,forwardedRef:s,id:i=null,onLayout:o=null,keyboardResizeBy:a=null,storage:c=Vb,style:u,tagName:f="div",...l}){const d=n$(i),p=Pi(null),[h,m]=yg(null),[y,g]=yg([]),v=SPe(),x=Pi({}),_=Pi(new Map),A=Pi(0),N=Pi({autoSaveId:t,direction:r,dragState:h,id:d,keyboardResizeBy:a,onLayout:o,storage:c}),T=Pi({layout:y,panelDataArray:[],panelDataArrayChanged:!1});Pi({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),qY(s,()=>({getId:()=>N.current.id,getLayout:()=>{const{layout:Y}=T.current;return Y},setLayout:Y=>{const{onLayout:Z}=N.current,{layout:he,panelDataArray:fe}=T.current,ce=$5({layout:Y,panelConstraints:fe.map(xe=>xe.constraints)});j5(he,ce)||(g(ce),T.current.layout=ce,Z&&Z(ce),Am(fe,ce,x.current))}}),[]),fp(()=>{N.current.autoSaveId=t,N.current.direction=r,N.current.dragState=h,N.current.id=d,N.current.onLayout=o,N.current.storage=c}),RPe({committedValuesRef:N,eagerValuesRef:T,groupId:d,layout:y,panelDataArray:T.current.panelDataArray,setLayout:g,panelGroupElement:p.current}),dp(()=>{const{panelDataArray:Y}=T.current;if(t){if(y.length===0||y.length!==Y.length)return;let Z=F5[t];Z==null&&(Z=DPe(OPe,IPe),F5[t]=Z);const he=[...Y],fe=new Map(_.current);Z(t,he,fe,y,c)}},[t,y,c]),dp(()=>{});const E=wi(Y=>{const{onLayout:Z}=N.current,{layout:he,panelDataArray:fe}=T.current;if(Y.constraints.collapsible){const ce=fe.map(Le=>Le.constraints),{collapsedSize:xe=0,panelSize:Ne,pivotIndices:pe}=$f(fe,Y,he);if(It(Ne!=null,`Panel size not found for panel "${Y.id}"`),!Jc(Ne,xe)){_.current.set(Y.id,Ne);const Me=Mm(fe,Y)===fe.length-1?Ne-xe:xe-Ne,Oe=Hb({delta:Me,initialLayout:he,panelConstraints:ce,pivotIndices:pe,prevLayout:he,trigger:"imperative-api"});E1(he,Oe)||(g(Oe),T.current.layout=Oe,Z&&Z(Oe),Am(fe,Oe,x.current))}}},[]),P=wi((Y,Z)=>{const{onLayout:he}=N.current,{layout:fe,panelDataArray:ce}=T.current;if(Y.constraints.collapsible){const xe=ce.map(Fe=>Fe.constraints),{collapsedSize:Ne=0,panelSize:pe=0,minSize:Le=0,pivotIndices:Me}=$f(ce,Y,fe),Oe=Z??Le;if(Jc(pe,Ne)){const Fe=_.current.get(Y.id),ot=Fe!=null&&Fe>=Oe?Fe:Oe,At=Mm(ce,Y)===ce.length-1?pe-ot:ot-pe,ee=Hb({delta:At,initialLayout:fe,panelConstraints:xe,pivotIndices:Me,prevLayout:fe,trigger:"imperative-api"});E1(fe,ee)||(g(ee),T.current.layout=ee,he&&he(ee),Am(ce,ee,x.current))}}},[]),k=wi(Y=>{const{layout:Z,panelDataArray:he}=T.current,{panelSize:fe}=$f(he,Y,Z);return It(fe!=null,`Panel size not found for panel "${Y.id}"`),fe},[]),M=wi((Y,Z)=>{const{panelDataArray:he}=T.current,fe=Mm(he,Y);return kPe({defaultSize:Z,dragState:h,layout:y,panelData:he,panelIndex:fe})},[h,y]),I=wi(Y=>{const{layout:Z,panelDataArray:he}=T.current,{collapsedSize:fe=0,collapsible:ce,panelSize:xe}=$f(he,Y,Z);return It(xe!=null,`Panel size not found for panel "${Y.id}"`),ce===!0&&Jc(xe,fe)},[]),j=wi(Y=>{const{layout:Z,panelDataArray:he}=T.current,{collapsedSize:fe=0,collapsible:ce,panelSize:xe}=$f(he,Y,Z);return It(xe!=null,`Panel size not found for panel "${Y.id}"`),!ce||Ap(xe,fe)>0},[]),L=wi(Y=>{const{panelDataArray:Z}=T.current;Z.push(Y),Z.sort((he,fe)=>{const ce=he.order,xe=fe.order;return ce==null&&xe==null?0:ce==null?-1:xe==null?1:ce-xe}),T.current.panelDataArrayChanged=!0,v()},[v]);fp(()=>{if(T.current.panelDataArrayChanged){T.current.panelDataArrayChanged=!1;const{autoSaveId:Y,onLayout:Z,storage:he}=N.current,{layout:fe,panelDataArray:ce}=T.current;let xe=null;if(Y){const pe=MPe(Y,ce,he);pe&&(_.current=new Map(Object.entries(pe.expandToSizes)),xe=pe.layout)}xe==null&&(xe=TPe({panelDataArray:ce}));const Ne=$5({layout:xe,panelConstraints:ce.map(pe=>pe.constraints)});j5(fe,Ne)||(g(Ne),T.current.layout=Ne,Z&&Z(Ne),Am(ce,Ne,x.current))}}),fp(()=>{const Y=T.current;return()=>{Y.layout=[]}},[]);const H=wi(Y=>function(he){he.preventDefault();const fe=p.current;if(!fe)return()=>null;const{direction:ce,dragState:xe,id:Ne,keyboardResizeBy:pe,onLayout:Le}=N.current,{layout:Me,panelDataArray:Oe}=T.current,{initialLayout:Fe}=xe??{},ot=rX(Ne,Y,fe);let nt=PPe(he,Y,ce,xe,pe,fe);const At=ce==="horizontal";document.dir==="rtl"&&At&&(nt=-nt);const ee=Oe.map(Re=>Re.constraints),de=Hb({delta:nt,initialLayout:Fe??Me,panelConstraints:ee,pivotIndices:ot,prevLayout:Me,trigger:KY(he)?"keyboard":"mouse-or-touch"}),me=!E1(Me,de);(YY(he)||XY(he))&&A.current!=nt&&(A.current=nt,me?Nk(Y,0):At?Nk(Y,nt<0?ZY:JY):Nk(Y,nt<0?eX:tX)),me&&(g(de),T.current.layout=de,Le&&Le(de),Am(Oe,de,x.current))},[]),K=wi((Y,Z)=>{const{onLayout:he}=N.current,{layout:fe,panelDataArray:ce}=T.current,xe=ce.map(Fe=>Fe.constraints),{panelSize:Ne,pivotIndices:pe}=$f(ce,Y,fe);It(Ne!=null,`Panel size not found for panel "${Y.id}"`);const Me=Mm(ce,Y)===ce.length-1?Ne-Z:Z-Ne,Oe=Hb({delta:Me,initialLayout:fe,panelConstraints:xe,pivotIndices:pe,prevLayout:fe,trigger:"imperative-api"});E1(fe,Oe)||(g(Oe),T.current.layout=Oe,he&&he(Oe),Am(ce,Oe,x.current))},[]),V=wi((Y,Z)=>{const{layout:he,panelDataArray:fe}=T.current,{collapsedSize:ce=0,collapsible:xe}=Z,{collapsedSize:Ne=0,collapsible:pe,maxSize:Le=100,minSize:Me=0}=Y.constraints,{panelSize:Oe}=$f(fe,Y,he);Oe!=null&&(xe&&pe&&Jc(Oe,ce)?Jc(ce,Ne)||K(Y,Ne):Oe<Me?K(Y,Me):Oe>Le&&K(Y,Le))},[K]),U=wi((Y,Z)=>{const{direction:he}=N.current,{layout:fe}=T.current;if(!p.current)return;const ce=KR(Y,p.current);It(ce,`Drag handle element not found for id "${Y}"`);const xe=iX(he,Z);m({dragHandleId:Y,dragHandleRect:ce.getBoundingClientRect(),initialCursorPosition:xe,initialLayout:fe})},[]),Q=wi(()=>{m(null)},[]),ne=wi(Y=>{const{panelDataArray:Z}=T.current,he=Mm(Z,Y);he>=0&&(Z.splice(he,1),delete x.current[Y.id],T.current.panelDataArrayChanged=!0,v())},[v]),X=cPe(()=>({collapsePanel:E,direction:r,dragState:h,expandPanel:P,getPanelSize:k,getPanelStyle:M,groupId:d,isPanelCollapsed:I,isPanelExpanded:j,reevaluatePanelConstraints:V,registerPanel:L,registerResizeHandle:H,resizePanel:K,startDragging:U,stopDragging:Q,unregisterPanel:ne,panelGroupElement:p.current}),[E,h,r,P,k,M,d,I,j,V,L,H,K,U,Q,ne]),G={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Yv(qR.Provider,{value:X},Yv(f,{...l,children:e,className:n,id:i,ref:p,style:{...G,...u},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":d}))}const uX=HY((t,e)=>Yv(cX,{...t,forwardedRef:e}));cX.displayName="PanelGroup";uX.displayName="forwardRef(PanelGroup)";function Mm(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function $f(t,e,n){const r=Mm(t,e),i=r===t.length-1?[r-1,r]:[r,r+1],o=n[r];return{...e.constraints,panelSize:o,pivotIndices:i}}function jPe({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:r}){dp(()=>{if(t||n==null||r==null)return;const s=KR(e,r);if(s==null)return;const i=o=>{if(!o.defaultPrevented)switch(o.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{o.preventDefault(),n(o);break}case"F6":{o.preventDefault();const a=s.getAttribute("data-panel-group-id");It(a,`No group element found for id "${a}"`);const c=dx(a,r),u=nX(a,e,r);It(u!==null,`No resize element found for id "${e}"`);const f=o.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 dX({children:t=null,className:e="",disabled:n=!1,hitAreaMargins:r,id:s,onBlur:i,onDragging:o,onFocus:a,style:c={},tabIndex:u=0,tagName:f="div",...l}){var d,p;const h=Pi(null),m=Pi({onDragging:o});dp(()=>{m.current.onDragging=o});const y=VY(qR);if(y===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:g,groupId:v,registerResizeHandle:x,startDragging:_,stopDragging:A,panelGroupElement:N}=y,T=n$(s),[E,P]=yg("inactive"),[k,M]=yg(!1),[I,j]=yg(null),L=Pi({state:E});fp(()=>{L.current.state=E}),dp(()=>{if(n)j(null);else{const U=x(T);j(()=>U)}},[n,T,x]);const H=(d=r==null?void 0:r.coarse)!==null&&d!==void 0?d:15,K=(p=r==null?void 0:r.fine)!==null&&p!==void 0?p:5;return dp(()=>{if(n||I==null)return;const U=h.current;return It(U,"Element ref not attached"),_Pe(T,U,g,{coarse:H,fine:K},(ne,X,G)=>{if(X)switch(ne){case"down":{P("drag"),_(T,G);const{onDragging:Y}=m.current;Y&&Y(!0);break}case"move":{const{state:Y}=L.current;Y!=="drag"&&P("hover"),I(G);break}case"up":{P("hover"),A();const{onDragging:Y}=m.current;Y&&Y(!1);break}}else P("inactive")})},[H,g,n,K,x,T,I,_,A]),jPe({disabled:n,handleId:T,resizeHandler:I,panelGroupElement:N}),Yv(f,{...l,children:t,className:e,id:s,onBlur:()=>{M(!1),i==null||i()},onFocus:()=>{M(!0),a==null||a()},ref:h,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...c},tabIndex:u,"data-panel-group-direction":g,"data-panel-group-id":v,"data-resize-handle":"","data-resize-handle-active":E==="drag"?"pointer":k?"keyboard":void 0,"data-resize-handle-state":E,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":T})}dX.displayName="PanelResizeHandle";const LPe=({className:t,...e})=>b.jsx(uX,{className:ie("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),...e}),z5=GY,$Pe=({withHandle:t,className:e,...n})=>b.jsx(dX,{className:ie("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",e),...n,children:t&&b.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:b.jsx(gq,{className:"h-2.5 w-2.5"})})});function fx(t,[e,n]){return Math.min(n,Math.max(e,t))}function FPe(t,e){return S.useReducer((n,r)=>e[n][r]??n,t)}var o$="ScrollArea",[fX,oHe]=In(o$),[zPe,fa]=fX(o$),hX=S.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:i=600,...o}=t,[a,c]=S.useState(null),[u,f]=S.useState(null),[l,d]=S.useState(null),[p,h]=S.useState(null),[m,y]=S.useState(null),[g,v]=S.useState(0),[x,_]=S.useState(0),[A,N]=S.useState(!1),[T,E]=S.useState(!1),P=et(e,M=>c(M)),k=el(s);return b.jsx(zPe,{scope:n,type:r,dir:k,scrollHideDelay:i,scrollArea:a,viewport:u,onViewportChange:f,content:l,onContentChange:d,scrollbarX:p,onScrollbarXChange:h,scrollbarXEnabled:A,onScrollbarXEnabledChange:N,scrollbarY:m,onScrollbarYChange:y,scrollbarYEnabled:T,onScrollbarYEnabledChange:E,onCornerWidthChange:v,onCornerHeightChange:_,children:b.jsx(De.div,{dir:k,...o,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":x+"px",...t.style}})})});hX.displayName=o$;var pX="ScrollAreaViewport",mX=S.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,nonce:s,...i}=t,o=fa(pX,n),a=S.useRef(null),c=et(e,a,o.onViewportChange);return b.jsxs(b.Fragment,{children:[b.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}),b.jsx(De.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...t.style},children:b.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});mX.displayName=pX;var ec="ScrollAreaScrollbar",a$=S.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=fa(ec,t.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=s,a=t.orientation==="horizontal";return S.useEffect(()=>(a?i(!0):o(!0),()=>{a?i(!1):o(!1)}),[a,i,o]),s.type==="hover"?b.jsx(BPe,{...r,ref:e,forceMount:n}):s.type==="scroll"?b.jsx(UPe,{...r,ref:e,forceMount:n}):s.type==="auto"?b.jsx(gX,{...r,ref:e,forceMount:n}):s.type==="always"?b.jsx(l$,{...r,ref:e}):null});a$.displayName=ec;var BPe=S.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=fa(ec,t.__scopeScrollArea),[i,o]=S.useState(!1);return S.useEffect(()=>{const a=s.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),o(!0)},f=()=>{c=window.setTimeout(()=>o(!1),s.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",f),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",f)}}},[s.scrollArea,s.scrollHideDelay]),b.jsx(Kn,{present:n||i,children:b.jsx(gX,{"data-state":i?"visible":"hidden",...r,ref:e})})}),UPe=S.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=fa(ec,t.__scopeScrollArea),i=t.orientation==="horizontal",o=XR(()=>c("SCROLL_END"),100),[a,c]=FPe("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return S.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,s.scrollHideDelay,c]),S.useEffect(()=>{const u=s.viewport,f=i?"scrollLeft":"scrollTop";if(u){let l=u[f];const d=()=>{const p=u[f];l!==p&&(c("SCROLL"),o()),l=p};return u.addEventListener("scroll",d),()=>u.removeEventListener("scroll",d)}},[s.viewport,i,c,o]),b.jsx(Kn,{present:n||a!=="hidden",children:b.jsx(l$,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:ye(t.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:ye(t.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),gX=S.forwardRef((t,e)=>{const n=fa(ec,t.__scopeScrollArea),{forceMount:r,...s}=t,[i,o]=S.useState(!1),a=t.orientation==="horizontal",c=XR(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,f=n.viewport.offsetHeight<n.viewport.scrollHeight;o(a?u:f)}},10);return Xv(n.viewport,c),Xv(n.content,c),b.jsx(Kn,{present:r||i,children:b.jsx(l$,{"data-state":i?"visible":"hidden",...s,ref:e})})}),l$=S.forwardRef((t,e)=>{const{orientation:n="vertical",...r}=t,s=fa(ec,t.__scopeScrollArea),i=S.useRef(null),o=S.useRef(0),[a,c]=S.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=wX(a.viewport,a.content),f={...r,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:d=>i.current=d,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:d=>o.current=d};function l(d,p){return KPe(d,o.current,a,p)}return n==="horizontal"?b.jsx(HPe,{...f,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const d=s.viewport.scrollLeft,p=B5(d,a,s.dir);i.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:d=>{s.viewport&&(s.viewport.scrollLeft=d)},onDragScroll:d=>{s.viewport&&(s.viewport.scrollLeft=l(d,s.dir))}}):n==="vertical"?b.jsx(VPe,{...f,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const d=s.viewport.scrollTop,p=B5(d,a);i.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:d=>{s.viewport&&(s.viewport.scrollTop=d)},onDragScroll:d=>{s.viewport&&(s.viewport.scrollTop=l(d))}}):null}),HPe=S.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=fa(ec,t.__scopeScrollArea),[o,a]=S.useState(),c=S.useRef(null),u=et(e,c,i.onScrollbarXChange);return S.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(yX,{"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":YR(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),SX(d,l)&&f.preventDefault()}},onResize:()=>{c.current&&i.viewport&&o&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:FE(o.paddingLeft),paddingEnd:FE(o.paddingRight)}})}})}),VPe=S.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=fa(ec,t.__scopeScrollArea),[o,a]=S.useState(),c=S.useRef(null),u=et(e,c,i.onScrollbarYChange);return S.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(yX,{"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":YR(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),SX(d,l)&&f.preventDefault()}},onResize:()=>{c.current&&i.viewport&&o&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:FE(o.paddingTop),paddingEnd:FE(o.paddingBottom)}})}})}),[qPe,vX]=fX(ec),yX=S.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:f,onResize:l,...d}=t,p=fa(ec,n),[h,m]=S.useState(null),y=et(e,P=>m(P)),g=S.useRef(null),v=S.useRef(""),x=p.viewport,_=r.content-r.viewport,A=on(f),N=on(c),T=XR(l,10);function E(P){if(g.current){const k=P.clientX-g.current.left,M=P.clientY-g.current.top;u({x:k,y:M})}}return S.useEffect(()=>{const P=k=>{const M=k.target;(h==null?void 0:h.contains(M))&&A(k,_)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[x,h,_,A]),S.useEffect(N,[r,N]),Xv(h,T),Xv(p.content,T),b.jsx(qPe,{scope:n,scrollbar:h,hasThumb:s,onThumbChange:on(i),onThumbPointerUp:on(o),onThumbPositionChange:N,onThumbPointerDown:on(a),children:b.jsx(De.div,{...d,ref:y,style:{position:"absolute",...d.style},onPointerDown:ye(t.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),g.current=h.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),E(P))}),onPointerMove:ye(t.onPointerMove,E),onPointerUp:ye(t.onPointerUp,P=>{const k=P.target;k.hasPointerCapture(P.pointerId)&&k.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=""),g.current=null})})})}),$E="ScrollAreaThumb",bX=S.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=vX($E,t.__scopeScrollArea);return b.jsx(Kn,{present:n||s.hasThumb,children:b.jsx(WPe,{ref:e,...r})})}),WPe=S.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...s}=t,i=fa($E,n),o=vX($E,n),{onThumbPositionChange:a}=o,c=et(e,l=>o.onThumbChange(l)),u=S.useRef(),f=XR(()=>{u.current&&(u.current(),u.current=void 0)},100);return S.useEffect(()=>{const l=i.viewport;if(l){const d=()=>{if(f(),!u.current){const p=YPe(l,a);u.current=p,a()}};return a(),l.addEventListener("scroll",d),()=>l.removeEventListener("scroll",d)}},[i.viewport,f,a]),b.jsx(De.div,{"data-state":o.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ye(t.onPointerDownCapture,l=>{const p=l.target.getBoundingClientRect(),h=l.clientX-p.left,m=l.clientY-p.top;o.onThumbPointerDown({x:h,y:m})}),onPointerUp:ye(t.onPointerUp,o.onThumbPointerUp)})});bX.displayName=$E;var c$="ScrollAreaCorner",xX=S.forwardRef((t,e)=>{const n=fa(c$,t.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?b.jsx(GPe,{...t,ref:e}):null});xX.displayName=c$;var GPe=S.forwardRef((t,e)=>{const{__scopeScrollArea:n,...r}=t,s=fa(c$,n),[i,o]=S.useState(0),[a,c]=S.useState(0),u=!!(i&&a);return Xv(s.scrollbarX,()=>{var l;const f=((l=s.scrollbarX)==null?void 0:l.offsetHeight)||0;s.onCornerHeightChange(f),c(f)}),Xv(s.scrollbarY,()=>{var l;const f=((l=s.scrollbarY)==null?void 0:l.offsetWidth)||0;s.onCornerWidthChange(f),o(f)}),u?b.jsx(De.div,{...r,ref:e,style:{width:i,height:a,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function FE(t){return t?parseInt(t,10):0}function wX(t,e){const n=t/e;return isNaN(n)?0:n}function YR(t){const e=wX(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function KPe(t,e,n,r="ltr"){const s=YR(n),i=s/2,o=e||i,a=s-o,c=n.scrollbar.paddingStart+o,u=n.scrollbar.size-n.scrollbar.paddingEnd-a,f=n.content-n.viewport,l=r==="ltr"?[0,f]:[f*-1,0];return _X([c,u],l)(t)}function B5(t,e,n="ltr"){const r=YR(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=e.scrollbar.size-s,o=e.content-e.viewport,a=i-r,c=n==="ltr"?[0,o]:[o*-1,0],u=fx(t,c);return _X([0,o],[0,a])(u)}function _X(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 SX(t,e){return t>0&&t<e}var YPe=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},r=0;return function s(){const i={left:t.scrollLeft,top:t.scrollTop},o=n.left!==i.left,a=n.top!==i.top;(o||a)&&e(),n=i,r=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(r)};function XR(t,e){const n=on(t),r=S.useRef(0);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),S.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function Xv(t,e){const n=on(e);ir(()=>{let r=0;if(t){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(t),()=>{window.cancelAnimationFrame(r),s.unobserve(t)}}},[t,n])}var CX=hX,XPe=mX,QPe=xX;const QR=S.forwardRef(({className:t,children:e,...n},r)=>b.jsxs(CX,{ref:r,className:ie("relative overflow-hidden",t),...n,children:[b.jsx(XPe,{className:"h-full w-full rounded-[inherit]",children:e}),b.jsx(EX,{}),b.jsx(QPe,{})]}));QR.displayName=CX.displayName;const EX=S.forwardRef(({className:t,orientation:e="vertical",...n},r)=>b.jsx(a$,{ref:r,orientation:e,className:ie("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...n,children:b.jsx(bX,{className:"relative flex-1 rounded-full bg-border"})}));EX.displayName=a$.displayName;var ZPe=[" ","Enter","ArrowUp","ArrowDown"],JPe=[" ","Enter"],U_="Select",[ZR,JR,eTe]=Cu(U_),[My,aHe]=In(U_,[eTe,Ql]),eN=Ql(),[tTe,vf]=My(U_),[nTe,rTe]=My(U_),AX=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:s,onOpenChange:i,value:o,defaultValue:a,onValueChange:c,dir:u,name:f,autoComplete:l,disabled:d,required:p}=t,h=eN(e),[m,y]=S.useState(null),[g,v]=S.useState(null),[x,_]=S.useState(!1),A=el(u),[N=!1,T]=mr({prop:r,defaultProp:s,onChange:i}),[E,P]=mr({prop:o,defaultProp:a,onChange:c}),k=S.useRef(null),M=m?!!m.closest("form"):!0,[I,j]=S.useState(new Set),L=Array.from(I).map(H=>H.props.value).join(";");return b.jsx(LR,{...h,children:b.jsxs(tTe,{required:p,scope:e,trigger:m,onTriggerChange:y,valueNode:g,onValueNodeChange:v,valueNodeHasChildren:x,onValueNodeHasChildrenChange:_,contentId:zs(),value:E,onValueChange:P,open:N,onOpenChange:T,dir:A,triggerPointerDownPosRef:k,disabled:d,children:[b.jsx(ZR.Provider,{scope:e,children:b.jsx(nTe,{scope:t.__scopeSelect,onNativeOptionAdd:S.useCallback(H=>{j(K=>new Set(K).add(H))},[]),onNativeOptionRemove:S.useCallback(H=>{j(K=>{const V=new Set(K);return V.delete(H),V})},[]),children:n})}),M?b.jsxs(QX,{"aria-hidden":!0,required:p,tabIndex:-1,name:f,autoComplete:l,value:E,onChange:H=>P(H.target.value),disabled:d,children:[E===void 0?b.jsx("option",{value:""}):null,Array.from(I)]},L):null]})})};AX.displayName=U_;var RX="SelectTrigger",NX=S.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...s}=t,i=eN(n),o=vf(RX,n),a=o.disabled||r,c=et(e,o.onTriggerChange),u=JR(n),[f,l,d]=ZX(h=>{const m=u().filter(v=>!v.disabled),y=m.find(v=>v.value===o.value),g=JX(m,h,y);g!==void 0&&o.onValueChange(g.value)}),p=()=>{a||(o.onOpenChange(!0),d())};return b.jsx(Ny,{asChild:!0,...i,children:b.jsx(De.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":XX(o.value)?"":void 0,...s,ref:c,onClick:ye(s.onClick,h=>{h.currentTarget.focus()}),onPointerDown:ye(s.onPointerDown,h=>{const m=h.target;m.hasPointerCapture(h.pointerId)&&m.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&(p(),o.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)},h.preventDefault())}),onKeyDown:ye(s.onKeyDown,h=>{const m=f.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&l(h.key),!(m&&h.key===" ")&&ZPe.includes(h.key)&&(p(),h.preventDefault())})})})});NX.displayName=RX;var PX="SelectValue",TX=S.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:o="",...a}=t,c=vf(PX,n),{onValueNodeHasChildrenChange:u}=c,f=i!==void 0,l=et(e,c.onValueNodeChange);return ir(()=>{u(f)},[u,f]),b.jsx(De.span,{...a,ref:l,style:{pointerEvents:"none"},children:XX(c.value)?b.jsx(b.Fragment,{children:o}):i})});TX.displayName=PX;var sTe="SelectIcon",kX=S.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...s}=t;return b.jsx(De.span,{"aria-hidden":!0,...s,ref:e,children:r||"▼"})});kX.displayName=sTe;var iTe="SelectPortal",DX=t=>b.jsx(my,{asChild:!0,...t});DX.displayName=iTe;var Rp="SelectContent",MX=S.forwardRef((t,e)=>{const n=vf(Rp,t.__scopeSelect),[r,s]=S.useState();if(ir(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?ss.createPortal(b.jsx(OX,{scope:t.__scopeSelect,children:b.jsx(ZR.Slot,{scope:t.__scopeSelect,children:b.jsx("div",{children:t.children})})}),i):null}return b.jsx(IX,{...t,ref:e})});MX.displayName=Rp;var wc=10,[OX,yf]=My(Rp),oTe="SelectContentImpl",IX=S.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:o,side:a,sideOffset:c,align:u,alignOffset:f,arrowPadding:l,collisionBoundary:d,collisionPadding:p,sticky:h,hideWhenDetached:m,avoidCollisions:y,...g}=t,v=vf(Rp,n),[x,_]=S.useState(null),[A,N]=S.useState(null),T=et(e,ce=>_(ce)),[E,P]=S.useState(null),[k,M]=S.useState(null),I=JR(n),[j,L]=S.useState(!1),H=S.useRef(!1);S.useEffect(()=>{if(x)return m_(x)},[x]),sR();const K=S.useCallback(ce=>{const[xe,...Ne]=I().map(Me=>Me.ref.current),[pe]=Ne.slice(-1),Le=document.activeElement;for(const Me of ce)if(Me===Le||(Me==null||Me.scrollIntoView({block:"nearest"}),Me===xe&&A&&(A.scrollTop=0),Me===pe&&A&&(A.scrollTop=A.scrollHeight),Me==null||Me.focus(),document.activeElement!==Le))return},[I,A]),V=S.useCallback(()=>K([E,x]),[K,E,x]);S.useEffect(()=>{j&&V()},[j,V]);const{onOpenChange:U,triggerPointerDownPosRef:Q}=v;S.useEffect(()=>{if(x){let ce={x:0,y:0};const xe=pe=>{var Le,Me;ce={x:Math.abs(Math.round(pe.pageX)-(((Le=Q.current)==null?void 0:Le.x)??0)),y:Math.abs(Math.round(pe.pageY)-(((Me=Q.current)==null?void 0:Me.y)??0))}},Ne=pe=>{ce.x<=10&&ce.y<=10?pe.preventDefault():x.contains(pe.target)||U(!1),document.removeEventListener("pointermove",xe),Q.current=null};return Q.current!==null&&(document.addEventListener("pointermove",xe),document.addEventListener("pointerup",Ne,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",xe),document.removeEventListener("pointerup",Ne,{capture:!0})}}},[x,U,Q]),S.useEffect(()=>{const ce=()=>U(!1);return window.addEventListener("blur",ce),window.addEventListener("resize",ce),()=>{window.removeEventListener("blur",ce),window.removeEventListener("resize",ce)}},[U]);const[ne,X]=ZX(ce=>{const xe=I().filter(Le=>!Le.disabled),Ne=xe.find(Le=>Le.ref.current===document.activeElement),pe=JX(xe,ce,Ne);pe&&setTimeout(()=>pe.ref.current.focus())}),G=S.useCallback((ce,xe,Ne)=>{const pe=!H.current&&!Ne;(v.value!==void 0&&v.value===xe||pe)&&(P(ce),pe&&(H.current=!0))},[v.value]),Y=S.useCallback(()=>x==null?void 0:x.focus(),[x]),Z=S.useCallback((ce,xe,Ne)=>{const pe=!H.current&&!Ne;(v.value!==void 0&&v.value===xe||pe)&&M(ce)},[v.value]),he=r==="popper"?iO:jX,fe=he===iO?{side:a,sideOffset:c,align:u,alignOffset:f,arrowPadding:l,collisionBoundary:d,collisionPadding:p,sticky:h,hideWhenDetached:m,avoidCollisions:y}:{};return b.jsx(OX,{scope:n,content:x,viewport:A,onViewportChange:N,itemRefCallback:G,selectedItem:E,onItemLeave:Y,itemTextRefCallback:Z,focusSelectedItem:V,selectedItemText:k,position:r,isPositioned:j,searchRef:ne,children:b.jsx(p_,{as:Ka,allowPinchZoom:!0,children:b.jsx(h_,{asChild:!0,trapped:v.open,onMountAutoFocus:ce=>{ce.preventDefault()},onUnmountAutoFocus:ye(s,ce=>{var xe;(xe=v.trigger)==null||xe.focus({preventScroll:!0}),ce.preventDefault()}),children:b.jsx(Au,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:ce=>ce.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:b.jsx(he,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:ce=>ce.preventDefault(),...g,...fe,onPlaced:()=>L(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:ye(g.onKeyDown,ce=>{const xe=ce.ctrlKey||ce.altKey||ce.metaKey;if(ce.key==="Tab"&&ce.preventDefault(),!xe&&ce.key.length===1&&X(ce.key),["ArrowUp","ArrowDown","Home","End"].includes(ce.key)){let pe=I().filter(Le=>!Le.disabled).map(Le=>Le.ref.current);if(["ArrowUp","End"].includes(ce.key)&&(pe=pe.slice().reverse()),["ArrowUp","ArrowDown"].includes(ce.key)){const Le=ce.target,Me=pe.indexOf(Le);pe=pe.slice(Me+1)}setTimeout(()=>K(pe)),ce.preventDefault()}})})})})})})});IX.displayName=oTe;var aTe="SelectItemAlignedPosition",jX=S.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...s}=t,i=vf(Rp,n),o=yf(Rp,n),[a,c]=S.useState(null),[u,f]=S.useState(null),l=et(e,T=>f(T)),d=JR(n),p=S.useRef(!1),h=S.useRef(!0),{viewport:m,selectedItem:y,selectedItemText:g,focusSelectedItem:v}=o,x=S.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&u&&m&&y&&g){const T=i.trigger.getBoundingClientRect(),E=u.getBoundingClientRect(),P=i.valueNode.getBoundingClientRect(),k=g.getBoundingClientRect();if(i.dir!=="rtl"){const Le=k.left-E.left,Me=P.left-Le,Oe=T.left-Me,Fe=T.width+Oe,ot=Math.max(Fe,E.width),nt=window.innerWidth-wc,At=fx(Me,[wc,nt-ot]);a.style.minWidth=Fe+"px",a.style.left=At+"px"}else{const Le=E.right-k.right,Me=window.innerWidth-P.right-Le,Oe=window.innerWidth-T.right-Me,Fe=T.width+Oe,ot=Math.max(Fe,E.width),nt=window.innerWidth-wc,At=fx(Me,[wc,nt-ot]);a.style.minWidth=Fe+"px",a.style.right=At+"px"}const M=d(),I=window.innerHeight-wc*2,j=m.scrollHeight,L=window.getComputedStyle(u),H=parseInt(L.borderTopWidth,10),K=parseInt(L.paddingTop,10),V=parseInt(L.borderBottomWidth,10),U=parseInt(L.paddingBottom,10),Q=H+K+j+U+V,ne=Math.min(y.offsetHeight*5,Q),X=window.getComputedStyle(m),G=parseInt(X.paddingTop,10),Y=parseInt(X.paddingBottom,10),Z=T.top+T.height/2-wc,he=I-Z,fe=y.offsetHeight/2,ce=y.offsetTop+fe,xe=H+K+ce,Ne=Q-xe;if(xe<=Z){const Le=y===M[M.length-1].ref.current;a.style.bottom="0px";const Me=u.clientHeight-m.offsetTop-m.offsetHeight,Oe=Math.max(he,fe+(Le?Y:0)+Me+V),Fe=xe+Oe;a.style.height=Fe+"px"}else{const Le=y===M[0].ref.current;a.style.top="0px";const Oe=Math.max(Z,H+m.offsetTop+(Le?G:0)+fe)+Ne;a.style.height=Oe+"px",m.scrollTop=xe-Z+m.offsetTop}a.style.margin=`${wc}px 0`,a.style.minHeight=ne+"px",a.style.maxHeight=I+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[d,i.trigger,i.valueNode,a,u,m,y,g,i.dir,r]);ir(()=>x(),[x]);const[_,A]=S.useState();ir(()=>{u&&A(window.getComputedStyle(u).zIndex)},[u]);const N=S.useCallback(T=>{T&&h.current===!0&&(x(),v==null||v(),h.current=!1)},[x,v]);return b.jsx(cTe,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:N,children:b.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:b.jsx(De.div,{...s,ref:l,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});jX.displayName=aTe;var lTe="SelectPopperPosition",iO=S.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=wc,...i}=t,o=eN(n);return b.jsx(A_,{...o,...i,ref:e,align:r,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});iO.displayName=lTe;var[cTe,u$]=My(Rp,{}),oO="SelectViewport",LX=S.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...s}=t,i=yf(oO,n),o=u$(oO,n),a=et(e,i.onViewportChange),c=S.useRef(0);return b.jsxs(b.Fragment,{children:[b.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}),b.jsx(ZR.Slot,{scope:n,children:b.jsx(De.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"auto",...s.style},onScroll:ye(s.onScroll,u=>{const f=u.currentTarget,{contentWrapper:l,shouldExpandOnScrollRef:d}=o;if(d!=null&&d.current&&l){const p=Math.abs(c.current-f.scrollTop);if(p>0){const h=window.innerHeight-wc*2,m=parseFloat(l.style.minHeight),y=parseFloat(l.style.height),g=Math.max(m,y);if(g<h){const v=g+p,x=Math.min(h,v),_=v-x;l.style.height=x+"px",l.style.bottom==="0px"&&(f.scrollTop=_>0?_:0,l.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});LX.displayName=oO;var $X="SelectGroup",[uTe,dTe]=My($X),fTe=S.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=zs();return b.jsx(uTe,{scope:n,id:s,children:b.jsx(De.div,{role:"group","aria-labelledby":s,...r,ref:e})})});fTe.displayName=$X;var FX="SelectLabel",zX=S.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=dTe(FX,n);return b.jsx(De.div,{id:s.id,...r,ref:e})});zX.displayName=FX;var zE="SelectItem",[hTe,BX]=My(zE),UX=S.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...o}=t,a=vf(zE,n),c=yf(zE,n),u=a.value===r,[f,l]=S.useState(i??""),[d,p]=S.useState(!1),h=et(e,g=>{var v;return(v=c.itemRefCallback)==null?void 0:v.call(c,g,r,s)}),m=zs(),y=()=>{s||(a.onValueChange(r),a.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 b.jsx(hTe,{scope:n,value:r,disabled:s,textId:m,isSelected:u,onItemTextChange:S.useCallback(g=>{l(v=>v||((g==null?void 0:g.textContent)??"").trim())},[]),children:b.jsx(ZR.ItemSlot,{scope:n,value:r,disabled:s,textValue:f,children:b.jsx(De.div,{role:"option","aria-labelledby":m,"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,...o,ref:h,onFocus:ye(o.onFocus,()=>p(!0)),onBlur:ye(o.onBlur,()=>p(!1)),onPointerUp:ye(o.onPointerUp,y),onPointerMove:ye(o.onPointerMove,g=>{var v;s?(v=c.onItemLeave)==null||v.call(c):g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ye(o.onPointerLeave,g=>{var v;g.currentTarget===document.activeElement&&((v=c.onItemLeave)==null||v.call(c))}),onKeyDown:ye(o.onKeyDown,g=>{var x;((x=c.searchRef)==null?void 0:x.current)!==""&&g.key===" "||(JPe.includes(g.key)&&y(),g.key===" "&&g.preventDefault())})})})})});UX.displayName=zE;var qb="SelectItemText",HX=S.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:s,...i}=t,o=vf(qb,n),a=yf(qb,n),c=BX(qb,n),u=rTe(qb,n),[f,l]=S.useState(null),d=et(e,g=>l(g),c.onItemTextChange,g=>{var v;return(v=a.itemTextRefCallback)==null?void 0:v.call(a,g,c.value,c.disabled)}),p=f==null?void 0:f.textContent,h=S.useMemo(()=>b.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:m,onNativeOptionRemove:y}=u;return ir(()=>(m(h),()=>y(h)),[m,y,h]),b.jsxs(b.Fragment,{children:[b.jsx(De.span,{id:c.textId,...i,ref:d}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?ss.createPortal(i.children,o.valueNode):null]})});HX.displayName=qb;var VX="SelectItemIndicator",qX=S.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return BX(VX,n).isSelected?b.jsx(De.span,{"aria-hidden":!0,...r,ref:e}):null});qX.displayName=VX;var aO="SelectScrollUpButton",WX=S.forwardRef((t,e)=>{const n=yf(aO,t.__scopeSelect),r=u$(aO,t.__scopeSelect),[s,i]=S.useState(!1),o=et(e,r.onScrollButtonChange);return ir(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=c.scrollTop>0;i(u)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?b.jsx(KX,{...t,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});WX.displayName=aO;var lO="SelectScrollDownButton",GX=S.forwardRef((t,e)=>{const n=yf(lO,t.__scopeSelect),r=u$(lO,t.__scopeSelect),[s,i]=S.useState(!1),o=et(e,r.onScrollButtonChange);return ir(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)<u;i(f)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?b.jsx(KX,{...t,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});GX.displayName=lO;var KX=S.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=t,i=yf("SelectScrollButton",n),o=S.useRef(null),a=JR(n),c=S.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return S.useEffect(()=>()=>c(),[c]),ir(()=>{var f;const u=a().find(l=>l.ref.current===document.activeElement);(f=u==null?void 0:u.ref.current)==null||f.scrollIntoView({block:"nearest"})},[a]),b.jsx(De.div,{"aria-hidden":!0,...s,ref:e,style:{flexShrink:0,...s.style},onPointerDown:ye(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:ye(s.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:ye(s.onPointerLeave,()=>{c()})})}),pTe="SelectSeparator",YX=S.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return b.jsx(De.div,{"aria-hidden":!0,...r,ref:e})});YX.displayName=pTe;var cO="SelectArrow",mTe=S.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=eN(n),i=vf(cO,n),o=yf(cO,n);return i.open&&o.position==="popper"?b.jsx(R_,{...s,...r,ref:e}):null});mTe.displayName=cO;function XX(t){return t===""||t===void 0}var QX=S.forwardRef((t,e)=>{const{value:n,...r}=t,s=S.useRef(null),i=et(e,s),o=Cy(n);return S.useEffect(()=>{const a=s.current,c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==n&&f){const l=new Event("change",{bubbles:!0});f.call(a,n),a.dispatchEvent(l)}},[o,n]),b.jsx(z_,{asChild:!0,children:b.jsx("select",{...r,ref:i,defaultValue:n})})});QX.displayName="BubbleSelect";function ZX(t){const e=on(t),n=S.useRef(""),r=S.useRef(0),s=S.useCallback(o=>{const a=n.current+o;e(a),function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(a)},[e]),i=S.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function JX(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 o=gTe(t,Math.max(i,0));s.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function gTe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var vTe=AX,eQ=NX,yTe=TX,bTe=kX,xTe=DX,tQ=MX,wTe=LX,nQ=zX,rQ=UX,_Te=HX,STe=qX,sQ=WX,iQ=GX,oQ=YX;const d$=vTe,f$=yTe,tN=S.forwardRef(({className:t,children:e,...n},r)=>b.jsxs(eQ,{ref:r,className:ie("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...n,children:[e,b.jsx(bTe,{asChild:!0,children:b.jsx(dy,{className:"h-4 w-4 opacity-50"})})]}));tN.displayName=eQ.displayName;const aQ=S.forwardRef(({className:t,...e},n)=>b.jsx(sQ,{ref:n,className:ie("flex cursor-default items-center justify-center py-1",t),...e,children:b.jsx(dq,{className:"h-4 w-4"})}));aQ.displayName=sQ.displayName;const lQ=S.forwardRef(({className:t,...e},n)=>b.jsx(iQ,{ref:n,className:ie("flex cursor-default items-center justify-center py-1",t),...e,children:b.jsx(dy,{className:"h-4 w-4"})}));lQ.displayName=iQ.displayName;const nN=S.forwardRef(({className:t,children:e,position:n="popper",...r},s)=>b.jsx(xTe,{children:b.jsxs(tQ,{ref:s,className:ie("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:[b.jsx(aQ,{}),b.jsx(wTe,{className:ie("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),b.jsx(lQ,{})]})}));nN.displayName=tQ.displayName;const CTe=S.forwardRef(({className:t,...e},n)=>b.jsx(nQ,{ref:n,className:ie("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));CTe.displayName=nQ.displayName;const bg=S.forwardRef(({className:t,children:e,...n},r)=>b.jsxs(rQ,{ref:r,className:ie("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[b.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(STe,{children:b.jsx(f_,{className:"h-4 w-4"})})}),b.jsx(_Te,{children:e})]}));bg.displayName=rQ.displayName;const ETe=S.forwardRef(({className:t,...e},n)=>b.jsx(oQ,{ref:n,className:ie("-mx-1 my-1 h-px bg-muted",t),...e}));ETe.displayName=oQ.displayName;const ATe=oR,RTe=aR,NTe=lR,cQ=S.forwardRef(({className:t,...e},n)=>b.jsx(gy,{className:ie("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));cQ.displayName=gy.displayName;const PTe=di("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"}}),uQ=S.forwardRef(({side:t="right",className:e,children:n,...r},s)=>b.jsxs(NTe,{children:[b.jsx(cQ,{}),b.jsxs(vy,{ref:s,className:ie(PTe({side:t}),e),...r,children:[n,b.jsxs(xy,{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:[b.jsx(Hv,{className:"h-4 w-4"}),b.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));uQ.displayName=vy.displayName;const TTe=S.forwardRef(({className:t,...e},n)=>b.jsx(yy,{ref:n,className:ie("text-lg font-semibold text-foreground",t),...e}));TTe.displayName=yy.displayName;const kTe=S.forwardRef(({className:t,...e},n)=>b.jsx(by,{ref:n,className:ie("text-sm text-muted-foreground",t),...e}));kTe.displayName=by.displayName;function _i({className:t,...e}){return b.jsx("div",{className:ie("animate-pulse rounded-md bg-muted",t),...e})}var dQ=["PageUp","PageDown"],fQ=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],hQ={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Oy="Slider",[uO,DTe,MTe]=Cu(Oy),[pQ,lHe]=In(Oy,[MTe]),[OTe,rN]=pQ(Oy),mQ=S.forwardRef((t,e)=>{const{name:n,min:r=0,max:s=100,step:i=1,orientation:o="horizontal",disabled:a=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[r],value:f,onValueChange:l=()=>{},onValueCommit:d=()=>{},inverted:p=!1,...h}=t,m=S.useRef(new Set),y=S.useRef(0),v=o==="horizontal"?ITe:jTe,[x=[],_]=mr({prop:f,defaultProp:u,onChange:k=>{var I;(I=[...m.current][y.current])==null||I.focus(),l(k)}}),A=S.useRef(x);function N(k){const M=BTe(x,k);P(k,M)}function T(k){P(k,y.current)}function E(){const k=A.current[y.current];x[y.current]!==k&&d(x)}function P(k,M,{commit:I}={commit:!1}){const j=qTe(i),L=WTe(Math.round((k-r)/i)*i+r,j),H=fx(L,[r,s]);_((K=[])=>{const V=FTe(K,H,M);if(VTe(V,c*i)){y.current=V.indexOf(H);const U=String(V)!==String(K);return U&&I&&d(V),U?V:K}else return K})}return b.jsx(OTe,{scope:t.__scopeSlider,name:n,disabled:a,min:r,max:s,valueIndexToChangeRef:y,thumbs:m.current,values:x,orientation:o,children:b.jsx(uO.Provider,{scope:t.__scopeSlider,children:b.jsx(uO.Slot,{scope:t.__scopeSlider,children:b.jsx(v,{"aria-disabled":a,"data-disabled":a?"":void 0,...h,ref:e,onPointerDown:ye(h.onPointerDown,()=>{a||(A.current=x)}),min:r,max:s,inverted:p,onSlideStart:a?void 0:N,onSlideMove:a?void 0:T,onSlideEnd:a?void 0:E,onHomeKeyDown:()=>!a&&P(r,0,{commit:!0}),onEndKeyDown:()=>!a&&P(s,x.length-1,{commit:!0}),onStepKeyDown:({event:k,direction:M})=>{if(!a){const L=dQ.includes(k.key)||k.shiftKey&&fQ.includes(k.key)?10:1,H=y.current,K=x[H],V=i*L*M;P(K+V,H,{commit:!0})}}})})})})});mQ.displayName=Oy;var[gQ,vQ]=pQ(Oy,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ITe=S.forwardRef((t,e)=>{const{min:n,max:r,dir:s,inverted:i,onSlideStart:o,onSlideMove:a,onSlideEnd:c,onStepKeyDown:u,...f}=t,[l,d]=S.useState(null),p=et(e,x=>d(x)),h=S.useRef(),m=el(s),y=m==="ltr",g=y&&!i||!y&&i;function v(x){const _=h.current||l.getBoundingClientRect(),A=[0,_.width],T=h$(A,g?[n,r]:[r,n]);return h.current=_,T(x-_.left)}return b.jsx(gQ,{scope:t.__scopeSlider,startEdge:g?"left":"right",endEdge:g?"right":"left",direction:g?1:-1,size:"width",children:b.jsx(yQ,{dir:m,"data-orientation":"horizontal",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{const _=v(x.clientX);o==null||o(_)},onSlideMove:x=>{const _=v(x.clientX);a==null||a(_)},onSlideEnd:()=>{h.current=void 0,c==null||c()},onStepKeyDown:x=>{const A=hQ[g?"from-left":"from-right"].includes(x.key);u==null||u({event:x,direction:A?-1:1})}})})}),jTe=S.forwardRef((t,e)=>{const{min:n,max:r,inverted:s,onSlideStart:i,onSlideMove:o,onSlideEnd:a,onStepKeyDown:c,...u}=t,f=S.useRef(null),l=et(e,f),d=S.useRef(),p=!s;function h(m){const y=d.current||f.current.getBoundingClientRect(),g=[0,y.height],x=h$(g,p?[r,n]:[n,r]);return d.current=y,x(m-y.top)}return b.jsx(gQ,{scope:t.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:b.jsx(yQ,{"data-orientation":"vertical",...u,ref:l,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:m=>{const y=h(m.clientY);i==null||i(y)},onSlideMove:m=>{const y=h(m.clientY);o==null||o(y)},onSlideEnd:()=>{d.current=void 0,a==null||a()},onStepKeyDown:m=>{const g=hQ[p?"from-bottom":"from-top"].includes(m.key);c==null||c({event:m,direction:g?-1:1})}})})}),yQ=S.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:o,onEndKeyDown:a,onStepKeyDown:c,...u}=t,f=rN(Oy,n);return b.jsx(De.span,{...u,ref:e,onKeyDown:ye(t.onKeyDown,l=>{l.key==="Home"?(o(l),l.preventDefault()):l.key==="End"?(a(l),l.preventDefault()):dQ.concat(fQ).includes(l.key)&&(c(l),l.preventDefault())}),onPointerDown:ye(t.onPointerDown,l=>{const d=l.target;d.setPointerCapture(l.pointerId),l.preventDefault(),f.thumbs.has(d)?d.focus():r(l)}),onPointerMove:ye(t.onPointerMove,l=>{l.target.hasPointerCapture(l.pointerId)&&s(l)}),onPointerUp:ye(t.onPointerUp,l=>{const d=l.target;d.hasPointerCapture(l.pointerId)&&(d.releasePointerCapture(l.pointerId),i(l))})})}),bQ="SliderTrack",xQ=S.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=rN(bQ,n);return b.jsx(De.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:e})});xQ.displayName=bQ;var dO="SliderRange",wQ=S.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=rN(dO,n),i=vQ(dO,n),o=S.useRef(null),a=et(e,o),c=s.values.length,u=s.values.map(d=>SQ(d,s.min,s.max)),f=c>1?Math.min(...u):0,l=100-Math.max(...u);return b.jsx(De.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:a,style:{...t.style,[i.startEdge]:f+"%",[i.endEdge]:l+"%"}})});wQ.displayName=dO;var fO="SliderThumb",_Q=S.forwardRef((t,e)=>{const n=DTe(t.__scopeSlider),[r,s]=S.useState(null),i=et(e,a=>s(a)),o=S.useMemo(()=>r?n().findIndex(a=>a.ref.current===r):-1,[n,r]);return b.jsx(LTe,{...t,ref:i,index:o})}),LTe=S.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:s,...i}=t,o=rN(fO,n),a=vQ(fO,n),[c,u]=S.useState(null),f=et(e,v=>u(v)),l=c?!!c.closest("form"):!0,d=w_(c),p=o.values[r],h=p===void 0?0:SQ(p,o.min,o.max),m=zTe(r,o.values.length),y=d==null?void 0:d[a.size],g=y?UTe(y,h,a.direction):0;return S.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]),b.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${h}% + ${g}px)`},children:[b.jsx(uO.ItemSlot,{scope:t.__scopeSlider,children:b.jsx(De.span,{role:"slider","aria-label":t["aria-label"]||m,"aria-valuemin":o.min,"aria-valuenow":p,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...i,ref:f,style:p===void 0?{display:"none"}:t.style,onFocus:ye(t.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),l&&b.jsx($Te,{name:s??(o.name?o.name+(o.values.length>1?"[]":""):void 0),value:p},r)]})});_Q.displayName=fO;var $Te=t=>{const{value:e,...n}=t,r=S.useRef(null),s=Cy(e);return S.useEffect(()=>{const i=r.current,o=window.HTMLInputElement.prototype,c=Object.getOwnPropertyDescriptor(o,"value").set;if(s!==e&&c){const u=new Event("input",{bubbles:!0});c.call(i,e),i.dispatchEvent(u)}},[s,e]),b.jsx("input",{style:{display:"none"},...n,ref:r,defaultValue:e})};function FTe(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}function SQ(t,e,n){const i=100/(n-e)*(t-e);return fx(i,[0,100])}function zTe(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function BTe(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 UTe(t,e,n){const r=t/2,i=h$([0,50],[0,r]);return(r-i(e)*n)*n}function HTe(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function VTe(t,e){if(e>0){const n=HTe(t);return Math.min(...n)>=e}return!0}function h$(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 qTe(t){return(String(t).split(".")[1]||"").length}function WTe(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var CQ=mQ,GTe=xQ,KTe=wQ,YTe=_Q;const XTe=S.forwardRef(({className:t,...e},n)=>b.jsxs(CQ,{ref:n,className:ie("relative flex w-full touch-none select-none items-center",t),...e,children:[b.jsx(GTe,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:b.jsx(KTe,{className:"absolute h-full bg-primary"})}),b.jsx(YTe,{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"})]}));XTe.displayName=CQ.displayName;var p$="Switch",[QTe,cHe]=In(p$),[ZTe,JTe]=QTe(p$),EQ=S.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:o,disabled:a,value:c="on",onCheckedChange:u,...f}=t,[l,d]=S.useState(null),p=et(e,v=>d(v)),h=S.useRef(!1),m=l?!!l.closest("form"):!0,[y=!1,g]=mr({prop:s,defaultProp:i,onChange:u});return b.jsxs(ZTe,{scope:n,checked:y,disabled:a,children:[b.jsx(De.button,{type:"button",role:"switch","aria-checked":y,"aria-required":o,"data-state":NQ(y),"data-disabled":a?"":void 0,disabled:a,value:c,...f,ref:p,onClick:ye(t.onClick,v=>{g(x=>!x),m&&(h.current=v.isPropagationStopped(),h.current||v.stopPropagation())})}),m&&b.jsx(eke,{control:l,bubbles:!h.current,name:r,value:c,checked:y,required:o,disabled:a,style:{transform:"translateX(-100%)"}})]})});EQ.displayName=p$;var AQ="SwitchThumb",RQ=S.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,s=JTe(AQ,n);return b.jsx(De.span,{"data-state":NQ(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:e})});RQ.displayName=AQ;var eke=t=>{const{control:e,checked:n,bubbles:r=!0,...s}=t,i=S.useRef(null),o=Cy(n),a=w_(e);return S.useEffect(()=>{const c=i.current,u=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(u,"checked").set;if(o!==n&&l){const d=new Event("click",{bubbles:r});l.call(c,n),c.dispatchEvent(d)}},[o,n,r]),b.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:i,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function NQ(t){return t?"checked":"unchecked"}var PQ=EQ,tke=RQ;const TQ=S.forwardRef(({className:t,...e},n)=>b.jsx(PQ,{className:ie("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...e,ref:n,children:b.jsx(tke,{className:ie("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));TQ.displayName=PQ.displayName;const sN=S.forwardRef(({className:t,...e},n)=>b.jsx("div",{className:"relative w-full overflow-auto",children:b.jsx("table",{ref:n,className:ie("w-full caption-bottom text-sm",t),...e})}));sN.displayName="Table";const iN=S.forwardRef(({className:t,...e},n)=>b.jsx("thead",{ref:n,className:ie("[&_tr]:border-b",t),...e}));iN.displayName="TableHeader";const oN=S.forwardRef(({className:t,...e},n)=>b.jsx("tbody",{ref:n,className:ie("[&_tr:last-child]:border-0",t),...e}));oN.displayName="TableBody";const nke=S.forwardRef(({className:t,...e},n)=>b.jsx("tfoot",{ref:n,className:ie("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));nke.displayName="TableFooter";const Qd=S.forwardRef(({className:t,...e},n)=>b.jsx("tr",{ref:n,className:ie("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...e}));Qd.displayName="TableRow";const aN=S.forwardRef(({className:t,...e},n)=>b.jsx("th",{ref:n,className:ie("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...e}));aN.displayName="TableHead";const hx=S.forwardRef(({className:t,...e},n)=>b.jsx("td",{ref:n,className:ie("py-2 px-4 align-middle [&:has([role=checkbox])]:pr-0",t),...e}));hx.displayName="TableCell";const kQ=S.forwardRef(({className:t,...e},n)=>b.jsx("caption",{ref:n,className:ie("mt-4 text-sm text-muted-foreground",t),...e}));kQ.displayName="TableCaption";var m$="Tabs",[rke,uHe]=In(m$,[Zl]),DQ=Zl(),[ske,g$]=rke(m$),MQ=S.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:o="horizontal",dir:a,activationMode:c="automatic",...u}=t,f=el(a),[l,d]=mr({prop:r,onChange:s,defaultProp:i});return b.jsx(ske,{scope:n,baseId:zs(),value:l,onValueChange:d,orientation:o,dir:f,activationMode:c,children:b.jsx(De.div,{dir:f,"data-orientation":o,...u,ref:e})})});MQ.displayName=m$;var OQ="TabsList",IQ=S.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...s}=t,i=g$(OQ,n),o=DQ(n);return b.jsx(N_,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:b.jsx(De.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:e})})});IQ.displayName=OQ;var jQ="TabsTrigger",LQ=S.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=t,o=g$(jQ,n),a=DQ(n),c=zQ(o.baseId,r),u=BQ(o.baseId,r),f=r===o.value;return b.jsx(P_,{asChild:!0,...a,focusable:!s,active:f,children:b.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:ye(t.onMouseDown,l=>{!s&&l.button===0&&l.ctrlKey===!1?o.onValueChange(r):l.preventDefault()}),onKeyDown:ye(t.onKeyDown,l=>{[" ","Enter"].includes(l.key)&&o.onValueChange(r)}),onFocus:ye(t.onFocus,()=>{const l=o.activationMode!=="manual";!f&&!s&&l&&o.onValueChange(r)})})})});LQ.displayName=jQ;var $Q="TabsContent",FQ=S.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...o}=t,a=g$($Q,n),c=zQ(a.baseId,r),u=BQ(a.baseId,r),f=r===a.value,l=S.useRef(f);return S.useEffect(()=>{const d=requestAnimationFrame(()=>l.current=!1);return()=>cancelAnimationFrame(d)},[]),b.jsx(Kn,{present:s||f,children:({present:d})=>b.jsx(De.div,{"data-state":f?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!d,id:u,tabIndex:0,...o,ref:e,style:{...t.style,animationDuration:l.current?"0s":void 0},children:d&&i})})});FQ.displayName=$Q;function zQ(t,e){return`${t}-trigger-${e}`}function BQ(t,e){return`${t}-content-${e}`}var ike=MQ,UQ=IQ,HQ=LQ,VQ=FQ;const v$=ike,lN=S.forwardRef(({className:t,...e},n)=>b.jsx(UQ,{ref:n,className:ie("inline-flex h-9 items-center justify-center rounded-lg bg-accent p-1 text-muted-foreground",t),...e}));lN.displayName=UQ.displayName;const Qv=S.forwardRef(({className:t,...e},n)=>b.jsx(HQ,{ref:n,className:ie("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",t),...e}));Qv.displayName=HQ.displayName;const Zv=S.forwardRef(({className:t,...e},n)=>b.jsx(VQ,{ref:n,className:ie("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));Zv.displayName=VQ.displayName;const qQ=S.forwardRef(({className:t,...e},n)=>b.jsx("textarea",{className:ie("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground/75 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:n,...e}));qQ.displayName="Textarea";var y$="ToastProvider",[b$,oke,ake]=Cu("Toast"),[WQ,dHe]=In("Toast",[ake]),[lke,cN]=WQ(y$),GQ=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=t,[a,c]=S.useState(null),[u,f]=S.useState(0),l=S.useRef(!1),d=S.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${y$}\`. Expected non-empty \`string\`.`),b.jsx(b$.Provider,{scope:e,children:b.jsx(lke,{scope:e,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:c,onToastAdd:S.useCallback(()=>f(p=>p+1),[]),onToastRemove:S.useCallback(()=>f(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:l,isClosePausedRef:d,children:o})})};GQ.displayName=y$;var KQ="ToastViewport",cke=["F8"],hO="toast.viewportPause",pO="toast.viewportResume",YQ=S.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=cke,label:s="Notifications ({hotkey})",...i}=t,o=cN(KQ,n),a=oke(n),c=S.useRef(null),u=S.useRef(null),f=S.useRef(null),l=S.useRef(null),d=et(e,l,o.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),h=o.toastCount>0;S.useEffect(()=>{const y=g=>{var x;r.every(_=>g[_]||g.code===_)&&((x=l.current)==null||x.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),S.useEffect(()=>{const y=c.current,g=l.current;if(h&&y&&g){const v=()=>{if(!o.isClosePausedRef.current){const N=new CustomEvent(hO);g.dispatchEvent(N),o.isClosePausedRef.current=!0}},x=()=>{if(o.isClosePausedRef.current){const N=new CustomEvent(pO);g.dispatchEvent(N),o.isClosePausedRef.current=!1}},_=N=>{!y.contains(N.relatedTarget)&&x()},A=()=>{y.contains(document.activeElement)||x()};return y.addEventListener("focusin",v),y.addEventListener("focusout",_),y.addEventListener("pointermove",v),y.addEventListener("pointerleave",A),window.addEventListener("blur",v),window.addEventListener("focus",x),()=>{y.removeEventListener("focusin",v),y.removeEventListener("focusout",_),y.removeEventListener("pointermove",v),y.removeEventListener("pointerleave",A),window.removeEventListener("blur",v),window.removeEventListener("focus",x)}}},[h,o.isClosePausedRef]);const m=S.useCallback(({tabbingDirection:y})=>{const v=a().map(x=>{const _=x.ref.current,A=[_,..._ke(_)];return y==="forwards"?A:A.reverse()});return(y==="forwards"?v.reverse():v).flat()},[a]);return S.useEffect(()=>{const y=l.current;if(y){const g=v=>{var A,N,T;const x=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!x){const E=document.activeElement,P=v.shiftKey;if(v.target===y&&P){(A=u.current)==null||A.focus();return}const I=m({tabbingDirection:P?"backwards":"forwards"}),j=I.findIndex(L=>L===E);Pk(I.slice(j+1))?v.preventDefault():P?(N=u.current)==null||N.focus():(T=f.current)==null||T.focus()}};return y.addEventListener("keydown",g),()=>y.removeEventListener("keydown",g)}},[a,m]),b.jsxs(Ume,{ref:c,role:"region","aria-label":s.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:h?void 0:"none"},children:[h&&b.jsx(mO,{ref:u,onFocusFromOutsideViewport:()=>{const y=m({tabbingDirection:"forwards"});Pk(y)}}),b.jsx(b$.Slot,{scope:n,children:b.jsx(De.ol,{tabIndex:-1,...i,ref:d})}),h&&b.jsx(mO,{ref:f,onFocusFromOutsideViewport:()=>{const y=m({tabbingDirection:"backwards"});Pk(y)}})]})});YQ.displayName=KQ;var XQ="ToastFocusProxy",mO=S.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=t,i=cN(XQ,n);return b.jsx(z_,{"aria-hidden":!0,tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:o=>{var u;const a=o.relatedTarget;!((u=i.viewport)!=null&&u.contains(a))&&r()}})});mO.displayName=XQ;var uN="Toast",uke="toast.swipeStart",dke="toast.swipeMove",fke="toast.swipeCancel",hke="toast.swipeEnd",QQ=S.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...o}=t,[a=!0,c]=mr({prop:r,defaultProp:s,onChange:i});return b.jsx(Kn,{present:n||a,children:b.jsx(gke,{open:a,...o,ref:e,onClose:()=>c(!1),onPause:on(t.onPause),onResume:on(t.onResume),onSwipeStart:ye(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ye(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:ye(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:ye(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)})})})});QQ.displayName=uN;var[pke,mke]=WQ(uN,{onClose(){}}),gke=S.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:a,onPause:c,onResume:u,onSwipeStart:f,onSwipeMove:l,onSwipeCancel:d,onSwipeEnd:p,...h}=t,m=cN(uN,n),[y,g]=S.useState(null),v=et(e,L=>g(L)),x=S.useRef(null),_=S.useRef(null),A=s||m.duration,N=S.useRef(0),T=S.useRef(A),E=S.useRef(0),{onToastAdd:P,onToastRemove:k}=m,M=on(()=>{var H;(y==null?void 0:y.contains(document.activeElement))&&((H=m.viewport)==null||H.focus()),o()}),I=S.useCallback(L=>{!L||L===1/0||(window.clearTimeout(E.current),N.current=new Date().getTime(),E.current=window.setTimeout(M,L))},[M]);S.useEffect(()=>{const L=m.viewport;if(L){const H=()=>{I(T.current),u==null||u()},K=()=>{const V=new Date().getTime()-N.current;T.current=T.current-V,window.clearTimeout(E.current),c==null||c()};return L.addEventListener(hO,K),L.addEventListener(pO,H),()=>{L.removeEventListener(hO,K),L.removeEventListener(pO,H)}}},[m.viewport,A,c,u,I]),S.useEffect(()=>{i&&!m.isClosePausedRef.current&&I(A)},[i,A,m.isClosePausedRef,I]),S.useEffect(()=>(P(),()=>k()),[P,k]);const j=S.useMemo(()=>y?sZ(y):null,[y]);return m.viewport?b.jsxs(b.Fragment,{children:[j&&b.jsx(vke,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:j}),b.jsx(pke,{scope:n,onClose:M,children:ss.createPortal(b.jsx(b$.ItemSlot,{scope:n,children:b.jsx(Bme,{asChild:!0,onEscapeKeyDown:ye(a,()=>{m.isFocusedToastEscapeKeyDownRef.current||M(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:b.jsx(De.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":m.swipeDirection,...h,ref:v,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:ye(t.onKeyDown,L=>{L.key==="Escape"&&(a==null||a(L.nativeEvent),L.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,M()))}),onPointerDown:ye(t.onPointerDown,L=>{L.button===0&&(x.current={x:L.clientX,y:L.clientY})}),onPointerMove:ye(t.onPointerMove,L=>{if(!x.current)return;const H=L.clientX-x.current.x,K=L.clientY-x.current.y,V=!!_.current,U=["left","right"].includes(m.swipeDirection),Q=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,ne=U?Q(0,H):0,X=U?0:Q(0,K),G=L.pointerType==="touch"?10:2,Y={x:ne,y:X},Z={originalEvent:L,delta:Y};V?(_.current=Y,A1(dke,l,Z,{discrete:!1})):U5(Y,m.swipeDirection,G)?(_.current=Y,A1(uke,f,Z,{discrete:!1}),L.target.setPointerCapture(L.pointerId)):(Math.abs(H)>G||Math.abs(K)>G)&&(x.current=null)}),onPointerUp:ye(t.onPointerUp,L=>{const H=_.current,K=L.target;if(K.hasPointerCapture(L.pointerId)&&K.releasePointerCapture(L.pointerId),_.current=null,x.current=null,H){const V=L.currentTarget,U={originalEvent:L,delta:H};U5(H,m.swipeDirection,m.swipeThreshold)?A1(hke,p,U,{discrete:!0}):A1(fke,d,U,{discrete:!0}),V.addEventListener("click",Q=>Q.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),vke=t=>{const{__scopeToast:e,children:n,...r}=t,s=cN(uN,e),[i,o]=S.useState(!1),[a,c]=S.useState(!1);return xke(()=>o(!0)),S.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:b.jsx(my,{asChild:!0,children:b.jsx(z_,{...r,children:i&&b.jsxs(b.Fragment,{children:[s.label," ",n]})})})},yke="ToastTitle",ZQ=S.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return b.jsx(De.div,{...r,ref:e})});ZQ.displayName=yke;var bke="ToastDescription",JQ=S.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return b.jsx(De.div,{...r,ref:e})});JQ.displayName=bke;var eZ="ToastAction",tZ=S.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?b.jsx(rZ,{altText:n,asChild:!0,children:b.jsx(x$,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${eZ}\`. Expected non-empty \`string\`.`),null)});tZ.displayName=eZ;var nZ="ToastClose",x$=S.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,s=mke(nZ,n);return b.jsx(rZ,{asChild:!0,children:b.jsx(De.button,{type:"button",...r,ref:e,onClick:ye(t.onClick,s.onClose)})})});x$.displayName=nZ;var rZ=S.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...s}=t;return b.jsx(De.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function sZ(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),wke(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...sZ(r))}}),e}function A1(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?Z0(s,i):s.dispatchEvent(i)}var U5=(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 xke(t=()=>{}){const e=on(t);ir(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function wke(t){return t.nodeType===t.ELEMENT_NODE}function _ke(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 Pk(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var Ske=GQ,iZ=YQ,oZ=QQ,aZ=ZQ,lZ=JQ,cZ=tZ,uZ=x$;const Cke=Ske,dZ=S.forwardRef(({className:t,...e},n)=>b.jsx(iZ,{ref:n,className:ie("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));dZ.displayName=iZ.displayName;const Eke=di("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"}}),fZ=S.forwardRef(({className:t,variant:e,...n},r)=>b.jsx(oZ,{ref:r,className:ie(Eke({variant:e}),t),...n}));fZ.displayName=oZ.displayName;const Ake=S.forwardRef(({className:t,...e},n)=>b.jsx(cZ,{ref:n,className:ie("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...e}));Ake.displayName=cZ.displayName;const hZ=S.forwardRef(({className:t,...e},n)=>b.jsx(uZ,{ref:n,className:ie("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:b.jsx(Hv,{className:"w-4 h-4"})}));hZ.displayName=uZ.displayName;const pZ=S.forwardRef(({className:t,...e},n)=>b.jsx(aZ,{ref:n,className:ie("text-sm font-semibold",t),...e}));pZ.displayName=aZ.displayName;const mZ=S.forwardRef(({className:t,...e},n)=>b.jsx(lZ,{ref:n,className:ie("text-sm opacity-90",t),...e}));mZ.displayName=lZ.displayName;const Rke=3,Nke=1e6;let Tk=0;function Pke(){return Tk=(Tk+1)%Number.MAX_SAFE_INTEGER,Tk.toString()}const kk=new Map,H5=t=>{if(kk.has(t))return;const e=setTimeout(()=>{kk.delete(t),S0({type:"REMOVE_TOAST",toastId:t})},Nke);kk.set(t,e)},Tke=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,Rke)};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?H5(n):t.toasts.forEach(r=>{H5(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)}}},lC=[];let cC={toasts:[]};function S0(t){cC=Tke(cC,t),lC.forEach(e=>{e(cC)})}function kke({...t}){const e=Pke(),n=s=>S0({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>S0({type:"DISMISS_TOAST",toastId:e});return S0({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:n}}function tc(){const[t,e]=S.useState(cC);return S.useEffect(()=>(lC.push(e),()=>{const n=lC.indexOf(e);n>-1&&lC.splice(n,1)}),[t]),{...t,toast:kke,dismiss:n=>S0({type:"DISMISS_TOAST",toastId:n})}}function gZ(){const{toasts:t}=tc();return b.jsxs(Cke,{swipeDirection:"down",children:[t.map(function({id:e,title:n,description:r,action:s,...i}){return b.jsxs(fZ,{...i,children:[b.jsxs("div",{className:"grid gap-1",children:[n&&b.jsx(pZ,{children:n}),r&&b.jsx(mZ,{children:r})]}),s,b.jsx(hZ,{})]},e)}),b.jsx(dZ,{className:"bottom-0 w-auto mx-auto sm:bottom-0 sm:left-0 sm:right-0"})]})}var Dke="Toggle",w$=S.forwardRef((t,e)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:s,...i}=t,[o=!1,a]=mr({prop:n,onChange:s,defaultProp:r});return b.jsx(De.button,{type:"button","aria-pressed":o,"data-state":o?"on":"off","data-disabled":t.disabled?"":void 0,...i,ref:e,onClick:ye(t.onClick,()=>{t.disabled||a(!o)})})});w$.displayName=Dke;var vZ=w$;const yZ=di("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"}}),bZ=S.forwardRef(({className:t,variant:e,size:n,...r},s)=>b.jsx(vZ,{ref:s,className:ie(yZ({variant:e,size:n,className:t})),...r}));bZ.displayName=vZ.displayName;var Iy="ToggleGroup",[xZ,fHe]=In(Iy,[Zl]),wZ=Zl(),_$=oe.forwardRef((t,e)=>{const{type:n,...r}=t;if(n==="single"){const s=r;return b.jsx(Mke,{...s,ref:e})}if(n==="multiple"){const s=r;return b.jsx(Oke,{...s,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${Iy}\``)});_$.displayName=Iy;var[_Z,SZ]=xZ(Iy),Mke=oe.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=t,[o,a]=mr({prop:n,defaultProp:r,onChange:s});return b.jsx(_Z,{scope:t.__scopeToggleGroup,type:"single",value:o?[o]:[],onItemActivate:a,onItemDeactivate:oe.useCallback(()=>a(""),[a]),children:b.jsx(CZ,{...i,ref:e})})}),Oke=oe.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=t,[o=[],a]=mr({prop:n,defaultProp:r,onChange:s}),c=oe.useCallback(f=>a((l=[])=>[...l,f]),[a]),u=oe.useCallback(f=>a((l=[])=>l.filter(d=>d!==f)),[a]);return b.jsx(_Z,{scope:t.__scopeToggleGroup,type:"multiple",value:o,onItemActivate:c,onItemDeactivate:u,children:b.jsx(CZ,{...i,ref:e})})});_$.displayName=Iy;var[Ike,jke]=xZ(Iy),CZ=oe.forwardRef((t,e)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:s=!0,orientation:i,dir:o,loop:a=!0,...c}=t,u=wZ(n),f=el(o),l={role:"group",dir:f,...c};return b.jsx(Ike,{scope:n,rovingFocus:s,disabled:r,children:s?b.jsx(N_,{asChild:!0,...u,orientation:i,dir:f,loop:a,children:b.jsx(De.div,{...l,ref:e})}):b.jsx(De.div,{...l,ref:e})})}),BE="ToggleGroupItem",EZ=oe.forwardRef((t,e)=>{const n=SZ(BE,t.__scopeToggleGroup),r=jke(BE,t.__scopeToggleGroup),s=wZ(t.__scopeToggleGroup),i=n.value.includes(t.value),o=r.disabled||t.disabled,a={...t,pressed:i,disabled:o},c=oe.useRef(null);return r.rovingFocus?b.jsx(P_,{asChild:!0,...s,focusable:!o,active:i,ref:c,children:b.jsx(V5,{...a,ref:e})}):b.jsx(V5,{...a,ref:e})});EZ.displayName=BE;var V5=oe.forwardRef((t,e)=>{const{__scopeToggleGroup:n,value:r,...s}=t,i=SZ(BE,n),o={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},a=i.type==="single"?o:void 0;return b.jsx(w$,{...a,...s,ref:e,onPressedChange:c=>{c?i.onItemActivate(r):i.onItemDeactivate(r)}})}),AZ=_$,RZ=EZ;const NZ=S.createContext({size:"default",variant:"default"}),Lke=S.forwardRef(({className:t,variant:e,size:n,children:r,...s},i)=>b.jsx(AZ,{ref:i,className:ie("flex items-center justify-center gap-1",t),...s,children:b.jsx(NZ.Provider,{value:{variant:e,size:n},children:r})}));Lke.displayName=AZ.displayName;const $ke=S.forwardRef(({className:t,children:e,variant:n,size:r,...s},i)=>{const o=S.useContext(NZ);return b.jsx(RZ,{ref:i,className:ie(yZ({variant:o.variant||n,size:o.size||r}),t),...s,children:e})});$ke.displayName=RZ.displayName;var[dN,hHe]=In("Tooltip",[Ql]),fN=Ql(),PZ="TooltipProvider",Fke=700,gO="tooltip.open",[zke,S$]=dN(PZ),TZ=t=>{const{__scopeTooltip:e,delayDuration:n=Fke,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,[o,a]=S.useState(!0),c=S.useRef(!1),u=S.useRef(0);return S.useEffect(()=>{const f=u.current;return()=>window.clearTimeout(f)},[]),b.jsx(zke,{scope:e,isOpenDelayed:o,delayDuration:n,onOpen:S.useCallback(()=>{window.clearTimeout(u.current),a(!1)},[]),onClose:S.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:S.useCallback(f=>{c.current=f},[]),disableHoverableContent:s,children:i})};TZ.displayName=PZ;var hN="Tooltip",[Bke,pN]=dN(hN),kZ=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s=!1,onOpenChange:i,disableHoverableContent:o,delayDuration:a}=t,c=S$(hN,t.__scopeTooltip),u=fN(e),[f,l]=S.useState(null),d=zs(),p=S.useRef(0),h=o??c.disableHoverableContent,m=a??c.delayDuration,y=S.useRef(!1),[g=!1,v]=mr({prop:r,defaultProp:s,onChange:T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(gO))):c.onClose(),i==null||i(T)}}),x=S.useMemo(()=>g?y.current?"delayed-open":"instant-open":"closed",[g]),_=S.useCallback(()=>{window.clearTimeout(p.current),y.current=!1,v(!0)},[v]),A=S.useCallback(()=>{window.clearTimeout(p.current),v(!1)},[v]),N=S.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,v(!0)},m)},[m,v]);return S.useEffect(()=>()=>window.clearTimeout(p.current),[]),b.jsx(LR,{...u,children:b.jsx(Bke,{scope:e,contentId:d,open:g,stateAttribute:x,trigger:f,onTriggerChange:l,onTriggerEnter:S.useCallback(()=>{c.isOpenDelayed?N():_()},[c.isOpenDelayed,N,_]),onTriggerLeave:S.useCallback(()=>{h?A():window.clearTimeout(p.current)},[A,h]),onOpen:_,onClose:A,disableHoverableContent:h,children:n})})};kZ.displayName=hN;var vO="TooltipTrigger",DZ=S.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=pN(vO,n),i=S$(vO,n),o=fN(n),a=S.useRef(null),c=et(e,a,s.onTriggerChange),u=S.useRef(!1),f=S.useRef(!1),l=S.useCallback(()=>u.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",l),[l]),b.jsx(Ny,{asChild:!0,...o,children:b.jsx(De.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:ye(t.onPointerMove,d=>{d.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:ye(t.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:ye(t.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",l,{once:!0})}),onFocus:ye(t.onFocus,()=>{u.current||s.onOpen()}),onBlur:ye(t.onBlur,s.onClose),onClick:ye(t.onClick,s.onClose)})})});DZ.displayName=vO;var Uke="TooltipPortal",[pHe,Hke]=dN(Uke,{forceMount:void 0}),Jv="TooltipContent",MZ=S.forwardRef((t,e)=>{const n=Hke(Jv,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,o=pN(Jv,t.__scopeTooltip);return b.jsx(Kn,{present:r||o.open,children:o.disableHoverableContent?b.jsx(OZ,{side:s,...i,ref:e}):b.jsx(Vke,{side:s,...i,ref:e})})}),Vke=S.forwardRef((t,e)=>{const n=pN(Jv,t.__scopeTooltip),r=S$(Jv,t.__scopeTooltip),s=S.useRef(null),i=et(e,s),[o,a]=S.useState(null),{trigger:c,onClose:u}=n,f=s.current,{onPointerInTransitChange:l}=r,d=S.useCallback(()=>{a(null),l(!1)},[l]),p=S.useCallback((h,m)=>{const y=h.currentTarget,g={x:h.clientX,y:h.clientY},v=Kke(g,y.getBoundingClientRect()),x=Yke(g,v),_=Xke(m.getBoundingClientRect()),A=Zke([...x,..._]);a(A),l(!0)},[l]);return S.useEffect(()=>()=>d(),[d]),S.useEffect(()=>{if(c&&f){const h=y=>p(y,f),m=y=>p(y,c);return c.addEventListener("pointerleave",h),f.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",h),f.removeEventListener("pointerleave",m)}}},[c,f,p,d]),S.useEffect(()=>{if(o){const h=m=>{const y=m.target,g={x:m.clientX,y:m.clientY},v=(c==null?void 0:c.contains(y))||(f==null?void 0:f.contains(y)),x=!Qke(g,o);v?d():x&&(d(),u())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[c,f,o,u,d]),b.jsx(OZ,{...t,ref:i})}),[qke,Wke]=dN(hN,{isInside:!1}),OZ=S.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=t,c=pN(Jv,n),u=fN(n),{onClose:f}=c;return S.useEffect(()=>(document.addEventListener(gO,f),()=>document.removeEventListener(gO,f)),[f]),S.useEffect(()=>{if(c.trigger){const l=d=>{const p=d.target;p!=null&&p.contains(c.trigger)&&f()};return window.addEventListener("scroll",l,{capture:!0}),()=>window.removeEventListener("scroll",l,{capture:!0})}},[c.trigger,f]),b.jsx(Au,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:l=>l.preventDefault(),onDismiss:f,children:b.jsxs(A_,{"data-state":c.stateAttribute,...u,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[b.jsx(oL,{children:r}),b.jsx(qke,{scope:n,isInside:!0,children:b.jsx(F9,{id:c.contentId,role:"tooltip",children:s||r})})]})})});MZ.displayName=Jv;var IZ="TooltipArrow",Gke=S.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=fN(n);return Wke(IZ,n).isInside?null:b.jsx(R_,{...s,...r,ref:e})});Gke.displayName=IZ;function Kke(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 Yke(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 Xke(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 Qke(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const a=e[i].x,c=e[i].y,u=e[o].x,f=e[o].y;c>r!=f>r&&n<(u-a)*(r-c)/(f-c)+a&&(s=!s)}return s}function Zke(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),Jke(e)}function Jke(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],o=e[e.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var eDe=TZ,tDe=kZ,nDe=DZ,jZ=MZ;const LZ=eDe,bs=tDe,xs=nDe,rs=S.forwardRef(({className:t,sideOffset:e=4,...n},r)=>b.jsx(jZ,{ref:r,sideOffset:e,className:ie("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));rs.displayName=jZ.displayName;/**
|
||
* @remix-run/router v1.19.0
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function tr(){return tr=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},tr.apply(this,arguments)}var Nr;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(Nr||(Nr={}));const q5="popstate";function rDe(t){t===void 0&&(t={});function e(r,s){let{pathname:i,search:o,hash:a}=r.location;return px("",{pathname:i,search:o,hash:a},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:Np(s)}return iDe(e,n,null,t)}function Ot(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function ey(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function sDe(){return Math.random().toString(36).substr(2,8)}function W5(t,e){return{usr:t.state,key:t.key,idx:e}}function px(t,e,n,r){return n===void 0&&(n=null),tr({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?bf(e):e,{state:n,key:e&&e.key||r||sDe()})}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 bf(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function iDe(t,e,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,a=Nr.Pop,c=null,u=f();u==null&&(u=0,o.replaceState(tr({},o.state,{idx:u}),""));function f(){return(o.state||{idx:null}).idx}function l(){a=Nr.Pop;let y=f(),g=y==null?null:y-u;u=y,c&&c({action:a,location:m.location,delta:g})}function d(y,g){a=Nr.Push;let v=px(m.location,y,g);u=f()+1;let x=W5(v,u),_=m.createHref(v);try{o.pushState(x,"",_)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;s.location.assign(_)}i&&c&&c({action:a,location:m.location,delta:1})}function p(y,g){a=Nr.Replace;let v=px(m.location,y,g);u=f();let x=W5(v,u),_=m.createHref(v);o.replaceState(x,"",_),i&&c&&c({action:a,location:m.location,delta:0})}function h(y){let g=s.location.origin!=="null"?s.location.origin:s.location.href,v=typeof y=="string"?y:Np(y);return v=v.replace(/ $/,"%20"),Ot(g,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,g)}let m={get action(){return a},get location(){return t(s,o)},listen(y){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(q5,l),c=y,()=>{s.removeEventListener(q5,l),c=null}},createHref(y){return e(s,y)},createURL:h,encodeLocation(y){let g=h(y);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:d,replace:p,go(y){return o.go(y)}};return m}var An;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(An||(An={}));const oDe=new Set(["lazy","caseSensitive","path","id","index","children"]);function aDe(t){return t.index===!0}function mx(t,e,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),t.map((s,i)=>{let o=[...n,String(i)],a=typeof s.id=="string"?s.id:o.join("-");if(Ot(s.index!==!0||!s.children,"Cannot specify children on an index route"),Ot(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),aDe(s)){let c=tr({},s,e(s),{id:a});return r[a]=c,c}else{let c=tr({},s,e(s),{id:a,children:void 0});return r[a]=c,s.children&&(c.children=mx(s.children,e,o,r)),c}})}function Kf(t,e,n){return n===void 0&&(n="/"),uC(t,e,n,!1)}function uC(t,e,n,r){let s=typeof e=="string"?bf(e):e,i=rf(s.pathname||"/",n);if(i==null)return null;let o=$Z(t);cDe(o);let a=null;for(let c=0;a==null&&c<o.length;++c){let u=xDe(i);a=yDe(o[c],u,r)}return a}function lDe(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 $Z(t,e,n,r){e===void 0&&(e=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(i,o,a)=>{let c={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(Ot(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=ou([r,c.relativePath]),f=n.concat(c);i.children&&i.children.length>0&&(Ot(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),$Z(i.children,e,f,u)),!(i.path==null&&!i.index)&&e.push({path:u,score:gDe(u,i.index),routesMeta:f})};return t.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))s(i,o);else for(let c of FZ(i.path))s(i,o,c)}),e}function FZ(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=FZ(r.join("/")),a=[];return a.push(...o.map(c=>c===""?i:[i,c].join("/"))),s&&a.push(...o),a.map(c=>t.startsWith("/")&&c===""?"/":c)}function cDe(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:vDe(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const uDe=/^:[\w-]+$/,dDe=3,fDe=2,hDe=1,pDe=10,mDe=-2,G5=t=>t==="*";function gDe(t,e){let n=t.split("/"),r=n.length;return n.some(G5)&&(r+=mDe),e&&(r+=fDe),n.filter(s=>!G5(s)).reduce((s,i)=>s+(uDe.test(i)?dDe:i===""?hDe:pDe),r)}function vDe(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 yDe(t,e,n){n===void 0&&(n=!1);let{routesMeta:r}=t,s={},i="/",o=[];for(let a=0;a<r.length;++a){let c=r[a],u=a===r.length-1,f=i==="/"?e:e.slice(i.length)||"/",l=K5({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},f),d=c.route;if(!l&&u&&n&&!r[r.length-1].route.index&&(l=K5({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},f)),!l)return null;Object.assign(s,l.params),o.push({params:s,pathname:ou([i,l.pathname]),pathnameBase:SDe(ou([i,l.pathnameBase])),route:d}),l.pathnameBase!=="/"&&(i=ou([i,l.pathnameBase]))}return o}function K5(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=bDe(t.path,t.caseSensitive,t.end),s=e.match(n);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),a=s.slice(1);return{params:r.reduce((u,f,l)=>{let{paramName:d,isOptional:p}=f;if(d==="*"){let m=a[l]||"";o=i.slice(0,i.length-m.length).replace(/(.)\/+$/,"$1")}const h=a[l];return p&&!h?u[d]=void 0:u[d]=(h||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:t}}function bDe(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),ey(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],s="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,c)=>(r.push({paramName:a,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),s+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":t!==""&&t!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),r]}function xDe(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return ey(!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 rf(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 wDe(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:s=""}=typeof t=="string"?bf(t):t;return{pathname:n?n.startsWith("/")?n:_De(n,e):e,search:CDe(r),hash:EDe(s)}}function _De(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 Dk(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 zZ(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function mN(t,e){let n=zZ(t);return e?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function gN(t,e,n,r){r===void 0&&(r=!1);let s;typeof t=="string"?s=bf(t):(s=tr({},t),Ot(!s.pathname||!s.pathname.includes("?"),Dk("?","pathname","search",s)),Ot(!s.pathname||!s.pathname.includes("#"),Dk("#","pathname","hash",s)),Ot(!s.search||!s.search.includes("#"),Dk("#","search","hash",s)));let i=t===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=n;else{let l=e.length-1;if(!r&&o.startsWith("..")){let d=o.split("/");for(;d[0]==="..";)d.shift(),l-=1;s.pathname=d.join("/")}a=l>=0?e[l]:"/"}let c=wDe(s,a),u=o&&o!=="/"&&o.endsWith("/"),f=(i||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||f)&&(c.pathname+="/"),c}const ou=t=>t.join("/").replace(/\/\/+/g,"/"),SDe=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),CDe=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,EDe=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class UE{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 vN(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const BZ=["post","put","patch","delete"],ADe=new Set(BZ),RDe=["get",...BZ],NDe=new Set(RDe),PDe=new Set([301,302,303,307,308]),TDe=new Set([307,308]),Mk={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},kDe={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Om={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},C$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,DDe=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),UZ="remix-router-transitions";function MDe(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",r=!n;Ot(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let s;if(t.mapRouteProperties)s=t.mapRouteProperties;else if(t.detectErrorBoundary){let re=t.detectErrorBoundary;s=ae=>({hasErrorBoundary:re(ae)})}else s=DDe;let i={},o=mx(t.routes,s,void 0,i),a,c=t.basename||"/",u=t.unstable_dataStrategy||$De,f=t.unstable_patchRoutesOnMiss,l=tr({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},t.future),d=null,p=new Set,h=null,m=null,y=null,g=t.hydrationData!=null,v=Kf(o,t.history.location,c),x=null;if(v==null&&!f){let re=Zs(404,{pathname:t.history.location.pathname}),{matches:ae,route:ge}=sU(o);v=ae,x={[ge.id]:re}}v&&!t.hydrationData&&Gi(v,o,t.history.location.pathname).active&&(v=null);let _;if(v)if(v.some(re=>re.route.lazy))_=!1;else if(!v.some(re=>re.route.loader))_=!0;else if(l.v7_partialHydration){let re=t.hydrationData?t.hydrationData.loaderData:null,ae=t.hydrationData?t.hydrationData.errors:null,ge=_e=>_e.route.loader?typeof _e.route.loader=="function"&&_e.route.loader.hydrate===!0?!1:re&&re[_e.route.id]!==void 0||ae&&ae[_e.route.id]!==void 0:!0;if(ae){let _e=v.findIndex(ze=>ae[ze.route.id]!==void 0);_=v.slice(0,_e+1).every(ge)}else _=v.every(ge)}else _=t.hydrationData!=null;else if(_=!1,v=[],l.v7_partialHydration){let re=Gi(null,o,t.history.location.pathname);re.active&&re.matches&&(v=re.matches)}let A,N={historyAction:t.history.action,location:t.history.location,matches:v,initialized:_,navigation:Mk,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},T=Nr.Pop,E=!1,P,k=!1,M=new Map,I=null,j=!1,L=!1,H=[],K=new Set,V=new Map,U=0,Q=-1,ne=new Map,X=new Set,G=new Map,Y=new Map,Z=new Set,he=new Map,fe=new Map,ce=new Map,xe=!1;function Ne(){if(d=t.history.listen(re=>{let{action:ae,location:ge,delta:_e}=re;if(xe){xe=!1;return}ey(fe.size===0||_e!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ze=Pt({currentLocation:N.location,nextLocation:ge,historyAction:ae});if(ze&&_e!=null){xe=!0,t.history.go(_e*-1),yt(ze,{state:"blocked",location:ge,proceed(){yt(ze,{state:"proceeding",proceed:void 0,reset:void 0,location:ge}),t.history.go(_e)},reset(){let Ke=new Map(N.blockers);Ke.set(ze,Om),Me({blockers:Ke})}});return}return nt(ae,ge)}),n){QDe(e,M);let re=()=>ZDe(e,M);e.addEventListener("pagehide",re),I=()=>e.removeEventListener("pagehide",re)}return N.initialized||nt(Nr.Pop,N.location,{initialHydration:!0}),A}function pe(){d&&d(),I&&I(),p.clear(),P&&P.abort(),N.fetchers.forEach((re,ae)=>_n(ae)),N.blockers.forEach((re,ae)=>Ze(ae))}function Le(re){return p.add(re),()=>p.delete(re)}function Me(re,ae){ae===void 0&&(ae={}),N=tr({},N,re);let ge=[],_e=[];l.v7_fetcherPersist&&N.fetchers.forEach((ze,Ke)=>{ze.state==="idle"&&(Z.has(Ke)?_e.push(Ke):ge.push(Ke))}),[...p].forEach(ze=>ze(N,{deletedFetchers:_e,unstable_viewTransitionOpts:ae.viewTransitionOpts,unstable_flushSync:ae.flushSync===!0})),l.v7_fetcherPersist&&(ge.forEach(ze=>N.fetchers.delete(ze)),_e.forEach(ze=>_n(ze)))}function Oe(re,ae,ge){var _e,ze;let{flushSync:Ke}=ge===void 0?{}:ge,ut=N.actionData!=null&&N.navigation.formMethod!=null&&$a(N.navigation.formMethod)&&N.navigation.state==="loading"&&((_e=re.state)==null?void 0:_e._isRedirect)!==!0,je;ae.actionData?Object.keys(ae.actionData).length>0?je=ae.actionData:je=null:ut?je=N.actionData:je=null;let xt=ae.loaderData?nU(N.loaderData,ae.loaderData,ae.matches||[],ae.errors):N.loaderData,rt=N.blockers;rt.size>0&&(rt=new Map(rt),rt.forEach((tn,hn)=>rt.set(hn,Om)));let st=E===!0||N.navigation.formMethod!=null&&$a(N.navigation.formMethod)&&((ze=re.state)==null?void 0:ze._isRedirect)!==!0;a&&(o=a,a=void 0),j||T===Nr.Pop||(T===Nr.Push?t.history.push(re,re.state):T===Nr.Replace&&t.history.replace(re,re.state));let cn;if(T===Nr.Pop){let tn=M.get(N.location.pathname);tn&&tn.has(re.pathname)?cn={currentLocation:N.location,nextLocation:re}:M.has(re.pathname)&&(cn={currentLocation:re,nextLocation:N.location})}else if(k){let tn=M.get(N.location.pathname);tn?tn.add(re.pathname):(tn=new Set([re.pathname]),M.set(N.location.pathname,tn)),cn={currentLocation:N.location,nextLocation:re}}Me(tr({},ae,{actionData:je,loaderData:xt,historyAction:T,location:re,initialized:!0,navigation:Mk,revalidation:"idle",restoreScrollPosition:Dr(re,ae.matches||N.matches),preventScrollReset:st,blockers:rt}),{viewTransitionOpts:cn,flushSync:Ke===!0}),T=Nr.Pop,E=!1,k=!1,j=!1,L=!1,H=[]}async function Fe(re,ae){if(typeof re=="number"){t.history.go(re);return}let ge=yO(N.location,N.matches,c,l.v7_prependBasename,re,l.v7_relativeSplatPath,ae==null?void 0:ae.fromRouteId,ae==null?void 0:ae.relative),{path:_e,submission:ze,error:Ke}=Y5(l.v7_normalizeFormMethod,!1,ge,ae),ut=N.location,je=px(N.location,_e,ae&&ae.state);je=tr({},je,t.history.encodeLocation(je));let xt=ae&&ae.replace!=null?ae.replace:void 0,rt=Nr.Push;xt===!0?rt=Nr.Replace:xt===!1||ze!=null&&$a(ze.formMethod)&&ze.formAction===N.location.pathname+N.location.search&&(rt=Nr.Replace);let st=ae&&"preventScrollReset"in ae?ae.preventScrollReset===!0:void 0,cn=(ae&&ae.unstable_flushSync)===!0,tn=Pt({currentLocation:ut,nextLocation:je,historyAction:rt});if(tn){yt(tn,{state:"blocked",location:je,proceed(){yt(tn,{state:"proceeding",proceed:void 0,reset:void 0,location:je}),Fe(re,ae)},reset(){let hn=new Map(N.blockers);hn.set(tn,Om),Me({blockers:hn})}});return}return await nt(rt,je,{submission:ze,pendingError:Ke,preventScrollReset:st,replace:ae&&ae.replace,enableViewTransition:ae&&ae.unstable_viewTransition,flushSync:cn})}function ot(){if(gt(),Me({revalidation:"loading"}),N.navigation.state!=="submitting"){if(N.navigation.state==="idle"){nt(N.historyAction,N.location,{startUninterruptedRevalidation:!0});return}nt(T||N.historyAction,N.navigation.location,{overrideNavigation:N.navigation})}}async function nt(re,ae,ge){P&&P.abort(),P=null,T=re,j=(ge&&ge.startUninterruptedRevalidation)===!0,Cr(N.location,N.matches),E=(ge&&ge.preventScrollReset)===!0,k=(ge&&ge.enableViewTransition)===!0;let _e=a||o,ze=ge&&ge.overrideNavigation,Ke=Kf(_e,ae,c),ut=(ge&&ge.flushSync)===!0,je=Gi(Ke,_e,ae.pathname);if(je.active&&je.matches&&(Ke=je.matches),!Ke){let{error:Jt,notFoundMatches:Mr,route:lr}=St(ae.pathname);Oe(ae,{matches:Mr,loaderData:{},errors:{[lr.id]:Jt}},{flushSync:ut});return}if(N.initialized&&!L&&VDe(N.location,ae)&&!(ge&&ge.submission&&$a(ge.submission.formMethod))){Oe(ae,{matches:Ke},{flushSync:ut});return}P=new AbortController;let xt=Rm(t.history,ae,P.signal,ge&&ge.submission),rt;if(ge&&ge.pendingError)rt=[tg(Ke).route.id,{type:An.error,error:ge.pendingError}];else if(ge&&ge.submission&&$a(ge.submission.formMethod)){let Jt=await At(xt,ae,ge.submission,Ke,je.active,{replace:ge.replace,flushSync:ut});if(Jt.shortCircuited)return;if(Jt.pendingActionResult){let[Mr,lr]=Jt.pendingActionResult;if(vo(lr)&&vN(lr.error)&&lr.error.status===404){P=null,Oe(ae,{matches:Jt.matches,loaderData:{},errors:{[Mr]:lr.error}});return}}Ke=Jt.matches||Ke,rt=Jt.pendingActionResult,ze=Ok(ae,ge.submission),ut=!1,je.active=!1,xt=Rm(t.history,xt.url,xt.signal)}let{shortCircuited:st,matches:cn,loaderData:tn,errors:hn}=await ee(xt,ae,Ke,je.active,ze,ge&&ge.submission,ge&&ge.fetcherSubmission,ge&&ge.replace,ge&&ge.initialHydration===!0,ut,rt);st||(P=null,Oe(ae,tr({matches:cn||Ke},rU(rt),{loaderData:tn,errors:hn})))}async function At(re,ae,ge,_e,ze,Ke){Ke===void 0&&(Ke={}),gt();let ut=YDe(ae,ge);if(Me({navigation:ut},{flushSync:Ke.flushSync===!0}),ze){let rt=await Yr(_e,ae.pathname,re.signal);if(rt.type==="aborted")return{shortCircuited:!0};if(rt.type==="error"){let{boundaryId:st,error:cn}=Wt(ae.pathname,rt);return{matches:rt.partialMatches,pendingActionResult:[st,{type:An.error,error:cn}]}}else if(rt.matches)_e=rt.matches;else{let{notFoundMatches:st,error:cn,route:tn}=St(ae.pathname);return{matches:st,pendingActionResult:[tn.id,{type:An.error,error:cn}]}}}let je,xt=Wb(_e,ae);if(!xt.route.action&&!xt.route.lazy)je={type:An.error,error:Zs(405,{method:re.method,pathname:ae.pathname,routeId:xt.route.id})};else if(je=(await tt("action",re,[xt],_e))[0],re.signal.aborted)return{shortCircuited:!0};if(rh(je)){let rt;return Ke&&Ke.replace!=null?rt=Ke.replace:rt=J5(je.response.headers.get("Location"),new URL(re.url),c)===N.location.pathname+N.location.search,await Ve(re,je,{submission:ge,replace:rt}),{shortCircuited:!0}}if(nh(je))throw Zs(400,{type:"defer-action"});if(vo(je)){let rt=tg(_e,xt.route.id);return(Ke&&Ke.replace)!==!0&&(T=Nr.Push),{matches:_e,pendingActionResult:[rt.route.id,je]}}return{matches:_e,pendingActionResult:[xt.route.id,je]}}async function ee(re,ae,ge,_e,ze,Ke,ut,je,xt,rt,st){let cn=ze||Ok(ae,Ke),tn=Ke||ut||lU(cn),hn=!j&&(!l.v7_partialHydration||!xt);if(_e){if(hn){let Yn=de(st);Me(tr({navigation:cn},Yn!==void 0?{actionData:Yn}:{}),{flushSync:rt})}let Ct=await Yr(ge,ae.pathname,re.signal);if(Ct.type==="aborted")return{shortCircuited:!0};if(Ct.type==="error"){let{boundaryId:Yn,error:Hs}=Wt(ae.pathname,Ct);return{matches:Ct.partialMatches,loaderData:{},errors:{[Yn]:Hs}}}else if(Ct.matches)ge=Ct.matches;else{let{error:Yn,notFoundMatches:Hs,route:jn}=St(ae.pathname);return{matches:Hs,loaderData:{},errors:{[jn.id]:Yn}}}}let Jt=a||o,[Mr,lr]=X5(t.history,N,ge,tn,ae,l.v7_partialHydration&&xt===!0,l.v7_skipActionErrorRevalidation,L,H,K,Z,G,X,Jt,c,st);if(Zt(Ct=>!(ge&&ge.some(Yn=>Yn.route.id===Ct))||Mr&&Mr.some(Yn=>Yn.route.id===Ct)),Q=++U,Mr.length===0&&lr.length===0){let Ct=$e();return Oe(ae,tr({matches:ge,loaderData:{},errors:st&&vo(st[1])?{[st[0]]:st[1].error}:null},rU(st),Ct?{fetchers:new Map(N.fetchers)}:{}),{flushSync:rt}),{shortCircuited:!0}}if(hn){let Ct={};if(!_e){Ct.navigation=cn;let Yn=de(st);Yn!==void 0&&(Ct.actionData=Yn)}lr.length>0&&(Ct.fetchers=me(lr)),Me(Ct,{flushSync:rt})}lr.forEach(Ct=>{V.has(Ct.key)&&or(Ct.key),Ct.controller&&V.set(Ct.key,Ct.controller)});let rl=()=>lr.forEach(Ct=>or(Ct.key));P&&P.signal.addEventListener("abort",rl);let{loaderResults:sl,fetcherResults:pa}=await qt(N.matches,ge,Mr,lr,re);if(re.signal.aborted)return{shortCircuited:!0};P&&P.signal.removeEventListener("abort",rl),lr.forEach(Ct=>V.delete(Ct.key));let Pu=iU([...sl,...pa]);if(Pu){if(Pu.idx>=Mr.length){let Ct=lr[Pu.idx-Mr.length].key;X.add(Ct)}return await Ve(re,Pu.result,{replace:je}),{shortCircuited:!0}}let{loaderData:Tu,errors:To}=tU(N,ge,Mr,sl,st,lr,pa,he);he.forEach((Ct,Yn)=>{Ct.subscribe(Hs=>{(Hs||Ct.done)&&he.delete(Yn)})}),l.v7_partialHydration&&xt&&N.errors&&Object.entries(N.errors).filter(Ct=>{let[Yn]=Ct;return!Mr.some(Hs=>Hs.route.id===Yn)}).forEach(Ct=>{let[Yn,Hs]=Ct;To=Object.assign(To||{},{[Yn]:Hs})});let Ef=$e(),Af=Xe(Q),Rf=Ef||Af||lr.length>0;return tr({matches:ge,loaderData:Tu,errors:To},Rf?{fetchers:new Map(N.fetchers)}:{})}function de(re){if(re&&!vo(re[1]))return{[re[0]]:re[1].data};if(N.actionData)return Object.keys(N.actionData).length===0?null:N.actionData}function me(re){return re.forEach(ae=>{let ge=N.fetchers.get(ae.key),_e=Eb(void 0,ge?ge.data:void 0);N.fetchers.set(ae.key,_e)}),new Map(N.fetchers)}function Re(re,ae,ge,_e){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");V.has(re)&&or(re);let ze=(_e&&_e.unstable_flushSync)===!0,Ke=a||o,ut=yO(N.location,N.matches,c,l.v7_prependBasename,ge,l.v7_relativeSplatPath,ae,_e==null?void 0:_e.relative),je=Kf(Ke,ut,c),xt=Gi(je,Ke,ut);if(xt.active&&xt.matches&&(je=xt.matches),!je){ln(re,ae,Zs(404,{pathname:ut}),{flushSync:ze});return}let{path:rt,submission:st,error:cn}=Y5(l.v7_normalizeFormMethod,!0,ut,_e);if(cn){ln(re,ae,cn,{flushSync:ze});return}let tn=Wb(je,rt);if(E=(_e&&_e.preventScrollReset)===!0,st&&$a(st.formMethod)){Pe(re,ae,rt,tn,je,xt.active,ze,st);return}G.set(re,{routeId:ae,path:rt}),Ee(re,ae,rt,tn,je,xt.active,ze,st)}async function Pe(re,ae,ge,_e,ze,Ke,ut,je){gt(),G.delete(re);function xt(jn){if(!jn.route.action&&!jn.route.lazy){let ko=Zs(405,{method:je.formMethod,pathname:ge,routeId:ae});return ln(re,ae,ko,{flushSync:ut}),!0}return!1}if(!Ke&&xt(_e))return;let rt=N.fetchers.get(re);kt(re,XDe(je,rt),{flushSync:ut});let st=new AbortController,cn=Rm(t.history,ge,st.signal,je);if(Ke){let jn=await Yr(ze,ge,cn.signal);if(jn.type==="aborted")return;if(jn.type==="error"){let{error:ko}=Wt(ge,jn);ln(re,ae,ko,{flushSync:ut});return}else if(jn.matches){if(ze=jn.matches,_e=Wb(ze,ge),xt(_e))return}else{ln(re,ae,Zs(404,{pathname:ge}),{flushSync:ut});return}}V.set(re,st);let tn=U,Jt=(await tt("action",cn,[_e],ze))[0];if(cn.signal.aborted){V.get(re)===st&&V.delete(re);return}if(l.v7_fetcherPersist&&Z.has(re)){if(rh(Jt)||vo(Jt)){kt(re,Yu(void 0));return}}else{if(rh(Jt))if(V.delete(re),Q>tn){kt(re,Yu(void 0));return}else return X.add(re),kt(re,Eb(je)),Ve(cn,Jt,{fetcherSubmission:je});if(vo(Jt)){ln(re,ae,Jt.error);return}}if(nh(Jt))throw Zs(400,{type:"defer-action"});let Mr=N.navigation.location||N.location,lr=Rm(t.history,Mr,st.signal),rl=a||o,sl=N.navigation.state!=="idle"?Kf(rl,N.navigation.location,c):N.matches;Ot(sl,"Didn't find any matches after fetcher action");let pa=++U;ne.set(re,pa);let Pu=Eb(je,Jt.data);N.fetchers.set(re,Pu);let[Tu,To]=X5(t.history,N,sl,je,Mr,!1,l.v7_skipActionErrorRevalidation,L,H,K,Z,G,X,rl,c,[_e.route.id,Jt]);To.filter(jn=>jn.key!==re).forEach(jn=>{let ko=jn.key,qy=N.fetchers.get(ko),sS=Eb(void 0,qy?qy.data:void 0);N.fetchers.set(ko,sS),V.has(ko)&&or(ko),jn.controller&&V.set(ko,jn.controller)}),Me({fetchers:new Map(N.fetchers)});let Ef=()=>To.forEach(jn=>or(jn.key));st.signal.addEventListener("abort",Ef);let{loaderResults:Af,fetcherResults:Rf}=await qt(N.matches,sl,Tu,To,lr);if(st.signal.aborted)return;st.signal.removeEventListener("abort",Ef),ne.delete(re),V.delete(re),To.forEach(jn=>V.delete(jn.key));let Ct=iU([...Af,...Rf]);if(Ct){if(Ct.idx>=Tu.length){let jn=To[Ct.idx-Tu.length].key;X.add(jn)}return Ve(lr,Ct.result)}let{loaderData:Yn,errors:Hs}=tU(N,N.matches,Tu,Af,void 0,To,Rf,he);if(N.fetchers.has(re)){let jn=Yu(Jt.data);N.fetchers.set(re,jn)}Xe(pa),N.navigation.state==="loading"&&pa>Q?(Ot(T,"Expected pending action"),P&&P.abort(),Oe(N.navigation.location,{matches:sl,loaderData:Yn,errors:Hs,fetchers:new Map(N.fetchers)})):(Me({errors:Hs,loaderData:nU(N.loaderData,Yn,sl,Hs),fetchers:new Map(N.fetchers)}),L=!1)}async function Ee(re,ae,ge,_e,ze,Ke,ut,je){let xt=N.fetchers.get(re);kt(re,Eb(je,xt?xt.data:void 0),{flushSync:ut});let rt=new AbortController,st=Rm(t.history,ge,rt.signal);if(Ke){let Jt=await Yr(ze,ge,st.signal);if(Jt.type==="aborted")return;if(Jt.type==="error"){let{error:Mr}=Wt(ge,Jt);ln(re,ae,Mr,{flushSync:ut});return}else if(Jt.matches)ze=Jt.matches,_e=Wb(ze,ge);else{ln(re,ae,Zs(404,{pathname:ge}),{flushSync:ut});return}}V.set(re,rt);let cn=U,hn=(await tt("loader",st,[_e],ze))[0];if(nh(hn)&&(hn=await GZ(hn,st.signal,!0)||hn),V.get(re)===rt&&V.delete(re),!st.signal.aborted){if(Z.has(re)){kt(re,Yu(void 0));return}if(rh(hn))if(Q>cn){kt(re,Yu(void 0));return}else{X.add(re),await Ve(st,hn);return}if(vo(hn)){ln(re,ae,hn.error);return}Ot(!nh(hn),"Unhandled fetcher deferred data"),kt(re,Yu(hn.data))}}async function Ve(re,ae,ge){let{submission:_e,fetcherSubmission:ze,replace:Ke}=ge===void 0?{}:ge;ae.response.headers.has("X-Remix-Revalidate")&&(L=!0);let ut=ae.response.headers.get("Location");Ot(ut,"Expected a Location header on the redirect Response"),ut=J5(ut,new URL(re.url),c);let je=px(N.location,ut,{_isRedirect:!0});if(n){let hn=!1;if(ae.response.headers.has("X-Remix-Reload-Document"))hn=!0;else if(C$.test(ut)){const Jt=t.history.createURL(ut);hn=Jt.origin!==e.location.origin||rf(Jt.pathname,c)==null}if(hn){Ke?e.location.replace(ut):e.location.assign(ut);return}}P=null;let xt=Ke===!0||ae.response.headers.has("X-Remix-Replace")?Nr.Replace:Nr.Push,{formMethod:rt,formAction:st,formEncType:cn}=N.navigation;!_e&&!ze&&rt&&st&&cn&&(_e=lU(N.navigation));let tn=_e||ze;if(TDe.has(ae.response.status)&&tn&&$a(tn.formMethod))await nt(xt,je,{submission:tr({},tn,{formAction:ut}),preventScrollReset:E});else{let hn=Ok(je,_e);await nt(xt,je,{overrideNavigation:hn,fetcherSubmission:ze,preventScrollReset:E})}}async function tt(re,ae,ge,_e){try{let ze=await FDe(u,re,ae,ge,_e,i,s);return await Promise.all(ze.map((Ke,ut)=>{if(WDe(Ke)){let je=Ke.result;return{type:An.redirect,response:UDe(je,ae,ge[ut].route.id,_e,c,l.v7_relativeSplatPath)}}return BDe(Ke)}))}catch(ze){return ge.map(()=>({type:An.error,error:ze}))}}async function qt(re,ae,ge,_e,ze){let[Ke,...ut]=await Promise.all([ge.length?tt("loader",ze,ge,ae):[],..._e.map(je=>{if(je.matches&&je.match&&je.controller){let xt=Rm(t.history,je.path,je.controller.signal);return tt("loader",xt,[je.match],je.matches).then(rt=>rt[0])}else return Promise.resolve({type:An.error,error:Zs(404,{pathname:je.path})})})]);return await Promise.all([aU(re,ge,Ke,Ke.map(()=>ze.signal),!1,N.loaderData),aU(re,_e.map(je=>je.match),ut,_e.map(je=>je.controller?je.controller.signal:null),!0)]),{loaderResults:Ke,fetcherResults:ut}}function gt(){L=!0,H.push(...Zt()),G.forEach((re,ae)=>{V.has(ae)&&(K.add(ae),or(ae))})}function kt(re,ae,ge){ge===void 0&&(ge={}),N.fetchers.set(re,ae),Me({fetchers:new Map(N.fetchers)},{flushSync:(ge&&ge.flushSync)===!0})}function ln(re,ae,ge,_e){_e===void 0&&(_e={});let ze=tg(N.matches,ae);_n(re),Me({errors:{[ze.route.id]:ge},fetchers:new Map(N.fetchers)},{flushSync:(_e&&_e.flushSync)===!0})}function gr(re){return l.v7_fetcherPersist&&(Y.set(re,(Y.get(re)||0)+1),Z.has(re)&&Z.delete(re)),N.fetchers.get(re)||kDe}function _n(re){let ae=N.fetchers.get(re);V.has(re)&&!(ae&&ae.state==="loading"&&ne.has(re))&&or(re),G.delete(re),ne.delete(re),X.delete(re),Z.delete(re),K.delete(re),N.fetchers.delete(re)}function pi(re){if(l.v7_fetcherPersist){let ae=(Y.get(re)||0)-1;ae<=0?(Y.delete(re),Z.add(re)):Y.set(re,ae)}else _n(re);Me({fetchers:new Map(N.fetchers)})}function or(re){let ae=V.get(re);Ot(ae,"Expected fetch controller: "+re),ae.abort(),V.delete(re)}function mi(re){for(let ae of re){let ge=gr(ae),_e=Yu(ge.data);N.fetchers.set(ae,_e)}}function $e(){let re=[],ae=!1;for(let ge of X){let _e=N.fetchers.get(ge);Ot(_e,"Expected fetcher: "+ge),_e.state==="loading"&&(X.delete(ge),re.push(ge),ae=!0)}return mi(re),ae}function Xe(re){let ae=[];for(let[ge,_e]of ne)if(_e<re){let ze=N.fetchers.get(ge);Ot(ze,"Expected fetcher: "+ge),ze.state==="loading"&&(or(ge),ne.delete(ge),ae.push(ge))}return mi(ae),ae.length>0}function ht(re,ae){let ge=N.blockers.get(re)||Om;return fe.get(re)!==ae&&fe.set(re,ae),ge}function Ze(re){N.blockers.delete(re),fe.delete(re)}function yt(re,ae){let ge=N.blockers.get(re)||Om;Ot(ge.state==="unblocked"&&ae.state==="blocked"||ge.state==="blocked"&&ae.state==="blocked"||ge.state==="blocked"&&ae.state==="proceeding"||ge.state==="blocked"&&ae.state==="unblocked"||ge.state==="proceeding"&&ae.state==="unblocked","Invalid blocker state transition: "+ge.state+" -> "+ae.state);let _e=new Map(N.blockers);_e.set(re,ae),Me({blockers:_e})}function Pt(re){let{currentLocation:ae,nextLocation:ge,historyAction:_e}=re;if(fe.size===0)return;fe.size>1&&ey(!1,"A router only supports one blocker at a time");let ze=Array.from(fe.entries()),[Ke,ut]=ze[ze.length-1],je=N.blockers.get(Ke);if(!(je&&je.state==="proceeding")&&ut({currentLocation:ae,nextLocation:ge,historyAction:_e}))return Ke}function St(re){let ae=Zs(404,{pathname:re}),ge=a||o,{matches:_e,route:ze}=sU(ge);return Zt(),{notFoundMatches:_e,route:ze,error:ae}}function Wt(re,ae){return{boundaryId:tg(ae.partialMatches).route.id,error:Zs(400,{type:"route-discovery",pathname:re,message:ae.error!=null&&"message"in ae.error?ae.error:String(ae.error)})}}function Zt(re){let ae=[];return he.forEach((ge,_e)=>{(!re||re(_e))&&(ge.cancel(),ae.push(_e),he.delete(_e))}),ae}function ar(re,ae,ge){if(h=re,y=ae,m=ge||null,!g&&N.navigation===Mk){g=!0;let _e=Dr(N.location,N.matches);_e!=null&&Me({restoreScrollPosition:_e})}return()=>{h=null,y=null,m=null}}function Pn(re,ae){return m&&m(re,ae.map(_e=>lDe(_e,N.loaderData)))||re.key}function Cr(re,ae){if(h&&y){let ge=Pn(re,ae);h[ge]=y()}}function Dr(re,ae){if(h){let ge=Pn(re,ae),_e=h[ge];if(typeof _e=="number")return _e}return null}function Gi(re,ae,ge){if(f)if(re){let _e=re[re.length-1].route;if(_e.path&&(_e.path==="*"||_e.path.endsWith("/*")))return{active:!0,matches:uC(ae,ge,c,!0)}}else return{active:!0,matches:uC(ae,ge,c,!0)||[]};return{active:!1,matches:null}}async function Yr(re,ae,ge){let _e=re,ze=_e.length>0?_e[_e.length-1].route:null;for(;;){let Ke=a==null,ut=a||o;try{await LDe(f,ae,_e,ut,i,s,ce,ge)}catch(st){return{type:"error",error:st,partialMatches:_e}}finally{Ke&&(o=[...o])}if(ge.aborted)return{type:"aborted"};let je=Kf(ut,ae,c),xt=!1;if(je){let st=je[je.length-1].route;if(st.index)return{type:"success",matches:je};if(st.path&&st.path.length>0)if(st.path==="*")xt=!0;else return{type:"success",matches:je}}let rt=uC(ut,ae,c,!0);if(!rt||_e.map(st=>st.route.id).join("-")===rt.map(st=>st.route.id).join("-"))return{type:"success",matches:xt?je:null};if(_e=rt,ze=_e[_e.length-1].route,ze.path==="*")return{type:"success",matches:_e}}}function rc(re){i={},a=mx(re,s,void 0,i)}function ha(re,ae){let ge=a==null;VZ(re,ae,a||o,i,s),ge&&(o=[...o],Me({}))}return A={get basename(){return c},get future(){return l},get state(){return N},get routes(){return o},get window(){return e},initialize:Ne,subscribe:Le,enableScrollRestoration:ar,navigate:Fe,fetch:Re,revalidate:ot,createHref:re=>t.history.createHref(re),encodeLocation:re=>t.history.encodeLocation(re),getFetcher:gr,deleteFetcher:pi,dispose:pe,getBlocker:ht,deleteBlocker:Ze,patchRoutes:ha,_internalFetchControllers:V,_internalActiveDeferreds:he,_internalSetRoutes:rc},A}function ODe(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function yO(t,e,n,r,s,i,o,a){let c,u;if(o){c=[];for(let l of e)if(c.push(l),l.route.id===o){u=l;break}}else c=e,u=e[e.length-1];let f=gN(s||".",mN(c,i),rf(t.pathname,n)||t.pathname,a==="path");return s==null&&(f.search=t.search,f.hash=t.hash),(s==null||s===""||s===".")&&u&&u.route.index&&!E$(f.search)&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(f.pathname=f.pathname==="/"?n:ou([n,f.pathname])),Np(f)}function Y5(t,e,n,r){if(!r||!ODe(r))return{path:n};if(r.formMethod&&!KDe(r.formMethod))return{path:n,error:Zs(405,{method:r.formMethod})};let s=()=>({path:n,error:Zs(400,{type:"invalid-body"})}),i=r.formMethod||"get",o=t?i.toUpperCase():i.toLowerCase(),a=qZ(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!$a(o))return s();let d=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((p,h)=>{let[m,y]=h;return""+p+m+"="+y+`
|
||
`},""):String(r.body);return{path:n,submission:{formMethod:o,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:d}}}else if(r.formEncType==="application/json"){if(!$a(o))return s();try{let d=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:o,formAction:a,formEncType:r.formEncType,formData:void 0,json:d,text:void 0}}}catch{return s()}}}Ot(typeof FormData=="function","FormData is not available in this environment");let c,u;if(r.formData)c=bO(r.formData),u=r.formData;else if(r.body instanceof FormData)c=bO(r.body),u=r.body;else if(r.body instanceof URLSearchParams)c=r.body,u=eU(c);else if(r.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(r.body),u=eU(c)}catch{return s()}let f={formMethod:o,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if($a(f.formMethod))return{path:n,submission:f};let l=bf(n);return e&&l.search&&E$(l.search)&&c.append("index",""),l.search="?"+c,{path:Np(l),submission:f}}function IDe(t,e){let n=t;if(e){let r=t.findIndex(s=>s.route.id===e);r>=0&&(n=t.slice(0,r))}return n}function X5(t,e,n,r,s,i,o,a,c,u,f,l,d,p,h,m){let y=m?vo(m[1])?m[1].error:m[1].data:void 0,g=t.createURL(e.location),v=t.createURL(s),x=m&&vo(m[1])?m[0]:void 0,_=x?IDe(n,x):n,A=m?m[1].statusCode:void 0,N=o&&A&&A>=400,T=_.filter((P,k)=>{let{route:M}=P;if(M.lazy)return!0;if(M.loader==null)return!1;if(i)return typeof M.loader!="function"||M.loader.hydrate?!0:e.loaderData[M.id]===void 0&&(!e.errors||e.errors[M.id]===void 0);if(jDe(e.loaderData,e.matches[k],P)||c.some(L=>L===P.route.id))return!0;let I=e.matches[k],j=P;return Q5(P,tr({currentUrl:g,currentParams:I.params,nextUrl:v,nextParams:j.params},r,{actionResult:y,actionStatus:A,defaultShouldRevalidate:N?!1:a||g.pathname+g.search===v.pathname+v.search||g.search!==v.search||HZ(I,j)}))}),E=[];return l.forEach((P,k)=>{if(i||!n.some(H=>H.route.id===P.routeId)||f.has(k))return;let M=Kf(p,P.path,h);if(!M){E.push({key:k,routeId:P.routeId,path:P.path,matches:null,match:null,controller:null});return}let I=e.fetchers.get(k),j=Wb(M,P.path),L=!1;d.has(k)?L=!1:u.has(k)?(u.delete(k),L=!0):I&&I.state!=="idle"&&I.data===void 0?L=a:L=Q5(j,tr({currentUrl:g,currentParams:e.matches[e.matches.length-1].params,nextUrl:v,nextParams:n[n.length-1].params},r,{actionResult:y,actionStatus:A,defaultShouldRevalidate:N?!1:a})),L&&E.push({key:k,routeId:P.routeId,path:P.path,matches:M,match:j,controller:new AbortController})}),[T,E]}function jDe(t,e,n){let r=!e||n.route.id!==e.route.id,s=t[n.route.id]===void 0;return r||s}function HZ(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function Q5(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}async function LDe(t,e,n,r,s,i,o,a){let c=[e,...n.map(u=>u.route.id)].join("-");try{let u=o.get(c);u||(u=t({path:e,matches:n,patch:(f,l)=>{a.aborted||VZ(f,l,r,s,i)}}),o.set(c,u)),u&&qDe(u)&&await u}finally{o.delete(c)}}function VZ(t,e,n,r,s){if(t){var i;let o=r[t];Ot(o,"No route found to patch children into: routeId = "+t);let a=mx(e,s,[t,"patch",String(((i=o.children)==null?void 0:i.length)||"0")],r);o.children?o.children.push(...a):o.children=a}else{let o=mx(e,s,["patch",String(n.length||"0")],r);n.push(...o)}}async function Z5(t,e,n){if(!t.lazy)return;let r=await t.lazy();if(!t.lazy)return;let s=n[t.id];Ot(s,"No route found in manifest");let i={};for(let o in r){let c=s[o]!==void 0&&o!=="hasErrorBoundary";ey(!c,'Route "'+s.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!c&&!oDe.has(o)&&(i[o]=r[o])}Object.assign(s,i),Object.assign(s,tr({},e(s),{lazy:void 0}))}function $De(t){return Promise.all(t.matches.map(e=>e.resolve()))}async function FDe(t,e,n,r,s,i,o,a){let c=r.reduce((l,d)=>l.add(d.route.id),new Set),u=new Set,f=await t({matches:s.map(l=>{let d=c.has(l.route.id);return tr({},l,{shouldLoad:d,resolve:h=>(u.add(l.route.id),d?zDe(e,n,l,i,o,h,a):Promise.resolve({type:An.data,result:void 0}))})}),request:n,params:s[0].params,context:a});return s.forEach(l=>Ot(u.has(l.route.id),'`match.resolve()` was not called for route id "'+l.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')),f.filter((l,d)=>c.has(s[d].route.id))}async function zDe(t,e,n,r,s,i,o){let a,c,u=f=>{let l,d=new Promise((m,y)=>l=y);c=()=>l(),e.signal.addEventListener("abort",c);let p=m=>typeof f!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+t+'" [routeId: '+n.route.id+"]"))):f({request:e,params:n.params,context:o},...m!==void 0?[m]:[]),h;return i?h=i(m=>p(m)):h=(async()=>{try{return{type:"data",result:await p()}}catch(m){return{type:"error",result:m}}})(),Promise.race([h,d])};try{let f=n.route[t];if(n.route.lazy)if(f){let l,[d]=await Promise.all([u(f).catch(p=>{l=p}),Z5(n.route,s,r)]);if(l!==void 0)throw l;a=d}else if(await Z5(n.route,s,r),f=n.route[t],f)a=await u(f);else if(t==="action"){let l=new URL(e.url),d=l.pathname+l.search;throw Zs(405,{method:e.method,pathname:d,routeId:n.route.id})}else return{type:An.data,result:void 0};else if(f)a=await u(f);else{let l=new URL(e.url),d=l.pathname+l.search;throw Zs(404,{pathname:d})}Ot(a.result!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(f){return{type:An.error,result:f}}finally{c&&e.signal.removeEventListener("abort",c)}return a}async function BDe(t){let{result:e,type:n}=t;if(WZ(e)){let u;try{let f=e.headers.get("Content-Type");f&&/\bapplication\/json\b/.test(f)?e.body==null?u=null:u=await e.json():u=await e.text()}catch(f){return{type:An.error,error:f}}return n===An.error?{type:An.error,error:new UE(e.status,e.statusText,u),statusCode:e.status,headers:e.headers}:{type:An.data,data:u,statusCode:e.status,headers:e.headers}}if(n===An.error){if(oU(e)){var r;if(e.data instanceof Error){var s;return{type:An.error,error:e.data,statusCode:(s=e.init)==null?void 0:s.status}}e=new UE(((r=e.init)==null?void 0:r.status)||500,void 0,e.data)}return{type:An.error,error:e,statusCode:vN(e)?e.status:void 0}}if(GDe(e)){var i,o;return{type:An.deferred,deferredData:e,statusCode:(i=e.init)==null?void 0:i.status,headers:((o=e.init)==null?void 0:o.headers)&&new Headers(e.init.headers)}}if(oU(e)){var a,c;return{type:An.data,data:e.data,statusCode:(a=e.init)==null?void 0:a.status,headers:(c=e.init)!=null&&c.headers?new Headers(e.init.headers):void 0}}return{type:An.data,data:e}}function UDe(t,e,n,r,s,i){let o=t.headers.get("Location");if(Ot(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!C$.test(o)){let a=r.slice(0,r.findIndex(c=>c.route.id===n)+1);o=yO(new URL(e.url),a,s,!0,o,i),t.headers.set("Location",o)}return t}function J5(t,e,n){if(C$.test(t)){let r=t,s=r.startsWith("//")?new URL(e.protocol+r):new URL(r),i=rf(s.pathname,n)!=null;if(s.origin===e.origin&&i)return s.pathname+s.search+s.hash}return t}function Rm(t,e,n,r){let s=t.createURL(qZ(e)).toString(),i={signal:n};if(r&&$a(r.formMethod)){let{formMethod:o,formEncType:a}=r;i.method=o.toUpperCase(),a==="application/json"?(i.headers=new Headers({"Content-Type":a}),i.body=JSON.stringify(r.json)):a==="text/plain"?i.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?i.body=bO(r.formData):i.body=r.formData}return new Request(s,i)}function bO(t){let e=new URLSearchParams;for(let[n,r]of t.entries())e.append(n,typeof r=="string"?r:r.name);return e}function eU(t){let e=new FormData;for(let[n,r]of t.entries())e.append(n,r);return e}function HDe(t,e,n,r,s,i){let o={},a=null,c,u=!1,f={},l=r&&vo(r[1])?r[1].error:void 0;return n.forEach((d,p)=>{let h=e[p].route.id;if(Ot(!rh(d),"Cannot handle redirect results in processLoaderData"),vo(d)){let m=d.error;l!==void 0&&(m=l,l=void 0),a=a||{};{let y=tg(t,h);a[y.route.id]==null&&(a[y.route.id]=m)}o[h]=void 0,u||(u=!0,c=vN(d.error)?d.error.status:500),d.headers&&(f[h]=d.headers)}else nh(d)?(s.set(h,d.deferredData),o[h]=d.deferredData.data,d.statusCode!=null&&d.statusCode!==200&&!u&&(c=d.statusCode),d.headers&&(f[h]=d.headers)):(o[h]=d.data,d.statusCode&&d.statusCode!==200&&!u&&(c=d.statusCode),d.headers&&(f[h]=d.headers))}),l!==void 0&&r&&(a={[r[0]]:l},o[r[0]]=void 0),{loaderData:o,errors:a,statusCode:c||200,loaderHeaders:f}}function tU(t,e,n,r,s,i,o,a){let{loaderData:c,errors:u}=HDe(e,n,r,s,a);for(let f=0;f<i.length;f++){let{key:l,match:d,controller:p}=i[f];Ot(o!==void 0&&o[f]!==void 0,"Did not find corresponding fetcher result");let h=o[f];if(!(p&&p.signal.aborted))if(vo(h)){let m=tg(t.matches,d==null?void 0:d.route.id);u&&u[m.route.id]||(u=tr({},u,{[m.route.id]:h.error})),t.fetchers.delete(l)}else if(rh(h))Ot(!1,"Unhandled fetcher revalidation redirect");else if(nh(h))Ot(!1,"Unhandled fetcher deferred data");else{let m=Yu(h.data);t.fetchers.set(l,m)}}return{loaderData:c,errors:u}}function nU(t,e,n,r){let s=tr({},e);for(let i of n){let o=i.route.id;if(e.hasOwnProperty(o)?e[o]!==void 0&&(s[o]=e[o]):t[o]!==void 0&&i.route.loader&&(s[o]=t[o]),r&&r.hasOwnProperty(o))break}return s}function rU(t){return t?vo(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function tg(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 sU(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 Zs(t,e){let{pathname:n,routeId:r,method:s,type:i,message:o}=e===void 0?{}:e,a="Unknown Server Error",c="Unknown @remix-run/router error";return t===400?(a="Bad Request",i==="route-discovery"?c='Unable to match URL "'+n+'" - the `unstable_patchRoutesOnMiss()` '+(`function threw the following error:
|
||
`+o):s&&n&&r?c="You made a "+s+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?c="defer() is not supported in actions":i==="invalid-body"&&(c="Unable to encode submission body")):t===403?(a="Forbidden",c='Route "'+r+'" does not match URL "'+n+'"'):t===404?(a="Not Found",c='No route matches URL "'+n+'"'):t===405&&(a="Method Not Allowed",s&&n&&r?c="You made a "+s.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":s&&(c='Invalid request method "'+s.toUpperCase()+'"')),new UE(t||500,a,new Error(c),!0)}function iU(t){for(let e=t.length-1;e>=0;e--){let n=t[e];if(rh(n))return{result:n,idx:e}}}function qZ(t){let e=typeof t=="string"?bf(t):t;return Np(tr({},e,{hash:""}))}function VDe(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function qDe(t){return typeof t=="object"&&t!=null&&"then"in t}function WDe(t){return WZ(t.result)&&PDe.has(t.result.status)}function nh(t){return t.type===An.deferred}function vo(t){return t.type===An.error}function rh(t){return(t&&t.type)===An.redirect}function oU(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function GDe(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 WZ(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function KDe(t){return NDe.has(t.toLowerCase())}function $a(t){return ADe.has(t.toLowerCase())}async function aU(t,e,n,r,s,i){for(let o=0;o<n.length;o++){let a=n[o],c=e[o];if(!c)continue;let u=t.find(l=>l.route.id===c.route.id),f=u!=null&&!HZ(u,c)&&(i&&i[c.route.id])!==void 0;if(nh(a)&&(s||f)){let l=r[o];Ot(l,"Expected an AbortSignal for revalidating fetcher deferred result"),await GZ(a,l,s).then(d=>{d&&(n[o]=d||n[o])})}}}async function GZ(t,e,n){if(n===void 0&&(n=!1),!await t.deferredData.resolveData(e)){if(n)try{return{type:An.data,data:t.deferredData.unwrappedData}}catch(s){return{type:An.error,error:s}}return{type:An.data,data:t.deferredData.data}}}function E$(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function Wb(t,e){let n=typeof e=="string"?bf(e).search:e.search;if(t[t.length-1].route.index&&E$(n||""))return t[t.length-1];let r=zZ(t);return r[r.length-1]}function lU(t){let{formMethod:e,formAction:n,formEncType:r,text:s,formData:i,json:o}=t;if(!(!e||!n||!r)){if(s!=null)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:void 0,text:s};if(i!=null)return{formMethod:e,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(o!==void 0)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function Ok(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 YDe(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 Eb(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 XDe(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function Yu(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function QDe(t,e){try{let n=t.sessionStorage.getItem(UZ);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 ZDe(t,e){if(e.size>0){let n={};for(let[r,s]of e)n[r]=[...s];try{t.sessionStorage.setItem(UZ,JSON.stringify(n))}catch(r){ey(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
|
||
* React Router v6.26.0
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function ty(){return ty=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},ty.apply(this,arguments)}const yN=S.createContext(null),KZ=S.createContext(null),xf=S.createContext(null),A$=S.createContext(null),nc=S.createContext({outlet:null,matches:[],isDataRoute:!1}),YZ=S.createContext(null);function JDe(t,e){let{relative:n}=e===void 0?{}:e;jy()||Ot(!1);let{basename:r,navigator:s}=S.useContext(xf),{hash:i,pathname:o,search:a}=QZ(t,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:ou([r,o])),s.createHref({pathname:c,search:a,hash:i})}function jy(){return S.useContext(A$)!=null}function wf(){return jy()||Ot(!1),S.useContext(A$).location}function XZ(t){S.useContext(xf).static||S.useLayoutEffect(t)}function Us(){let{isDataRoute:t}=S.useContext(nc);return t?pMe():eMe()}function eMe(){jy()||Ot(!1);let t=S.useContext(yN),{basename:e,future:n,navigator:r}=S.useContext(xf),{matches:s}=S.useContext(nc),{pathname:i}=wf(),o=JSON.stringify(mN(s,n.v7_relativeSplatPath)),a=S.useRef(!1);return XZ(()=>{a.current=!0}),S.useCallback(function(u,f){if(f===void 0&&(f={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let l=gN(u,JSON.parse(o),i,f.relative==="path");t==null&&e!=="/"&&(l.pathname=l.pathname==="/"?e:ou([e,l.pathname])),(f.replace?r.replace:r.push)(l,f.state,f)},[e,r,o,i,t])}const tMe=S.createContext(null);function nMe(t){let e=S.useContext(nc).outlet;return e&&S.createElement(tMe.Provider,{value:t},e)}function rMe(){let{matches:t}=S.useContext(nc),e=t[t.length-1];return e?e.params:{}}function QZ(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=S.useContext(xf),{matches:s}=S.useContext(nc),{pathname:i}=wf(),o=JSON.stringify(mN(s,r.v7_relativeSplatPath));return S.useMemo(()=>gN(t,JSON.parse(o),i,n==="path"),[t,o,i,n])}function sMe(t,e,n,r){jy()||Ot(!1);let{navigator:s}=S.useContext(xf),{matches:i}=S.useContext(nc),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=wf(),f;f=u;let l=f.pathname||"/",d=l;if(c!=="/"){let m=c.replace(/^\//,"").split("/");d="/"+l.replace(/^\//,"").split("/").slice(m.length).join("/")}let p=Kf(t,{pathname:d});return cMe(p&&p.map(m=>Object.assign({},m,{params:Object.assign({},a,m.params),pathname:ou([c,s.encodeLocation?s.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?c:ou([c,s.encodeLocation?s.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),i,n,r)}function iMe(){let t=dMe(),e=vN(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},e),n?S.createElement("pre",{style:s},n):null,null)}const oMe=S.createElement(iMe,null);class aMe extends S.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?S.createElement(nc.Provider,{value:this.props.routeContext},S.createElement(YZ.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function lMe(t){let{routeContext:e,match:n,children:r}=t,s=S.useContext(yN);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),S.createElement(nc.Provider,{value:e},r)}function cMe(t,e,n,r){var s;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var i;if(!n)return null;if(n.errors)t=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let o=t,a=(s=n)==null?void 0:s.errors;if(a!=null){let f=o.findIndex(l=>l.route.id&&(a==null?void 0:a[l.route.id])!==void 0);f>=0||Ot(!1),o=o.slice(0,Math.min(o.length,f+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let f=0;f<o.length;f++){let l=o[f];if((l.route.HydrateFallback||l.route.hydrateFallbackElement)&&(u=f),l.route.id){let{loaderData:d,errors:p}=n,h=l.route.loader&&d[l.route.id]===void 0&&(!p||p[l.route.id]===void 0);if(l.route.lazy||h){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((f,l,d)=>{let p,h=!1,m=null,y=null;n&&(p=a&&l.route.id?a[l.route.id]:void 0,m=l.route.errorElement||oMe,c&&(u<0&&d===0?(mMe("route-fallback"),h=!0,y=null):u===d&&(h=!0,y=l.route.hydrateFallbackElement||null)));let g=e.concat(o.slice(0,d+1)),v=()=>{let x;return p?x=m:h?x=y:l.route.Component?x=S.createElement(l.route.Component,null):l.route.element?x=l.route.element:x=f,S.createElement(lMe,{match:l,routeContext:{outlet:f,matches:g,isDataRoute:n!=null},children:x})};return n&&(l.route.ErrorBoundary||l.route.errorElement||d===0)?S.createElement(aMe,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:v(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):v()},null)}var R$=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(R$||{}),gx=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}(gx||{});function ZZ(t){let e=S.useContext(yN);return e||Ot(!1),e}function JZ(t){let e=S.useContext(KZ);return e||Ot(!1),e}function uMe(t){let e=S.useContext(nc);return e||Ot(!1),e}function eJ(t){let e=uMe(),n=e.matches[e.matches.length-1];return n.route.id||Ot(!1),n.route.id}function dMe(){var t;let e=S.useContext(YZ),n=JZ(gx.UseRouteError),r=eJ(gx.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}let fMe=0;function hMe(t){let{router:e,basename:n}=ZZ(R$.UseBlocker),r=JZ(gx.UseBlocker),[s,i]=S.useState(""),o=S.useCallback(a=>{if(typeof t!="function")return!!t;if(n==="/")return t(a);let{currentLocation:c,nextLocation:u,historyAction:f}=a;return t({currentLocation:ty({},c,{pathname:rf(c.pathname,n)||c.pathname}),nextLocation:ty({},u,{pathname:rf(u.pathname,n)||u.pathname}),historyAction:f})},[n,t]);return S.useEffect(()=>{let a=String(++fMe);return i(a),()=>e.deleteBlocker(a)},[e]),S.useEffect(()=>{s!==""&&e.getBlocker(s,o)},[e,s,o]),s&&r.blockers.has(s)?r.blockers.get(s):Om}function pMe(){let{router:t}=ZZ(R$.UseNavigateStable),e=eJ(gx.UseNavigateStable),n=S.useRef(!1);return XZ(()=>{n.current=!0}),S.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?t.navigate(s):t.navigate(s,ty({fromRouteId:e},i)))},[t,e])}const cU={};function mMe(t,e,n){cU[t]||(cU[t]=!0)}function tJ(t){let{to:e,replace:n,state:r,relative:s}=t;jy()||Ot(!1);let{future:i,static:o}=S.useContext(xf),{matches:a}=S.useContext(nc),{pathname:c}=wf(),u=Us(),f=gN(e,mN(a,i.v7_relativeSplatPath),c,s==="path"),l=JSON.stringify(f);return S.useEffect(()=>u(JSON.parse(l),{replace:n,state:r,relative:s}),[u,l,s,n,r]),null}function R1(t){return nMe(t.context)}function gMe(t){let{basename:e="/",children:n=null,location:r,navigationType:s=Nr.Pop,navigator:i,static:o=!1,future:a}=t;jy()&&Ot(!1);let c=e.replace(/^\/*/,"/"),u=S.useMemo(()=>({basename:c,navigator:i,static:o,future:ty({v7_relativeSplatPath:!1},a)}),[c,a,i,o]);typeof r=="string"&&(r=bf(r));let{pathname:f="/",search:l="",hash:d="",state:p=null,key:h="default"}=r,m=S.useMemo(()=>{let y=rf(f,c);return y==null?null:{location:{pathname:y,search:l,hash:d,state:p,key:h},navigationType:s}},[c,f,l,d,p,h,s]);return m==null?null:S.createElement(xf.Provider,{value:u},S.createElement(A$.Provider,{children:n,value:m}))}new Promise(()=>{});function vMe(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:S.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(e,{hydrateFallbackElement:S.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:S.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}/**
|
||
* React Router DOM v6.26.0
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function vx(){return vx=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},vx.apply(this,arguments)}function yMe(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 bMe(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function xMe(t,e){return t.button===0&&(!e||e==="_self")&&!bMe(t)}function xO(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 wMe(t,e){let n=xO(t);return e&&e.forEach((r,s)=>{n.has(s)||e.getAll(s).forEach(i=>{n.append(s,i)})}),n}const _Me=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],SMe="6";try{window.__reactRouterVersion=SMe}catch{}function CMe(t,e){return MDe({basename:e==null?void 0:e.basename,future:vx({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:rDe({window:e==null?void 0:e.window}),hydrationData:(e==null?void 0:e.hydrationData)||EMe(),routes:t,mapRouteProperties:vMe,unstable_dataStrategy:e==null?void 0:e.unstable_dataStrategy,unstable_patchRoutesOnMiss:e==null?void 0:e.unstable_patchRoutesOnMiss,window:e==null?void 0:e.window}).initialize()}function EMe(){var t;let e=(t=window)==null?void 0:t.__staticRouterHydrationData;return e&&e.errors&&(e=vx({},e,{errors:AMe(e.errors)})),e}function AMe(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 UE(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let i=window[s.__subType];if(typeof i=="function")try{let o=new i(s.message);o.stack="",n[r]=o}catch{}}if(n[r]==null){let i=new Error(s.message);i.stack="",n[r]=i}}else n[r]=s;return n}const RMe=S.createContext({isTransitioning:!1}),NMe=S.createContext(new Map),PMe="startTransition",uU=o_[PMe],TMe="flushSync",dU=the[TMe];function kMe(t){uU?uU(t):t()}function Ab(t){dU?dU(t):t()}class DMe{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 MMe(t){let{fallbackElement:e,router:n,future:r}=t,[s,i]=S.useState(n.state),[o,a]=S.useState(),[c,u]=S.useState({isTransitioning:!1}),[f,l]=S.useState(),[d,p]=S.useState(),[h,m]=S.useState(),y=S.useRef(new Map),{v7_startTransition:g}=r||{},v=S.useCallback(E=>{g?kMe(E):E()},[g]),x=S.useCallback((E,P)=>{let{deletedFetchers:k,unstable_flushSync:M,unstable_viewTransitionOpts:I}=P;k.forEach(L=>y.current.delete(L)),E.fetchers.forEach((L,H)=>{L.data!==void 0&&y.current.set(H,L.data)});let j=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!I||j){M?Ab(()=>i(E)):v(()=>i(E));return}if(M){Ab(()=>{d&&(f&&f.resolve(),d.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:I.currentLocation,nextLocation:I.nextLocation})});let L=n.window.document.startViewTransition(()=>{Ab(()=>i(E))});L.finished.finally(()=>{Ab(()=>{l(void 0),p(void 0),a(void 0),u({isTransitioning:!1})})}),Ab(()=>p(L));return}d?(f&&f.resolve(),d.skipTransition(),m({state:E,currentLocation:I.currentLocation,nextLocation:I.nextLocation})):(a(E),u({isTransitioning:!0,flushSync:!1,currentLocation:I.currentLocation,nextLocation:I.nextLocation}))},[n.window,d,f,y,v]);S.useLayoutEffect(()=>n.subscribe(x),[n,x]),S.useEffect(()=>{c.isTransitioning&&!c.flushSync&&l(new DMe)},[c]),S.useEffect(()=>{if(f&&o&&n.window){let E=o,P=f.promise,k=n.window.document.startViewTransition(async()=>{v(()=>i(E)),await P});k.finished.finally(()=>{l(void 0),p(void 0),a(void 0),u({isTransitioning:!1})}),p(k)}},[v,o,f,n.window]),S.useEffect(()=>{f&&o&&s.location.key===o.location.key&&f.resolve()},[f,d,s.location,o]),S.useEffect(()=>{!c.isTransitioning&&h&&(a(h.state),u({isTransitioning:!0,flushSync:!1,currentLocation:h.currentLocation,nextLocation:h.nextLocation}),m(void 0))},[c.isTransitioning,h]),S.useEffect(()=>{},[]);let _=S.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:E=>n.navigate(E),push:(E,P,k)=>n.navigate(E,{state:P,preventScrollReset:k==null?void 0:k.preventScrollReset}),replace:(E,P,k)=>n.navigate(E,{replace:!0,state:P,preventScrollReset:k==null?void 0:k.preventScrollReset})}),[n]),A=n.basename||"/",N=S.useMemo(()=>({router:n,navigator:_,static:!1,basename:A}),[n,_,A]),T=S.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return S.createElement(S.Fragment,null,S.createElement(yN.Provider,{value:N},S.createElement(KZ.Provider,{value:s},S.createElement(NMe.Provider,{value:y.current},S.createElement(RMe.Provider,{value:c},S.createElement(gMe,{basename:A,location:s.location,navigationType:s.historyAction,navigator:_,future:T},s.initialized||n.future.v7_partialHydration?S.createElement(OMe,{routes:n.routes,future:n.future,state:s}):e))))),null)}const OMe=S.memo(IMe);function IMe(t){let{routes:e,future:n,state:r}=t;return sMe(e,void 0,r,n)}const jMe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",LMe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,eu=S.forwardRef(function(e,n){let{onClick:r,relative:s,reloadDocument:i,replace:o,state:a,target:c,to:u,preventScrollReset:f,unstable_viewTransition:l}=e,d=yMe(e,_Me),{basename:p}=S.useContext(xf),h,m=!1;if(typeof u=="string"&&LMe.test(u)&&(h=u,jMe))try{let x=new URL(window.location.href),_=u.startsWith("//")?new URL(x.protocol+u):new URL(u),A=rf(_.pathname,p);_.origin===x.origin&&A!=null?u=A+_.search+_.hash:m=!0}catch{}let y=JDe(u,{relative:s}),g=$Me(u,{replace:o,state:a,target:c,preventScrollReset:f,relative:s,unstable_viewTransition:l});function v(x){r&&r(x),x.defaultPrevented||g(x)}return S.createElement("a",vx({},d,{href:h||y,onClick:m||i?r:v,ref:n,target:c}))});var fU;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(fU||(fU={}));var hU;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(hU||(hU={}));function $Me(t,e){let{target:n,replace:r,state:s,preventScrollReset:i,relative:o,unstable_viewTransition:a}=e===void 0?{}:e,c=Us(),u=wf(),f=QZ(t,{relative:o});return S.useCallback(l=>{if(xMe(l,n)){l.preventDefault();let d=r!==void 0?r:Np(u)===Np(f);c(t,{replace:d,state:s,preventScrollReset:i,relative:o,unstable_viewTransition:a})}},[u,c,f,r,s,n,t,i,o,a])}function FMe(t){let e=S.useRef(xO(t)),n=S.useRef(!1),r=wf(),s=S.useMemo(()=>wMe(r.search,n.current?null:e.current),[r.search]),i=Us(),o=S.useCallback((a,c)=>{const u=xO(typeof a=="function"?a(s):a);n.current=!0,i("?"+u,c)},[i,s]);return[s,o]}const nJ=({isOpen:t,onCancel:e,onConfirm:n,title:r,description:s,cancelLabel:i,confirmLabel:o})=>b.jsx(PL,{open:t,children:b.jsxs(cR,{children:[b.jsxs(uR,{children:[b.jsx(fR,{children:r}),b.jsx(hR,{children:s})]}),b.jsxs(dR,{children:[b.jsx(mR,{children:b.jsx(eu,{to:"#",onClick:e,children:i})}),b.jsx(pR,{children:b.jsx(eu,{to:"#",onClick:n,children:o})})]})]})}),zMe={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console&&console[t]&&console[t].apply(console,e)}};class HE{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=e||zMe,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:(typeof e[0]=="string"&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new HE(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new HE(this.logger,e)}}var $l=new HE;class bN{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(o=>{let[a,c]=o;for(let u=0;u<c;u++)a(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(o=>{let[a,c]=o;for(let u=0;u<c;u++)a.apply(a,[e,...r])})}}function Rb(){let t,e;const n=new Promise((r,s)=>{t=r,e=s});return n.resolve=t,n.reject=e,n}function pU(t){return t==null?"":""+t}function BMe(t,e,n){t.forEach(r=>{e[r]&&(n[r]=e[r])})}const UMe=/###/g;function C0(t,e,n){function r(a){return a&&a.indexOf("###")>-1?a.replace(UMe,"."):a}function s(){return!t||typeof t=="string"}const i=typeof e!="string"?e:e.split(".");let o=0;for(;o<i.length-1;){if(s())return{};const a=r(i[o]);!t[a]&&n&&(t[a]=new n),Object.prototype.hasOwnProperty.call(t,a)?t=t[a]:t={},++o}return s()?{}:{obj:t,k:r(i[o])}}function mU(t,e,n){const{obj:r,k:s}=C0(t,e,Object);if(r!==void 0||e.length===1){r[s]=n;return}let i=e[e.length-1],o=e.slice(0,e.length-1),a=C0(t,o,Object);for(;a.obj===void 0&&o.length;)i=`${o[o.length-1]}.${i}`,o=o.slice(0,o.length-1),a=C0(t,o,Object),a&&a.obj&&typeof a.obj[`${a.k}.${i}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n}function HMe(t,e,n,r){const{obj:s,k:i}=C0(t,e,Object);s[i]=s[i]||[],s[i].push(n)}function VE(t,e){const{obj:n,k:r}=C0(t,e);if(n)return n[r]}function VMe(t,e,n){const r=VE(t,n);return r!==void 0?r:VE(e,n)}function rJ(t,e,n){for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?typeof t[r]=="string"||t[r]instanceof String||typeof e[r]=="string"||e[r]instanceof String?n&&(t[r]=e[r]):rJ(t[r],e[r],n):t[r]=e[r]);return t}function Nm(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var qMe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function WMe(t){return typeof t=="string"?t.replace(/[&<>"'\/]/g,e=>qMe[e]):t}class GMe{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 KMe=[" ",",","?","!",";"],YMe=new GMe(20);function XMe(t,e,n){e=e||"",n=n||"";const r=KMe.filter(o=>e.indexOf(o)<0&&n.indexOf(o)<0);if(r.length===0)return!0;const s=YMe.getRegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let i=!s.test(t);if(!i){const o=t.indexOf(n);o>0&&!s.test(t.substring(0,o))&&(i=!0)}return i}function wO(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 o,a="";for(let c=i;c<r.length;++c)if(c!==i&&(a+=n),a+=r[c],o=s[a],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&c<r.length-1)continue;i+=c-i+1;break}s=o}return s}function qE(t){return t&&t.indexOf("_")>0?t.replace("_","-"):t}class gU extends bN{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,o=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,n],r&&(Array.isArray(r)?a.push(...r):typeof r=="string"&&i?a.push(...r.split(i)):a.push(r)));const c=VE(this.data,a);return!c&&!n&&!r&&e.indexOf(".")>-1&&(e=a[0],n=a[1],r=a.slice(2).join(".")),c||!o||typeof r!="string"?c:wO(this.data&&this.data[e]&&this.data[e][n],r,i)}addResource(e,n,r,s){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let a=[e,n];r&&(a=a.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(a=e.split("."),s=n,n=a[1]),this.addNamespaces(n),mU(this.data,a,s),i.silent||this.emit("added",e,n,r,s)}addResources(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const i in r)(typeof r[i]=="string"||Array.isArray(r[i]))&&this.addResource(e,n,i,r[i],{silent:!0});s.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,s,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},a=[e,n];e.indexOf(".")>-1&&(a=e.split("."),s=r,r=n,n=a[1]),this.addNamespaces(n);let c=VE(this.data,a)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?rJ(c,r,i):c={...c,...r},mU(this.data,a,c),o.silent||this.emit("added",e,n,r)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,n)}:this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var sJ={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 vU={};class WE extends bN{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),BMe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=$l.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const r=this.resolve(e,n);return r&&r.res!==void 0}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const o=r&&e.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!XMe(e,r,s);if(o&&!a){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces: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 typeof i=="string"&&(i=[i]),{key:e,namespaces:i}}translate(e,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const s=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:o,namespaces:a}=this.extractFromKey(e[e.length-1],n),c=a[a.length-1],u=n.lng||this.language,f=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(f){const _=n.nsSeparator||this.options.nsSeparator;return s?{res:`${c}${_}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${_}${o}`}return s?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:o}const l=this.resolve(e,n);let d=l&&l.res;const p=l&&l.usedKey||o,h=l&&l.exactUsedKey||o,m=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;if(v&&d&&(typeof d!="string"&&typeof d!="boolean"&&typeof d!="number")&&y.indexOf(m)<0&&!(typeof g=="string"&&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 _=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,d,{...n,ns:a}):`key '${o} (${this.language})' returned an object instead of string.`;return s?(l.res=_,l.usedParams=this.getUsedParamsDetails(n),l):_}if(i){const _=Array.isArray(d),A=_?[]:{},N=_?h:p;for(const T in d)if(Object.prototype.hasOwnProperty.call(d,T)){const E=`${N}${i}${T}`;A[T]=this.translate(E,{...n,joinArrays:!1,ns:a}),A[T]===E&&(A[T]=d[T])}d=A}}else if(v&&typeof g=="string"&&Array.isArray(d))d=d.join(g),d&&(d=this.extendTranslation(d,e,n,r));else{let _=!1,A=!1;const N=n.count!==void 0&&typeof n.count!="string",T=WE.hasDefaultValue(n),E=N?this.pluralResolver.getSuffix(u,n.count,n):"",P=n.ordinal&&N?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",k=N&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),M=k&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${E}`]||n[`defaultValue${P}`]||n.defaultValue;!this.isValidLookup(d)&&T&&(_=!0,d=M),this.isValidLookup(d)||(A=!0,d=o);const j=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&A?void 0:d,L=T&&M!==d&&this.options.updateMissing;if(A||_||L){if(this.logger.log(L?"updateKey":"missingKey",u,c,o,L?M:d),i){const U=this.resolve(o,{...n,keySeparator:!1});U&&U.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let H=[];const K=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&K&&K[0])for(let U=0;U<K.length;U++)H.push(K[U]);else this.options.saveMissingTo==="all"?H=this.languageUtils.toResolveHierarchy(n.lng||this.language):H.push(n.lng||this.language);const V=(U,Q,ne)=>{const X=T&&ne!==d?ne:j;this.options.missingKeyHandler?this.options.missingKeyHandler(U,c,Q,X,L,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(U,c,Q,X,L,n),this.emit("missingKey",U,c,Q,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&N?H.forEach(U=>{const Q=this.pluralResolver.getSuffixes(U,n);k&&n[`defaultValue${this.options.pluralSeparator}zero`]&&Q.indexOf(`${this.options.pluralSeparator}zero`)<0&&Q.push(`${this.options.pluralSeparator}zero`),Q.forEach(ne=>{V([U],o+ne,n[`defaultValue${ne}`]||M)})}):V(H,o,M))}d=this.extendTranslation(d,e,n,l,r),A&&d===o&&this.options.appendNamespaceToMissingKey&&(d=`${c}:${o}`),(A||_)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${o}`:o,_?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 o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=typeof e=="string"&&(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&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),e=this.interpolator.interpolate(e,l,r.lng||this.language||s.usedLng,r),u){const d=e.match(this.interpolator.nestingRegexp),p=d&&d.length;f<p&&(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,p=new Array(d),h=0;h<d;h++)p[h]=arguments[h];return i&&i[0]===p[0]&&!r.context?(o.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${n[0]}`),null):o.translate(...p,n)},r)),r.interpolation&&this.interpolator.reset()}const a=r.postProcess||this.options.postProcess,c=typeof a=="string"?[a]:a;return e!=null&&c&&c.length&&r.applyPostProcessor!==!1&&(e=sJ.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,o,a;return typeof e=="string"&&(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&&typeof n.count!="string",p=d&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),h=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",m=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);l.forEach(y=>{this.isValidLookup(r)||(a=y,!vU[`${m[0]}-${y}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(vU[`${m[0]}-${y}`]=!0,this.logger.warn(`key "${s}" for languages "${m.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),m.forEach(g=>{if(this.isValidLookup(r))return;o=g;const v=[f];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(v,f,g,y,n);else{let _;d&&(_=this.pluralResolver.getSuffix(g,n.count,n));const A=`${this.options.pluralSeparator}zero`,N=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(v.push(f+_),n.ordinal&&_.indexOf(N)===0&&v.push(f+_.replace(N,this.options.pluralSeparator)),p&&v.push(f+A)),h){const T=`${f}${this.options.contextSeparator}${n.context}`;v.push(T),d&&(v.push(T+_),n.ordinal&&_.indexOf(N)===0&&v.push(T+_.replace(N,this.options.pluralSeparator)),p&&v.push(T+A))}}let x;for(;x=v.pop();)this.isValidLookup(r)||(i=x,r=this.getResource(g,y,x,n))}))})}),{res:r,usedKey:s,exactUsedKey:i,usedLng:o,usedNS:a}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,n,r,s):this.resourceStore.getResource(e,n,r,s)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&typeof e.replace!="string";let s=r?e.replace:e;if(r&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const i of n)delete s[i]}return s}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n===r.substring(0,n.length)&&e[r]!==void 0)return!0;return!1}}function Ik(t){return t.charAt(0).toUpperCase()+t.slice(1)}class yU{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=$l.create("languageUtils")}getScriptPartFromCode(e){if(e=qE(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=qE(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(typeof e=="string"&&e.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=e.split("-");return this.options.lowerCaseLng?r=r.map(s=>s.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Ik(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]=Ik(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=Ik(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(i=>{if(i===s)return i;if(!(i.indexOf("-")<0&&s.indexOf("-")<0)&&(i.indexOf("-")>0&&s.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===s||i.indexOf(s)===0&&s.length>1))return i})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),typeof e=="string"&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],e),s=[],i=o=>{o&&(this.isSupportedCode(o)?s.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return typeof e=="string"&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(e))):typeof e=="string"&&i(this.formatLanguageCode(e)),r.forEach(o=>{s.indexOf(o)<0&&i(this.formatLanguageCode(o))}),s}}let QMe=[{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}],ZMe={1:function(t){return+(t>1)},2:function(t){return+(t!=1)},3:function(t){return 0},4:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},5:function(t){return t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5},6:function(t){return t==1?0:t>=2&&t<=4?1:2},7:function(t){return t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},8:function(t){return t==1?0:t==2?1:t!=8&&t!=11?2:3},9:function(t){return+(t>=2)},10:function(t){return t==1?0:t==2?1:t<7?2:t<11?3:4},11:function(t){return t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3},12:function(t){return+(t%10!=1||t%100==11)},13:function(t){return+(t!==0)},14:function(t){return t==1?0:t==2?1:t==3?2:3},15:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2},16:function(t){return t%10==1&&t%100!=11?0:t!==0?1:2},17:function(t){return t==1||t%10==1&&t%100!=11?0:1},18:function(t){return t==0?0:t==1?1:2},19:function(t){return t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3},20:function(t){return t==1?0:t==0||t%100>0&&t%100<20?1:2},21:function(t){return t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0},22:function(t){return t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3}};const JMe=["v1","v2","v3"],eOe=["v4"],bU={zero:0,one:1,two:2,few:3,many:4,other:5};function tOe(){const t={};return QMe.forEach(e=>{e.lngs.forEach(n=>{t[n]={numbers:e.nr,plurals:ZMe[e.fc]}})}),t}class nOe{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=$l.create("pluralResolver"),(!this.options.compatibilityJSON||eOe.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=tOe()}addRule(e,n){this.rules[e]=n}getRule(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(qE(e==="dev"?"en":e),{type:n.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(e,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,r).map(s=>`${n}${s}`)}getSuffixes(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((s,i)=>bU[s]-bU[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!JMe.includes(this.options.compatibilityJSON)}}function xU(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=VMe(t,e,n);return!i&&s&&typeof n=="string"&&(i=wO(t,n,r),i===void 0&&(i=wO(e,n,r))),i}class rOe{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=$l.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(n=>n),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:c,formatSeparator:u,unescapeSuffix:f,unescapePrefix:l,nestingPrefix:d,nestingPrefixEscaped:p,nestingSuffix:h,nestingSuffixEscaped:m,nestingOptionsSeparator:y,maxReplaces:g,alwaysFormat:v}=e.interpolation;this.escape=n!==void 0?n:WMe,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=i?Nm(i):o||"{{",this.suffix=a?Nm(a):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=f?"":l||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=d?Nm(d):p||Nm("$t("),this.nestingSuffix=h?Nm(h):m||Nm(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=g||1e3,this.alwaysFormat=v!==void 0?v:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,n,r,s){let i,o,a;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(h){return h.replace(/\$/g,"$$$$")}const f=h=>{if(h.indexOf(this.formatSeparator)<0){const v=xU(n,c,h,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(v,void 0,r,{...s,...n,interpolationkey:h}):v}const m=h.split(this.formatSeparator),y=m.shift().trim(),g=m.join(this.formatSeparator).trim();return this.format(xU(n,c,y,this.options.keySeparator,this.options.ignoreJSONStructure),g,r,{...s,...n,interpolationkey:y})};this.resetRegExp();const l=s&&s.missingInterpolationHandler||this.options.missingInterpolationHandler,d=s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:h=>u(h)},{regex:this.regexp,safeValue:h=>this.escapeValue?u(this.escape(h)):u(h)}].forEach(h=>{for(a=0;i=h.regex.exec(e);){const m=i[1].trim();if(o=f(m),o===void 0)if(typeof l=="function"){const g=l(e,i,s);o=typeof g=="string"?g:""}else if(s&&Object.prototype.hasOwnProperty.call(s,m))o="";else if(d){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${e}`),o="";else typeof o!="string"&&!this.useRawValueToEscape&&(o=pU(o));const y=h.safeValue(o);if(e=e.replace(i[0],y),d?(h.regex.lastIndex+=o.length,h.regex.lastIndex-=i[0].length):h.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,i,o;function a(c,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,o);const p=d.match(/'/g),h=d.match(/"/g);(p&&p.length%2===0&&!h||h.length%2!==0)&&(d=d.replace(/'/g,'"'));try{o=JSON.parse(d),u&&(o={...u,...o})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,m),`${c}${f}${d}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,c}for(;s=this.nestingRegexp.exec(e);){let c=[];o={...r},o=o.replace&&typeof o.replace!="string"?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let 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(a.call(this,s[1].trim(),o),o),i&&s[0]===e&&typeof i!="string")return i;typeof i!="string"&&(i=pU(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}}function sOe(t){let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);e==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(o=>{if(o){const[a,...c]=o.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),f=a.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}}function Pm(t){const e={};return function(r,s,i){const o=s+JSON.stringify(i);let a=e[o];return a||(a=t(qE(s),i),e[o]=a),a(r)}}class iOe{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=$l.create("formatter"),this.options=e,this.formats={number:Pm((n,r)=>{const s=new Intl.NumberFormat(n,{...r});return i=>s.format(i)}),currency:Pm((n,r)=>{const s=new Intl.NumberFormat(n,{...r,style:"currency"});return i=>s.format(i)}),datetime:Pm((n,r)=>{const s=new Intl.DateTimeFormat(n,{...r});return i=>s.format(i)}),relativetime:Pm((n,r)=>{const s=new Intl.RelativeTimeFormat(n,{...r});return i=>s.format(i,r.range||"day")}),list:Pm((n,r)=>{const s=new Intl.ListFormat(n,{...r});return i=>s.format(i)})},this.init(e)}init(e){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=Pm(n)}format(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return n.split(this.formatSeparator).reduce((a,c)=>{const{formatName:u,formatOptions:f}=sOe(c);if(this.formats[u]){let l=a;try{const d=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},p=d.locale||d.lng||s.locale||s.lng||r;l=this.formats[u](a,p,{...f,...s,...d})}catch(d){this.logger.warn(d)}return l}else this.logger.warn(`there was no format function for ${u}`);return a},e)}}function oOe(t,e){t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)}class aOe extends bN{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=$l.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,s.backend,s)}queueLoad(e,n,r,s){const i={},o={},a={},c={};return e.forEach(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?o[d]===void 0&&(o[d]=!0):(this.state[d]=1,f=!1,o[d]===void 0&&(o[d]=!0),i[d]===void 0&&(i[d]=!0),c[l]===void 0&&(c[l]=!0)))}),f||(a[u]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(c)}}loaded(e,n,r){const s=e.split("|"),i=s[0],o=s[1];n&&this.emit("failedLoading",i,o,n),r&&this.store.addResourceBundle(i,o,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2;const a={};this.queue.forEach(c=>{HMe(c.loaded,[i],o),oOe(c,e),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{a[u]||(a[u]={});const f=c.loaded[u];f.length&&f.forEach(l=>{a[u][l]===void 0&&(a[u][l]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(c=>!c.done)}read(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:s,wait:i,callback:o});return}this.readingCalls++;const a=(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,o)},i);return}o(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=>a(null,f)).catch(a):a(null,u)}catch(u){a(u)}return}return c(e,n,a)}prepareLoading(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();typeof e=="string"&&(e=this.languageUtils.toResolveHierarchy(e)),typeof n=="string"&&(n=[n]);const i=this.queueLoad(e,n,r,s);if(!i.toLoad.length)return i.pending.length||s(),null;i.toLoad.forEach(o=>{this.loadOne(o)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=e.split("|"),s=r[0],i=r[1];this.read(s,i,"read",void 0,void 0,(o,a)=>{o&&this.logger.warn(`${n}loading namespace ${i} for language ${s} failed`,o),!o&&a&&this.logger.log(`${n}loaded namespace ${i} for language ${s}`,a),this.loaded(e,o,a)})}saveMissing(e,n,r,s,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const c={...o,isUpdate:i},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=>a(null,l)).catch(a):a(null,f)}catch(f){a(f)}else u(e,n,r,s,a,c)}!e||!e[0]||this.store.addResource(e[0],n,r,s)}}}function wU(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){let n={};if(typeof e[1]=="object"&&(n=e[1]),typeof e[1]=="string"&&(n.defaultValue=e[1]),typeof e[2]=="string"&&(n.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const r=e[3]||e[2];Object.keys(r).forEach(s=>{n[s]=r[s]})}return n},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function _U(t){return typeof t.ns=="string"&&(t.ns=[t.ns]),typeof t.fallbackLng=="string"&&(t.fallbackLng=[t.fallbackLng]),typeof t.fallbackNS=="string"&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function N1(){}function lOe(t){Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})}class yx extends bN{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=_U(e),this.services={},this.logger=$l,this.modules={external:[]},lOe(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const s=wU();this.options={...s,...this.options,..._U(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...s.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);function i(f){return f?typeof f=="function"?new f:f:null}if(!this.options.isClone){this.modules.logger?$l.init(i(this.modules.logger),this.options):$l.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:typeof Intl<"u"&&(f=iOe);const l=new yU(this.options);this.store=new gU(this.options.resources,this.options);const d=this.services;d.logger=$l,d.resourceStore=this.store,d.languageUtils=l,d.pluralResolver=new nOe(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 rOe(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new aOe(i(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",function(p){for(var h=arguments.length,m=new Array(h>1?h-1:0),y=1;y<h;y++)m[y-1]=arguments[y];e.emit(p,...m)}),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 WE(this.services,this.options),this.translator.on("*",function(p){for(var h=arguments.length,m=new Array(h>1?h-1:0),y=1;y<h;y++)m[y-1]=arguments[y];e.emit(p,...m)}),this.modules.external.forEach(p=>{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,r||(r=N1),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=Rb(),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]:N1;const s=typeof e=="string"?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(s&&s.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const i=[],o=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(u=>{u!=="cimode"&&i.indexOf(u)<0&&i.push(u)})};s?o(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>o(c)),this.options.preload&&this.options.preload.forEach(a=>o(a)),this.services.backendConnector.load(i,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(a)})}else r(null)}reloadResources(e,n,r){const s=Rb();return e||(e=this.languages),n||(n=this.options.ns),r||(r=N1),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"&&sJ.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=Rb();this.emit("languageChanging",e);const i=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},o=(c,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)})},a=c=>{!e&&!c&&this.services.languageDetector&&(c=[]);const u=typeof c=="string"?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=>{o(f,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),s}getFixedT(e,n,r){var s=this;const i=function(o,a){let c;if(typeof a!="object"){for(var 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([o,a].concat(f))}else c={...a};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 p;return c.keyPrefix&&Array.isArray(o)?p=o.map(h=>`${c.keyPrefix}${d}${h}`):p=c.keyPrefix?`${c.keyPrefix}${d}${o}`:o,s.t(p,c)};return typeof e=="string"?i.lng=e:i.lngs=e,i.ns=n,i.keyPrefix=r,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(a,c)=>{const u=this.services.backendConnector.state[`${a}|${c}`];return u===-1||u===2};if(n.precheck){const a=n.precheck(this,o);if(a!==void 0)return a}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,e)&&(!s||o(i,e)))}loadNamespaces(e,n){const r=Rb();return this.options.ns?(typeof e=="string"&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}loadLanguages(e,n){const r=Rb();typeof e=="string"&&(e=[e]);const s=this.options.preload||[],i=e.filter(o=>s.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return i.length?(this.options.preload=s.concat(i),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new yU(wU());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 yx(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:N1;const r=e.forkResourceStore;r&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},i=new yx(s);return(e.debug!==void 0||e.prefix!==void 0)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(a=>{i[a]=this[a]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r&&(i.store=new gU(this.store.data,s),i.services.resourceStore=i.store),i.translator=new WE(i.services,s),i.translator.on("*",function(a){for(var c=arguments.length,u=new Array(c>1?c-1:0),f=1;f<c;f++)u[f-1]=arguments[f];i.emit(a,...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 Cs=yx.createInstance();Cs.createInstance=yx.createInstance;Cs.createInstance;Cs.dir;Cs.init;Cs.loadResources;Cs.reloadResources;Cs.use;Cs.changeLanguage;Cs.getFixedT;const te=Cs.t;Cs.exists;Cs.setDefaultNamespace;Cs.hasLoadedNamespace;Cs.loadNamespaces;Cs.loadLanguages;const cOe=t=>{const[e,n]=S.useState(!1),[r,s]=S.useState({title:"Título",description:"Descripción",cancelLabel:te("common.no"),confirmLabel:te("common.yes"),onCancel:()=>{},onConfirm:()=>{},...t}),i=(u,f)=>{u==null||u.preventDefault(),f&&s(f),n(!0)},o=u=>{u==null||u.preventDefault(),n(!1),r==null||r.onCancel(u)},a=u=>{u==null||u.preventDefault(),n(!1),r==null||r.onConfirm(u)},c=r?b.jsx(nJ,{isOpen:e,onCancel:o,onConfirm:a,title:r.title,description:r.description,cancelLabel:r.cancelLabel,confirmLabel:r.confirmLabel}):b.jsx(b.Fragment,{});return{openDialog:i,cancelDialog:o,confirmDialog:a,DialogComponent:c}};var iJ={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(self,()=>{return n={7629:(s,i,o)=>{const a=o(375),c=o(8571),u=o(9474),f=o(1687),l=o(8652),d=o(8160),p=o(3292),h=o(6354),m=o(8901),y=o(9708),g=o(6914),v=o(2294),x=o(6133),_=o(1152),A=o(8863),N=o(2036),T={Base:class{constructor(E){this.type=E,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new v.Ids,this._preferences=null,this._refs=new x.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return a(typeof y.describe=="function","Manifest functionality disabled"),y.describe(this)}allow(...E){return d.verifyFlat(E,"allow"),this._values(E,"_valids")}alter(E){a(E&&typeof E=="object"&&!Array.isArray(E),"Invalid targets argument"),a(!this._inRuleset(),"Cannot set alterations inside a ruleset");const P=this.clone();P.$_terms.alterations=P.$_terms.alterations||[];for(const k in E){const M=E[k];a(typeof M=="function","Alteration adjuster for",k,"must be a function"),P.$_terms.alterations.push({target:k,adjuster:M})}return P.$_temp.ruleset=!1,P}artifact(E){return a(E!==void 0,"Artifact cannot be undefined"),a(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",E)}cast(E){return a(E===!1||typeof E=="string","Invalid to value"),a(E===!1||this._definition.cast[E],"Type",this.type,"does not support casting to",E),this.$_setFlag("cast",E===!1?void 0:E)}default(E,P){return this._default("default",E,P)}description(E){return a(E&&typeof E=="string","Description must be a non-empty string"),this.$_setFlag("description",E)}empty(E){const P=this.clone();return E!==void 0&&(E=P.$_compile(E,{override:!1})),P.$_setFlag("empty",E,{clone:!1})}error(E){return a(E,"Missing error"),a(E instanceof Error||typeof E=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",E)}example(E,P={}){return a(E!==void 0,"Missing example"),d.assertOptions(P,["override"]),this._inner("examples",E,{single:!0,override:P.override})}external(E,P){return typeof E=="object"&&(a(!P,"Cannot combine options with description"),P=E.description,E=E.method),a(typeof E=="function","Method must be a function"),a(P===void 0||P&&typeof P=="string","Description must be a non-empty string"),this._inner("externals",{method:E,description:P},{single:!0})}failover(E,P){return this._default("failover",E,P)}forbidden(){return this.presence("forbidden")}id(E){return E?(a(typeof E=="string","id must be a non-empty string"),a(/^[^\.]+$/.test(E),"id cannot contain period character"),this.$_setFlag("id",E)):this.$_setFlag("id",void 0)}invalid(...E){return this._values(E,"_invalids")}label(E){return a(E&&typeof E=="string","Label name must be a non-empty string"),this.$_setFlag("label",E)}meta(E){return a(E!==void 0,"Meta cannot be undefined"),this._inner("metas",E,{single:!0})}note(...E){a(E.length,"Missing notes");for(const P of E)a(P&&typeof P=="string","Notes must be non-empty strings");return this._inner("notes",E)}only(E=!0){return a(typeof E=="boolean","Invalid mode:",E),this.$_setFlag("only",E)}optional(){return this.presence("optional")}prefs(E){a(E,"Missing preferences"),a(E.context===void 0,"Cannot override context"),a(E.externals===void 0,"Cannot override externals"),a(E.warnings===void 0,"Cannot override warnings"),a(E.debug===void 0,"Cannot override debug"),d.checkPreferences(E);const P=this.clone();return P._preferences=d.preferences(P._preferences,E),P}presence(E){return a(["optional","required","forbidden"].includes(E),"Unknown presence mode",E),this.$_setFlag("presence",E)}raw(E=!0){return this.$_setFlag("result",E?"raw":void 0)}result(E){return a(["raw","strip"].includes(E),"Unknown result mode",E),this.$_setFlag("result",E)}required(){return this.presence("required")}strict(E){const P=this.clone(),k=E!==void 0&&!E;return P._preferences=d.preferences(P._preferences,{convert:k}),P}strip(E=!0){return this.$_setFlag("result",E?"strip":void 0)}tag(...E){a(E.length,"Missing tags");for(const P of E)a(P&&typeof P=="string","Tags must be non-empty strings");return this._inner("tags",E)}unit(E){return a(E&&typeof E=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",E)}valid(...E){d.verifyFlat(E,"valid");const P=this.allow(...E);return P.$_setFlag("only",!!P._valids,{clone:!1}),P}when(E,P){const k=this.clone();k.$_terms.whens||(k.$_terms.whens=[]);const M=p.when(k,E,P);if(!["any","link"].includes(k.type)){const I=M.is?[M]:M.switch;for(const j of I)a(!j.then||j.then.type==="any"||j.then.type===k.type,"Cannot combine",k.type,"with",j.then&&j.then.type),a(!j.otherwise||j.otherwise.type==="any"||j.otherwise.type===k.type,"Cannot combine",k.type,"with",j.otherwise&&j.otherwise.type)}return k.$_terms.whens.push(M),k.$_mutateRebuild()}cache(E){a(!this._inRuleset(),"Cannot set caching inside a ruleset"),a(!this._cache,"Cannot override schema cache"),a(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const P=this.clone();return P._cache=E||l.provider.provision(),P.$_temp.ruleset=!1,P}clone(){const E=Object.create(Object.getPrototypeOf(this));return this._assign(E)}concat(E){a(d.isSchema(E),"Invalid schema object"),a(this.type==="any"||E.type==="any"||E.type===this.type,"Cannot merge type",this.type,"with another type:",E.type),a(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),a(!E._inRuleset(),"Cannot concatenate a schema with open ruleset");let P=this.clone();if(this.type==="any"&&E.type!=="any"){const k=E.clone();for(const M of Object.keys(P))M!=="type"&&(k[M]=P[M]);P=k}P._ids.concat(E._ids),P._refs.register(E,x.toSibling),P._preferences=P._preferences?d.preferences(P._preferences,E._preferences):E._preferences,P._valids=N.merge(P._valids,E._valids,E._invalids),P._invalids=N.merge(P._invalids,E._invalids,E._valids);for(const k of E._singleRules.keys())P._singleRules.has(k)&&(P._rules=P._rules.filter(M=>M.keep||M.name!==k),P._singleRules.delete(k));for(const k of E._rules)E._definition.rules[k.method].multi||P._singleRules.set(k.name,k),P._rules.push(k);if(P._flags.empty&&E._flags.empty){P._flags.empty=P._flags.empty.concat(E._flags.empty);const k=Object.assign({},E._flags);delete k.empty,f(P._flags,k)}else if(E._flags.empty){P._flags.empty=E._flags.empty;const k=Object.assign({},E._flags);delete k.empty,f(P._flags,k)}else f(P._flags,E._flags);for(const k in E.$_terms){const M=E.$_terms[k];M?P.$_terms[k]?P.$_terms[k]=P.$_terms[k].concat(M):P.$_terms[k]=M.slice():P.$_terms[k]||(P.$_terms[k]=M)}return this.$_root._tracer&&this.$_root._tracer._combine(P,[this,E]),P.$_mutateRebuild()}extend(E){return a(!E.base,"Cannot extend type with another base"),m.type(this,E)}extract(E){return E=Array.isArray(E)?E:E.split("."),this._ids.reach(E)}fork(E,P){a(!this._inRuleset(),"Cannot fork inside a ruleset");let k=this;for(let M of[].concat(E))M=Array.isArray(M)?M:M.split("."),k=k._ids.fork(M,P,k);return k.$_temp.ruleset=!1,k}rule(E){const P=this._definition;d.assertOptions(E,Object.keys(P.modifiers)),a(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const k=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;a(k>=0&&k<this._rules.length,"Cannot apply rules to empty ruleset");const M=this.clone();for(let I=k;I<M._rules.length;++I){const j=M._rules[I],L=c(j);for(const H in E)P.modifiers[H](L,E[H]),a(L.name===j.name,"Cannot change rule name");M._rules[I]=L,M._singleRules.get(L.name)===j&&M._singleRules.set(L.name,L)}return M.$_temp.ruleset=!1,M.$_mutateRebuild()}get ruleset(){a(!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),a(!this._inRuleset(),"Cannot tailor inside a ruleset");let P=this;if(this.$_terms.alterations)for(const{target:k,adjuster:M}of this.$_terms.alterations)E.includes(k)&&(P=M(P),a(d.isSchema(P),"Alteration adjuster for",k,"failed to return a schema object"));return P=P.$_modify({each:k=>k.tailor(E),ref:!1}),P.$_temp.ruleset=!1,P.$_mutateRebuild()}tracer(){return _.location?_.location(this):this}validate(E,P){return A.entry(E,this,P)}validateAsync(E,P){return A.entryAsync(E,this,P)}$_addRule(E){typeof E=="string"&&(E={name:E}),a(E&&typeof E=="object","Invalid options"),a(E.name&&typeof E.name=="string","Invalid rule name");for(const j in E)a(j[0]!=="_","Cannot set private rule properties");const P=Object.assign({},E);P._resolve=[],P.method=P.method||P.name;const k=this._definition.rules[P.method],M=P.args;a(k,"Unknown rule",P.method);const I=this.clone();if(M){a(Object.keys(M).length===1||Object.keys(M).length===this._definition.rules[P.name].args.length,"Invalid rule definition for",this.type,P.name);for(const j in M){let L=M[j];if(k.argsByName){const H=k.argsByName.get(j);if(H.ref&&d.isResolvable(L))P._resolve.push(j),I.$_mutateRegister(L);else if(H.normalize&&(L=H.normalize(L),M[j]=L),H.assert){const K=d.validateArg(L,j,H);a(!K,K,"or reference")}}L!==void 0?M[j]=L:delete M[j]}}return k.multi||(I._ruleRemove(P.name,{clone:!1}),I._singleRules.set(P.name,P)),I.$_temp.ruleset===!1&&(I.$_temp.ruleset=null),k.priority?I._rules.unshift(P):I._rules.push(P),I}$_compile(E,P){return p.schema(this.$_root,E,P)}$_createError(E,P,k,M,I,j={}){const L=j.flags!==!1?this._flags:{},H=j.messages?g.merge(this._definition.messages,j.messages):this._definition.messages;return new h.Report(E,P,k,L,H,M,I)}$_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,P,k,M){(k=Object.assign({},k)).abortEarly=!0,k._externals=!1,P.snapshot();const I=!A.validate(E,this,P,k,M).errors;return P.restore(),I}$_modify(E){return d.assertOptions(E,["each","once","ref","schema"]),v.schema(this,E)||this}$_mutateRebuild(){return a(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(E,{source:P,name:k,path:M,key:I})=>{const j=this._definition[P][k]&&this._definition[P][k].register;j!==!1&&this.$_mutateRegister(E,{family:j,key:I})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(E,{family:P,key:k}={}){this._refs.register(E,P),this._ids.register(E,{key:k})}$_property(E){return this._definition.properties[E]}$_reach(E){return this._ids.reach(E)}$_rootReferences(){return this._refs.roots()}$_setFlag(E,P,k={}){a(E[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const M=this._definition.flags[E]||{};if(u(P,M.default)&&(P=void 0),u(P,this._flags[E]))return this;const I=k.clone!==!1?this.clone():this;return P!==void 0?(I._flags[E]=P,I.$_mutateRegister(P)):delete I._flags[E],E[0]!=="_"&&(I.$_temp.ruleset=!1),I}$_parent(E,...P){return this[E][d.symbols.parent].call(this,...P)}$_validate(E,P,k){return A.validate(E,this,P,k)}_assign(E){E.type=this.type,E.$_root=this.$_root,E.$_temp=Object.assign({},this.$_temp),E.$_temp.whens={},E._ids=this._ids.clone(),E._preferences=this._preferences,E._valids=this._valids&&this._valids.clone(),E._invalids=this._invalids&&this._invalids.clone(),E._rules=this._rules.slice(),E._singleRules=c(this._singleRules,{shallow:!0}),E._refs=this._refs.clone(),E._flags=Object.assign({},this._flags),E._cache=null,E.$_terms={};for(const P in this.$_terms)E.$_terms[P]=this.$_terms[P]?this.$_terms[P].slice():null;E.$_super={};for(const P in this.$_super)E.$_super[P]=this._super[P].bind(E);return E}_bare(){const E=this.clone();E._reset();const P=E._definition.terms;for(const k in P){const M=P[k];E.$_terms[k]=M.init}return E.$_mutateRebuild()}_default(E,P,k={}){return d.assertOptions(k,"literal"),a(P!==void 0,"Missing",E,"value"),a(typeof P=="function"||!k.literal,"Only function value supports literal option"),typeof P=="function"&&k.literal&&(P={[d.symbols.literal]:!0,literal:P}),this.$_setFlag(E,P)}_generate(E,P,k){if(!this.$_terms.whens)return{schema:this};const M=[],I=[];for(let H=0;H<this.$_terms.whens.length;++H){const K=this.$_terms.whens[H];if(K.concat){M.push(K.concat),I.push(`${H}.concat`);continue}const V=K.ref?K.ref.resolve(E,P,k):E,U=K.is?[K]:K.switch,Q=I.length;for(let ne=0;ne<U.length;++ne){const{is:X,then:G,otherwise:Y}=U[ne],Z=`${H}${K.switch?"."+ne:""}`;if(X.$_match(V,P.nest(X,`${Z}.is`),k)){if(G){const he=P.localize([...P.path,`${Z}.then`],P.ancestors,P.schemas),{schema:fe,id:ce}=G._generate(E,he,k);M.push(fe),I.push(`${Z}.then${ce?`(${ce})`:""}`);break}}else if(Y){const he=P.localize([...P.path,`${Z}.otherwise`],P.ancestors,P.schemas),{schema:fe,id:ce}=Y._generate(E,he,k);M.push(fe),I.push(`${Z}.otherwise${ce?`(${ce})`:""}`);break}}if(K.break&&I.length>Q)break}const j=I.join(", ");if(P.mainstay.tracer.debug(P,"rule","when",j),!j)return{schema:this};if(!P.mainstay.tracer.active&&this.$_temp.whens[j])return{schema:this.$_temp.whens[j],id:j};let L=this;this._definition.generate&&(L=this._definition.generate(this,E,P,k));for(const H of M)L=L.concat(H);return this.$_root._tracer&&this.$_root._tracer._combine(L,[this,...M]),this.$_temp.whens[j]=L,{schema:L,id:j}}_inner(E,P,k={}){a(!this._inRuleset(),`Cannot set ${E} inside a ruleset`);const M=this.clone();return M.$_terms[E]&&!k.override||(M.$_terms[E]=[]),k.single?M.$_terms[E].push(P):M.$_terms[E].push(...P),M.$_temp.ruleset=!1,M}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(E,P={}){if(!this._singleRules.has(E))return this;const k=P.clone!==!1?this.clone():this;k._singleRules.delete(E);const M=[];for(let I=0;I<k._rules.length;++I){const j=k._rules[I];j.name!==E||j.keep?M.push(j):k._inRuleset()&&I<k.$_temp.ruleset&&--k.$_temp.ruleset}return k._rules=M,k}_values(E,P){d.verifyFlat(E,P.slice(1,-1));const k=this.clone(),M=E[0]===d.symbols.override;if(M&&(E=E.slice(1)),!k[P]&&E.length?k[P]=new N:M&&(k[P]=E.length?new N:null,k.$_mutateRebuild()),!k[P])return k;M&&k[P].override();for(const I of E){a(I!==void 0,"Cannot call allow/valid/invalid with undefined"),a(I!==d.symbols.override,"Override must be the first value");const j=P==="_invalids"?"_valids":"_invalids";k[j]&&(k[j].remove(I),k[j].length||(a(P==="_valids"||!k._flags.only,"Setting invalid value",I,"leaves schema rejecting all values due to previous valid rule"),k[j]=null)),k[P].add(I,k._refs)}return k}}};T.Base.prototype[d.symbols.any]={version:d.version,compile:p.compile,root:"$_root"},T.Base.prototype.isImmutable=!0,T.Base.prototype.deny=T.Base.prototype.invalid,T.Base.prototype.disallow=T.Base.prototype.invalid,T.Base.prototype.equal=T.Base.prototype.valid,T.Base.prototype.exist=T.Base.prototype.required,T.Base.prototype.not=T.Base.prototype.invalid,T.Base.prototype.options=T.Base.prototype.prefs,T.Base.prototype.preferences=T.Base.prototype.prefs,s.exports=new T.Base},8652:(s,i,o)=>{const a=o(375),c=o(8571),u=o(8160),f={max:1e3,supported:new Set(["undefined","boolean","number","string"])};i.provider={provision:l=>new f.Cache(l)},f.Cache=class{constructor(l={}){u.assertOptions(l,["max"]),a(l.max===void 0||l.max&&l.max>0&&isFinite(l.max),"Invalid max cache size"),this._max=l.max||f.max,this._map=new Map,this._list=new f.List}get length(){return this._map.size}set(l,d){if(l!==null&&!f.supported.has(typeof l))return;let p=this._map.get(l);if(p)return p.value=d,void this._list.first(p);p=this._list.unshift({key:l,value:d}),this._map.set(l,p),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:p}=l;return d.prev=p,p&&(p.next=d),l===this.tail&&(this.tail=d),l.prev=null,l.next=null,l}}},8160:(s,i,o)=>{const a=o(375),c=o(7916),u=o(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(p,h,m="Options"){a(p&&typeof p=="object"&&!Array.isArray(p),"Options must be of type object");const y=Object.keys(p).filter(g=>!h.includes(g));a(y.length===0,`${m} contain unknown keys: ${y}`)},i.checkPreferences=function(p){l=l||o(3378);const h=l.preferences.validate(p);if(h.error)throw new c([h.error.details[0].message])},i.compare=function(p,h,m){switch(m){case"=":return p===h;case">":return p>h;case"<":return p<h;case">=":return p>=h;case"<=":return p<=h}},i.default=function(p,h){return p===void 0?h:p},i.isIsoDate=function(p){return d.isoDate.test(p)},i.isNumber=function(p){return typeof p=="number"&&!isNaN(p)},i.isResolvable=function(p){return!!p&&(p[i.symbols.ref]||p[i.symbols.template])},i.isSchema=function(p,h={}){const m=p&&p[i.symbols.any];return!!m&&(a(h.legacy||m.version===i.version,"Cannot mix different versions of joi schemas"),!0)},i.isValues=function(p){return p[i.symbols.values]},i.limit=function(p){return Number.isSafeInteger(p)&&p>=0},i.preferences=function(p,h){f=f||o(6914),p=p||{},h=h||{};const m=Object.assign({},p,h);return h.errors&&p.errors&&(m.errors=Object.assign({},p.errors,h.errors),m.errors.wrap=Object.assign({},p.errors.wrap,h.errors.wrap)),h.messages&&(m.messages=f.compile(h.messages,p.messages)),delete m[i.symbols.prefs],m},i.tryWithPath=function(p,h,m={}){try{return p()}catch(y){throw y.path!==void 0?y.path=h+"."+y.path:y.path=h,m.append&&(y.message=`${y.message} (${y.path})`),y}},i.validateArg=function(p,h,{assert:m,message:y}){if(i.isSchema(m)){const g=m.validate(p);return g.error?g.error.message:void 0}if(!m(p))return h?`${h} ${y}`:y},i.verifyFlat=function(p,h){for(const m of p)a(!Array.isArray(m),"Method no longer accepts array arguments:",h)}},3292:(s,i,o)=>{const a=o(375),c=o(8160),u=o(6133),f={};i.schema=function(l,d,p={}){c.assertOptions(p,["appendPath","override"]);try{return f.schema(l,d,p)}catch(h){throw p.appendPath&&h.path!==void 0&&(h.message=`${h.message} (${h.path})`),h}},f.schema=function(l,d,p){a(d!==void 0,"Invalid undefined schema"),Array.isArray(d)&&(a(d.length,"Invalid empty array schema"),d.length===1&&(d=d[0]));const h=(m,...y)=>p.override!==!1?m.valid(l.override,...y):m.valid(...y);if(f.simple(d))return h(l,d);if(typeof d=="function")return l.custom(d);if(a(typeof d=="object","Invalid schema content:",typeof d),c.isResolvable(d))return h(l,d);if(c.isSchema(d))return d;if(Array.isArray(d)){for(const m of d)if(!f.simple(m))return l.alternatives().try(...d);return h(l,...d)}return d instanceof RegExp?l.string().regex(d):d instanceof Date?h(l.date(),d):(a(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,p={}){c.assertOptions(p,["legacy"]);const h=d&&d[c.symbols.any];if(h)return a(p.legacy||h.version===c.version,"Cannot mix different versions of joi schemas:",h.version,c.version),d;if(typeof d!="object"||!p.legacy)return i.schema(l,d,{appendPath:!0});const m=f.walk(d);return m?m.compile(m.root,d):i.schema(l,d,{appendPath:!0})},f.walk=function(l){if(typeof l!="object")return null;if(Array.isArray(l)){for(const p of l){const h=f.walk(p);if(h)return h}return null}const d=l[c.symbols.any];if(d)return{root:l[d.root],compile:d.compile};a(Object.getPrototypeOf(l)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const p in l){const h=f.walk(l[p]);if(h)return h}return null},f.simple=function(l){return l===null||["boolean","string","number"].includes(typeof l)},i.when=function(l,d,p){if(p===void 0&&(a(d&&typeof d=="object","Missing options"),p=d,d=u.create(".")),Array.isArray(p)&&(p={switch:p}),c.assertOptions(p,["is","not","then","otherwise","switch","break"]),c.isSchema(d))return a(p.is===void 0,'"is" can not be used with a schema condition'),a(p.not===void 0,'"not" can not be used with a schema condition'),a(p.switch===void 0,'"switch" can not be used with a schema condition'),f.condition(l,{is:d,then:p.then,otherwise:p.otherwise,break:p.break});if(a(u.isRef(d)||typeof d=="string","Invalid condition:",d),a(p.not===void 0||p.is===void 0,'Cannot combine "is" with "not"'),p.switch===void 0){let m=p;p.not!==void 0&&(m={is:p.not,then:p.otherwise,otherwise:p.then,break:p.break});let y=m.is!==void 0?l.$_compile(m.is):l.$_root.invalid(null,!1,0,"").required();return a(m.then!==void 0||m.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),a(m.break===void 0||m.then===void 0||m.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),p.is===void 0||u.isRef(p.is)||c.isSchema(p.is)||(y=y.required()),f.condition(l,{ref:i.ref(d),is:y,then:m.then,otherwise:m.otherwise,break:m.break})}a(Array.isArray(p.switch),'"switch" must be an array'),a(p.is===void 0,'Cannot combine "switch" with "is"'),a(p.not===void 0,'Cannot combine "switch" with "not"'),a(p.then===void 0,'Cannot combine "switch" with "then"');const h={ref:i.ref(d),switch:[],break:p.break};for(let m=0;m<p.switch.length;++m){const y=p.switch[m],g=m===p.switch.length-1;c.assertOptions(y,g?["is","then","otherwise"]:["is","then"]),a(y.is!==void 0,'Switch statement missing "is"'),a(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){a(p.otherwise===void 0||y.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');const x=p.otherwise!==void 0?p.otherwise:y.otherwise;x!==void 0&&(a(h.break===void 0,"Cannot specify both otherwise and break"),v.otherwise=l.$_compile(x))}h.switch.push(v)}return h},f.condition=function(l,d){for(const p of["then","otherwise"])d[p]===void 0?delete d[p]:d[p]=l.$_compile(d[p]);return d}},6354:(s,i,o)=>{const a=o(5688),c=o(8160),u=o(3328);i.Report=class{constructor(f,l,d,p,h,m,y){if(this.code=f,this.flags=p,this.messages=h,this.path=m.path,this.prefs=y,this.state=m,this.value=l,this.message=null,this.template=null,this.local=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,p,h){if(!l)return;if(u.isTemplate(l))return d!=="root"?l:null;let m=h.errors.language;if(c.isResolvable(m)&&(m=m.resolve(f,p,h)),m&&l[m]){if(l[m][d]!==void 0)return l[m][d];if(l[m]["*"]!==void 0)return l[m]["*"]}return l[d]?l[d]:l["*"]},i.label=function(f,l,d,p){if(!d.errors.label)return"";if(f.label)return f.label;let h=l.path;return d.errors.label==="key"&&l.path.length>1&&(h=l.path.slice(-1)),i.path(h)||i.template(null,d.messages,"root",l,d)||p&&i.template(null,p,"root",l,d)||"value"},i.process=function(f,l,d){if(!f)return null;const{override:p,message:h,details:m}=i.details(f);if(p)return p;if(d.errors.stack)return new i.ValidationError(h,m,l);const y=Error.stackTraceLimit;Error.stackTraceLimit=0;const g=new i.ValidationError(h,m,l);return Error.stackTraceLimit=y,g},i.details=function(f,l={}){let d=[];const p=[];for(const h of f){if(h instanceof Error){if(l.override!==!1)return{override:h};const y=h.toString();d.push(y),p.push({message:y,type:"override",context:{error:h}});continue}const m=h.toString();d.push(m),p.push({message:m,path:h.path.filter(y=>typeof y!="object"),type:h.code,context:h.local})}return d.length>1&&(d=[...new Set(d)]),{message:d.join(". "),details:p}},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=a.error},8901:(s,i,o)=>{const a=o(375),c=o(8571),u=o(8160),f=o(6914),l={};i.type=function(d,p){const h=Object.getPrototypeOf(d),m=c(h),y=d._assign(Object.create(m)),g=Object.assign({},p);delete g.base,m._definition=g;const v=h._definition||{};g.messages=f.merge(v.messages,g.messages),g.properties=Object.assign({},v.properties,g.properties),y.type=g.type,g.flags=Object.assign({},v.flags,g.flags);const x=Object.assign({},v.terms);if(g.terms)for(const T in g.terms){const E=g.terms[T];a(y.$_terms[T]===void 0,"Invalid term override for",g.type,T),y.$_terms[T]=E.init,x[T]=E}g.terms=x,g.args||(g.args=v.args),g.prepare=l.prepare(g.prepare,v.prepare),g.coerce&&(typeof g.coerce=="function"&&(g.coerce={method:g.coerce}),g.coerce.from&&!Array.isArray(g.coerce.from)&&(g.coerce={method:g.coerce.method,from:[].concat(g.coerce.from)})),g.coerce=l.coerce(g.coerce,v.coerce),g.validate=l.validate(g.validate,v.validate);const _=Object.assign({},v.rules);if(g.rules)for(const T in g.rules){const E=g.rules[T];a(typeof E=="object","Invalid rule definition for",g.type,T);let P=E.method;if(P===void 0&&(P=function(){return this.$_addRule(T)}),P&&(a(!m[T],"Rule conflict in",g.type,T),m[T]=P),a(!_[T],"Rule conflict in",g.type,T),_[T]=E,E.alias){const k=[].concat(E.alias);for(const M of k)m[M]=E.method}E.args&&(E.argsByName=new Map,E.args=E.args.map(k=>(typeof k=="string"&&(k={name:k}),a(!E.argsByName.has(k.name),"Duplicated argument name",k.name),u.isSchema(k.assert)&&(k.assert=k.assert.strict().label(k.name)),E.argsByName.set(k.name,k),k)))}g.rules=_;const A=Object.assign({},v.modifiers);if(g.modifiers)for(const T in g.modifiers){a(!m[T],"Rule conflict in",g.type,T);const E=g.modifiers[T];a(typeof E=="function","Invalid modifier definition for",g.type,T);const P=function(k){return this.rule({[T]:k})};m[T]=P,A[T]=E}if(g.modifiers=A,g.overrides){m._super=h,y.$_super={};for(const T in g.overrides)a(h[T],"Cannot override missing",T),g.overrides[T][u.symbols.parent]=h[T],y.$_super[T]=h[T].bind(y);Object.assign(m,g.overrides)}g.cast=Object.assign({},v.cast,g.cast);const N=Object.assign({},v.manifest,g.manifest);return N.build=l.build(g.manifest&&g.manifest.build,v.manifest&&v.manifest.build),g.manifest=N,g.rebuild=l.rebuild(g.rebuild,v.rebuild),y},l.build=function(d,p){return d&&p?function(h,m){return p(d(h,m),m)}:d||p},l.coerce=function(d,p){return d&&p?{from:d.from&&p.from?[...new Set([...d.from,...p.from])]:null,method(h,m){let y;if((!p.from||p.from.includes(typeof h))&&(y=p.method(h,m),y)){if(y.errors||y.value===void 0)return y;h=y.value}if(!d.from||d.from.includes(typeof h)){const g=d.method(h,m);if(g)return g}return y}}:d||p},l.prepare=function(d,p){return d&&p?function(h,m){const y=d(h,m);if(y){if(y.errors||y.value===void 0)return y;h=y.value}return p(h,m)||y}:d||p},l.rebuild=function(d,p){return d&&p?function(h){p(h),d(h)}:d||p},l.validate=function(d,p){return d&&p?function(h,m){const y=p(h,m);if(y){if(y.errors&&(!Array.isArray(y.errors)||y.errors.length))return y;h=y.value}return d(h,m)||y}:d||p}},5107:(s,i,o)=>{const a=o(375),c=o(8571),u=o(8652),f=o(8160),l=o(3292),d=o(6354),p=o(8901),h=o(9708),m=o(6133),y=o(3328),g=o(1152);let v;const x={types:{alternatives:o(4946),any:o(8068),array:o(546),boolean:o(4937),date:o(7500),function:o(390),link:o(8785),number:o(3832),object:o(8966),string:o(7417),symbol:o(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const _={_types:new Set(Object.keys(x.types))};for(const A of _._types)_[A]=function(...N){return a(!N.length||["alternatives","link","object"].includes(A),"The",A,"type does not allow arguments"),x.generate(this,x.types[A],N)};for(const A of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])_[A]=function(...N){return this.any()[A](...N)};Object.assign(_,x.methods);for(const A in x.aliases){const N=x.aliases[A];_[A]=_[N]}return _.x=_.expression,g.setup&&g.setup(_),_}};x.methods={ValidationError:d.ValidationError,version:f.version,cache:u.provider,assert(_,A,...N){x.assert(_,A,!0,N)},attempt:(_,A,...N)=>x.assert(_,A,!1,N),build(_){return a(typeof h.build=="function","Manifest functionality disabled"),h.build(this,_)},checkPreferences(_){f.checkPreferences(_)},compile(_,A){return l.compile(this,_,A)},defaults(_){a(typeof _=="function","modifier must be a function");const A=Object.assign({},this);for(const N of A._types){const T=_(A[N]());a(f.isSchema(T),"modifier must return a valid schema object"),A[N]=function(...E){return x.generate(this,T,E)}}return A},expression:(..._)=>new y(..._),extend(..._){f.verifyFlat(_,"extend"),v=v||o(3378),a(_.length,"You need to provide at least one extension"),this.assert(_,v.extensions);const A=Object.assign({},this);A._types=new Set(A._types);for(let N of _){typeof N=="function"&&(N=N(A)),this.assert(N,v.extension);const T=x.expandExtension(N,A);for(const E of T){a(A[E.type]===void 0||A._types.has(E.type),"Cannot override name",E.type);const P=E.base||this.any(),k=p.type(P,E);A._types.add(E.type),A[E.type]=function(...M){return x.generate(this,k,M)}}}return A},isError:d.ValidationError.isError,isExpression:y.isTemplate,isRef:m.isRef,isSchema:f.isSchema,in:(..._)=>m.in(..._),override:f.symbols.override,ref:(..._)=>m.create(..._),types(){const _={};for(const A of this._types)_[A]=this[A]();for(const A in x.aliases)_[A]=this[A]();return _}},x.assert=function(_,A,N,T){const E=T[0]instanceof Error||typeof T[0]=="string"?T[0]:null,P=E!==null?T[1]:T[0],k=A.validate(_,f.preferences({errors:{stack:!0}},P||{}));let M=k.error;if(!M)return k.value;if(E instanceof Error)throw E;const I=N&&typeof M.annotate=="function"?M.annotate():M.message;throw M instanceof d.ValidationError==0&&(M=c(M)),M.message=E?`${E} ${I}`:I,M},x.generate=function(_,A,N){return a(_,"Must be invoked on a Joi instance."),A.$_root=_,A._definition.args&&N.length?A._definition.args(A,...N):A},x.expandExtension=function(_,A){if(typeof _.type=="string")return[_];const N=[];for(const T of A._types)if(_.type.test(T)){const E=Object.assign({},_);E.type=T,E.base=A[T](),N.push(E)}return N},s.exports=x.root()},6914:(s,i,o)=>{const a=o(375),c=o(8571),u=o(3328);i.compile=function(f,l){if(typeof f=="string")return a(!l,"Cannot set single message string"),new u(f);if(u.isTemplate(f))return a(!l,"Cannot set single message template"),f;a(typeof f=="object"&&!Array.isArray(f),"Invalid message options"),l=l?c(l):{};for(let d in f){const p=f[d];if(d==="root"||u.isTemplate(p)){l[d]=p;continue}if(typeof p=="string"){l[d]=new u(p);continue}a(typeof p=="object"&&!Array.isArray(p),"Invalid message for",d);const h=d;for(d in l[h]=l[h]||{},p){const m=p[d];d==="root"||u.isTemplate(m)?l[h][d]=m:(a(typeof m=="string","Invalid message for",d,"in",h),l[h][d]=new u(m))}}return l},i.decompile=function(f){const l={};for(let d in f){const p=f[d];if(d==="root"){l.root=p;continue}if(u.isTemplate(p)){l[d]=p.describe({compact:!0});continue}const h=d;for(d in l[h]={},p){const m=p[d];d!=="root"?l[h][d]=m.describe({compact:!0}):l[h].root=m}}return l},i.merge=function(f,l){if(!f)return i.compile(l);if(!l)return f;if(typeof l=="string")return new u(l);if(u.isTemplate(l))return l;const d=c(f);for(let p in l){const h=l[p];if(p==="root"||u.isTemplate(h)){d[p]=h;continue}if(typeof h=="string"){d[p]=new u(h);continue}a(typeof h=="object"&&!Array.isArray(h),"Invalid message for",p);const m=p;for(p in d[m]=d[m]||{},h){const y=h[p];p==="root"||u.isTemplate(y)?d[m][p]=y:(a(typeof y=="string","Invalid message for",p,"in",m),d[m][p]=new u(y))}}return d}},2294:(s,i,o)=>{const a=o(375),c=o(8160),u=o(6133),f={};i.Ids=f.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const l=new f.Ids;return l._byId=new Map(this._byId),l._byKey=new Map(this._byKey),l._schemaChain=this._schemaChain,l}concat(l){l._schemaChain&&(this._schemaChain=!0);for(const[d,p]of l._byId.entries())a(!this._byKey.has(d),"Schema id conflicts with existing key:",d),this._byId.set(d,p);for(const[d,p]of l._byKey.entries())a(!this._byId.has(d),"Schema key conflicts with existing id:",d),this._byKey.set(d,p)}fork(l,d,p){const h=this._collect(l);h.push({schema:p});const m=h.shift();let y={id:m.id,schema:d(m.schema)};a(c.isSchema(y.schema),"adjuster function failed to return a joi schema type");for(const g of h)y={id:g.id,schema:f.fork(g.schema,y.id,y.schema)};return y.schema}labels(l,d=[]){const p=l[0],h=this._get(p);if(!h)return[...d,...l].join(".");const m=l.slice(1);return d=[...d,h.schema._flags.label||p],m.length?h.schema._ids.labels(m,d):d.join(".")}reach(l,d=[]){const p=l[0],h=this._get(p);a(h,"Schema does not contain path",[...d,...l].join("."));const m=l.slice(1);return m.length?h.schema._ids.reach(m,[...d,p]):h.schema}register(l,{key:d}={}){if(!l||!c.isSchema(l))return;(l.$_property("schemaChain")||l._ids._schemaChain)&&(this._schemaChain=!0);const p=l._flags.id;if(p){const h=this._byId.get(p);a(!h||h.schema===l,"Cannot add different schemas with the same id:",p),a(!this._byKey.has(p),"Schema id conflicts with existing key:",p),this._byId.set(p,{schema:l,id:p})}d&&(a(!this._byKey.has(d),"Schema already contains key:",d),a(!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=[],p=[]){const h=l[0],m=this._get(h);a(m,"Schema does not contain path",[...d,...l].join(".")),p=[m,...p];const y=l.slice(1);return y.length?m.schema._ids._collect(y,[...d,h],p):p}_get(l){return this._byId.get(l)||this._byKey.get(l)}},f.fork=function(l,d,p){const h=i.schema(l,{each:(m,{key:y})=>{if(d===(m._flags.id||y))return p},ref:!1});return h?h.$_mutateRebuild():l},i.schema=function(l,d){let p;for(const h in l._flags){if(h[0]==="_")continue;const m=f.scan(l._flags[h],{source:"flags",name:h},d);m!==void 0&&(p=p||l.clone(),p._flags[h]=m)}for(let h=0;h<l._rules.length;++h){const m=l._rules[h],y=f.scan(m.args,{source:"rules",name:m.name},d);if(y!==void 0){p=p||l.clone();const g=Object.assign({},m);g.args=y,p._rules[h]=g,p._singleRules.get(m.name)===m&&p._singleRules.set(m.name,g)}}for(const h in l.$_terms){if(h[0]==="_")continue;const m=f.scan(l.$_terms[h],{source:"terms",name:h},d);m!==void 0&&(p=p||l.clone(),p.$_terms[h]=m)}return p},f.scan=function(l,d,p,h,m){const y=h||[];if(l===null||typeof l!="object")return;let g;if(Array.isArray(l)){for(let v=0;v<l.length;++v){const x=d.source==="terms"&&d.name==="keys"&&l[v].key,_=f.scan(l[v],d,p,[v,...y],x);_!==void 0&&(g=g||l.slice(),g[v]=_)}return g}if(p.schema!==!1&&c.isSchema(l)||p.ref!==!1&&u.isRef(l)){const v=p.each(l,{...d,path:y,key:m});return v===l?void 0:v}for(const v in l){if(v[0]==="_")continue;const x=f.scan(l[v],d,p,[v,...y],m);x!==void 0&&(g=g||Object.assign({},l),g[v]=x)}return g}},6133:(s,i,o)=>{const a=o(375),c=o(8571),u=o(9621),f=o(8160);let l;const d={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};i.create=function(p,h={}){a(typeof p=="string","Invalid reference key:",p),f.assertOptions(h,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),a(!h.prefix||typeof h.prefix=="object","options.prefix must be of type object");const m=Object.assign({},d.defaults,h);delete m.prefix;const y=m.separator,g=d.context(p,y,h.prefix);if(m.type=g.type,p=g.key,m.type==="value")if(g.root&&(a(!y||p[0]!==y,"Cannot specify relative path with root prefix"),m.ancestor="root",p||(p=null)),y&&y===p)p=null,m.ancestor=0;else if(m.ancestor!==void 0)a(!y||!p||p[0]!==y,"Cannot combine prefix with ancestor option");else{const[v,x]=d.ancestor(p,y);x&&(p=p.slice(x))===""&&(p=null),m.ancestor=v}return m.path=y?p===null?[]:p.split(y):[p],new d.Ref(m)},i.in=function(p,h={}){return i.create(p,{...h,in:!0})},i.isRef=function(p){return!!p&&!!p[f.symbols.ref]},d.Ref=class{constructor(p){a(typeof p=="object","Invalid reference construction"),f.assertOptions(p,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),a([!1,void 0].includes(p.separator)||typeof p.separator=="string"&&p.separator.length===1,"Invalid separator"),a(!p.adjust||typeof p.adjust=="function","options.adjust must be a function"),a(!p.map||Array.isArray(p.map),"options.map must be an array"),a(!p.map||!p.adjust,"Cannot set both map and adjust options"),Object.assign(this,d.defaults,p),a(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(p,h,m,y,g={}){return a(!this.in||g.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(m.context,h,g):this.type==="local"?this._resolve(y,h,g):this.ancestor?this.ancestor==="root"?this._resolve(h.ancestors[h.ancestors.length-1],h,g):(a(this.ancestor<=h.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(h.ancestors[this.ancestor-1],h,g)):this._resolve(p,h,g)}_resolve(p,h,m){let y;if(this.type==="value"&&h.mainstay.shadow&&m.shadow!==!1&&(y=h.mainstay.shadow.get(this.absolute(h))),y===void 0&&(y=u(p,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(y=this.adjust(y)),this.map){const g=this.map.get(y);g!==void 0&&(y=g)}return h.mainstay&&h.mainstay.tracer.resolve(h,this,y),y}toString(){return this.display}absolute(p){return[...p.path.slice(0,-this.ancestor),...this.path]}clone(){return new d.Ref(this)}describe(){const p={path:this.path};this.type!=="value"&&(p.type=this.type),this.separator!=="."&&(p.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(p.ancestor=this.ancestor),this.map&&(p.map=[...this.map]);for(const h of["adjust","iterables","render"])this[h]!==null&&this[h]!==void 0&&(p[h]=this[h]);return this.in!==!1&&(p.in=!0),{ref:p}}updateDisplay(){const p=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${p}`);if(!this.separator)return void(this.display=`ref:${p}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${p}`);if(this.ancestor==="root")return void(this.display=`ref:root:${p}`);if(this.ancestor===1)return void(this.display=`ref:${p||".."}`);const h=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${h}${p||""}`}},d.Ref.prototype[f.symbols.ref]=!0,i.build=function(p){return(p=Object.assign({},d.defaults,p)).type==="value"&&p.ancestor===void 0&&(p.ancestor=1),new d.Ref(p)},d.context=function(p,h,m={}){if(p=p.trim(),m){const y=m.global===void 0?"$":m.global;if(y!==h&&p.startsWith(y))return{key:p.slice(y.length),type:"global"};const g=m.local===void 0?"#":m.local;if(g!==h&&p.startsWith(g))return{key:p.slice(g.length),type:"local"};const v=m.root===void 0?"/":m.root;if(v!==h&&p.startsWith(v))return{key:p.slice(v.length),type:"value",root:!0}}return{key:p,type:"value"}},d.ancestor=function(p,h){if(!h)return[1,0];if(p[0]!==h)return[1,0];if(p[1]!==h)return[0,1];let m=2;for(;p[m]===h;)++m;return[m-1,m]},i.toSibling=0,i.toParent=1,i.Manager=class{constructor(){this.refs=[]}register(p,h){if(p)if(h=h===void 0?i.toParent:h,Array.isArray(p))for(const m of p)this.register(m,h);else if(f.isSchema(p))for(const m of p._refs.refs)m.ancestor-h>=0&&this.refs.push({ancestor:m.ancestor-h,root:m.root});else i.isRef(p)&&p.type==="value"&&p.ancestor-h>=0&&this.refs.push({ancestor:p.ancestor-h,root:p.root}),l=l||o(3328),l.isTemplate(p)&&this.register(p.refs(),h)}get length(){return this.refs.length}clone(){const p=new i.Manager;return p.refs=c(this.refs),p}reset(){this.refs=[]}roots(){return this.refs.filter(p=>!p.ancestor).map(p=>p.root)}}},3378:(s,i,o)=>{const a=o(5107),c={};c.wrap=a.string().min(1).max(2).allow(!1),i.preferences=a.object({allowUnknown:a.boolean(),abortEarly:a.boolean(),artifacts:a.boolean(),cache:a.boolean(),context:a.object(),convert:a.boolean(),dateFormat:a.valid("date","iso","string","time","utc"),debug:a.boolean(),errors:{escapeHtml:a.boolean(),label:a.valid("path","key",!1),language:[a.string(),a.object().ref()],render:a.boolean(),stack:a.boolean(),wrap:{label:c.wrap,array:c.wrap,string:c.wrap}},externals:a.boolean(),messages:a.object(),noDefaults:a.boolean(),nonEnumerables:a.boolean(),presence:a.valid("required","optional","forbidden"),skipFunctions:a.boolean(),stripUnknown:a.object({arrays:a.boolean(),objects:a.boolean()}).or("arrays","objects").allow(!0,!1),warnings:a.boolean()}).strict(),c.nameRx=/^[a-zA-Z0-9]\w*$/,c.rule=a.object({alias:a.array().items(a.string().pattern(c.nameRx)).single(),args:a.array().items(a.string(),a.object({name:a.string().pattern(c.nameRx).required(),ref:a.boolean(),assert:a.alternatives([a.function(),a.object().schema()]).conditional("ref",{is:!0,then:a.required()}),normalize:a.function(),message:a.string().when("assert",{is:a.function(),then:a.required()})})),convert:a.boolean(),manifest:a.boolean(),method:a.function().allow(!1),multi:a.boolean(),validate:a.function()}),i.extension=a.object({type:a.alternatives([a.string(),a.object().regex()]).required(),args:a.function(),cast:a.object().pattern(c.nameRx,a.object({from:a.function().maxArity(1).required(),to:a.function().minArity(1).maxArity(2).required()})),base:a.object().schema().when("type",{is:a.object().regex(),then:a.forbidden()}),coerce:[a.function().maxArity(3),a.object({method:a.function().maxArity(3).required(),from:a.array().items(a.string()).single()})],flags:a.object().pattern(c.nameRx,a.object({setter:a.string(),default:a.any()})),manifest:{build:a.function().arity(2)},messages:[a.object(),a.string()],modifiers:a.object().pattern(c.nameRx,a.function().minArity(1).maxArity(2)),overrides:a.object().pattern(c.nameRx,a.function()),prepare:a.function().maxArity(3),rebuild:a.function().arity(1),rules:a.object().pattern(c.nameRx,c.rule),terms:a.object().pattern(c.nameRx,a.object({init:a.array().allow(null).required(),manifest:a.object().pattern(/.+/,[a.valid("schema","single"),a.object({mapped:a.object({from:a.string().required(),to:a.string().required()}).required()})])})),validate:a.function().maxArity(3)}).strict(),i.extensions=a.array().items(a.object(),a.function().arity(1)).strict(),c.desc={buffer:a.object({buffer:a.string()}),func:a.object({function:a.function().required(),options:{literal:!0}}),override:a.object({override:!0}),ref:a.object({ref:a.object({type:a.valid("value","global","local"),path:a.array().required(),separator:a.string().length(1).allow(!1),ancestor:a.number().min(0).integer().allow("root"),map:a.array().items(a.array().length(2)).min(1),adjust:a.function(),iterables:a.boolean(),in:a.boolean(),render:a.boolean()}).required()}),regex:a.object({regex:a.string().min(3)}),special:a.object({special:a.valid("deep").required()}),template:a.object({template:a.string().required(),options:a.object()}),value:a.object({value:a.alternatives([a.object(),a.array()]).required()})},c.desc.entity=a.alternatives([a.array().items(a.link("...")),a.boolean(),a.function(),a.number(),a.string(),c.desc.buffer,c.desc.func,c.desc.ref,c.desc.regex,c.desc.special,c.desc.template,c.desc.value,a.link("/")]),c.desc.values=a.array().items(null,a.boolean(),a.function(),a.number().allow(1/0,-1/0),a.string().allow(""),a.symbol(),c.desc.buffer,c.desc.func,c.desc.override,c.desc.ref,c.desc.regex,c.desc.template,c.desc.value),c.desc.messages=a.object().pattern(/.+/,[a.string(),c.desc.template,a.object().pattern(/.+/,[a.string(),c.desc.template])]),i.description=a.object({type:a.string().required(),flags:a.object({cast:a.string(),default:a.any(),description:a.string(),empty:a.link("/"),failover:c.desc.entity,id:a.string(),label:a.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:a.boolean(),unit:a.string()}).unknown(),preferences:{allowUnknown:a.boolean(),abortEarly:a.boolean(),artifacts:a.boolean(),cache:a.boolean(),convert:a.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:a.boolean(),label:["path","key"],language:[a.string(),c.desc.ref],wrap:{label:c.wrap,array:c.wrap}},externals:a.boolean(),messages:c.desc.messages,noDefaults:a.boolean(),nonEnumerables:a.boolean(),presence:["required","optional","forbidden"],skipFunctions:a.boolean(),stripUnknown:a.object({arrays:a.boolean(),objects:a.boolean()}).or("arrays","objects").allow(!0,!1),warnings:a.boolean()},allow:c.desc.values,invalid:c.desc.values,rules:a.array().min(1).items({name:a.string().required(),args:a.object().min(1),keep:a.boolean(),message:[a.string(),c.desc.messages],warn:a.boolean()}),keys:a.object().pattern(/.*/,a.link("/")),link:c.desc.ref}).pattern(/^[a-z]\w*$/,a.any())},493:(s,i,o)=>{const a=o(8571),c=o(9621),u=o(8160),f={value:Symbol("value")};s.exports=f.State=class{constructor(l,d,p){this.path=l,this.ancestors=d,this.mainstay=p.mainstay,this.schemas=p.schemas,this.debug=null}localize(l,d=null,p=null){const h=new f.State(l,d,this);return p&&h.schemas&&(h.schemas=[f.schemas(p),...h.schemas]),h}nest(l,d){const p=new f.State(this.path,this.ancestors,this);return p.schemas=p.schemas&&[f.schemas(l),...p.schemas],p.debug=d,p}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=a(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}},f.schemas=function(l){return u.isSchema(l)?{schema:l}:l},f.Shadow=class{constructor(){this._values=null}set(l,d,p){if(!l.length||p==="strip"&&typeof l[l.length-1]=="number")return;this._values=this._values||new Map;let h=this._values;for(let m=0;m<l.length;++m){const y=l[m];let g=h.get(y);g||(g=new Map,h.set(y,g)),h=g}h[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 p=l.slice(0,-1),h=l[l.length-1],m=c(this._values,p,{iterables:!0});d?m.set(h,d):m&&m.delete(h)}}},3328:(s,i,o)=>{const a=o(375),c=o(8571),u=o(5277),f=o(1447),l=o(8160),d=o(6354),p=o(6133),h={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};s.exports=h.Template=class{constructor(m,y){if(a(typeof m=="string","Template source must be a string"),a(!m.includes("\0")&&!m.includes(""),"Template source cannot contain reserved control characters"),this.source=m,this.rendered=m,this._template=null,y){const{functions:g,...v}=y;this._settings=Object.keys(v).length?c(v):void 0,this._functions=g,this._functions&&(a(Object.keys(this._functions).every(x=>typeof x=="string"),"Functions keys must be strings"),a(Object.values(this._functions).every(x=>typeof x=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const m=h.encode(this.source),y=h.split(m);let g=!1;const v=[],x=y.shift();x&&v.push(x);for(const _ of y){const A=_[0]!=="{",N=A?"}":"}}",T=_.indexOf(N);if(T===-1||_[1]==="{"){v.push(`{${h.decode(_)}`);continue}let E=_.slice(A?0:1,T);const P=E[0]===":";P&&(E=E.slice(1));const k=this._ref(h.decode(E),{raw:A,wrapped:P});v.push(k),typeof k!="string"&&(g=!0);const M=_.slice(T+N.length);M&&v.push(h.decode(M))}g?this._template=v:this.rendered=v.join("")}static date(m,y){return h.dateFormat[y.dateFormat].call(m)}describe(m={}){if(!this._settings&&m.compact)return this.source;const y={template:this.source};return this._settings&&(y.options=this._settings),this._functions&&(y.functions=this._functions),y}static build(m){return new h.Template(m.template,m.options||m.functions?{...m.options,functions:m.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(m){return!!m&&!!m[l.symbols.template]}refs(){if(!this._template)return;const m=[];for(const y of this._template)typeof y!="string"&&m.push(...y.refs);return m}resolve(m,y,g,v){return this._template&&this._template.length===1?this._part(this._template[0],m,y,g,v,{}):this.render(m,y,g,v)}_part(m,...y){return m.ref?m.ref.resolve(...y):m.formula.evaluate(y)}render(m,y,g,v,x={}){if(!this.isDynamic())return this.rendered;const _=[];for(const A of this._template)if(typeof A=="string")_.push(A);else{const N=this._part(A,m,y,g,v,x),T=h.stringify(N,m,y,g,v,x);if(T!==void 0){const E=A.raw||(x.errors&&x.errors.escapeHtml)===!1?T:u(T);_.push(h.wrap(E,A.wrapped&&g.errors.wrap.label))}}return _.join("")}_ref(m,{raw:y,wrapped:g}){const v=[],x=A=>{const N=p.create(A,this._settings);return v.push(N),T=>{const E=N.resolve(...T);return E!==void 0?E:null}};try{const A=this._functions?{...h.functions,...this._functions}:h.functions;var _=new f.Parser(m,{reference:x,functions:A,constants:h.constants})}catch(A){throw A.message=`Invalid template variable "${m}" fails due to: ${A.message}`,A}if(_.single){if(_.single.type==="reference"){const A=v[0];return{ref:A,raw:y,refs:v,wrapped:g||A.type==="local"&&A.key==="label"}}return h.stringify(_.single.value)}return{formula:_,raw:y,refs:v}}toString(){return this.source}},h.Template.prototype[l.symbols.template]=!0,h.Template.prototype.isImmutable=!0,h.encode=function(m){return m.replace(/\\(\{+)/g,(y,g)=>h.opens.slice(0,g.length)).replace(/\\(\}+)/g,(y,g)=>h.closes.slice(0,g.length))},h.decode=function(m){return m.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},h.split=function(m){const y=[];let g="";for(let v=0;v<m.length;++v){const x=m[v];if(x==="{"){let _="";for(;v+1<m.length&&m[v+1]==="{";)_+="{",++v;y.push(g),g=_}else g+=x}return y.push(g),y},h.wrap=function(m,y){return y?y.length===1?`${y}${m}${y}`:`${y[0]}${m}${y[1]}`:m},h.stringify=function(m,y,g,v,x,_={}){const A=typeof m,N=v&&v.errors&&v.errors.wrap||{};let T=!1;if(p.isRef(m)&&m.render&&(T=m.in,m=m.resolve(y,g,v,x,{in:m.in,..._})),m===null)return"null";if(A==="string")return h.wrap(m,_.arrayItems&&N.string);if(A==="number"||A==="function"||A==="symbol")return m.toString();if(A!=="object")return JSON.stringify(m);if(m instanceof Date)return h.Template.date(m,v);if(m instanceof Map){const P=[];for(const[k,M]of m.entries())P.push(`${k.toString()} -> ${M.toString()}`);m=P}if(!Array.isArray(m))return m.toString();const E=[];for(const P of m)E.push(h.stringify(P,y,g,v,x,{arrayItems:!0,..._}));return h.wrap(E.join(", "),!T&&N.array)},h.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},h.functions={if:(m,y,g)=>m?y:g,length:m=>typeof m=="string"?m.length:m&&typeof m=="object"?Array.isArray(m)?m.length:Object.keys(m).length:null,msg(m){const[y,g,v,x,_]=this,A=_.messages;if(!A)return"";const N=d.template(y,A[0],m,g,v)||d.template(y,A[1],m,g,v);return N?N.render(y,g,v,x,_):""},number:m=>typeof m=="number"?m:typeof m=="string"?parseFloat(m):typeof m=="boolean"?m?1:0:m instanceof Date?m.getTime():null}},4946:(s,i,o)=>{const a=o(375),c=o(1687),u=o(8068),f=o(8160),l=o(3292),d=o(6354),p=o(6133),h={};s.exports=u.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:p.toSibling}},args:(m,...y)=>y.length===1&&Array.isArray(y[0])?m.try(...y[0]):m.try(...y),validate(m,y){const{schema:g,error:v,state:x,prefs:_}=y;if(g._flags.match){const N=[],T=[];for(let P=0;P<g.$_terms.matches.length;++P){const k=g.$_terms.matches[P],M=x.nest(k.schema,`match.${P}`);M.snapshot();const I=k.schema.$_validate(m,M,_);I.errors?(T.push(I.errors),M.restore()):(N.push(I.value),M.commit())}if(N.length===0)return{errors:v("alternatives.any",{details:T.map(P=>d.details(P,{override:!1}))})};if(g._flags.match==="one")return N.length===1?{value:N[0]}:{errors:v("alternatives.one")};if(N.length!==g.$_terms.matches.length)return{errors:v("alternatives.all",{details:T.map(P=>d.details(P,{override:!1}))})};const E=P=>P.$_terms.matches.some(k=>k.schema.type==="object"||k.schema.type==="alternatives"&&E(k.schema));return E(g)?{value:N.reduce((P,k)=>c(P,k,{mergeArrays:!1}))}:{value:N[N.length-1]}}const A=[];for(let N=0;N<g.$_terms.matches.length;++N){const T=g.$_terms.matches[N];if(T.schema){const k=x.nest(T.schema,`match.${N}`);k.snapshot();const M=T.schema.$_validate(m,k,_);if(!M.errors)return k.commit(),M;k.restore(),A.push({schema:T.schema,reports:M.errors});continue}const E=T.ref?T.ref.resolve(m,x,_):m,P=T.is?[T]:T.switch;for(let k=0;k<P.length;++k){const M=P[k],{is:I,then:j,otherwise:L}=M,H=`match.${N}${T.switch?"."+k:""}`;if(I.$_match(E,x.nest(I,`${H}.is`),_)){if(j)return j.$_validate(m,x.nest(j,`${H}.then`),_)}else if(L)return L.$_validate(m,x.nest(L,`${H}.otherwise`),_)}}return h.errors(A,y)},rules:{conditional:{method(m,y){a(!this._flags._endedSwitch,"Unreachable condition"),a(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),a(y.break===void 0,"Cannot use break option with alternatives conditional");const g=this.clone(),v=l.when(g,m,y),x=v.is?[v]:v.switch;for(const _ of x)if(_.then&&_.otherwise){g.$_setFlag("_endedSwitch",!0,{clone:!1});break}return g.$_terms.matches.push(v),g.$_mutateRebuild()}},match:{method(m){if(a(["any","one","all"].includes(m),"Invalid alternatives match mode",m),m!=="any")for(const y of this.$_terms.matches)a(y.schema,"Cannot combine match mode",m,"with conditional rules");return this.$_setFlag("match",m)}},try:{method(...m){a(m.length,"Missing alternative schemas"),f.verifyFlat(m,"try"),a(!this._flags._endedSwitch,"Unreachable condition");const y=this.clone();for(const g of m)y.$_terms.matches.push({schema:y.$_compile(g)});return y.$_mutateRebuild()}}},overrides:{label(m){return this.$_parent("label",m).$_modify({each:(y,g)=>g.path[0]!=="is"&&typeof y._flags.label!="string"?y.label(m):void 0,ref:!1})}},rebuild(m){m.$_modify({each:y=>{f.isSchema(y)&&y.type==="array"&&m.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(m,y){if(y.matches)for(const g of y.matches){const{schema:v,ref:x,is:_,not:A,then:N,otherwise:T}=g;m=v?m.try(v):x?m.conditional(x,{is:_,then:N,not:A,otherwise:T,switch:g.switch}):m.conditional(_,{then:N,otherwise:T})}return m}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),h.errors=function(m,{error:y,state:g}){if(!m.length)return{errors:y("alternatives.any")};if(m.length===1)return{errors:m[0].reports};const v=new Set,x=[];for(const{reports:_,schema:A}of m){if(_.length>1)return h.unmatched(m,y);const N=_[0];if(N instanceof d.Report==0)return h.unmatched(m,y);if(N.state.path.length!==g.path.length){x.push({type:A.type,report:N});continue}if(N.code==="any.only"){for(const P of N.local.valids)v.add(P);continue}const[T,E]=N.code.split(".");E!=="base"?x.push({type:A.type,report:N}):N.code==="object.base"?v.add(N.local.type):v.add(T)}return x.length?x.length===1?{errors:x[0].report}:h.unmatched(m,y):{errors:y("alternatives.types",{types:[...v]})}},h.unmatched=function(m,y){const g=[];for(const v of m)g.push(...v.reports);return{errors:y("alternatives.match",d.details(g,{override:!1}))}}},8068:(s,i,o)=>{const a=o(375),c=o(7629),u=o(8160),f=o(6914);s.exports=c.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(l,d){return a(typeof l=="function","Method must be a function"),a(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:p}){try{return p(l,d)}catch(h){return d.error("any.custom",{error:h})}},args:["method","description"],multi:!0},messages:{method(l){return this.prefs({messages:l})}},shared:{method(l){a(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 a(l&&typeof l=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:l,local:d},warn:!0})},validate:(l,d,{code:p,local:h})=>d.error(p,h),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 p in d){const h=d[p];if(["examples","externals","metas","notes","tags"].includes(p))for(const m of h)l=l[p.slice(0,-1)](m);else if(p!=="alterations")if(p!=="whens"){if(p==="shared")for(const m of h)l=l.shared(m)}else for(const m of h){const{ref:y,is:g,not:v,then:x,otherwise:_,concat:A}=m;l=A?l.concat(A):y?l.when(y,{is:g,not:v,then:x,otherwise:_,switch:m.switch,break:m.break}):l.when(g,{then:x,otherwise:_,break:m.break})}else{const m={};for(const{target:y,adjuster:g}of h)m[y]=g;l=l.alter(m)}}return l}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(s,i,o)=>{const a=o(375),c=o(9474),u=o(9621),f=o(8068),l=o(8160),d=o(3292),p={};s.exports=f.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(h,{schema:m,state:y,prefs:g}){if(!Array.isArray(h))return;const v=m.$_getRule("sort");return v?p.sort(m,h,v.args.options,y,g):void 0}},validate(h,{schema:m,error:y}){if(!Array.isArray(h)){if(m._flags.single){const g=[h];return g[l.symbols.arraySingle]=!0,{value:g}}return{errors:y("array.base")}}if(m.$_getRule("items")||m.$_terms.externals)return{value:h.slice()}},rules:{has:{method(h){h=this.$_compile(h,{appendPath:!0});const m=this.$_addRule({name:"has",args:{schema:h}});return m.$_mutateRegister(h),m},validate(h,{state:m,prefs:y,error:g},{schema:v}){const x=[h,...m.ancestors];for(let A=0;A<h.length;++A){const N=m.localize([...m.path,A],x,v);if(v.$_match(h[A],N,y))return h}const _=v._flags.label;return _?g("array.hasKnown",{patternLabel:_}):g("array.hasUnknown",null)},multi:!0},items:{method(...h){l.verifyFlat(h,"items");const m=this.$_addRule("items");for(let y=0;y<h.length;++y){const g=l.tryWithPath(()=>this.$_compile(h[y]),y,{append:!0});m.$_terms.items.push(g)}return m.$_mutateRebuild()},validate(h,{schema:m,error:y,state:g,prefs:v,errorsArray:x}){const _=m.$_terms._requireds.slice(),A=m.$_terms.ordered.slice(),N=[...m.$_terms._inclusions,..._],T=!h[l.symbols.arraySingle];delete h[l.symbols.arraySingle];const E=x();let P=h.length;for(let k=0;k<P;++k){const M=h[k];let I=!1,j=!1;const L=T?k:new Number(k),H=[...g.path,L];if(!m._flags.sparse&&M===void 0){if(E.push(y("array.sparse",{key:L,path:H,pos:k,value:void 0},g.localize(H))),v.abortEarly)return E;A.shift();continue}const K=[h,...g.ancestors];for(const ne of m.$_terms._exclusions)if(ne.$_match(M,g.localize(H,K,ne),v,{presence:"ignore"})){if(E.push(y("array.excludes",{pos:k,value:M},g.localize(H))),v.abortEarly)return E;I=!0,A.shift();break}if(I)continue;if(m.$_terms.ordered.length){if(A.length){const ne=A.shift(),X=ne.$_validate(M,g.localize(H,K,ne),v);if(X.errors){if(E.push(...X.errors),v.abortEarly)return E}else if(ne._flags.result==="strip")p.fastSplice(h,k),--k,--P;else{if(!m._flags.sparse&&X.value===void 0){if(E.push(y("array.sparse",{key:L,path:H,pos:k,value:void 0},g.localize(H))),v.abortEarly)return E;continue}h[k]=X.value}continue}if(!m.$_terms.items.length){if(E.push(y("array.orderedLength",{pos:k,limit:m.$_terms.ordered.length})),v.abortEarly)return E;break}}const V=[];let U=_.length;for(let ne=0;ne<U;++ne){const X=g.localize(H,K,_[ne]);X.snapshot();const G=_[ne].$_validate(M,X,v);if(V[ne]=G,!G.errors){if(X.commit(),h[k]=G.value,j=!0,p.fastSplice(_,ne),--ne,--U,!m._flags.sparse&&G.value===void 0&&(E.push(y("array.sparse",{key:L,path:H,pos:k,value:void 0},g.localize(H))),v.abortEarly))return E;break}X.restore()}if(j)continue;const Q=v.stripUnknown&&!!v.stripUnknown.arrays||!1;U=N.length;for(const ne of N){let X;const G=_.indexOf(ne);if(G!==-1)X=V[G];else{const Y=g.localize(H,K,ne);if(Y.snapshot(),X=ne.$_validate(M,Y,v),!X.errors){Y.commit(),ne._flags.result==="strip"?(p.fastSplice(h,k),--k,--P):m._flags.sparse||X.value!==void 0?h[k]=X.value:(E.push(y("array.sparse",{key:L,path:H,pos:k,value:void 0},g.localize(H))),I=!0),j=!0;break}Y.restore()}if(U===1){if(Q){p.fastSplice(h,k),--k,--P,j=!0;break}if(E.push(...X.errors),v.abortEarly)return E;I=!0;break}}if(!I&&(m.$_terms._inclusions.length||m.$_terms._requireds.length)&&!j){if(Q){p.fastSplice(h,k),--k,--P;continue}if(E.push(y("array.includes",{pos:k,value:M},g.localize(H))),v.abortEarly)return E}}return _.length&&p.fillMissedErrors(m,E,_,h,g,v),A.length&&(p.fillOrderedErrors(m,E,A,h,g,v),E.length||p.fillDefault(A,h,g,v)),E.length?E:h},priority:!0,manifest:!1},length:{method(h){return this.$_addRule({name:"length",args:{limit:h},operator:"="})},validate:(h,m,{limit:y},{name:g,operator:v,args:x})=>l.compare(h.length,y,v)?h:m.error("array."+g,{limit:x.limit,value:h}),args:[{name:"limit",ref:!0,assert:l.limit,message:"must be a positive integer"}]},max:{method(h){return this.$_addRule({name:"max",method:"length",args:{limit:h},operator:"<="})}},min:{method(h){return this.$_addRule({name:"min",method:"length",args:{limit:h},operator:">="})}},ordered:{method(...h){l.verifyFlat(h,"ordered");const m=this.$_addRule("items");for(let y=0;y<h.length;++y){const g=l.tryWithPath(()=>this.$_compile(h[y]),y,{append:!0});p.validateSingle(g,m),m.$_mutateRegister(g),m.$_terms.ordered.push(g)}return m.$_mutateRebuild()}},single:{method(h){const m=h===void 0||!!h;return a(!m||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",m)}},sort:{method(h={}){l.assertOptions(h,["by","order"]);const m={order:h.order||"ascending"};return h.by&&(m.by=d.ref(h.by,{ancestor:0}),a(!m.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:m}})},validate(h,{error:m,state:y,prefs:g,schema:v},{options:x}){const{value:_,errors:A}=p.sort(v,h,x,y,g);if(A)return A;for(let N=0;N<h.length;++N)if(h[N]!==_[N])return m("array.sort",{order:x.order,by:x.by?x.by.key:"value"});return h},convert:!0},sparse:{method(h){const m=h===void 0||!!h;return this._flags.sparse===m?this:(m?this.clone():this.$_addRule("items")).$_setFlag("sparse",m,{clone:!1})}},unique:{method(h,m={}){a(!h||typeof h=="function"||typeof h=="string","comparator must be a function or a string"),l.assertOptions(m,["ignoreUndefined","separator"]);const y={name:"unique",args:{options:m,comparator:h}};if(h)if(typeof h=="string"){const g=l.default(m.separator,".");y.path=g?h.split(g):[h]}else y.comparator=h;return this.$_addRule(y)},validate(h,{state:m,error:y,schema:g},{comparator:v,options:x},{comparator:_,path:A}){const N={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},T=_||c,E=x.ignoreUndefined;for(let P=0;P<h.length;++P){const k=A?u(h[P],A):h[P],M=_?N.custom:N[typeof k];if(a(M,"Failed to find unique map container for type",typeof k),M instanceof Map){const I=M.entries();let j;for(;!(j=I.next()).done;)if(T(j.value[0],k)){const L=m.localize([...m.path,P],[h,...m.ancestors]),H={pos:P,value:h[P],dupePos:j.value[1],dupeValue:h[j.value[1]]};return A&&(H.path=v),y("array.unique",H,L)}M.set(k,P)}else{if((!E||k!==void 0)&&M[k]!==void 0){const I={pos:P,value:h[P],dupePos:M[k],dupeValue:h[M[k]]};return A&&(I.path=v),y("array.unique",I,m.localize([...m.path,P],[h,...m.ancestors]))}M[k]=P}}return h},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(h,m)=>new Set(h)}},rebuild(h){h.$_terms._inclusions=[],h.$_terms._exclusions=[],h.$_terms._requireds=[];for(const m of h.$_terms.items)p.validateSingle(m,h),m._flags.presence==="required"?h.$_terms._requireds.push(m):m._flags.presence==="forbidden"?h.$_terms._exclusions.push(m):h.$_terms._inclusions.push(m);for(const m of h.$_terms.ordered)p.validateSingle(m,h)},manifest:{build:(h,m)=>(m.items&&(h=h.items(...m.items)),m.ordered&&(h=h.ordered(...m.ordered)),h)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),p.fillMissedErrors=function(h,m,y,g,v,x){const _=[];let A=0;for(const N of y){const T=N._flags.label;T?_.push(T):++A}_.length?A?m.push(h.$_createError("array.includesRequiredBoth",g,{knownMisses:_,unknownMisses:A},v,x)):m.push(h.$_createError("array.includesRequiredKnowns",g,{knownMisses:_},v,x)):m.push(h.$_createError("array.includesRequiredUnknowns",g,{unknownMisses:A},v,x))},p.fillOrderedErrors=function(h,m,y,g,v,x){const _=[];for(const A of y)A._flags.presence==="required"&&_.push(A);_.length&&p.fillMissedErrors(h,m,_,g,v,x)},p.fillDefault=function(h,m,y,g){const v=[];let x=!0;for(let _=h.length-1;_>=0;--_){const A=h[_],N=[m,...y.ancestors],T=A.$_validate(void 0,y.localize(y.path,N,A),g).value;if(x){if(T===void 0)continue;x=!1}v.unshift(T)}v.length&&m.push(...v)},p.fastSplice=function(h,m){let y=m;for(;y<h.length;)h[y++]=h[y];--h.length},p.validateSingle=function(h,m){(h.type==="array"||h._flags._arrayItems)&&(a(!m._flags.single,"Cannot specify array item with single rule enabled"),m.$_setFlag("_arrayItems",!0,{clone:!1}))},p.sort=function(h,m,y,g,v){const x=y.order==="ascending"?1:-1,_=-1*x,A=x,N=(T,E)=>{let P=p.compare(T,E,_,A);if(P!==null||(y.by&&(T=y.by.resolve(T,g,v),E=y.by.resolve(E,g,v)),P=p.compare(T,E,_,A),P!==null))return P;const k=typeof T;if(k!==typeof E)throw h.$_createError("array.sort.mismatching",m,null,g,v);if(k!=="number"&&k!=="string")throw h.$_createError("array.sort.unsupported",m,{type:k},g,v);return k==="number"?(T-E)*x:T<E?_:A};try{return{value:m.slice().sort(N)}}catch(T){return{errors:T}}},p.compare=function(h,m,y,g){return h===m?0:h===void 0?1:m===void 0?-1:h===null?g:m===null?y:null}},4937:(s,i,o)=>{const a=o(375),c=o(8068),u=o(8160),f=o(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:p}){if(typeof d!="boolean"){if(typeof d=="string"){const h=p._flags.sensitive?d:d.toLowerCase();d=h==="true"||h!=="false"&&d}return typeof d!="boolean"&&(d=p.$_terms.truthy&&p.$_terms.truthy.has(d,null,null,!p._flags.sensitive)||(!p.$_terms.falsy||!p.$_terms.falsy.has(d,null,null,!p._flags.sensitive))&&d),{value:d}}},validate(d,{error:p}){if(typeof d!="boolean")return{value:d,errors:p("boolean.base")}},rules:{truthy:{method(...d){u.verifyFlat(d,"truthy");const p=this.clone();p.$_terms.truthy=p.$_terms.truthy||new f;for(let h=0;h<d.length;++h){const m=d[h];a(m!==void 0,"Cannot call truthy with undefined"),p.$_terms.truthy.add(m)}return p}},falsy:{method(...d){u.verifyFlat(d,"falsy");const p=this.clone();p.$_terms.falsy=p.$_terms.falsy||new f;for(let h=0;h<d.length;++h){const m=d[h];a(m!==void 0,"Cannot call falsy with undefined"),p.$_terms.falsy.add(m)}return p}},sensitive:{method(d=!0){return this.$_setFlag("sensitive",d)}}},cast:{number:{from:l.isBool,to:(d,p)=>d?1:0},string:{from:l.isBool,to:(d,p)=>d?"true":"false"}},manifest:{build:(d,p)=>(p.truthy&&(d=d.truthy(...p.truthy)),p.falsy&&(d=d.falsy(...p.falsy)),d)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(s,i,o)=>{const a=o(375),c=o(8068),u=o(8160),f=o(3328),l={isDate:function(d){return d instanceof Date}};s.exports=c.extend({type:"date",coerce:{from:["number","string"],method:(d,{schema:p})=>({value:l.parse(d,p._flags.format)||d})},validate(d,{schema:p,error:h,prefs:m}){if(d instanceof Date&&!isNaN(d.getTime()))return;const y=p._flags.format;return m.convert&&y&&typeof d=="string"?{value:d,errors:h("date.format",{format:y})}:{value:d,errors:h("date.base")}},rules:{compare:{method:!1,validate(d,p,{date:h},{name:m,operator:y,args:g}){const v=h==="now"?Date.now():h.getTime();return u.compare(d.getTime(),v,y)?d:p.error("date."+m,{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 a(["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 a(["javascript","unix"].includes(d),'"type" must be one of "javascript, unix"'),this.format(d)}}},cast:{number:{from:l.isDate,to:(d,p)=>d.getTime()},string:{from:l.isDate,to:(d,{prefs:p})=>f.date(d,p)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),l.parse=function(d,p){if(d instanceof Date)return d;if(typeof d!="string"&&(isNaN(d)||!isFinite(d))||/^\s*$/.test(d))return null;if(p==="iso")return u.isIsoDate(d)?l.date(d.toString()):null;const h=d;if(typeof d=="string"&&/^[+-]?\d+(\.\d+)?$/.test(d)&&(d=parseFloat(d)),p){if(p==="javascript")return l.date(1*d);if(p==="unix")return l.date(1e3*d);if(typeof h=="string")return null}return l.date(d)},l.date=function(d){const p=new Date(d);return isNaN(p.getTime())?null:p}},390:(s,i,o)=>{const a=o(375),c=o(7824);s.exports=c.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(u){return a(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 a(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 a(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,o)=>{const a=o(978),c=o(375),u=o(8571),f=o(3652),l=o(8068),d=o(8160),p=o(3292),h=o(6354),m=o(6133),y=o(3328),g={renameDefaults:{alias:!1,multiple:!1,override:!1}};s.exports=l.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:void 0}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(v,x)=>v.keys(x),validate(v,{schema:x,error:_,state:A,prefs:N}){if(!v||typeof v!==x.$_property("typeof")||Array.isArray(v))return{value:v,errors:_("object.base",{type:x.$_property("typeof")})};if(!(x.$_terms.renames||x.$_terms.dependencies||x.$_terms.keys||x.$_terms.patterns||x.$_terms.externals))return;v=g.clone(v,N);const T=[];if(x.$_terms.renames&&!g.rename(x,v,A,N,T))return{value:v,errors:T};if(!x.$_terms.keys&&!x.$_terms.patterns&&!x.$_terms.dependencies)return{value:v,errors:T};const E=new Set(Object.keys(v));if(x.$_terms.keys){const P=[v,...A.ancestors];for(const k of x.$_terms.keys){const M=k.key,I=v[M];E.delete(M);const j=A.localize([...A.path,M],P,k),L=k.schema.$_validate(I,j,N);if(L.errors){if(N.abortEarly)return{value:v,errors:L.errors};L.value!==void 0&&(v[M]=L.value),T.push(...L.errors)}else k.schema._flags.result==="strip"||L.value===void 0&&I!==void 0?delete v[M]:L.value!==void 0&&(v[M]=L.value)}}if(E.size||x._flags._hasPatternMatch){const P=g.unknown(x,v,E,T,A,N);if(P)return P}if(x.$_terms.dependencies)for(const P of x.$_terms.dependencies){if(P.key!==null&&g.isPresent(P.options)(P.key.resolve(v,A,N,null,{shadow:!1}))===!1)continue;const k=g.dependencies[P.rel](x,P,v,A,N);if(k){const M=x.$_createError(k.code,v,k.context,A,N);if(N.abortEarly)return{value:v,errors:M};T.push(M)}}return{value:v,errors:T}},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,x,_){y.isTemplate(v)||(v=p.ref(v)),c(_===void 0||typeof _=="string","Message must be a string"),x=this.$_compile(x,{appendPath:!0});const A=this.$_addRule({name:"assert",args:{subject:v,schema:x,message:_}});return A.$_mutateRegister(v),A.$_mutateRegister(x),A},validate(v,{error:x,prefs:_,state:A},{subject:N,schema:T,message:E}){const P=N.resolve(v,A,_),k=m.isRef(N)?N.absolute(A):[];return T.$_match(P,A.localize(k,[v,...A.ancestors],T),_)?v:x("object.assert",{subject:N,message:E})},args:["subject","schema","message"],multi:!0},instance:{method(v,x){return c(typeof v=="function","constructor must be a function"),x=x||v.name,this.$_addRule({name:"instance",args:{constructor:v,name:x}})},validate:(v,x,{constructor:_,name:A})=>v instanceof _?v:x.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 x=this.clone();if(v)if(Object.keys(v).length){x.$_terms.keys=x.$_terms.keys?x.$_terms.keys.filter(_=>!v.hasOwnProperty(_.key)):new g.Keys;for(const _ in v)d.tryWithPath(()=>x.$_terms.keys.push({key:_,schema:this.$_compile(v[_])}),_)}else x.$_terms.keys=new g.Keys;else x.$_terms.keys=null;return x.$_mutateRebuild()}},length:{method(v){return this.$_addRule({name:"length",args:{limit:v},operator:"="})},validate:(v,x,{limit:_},{name:A,operator:N,args:T})=>d.compare(Object.keys(v).length,_,N)?v:x.error("object."+A,{limit:T.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,x,_={}){const A=v instanceof RegExp;A||(v=this.$_compile(v,{appendPath:!0})),c(x!==void 0,"Invalid rule"),d.assertOptions(_,["fallthrough","matches"]),A&&c(!v.flags.includes("g")&&!v.flags.includes("y"),"pattern should not use global or sticky mode"),x=this.$_compile(x,{appendPath:!0});const N=this.clone();N.$_terms.patterns=N.$_terms.patterns||[];const T={[A?"regex":"schema"]:v,rule:x};return _.matches&&(T.matches=this.$_compile(_.matches),T.matches.type!=="array"&&(T.matches=T.matches.$_root.array().items(T.matches)),N.$_mutateRegister(T.matches),N.$_setFlag("_hasPatternMatch",!0,{clone:!1})),_.fallthrough&&(T.fallthrough=!0),N.$_terms.patterns.push(T),N.$_mutateRegister(x),N}},ref:{method(){return this.$_addRule("ref")},validate:(v,x)=>m.isRef(v)?v:x.error("object.refType",{value:v})},regex:{method(){return this.$_addRule("regex")},validate:(v,x)=>v instanceof RegExp?v:x.error("object.regex",{value:v})},rename:{method(v,x,_={}){c(typeof v=="string"||v instanceof RegExp,"Rename missing the from argument"),c(typeof x=="string"||x instanceof y,"Invalid rename to argument"),c(x!==v,"Cannot rename key to same name:",v),d.assertOptions(_,["alias","ignoreUndefined","override","multiple"]);const A=this.clone();A.$_terms.renames=A.$_terms.renames||[];for(const N of A.$_terms.renames)c(N.from!==v,"Cannot rename the same key multiple times");return x instanceof y&&A.$_mutateRegister(x),A.$_terms.renames.push({from:v,to:x,options:a(g.renameDefaults,_)}),A}},schema:{method(v="any"){return this.$_addRule({name:"schema",args:{type:v}})},validate:(v,x,{type:_})=>!d.isSchema(v)||_!=="any"&&v.type!==_?x.error("object.schema",{type:_}):v},unknown:{method(v){return this.$_setFlag("unknown",v!==!1)}},with:{method(v,x,_={}){return g.dependency(this,"with",v,x,_)}},without:{method(v,x,_={}){return g.dependency(this,"without",v,x,_)}},xor:{method(...v){return d.verifyFlat(v,"xor"),g.dependency(this,"xor",null,v)}}},overrides:{default(v,x){return v===void 0&&(v=d.symbols.deepDefault),this.$_parent("default",v,x)}},rebuild(v){if(v.$_terms.keys){const x=new f.Sorter;for(const _ of v.$_terms.keys)d.tryWithPath(()=>x.add(_,{after:_.schema.$_rootReferences(),group:_.key}),_.key);v.$_terms.keys=new g.Keys(...x.nodes)}},manifest:{build(v,x){if(x.keys&&(v=v.keys(x.keys)),x.dependencies)for(const{rel:_,key:A=null,peers:N,options:T}of x.dependencies)v=g.dependency(v,_,A,N,T);if(x.patterns)for(const{regex:_,schema:A,rule:N,fallthrough:T,matches:E}of x.patterns)v=v.pattern(_||A,N,{fallthrough:T,matches:E});if(x.renames)for(const{from:_,to:A,options:N}of x.renames)v=v.rename(_,A,N);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,x){if(typeof v=="object"){if(x.nonEnumerables)return u(v,{shallow:!0});const A=Object.create(Object.getPrototypeOf(v));return Object.assign(A,v),A}const _=function(...A){return v.apply(this,A)};return _.prototype=u(v.prototype),Object.defineProperty(_,"name",{value:v.name,writable:!1}),Object.defineProperty(_,"length",{value:v.length,writable:!1}),Object.assign(_,v),_},g.dependency=function(v,x,_,A,N){c(_===null||typeof _=="string",x,"key must be a strings"),N||(N=A.length>1&&typeof A[A.length-1]=="object"?A.pop():{}),d.assertOptions(N,["separator","isPresent"]),A=[].concat(A);const T=d.default(N.separator,"."),E=[];for(const k of A)c(typeof k=="string",x,"peers must be strings"),E.push(p.ref(k,{separator:T,ancestor:0,prefix:!1}));_!==null&&(_=p.ref(_,{separator:T,ancestor:0,prefix:!1}));const P=v.clone();return P.$_terms.dependencies=P.$_terms.dependencies||[],P.$_terms.dependencies.push(new g.Dependency(x,_,E,A,N)),P},g.dependencies={and(v,x,_,A,N){const T=[],E=[],P=x.peers.length,k=g.isPresent(x.options);for(const M of x.peers)k(M.resolve(_,A,N,null,{shadow:!1}))===!1?T.push(M.key):E.push(M.key);if(T.length!==P&&E.length!==P)return{code:"object.and",context:{present:E,presentWithLabels:g.keysToLabels(v,E),missing:T,missingWithLabels:g.keysToLabels(v,T)}}},nand(v,x,_,A,N){const T=[],E=g.isPresent(x.options);for(const M of x.peers)E(M.resolve(_,A,N,null,{shadow:!1}))&&T.push(M.key);if(T.length!==x.peers.length)return;const P=x.paths[0],k=x.paths.slice(1);return{code:"object.nand",context:{main:P,mainWithLabel:g.keysToLabels(v,P),peers:k,peersWithLabels:g.keysToLabels(v,k)}}},or(v,x,_,A,N){const T=g.isPresent(x.options);for(const E of x.peers)if(T(E.resolve(_,A,N,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:x.paths,peersWithLabels:g.keysToLabels(v,x.paths)}}},oxor(v,x,_,A,N){const T=[],E=g.isPresent(x.options);for(const k of x.peers)E(k.resolve(_,A,N,null,{shadow:!1}))&&T.push(k.key);if(!T.length||T.length===1)return;const P={peers:x.paths,peersWithLabels:g.keysToLabels(v,x.paths)};return P.present=T,P.presentWithLabels=g.keysToLabels(v,T),{code:"object.oxor",context:P}},with(v,x,_,A,N){const T=g.isPresent(x.options);for(const E of x.peers)if(T(E.resolve(_,A,N,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:x.key.key,mainWithLabel:g.keysToLabels(v,x.key.key),peer:E.key,peerWithLabel:g.keysToLabels(v,E.key)}}},without(v,x,_,A,N){const T=g.isPresent(x.options);for(const E of x.peers)if(T(E.resolve(_,A,N,null,{shadow:!1})))return{code:"object.without",context:{main:x.key.key,mainWithLabel:g.keysToLabels(v,x.key.key),peer:E.key,peerWithLabel:g.keysToLabels(v,E.key)}}},xor(v,x,_,A,N){const T=[],E=g.isPresent(x.options);for(const k of x.peers)E(k.resolve(_,A,N,null,{shadow:!1}))&&T.push(k.key);if(T.length===1)return;const P={peers:x.paths,peersWithLabels:g.keysToLabels(v,x.paths)};return T.length===0?{code:"object.missing",context:P}:(P.present=T,P.presentWithLabels=g.keysToLabels(v,T),{code:"object.xor",context:P})}},g.keysToLabels=function(v,x){return Array.isArray(x)?x.map(_=>v.$_mapLabels(_)):v.$_mapLabels(x)},g.isPresent=function(v){return typeof v.isPresent=="function"?v.isPresent:x=>x!==void 0},g.rename=function(v,x,_,A,N){const T={};for(const E of v.$_terms.renames){const P=[],k=typeof E.from!="string";if(k)for(const M in x){if(x[M]===void 0&&E.options.ignoreUndefined||M===E.to)continue;const I=E.from.exec(M);I&&P.push({from:M,to:E.to,match:I})}else!Object.prototype.hasOwnProperty.call(x,E.from)||x[E.from]===void 0&&E.options.ignoreUndefined||P.push(E);for(const M of P){const I=M.from;let j=M.to;if(j instanceof y&&(j=j.render(x,_,A,M.match)),I!==j){if(!E.options.multiple&&T[j]&&(N.push(v.$_createError("object.rename.multiple",x,{from:I,to:j,pattern:k},_,A)),A.abortEarly)||Object.prototype.hasOwnProperty.call(x,j)&&!E.options.override&&!T[j]&&(N.push(v.$_createError("object.rename.override",x,{from:I,to:j,pattern:k},_,A)),A.abortEarly))return!1;x[I]===void 0?delete x[j]:x[j]=x[I],T[j]=!0,E.options.alias||delete x[I]}}}return!0},g.unknown=function(v,x,_,A,N,T){if(v.$_terms.patterns){let E=!1;const P=v.$_terms.patterns.map(M=>{if(M.matches)return E=!0,[]}),k=[x,...N.ancestors];for(const M of _){const I=x[M],j=[...N.path,M];for(let L=0;L<v.$_terms.patterns.length;++L){const H=v.$_terms.patterns[L];if(H.regex){const U=H.regex.test(M);if(N.mainstay.tracer.debug(N,"rule",`pattern.${L}`,U?"pass":"error"),!U)continue}else if(!H.schema.$_match(M,N.nest(H.schema,`pattern.${L}`),T))continue;_.delete(M);const K=N.localize(j,k,{schema:H.rule,key:M}),V=H.rule.$_validate(I,K,T);if(V.errors){if(T.abortEarly)return{value:x,errors:V.errors};A.push(...V.errors)}if(H.matches&&P[L].push(M),x[M]=V.value,!H.fallthrough)break}}if(E)for(let M=0;M<P.length;++M){const I=P[M];if(!I)continue;const j=v.$_terms.patterns[M].matches,L=N.localize(N.path,k,j),H=j.$_validate(I,L,T);if(H.errors){const K=h.details(H.errors,{override:!1});K.matches=I;const V=v.$_createError("object.pattern.match",x,K,N,T);if(T.abortEarly)return{value:x,errors:V};A.push(V)}}}if(_.size&&(v.$_terms.keys||v.$_terms.patterns)){if(T.stripUnknown&&v._flags.unknown===void 0||T.skipFunctions){const E=!(!T.stripUnknown||T.stripUnknown!==!0&&!T.stripUnknown.objects);for(const P of _)E?(delete x[P],_.delete(P)):typeof x[P]=="function"&&_.delete(P)}if(!d.default(v._flags.unknown,T.allowUnknown))for(const E of _){const P=N.localize([...N.path,E],[]),k=v.$_createError("object.unknown",x[E],{child:E},P,T,{flags:!1});if(T.abortEarly)return{value:x,errors:k};A.push(k)}}},g.Dependency=class{constructor(v,x,_,A,N){this.rel=v,this.key=x,this.peers=_,this.paths=A,this.options=N}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 x=this.slice(),_=new Map;for(let A=0;A<x.length;++A)_.set(x[A].key,A);for(const A of v){const N=A.key,T=_.get(N);T!==void 0?x[T]={key:N,schema:x[T].schema.concat(A.schema)}:x.push(A)}return x}}},8785:(s,i,o)=>{const a=o(375),c=o(8068),u=o(8160),f=o(3292),l=o(6354),d={};s.exports=c.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(p,h)=>p.ref(h),validate(p,{schema:h,state:m,prefs:y}){a(h.$_terms.link,"Uninitialized link schema");const g=d.generate(h,p,m,y),v=h.$_terms.link[0].ref;return g.$_validate(p,m.nest(g,`link:${v.display}:${g.type}`),y)},generate:(p,h,m,y)=>d.generate(p,h,m,y),rules:{ref:{method(p){a(!this.$_terms.link,"Cannot reinitialize schema"),p=f.ref(p),a(p.type==="value"||p.type==="local","Invalid reference type:",p.type),a(p.type==="local"||p.ancestor==="root"||p.ancestor>0,"Link cannot reference itself");const h=this.clone();return h.$_terms.link=[{ref:p}],h}},relative:{method(p=!0){return this.$_setFlag("relative",p)}}},overrides:{concat(p){a(this.$_terms.link,"Uninitialized link schema"),a(u.isSchema(p),"Invalid schema object"),a(p.type!=="link","Cannot merge type link with another link");const h=this.clone();return h.$_terms.whens||(h.$_terms.whens=[]),h.$_terms.whens.push({concat:p}),h.$_mutateRebuild()}},manifest:{build:(p,h)=>(a(h.link,"Invalid link description missing link"),p.ref(h.link))}}),d.generate=function(p,h,m,y){let g=m.mainstay.links.get(p);if(g)return g._generate(h,m,y).schema;const v=p.$_terms.link[0].ref,{perspective:x,path:_}=d.perspective(v,m);d.assert(x,"which is outside of schema boundaries",v,p,m,y);try{g=_.length?x.$_reach(_):x}catch{d.assert(!1,"to non-existing schema",v,p,m,y)}return d.assert(g.type!=="link","which is another link",v,p,m,y),p._flags.relative||m.mainstay.links.set(p,g),g._generate(h,m,y).schema},d.perspective=function(p,h){if(p.type==="local"){for(const{schema:m,key:y}of h.schemas){if((m._flags.id||y)===p.path[0])return{perspective:m,path:p.path.slice(1)};if(m.$_terms.shared){for(const g of m.$_terms.shared)if(g._flags.id===p.path[0])return{perspective:g,path:p.path.slice(1)}}}return{perspective:null,path:null}}return p.ancestor==="root"?{perspective:h.schemas[h.schemas.length-1].schema,path:p.path}:{perspective:h.schemas[p.ancestor]&&h.schemas[p.ancestor].schema,path:p.path}},d.assert=function(p,h,m,y,g,v){p||a(!1,`"${l.label(y._flags,g,v)}" contains link reference "${m.display}" ${h}`)}},3832:(s,i,o)=>{const a=o(375),c=o(8068),u=o(8160),f={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(l){const d=l.toString(),p=d.indexOf("."),h=d.indexOf("e");return(p<0?0:(h<0?d.length:h)-p-1)+(h<0?0:Math.max(0,-parseInt(d.slice(h+1))))}};s.exports=c.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(l,{schema:d,error:p}){if(!l.match(f.numberRx))return;l=l.trim();const h={value:parseFloat(l)};if(h.value===0&&(h.value=0),!d._flags.unsafe)if(l.match(/e/i)){if(f.extractSignificantDigits(l)!==f.extractSignificantDigits(String(h.value)))return h.errors=p("number.unsafe"),h}else{const m=h.value.toString();if(m.match(/e/i))return h;if(m!==f.normalizeDecimal(l))return h.errors=p("number.unsafe"),h}return h}},validate(l,{schema:d,error:p,prefs:h}){if(l===1/0||l===-1/0)return{value:l,errors:p("number.infinity")};if(!u.isNumber(l))return{value:l,errors:p("number.base")};const m={value:l};if(h.convert){const y=d.$_getRule("precision");if(y){const g=Math.pow(10,y.args.limit);m.value=Math.round(m.value*g)/g}}return m.value===0&&(m.value=0),!d._flags.unsafe&&(l>Number.MAX_SAFE_INTEGER||l<Number.MIN_SAFE_INTEGER)&&(m.errors=p("number.unsafe")),m},rules:{compare:{method:!1,validate:(l,d,{limit:p},{name:h,operator:m,args:y})=>u.compare(l,p,m)?l:d.error("number."+h,{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,p=Math.pow(10,d);return this.$_addRule({name:"multiple",args:{base:l,baseDecimalPlace:d,pfactor:p}})},validate:(l,d,{base:p,baseDecimalPlace:h,pfactor:m},y)=>f.decimalPlaces(l)>h?d.error("number.multiple",{multiple:y.args.base,value:l}):Math.round(m*l)%Math.round(m*p)==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 a(Number.isSafeInteger(l),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:l}})},validate(l,d,{limit:p}){const h=l.toString().match(f.precisionRx);return Math.max((h[1]?h[1].length:0)-(h[2]?parseInt(h[2],10):0),0)<=p?l:d.error("number.precision",{limit:p,value:l})},convert:!0},sign:{method(l){return a(["negative","positive"].includes(l),"Invalid sign",l),this.$_addRule({name:"sign",args:{sign:l}})},validate:(l,d,{sign:p})=>p==="negative"&&l<0||p==="positive"&&l>0?l:d.error(`number.${p}`)},unsafe:{method(l=!0){return a(typeof l=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",l)}}},cast:{string:{from:l=>typeof l=="number",to:(l,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,o)=>{const a=o(7824);s.exports=a.extend({type:"object",cast:{map:{from:c=>c&&typeof c=="object",to:(c,u)=>new Map(Object.entries(c))}}})},7417:(s,i,o)=>{const a=o(375),c=o(5380),u=o(1745),f=o(9959),l=o(6064),d=o(9926),p=o(5752),h=o(8068),m=o(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=h.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(g,{schema:v,state:x,prefs:_}){const A=v.$_getRule("normalize");A&&(g=g.normalize(A.args.form));const N=v.$_getRule("case");N&&(g=N.args.direction==="upper"?g.toLocaleUpperCase():g.toLocaleLowerCase());const T=v.$_getRule("trim");if(T&&T.args.enabled&&(g=g.trim()),v.$_terms.replacements)for(const P of v.$_terms.replacements)g=g.replace(P.pattern,P.replacement);const E=v.$_getRule("hex");if(E&&E.args.options.byteAligned&&g.length%2!=0&&(g=`0${g}`),v.$_getRule("isoDate")){const P=y.isoDate(g);P&&(g=P)}if(v._flags.truncate){const P=v.$_getRule("max");if(P){let k=P.args.limit;if(m.isResolvable(k)&&(k=k.resolve(g,x,_),!m.limit(k)))return{value:g,errors:v.$_createError("any.ref",k,{ref:P.args.limit,arg:"limit",reason:"must be a positive integer"},x,_)};g=g.slice(0,k)}}return{value:g}}},validate(g,{schema:v,error:x}){if(typeof g!="string")return{value:g,errors:x("string.base")};if(g===""){const _=v.$_getRule("min");return _&&_.args.limit===0?void 0:{value:g,errors:x("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(g,v)=>/^[a-zA-Z0-9]+$/.test(g)?g:v.error("string.alphanum")},base64:{method(g={}){return m.assertOptions(g,["paddingRequired","urlSafe"]),g={urlSafe:!1,paddingRequired:!0,...g},a(typeof g.paddingRequired=="boolean","paddingRequired must be boolean"),a(typeof g.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:g}})},validate:(g,v,{options:x})=>y.base64Regex[x.paddingRequired][x.urlSafe].test(g)?g:v.error("string.base64")},case:{method(g){return a(["lower","upper"].includes(g),"Invalid case:",g),this.$_addRule({name:"case",args:{direction:g}})},validate:(g,v,{direction:x})=>x==="lower"&&g===g.toLocaleLowerCase()||x==="upper"&&g===g.toLocaleUpperCase()?g:v.error(`string.${x}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(g,v){let x=g.length,_=0,A=1;for(;x--;){const N=g.charAt(x)*A;_+=N-9*(N>9),A^=3}return _>0&&_%10==0?g:v.error("string.creditCard")}},dataUri:{method(g={}){return m.assertOptions(g,["paddingRequired"]),g={paddingRequired:!0,...g},a(typeof g.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:g}})},validate(g,v,{options:x}){const _=g.match(y.dataUriRegex);return _&&(!_[2]||_[2]!=="base64"||y.base64Regex[x.paddingRequired].false.test(_[3]))?g:v.error("string.dataUri")}},domain:{method(g){g&&m.assertOptions(g,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const v=y.addressOptions(g);return this.$_addRule({name:"domain",args:{options:g},address:v})},validate:(g,v,x,{address:_})=>c.isValid(g,_)?g:v.error("string.domain")},email:{method(g={}){m.assertOptions(g,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),a(g.multiple===void 0||typeof g.multiple=="boolean","multiple option must be an boolean");const v=y.addressOptions(g),x=new RegExp(`\\s*[${g.separator?l(g.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:g},regex:x,address:v})},validate(g,v,{options:x},{regex:_,address:A}){const N=x.multiple?g.split(_):[g],T=[];for(const E of N)u.isValid(E,A)||T.push(E);return T.length?v.error("string.email",{value:g,invalids:T}):g}},guid:{alias:"uuid",method(g={}){m.assertOptions(g,["version","separator"]);let v="";if(g.version){const A=[].concat(g.version);a(A.length>=1,"version must have at least 1 valid version specified");const N=new Set;for(let T=0;T<A.length;++T){const E=A[T];a(typeof E=="string","version at position "+T+" must be a string");const P=y.guidVersions[E.toLowerCase()];a(P,"version at position "+T+" must be one of "+Object.keys(y.guidVersions).join(", ")),a(!N.has(P),"version at position "+T+" must not be a duplicate"),v+=P,N.add(P)}}a(y.guidSeparators.has(g.separator),'separator must be one of true, false, "-", or ":"');const x=g.separator===void 0?"[:-]?":g.separator===!0?"[:-]":g.separator===!1?"[]?":`\\${g.separator}`,_=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${x})[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:_})},validate(g,v,x,{regex:_}){const A=_.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 m.assertOptions(g,["byteAligned","prefix"]),g={byteAligned:!1,prefix:!1,...g},a(typeof g.byteAligned=="boolean","byteAligned must be boolean"),a(typeof g.prefix=="boolean"||g.prefix==="optional",'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:g}})},validate:(g,v,{options:x})=>(x.prefix==="optional"?y.hexRegex.withOptionalPrefix:x.prefix===!0?y.hexRegex.withPrefix:y.hexRegex.withoutPrefix).test(g)?x.byteAligned&&g.length%2!=0?v.error("string.hexAlign"):g:v.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(g,v)=>c.isValid(g,{minDomainSegments:1})||y.ipRegex.test(g)?g:v.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(g={}){m.assertOptions(g,["cidr","version"]);const{cidr:v,versions:x,regex:_}=f.regex(g),A=g.version?x:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:v,version:A}},regex:_})},validate:(g,v,{options:x},{regex:_})=>_.test(g)?g:x.version?v.error("string.ipVersion",{value:g,cidr:x.cidr,version:x.version}):v.error("string.ip",{value:g,cidr:x.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:x,encoding:_},{name:A,operator:N,args:T}){const E=!_&&g.length;return m.compare(E,x,N)?g:v.error("string."+A,{limit:T.limit,value:g,encoding:_})},args:[{name:"limit",ref:!0,assert:m.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(g,v){return y.length(this,"max",g,"<=",v)},args:["limit","encoding"]},min:{method(g,v){return y.length(this,"min",g,">=",v)},args:["limit","encoding"]},normalize:{method(g="NFC"){return a(y.normalizationForms.includes(g),"normalization form must be one of "+y.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:g}})},validate:(g,{error:v},{form:x})=>g===g.normalize(x)?g:v("string.normalize",{value:g,form:x}),convert:!0},pattern:{alias:"regex",method(g,v={}){a(g instanceof RegExp,"regex must be a RegExp"),a(!g.flags.includes("g")&&!g.flags.includes("y"),"regex should not use global or sticky mode"),typeof v=="string"&&(v={name:v}),m.assertOptions(v,["invert","name"]);const x=["string.pattern",v.invert?".invert":"",v.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:g,options:v},errorCode:x})},validate:(g,v,{regex:x,options:_},{errorCode:A})=>x.test(g)^_.invert?g:v.error(A,{name:_.name,regex:x,value:g}),args:["regex","options"],multi:!0},replace:{method(g,v){typeof g=="string"&&(g=new RegExp(l(g),"g")),a(g instanceof RegExp,"pattern must be a RegExp"),a(typeof v=="string","replacement must be a String");const x=this.clone();return x.$_terms.replacements||(x.$_terms.replacements=[]),x.$_terms.replacements.push({pattern:g,replacement:v}),x}},token:{method(){return this.$_addRule("token")},validate:(g,v)=>/^\w+$/.test(g)?g:v.error("string.token")},trim:{method(g=!0){return a(typeof g=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:g}})},validate:(g,v,{enabled:x})=>x&&g!==g.trim()?v.error("string.trim"):g,convert:!0},truncate:{method(g=!0){return a(typeof g=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",g)}},uppercase:{method(){return this.case("upper")}},uri:{method(g={}){m.assertOptions(g,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),g.domain&&m.assertOptions(g.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:v,scheme:x}=p.regex(g),_=g.domain?y.addressOptions(g.domain):null;return this.$_addRule({name:"uri",args:{options:g},regex:v,domain:_,scheme:x})},validate(g,v,{options:x},{regex:_,domain:A,scheme:N}){if(["http:/","https:/"].includes(g))return v.error("string.uri");let T=_.exec(g);if(!T&&v.prefs.convert&&x.encodeUri){const E=encodeURI(g);T=_.exec(E),T&&(g=E)}if(T){const E=T[1]||T[2];return!A||x.allowRelative&&!E||c.isValid(E,A)?g:v.error("string.domain",{value:E})}return x.relativeOnly?v.error("string.uriRelativeOnly"):x.scheme?v.error("string.uriCustomScheme",{scheme:N,value:g}):v.error("string.uri")}}},manifest:{build(g,v){if(v.replacements)for(const{pattern:x,replacement:_}of v.replacements)g=g.replace(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(a(g.minDomainSegments===void 0||Number.isSafeInteger(g.minDomainSegments)&&g.minDomainSegments>0,"minDomainSegments must be a positive integer"),a(g.maxDomainSegments===void 0||Number.isSafeInteger(g.maxDomainSegments)&&g.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),g.tlds===!1)return g;if(g.tlds===!0||g.tlds===void 0)return a(y.tlds,"Built-in TLD list disabled"),Object.assign({},g,y.tlds);a(typeof g.tlds=="object","tlds must be true, false, or an object");const v=g.tlds.deny;if(v)return Array.isArray(v)&&(g=Object.assign({},g,{tlds:{deny:new Set(v)}})),a(g.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),a(!g.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),y.validateTlds(g.tlds.deny,"tlds.deny"),g;const x=g.tlds.allow;return x?x===!0?(a(y.tlds,"Built-in TLD list disabled"),Object.assign({},g,y.tlds)):(Array.isArray(x)&&(g=Object.assign({},g,{tlds:{allow:new Set(x)}})),a(g.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),y.validateTlds(g.tlds.allow,"tlds.allow"),g):g},y.validateTlds=function(g,v){for(const x of g)a(c.isValid(x,{minDomainSegments:1,maxDomainSegments:1}),`${v} must contain valid top level domain names`)},y.isoDate=function(g){if(!m.isIsoDate(g))return null;/.*T.*[+-]\d\d$/.test(g)&&(g+="00");const v=new Date(g);return isNaN(v.getTime())?null:v.toISOString()},y.length=function(g,v,x,_,A){return a(!A||!1,"Invalid encoding:",A),g.$_addRule({name:v,method:"length",args:{limit:x,encoding:A},operator:_})}},8826:(s,i,o)=>{const a=o(375),c=o(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 p=l.$_terms.map.get(f);return p&&(f=p),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)),a(f&&f[Symbol.iterator],"Iterable must be an iterable or object");const l=this.clone(),d=[];for(const p of f){a(p&&p[Symbol.iterator],"Entry must be an iterable");const[h,m]=p;a(typeof h!="object"&&typeof h!="function"&&typeof h!="symbol","Key must not be of type object, function, or Symbol"),a(typeof m=="symbol","Value must be a Symbol"),l.$_terms.map.set(h,m),d.push(m)}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,o)=>{const a=o(375),c=o(8571),u=o(738),f=o(9621),l=o(8160),d=o(6354),p=o(493),h={result:Symbol("result")};i.entry=function(m,y,g){let v=l.defaults;g&&(a(g.warnings===void 0,"Cannot override warnings preference in synchronous validation"),a(g.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),v=l.preferences(l.defaults,g));const x=h.entry(m,y,v);a(!x.mainstay.externals.length,"Schema with external rules must use validateAsync()");const _={value:x.value};return x.error&&(_.error=x.error),x.mainstay.warnings.length&&(_.warning=d.details(x.mainstay.warnings)),x.mainstay.debug&&(_.debug=x.mainstay.debug),x.mainstay.artifacts&&(_.artifacts=x.mainstay.artifacts),_},i.entryAsync=async function(m,y,g){let v=l.defaults;g&&(v=l.preferences(l.defaults,g));const x=h.entry(m,y,v),_=x.mainstay;if(x.error)throw _.debug&&(x.error.debug=_.debug),x.error;if(_.externals.length){let N=x.value;const T=[];for(const E of _.externals){const P=E.state.path,k=E.schema.type==="link"?_.links.get(E.schema):null;let M,I,j=N;const L=P.length?[N]:[],H=P.length?f(m,P):m;if(P.length){M=P[P.length-1];let K=N;for(const V of P.slice(0,-1))K=K[V],L.unshift(K);I=L[0],j=I[M]}try{const K=(U,Q)=>(k||E.schema).$_createError(U,j,Q,E.state,v),V=await E.method(j,{schema:E.schema,linked:k,state:E.state,prefs:g,original:H,error:K,errorsArray:h.errorsArray,warn:(U,Q)=>_.warnings.push((k||E.schema).$_createError(U,j,Q,E.state,v)),message:(U,Q)=>(k||E.schema).$_createError("external",j,Q,E.state,v,{messages:U})});if(V===void 0||V===j)continue;if(V instanceof d.Report){if(_.tracer.log(E.schema,E.state,"rule","external","error"),T.push(V),v.abortEarly)break;continue}if(Array.isArray(V)&&V[l.symbols.errors]){if(_.tracer.log(E.schema,E.state,"rule","external","error"),T.push(...V),v.abortEarly)break;continue}I?(_.tracer.value(E.state,"rule",j,V,"external"),I[M]=V):(_.tracer.value(E.state,"rule",N,V,"external"),N=V)}catch(K){throw v.errors.label&&(K.message+=` (${E.label})`),K}}if(x.value=N,T.length)throw x.error=d.process(T,m,v),_.debug&&(x.error.debug=_.debug),x.error}if(!v.warnings&&!v.debug&&!v.artifacts)return x.value;const A={value:x.value};return _.warnings.length&&(A.warning=d.details(_.warnings)),_.debug&&(A.debug=_.debug),_.artifacts&&(A.artifacts=_.artifacts),A},h.Mainstay=class{constructor(m,y,g){this.externals=[],this.warnings=[],this.tracer=m,this.debug=y,this.links=g,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const m=this._snapshots.pop();this.externals=m.externals,this.warnings=m.warnings}commit(){this._snapshots.pop()}},h.entry=function(m,y,g){const{tracer:v,cleanup:x}=h.tracer(y,g),_=g.debug?[]:null,A=y._ids._schemaChain?new Map:null,N=new h.Mainstay(v,_,A),T=y._ids._schemaChain?[{schema:y}]:null,E=new p([],[],{mainstay:N,schemas:T}),P=i.validate(m,y,E,g);x&&y.$_root.untrace();const k=d.process(P.errors,m,g);return{value:P.value,error:k,mainstay:N}},h.tracer=function(m,y){return m.$_root._tracer?{tracer:m.$_root._tracer._register(m)}:y.debug?(a(m.$_root.trace,"Debug mode not supported"),{tracer:m.$_root.trace()._register(m),cleanup:!0}):{tracer:h.ignore}},i.validate=function(m,y,g,v,x={}){if(y.$_terms.whens&&(y=y._generate(m,g,v).schema),y._preferences&&(v=h.prefs(y,v)),y._cache&&v.cache){const k=y._cache.get(m);if(g.mainstay.tracer.debug(g,"validate","cached",!!k),k)return k}const _=(k,M,I)=>y.$_createError(k,m,M,I||g,v),A={original:m,prefs:v,schema:y,state:g,error:_,errorsArray:h.errorsArray,warn:(k,M,I)=>g.mainstay.warnings.push(_(k,M,I)),message:(k,M)=>y.$_createError("custom",m,M,g,v,{messages:k})};g.mainstay.tracer.entry(y,g);const N=y._definition;if(N.prepare&&m!==void 0&&v.convert){const k=N.prepare(m,A);if(k){if(g.mainstay.tracer.value(g,"prepare",m,k.value),k.errors)return h.finalize(k.value,[].concat(k.errors),A);m=k.value}}if(N.coerce&&m!==void 0&&v.convert&&(!N.coerce.from||N.coerce.from.includes(typeof m))){const k=N.coerce.method(m,A);if(k){if(g.mainstay.tracer.value(g,"coerced",m,k.value),k.errors)return h.finalize(k.value,[].concat(k.errors),A);m=k.value}}const T=y._flags.empty;T&&T.$_match(h.trim(m,y),g.nest(T),l.defaults)&&(g.mainstay.tracer.value(g,"empty",m,void 0),m=void 0);const E=x.presence||y._flags.presence||(y._flags._endedSwitch?null:v.presence);if(m===void 0){if(E==="forbidden")return h.finalize(m,null,A);if(E==="required")return h.finalize(m,[y.$_createError("any.required",m,null,g,v)],A);if(E==="optional"){if(y._flags.default!==l.symbols.deepDefault)return h.finalize(m,null,A);g.mainstay.tracer.value(g,"default",m,{}),m={}}}else if(E==="forbidden")return h.finalize(m,[y.$_createError("any.unknown",m,null,g,v)],A);const P=[];if(y._valids){const k=y._valids.get(m,g,v,y._flags.insensitive);if(k)return v.convert&&(g.mainstay.tracer.value(g,"valids",m,k.value),m=k.value),g.mainstay.tracer.filter(y,g,"valid",k),h.finalize(m,null,A);if(y._flags.only){const M=y.$_createError("any.only",m,{valids:y._valids.values({display:!0})},g,v);if(v.abortEarly)return h.finalize(m,[M],A);P.push(M)}}if(y._invalids){const k=y._invalids.get(m,g,v,y._flags.insensitive);if(k){g.mainstay.tracer.filter(y,g,"invalid",k);const M=y.$_createError("any.invalid",m,{invalids:y._invalids.values({display:!0})},g,v);if(v.abortEarly)return h.finalize(m,[M],A);P.push(M)}}if(N.validate){const k=N.validate(m,A);if(k&&(g.mainstay.tracer.value(g,"base",m,k.value),m=k.value,k.errors)){if(!Array.isArray(k.errors))return P.push(k.errors),h.finalize(m,P,A);if(k.errors.length)return P.push(...k.errors),h.finalize(m,P,A)}}return y._rules.length?h.rules(m,P,A):h.finalize(m,P,A)},h.rules=function(m,y,g){const{schema:v,state:x,prefs:_}=g;for(const A of v._rules){const N=v._definition.rules[A.method];if(N.convert&&_.convert){x.mainstay.tracer.log(v,x,"rule",A.name,"full");continue}let T,E=A.args;if(A._resolve.length){E=Object.assign({},E);for(const k of A._resolve){const M=N.argsByName.get(k),I=E[k].resolve(m,x,_),j=M.normalize?M.normalize(I):I,L=l.validateArg(j,null,M);if(L){T=v.$_createError("any.ref",I,{arg:k,ref:E[k],reason:L},x,_);break}E[k]=j}}T=T||N.validate(m,g,E,A);const P=h.rule(T,A);if(P.errors){if(x.mainstay.tracer.log(v,x,"rule",A.name,"error"),A.warn){x.mainstay.warnings.push(...P.errors);continue}if(_.abortEarly)return h.finalize(m,P.errors,g);y.push(...P.errors)}else x.mainstay.tracer.log(v,x,"rule",A.name,"pass"),x.mainstay.tracer.value(x,"rule",m,P.value,A.name),m=P.value}return h.finalize(m,y,g)},h.rule=function(m,y){return m instanceof d.Report?(h.error(m,y),{errors:[m],value:null}):Array.isArray(m)&&m[l.symbols.errors]?(m.forEach(g=>h.error(g,y)),{errors:m,value:null}):{errors:null,value:m}},h.error=function(m,y){return y.message&&m._setTemplate(y.message),m},h.finalize=function(m,y,g){y=y||[];const{schema:v,state:x,prefs:_}=g;if(y.length){const N=h.default("failover",void 0,y,g);N!==void 0&&(x.mainstay.tracer.value(x,"failover",m,N),m=N,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 N of y)a(N instanceof Error||N instanceof d.Report,"error() must return an Error object")}else y=[v._flags.error];if(m===void 0){const N=h.default("default",m,y,g);x.mainstay.tracer.value(x,"default",m,N),m=N}if(v._flags.cast&&m!==void 0){const N=v._definition.cast[v._flags.cast];if(N.from(m)){const T=N.to(m,g);x.mainstay.tracer.value(x,"cast",m,T,v._flags.cast),m=T}}if(v.$_terms.externals&&_.externals&&_._externals!==!1)for(const{method:N}of v.$_terms.externals)x.mainstay.externals.push({method:N,schema:v,state:x,label:d.label(v._flags,x,_)});const A={value:m,errors:y.length?y:null};return v._flags.result&&(A.value=v._flags.result==="strip"?void 0:g.original,x.mainstay.tracer.value(x,v._flags.result,m,A.value),x.shadow(m,v._flags.result)),v._cache&&_.cache!==!1&&!v._refs.length&&v._cache.set(g.original,A),m===void 0||A.errors||v._flags.artifact===void 0||(x.mainstay.artifacts=x.mainstay.artifacts||new Map,x.mainstay.artifacts.has(v._flags.artifact)||x.mainstay.artifacts.set(v._flags.artifact,[]),x.mainstay.artifacts.get(v._flags.artifact).push(x.path)),A},h.prefs=function(m,y){const g=y===l.defaults;return g&&m._preferences[l.symbols.prefs]?m._preferences[l.symbols.prefs]:(y=l.preferences(y,m._preferences),g&&(m._preferences[l.symbols.prefs]=y),y)},h.default=function(m,y,g,v){const{schema:x,state:_,prefs:A}=v,N=x._flags[m];if(A.noDefaults||N===void 0)return y;if(_.mainstay.tracer.log(x,_,"rule",m,"full"),!N)return N;if(typeof N=="function"){const T=N.length?[c(_.ancestors[0]),v]:[];try{return N(...T)}catch(E){return void g.push(x.$_createError(`any.${m}`,null,{error:E},_,A))}}return typeof N!="object"?N:N[l.symbols.literal]?N.literal:l.isResolvable(N)?N.resolve(y,_,A):c(N)},h.trim=function(m,y){if(typeof m!="string")return m;const g=y.$_getRule("trim");return g&&g.args.enabled?m.trim():m},h.ignore={active:!1,debug:u,entry:u,filter:u,log:u,resolve:u,value:u},h.errorsArray=function(){const m=[];return m[l.symbols.errors]=!0,m}},2036:(s,i,o)=>{const a=o(375),c=o(9474),u=o(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,p){if(l=l||new f.Values,d){if(d._override)return d.clone();for(const h of[...d._values,...d._refs])l.add(h)}if(p)for(const h of[...p._values,...p._refs])l.remove(h);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,p,h){return!!this.get(l,d,p,h)}get(l,d,p,h){if(!this.length)return!1;if(this._values.has(l))return{value:l};if(typeof l=="string"&&l&&h){const m=this._lowercase.get(l.toLowerCase());if(m)return{value:m}}if(!this._refs.size&&typeof l!="object")return!1;if(typeof l=="object"){for(const m of this._values)if(c(m,l))return{value:m}}if(d)for(const m of this._refs){const y=m.resolve(l,d,p,null,{in:!0});if(y===void 0)continue;const g=m.in&&typeof y=="object"?Array.isArray(y)?y:Object.keys(y):[y];for(const v of g)if(typeof v==typeof l){if(h&&l&&typeof l=="string"){if(v.toLowerCase()===l.toLowerCase())return{value:v,ref:m}}else if(c(v,l))return{value:v,ref:m}}}return!1}override(){this._override=!0}values(l){if(l&&l.display){const d=[];for(const p of[...this._values,...this._refs])p!==void 0&&d.push(p);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){a(!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 p of l)typeof p=="string"&&d.set(p.toLowerCase(),p);return d}},978:(s,i,o)=>{const a=o(375),c=o(8571),u=o(1687),f=o(9621),l={};s.exports=function(d,p,h={}){if(a(d&&typeof d=="object","Invalid defaults value: must be an object"),a(!p||p===!0||typeof p=="object","Invalid source value: must be true, falsy or an object"),a(typeof h=="object","Invalid options: must be an object"),!p)return null;if(h.shallow)return l.applyToDefaultsWithShallow(d,p,h);const m=c(d);if(p===!0)return m;const y=h.nullOverride!==void 0&&h.nullOverride;return u(m,p,{nullOverride:y,mergeArrays:!1})},l.applyToDefaultsWithShallow=function(d,p,h){const m=h.shallow;a(Array.isArray(m),"Invalid keys");const y=new Map,g=p===!0?null:new Set;for(let _ of m){_=Array.isArray(_)?_:_.split(".");const A=f(d,_);A&&typeof A=="object"?y.set(A,g&&f(p,_)||A):g&&g.add(_)}const v=c(d,{},y);if(!g)return v;for(const _ of g)l.reachCopy(v,p,_);const x=h.nullOverride!==void 0&&h.nullOverride;return u(v,p,{nullOverride:x,mergeArrays:!1})},l.reachCopy=function(d,p,h){for(const g of h){if(!(g in p))return;const v=p[g];if(typeof v!="object"||v===null)return;p=v}const m=p;let y=d;for(let g=0;g<h.length-1;++g){const v=h[g];typeof y[v]!="object"&&(y[v]={}),y=y[v]}y[h[h.length-1]]=m}},375:(s,i,o)=>{const a=o(7916);s.exports=function(c,...u){if(!c)throw u.length===1&&u[0]instanceof Error?u[0]:new a(u)}},8571:(s,i,o)=>{const a=o(9621),c=o(4277),u=o(7043),f={needsProtoHack:new Set([c.set,c.map,c.weakSet,c.weakMap])};s.exports=f.clone=function(l,d={},p=null){if(typeof l!="object"||l===null)return l;let h=f.clone,m=p;if(d.shallow){if(d.shallow!==!0)return f.cloneWithShallow(l,d);h=x=>x}else if(m){const x=m.get(l);if(x)return x}else m=new Map;const y=c.getInternalProto(l);if(y===c.buffer)return!1;if(y===c.date)return new Date(l.getTime());if(y===c.regex)return new RegExp(l);const g=f.base(l,y,d);if(g===l)return l;if(m&&m.set(l,g),y===c.set)for(const x of l)g.add(h(x,d,m));else if(y===c.map)for(const[x,_]of l)g.set(x,h(_,d,m));const v=u.keys(l,d);for(const x of v){if(x==="__proto__")continue;if(y===c.array&&x==="length"){g.length=l.length;continue}const _=Object.getOwnPropertyDescriptor(l,x);_?_.get||_.set?Object.defineProperty(g,x,_):_.enumerable?g[x]=h(l[x],d,m):Object.defineProperty(g,x,{enumerable:!1,writable:!0,configurable:!0,value:h(l[x],d,m)}):Object.defineProperty(g,x,{enumerable:!0,writable:!0,configurable:!0,value:h(l[x],d,m)})}return g},f.cloneWithShallow=function(l,d){const p=d.shallow;(d=Object.assign({},d)).shallow=!1;const h=new Map;for(const m of p){const y=a(l,m);typeof y!="object"&&typeof y!="function"||h.set(y,y)}return f.clone(l,d,h)},f.base=function(l,d,p){if(p.prototype===!1)return f.needsProtoHack.has(d)?new d.constructor:d===c.array?[]:{};const h=Object.getPrototypeOf(l);if(h&&h.isImmutable)return l;if(d===c.array){const m=[];return h!==d&&Object.setPrototypeOf(m,h),m}if(f.needsProtoHack.has(d)){const m=new h.constructor;return h!==d&&Object.setPrototypeOf(m,h),m}return Object.create(h)}},9474:(s,i,o)=>{const a=o(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 p=typeof u;if(p!==typeof f||u===null||f===null)return!1;if(p==="function"){if(!l.deepFunction||u.toString()!==f.toString())return!1}else if(p!=="object")return u!=u&&f!=f;const h=c.getSharedType(u,f,!!l.prototype);switch(h){case a.buffer:return!1;case a.promise:return u===f;case a.regex:return u.toString()===f.toString();case c.mismatched:return!1}for(let m=d.length-1;m>=0;--m)if(d[m].isSame(u,f))return!0;d.push(new c.SeenEntry(u,f));try{return!!c.isDeepEqualObj(h,u,f,l,d)}finally{d.pop()}},c.getSharedType=function(u,f,l){if(l)return Object.getPrototypeOf(u)!==Object.getPrototypeOf(f)?c.mismatched:a.getInternalProto(u);const d=a.getInternalProto(u);return d!==a.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,p){const{isDeepEqual:h,valueOf:m,hasOwnEnumerableProperty:y}=c,{keys:g,getOwnPropertySymbols:v}=Object;if(u===a.array){if(!d.part){if(f.length!==l.length)return!1;for(let T=0;T<f.length;++T)if(!h(f[T],l[T],d,p))return!1;return!0}for(const T of f)for(const E of l)if(h(T,E,d,p))return!0}else if(u===a.set){if(f.size!==l.size)return!1;if(!c.isSetSimpleEqual(f,l)){const T=new Set(Set.prototype.values.call(l));for(const E of Set.prototype.values.call(f)){if(T.delete(E))continue;let P=!1;for(const k of T)if(h(E,k,d,p)){T.delete(k),P=!0;break}if(!P)return!1}}}else if(u===a.map){if(f.size!==l.size)return!1;for(const[T,E]of Map.prototype.entries.call(f))if(E===void 0&&!Map.prototype.has.call(l,T)||!h(E,Map.prototype.get.call(l,T),d,p))return!1}else if(u===a.error&&(f.name!==l.name||f.message!==l.message))return!1;const x=m(f),_=m(l);if((f!==x||l!==_)&&!h(x,_,d,p))return!1;const A=g(f);if(!d.part&&A.length!==g(l).length&&!d.skip)return!1;let N=0;for(const T of A)if(d.skip&&d.skip.includes(T))l[T]===void 0&&++N;else if(!y(l,T)||!h(f[T],l[T],d,p))return!1;if(!d.part&&A.length-N!==g(l).length)return!1;if(d.symbols!==!1){const T=v(f),E=new Set(v(l));for(const P of T){if(!d.skip||!d.skip.includes(P)){if(y(f,P)){if(!y(l,P)||!h(f[P],l[P],d,p))return!1}else if(y(l,P))return!1}E.delete(P)}for(const P of E)if(y(l,P))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,o)=>{const a=o(8761);s.exports=class extends Error{constructor(c){super(c.filter(u=>u!=="").map(u=>typeof u=="string"?u:u instanceof Error?u.message:a(u)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,i.assert)}}},5277:s=>{const i={};s.exports=function(o){if(!o)return"";let a="";for(let c=0;c<o.length;++c){const u=o.charCodeAt(c);i.isSafe(u)?a+=o[c]:a+=i.escapeHtmlChar(u)}return a},i.escapeHtmlChar=function(o){return i.namedHtml.get(o)||(o>=256?"&#"+o+";":`&#x${o.toString(16).padStart(2,"0")};`)},i.isSafe=function(o){return i.safeCharCodes.has(o)},i.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),i.safeCharCodes=function(){const o=new Set;for(let a=32;a<123;++a)(a>=97||a>=65&&a<=90||a>=48&&a<=57||a===32||a===46||a===44||a===45||a===58||a===95)&&o.add(a);return o}()},6064:s=>{s.exports=function(i){return i.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:s=>{s.exports=function(){}},1687:(s,i,o)=>{const a=o(375),c=o(8571),u=o(7043),f={};s.exports=f.merge=function(l,d,p){if(a(l&&typeof l=="object","Invalid target value: must be an object"),a(d==null||typeof d=="object","Invalid source value: must be null, undefined, or an object"),!d)return l;if(p=Object.assign({nullOverride:!0,mergeArrays:!0},p),Array.isArray(d)){a(Array.isArray(l),"Cannot merge array onto an object"),p.mergeArrays||(l.length=0);for(let m=0;m<d.length;++m)l.push(c(d[m],{symbols:p.symbols}));return l}const h=u.keys(d,p);for(let m=0;m<h.length;++m){const y=h[m];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:p.symbols}):f.merge(l[y],g,p)}else(g!=null||p.nullOverride)&&(l[y]=g)}return l}},9621:(s,i,o)=>{const a=o(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);a(!d||!l.separator,"Separator option is not valid for array-based chain");const p=d?f:f.split(l.separator||".");let h=u;for(let m=0;m<p.length;++m){let y=p[m];const g=l.iterables&&c.iterables(h);if(Array.isArray(h)||g==="set"){const v=Number(y);Number.isInteger(v)&&(y=v<0?h.length+v:v)}if(!h||typeof h=="function"&&l.functions===!1||!g&&h[y]===void 0){a(!l.strict||m+1===p.length,"Missing segment",y,"in reach path ",f),a(typeof h=="object"||l.functions===!0||typeof h!="function","Invalid segment",y,"in reach path ",f),h=l.default;break}h=g?g==="set"?[...h][y]:h.get(y):h[y]}return h},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(o){return"[Cannot display object: "+o.message+"]"}}},4277:(s,i)=>{const o={};i=s.exports={array:Array.prototype,buffer:!1,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},o.typeMap=new Map([["[object Error]",i.error],["[object Map]",i.map],["[object Promise]",i.promise],["[object Set]",i.set],["[object WeakMap]",i.weakMap],["[object WeakSet]",i.weakSet]]),i.getInternalProto=function(a){if(Array.isArray(a))return i.array;if(a instanceof Date)return i.date;if(a instanceof RegExp)return i.regex;if(a instanceof Error)return i.error;const c=Object.prototype.toString.call(a);return o.typeMap.get(c)||i.generic}},7043:(s,i)=>{i.keys=function(o,a={}){return a.symbols!==!1?Reflect.ownKeys(o):Object.getOwnPropertyNames(o)}},3652:(s,i,o)=>{const a=o(375),c={};i.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(u,f){const l=[].concat((f=f||{}).before||[]),d=[].concat(f.after||[]),p=f.group||"?",h=f.sort||0;a(!l.includes(p),`Item cannot come before itself: ${p}`),a(!l.includes("?"),"Item cannot come before unassociated items"),a(!d.includes(p),`Item cannot come after itself: ${p}`),a(!d.includes("?"),"Item cannot come after unassociated items"),Array.isArray(u)||(u=[u]);for(const m of u){const y={seq:this._items.length,sort:h,before:l,after:d,group:p,node:m};this._items.push(y)}if(!f.manual){const m=this._sort();a(m,"item",p!=="?"?`added into group ${p}`:"","created a dependencies error")}return this.nodes}merge(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 a(f,"merge created a dependencies error"),this.nodes}sort(){const u=this._sort();return a(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 x of y.after)f[x]=f[x]||[],f[x].push(g)}for(const y in u){const g=[];for(const v in u[y]){const x=u[y][v];l[x]=l[x]||[],g.push(...l[x])}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 p={},h=[];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(p[v]===!0)continue;d[v]||(d[v]=[]);const x=d[v].length;let _=0;for(let A=0;A<x;++A)p[d[v][A]]&&++_;if(_===x){g=v;break}}}g!==null&&(p[g]=!0,h.push(g))}if(h.length!==this._items.length)return!1;const m={};for(const y of this._items)m[y.seq]=y;this._items=[],this.nodes=[];for(const y of h){const g=m[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,o)=>{const a=o(443),c=o(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:a.URL||URL};i.analyze=function(f,l={}){if(!f)return c.code("DOMAIN_NON_EMPTY_STRING");if(typeof f!="string")throw new Error("Invalid input: domain must be a string");if(f.length>256)return c.code("DOMAIN_TOO_LONG");if(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,p=f.split(".");if(p.length<d)return c.code("DOMAIN_SEGMENTS_COUNT");if(l.maxDomainSegments&&p.length>l.maxDomainSegments)return c.code("DOMAIN_SEGMENTS_COUNT_MAX");const h=l.tlds;if(h){const m=p[p.length-1].toLowerCase();if(h.deny&&h.deny.has(m)||h.allow&&!h.allow.has(m))return c.code("DOMAIN_FORBIDDEN_TLDS")}for(let m=0;m<p.length;++m){const y=p[m];if(!y.length)return c.code("DOMAIN_EMPTY_SEGMENT");if(y.length>63)return c.code("DOMAIN_LONG_SEGMENT");if(m<p.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,o)=>{const a=o(9848),c=o(5380),u=o(2178),f={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(a.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 p=!f.nonAsciiRx.test(l);if(!p){if(d.allowUnicode===!1)return u.code("FORBIDDEN_UNICODE");l=l.normalize("NFC")}const h=l.split("@");if(h.length!==2)return h.length>2?u.code("MULTIPLE_AT_CHAR"):u.code("MISSING_AT_CHAR");const[m,y]=h;if(!m)return u.code("EMPTY_LOCAL");if(!d.ignoreLength){if(l.length>254)return u.code("ADDRESS_TOO_LONG");if(f.encoder.encode(m).length>64)return u.code("LOCAL_TOO_LONG")}return f.local(m,p)||c.analyze(y,d)},f.local=function(l,d){const p=l.split(".");for(const h of p){if(!h.length)return u.code("EMPTY_LOCAL_SEGMENT");if(d){if(!f.atextRx.test(h))return u.code("INVALID_LOCAL_CHARS")}else for(const m of h){if(f.atextRx.test(m))continue;const y=f.binary(m);if(!f.atomRx.test(y))return 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(o){return{code:o,error:i.codes[o]}}},9959:(s,i,o)=>{const a=o(375),c=o(5752);i.regex=function(u={}){a(u.cidr===void 0||typeof u.cidr=="string","options.cidr must be a string");const f=u.cidr?u.cidr.toLowerCase():"optional";a(["required","optional","forbidden"].includes(f),"options.cidr must be one of required, optional, forbidden"),a(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]),a(l.length>=1,"options.version must have at least 1 version specified");for(let h=0;h<l.length;++h)a(typeof l[h]=="string","options.version must only contain strings"),l[h]=l[h].toLowerCase(),a(["ipv4","ipv6","ipvfuture"].includes(l[h]),"options.version contains unknown version "+l[h]+" - must be one of ipv4, ipv6, ipvfuture");l=Array.from(new Set(l));const d=`(?:${l.map(h=>{if(f==="forbidden")return c.ip[h];const m=`\\/${h==="ipv4"?c.ip.v4Cidr:c.ip.v6Cidr}`;return f==="required"?`${c.ip[h]}${m}`:`${c.ip[h]}(?:${m})?`}).join("|")})`,p=new RegExp(`^${d}$`);return{cidr:f,versions:l,regex:p,raw:d}}},5752:(s,i,o)=>{const a=o(375),c=o(6064),u={generate:function(){const f={},l="\\dA-Fa-f",d="["+l+"]",p="\\w-\\.~",h="!\\$&'\\(\\)\\*\\+,;=",m="%"+l,y=p+m+h+":@",g="["+y+"]",v="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";f.ipv4address="(?:"+v+"\\.){3}"+v;const x=d+"{1,4}",_="(?:"+x+":"+x+"|"+f.ipv4address+")",A="(?:"+x+":){6}"+_,N="::(?:"+x+":){5}"+_,T="(?:"+x+")?::(?:"+x+":){4}"+_,E="(?:(?:"+x+":){0,1}"+x+")?::(?:"+x+":){3}"+_,P="(?:(?:"+x+":){0,2}"+x+")?::(?:"+x+":){2}"+_,k="(?:(?:"+x+":){0,3}"+x+")?::"+x+":"+_,M="(?:(?:"+x+":){0,4}"+x+")?::"+_,I="(?:(?:"+x+":){0,5}"+x+")?::"+x,j="(?:(?:"+x+":){0,6}"+x+")?::";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+"|"+N+"|"+T+"|"+E+"|"+P+"|"+k+"|"+M+"|"+I+"|"+j+")",f.ipvFuture="v"+d+"+\\.["+p+h+":]+",f.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",f.schemeRegex=new RegExp(f.scheme);const L="["+p+m+h+":]*",H="["+p+m+h+"]{1,255}",K="(?:\\[(?:"+f.ipv6address+"|"+f.ipvFuture+")\\]|"+f.ipv4address+"|"+H+")",V="(?:"+L+"@)?"+K+"(?::\\d*)?",U="(?:"+L+"@)?("+K+")(?::\\d*)?",Q=g+"*",ne=g+"+",X="(?:\\/"+Q+")*",G="\\/(?:"+ne+X+")?",Y=ne+X,Z="["+p+m+h+"@]+"+X,he="(?:\\/\\/\\/"+Q+X+")";return f.hierPart="(?:(?:\\/\\/"+V+X+")|"+G+"|"+Y+"|"+he+")",f.hierPartCapture="(?:(?:\\/\\/"+U+X+")|"+G+"|"+Y+")",f.relativeRef="(?:(?:\\/\\/"+V+X+")|"+G+"|"+Z+"|)",f.relativeRefCapture="(?:(?:\\/\\/"+U+X+")|"+G+"|"+Z+"|)",f.query="["+y+"\\/\\?]*(?=#|$)",f.queryWithSquareBrackets="["+y+"\\[\\]\\/\\?]*(?=#|$)",f.fragment="["+y+"\\/\\?]*",f}};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+")?",p=f.domain?l.relativeRefCapture:l.relativeRef;if(f.relativeOnly)return u.wrap(p+d);let h="";if(f.scheme){a(f.scheme instanceof RegExp||typeof f.scheme=="string"||Array.isArray(f.scheme),"scheme must be a RegExp, String, or Array");const g=[].concat(f.scheme);a(g.length>=1,"scheme must have at least 1 scheme specified");const v=[];for(let x=0;x<g.length;++x){const _=g[x];a(_ instanceof RegExp||typeof _=="string","scheme at position "+x+" must be a RegExp or String"),_ instanceof RegExp?v.push(_.source.toString()):(a(l.schemeRegex.test(_),"scheme at position "+x+" must be a valid scheme"),v.push(c(_)))}h=v.join("|")}const m="(?:"+(h?"(?:"+h+")":l.scheme)+":"+(f.domain?l.hierPartCapture:l.hierPart)+")",y=f.allowRelative?"(?:"+m+"|"+p+")":m;return u.wrap(y+d,h)},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 o={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};i.Parser=class{constructor(a,c={}){if(!c[o.settings]&&c.constants)for(const 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[o.settings]?c:Object.assign({[o.settings]:!0,constants:{},functions:{}},c),this.single=null,this._parts=null,this._parse(a)}_parse(a){let c=[],u="",f=0,l=!1;const d=h=>{if(f)throw new Error("Formula missing closing parenthesis");const m=c.length?c[c.length-1]:null;if(l||u||h){if(m&&m.type==="reference"&&h===")")return m.type="function",m.value=this._subFormula(u,m.value),void(u="");if(h===")"){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(o.operatorCharacters.includes(u))m&&m.type==="operator"&&o.operators.includes(m.value+u)?m.value+=u:c.push({type:"operator",value:u});else if(u.match(o.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(o.tokenRx))throw new Error(`Formula contains invalid token: ${u}`);c.push({type:"reference",value:u})}u=""}};for(const h of a)l?h===l?(d(),l=!1):u+=h:f?h==="("?(u+=h,++f):h===")"?(--f,f?u+=h:d(h)):u+=h:h in o.literals?l=o.literals[h]:h==="("?(d(),++f):o.operatorCharacters.includes(h)?(d(),u=h,d()):h!==" "?u+=h:d();d(),c=c.map((h,m)=>h.type!=="operator"||h.value!=="-"||m&&c[m-1].type!=="operator"?h:{type:"operator",value:"n"});let p=!1;for(const h of c){if(h.type==="operator"){if(o.operatorsPrefix.includes(h.value))continue;if(!p)throw new Error("Formula contains an operator in invalid position");if(!o.operators.includes(h.value))throw new Error(`Formula contains an unknown operator ${h.value}`)}else if(p)throw new Error("Formula missing expected operator");p=!p}if(!p)throw new Error("Formula contains invalid trailing operator");c.length===1&&["reference","literal","constant"].includes(c[0].type)&&(this.single={type:c[0].type==="reference"?"reference":"value",value:c[0].value}),this._parts=c.map(h=>{if(h.type==="operator")return o.operatorsPrefix.includes(h.value)?h:h.value;if(h.type!=="reference")return h.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(h.value))throw new Error(`Formula contains invalid reference ${h.value}`);return this.settings.reference?this.settings.reference(h.value):o.reference(h.value)})}_subFormula(a,c){const u=this.settings.functions[c];if(typeof u!="function")throw new Error(`Formula contains unknown function ${c}`);let f=[];if(a){let l="",d=0,p=!1;const h=()=>{if(!l)throw new Error(`Formula contains function ${c} with invalid arguments ${a}`);f.push(l),l=""};for(let m=0;m<a.length;++m){const y=a[m];p?(l+=y,y===p&&(p=!1)):y in o.literals&&!d?(l+=y,p=o.literals[y]):y!==","||d?(l+=y,y==="("?++d:y===")"&&--d):h()}h()}return f=f.map(l=>new i.Parser(l,this.settings)),function(l){const d=[];for(const p of f)d.push(p.evaluate(l));return u.call(l,...d)}}evaluate(a){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=o.evaluate(l,a);c[u]=o.single(f.value,d)}}return o.operatorsOrder.forEach(u=>{for(let f=1;f<c.length-1;)if(u.includes(c[f])){const l=c[f],d=o.evaluate(c[f-1],a),p=o.evaluate(c[f+1],a);c.splice(f,2);const h=o.calculate(l,d,p);c[f-1]=h===0?0:h}else f+=2}),o.evaluate(c[0],a)}},i.Parser.prototype[o.symbol]=!0,o.reference=function(a){return function(c){return c&&c[a]!==void 0?c[a]:null}},o.evaluate=function(a,c){return a===null?null:typeof a=="function"?a(c):a[o.symbol]?a.evaluate(c):a},o.single=function(a,c){if(a==="!")return!c;const u=-c;return u===0?0:u},o.calculate=function(a,c,u){if(a==="??")return o.exists(c)?c:u;if(typeof c=="string"||typeof u=="string"){if(a==="+")return(c=o.exists(c)?c:"")+(o.exists(u)?u:"")}else switch(a){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(a){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},o.exists=function(a){return a!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:s=>{s.exports=JSON.parse('{"version":"17.13.3"}')}},r={},function s(i){var o=r[i];if(o!==void 0)return o.exports;var a=r[i]={exports:{}};return n[i](a,a.exports,s),a.exports}(5107);var n,r})})(iJ);var uOe=iJ.exports;const Kt=_u(uOe),dOe=t=>typeof t=="object"&&t!==null&&t.hasOwnProperty("total_items");class an{constructor(e){Te(this,"_object");Te(this,"_error");Te(this,"isSuccess");Te(this,"isFailure");const{isSuccess:n,error:r,object:s}=e;if(n&&r)throw new Error("InvalidOperation: A result cannot be successful and contain an error");if(!n&&!r)throw new Error("InvalidOperation: A failing result needs to contain an error message");this.isSuccess=n,this.isFailure=!n,this._error=r,this._object=s,Object.freeze(this)}get object(){if(this.isFailure)throw new Error("Result is not successful");return this._object}get error(){if(this.isSuccess)throw new Error("Result is not error");return this._error}static ok(e){return new an({isSuccess:!0,object:e})}static fail(e){return new an({isSuccess:!1,error:e})}static combine(e){for(const n of e)if(n.isFailure)return n;return an.ok()}}class bn{static validate(e,n,r={}){if(!Kt.isSchema(e))throw new fOe("Rule provided is not a valid Joi schema!");const s={abortEarly:!1,errors:{wrap:{label:"{}"}},...r},i=e.validate(n,s);return i.error?an.fail(i.error):an.ok(i.value)}static validateFnc(e){return(n,r)=>{const s=e(n);return s.isSuccess?n:r.message({custom:s.error.message})}}}Te(bn,"RULE_NOT_NULL_OR_UNDEFINED",Kt.any().required().invalid(null)),Te(bn,"RULE_ALLOW_NULL_OR_UNDEFINED",Kt.any().optional().valid(null)),Te(bn,"RULE_ALLOW_NULL",Kt.any().valid(null)),Te(bn,"RULE_ALLOW_EMPTY",Kt.any().optional().valid(null,"")),Te(bn,"RULE_IS_TYPE_STRING",Kt.string()),Te(bn,"RULE_IS_TYPE_NUMBER",Kt.number());class fOe extends Error{}class N$ extends Error{constructor(n,r,s={}){super(r);Te(this,"code");Te(this,"payload",{});this.name=this.constructor.name,this.code=n,this.payload=s,Object.setPrototypeOf(this,N$.prototype)}}const mA=class mA extends N${static create(e,n,r){return new mA(e,n,r)}};Te(mA,"INVALID_INPUT_DATA","INVALID_INPUT_DATA");let Za=mA;function sf(t,e="",n){return Za.create(t,e,n)}var oJ={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Object.prototype.hasOwnProperty;t.is=function(n,r){return n===r?n!==0||r!==0||1/n===1/r:n!==n&&r!==r},t.shallowEqual=function(n,r,s){if(n===r)return!0;if(typeof n!="object"||n===null||typeof r!="object"||r===null)return!1;var i=Object.keys(n),o=Object.keys(r);if(i.length!==o.length)return!1;for(var a=s&&typeof s.customEqual=="function"?s.customEqual:t.is,c=0;c<i.length;c++){var u=i[c];if(!e.call(r,u)||!a(n[u],r[u]))return!1}return!0}})(oJ);class P${constructor(e){Te(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:oJ.shallowEqual(this.props,e.props)}}class mHe extends Kt.ValidationError{}class gHe extends Kt.ValidationError{}let P1;const hOe=new Uint8Array(16);function pOe(){if(!P1&&(P1=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!P1))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return P1(hOe)}const cs=[];for(let t=0;t<256;++t)cs.push((t+256).toString(16).slice(1));function mOe(t,e=0){return cs[t[e+0]]+cs[t[e+1]]+cs[t[e+2]]+cs[t[e+3]]+"-"+cs[t[e+4]]+cs[t[e+5]]+"-"+cs[t[e+6]]+cs[t[e+7]]+"-"+cs[t[e+8]]+cs[t[e+9]]+"-"+cs[t[e+10]]+cs[t[e+11]]+cs[t[e+12]]+cs[t[e+13]]+cs[t[e+14]]+cs[t[e+15]]}const gOe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),SU={randomUUID:gOe};function vOe(t,e,n){if(SU.randomUUID&&!e&&!t)return SU.randomUUID();t=t||{};const r=t.random||(t.rng||pOe)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,mOe(r)}class H_ extends P${constructor(){super(...arguments);Te(this,"isNull",()=>this.props===null)}}class td extends H_{static validate(e,n){const r=bn.RULE_ALLOW_EMPTY.default(""),s=Kt.string().guid({version:["uuidv4"]}).label(n.label?n.label:"id"),i=Kt.alternatives(r,s);return bn.validate(i,e)}static sanitize(e){return e.trim()}static create(e,n={}){const r={label:"id",generateOnEmpty:!1,...n};if(!e&&!r.generateOnEmpty)return an.fail(sf(Za.INVALID_INPUT_DATA,"ID is null or empty"));if(e){const s=td.validate(e,r);return s.isFailure?an.fail(sf(Za.INVALID_INPUT_DATA,s.error.message,r)):an.ok(new td(td.sanitize(s.object)))}return r.generateOnEmpty?td.generateNewID():an.ok(new td(null))}static generateNewID(){return an.ok(new td(vOe()))}get value(){return String(this.props)}toString(){return String(this.props)}toPrimitive(){return this.toString()}}class vHe extends Kt.ValidationError{}class yHe extends Kt.ValidationError{}class bHe extends Kt.ValidationError{}class xHe extends Kt.ValidationError{}class wHe extends Kt.ValidationError{}const jk={USD:{symbol:"$",name:"US Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"USD",name_plural:"US dollars"},CAD:{symbol:"CA$",name:"Canadian Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"CAD",name_plural:"Canadian dollars"},EUR:{symbol:"€",name:"Euro",symbol_native:"€",decimal_digits:2,rounding:0,code:"EUR",name_plural:"euros"},BTC:{symbol:"BTC",name:"Bitcoin",symbol_native:"฿",decimal_digits:8,rounding:0,code:"BTC",name_plural:"Bitcoins"},AED:{symbol:"AED",name:"United Arab Emirates Dirham",symbol_native:"د.إ.",decimal_digits:2,rounding:0,code:"AED",name_plural:"UAE dirhams"},AFN:{symbol:"Af",name:"Afghan Afghani",symbol_native:"؋",decimal_digits:2,rounding:0,code:"AFN",name_plural:"Afghan Afghanis"},ALL:{symbol:"ALL",name:"Albanian Lek",symbol_native:"Lek",decimal_digits:2,rounding:0,code:"ALL",name_plural:"Albanian lekë"},AMD:{symbol:"AMD",name:"Armenian Dram",symbol_native:"դր.",decimal_digits:2,rounding:0,code:"AMD",name_plural:"Armenian drams"},ARS:{symbol:"AR$",name:"Argentine Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"ARS",name_plural:"Argentine pesos"},AUD:{symbol:"AU$",name:"Australian Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"AUD",name_plural:"Australian dollars"},AZN:{symbol:"man.",name:"Azerbaijani Manat",symbol_native:"ман.",decimal_digits:2,rounding:0,code:"AZN",name_plural:"Azerbaijani manats"},BAM:{symbol:"KM",name:"Bosnia-Herzegovina Convertible Mark",symbol_native:"KM",decimal_digits:2,rounding:0,code:"BAM",name_plural:"Bosnia-Herzegovina convertible marks"},BDT:{symbol:"Tk",name:"Bangladeshi Taka",symbol_native:"৳",decimal_digits:2,rounding:0,code:"BDT",name_plural:"Bangladeshi takas"},BGN:{symbol:"BGN",name:"Bulgarian Lev",symbol_native:"лв.",decimal_digits:2,rounding:0,code:"BGN",name_plural:"Bulgarian leva"},BHD:{symbol:"BD",name:"Bahraini Dinar",symbol_native:"د.ب.",decimal_digits:3,rounding:0,code:"BHD",name_plural:"Bahraini dinars"},BIF:{symbol:"FBu",name:"Burundian Franc",symbol_native:"FBu",decimal_digits:0,rounding:0,code:"BIF",name_plural:"Burundian francs"},BND:{symbol:"BN$",name:"Brunei Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"BND",name_plural:"Brunei dollars"},BOB:{symbol:"Bs",name:"Bolivian Boliviano",symbol_native:"Bs",decimal_digits:2,rounding:0,code:"BOB",name_plural:"Bolivian bolivianos"},BRL:{symbol:"R$",name:"Brazilian Real",symbol_native:"R$",decimal_digits:2,rounding:0,code:"BRL",name_plural:"Brazilian reals"},BWP:{symbol:"BWP",name:"Botswanan Pula",symbol_native:"P",decimal_digits:2,rounding:0,code:"BWP",name_plural:"Botswanan pulas"},BYR:{symbol:"BYR",name:"Belarusian Ruble",symbol_native:"BYR",decimal_digits:0,rounding:0,code:"BYR",name_plural:"Belarusian rubles"},BZD:{symbol:"BZ$",name:"Belize Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"BZD",name_plural:"Belize dollars"},CDF:{symbol:"CDF",name:"Congolese Franc",symbol_native:"FrCD",decimal_digits:2,rounding:0,code:"CDF",name_plural:"Congolese francs"},CHF:{symbol:"CHF",name:"Swiss Franc",symbol_native:"CHF",decimal_digits:2,rounding:.05,code:"CHF",name_plural:"Swiss francs"},CLP:{symbol:"CL$",name:"Chilean Peso",symbol_native:"$",decimal_digits:0,rounding:0,code:"CLP",name_plural:"Chilean pesos"},CNY:{symbol:"CN¥",name:"Chinese Yuan",symbol_native:"CN¥",decimal_digits:2,rounding:0,code:"CNY",name_plural:"Chinese yuan"},COP:{symbol:"CO$",name:"Colombian Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"COP",name_plural:"Colombian pesos"},CRC:{symbol:"₡",name:"Costa Rican Colón",symbol_native:"₡",decimal_digits:2,rounding:0,code:"CRC",name_plural:"Costa Rican colóns"},CVE:{symbol:"CV$",name:"Cape Verdean Escudo",symbol_native:"CV$",decimal_digits:2,rounding:0,code:"CVE",name_plural:"Cape Verdean escudos"},CZK:{symbol:"Kč",name:"Czech Republic Koruna",symbol_native:"Kč",decimal_digits:2,rounding:0,code:"CZK",name_plural:"Czech Republic korunas"},DJF:{symbol:"Fdj",name:"Djiboutian Franc",symbol_native:"Fdj",decimal_digits:0,rounding:0,code:"DJF",name_plural:"Djiboutian francs"},DKK:{symbol:"Dkr",name:"Danish Krone",symbol_native:"kr",decimal_digits:2,rounding:0,code:"DKK",name_plural:"Danish kroner"},DOP:{symbol:"RD$",name:"Dominican Peso",symbol_native:"RD$",decimal_digits:2,rounding:0,code:"DOP",name_plural:"Dominican pesos"},DZD:{symbol:"DA",name:"Algerian Dinar",symbol_native:"د.ج.",decimal_digits:2,rounding:0,code:"DZD",name_plural:"Algerian dinars"},EEK:{symbol:"Ekr",name:"Estonian Kroon",symbol_native:"kr",decimal_digits:2,rounding:0,code:"EEK",name_plural:"Estonian kroons"},EGP:{symbol:"EGP",name:"Egyptian Pound",symbol_native:"ج.م.",decimal_digits:2,rounding:0,code:"EGP",name_plural:"Egyptian pounds"},ERN:{symbol:"Nfk",name:"Eritrean Nakfa",symbol_native:"Nfk",decimal_digits:2,rounding:0,code:"ERN",name_plural:"Eritrean nakfas"},ETB:{symbol:"Br",name:"Ethiopian Birr",symbol_native:"Br",decimal_digits:2,rounding:0,code:"ETB",name_plural:"Ethiopian birrs"},GBP:{symbol:"£",name:"British Pound Sterling",symbol_native:"£",decimal_digits:2,rounding:0,code:"GBP",name_plural:"British pounds sterling"},GEL:{symbol:"GEL",name:"Georgian Lari",symbol_native:"GEL",decimal_digits:2,rounding:0,code:"GEL",name_plural:"Georgian laris"},GHS:{symbol:"GH₵",name:"Ghanaian Cedi",symbol_native:"GH₵",decimal_digits:2,rounding:0,code:"GHS",name_plural:"Ghanaian cedis"},GNF:{symbol:"FG",name:"Guinean Franc",symbol_native:"FG",decimal_digits:0,rounding:0,code:"GNF",name_plural:"Guinean francs"},GTQ:{symbol:"GTQ",name:"Guatemalan Quetzal",symbol_native:"Q",decimal_digits:2,rounding:0,code:"GTQ",name_plural:"Guatemalan quetzals"},HKD:{symbol:"HK$",name:"Hong Kong Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"HKD",name_plural:"Hong Kong dollars"},HNL:{symbol:"HNL",name:"Honduran Lempira",symbol_native:"L",decimal_digits:2,rounding:0,code:"HNL",name_plural:"Honduran lempiras"},HRK:{symbol:"kn",name:"Croatian Kuna",symbol_native:"kn",decimal_digits:2,rounding:0,code:"HRK",name_plural:"Croatian kunas"},HUF:{symbol:"Ft",name:"Hungarian Forint",symbol_native:"Ft",decimal_digits:2,rounding:0,code:"HUF",name_plural:"Hungarian forints"},IDR:{symbol:"Rp",name:"Indonesian Rupiah",symbol_native:"Rp",decimal_digits:2,rounding:0,code:"IDR",name_plural:"Indonesian rupiahs"},ILS:{symbol:"₪",name:"Israeli New Sheqel",symbol_native:"₪",decimal_digits:2,rounding:0,code:"ILS",name_plural:"Israeli new sheqels"},INR:{symbol:"Rs",name:"Indian Rupee",symbol_native:"টকা",decimal_digits:2,rounding:0,code:"INR",name_plural:"Indian rupees"},IQD:{symbol:"IQD",name:"Iraqi Dinar",symbol_native:"د.ع.",decimal_digits:3,rounding:0,code:"IQD",name_plural:"Iraqi dinars"},IRR:{symbol:"IRR",name:"Iranian Rial",symbol_native:"﷼",decimal_digits:2,rounding:0,code:"IRR",name_plural:"Iranian rials"},ISK:{symbol:"Ikr",name:"Icelandic Króna",symbol_native:"kr",decimal_digits:0,rounding:0,code:"ISK",name_plural:"Icelandic krónur"},JMD:{symbol:"J$",name:"Jamaican Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"JMD",name_plural:"Jamaican dollars"},JOD:{symbol:"JD",name:"Jordanian Dinar",symbol_native:"د.أ.",decimal_digits:3,rounding:0,code:"JOD",name_plural:"Jordanian dinars"},JPY:{symbol:"¥",name:"Japanese Yen",symbol_native:"¥",decimal_digits:0,rounding:0,code:"JPY",name_plural:"Japanese yen"},KES:{symbol:"Ksh",name:"Kenyan Shilling",symbol_native:"Ksh",decimal_digits:2,rounding:0,code:"KES",name_plural:"Kenyan shillings"},KHR:{symbol:"KHR",name:"Cambodian Riel",symbol_native:"៛",decimal_digits:2,rounding:0,code:"KHR",name_plural:"Cambodian riels"},KMF:{symbol:"CF",name:"Comorian Franc",symbol_native:"FC",decimal_digits:0,rounding:0,code:"KMF",name_plural:"Comorian francs"},KRW:{symbol:"₩",name:"South Korean Won",symbol_native:"₩",decimal_digits:0,rounding:0,code:"KRW",name_plural:"South Korean won"},KWD:{symbol:"KD",name:"Kuwaiti Dinar",symbol_native:"د.ك.",decimal_digits:3,rounding:0,code:"KWD",name_plural:"Kuwaiti dinars"},KZT:{symbol:"KZT",name:"Kazakhstani Tenge",symbol_native:"тңг.",decimal_digits:2,rounding:0,code:"KZT",name_plural:"Kazakhstani tenges"},LAK:{symbol:"₭",name:"Lao kip",symbol_native:"ກີບ",decimal_digits:2,rounding:0,code:"LAK",name_plural:"Lao kips"},LBP:{symbol:"LB£",name:"Lebanese Pound",symbol_native:"ل.ل.",decimal_digits:2,rounding:0,code:"LBP",name_plural:"Lebanese pounds"},LKR:{symbol:"SLRs",name:"Sri Lankan Rupee",symbol_native:"SL Re",decimal_digits:2,rounding:0,code:"LKR",name_plural:"Sri Lankan rupees"},LTL:{symbol:"Lt",name:"Lithuanian Litas",symbol_native:"Lt",decimal_digits:2,rounding:0,code:"LTL",name_plural:"Lithuanian litai"},LVL:{symbol:"Ls",name:"Latvian Lats",symbol_native:"Ls",decimal_digits:2,rounding:0,code:"LVL",name_plural:"Latvian lati"},LYD:{symbol:"LD",name:"Libyan Dinar",symbol_native:"د.ل.",decimal_digits:3,rounding:0,code:"LYD",name_plural:"Libyan dinars"},MAD:{symbol:"MAD",name:"Moroccan Dirham",symbol_native:"د.م.",decimal_digits:2,rounding:0,code:"MAD",name_plural:"Moroccan dirhams"},MDL:{symbol:"MDL",name:"Moldovan Leu",symbol_native:"MDL",decimal_digits:2,rounding:0,code:"MDL",name_plural:"Moldovan lei"},MGA:{symbol:"MGA",name:"Malagasy Ariary",symbol_native:"MGA",decimal_digits:2,rounding:0,code:"MGA",name_plural:"Malagasy Ariaries"},MKD:{symbol:"MKD",name:"Macedonian Denar",symbol_native:"MKD",decimal_digits:2,rounding:0,code:"MKD",name_plural:"Macedonian denari"},MMK:{symbol:"MMK",name:"Myanma Kyat",symbol_native:"K",decimal_digits:2,rounding:0,code:"MMK",name_plural:"Myanma kyats"},MOP:{symbol:"MOP$",name:"Macanese Pataca",symbol_native:"MOP$",decimal_digits:2,rounding:0,code:"MOP",name_plural:"Macanese patacas"},MUR:{symbol:"MURs",name:"Mauritian Rupee",symbol_native:"MURs",decimal_digits:2,rounding:0,code:"MUR",name_plural:"Mauritian rupees"},MXN:{symbol:"MX$",name:"Mexican Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"MXN",name_plural:"Mexican pesos"},MYR:{symbol:"RM",name:"Malaysian Ringgit",symbol_native:"RM",decimal_digits:2,rounding:0,code:"MYR",name_plural:"Malaysian ringgits"},MZN:{symbol:"MTn",name:"Mozambican Metical",symbol_native:"MTn",decimal_digits:2,rounding:0,code:"MZN",name_plural:"Mozambican meticals"},NAD:{symbol:"N$",name:"Namibian Dollar",symbol_native:"N$",decimal_digits:2,rounding:0,code:"NAD",name_plural:"Namibian dollars"},NGN:{symbol:"₦",name:"Nigerian Naira",symbol_native:"₦",decimal_digits:2,rounding:0,code:"NGN",name_plural:"Nigerian nairas"},NIO:{symbol:"C$",name:"Nicaraguan Córdoba",symbol_native:"C$",decimal_digits:2,rounding:0,code:"NIO",name_plural:"Nicaraguan córdobas"},NOK:{symbol:"Nkr",name:"Norwegian Krone",symbol_native:"kr",decimal_digits:2,rounding:0,code:"NOK",name_plural:"Norwegian kroner"},NPR:{symbol:"NPRs",name:"Nepalese Rupee",symbol_native:"नेरू",decimal_digits:2,rounding:0,code:"NPR",name_plural:"Nepalese rupees"},NZD:{symbol:"NZ$",name:"New Zealand Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"NZD",name_plural:"New Zealand dollars"},OMR:{symbol:"OMR",name:"Omani Rial",symbol_native:"ر.ع.",decimal_digits:3,rounding:0,code:"OMR",name_plural:"Omani rials"},PAB:{symbol:"B/.",name:"Panamanian Balboa",symbol_native:"B/.",decimal_digits:2,rounding:0,code:"PAB",name_plural:"Panamanian balboas"},PEN:{symbol:"S/.",name:"Peruvian Nuevo Sol",symbol_native:"S/.",decimal_digits:2,rounding:0,code:"PEN",name_plural:"Peruvian nuevos soles"},PHP:{symbol:"₱",name:"Philippine Peso",symbol_native:"₱",decimal_digits:2,rounding:0,code:"PHP",name_plural:"Philippine pesos"},PKR:{symbol:"PKRs",name:"Pakistani Rupee",symbol_native:"₨",decimal_digits:2,rounding:0,code:"PKR",name_plural:"Pakistani rupees"},PLN:{symbol:"zł",name:"Polish Zloty",symbol_native:"zł",decimal_digits:2,rounding:0,code:"PLN",name_plural:"Polish zlotys"},PYG:{symbol:"₲",name:"Paraguayan Guarani",symbol_native:"₲",decimal_digits:0,rounding:0,code:"PYG",name_plural:"Paraguayan guaranis"},QAR:{symbol:"QR",name:"Qatari Rial",symbol_native:"ر.ق.",decimal_digits:2,rounding:0,code:"QAR",name_plural:"Qatari rials"},RON:{symbol:"RON",name:"Romanian Leu",symbol_native:"RON",decimal_digits:2,rounding:0,code:"RON",name_plural:"Romanian lei"},RSD:{symbol:"din.",name:"Serbian Dinar",symbol_native:"дин.",decimal_digits:2,rounding:0,code:"RSD",name_plural:"Serbian dinars"},RUB:{symbol:"RUB",name:"Russian Ruble",symbol_native:"₽",decimal_digits:2,rounding:0,code:"RUB",name_plural:"Russian rubles"},RWF:{symbol:"RWF",name:"Rwandan Franc",symbol_native:"FR",decimal_digits:0,rounding:0,code:"RWF",name_plural:"Rwandan francs"},SAR:{symbol:"SR",name:"Saudi Riyal",symbol_native:"ر.س.",decimal_digits:2,rounding:0,code:"SAR",name_plural:"Saudi riyals"},SDG:{symbol:"SDG",name:"Sudanese Pound",symbol_native:"SDG",decimal_digits:2,rounding:0,code:"SDG",name_plural:"Sudanese pounds"},SEK:{symbol:"Skr",name:"Swedish Krona",symbol_native:"kr",decimal_digits:2,rounding:0,code:"SEK",name_plural:"Swedish kronor"},SGD:{symbol:"S$",name:"Singapore Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"SGD",name_plural:"Singapore dollars"},SOS:{symbol:"Ssh",name:"Somali Shilling",symbol_native:"Ssh",decimal_digits:2,rounding:0,code:"SOS",name_plural:"Somali shillings"},SYP:{symbol:"SY£",name:"Syrian Pound",symbol_native:"ل.س.",decimal_digits:2,rounding:0,code:"SYP",name_plural:"Syrian pounds"},THB:{symbol:"฿",name:"Thai Baht",symbol_native:"฿",decimal_digits:2,rounding:0,code:"THB",name_plural:"Thai baht"},TND:{symbol:"DT",name:"Tunisian Dinar",symbol_native:"د.ت.",decimal_digits:3,rounding:0,code:"TND",name_plural:"Tunisian dinars"},TOP:{symbol:"T$",name:"Tongan Paʻanga",symbol_native:"T$",decimal_digits:2,rounding:0,code:"TOP",name_plural:"Tongan paʻanga"},TRY:{symbol:"TL",name:"Turkish Lira",symbol_native:"TL",decimal_digits:2,rounding:0,code:"TRY",name_plural:"Turkish Lira"},TTD:{symbol:"TT$",name:"Trinidad and Tobago Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"TTD",name_plural:"Trinidad and Tobago dollars"},TWD:{symbol:"NT$",name:"New Taiwan Dollar",symbol_native:"NT$",decimal_digits:2,rounding:0,code:"TWD",name_plural:"New Taiwan dollars"},TZS:{symbol:"TSh",name:"Tanzanian Shilling",symbol_native:"TSh",decimal_digits:2,rounding:0,code:"TZS",name_plural:"Tanzanian shillings"},UAH:{symbol:"₴",name:"Ukrainian Hryvnia",symbol_native:"₴",decimal_digits:2,rounding:0,code:"UAH",name_plural:"Ukrainian hryvnias"},UGX:{symbol:"USh",name:"Ugandan Shilling",symbol_native:"USh",decimal_digits:0,rounding:0,code:"UGX",name_plural:"Ugandan shillings"},UYU:{symbol:"$U",name:"Uruguayan Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"UYU",name_plural:"Uruguayan pesos"},UZS:{symbol:"UZS",name:"Uzbekistan Som",symbol_native:"UZS",decimal_digits:2,rounding:0,code:"UZS",name_plural:"Uzbekistan som"},VEF:{symbol:"Bs.F.",name:"Venezuelan Bolívar",symbol_native:"Bs.F.",decimal_digits:2,rounding:0,code:"VEF",name_plural:"Venezuelan bolívars"},VND:{symbol:"₫",name:"Vietnamese Dong",symbol_native:"₫",decimal_digits:0,rounding:0,code:"VND",name_plural:"Vietnamese dong"},XAF:{symbol:"FCFA",name:"CFA Franc BEAC",symbol_native:"FCFA",decimal_digits:0,rounding:0,code:"XAF",name_plural:"CFA francs BEAC"},XOF:{symbol:"CFA",name:"CFA Franc BCEAO",symbol_native:"CFA",decimal_digits:0,rounding:0,code:"XOF",name_plural:"CFA francs BCEAO"},YER:{symbol:"YR",name:"Yemeni Rial",symbol_native:"ر.ي.",decimal_digits:2,rounding:0,code:"YER",name_plural:"Yemeni rials"},ZAR:{symbol:"R",name:"South African Rand",symbol_native:"R",decimal_digits:2,rounding:0,code:"ZAR",name_plural:"South African rand"},ZMK:{symbol:"ZK",name:"Zambian Kwacha",symbol_native:"ZK",decimal_digits:0,rounding:0,code:"ZMK",name_plural:"Zambian kwachas"}},rd=class rd extends H_{constructor(){super(...arguments);Te(this,"toString",()=>this.code)}get symbol(){return this.props?String(this.props.symbol_native):""}get code(){return this.props?String(this.props.code):""}static validate(n,r){const s=Kt.alternatives(bn.RULE_ALLOW_EMPTY.default(""),Kt.string().uppercase().valid(...Object.keys(jk)).label(String(r.label)));return bn.validate(s,n)}static createFromCode(n,r={}){const s={...r,label:r.label?r.label:"current_code"},i=rd.validate(n,s);return i.isFailure?an.fail(sf(Za.INVALID_INPUT_DATA,i.error.message,s)):an.ok(new rd(jk[i.object]))}static createDefaultCode(){return rd.createFromCode(rd.DEFAULT_CURRENCY_CODE)}isEmpty(){return this.isNull()||this.props===void 0}toPrimitive(){return this.toString()}};Te(rd,"DEFAULT_CURRENCY_CODE","EUR"),Te(rd,"CURRENCIES",jk);let au=rd;class _He extends Kt.ValidationError{}const Lk={aa:{name:"Afar",nativeName:"Afaraf"},ab:{name:"Abkhaz",nativeName:"аҧсуа бызшәа"},ae:{name:"Avestan",nativeName:"avesta"},af:{name:"Afrikaans",nativeName:"Afrikaans"},ak:{name:"Akan",nativeName:"Akan"},am:{name:"Amharic",nativeName:"አማርኛ"},an:{name:"Aragonese",nativeName:"aragonés"},ar:{name:"Arabic",nativeName:"اَلْعَرَبِيَّةُ"},as:{name:"Assamese",nativeName:"অসমীয়া"},av:{name:"Avaric",nativeName:"авар мацӀ"},ay:{name:"Aymara",nativeName:"aymar aru"},az:{name:"Azerbaijani",nativeName:"azərbaycan dili"},ba:{name:"Bashkir",nativeName:"башҡорт теле"},be:{name:"Belarusian",nativeName:"беларуская мова"},bg:{name:"Bulgarian",nativeName:"български език"},bi:{name:"Bislama",nativeName:"Bislama"},bm:{name:"Bambara",nativeName:"bamanankan"},bn:{name:"Bengali",nativeName:"বাংলা"},bo:{name:"Tibetan",nativeName:"བོད་ཡིག"},br:{name:"Breton",nativeName:"brezhoneg"},bs:{name:"Bosnian",nativeName:"bosanski jezik"},ca:{name:"Catalan",nativeName:"Català"},ce:{name:"Chechen",nativeName:"нохчийн мотт"},ch:{name:"Chamorro",nativeName:"Chamoru"},co:{name:"Corsican",nativeName:"corsu"},cr:{name:"Cree",nativeName:"ᓀᐦᐃᔭᐍᐏᐣ"},cs:{name:"Czech",nativeName:"čeština"},cu:{name:"Old Church Slavonic",nativeName:"ѩзыкъ словѣньскъ"},cv:{name:"Chuvash",nativeName:"чӑваш чӗлхи"},cy:{name:"Welsh",nativeName:"Cymraeg"},da:{name:"Danish",nativeName:"dansk"},de:{name:"German",nativeName:"Deutsch"},dv:{name:"Divehi",nativeName:"ދިވެހި"},dz:{name:"Dzongkha",nativeName:"རྫོང་ཁ"},ee:{name:"Ewe",nativeName:"Eʋegbe"},el:{name:"Greek",nativeName:"Ελληνικά"},en:{name:"English",nativeName:"English"},eo:{name:"Esperanto",nativeName:"Esperanto"},es:{name:"Spanish",nativeName:"Español"},et:{name:"Estonian",nativeName:"eesti"},eu:{name:"Basque",nativeName:"euskara"},fa:{name:"Persian",nativeName:"فارسی"},ff:{name:"Fula",nativeName:"Fulfulde"},fi:{name:"Finnish",nativeName:"suomi"},fj:{name:"Fijian",nativeName:"vosa Vakaviti"},fo:{name:"Faroese",nativeName:"føroyskt"},fr:{name:"French",nativeName:"Français"},fy:{name:"Western Frisian",nativeName:"Frysk"},ga:{name:"Irish",nativeName:"Gaeilge"},gd:{name:"Scottish Gaelic",nativeName:"Gàidhlig"},gl:{name:"Galician",nativeName:"galego"},gn:{name:"Guaraní",nativeName:"Avañe'ẽ"},gu:{name:"Gujarati",nativeName:"ગુજરાતી"},gv:{name:"Manx",nativeName:"Gaelg"},ha:{name:"Hausa",nativeName:"هَوُسَ"},he:{name:"Hebrew",nativeName:"עברית"},hi:{name:"Hindi",nativeName:"हिन्दी"},ho:{name:"Hiri Motu",nativeName:"Hiri Motu"},hr:{name:"Croatian",nativeName:"Hrvatski"},ht:{name:"Haitian",nativeName:"Kreyòl ayisyen"},hu:{name:"Hungarian",nativeName:"magyar"},hy:{name:"Armenian",nativeName:"Հայերեն"},hz:{name:"Herero",nativeName:"Otjiherero"},ia:{name:"Interlingua",nativeName:"Interlingua"},id:{name:"Indonesian",nativeName:"Bahasa Indonesia"},ie:{name:"Interlingue",nativeName:"Interlingue"},ig:{name:"Igbo",nativeName:"Asụsụ Igbo"},ii:{name:"Nuosu",nativeName:"ꆈꌠ꒿ Nuosuhxop"},ik:{name:"Inupiaq",nativeName:"Iñupiaq"},io:{name:"Ido",nativeName:"Ido"},is:{name:"Icelandic",nativeName:"Íslenska"},it:{name:"Italian",nativeName:"Italiano"},iu:{name:"Inuktitut",nativeName:"ᐃᓄᒃᑎᑐᑦ"},ja:{name:"Japanese",nativeName:"日本語"},jv:{name:"Javanese",nativeName:"basa Jawa"},ka:{name:"Georgian",nativeName:"ქართული"},kg:{name:"Kongo",nativeName:"Kikongo"},ki:{name:"Kikuyu",nativeName:"Gĩkũyũ"},kj:{name:"Kwanyama",nativeName:"Kuanyama"},kk:{name:"Kazakh",nativeName:"қазақ тілі"},kl:{name:"Kalaallisut",nativeName:"kalaallisut"},km:{name:"Khmer",nativeName:"ខេមរភាសា"},kn:{name:"Kannada",nativeName:"ಕನ್ನಡ"},ko:{name:"Korean",nativeName:"한국어"},kr:{name:"Kanuri",nativeName:"Kanuri"},ks:{name:"Kashmiri",nativeName:"कश्मीरी"},ku:{name:"Kurdish",nativeName:"Kurdî"},kv:{name:"Komi",nativeName:"коми кыв"},kw:{name:"Cornish",nativeName:"Kernewek"},ky:{name:"Kyrgyz",nativeName:"Кыргызча"},la:{name:"Latin",nativeName:"latine"},lb:{name:"Luxembourgish",nativeName:"Lëtzebuergesch"},lg:{name:"Ganda",nativeName:"Luganda"},li:{name:"Limburgish",nativeName:"Limburgs"},ln:{name:"Lingala",nativeName:"Lingála"},lo:{name:"Lao",nativeName:"ພາສາລາວ"},lt:{name:"Lithuanian",nativeName:"lietuvių kalba"},lu:{name:"Luba-Katanga",nativeName:"Kiluba"},lv:{name:"Latvian",nativeName:"latviešu valoda"},mg:{name:"Malagasy",nativeName:"fiteny malagasy"},mh:{name:"Marshallese",nativeName:"Kajin M̧ajeļ"},mi:{name:"Māori",nativeName:"te reo Māori"},mk:{name:"Macedonian",nativeName:"македонски јазик"},ml:{name:"Malayalam",nativeName:"മലയാളം"},mn:{name:"Mongolian",nativeName:"Монгол хэл"},mr:{name:"Marathi",nativeName:"मराठी"},ms:{name:"Malay",nativeName:"Bahasa Melayu"},mt:{name:"Maltese",nativeName:"Malti"},my:{name:"Burmese",nativeName:"ဗမာစာ"},na:{name:"Nauru",nativeName:"Dorerin Naoero"},nb:{name:"Norwegian Bokmål",nativeName:"Norsk bokmål"},nd:{name:"Northern Ndebele",nativeName:"isiNdebele"},ne:{name:"Nepali",nativeName:"नेपाली"},ng:{name:"Ndonga",nativeName:"Owambo"},nl:{name:"Dutch",nativeName:"Nederlands"},nn:{name:"Norwegian Nynorsk",nativeName:"Norsk nynorsk"},no:{name:"Norwegian",nativeName:"Norsk"},nr:{name:"Southern Ndebele",nativeName:"isiNdebele"},nv:{name:"Navajo",nativeName:"Diné bizaad"},ny:{name:"Chichewa",nativeName:"chiCheŵa"},oc:{name:"Occitan",nativeName:"occitan"},oj:{name:"Ojibwe",nativeName:"ᐊᓂᔑᓈᐯᒧᐎᓐ"},om:{name:"Oromo",nativeName:"Afaan Oromoo"},or:{name:"Oriya",nativeName:"ଓଡ଼ିଆ"},os:{name:"Ossetian",nativeName:"ирон æвзаг"},pa:{name:"Panjabi",nativeName:"ਪੰਜਾਬੀ"},pi:{name:"Pāli",nativeName:"पाऴि"},pl:{name:"Polish",nativeName:"Polski"},ps:{name:"Pashto",nativeName:"پښتو"},pt:{name:"Portuguese",nativeName:"Português"},qu:{name:"Quechua",nativeName:"Runa Simi"},rm:{name:"Romansh",nativeName:"rumantsch grischun"},rn:{name:"Kirundi",nativeName:"Ikirundi"},ro:{name:"Romanian",nativeName:"Română"},ru:{name:"Russian",nativeName:"Русский"},rw:{name:"Kinyarwanda",nativeName:"Ikinyarwanda"},sa:{name:"Sanskrit",nativeName:"संस्कृतम्"},sc:{name:"Sardinian",nativeName:"sardu"},sd:{name:"Sindhi",nativeName:"सिन्धी"},se:{name:"Northern Sami",nativeName:"Davvisámegiella"},sg:{name:"Sango",nativeName:"yângâ tî sängö"},si:{name:"Sinhala",nativeName:"සිංහල"},sk:{name:"Slovak",nativeName:"slovenčina"},sl:{name:"Slovenian",nativeName:"slovenščina"},sm:{name:"Samoan",nativeName:"gagana fa'a Samoa"},sn:{name:"Shona",nativeName:"chiShona"},so:{name:"Somali",nativeName:"Soomaaliga"},sq:{name:"Albanian",nativeName:"Shqip"},sr:{name:"Serbian",nativeName:"српски језик"},ss:{name:"Swati",nativeName:"SiSwati"},st:{name:"Southern Sotho",nativeName:"Sesotho"},su:{name:"Sundanese",nativeName:"Basa Sunda"},sv:{name:"Swedish",nativeName:"Svenska"},sw:{name:"Swahili",nativeName:"Kiswahili"},ta:{name:"Tamil",nativeName:"தமிழ்"},te:{name:"Telugu",nativeName:"తెలుగు"},tg:{name:"Tajik",nativeName:"тоҷикӣ"},th:{name:"Thai",nativeName:"ไทย"},ti:{name:"Tigrinya",nativeName:"ትግርኛ"},tk:{name:"Turkmen",nativeName:"Türkmençe"},tl:{name:"Tagalog",nativeName:"Wikang Tagalog"},tn:{name:"Tswana",nativeName:"Setswana"},to:{name:"Tonga",nativeName:"faka Tonga"},tr:{name:"Turkish",nativeName:"Türkçe"},ts:{name:"Tsonga",nativeName:"Xitsonga"},tt:{name:"Tatar",nativeName:"татар теле"},tw:{name:"Twi",nativeName:"Twi"},ty:{name:"Tahitian",nativeName:"Reo Tahiti"},ug:{name:"Uyghur",nativeName:"ئۇيغۇرچە"},uk:{name:"Ukrainian",nativeName:"Українська"},ur:{name:"Urdu",nativeName:"اردو"},uz:{name:"Uzbek",nativeName:"Ўзбек"},ve:{name:"Venda",nativeName:"Tshivenḓa"},vi:{name:"Vietnamese",nativeName:"Tiếng Việt"},vo:{name:"Volapük",nativeName:"Volapük"},wa:{name:"Walloon",nativeName:"walon"},wo:{name:"Wolof",nativeName:"Wollof"},xh:{name:"Xhosa",nativeName:"isiXhosa"},yi:{name:"Yiddish",nativeName:"ייִדיש"},yo:{name:"Yoruba",nativeName:"Yorùbá"},za:{name:"Zhuang",nativeName:"Saɯ cueŋƅ"},zh:{name:"Chinese",nativeName:"中文"},zu:{name:"Zulu",nativeName:"isiZulu"}},sd=class sd extends H_{constructor(){super(...arguments);Te(this,"toString",()=>this.code)}static validate(n,r){const s=Kt.alternatives(bn.RULE_ALLOW_EMPTY.default(""),Kt.string().lowercase().valid(...Object.keys(Lk)).label(String(r.label)));return bn.validate(s,n)}static sanitize(n){return n?String(n).toLowerCase():void 0}static createFromCode(n,r={}){const s={...r,label:r.label?r.label:"lang_code"},i=sd.validate(n,s);if(i.isFailure)return an.fail(sf(Za.INVALID_INPUT_DATA,i.error.message,s));const o=sd.sanitize(i.object),a=o?{...Lk[i.object],code:o}:void 0;return an.ok(new sd(a))}static createDefaultCode(){return sd.createFromCode(this.DEFAULT_LANGUAGE_CODE)}get name(){return this.props?String(this.props.name):""}get nativeName(){return this.props?String(this.props.nativeName):""}get code(){return this.props?String(this.props.code):""}isEmpty(){return this.isNull()||this.props===void 0}toPrimitive(){return this.toString()}};Te(sd,"DEFAULT_LANGUAGE_CODE","es"),Te(sd,"LANGUAGES",Lk);let E0=sd;var yOe={defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},bOe={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 A0(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?A0=function(e){return typeof e}:A0=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A0(t)}function CU(t){return xOe(t)||wOe(t)||_Oe(t)||SOe()}function xOe(t){if(Array.isArray(t))return t}function wOe(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function _Oe(t,e){if(t){if(typeof t=="string")return EU(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 EU(t,e)}}function EU(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 SOe(){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 COe={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=CU(e),r=n[0],s=n.slice(1),i=r;return s.forEach(function(o){i=i.lessThan(o)?i:o}),i},maximum:function(e){var n=CU(e),r=n[0],s=n.slice(1),i=r;return s.forEach(function(o){i=i.greaterThan(o)?i:o}),i}};function aJ(t){return!isNaN(parseInt(t))&&isFinite(t)}function EOe(t){return aJ(t)&&t<=100&&t>=0}function AOe(t){return t.length>0&&t.every(function(e){return e>=0})&&t.some(function(e){return e>0})}function AU(t){return t%2===0}function RU(t){return aJ(t)&&!Number.isInteger(t)}function ROe(){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 Nb(t){return Math.abs(t)%1===.5}function NOe(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),POe(s,e.headers),s.send()})}function POe(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 Gb(t){return typeof t>"u"}function lJ(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",n={};return Object.entries(t).forEach(function(r){if(A0(r[1])==="object"){var s=lJ(r[1]);Object.entries(s).forEach(function(i){n[r[0]+e+i[0]]=i[1]})}else n[r[0]]=r[1]}),n}function TOe(t){return!!t&&(A0(t)==="object"||typeof t=="function")&&typeof t.then=="function"}function cJ(){var t=function(r,s){var i=function(c){return Math.pow(10,ROe(c))},o=Math.max(i(r),i(s));return Math.round(r*o)*Math.round(s*o)/(o*o)},e={HALF_ODD:function(r){var s=Math.round(r);return Nb(r)&&AU(s)?s-1:s},HALF_EVEN:function(r){var s=Math.round(r);return Nb(r)?AU(s)?s:s-1:s},HALF_UP:function(r){return Math.round(r)},HALF_DOWN:function(r){return Nb(r)?Math.floor(r):Math.round(r)},HALF_TOWARDS_ZERO:function(r){return Nb(r)?Math.sign(r)*Math.floor(Math.abs(r)):Math.round(r)},HALF_AWAY_FROM_ZERO:function(r){return Nb(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 RU(r)||RU(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 kOe=cJ();function DOe(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!Gb(r)}):[]},getMinimumFractionDigits:function(){var r=function(i){return i==="."};return Gb(this.getMatches().find(r))?0:this.getMatches()[kOe.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 Gb(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!Gb(this.getMatches().find(function(r){return r===","}))}}}function MOe(t){var e=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",i=arguments.length>1?arguments[1]:void 0;for(var o in i)s=s.replace("{{".concat(o,"}}"),i[o]);return s},n=function(s,i){return NOe(e(t.endpoint,{from:s,to:i}),{headers:t.headers})};return{getExchangeRate:function(s,i){return(TOe(t.endpoint)?t.endpoint:n(s,i)).then(function(o){return lJ(o)[e(t.propertyPath,{from:s,to:i})]})}}}function bx(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!t)throw new n(e)}function OOe(t){bx(EOe(t),"You must provide a numeric value between 0 and 100.",RangeError)}function IOe(t){bx(AOe(t),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function $k(t){bx(Number.isInteger(t),"You must provide an integer.",TypeError)}var Vn=cJ(),jOe=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;$k(r),$k(i);var o=t.globalLocale,a=t.globalFormat,c=t.globalRoundingMode,u=t.globalFormatRoundingMode,f=Object.assign({},t.globalExchangeRatesApi),l=function(h){var m=Object.assign({},Object.assign({},{amount:r,currency:s,precision:i},h),Object.assign({},{locale:this.locale},h));return Object.assign(t({amount:m.amount,currency:m.currency,precision:m.precision}),{locale:m.locale})},d=function(h){bx(this.hasSameCurrency(h),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return r},getCurrency:function(){return s},getLocale:function(){return this.locale||o},setLocale:function(h){return l.call(this,{locale:h})},getPrecision:function(){return i},convertPrecision:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;$k(h);var y=this.getPrecision(),g=h>y,v=g?Vn.multiply:Vn.divide,x=g?[h,y]:[y,h],_=Math.pow(10,Vn.subtract.apply(Vn,x));return l.call(this,{amount:Vn.round(v(this.getAmount(),_),m),precision:h})},add:function(h){d.call(this,h);var m=t.normalizePrecision([this,h]);return l.call(this,{amount:Vn.add(m[0].getAmount(),m[1].getAmount()),precision:m[0].getPrecision()})},subtract:function(h){d.call(this,h);var m=t.normalizePrecision([this,h]);return l.call(this,{amount:Vn.subtract(m[0].getAmount(),m[1].getAmount()),precision:m[0].getPrecision()})},multiply:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return l.call(this,{amount:Vn.round(Vn.multiply(this.getAmount(),h),m)})},divide:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return l.call(this,{amount:Vn.round(Vn.divide(this.getAmount(),h),m)})},percentage:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return OOe(h),this.multiply(Vn.divide(h,100),m)},allocate:function(h){var m=this;IOe(h);for(var y=h.reduce(function(_,A){return Vn.add(_,A)}),g=this.getAmount(),v=h.map(function(_){var A=Math.floor(Vn.divide(Vn.multiply(m.getAmount(),_),y));return g=Vn.subtract(g,A),l.call(m,{amount:A})}),x=0;g>0;)h[x]>0&&(v[x]=v[x].add(l.call(this,{amount:1})),g=Vn.subtract(g,1)),x+=1;return v},convert:function(h){var m=this,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g=y.endpoint,v=g===void 0?f.endpoint:g,x=y.propertyPath,_=x===void 0?f.propertyPath||"rates.{{to}}":x,A=y.headers,N=A===void 0?f.headers:A,T=y.roundingMode,E=T===void 0?c:T,P=Object.assign({},{endpoint:v,propertyPath:_,headers:N,roundingMode:E});return MOe(P).getExchangeRate(this.getCurrency(),h).then(function(k){return bx(!Gb(k),'No rate was found for the destination currency "'.concat(h,'".'),TypeError),l.call(m,{amount:Vn.round(Vn.multiply(m.getAmount(),parseFloat(k)),P.roundingMode),currency:h})})},equalsTo:function(h){return this.hasSameAmount(h)&&this.hasSameCurrency(h)},lessThan:function(h){d.call(this,h);var m=t.normalizePrecision([this,h]);return m[0].getAmount()<m[1].getAmount()},lessThanOrEqual:function(h){d.call(this,h);var m=t.normalizePrecision([this,h]);return m[0].getAmount()<=m[1].getAmount()},greaterThan:function(h){d.call(this,h);var m=t.normalizePrecision([this,h]);return m[0].getAmount()>m[1].getAmount()},greaterThanOrEqual:function(h){d.call(this,h);var m=t.normalizePrecision([this,h]);return m[0].getAmount()>=m[1].getAmount()},isZero:function(){return this.getAmount()===0},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return Vn.modulo(this.getAmount(),Math.pow(10,i))!==0},hasCents:function(){return Vn.modulo(this.getAmount(),Math.pow(10,i))!==0},hasSameCurrency:function(h){return this.getCurrency()===h.getCurrency()},hasSameAmount:function(h){var m=t.normalizePrecision([this,h]);return m[0].getAmount()===m[1].getAmount()},toFormat:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:a,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u,y=DOe(h);return this.toRoundedUnit(y.getMinimumFractionDigits(),m).toLocaleString(this.getLocale(),{currencyDisplay:y.getCurrencyDisplay(),useGrouping:y.getUseGrouping(),minimumFractionDigits:y.getMinimumFractionDigits(),style:y.getStyle(),currency:this.getCurrency()})},toUnit:function(){return Vn.divide(this.getAmount(),Math.pow(10,i))},toRoundedUnit:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u,y=Math.pow(10,h);return Vn.divide(Vn.round(Vn.multiply(this.toUnit(),y),m),y)},toObject:function(){return{amount:r,currency:s,precision:i}},toJSON:function(){return this.toObject()}}},T1=Object.assign(jOe,yOe,bOe,COe),GE={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
|
||
*/GE.exports;(function(t,e){(function(){var n,r="4.17.21",s=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",u=500,f="__lodash_placeholder__",l=1,d=2,p=4,h=1,m=2,y=1,g=2,v=4,x=8,_=16,A=32,N=64,T=128,E=256,P=512,k=30,M="...",I=800,j=16,L=1,H=2,K=3,V=1/0,U=9007199254740991,Q=17976931348623157e292,ne=NaN,X=4294967295,G=X-1,Y=X>>>1,Z=[["ary",T],["bind",y],["bindKey",g],["curry",x],["curryRight",_],["flip",P],["partial",A],["partialRight",N],["rearg",E]],he="[object Arguments]",fe="[object Array]",ce="[object AsyncFunction]",xe="[object Boolean]",Ne="[object Date]",pe="[object DOMException]",Le="[object Error]",Me="[object Function]",Oe="[object GeneratorFunction]",Fe="[object Map]",ot="[object Number]",nt="[object Null]",At="[object Object]",ee="[object Promise]",de="[object Proxy]",me="[object RegExp]",Re="[object Set]",Pe="[object String]",Ee="[object Symbol]",Ve="[object Undefined]",tt="[object WeakMap]",qt="[object WeakSet]",gt="[object ArrayBuffer]",kt="[object DataView]",ln="[object Float32Array]",gr="[object Float64Array]",_n="[object Int8Array]",pi="[object Int16Array]",or="[object Int32Array]",mi="[object Uint8Array]",$e="[object Uint8ClampedArray]",Xe="[object Uint16Array]",ht="[object Uint32Array]",Ze=/\b__p \+= '';/g,yt=/\b(__p \+=) '' \+/g,Pt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,St=/&(?:amp|lt|gt|quot|#39);/g,Wt=/[&<>"']/g,Zt=RegExp(St.source),ar=RegExp(Wt.source),Pn=/<%-([\s\S]+?)%>/g,Cr=/<%([\s\S]+?)%>/g,Dr=/<%=([\s\S]+?)%>/g,Gi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Yr=/^\w*$/,rc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ha=/[\\^$.*+?()[\]{}|]/g,re=RegExp(ha.source),ae=/^\s+/,ge=/\s/,_e=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ze=/\{\n\/\* \[wrapped with (.+)\] \*/,Ke=/,? & /,ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,je=/[()=,{}\[\]\/\s]/,xt=/\\(\\)?/g,rt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,st=/\w*$/,cn=/^[-+]0x[0-9a-f]+$/i,tn=/^0b[01]+$/i,hn=/^\[object .+?Constructor\]$/,Jt=/^0o[0-7]+$/i,Mr=/^(?:0|[1-9]\d*)$/,lr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,rl=/($^)/,sl=/['\n\r\u2028\u2029\\]/g,pa="\\ud800-\\udfff",Pu="\\u0300-\\u036f",Tu="\\ufe20-\\ufe2f",To="\\u20d0-\\u20ff",Ef=Pu+Tu+To,Af="\\u2700-\\u27bf",Rf="a-z\\xdf-\\xf6\\xf8-\\xff",Ct="\\xac\\xb1\\xd7\\xf7",Yn="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Hs="\\u2000-\\u206f",jn=" \\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",ko="A-Z\\xc0-\\xd6\\xd8-\\xde",qy="\\ufe0e\\ufe0f",sS=Ct+Yn+Hs+jn,eP="['’]",Rre="["+pa+"]",wF="["+sS+"]",iS="["+Ef+"]",_F="\\d+",Nre="["+Af+"]",SF="["+Rf+"]",CF="[^"+pa+sS+_F+Af+Rf+ko+"]",tP="\\ud83c[\\udffb-\\udfff]",Pre="(?:"+iS+"|"+tP+")",EF="[^"+pa+"]",nP="(?:\\ud83c[\\udde6-\\uddff]){2}",rP="[\\ud800-\\udbff][\\udc00-\\udfff]",rm="["+ko+"]",AF="\\u200d",RF="(?:"+SF+"|"+CF+")",Tre="(?:"+rm+"|"+CF+")",NF="(?:"+eP+"(?:d|ll|m|re|s|t|ve))?",PF="(?:"+eP+"(?:D|LL|M|RE|S|T|VE))?",TF=Pre+"?",kF="["+qy+"]?",kre="(?:"+AF+"(?:"+[EF,nP,rP].join("|")+")"+kF+TF+")*",Dre="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Mre="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",DF=kF+TF+kre,Ore="(?:"+[Nre,nP,rP].join("|")+")"+DF,Ire="(?:"+[EF+iS+"?",iS,nP,rP,Rre].join("|")+")",jre=RegExp(eP,"g"),Lre=RegExp(iS,"g"),sP=RegExp(tP+"(?="+tP+")|"+Ire+DF,"g"),$re=RegExp([rm+"?"+SF+"+"+NF+"(?="+[wF,rm,"$"].join("|")+")",Tre+"+"+PF+"(?="+[wF,rm+RF,"$"].join("|")+")",rm+"?"+RF+"+"+NF,rm+"+"+PF,Mre,Dre,_F,Ore].join("|"),"g"),Fre=RegExp("["+AF+pa+Ef+qy+"]"),zre=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Bre=["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"],Ure=-1,Un={};Un[ln]=Un[gr]=Un[_n]=Un[pi]=Un[or]=Un[mi]=Un[$e]=Un[Xe]=Un[ht]=!0,Un[he]=Un[fe]=Un[gt]=Un[xe]=Un[kt]=Un[Ne]=Un[Le]=Un[Me]=Un[Fe]=Un[ot]=Un[At]=Un[me]=Un[Re]=Un[Pe]=Un[tt]=!1;var Ln={};Ln[he]=Ln[fe]=Ln[gt]=Ln[kt]=Ln[xe]=Ln[Ne]=Ln[ln]=Ln[gr]=Ln[_n]=Ln[pi]=Ln[or]=Ln[Fe]=Ln[ot]=Ln[At]=Ln[me]=Ln[Re]=Ln[Pe]=Ln[Ee]=Ln[mi]=Ln[$e]=Ln[Xe]=Ln[ht]=!0,Ln[Le]=Ln[Me]=Ln[tt]=!1;var Hre={À:"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"},Vre={"&":"&","<":"<",">":">",'"':""","'":"'"},qre={"&":"&","<":"<",">":">",""":'"',"'":"'"},Wre={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Gre=parseFloat,Kre=parseInt,MF=typeof pr=="object"&&pr&&pr.Object===Object&&pr,Yre=typeof self=="object"&&self&&self.Object===Object&&self,as=MF||Yre||Function("return this")(),iP=e&&!e.nodeType&&e,Nf=iP&&!0&&t&&!t.nodeType&&t,OF=Nf&&Nf.exports===iP,oP=OF&&MF.process,Do=function(){try{var le=Nf&&Nf.require&&Nf.require("util").types;return le||oP&&oP.binding&&oP.binding("util")}catch{}}(),IF=Do&&Do.isArrayBuffer,jF=Do&&Do.isDate,LF=Do&&Do.isMap,$F=Do&&Do.isRegExp,FF=Do&&Do.isSet,zF=Do&&Do.isTypedArray;function Ki(le,we,ve){switch(ve.length){case 0:return le.call(we);case 1:return le.call(we,ve[0]);case 2:return le.call(we,ve[0],ve[1]);case 3:return le.call(we,ve[0],ve[1],ve[2])}return le.apply(we,ve)}function Xre(le,we,ve,We){for(var bt=-1,nn=le==null?0:le.length;++bt<nn;){var Or=le[bt];we(We,Or,ve(Or),le)}return We}function Mo(le,we){for(var ve=-1,We=le==null?0:le.length;++ve<We&&we(le[ve],ve,le)!==!1;);return le}function Qre(le,we){for(var ve=le==null?0:le.length;ve--&&we(le[ve],ve,le)!==!1;);return le}function BF(le,we){for(var ve=-1,We=le==null?0:le.length;++ve<We;)if(!we(le[ve],ve,le))return!1;return!0}function ku(le,we){for(var ve=-1,We=le==null?0:le.length,bt=0,nn=[];++ve<We;){var Or=le[ve];we(Or,ve,le)&&(nn[bt++]=Or)}return nn}function oS(le,we){var ve=le==null?0:le.length;return!!ve&&sm(le,we,0)>-1}function aP(le,we,ve){for(var We=-1,bt=le==null?0:le.length;++We<bt;)if(ve(we,le[We]))return!0;return!1}function Xn(le,we){for(var ve=-1,We=le==null?0:le.length,bt=Array(We);++ve<We;)bt[ve]=we(le[ve],ve,le);return bt}function Du(le,we){for(var ve=-1,We=we.length,bt=le.length;++ve<We;)le[bt+ve]=we[ve];return le}function lP(le,we,ve,We){var bt=-1,nn=le==null?0:le.length;for(We&&nn&&(ve=le[++bt]);++bt<nn;)ve=we(ve,le[bt],bt,le);return ve}function Zre(le,we,ve,We){var bt=le==null?0:le.length;for(We&&bt&&(ve=le[--bt]);bt--;)ve=we(ve,le[bt],bt,le);return ve}function cP(le,we){for(var ve=-1,We=le==null?0:le.length;++ve<We;)if(we(le[ve],ve,le))return!0;return!1}var Jre=uP("length");function ese(le){return le.split("")}function tse(le){return le.match(ut)||[]}function UF(le,we,ve){var We;return ve(le,function(bt,nn,Or){if(we(bt,nn,Or))return We=nn,!1}),We}function aS(le,we,ve,We){for(var bt=le.length,nn=ve+(We?1:-1);We?nn--:++nn<bt;)if(we(le[nn],nn,le))return nn;return-1}function sm(le,we,ve){return we===we?hse(le,we,ve):aS(le,HF,ve)}function nse(le,we,ve,We){for(var bt=ve-1,nn=le.length;++bt<nn;)if(We(le[bt],we))return bt;return-1}function HF(le){return le!==le}function VF(le,we){var ve=le==null?0:le.length;return ve?fP(le,we)/ve:ne}function uP(le){return function(we){return we==null?n:we[le]}}function dP(le){return function(we){return le==null?n:le[we]}}function qF(le,we,ve,We,bt){return bt(le,function(nn,Or,Tn){ve=We?(We=!1,nn):we(ve,nn,Or,Tn)}),ve}function rse(le,we){var ve=le.length;for(le.sort(we);ve--;)le[ve]=le[ve].value;return le}function fP(le,we){for(var ve,We=-1,bt=le.length;++We<bt;){var nn=we(le[We]);nn!==n&&(ve=ve===n?nn:ve+nn)}return ve}function hP(le,we){for(var ve=-1,We=Array(le);++ve<le;)We[ve]=we(ve);return We}function sse(le,we){return Xn(we,function(ve){return[ve,le[ve]]})}function WF(le){return le&&le.slice(0,XF(le)+1).replace(ae,"")}function Yi(le){return function(we){return le(we)}}function pP(le,we){return Xn(we,function(ve){return le[ve]})}function Wy(le,we){return le.has(we)}function GF(le,we){for(var ve=-1,We=le.length;++ve<We&&sm(we,le[ve],0)>-1;);return ve}function KF(le,we){for(var ve=le.length;ve--&&sm(we,le[ve],0)>-1;);return ve}function ise(le,we){for(var ve=le.length,We=0;ve--;)le[ve]===we&&++We;return We}var ose=dP(Hre),ase=dP(Vre);function lse(le){return"\\"+Wre[le]}function cse(le,we){return le==null?n:le[we]}function im(le){return Fre.test(le)}function use(le){return zre.test(le)}function dse(le){for(var we,ve=[];!(we=le.next()).done;)ve.push(we.value);return ve}function mP(le){var we=-1,ve=Array(le.size);return le.forEach(function(We,bt){ve[++we]=[bt,We]}),ve}function YF(le,we){return function(ve){return le(we(ve))}}function Mu(le,we){for(var ve=-1,We=le.length,bt=0,nn=[];++ve<We;){var Or=le[ve];(Or===we||Or===f)&&(le[ve]=f,nn[bt++]=ve)}return nn}function lS(le){var we=-1,ve=Array(le.size);return le.forEach(function(We){ve[++we]=We}),ve}function fse(le){var we=-1,ve=Array(le.size);return le.forEach(function(We){ve[++we]=[We,We]}),ve}function hse(le,we,ve){for(var We=ve-1,bt=le.length;++We<bt;)if(le[We]===we)return We;return-1}function pse(le,we,ve){for(var We=ve+1;We--;)if(le[We]===we)return We;return We}function om(le){return im(le)?gse(le):Jre(le)}function ma(le){return im(le)?vse(le):ese(le)}function XF(le){for(var we=le.length;we--&&ge.test(le.charAt(we)););return we}var mse=dP(qre);function gse(le){for(var we=sP.lastIndex=0;sP.test(le);)++we;return we}function vse(le){return le.match(sP)||[]}function yse(le){return le.match($re)||[]}var bse=function le(we){we=we==null?as:am.defaults(as.Object(),we,am.pick(as,Bre));var ve=we.Array,We=we.Date,bt=we.Error,nn=we.Function,Or=we.Math,Tn=we.Object,gP=we.RegExp,xse=we.String,Oo=we.TypeError,cS=ve.prototype,wse=nn.prototype,lm=Tn.prototype,uS=we["__core-js_shared__"],dS=wse.toString,pn=lm.hasOwnProperty,_se=0,QF=function(){var w=/[^.]+$/.exec(uS&&uS.keys&&uS.keys.IE_PROTO||"");return w?"Symbol(src)_1."+w:""}(),fS=lm.toString,Sse=dS.call(Tn),Cse=as._,Ese=gP("^"+dS.call(pn).replace(ha,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),hS=OF?we.Buffer:n,Ou=we.Symbol,pS=we.Uint8Array,ZF=hS?hS.allocUnsafe:n,mS=YF(Tn.getPrototypeOf,Tn),JF=Tn.create,e3=lm.propertyIsEnumerable,gS=cS.splice,t3=Ou?Ou.isConcatSpreadable:n,Gy=Ou?Ou.iterator:n,Pf=Ou?Ou.toStringTag:n,vS=function(){try{var w=Of(Tn,"defineProperty");return w({},"",{}),w}catch{}}(),Ase=we.clearTimeout!==as.clearTimeout&&we.clearTimeout,Rse=We&&We.now!==as.Date.now&&We.now,Nse=we.setTimeout!==as.setTimeout&&we.setTimeout,yS=Or.ceil,bS=Or.floor,vP=Tn.getOwnPropertySymbols,Pse=hS?hS.isBuffer:n,n3=we.isFinite,Tse=cS.join,kse=YF(Tn.keys,Tn),Ir=Or.max,Es=Or.min,Dse=We.now,Mse=we.parseInt,r3=Or.random,Ose=cS.reverse,yP=Of(we,"DataView"),Ky=Of(we,"Map"),bP=Of(we,"Promise"),cm=Of(we,"Set"),Yy=Of(we,"WeakMap"),Xy=Of(Tn,"create"),xS=Yy&&new Yy,um={},Ise=If(yP),jse=If(Ky),Lse=If(bP),$se=If(cm),Fse=If(Yy),wS=Ou?Ou.prototype:n,Qy=wS?wS.valueOf:n,s3=wS?wS.toString:n;function q(w){if(cr(w)&&!wt(w)&&!(w instanceof Bt)){if(w instanceof Io)return w;if(pn.call(w,"__wrapped__"))return i4(w)}return new Io(w)}var dm=function(){function w(){}return function(C){if(!Zn(C))return{};if(JF)return JF(C);w.prototype=C;var D=new w;return w.prototype=n,D}}();function _S(){}function Io(w,C){this.__wrapped__=w,this.__actions__=[],this.__chain__=!!C,this.__index__=0,this.__values__=n}q.templateSettings={escape:Pn,evaluate:Cr,interpolate:Dr,variable:"",imports:{_:q}},q.prototype=_S.prototype,q.prototype.constructor=q,Io.prototype=dm(_S.prototype),Io.prototype.constructor=Io;function Bt(w){this.__wrapped__=w,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=X,this.__views__=[]}function zse(){var w=new Bt(this.__wrapped__);return w.__actions__=gi(this.__actions__),w.__dir__=this.__dir__,w.__filtered__=this.__filtered__,w.__iteratees__=gi(this.__iteratees__),w.__takeCount__=this.__takeCount__,w.__views__=gi(this.__views__),w}function Bse(){if(this.__filtered__){var w=new Bt(this);w.__dir__=-1,w.__filtered__=!0}else w=this.clone(),w.__dir__*=-1;return w}function Use(){var w=this.__wrapped__.value(),C=this.__dir__,D=wt(w),O=C<0,F=D?w.length:0,W=eoe(0,F,this.__views__),J=W.start,se=W.end,ue=se-J,Se=O?se:J-1,Ce=this.__iteratees__,Ae=Ce.length,Be=0,Qe=Es(ue,this.__takeCount__);if(!D||!O&&F==ue&&Qe==ue)return N3(w,this.__actions__);var dt=[];e:for(;ue--&&Be<Qe;){Se+=C;for(var Tt=-1,ft=w[Se];++Tt<Ae;){var Lt=Ce[Tt],Ut=Lt.iteratee,Zi=Lt.type,Ws=Ut(ft);if(Zi==H)ft=Ws;else if(!Ws){if(Zi==L)continue e;break e}}dt[Be++]=ft}return dt}Bt.prototype=dm(_S.prototype),Bt.prototype.constructor=Bt;function Tf(w){var C=-1,D=w==null?0:w.length;for(this.clear();++C<D;){var O=w[C];this.set(O[0],O[1])}}function Hse(){this.__data__=Xy?Xy(null):{},this.size=0}function Vse(w){var C=this.has(w)&&delete this.__data__[w];return this.size-=C?1:0,C}function qse(w){var C=this.__data__;if(Xy){var D=C[w];return D===c?n:D}return pn.call(C,w)?C[w]:n}function Wse(w){var C=this.__data__;return Xy?C[w]!==n:pn.call(C,w)}function Gse(w,C){var D=this.__data__;return this.size+=this.has(w)?0:1,D[w]=Xy&&C===n?c:C,this}Tf.prototype.clear=Hse,Tf.prototype.delete=Vse,Tf.prototype.get=qse,Tf.prototype.has=Wse,Tf.prototype.set=Gse;function sc(w){var C=-1,D=w==null?0:w.length;for(this.clear();++C<D;){var O=w[C];this.set(O[0],O[1])}}function Kse(){this.__data__=[],this.size=0}function Yse(w){var C=this.__data__,D=SS(C,w);if(D<0)return!1;var O=C.length-1;return D==O?C.pop():gS.call(C,D,1),--this.size,!0}function Xse(w){var C=this.__data__,D=SS(C,w);return D<0?n:C[D][1]}function Qse(w){return SS(this.__data__,w)>-1}function Zse(w,C){var D=this.__data__,O=SS(D,w);return O<0?(++this.size,D.push([w,C])):D[O][1]=C,this}sc.prototype.clear=Kse,sc.prototype.delete=Yse,sc.prototype.get=Xse,sc.prototype.has=Qse,sc.prototype.set=Zse;function ic(w){var C=-1,D=w==null?0:w.length;for(this.clear();++C<D;){var O=w[C];this.set(O[0],O[1])}}function Jse(){this.size=0,this.__data__={hash:new Tf,map:new(Ky||sc),string:new Tf}}function eie(w){var C=IS(this,w).delete(w);return this.size-=C?1:0,C}function tie(w){return IS(this,w).get(w)}function nie(w){return IS(this,w).has(w)}function rie(w,C){var D=IS(this,w),O=D.size;return D.set(w,C),this.size+=D.size==O?0:1,this}ic.prototype.clear=Jse,ic.prototype.delete=eie,ic.prototype.get=tie,ic.prototype.has=nie,ic.prototype.set=rie;function kf(w){var C=-1,D=w==null?0:w.length;for(this.__data__=new ic;++C<D;)this.add(w[C])}function sie(w){return this.__data__.set(w,c),this}function iie(w){return this.__data__.has(w)}kf.prototype.add=kf.prototype.push=sie,kf.prototype.has=iie;function ga(w){var C=this.__data__=new sc(w);this.size=C.size}function oie(){this.__data__=new sc,this.size=0}function aie(w){var C=this.__data__,D=C.delete(w);return this.size=C.size,D}function lie(w){return this.__data__.get(w)}function cie(w){return this.__data__.has(w)}function uie(w,C){var D=this.__data__;if(D instanceof sc){var O=D.__data__;if(!Ky||O.length<s-1)return O.push([w,C]),this.size=++D.size,this;D=this.__data__=new ic(O)}return D.set(w,C),this.size=D.size,this}ga.prototype.clear=oie,ga.prototype.delete=aie,ga.prototype.get=lie,ga.prototype.has=cie,ga.prototype.set=uie;function i3(w,C){var D=wt(w),O=!D&&jf(w),F=!D&&!O&&Fu(w),W=!D&&!O&&!F&&mm(w),J=D||O||F||W,se=J?hP(w.length,xse):[],ue=se.length;for(var Se in w)(C||pn.call(w,Se))&&!(J&&(Se=="length"||F&&(Se=="offset"||Se=="parent")||W&&(Se=="buffer"||Se=="byteLength"||Se=="byteOffset")||cc(Se,ue)))&&se.push(Se);return se}function o3(w){var C=w.length;return C?w[TP(0,C-1)]:n}function die(w,C){return jS(gi(w),Df(C,0,w.length))}function fie(w){return jS(gi(w))}function xP(w,C,D){(D!==n&&!va(w[C],D)||D===n&&!(C in w))&&oc(w,C,D)}function Zy(w,C,D){var O=w[C];(!(pn.call(w,C)&&va(O,D))||D===n&&!(C in w))&&oc(w,C,D)}function SS(w,C){for(var D=w.length;D--;)if(va(w[D][0],C))return D;return-1}function hie(w,C,D,O){return Iu(w,function(F,W,J){C(O,F,D(F),J)}),O}function a3(w,C){return w&&ol(C,Xr(C),w)}function pie(w,C){return w&&ol(C,yi(C),w)}function oc(w,C,D){C=="__proto__"&&vS?vS(w,C,{configurable:!0,enumerable:!0,value:D,writable:!0}):w[C]=D}function wP(w,C){for(var D=-1,O=C.length,F=ve(O),W=w==null;++D<O;)F[D]=W?n:tT(w,C[D]);return F}function Df(w,C,D){return w===w&&(D!==n&&(w=w<=D?w:D),C!==n&&(w=w>=C?w:C)),w}function jo(w,C,D,O,F,W){var J,se=C&l,ue=C&d,Se=C&p;if(D&&(J=F?D(w,O,F,W):D(w)),J!==n)return J;if(!Zn(w))return w;var Ce=wt(w);if(Ce){if(J=noe(w),!se)return gi(w,J)}else{var Ae=As(w),Be=Ae==Me||Ae==Oe;if(Fu(w))return k3(w,se);if(Ae==At||Ae==he||Be&&!F){if(J=ue||Be?{}:X3(w),!se)return ue?qie(w,pie(J,w)):Vie(w,a3(J,w))}else{if(!Ln[Ae])return F?w:{};J=roe(w,Ae,se)}}W||(W=new ga);var Qe=W.get(w);if(Qe)return Qe;W.set(w,J),E4(w)?w.forEach(function(ft){J.add(jo(ft,C,D,ft,w,W))}):S4(w)&&w.forEach(function(ft,Lt){J.set(Lt,jo(ft,C,D,Lt,w,W))});var dt=Se?ue?BP:zP:ue?yi:Xr,Tt=Ce?n:dt(w);return Mo(Tt||w,function(ft,Lt){Tt&&(Lt=ft,ft=w[Lt]),Zy(J,Lt,jo(ft,C,D,Lt,w,W))}),J}function mie(w){var C=Xr(w);return function(D){return l3(D,w,C)}}function l3(w,C,D){var O=D.length;if(w==null)return!O;for(w=Tn(w);O--;){var F=D[O],W=C[F],J=w[F];if(J===n&&!(F in w)||!W(J))return!1}return!0}function c3(w,C,D){if(typeof w!="function")throw new Oo(o);return ib(function(){w.apply(n,D)},C)}function Jy(w,C,D,O){var F=-1,W=oS,J=!0,se=w.length,ue=[],Se=C.length;if(!se)return ue;D&&(C=Xn(C,Yi(D))),O?(W=aP,J=!1):C.length>=s&&(W=Wy,J=!1,C=new kf(C));e:for(;++F<se;){var Ce=w[F],Ae=D==null?Ce:D(Ce);if(Ce=O||Ce!==0?Ce:0,J&&Ae===Ae){for(var Be=Se;Be--;)if(C[Be]===Ae)continue e;ue.push(Ce)}else W(C,Ae,O)||ue.push(Ce)}return ue}var Iu=j3(il),u3=j3(SP,!0);function gie(w,C){var D=!0;return Iu(w,function(O,F,W){return D=!!C(O,F,W),D}),D}function CS(w,C,D){for(var O=-1,F=w.length;++O<F;){var W=w[O],J=C(W);if(J!=null&&(se===n?J===J&&!Qi(J):D(J,se)))var se=J,ue=W}return ue}function vie(w,C,D,O){var F=w.length;for(D=Rt(D),D<0&&(D=-D>F?0:F+D),O=O===n||O>F?F:Rt(O),O<0&&(O+=F),O=D>O?0:R4(O);D<O;)w[D++]=C;return w}function d3(w,C){var D=[];return Iu(w,function(O,F,W){C(O,F,W)&&D.push(O)}),D}function ls(w,C,D,O,F){var W=-1,J=w.length;for(D||(D=ioe),F||(F=[]);++W<J;){var se=w[W];C>0&&D(se)?C>1?ls(se,C-1,D,O,F):Du(F,se):O||(F[F.length]=se)}return F}var _P=L3(),f3=L3(!0);function il(w,C){return w&&_P(w,C,Xr)}function SP(w,C){return w&&f3(w,C,Xr)}function ES(w,C){return ku(C,function(D){return uc(w[D])})}function Mf(w,C){C=Lu(C,w);for(var D=0,O=C.length;w!=null&&D<O;)w=w[al(C[D++])];return D&&D==O?w:n}function h3(w,C,D){var O=C(w);return wt(w)?O:Du(O,D(w))}function Vs(w){return w==null?w===n?Ve:nt:Pf&&Pf in Tn(w)?Jie(w):foe(w)}function CP(w,C){return w>C}function yie(w,C){return w!=null&&pn.call(w,C)}function bie(w,C){return w!=null&&C in Tn(w)}function xie(w,C,D){return w>=Es(C,D)&&w<Ir(C,D)}function EP(w,C,D){for(var O=D?aP:oS,F=w[0].length,W=w.length,J=W,se=ve(W),ue=1/0,Se=[];J--;){var Ce=w[J];J&&C&&(Ce=Xn(Ce,Yi(C))),ue=Es(Ce.length,ue),se[J]=!D&&(C||F>=120&&Ce.length>=120)?new kf(J&&Ce):n}Ce=w[0];var Ae=-1,Be=se[0];e:for(;++Ae<F&&Se.length<ue;){var Qe=Ce[Ae],dt=C?C(Qe):Qe;if(Qe=D||Qe!==0?Qe:0,!(Be?Wy(Be,dt):O(Se,dt,D))){for(J=W;--J;){var Tt=se[J];if(!(Tt?Wy(Tt,dt):O(w[J],dt,D)))continue e}Be&&Be.push(dt),Se.push(Qe)}}return Se}function wie(w,C,D,O){return il(w,function(F,W,J){C(O,D(F),W,J)}),O}function eb(w,C,D){C=Lu(C,w),w=e4(w,C);var O=w==null?w:w[al($o(C))];return O==null?n:Ki(O,w,D)}function p3(w){return cr(w)&&Vs(w)==he}function _ie(w){return cr(w)&&Vs(w)==gt}function Sie(w){return cr(w)&&Vs(w)==Ne}function tb(w,C,D,O,F){return w===C?!0:w==null||C==null||!cr(w)&&!cr(C)?w!==w&&C!==C:Cie(w,C,D,O,tb,F)}function Cie(w,C,D,O,F,W){var J=wt(w),se=wt(C),ue=J?fe:As(w),Se=se?fe:As(C);ue=ue==he?At:ue,Se=Se==he?At:Se;var Ce=ue==At,Ae=Se==At,Be=ue==Se;if(Be&&Fu(w)){if(!Fu(C))return!1;J=!0,Ce=!1}if(Be&&!Ce)return W||(W=new ga),J||mm(w)?G3(w,C,D,O,F,W):Qie(w,C,ue,D,O,F,W);if(!(D&h)){var Qe=Ce&&pn.call(w,"__wrapped__"),dt=Ae&&pn.call(C,"__wrapped__");if(Qe||dt){var Tt=Qe?w.value():w,ft=dt?C.value():C;return W||(W=new ga),F(Tt,ft,D,O,W)}}return Be?(W||(W=new ga),Zie(w,C,D,O,F,W)):!1}function Eie(w){return cr(w)&&As(w)==Fe}function AP(w,C,D,O){var F=D.length,W=F,J=!O;if(w==null)return!W;for(w=Tn(w);F--;){var se=D[F];if(J&&se[2]?se[1]!==w[se[0]]:!(se[0]in w))return!1}for(;++F<W;){se=D[F];var ue=se[0],Se=w[ue],Ce=se[1];if(J&&se[2]){if(Se===n&&!(ue in w))return!1}else{var Ae=new ga;if(O)var Be=O(Se,Ce,ue,w,C,Ae);if(!(Be===n?tb(Ce,Se,h|m,O,Ae):Be))return!1}}return!0}function m3(w){if(!Zn(w)||aoe(w))return!1;var C=uc(w)?Ese:hn;return C.test(If(w))}function Aie(w){return cr(w)&&Vs(w)==me}function Rie(w){return cr(w)&&As(w)==Re}function Nie(w){return cr(w)&&US(w.length)&&!!Un[Vs(w)]}function g3(w){return typeof w=="function"?w:w==null?bi:typeof w=="object"?wt(w)?b3(w[0],w[1]):y3(w):$4(w)}function RP(w){if(!sb(w))return kse(w);var C=[];for(var D in Tn(w))pn.call(w,D)&&D!="constructor"&&C.push(D);return C}function Pie(w){if(!Zn(w))return doe(w);var C=sb(w),D=[];for(var O in w)O=="constructor"&&(C||!pn.call(w,O))||D.push(O);return D}function NP(w,C){return w<C}function v3(w,C){var D=-1,O=vi(w)?ve(w.length):[];return Iu(w,function(F,W,J){O[++D]=C(F,W,J)}),O}function y3(w){var C=HP(w);return C.length==1&&C[0][2]?Z3(C[0][0],C[0][1]):function(D){return D===w||AP(D,w,C)}}function b3(w,C){return qP(w)&&Q3(C)?Z3(al(w),C):function(D){var O=tT(D,w);return O===n&&O===C?nT(D,w):tb(C,O,h|m)}}function AS(w,C,D,O,F){w!==C&&_P(C,function(W,J){if(F||(F=new ga),Zn(W))Tie(w,C,J,D,AS,O,F);else{var se=O?O(GP(w,J),W,J+"",w,C,F):n;se===n&&(se=W),xP(w,J,se)}},yi)}function Tie(w,C,D,O,F,W,J){var se=GP(w,D),ue=GP(C,D),Se=J.get(ue);if(Se){xP(w,D,Se);return}var Ce=W?W(se,ue,D+"",w,C,J):n,Ae=Ce===n;if(Ae){var Be=wt(ue),Qe=!Be&&Fu(ue),dt=!Be&&!Qe&&mm(ue);Ce=ue,Be||Qe||dt?wt(se)?Ce=se:vr(se)?Ce=gi(se):Qe?(Ae=!1,Ce=k3(ue,!0)):dt?(Ae=!1,Ce=D3(ue,!0)):Ce=[]:ob(ue)||jf(ue)?(Ce=se,jf(se)?Ce=N4(se):(!Zn(se)||uc(se))&&(Ce=X3(ue))):Ae=!1}Ae&&(J.set(ue,Ce),F(Ce,ue,O,W,J),J.delete(ue)),xP(w,D,Ce)}function x3(w,C){var D=w.length;if(D)return C+=C<0?D:0,cc(C,D)?w[C]:n}function w3(w,C,D){C.length?C=Xn(C,function(W){return wt(W)?function(J){return Mf(J,W.length===1?W[0]:W)}:W}):C=[bi];var O=-1;C=Xn(C,Yi(at()));var F=v3(w,function(W,J,se){var ue=Xn(C,function(Se){return Se(W)});return{criteria:ue,index:++O,value:W}});return rse(F,function(W,J){return Hie(W,J,D)})}function kie(w,C){return _3(w,C,function(D,O){return nT(w,O)})}function _3(w,C,D){for(var O=-1,F=C.length,W={};++O<F;){var J=C[O],se=Mf(w,J);D(se,J)&&nb(W,Lu(J,w),se)}return W}function Die(w){return function(C){return Mf(C,w)}}function PP(w,C,D,O){var F=O?nse:sm,W=-1,J=C.length,se=w;for(w===C&&(C=gi(C)),D&&(se=Xn(w,Yi(D)));++W<J;)for(var ue=0,Se=C[W],Ce=D?D(Se):Se;(ue=F(se,Ce,ue,O))>-1;)se!==w&&gS.call(se,ue,1),gS.call(w,ue,1);return w}function S3(w,C){for(var D=w?C.length:0,O=D-1;D--;){var F=C[D];if(D==O||F!==W){var W=F;cc(F)?gS.call(w,F,1):MP(w,F)}}return w}function TP(w,C){return w+bS(r3()*(C-w+1))}function Mie(w,C,D,O){for(var F=-1,W=Ir(yS((C-w)/(D||1)),0),J=ve(W);W--;)J[O?W:++F]=w,w+=D;return J}function kP(w,C){var D="";if(!w||C<1||C>U)return D;do C%2&&(D+=w),C=bS(C/2),C&&(w+=w);while(C);return D}function Dt(w,C){return KP(J3(w,C,bi),w+"")}function Oie(w){return o3(gm(w))}function Iie(w,C){var D=gm(w);return jS(D,Df(C,0,D.length))}function nb(w,C,D,O){if(!Zn(w))return w;C=Lu(C,w);for(var F=-1,W=C.length,J=W-1,se=w;se!=null&&++F<W;){var ue=al(C[F]),Se=D;if(ue==="__proto__"||ue==="constructor"||ue==="prototype")return w;if(F!=J){var Ce=se[ue];Se=O?O(Ce,ue,se):n,Se===n&&(Se=Zn(Ce)?Ce:cc(C[F+1])?[]:{})}Zy(se,ue,Se),se=se[ue]}return w}var C3=xS?function(w,C){return xS.set(w,C),w}:bi,jie=vS?function(w,C){return vS(w,"toString",{configurable:!0,enumerable:!1,value:sT(C),writable:!0})}:bi;function Lie(w){return jS(gm(w))}function Lo(w,C,D){var O=-1,F=w.length;C<0&&(C=-C>F?0:F+C),D=D>F?F:D,D<0&&(D+=F),F=C>D?0:D-C>>>0,C>>>=0;for(var W=ve(F);++O<F;)W[O]=w[O+C];return W}function $ie(w,C){var D;return Iu(w,function(O,F,W){return D=C(O,F,W),!D}),!!D}function RS(w,C,D){var O=0,F=w==null?O:w.length;if(typeof C=="number"&&C===C&&F<=Y){for(;O<F;){var W=O+F>>>1,J=w[W];J!==null&&!Qi(J)&&(D?J<=C:J<C)?O=W+1:F=W}return F}return DP(w,C,bi,D)}function DP(w,C,D,O){var F=0,W=w==null?0:w.length;if(W===0)return 0;C=D(C);for(var J=C!==C,se=C===null,ue=Qi(C),Se=C===n;F<W;){var Ce=bS((F+W)/2),Ae=D(w[Ce]),Be=Ae!==n,Qe=Ae===null,dt=Ae===Ae,Tt=Qi(Ae);if(J)var ft=O||dt;else Se?ft=dt&&(O||Be):se?ft=dt&&Be&&(O||!Qe):ue?ft=dt&&Be&&!Qe&&(O||!Tt):Qe||Tt?ft=!1:ft=O?Ae<=C:Ae<C;ft?F=Ce+1:W=Ce}return Es(W,G)}function E3(w,C){for(var D=-1,O=w.length,F=0,W=[];++D<O;){var J=w[D],se=C?C(J):J;if(!D||!va(se,ue)){var ue=se;W[F++]=J===0?0:J}}return W}function A3(w){return typeof w=="number"?w:Qi(w)?ne:+w}function Xi(w){if(typeof w=="string")return w;if(wt(w))return Xn(w,Xi)+"";if(Qi(w))return s3?s3.call(w):"";var C=w+"";return C=="0"&&1/w==-V?"-0":C}function ju(w,C,D){var O=-1,F=oS,W=w.length,J=!0,se=[],ue=se;if(D)J=!1,F=aP;else if(W>=s){var Se=C?null:Yie(w);if(Se)return lS(Se);J=!1,F=Wy,ue=new kf}else ue=C?[]:se;e:for(;++O<W;){var Ce=w[O],Ae=C?C(Ce):Ce;if(Ce=D||Ce!==0?Ce:0,J&&Ae===Ae){for(var Be=ue.length;Be--;)if(ue[Be]===Ae)continue e;C&&ue.push(Ae),se.push(Ce)}else F(ue,Ae,D)||(ue!==se&&ue.push(Ae),se.push(Ce))}return se}function MP(w,C){return C=Lu(C,w),w=e4(w,C),w==null||delete w[al($o(C))]}function R3(w,C,D,O){return nb(w,C,D(Mf(w,C)),O)}function NS(w,C,D,O){for(var F=w.length,W=O?F:-1;(O?W--:++W<F)&&C(w[W],W,w););return D?Lo(w,O?0:W,O?W+1:F):Lo(w,O?W+1:0,O?F:W)}function N3(w,C){var D=w;return D instanceof Bt&&(D=D.value()),lP(C,function(O,F){return F.func.apply(F.thisArg,Du([O],F.args))},D)}function OP(w,C,D){var O=w.length;if(O<2)return O?ju(w[0]):[];for(var F=-1,W=ve(O);++F<O;)for(var J=w[F],se=-1;++se<O;)se!=F&&(W[F]=Jy(W[F]||J,w[se],C,D));return ju(ls(W,1),C,D)}function P3(w,C,D){for(var O=-1,F=w.length,W=C.length,J={};++O<F;){var se=O<W?C[O]:n;D(J,w[O],se)}return J}function IP(w){return vr(w)?w:[]}function jP(w){return typeof w=="function"?w:bi}function Lu(w,C){return wt(w)?w:qP(w,C)?[w]:s4(un(w))}var Fie=Dt;function $u(w,C,D){var O=w.length;return D=D===n?O:D,!C&&D>=O?w:Lo(w,C,D)}var T3=Ase||function(w){return as.clearTimeout(w)};function k3(w,C){if(C)return w.slice();var D=w.length,O=ZF?ZF(D):new w.constructor(D);return w.copy(O),O}function LP(w){var C=new w.constructor(w.byteLength);return new pS(C).set(new pS(w)),C}function zie(w,C){var D=C?LP(w.buffer):w.buffer;return new w.constructor(D,w.byteOffset,w.byteLength)}function Bie(w){var C=new w.constructor(w.source,st.exec(w));return C.lastIndex=w.lastIndex,C}function Uie(w){return Qy?Tn(Qy.call(w)):{}}function D3(w,C){var D=C?LP(w.buffer):w.buffer;return new w.constructor(D,w.byteOffset,w.length)}function M3(w,C){if(w!==C){var D=w!==n,O=w===null,F=w===w,W=Qi(w),J=C!==n,se=C===null,ue=C===C,Se=Qi(C);if(!se&&!Se&&!W&&w>C||W&&J&&ue&&!se&&!Se||O&&J&&ue||!D&&ue||!F)return 1;if(!O&&!W&&!Se&&w<C||Se&&D&&F&&!O&&!W||se&&D&&F||!J&&F||!ue)return-1}return 0}function Hie(w,C,D){for(var O=-1,F=w.criteria,W=C.criteria,J=F.length,se=D.length;++O<J;){var ue=M3(F[O],W[O]);if(ue){if(O>=se)return ue;var Se=D[O];return ue*(Se=="desc"?-1:1)}}return w.index-C.index}function O3(w,C,D,O){for(var F=-1,W=w.length,J=D.length,se=-1,ue=C.length,Se=Ir(W-J,0),Ce=ve(ue+Se),Ae=!O;++se<ue;)Ce[se]=C[se];for(;++F<J;)(Ae||F<W)&&(Ce[D[F]]=w[F]);for(;Se--;)Ce[se++]=w[F++];return Ce}function I3(w,C,D,O){for(var F=-1,W=w.length,J=-1,se=D.length,ue=-1,Se=C.length,Ce=Ir(W-se,0),Ae=ve(Ce+Se),Be=!O;++F<Ce;)Ae[F]=w[F];for(var Qe=F;++ue<Se;)Ae[Qe+ue]=C[ue];for(;++J<se;)(Be||F<W)&&(Ae[Qe+D[J]]=w[F++]);return Ae}function gi(w,C){var D=-1,O=w.length;for(C||(C=ve(O));++D<O;)C[D]=w[D];return C}function ol(w,C,D,O){var F=!D;D||(D={});for(var W=-1,J=C.length;++W<J;){var se=C[W],ue=O?O(D[se],w[se],se,D,w):n;ue===n&&(ue=w[se]),F?oc(D,se,ue):Zy(D,se,ue)}return D}function Vie(w,C){return ol(w,VP(w),C)}function qie(w,C){return ol(w,K3(w),C)}function PS(w,C){return function(D,O){var F=wt(D)?Xre:hie,W=C?C():{};return F(D,w,at(O,2),W)}}function fm(w){return Dt(function(C,D){var O=-1,F=D.length,W=F>1?D[F-1]:n,J=F>2?D[2]:n;for(W=w.length>3&&typeof W=="function"?(F--,W):n,J&&qs(D[0],D[1],J)&&(W=F<3?n:W,F=1),C=Tn(C);++O<F;){var se=D[O];se&&w(C,se,O,W)}return C})}function j3(w,C){return function(D,O){if(D==null)return D;if(!vi(D))return w(D,O);for(var F=D.length,W=C?F:-1,J=Tn(D);(C?W--:++W<F)&&O(J[W],W,J)!==!1;);return D}}function L3(w){return function(C,D,O){for(var F=-1,W=Tn(C),J=O(C),se=J.length;se--;){var ue=J[w?se:++F];if(D(W[ue],ue,W)===!1)break}return C}}function Wie(w,C,D){var O=C&y,F=rb(w);function W(){var J=this&&this!==as&&this instanceof W?F:w;return J.apply(O?D:this,arguments)}return W}function $3(w){return function(C){C=un(C);var D=im(C)?ma(C):n,O=D?D[0]:C.charAt(0),F=D?$u(D,1).join(""):C.slice(1);return O[w]()+F}}function hm(w){return function(C){return lP(j4(I4(C).replace(jre,"")),w,"")}}function rb(w){return function(){var C=arguments;switch(C.length){case 0:return new w;case 1:return new w(C[0]);case 2:return new w(C[0],C[1]);case 3:return new w(C[0],C[1],C[2]);case 4:return new w(C[0],C[1],C[2],C[3]);case 5:return new w(C[0],C[1],C[2],C[3],C[4]);case 6:return new w(C[0],C[1],C[2],C[3],C[4],C[5]);case 7:return new w(C[0],C[1],C[2],C[3],C[4],C[5],C[6])}var D=dm(w.prototype),O=w.apply(D,C);return Zn(O)?O:D}}function Gie(w,C,D){var O=rb(w);function F(){for(var W=arguments.length,J=ve(W),se=W,ue=pm(F);se--;)J[se]=arguments[se];var Se=W<3&&J[0]!==ue&&J[W-1]!==ue?[]:Mu(J,ue);if(W-=Se.length,W<D)return H3(w,C,TS,F.placeholder,n,J,Se,n,n,D-W);var Ce=this&&this!==as&&this instanceof F?O:w;return Ki(Ce,this,J)}return F}function F3(w){return function(C,D,O){var F=Tn(C);if(!vi(C)){var W=at(D,3);C=Xr(C),D=function(se){return W(F[se],se,F)}}var J=w(C,D,O);return J>-1?F[W?C[J]:J]:n}}function z3(w){return lc(function(C){var D=C.length,O=D,F=Io.prototype.thru;for(w&&C.reverse();O--;){var W=C[O];if(typeof W!="function")throw new Oo(o);if(F&&!J&&OS(W)=="wrapper")var J=new Io([],!0)}for(O=J?O:D;++O<D;){W=C[O];var se=OS(W),ue=se=="wrapper"?UP(W):n;ue&&WP(ue[0])&&ue[1]==(T|x|A|E)&&!ue[4].length&&ue[9]==1?J=J[OS(ue[0])].apply(J,ue[3]):J=W.length==1&&WP(W)?J[se]():J.thru(W)}return function(){var Se=arguments,Ce=Se[0];if(J&&Se.length==1&&wt(Ce))return J.plant(Ce).value();for(var Ae=0,Be=D?C[Ae].apply(this,Se):Ce;++Ae<D;)Be=C[Ae].call(this,Be);return Be}})}function TS(w,C,D,O,F,W,J,se,ue,Se){var Ce=C&T,Ae=C&y,Be=C&g,Qe=C&(x|_),dt=C&P,Tt=Be?n:rb(w);function ft(){for(var Lt=arguments.length,Ut=ve(Lt),Zi=Lt;Zi--;)Ut[Zi]=arguments[Zi];if(Qe)var Ws=pm(ft),Ji=ise(Ut,Ws);if(O&&(Ut=O3(Ut,O,F,Qe)),W&&(Ut=I3(Ut,W,J,Qe)),Lt-=Ji,Qe&&Lt<Se){var yr=Mu(Ut,Ws);return H3(w,C,TS,ft.placeholder,D,Ut,yr,se,ue,Se-Lt)}var ya=Ae?D:this,fc=Be?ya[w]:w;return Lt=Ut.length,se?Ut=hoe(Ut,se):dt&&Lt>1&&Ut.reverse(),Ce&&ue<Lt&&(Ut.length=ue),this&&this!==as&&this instanceof ft&&(fc=Tt||rb(fc)),fc.apply(ya,Ut)}return ft}function B3(w,C){return function(D,O){return wie(D,w,C(O),{})}}function kS(w,C){return function(D,O){var F;if(D===n&&O===n)return C;if(D!==n&&(F=D),O!==n){if(F===n)return O;typeof D=="string"||typeof O=="string"?(D=Xi(D),O=Xi(O)):(D=A3(D),O=A3(O)),F=w(D,O)}return F}}function $P(w){return lc(function(C){return C=Xn(C,Yi(at())),Dt(function(D){var O=this;return w(C,function(F){return Ki(F,O,D)})})})}function DS(w,C){C=C===n?" ":Xi(C);var D=C.length;if(D<2)return D?kP(C,w):C;var O=kP(C,yS(w/om(C)));return im(C)?$u(ma(O),0,w).join(""):O.slice(0,w)}function Kie(w,C,D,O){var F=C&y,W=rb(w);function J(){for(var se=-1,ue=arguments.length,Se=-1,Ce=O.length,Ae=ve(Ce+ue),Be=this&&this!==as&&this instanceof J?W:w;++Se<Ce;)Ae[Se]=O[Se];for(;ue--;)Ae[Se++]=arguments[++se];return Ki(Be,F?D:this,Ae)}return J}function U3(w){return function(C,D,O){return O&&typeof O!="number"&&qs(C,D,O)&&(D=O=n),C=dc(C),D===n?(D=C,C=0):D=dc(D),O=O===n?C<D?1:-1:dc(O),Mie(C,D,O,w)}}function MS(w){return function(C,D){return typeof C=="string"&&typeof D=="string"||(C=Fo(C),D=Fo(D)),w(C,D)}}function H3(w,C,D,O,F,W,J,se,ue,Se){var Ce=C&x,Ae=Ce?J:n,Be=Ce?n:J,Qe=Ce?W:n,dt=Ce?n:W;C|=Ce?A:N,C&=~(Ce?N:A),C&v||(C&=~(y|g));var Tt=[w,C,F,Qe,Ae,dt,Be,se,ue,Se],ft=D.apply(n,Tt);return WP(w)&&t4(ft,Tt),ft.placeholder=O,n4(ft,w,C)}function FP(w){var C=Or[w];return function(D,O){if(D=Fo(D),O=O==null?0:Es(Rt(O),292),O&&n3(D)){var F=(un(D)+"e").split("e"),W=C(F[0]+"e"+(+F[1]+O));return F=(un(W)+"e").split("e"),+(F[0]+"e"+(+F[1]-O))}return C(D)}}var Yie=cm&&1/lS(new cm([,-0]))[1]==V?function(w){return new cm(w)}:aT;function V3(w){return function(C){var D=As(C);return D==Fe?mP(C):D==Re?fse(C):sse(C,w(C))}}function ac(w,C,D,O,F,W,J,se){var ue=C&g;if(!ue&&typeof w!="function")throw new Oo(o);var Se=O?O.length:0;if(Se||(C&=~(A|N),O=F=n),J=J===n?J:Ir(Rt(J),0),se=se===n?se:Rt(se),Se-=F?F.length:0,C&N){var Ce=O,Ae=F;O=F=n}var Be=ue?n:UP(w),Qe=[w,C,D,O,F,Ce,Ae,W,J,se];if(Be&&uoe(Qe,Be),w=Qe[0],C=Qe[1],D=Qe[2],O=Qe[3],F=Qe[4],se=Qe[9]=Qe[9]===n?ue?0:w.length:Ir(Qe[9]-Se,0),!se&&C&(x|_)&&(C&=~(x|_)),!C||C==y)var dt=Wie(w,C,D);else C==x||C==_?dt=Gie(w,C,se):(C==A||C==(y|A))&&!F.length?dt=Kie(w,C,D,O):dt=TS.apply(n,Qe);var Tt=Be?C3:t4;return n4(Tt(dt,Qe),w,C)}function q3(w,C,D,O){return w===n||va(w,lm[D])&&!pn.call(O,D)?C:w}function W3(w,C,D,O,F,W){return Zn(w)&&Zn(C)&&(W.set(C,w),AS(w,C,n,W3,W),W.delete(C)),w}function Xie(w){return ob(w)?n:w}function G3(w,C,D,O,F,W){var J=D&h,se=w.length,ue=C.length;if(se!=ue&&!(J&&ue>se))return!1;var Se=W.get(w),Ce=W.get(C);if(Se&&Ce)return Se==C&&Ce==w;var Ae=-1,Be=!0,Qe=D&m?new kf:n;for(W.set(w,C),W.set(C,w);++Ae<se;){var dt=w[Ae],Tt=C[Ae];if(O)var ft=J?O(Tt,dt,Ae,C,w,W):O(dt,Tt,Ae,w,C,W);if(ft!==n){if(ft)continue;Be=!1;break}if(Qe){if(!cP(C,function(Lt,Ut){if(!Wy(Qe,Ut)&&(dt===Lt||F(dt,Lt,D,O,W)))return Qe.push(Ut)})){Be=!1;break}}else if(!(dt===Tt||F(dt,Tt,D,O,W))){Be=!1;break}}return W.delete(w),W.delete(C),Be}function Qie(w,C,D,O,F,W,J){switch(D){case kt:if(w.byteLength!=C.byteLength||w.byteOffset!=C.byteOffset)return!1;w=w.buffer,C=C.buffer;case gt:return!(w.byteLength!=C.byteLength||!W(new pS(w),new pS(C)));case xe:case Ne:case ot:return va(+w,+C);case Le:return w.name==C.name&&w.message==C.message;case me:case Pe:return w==C+"";case Fe:var se=mP;case Re:var ue=O&h;if(se||(se=lS),w.size!=C.size&&!ue)return!1;var Se=J.get(w);if(Se)return Se==C;O|=m,J.set(w,C);var Ce=G3(se(w),se(C),O,F,W,J);return J.delete(w),Ce;case Ee:if(Qy)return Qy.call(w)==Qy.call(C)}return!1}function Zie(w,C,D,O,F,W){var J=D&h,se=zP(w),ue=se.length,Se=zP(C),Ce=Se.length;if(ue!=Ce&&!J)return!1;for(var Ae=ue;Ae--;){var Be=se[Ae];if(!(J?Be in C:pn.call(C,Be)))return!1}var Qe=W.get(w),dt=W.get(C);if(Qe&&dt)return Qe==C&&dt==w;var Tt=!0;W.set(w,C),W.set(C,w);for(var ft=J;++Ae<ue;){Be=se[Ae];var Lt=w[Be],Ut=C[Be];if(O)var Zi=J?O(Ut,Lt,Be,C,w,W):O(Lt,Ut,Be,w,C,W);if(!(Zi===n?Lt===Ut||F(Lt,Ut,D,O,W):Zi)){Tt=!1;break}ft||(ft=Be=="constructor")}if(Tt&&!ft){var Ws=w.constructor,Ji=C.constructor;Ws!=Ji&&"constructor"in w&&"constructor"in C&&!(typeof Ws=="function"&&Ws instanceof Ws&&typeof Ji=="function"&&Ji instanceof Ji)&&(Tt=!1)}return W.delete(w),W.delete(C),Tt}function lc(w){return KP(J3(w,n,l4),w+"")}function zP(w){return h3(w,Xr,VP)}function BP(w){return h3(w,yi,K3)}var UP=xS?function(w){return xS.get(w)}:aT;function OS(w){for(var C=w.name+"",D=um[C],O=pn.call(um,C)?D.length:0;O--;){var F=D[O],W=F.func;if(W==null||W==w)return F.name}return C}function pm(w){var C=pn.call(q,"placeholder")?q:w;return C.placeholder}function at(){var w=q.iteratee||iT;return w=w===iT?g3:w,arguments.length?w(arguments[0],arguments[1]):w}function IS(w,C){var D=w.__data__;return ooe(C)?D[typeof C=="string"?"string":"hash"]:D.map}function HP(w){for(var C=Xr(w),D=C.length;D--;){var O=C[D],F=w[O];C[D]=[O,F,Q3(F)]}return C}function Of(w,C){var D=cse(w,C);return m3(D)?D:n}function Jie(w){var C=pn.call(w,Pf),D=w[Pf];try{w[Pf]=n;var O=!0}catch{}var F=fS.call(w);return O&&(C?w[Pf]=D:delete w[Pf]),F}var VP=vP?function(w){return w==null?[]:(w=Tn(w),ku(vP(w),function(C){return e3.call(w,C)}))}:lT,K3=vP?function(w){for(var C=[];w;)Du(C,VP(w)),w=mS(w);return C}:lT,As=Vs;(yP&&As(new yP(new ArrayBuffer(1)))!=kt||Ky&&As(new Ky)!=Fe||bP&&As(bP.resolve())!=ee||cm&&As(new cm)!=Re||Yy&&As(new Yy)!=tt)&&(As=function(w){var C=Vs(w),D=C==At?w.constructor:n,O=D?If(D):"";if(O)switch(O){case Ise:return kt;case jse:return Fe;case Lse:return ee;case $se:return Re;case Fse:return tt}return C});function eoe(w,C,D){for(var O=-1,F=D.length;++O<F;){var W=D[O],J=W.size;switch(W.type){case"drop":w+=J;break;case"dropRight":C-=J;break;case"take":C=Es(C,w+J);break;case"takeRight":w=Ir(w,C-J);break}}return{start:w,end:C}}function toe(w){var C=w.match(ze);return C?C[1].split(Ke):[]}function Y3(w,C,D){C=Lu(C,w);for(var O=-1,F=C.length,W=!1;++O<F;){var J=al(C[O]);if(!(W=w!=null&&D(w,J)))break;w=w[J]}return W||++O!=F?W:(F=w==null?0:w.length,!!F&&US(F)&&cc(J,F)&&(wt(w)||jf(w)))}function noe(w){var C=w.length,D=new w.constructor(C);return C&&typeof w[0]=="string"&&pn.call(w,"index")&&(D.index=w.index,D.input=w.input),D}function X3(w){return typeof w.constructor=="function"&&!sb(w)?dm(mS(w)):{}}function roe(w,C,D){var O=w.constructor;switch(C){case gt:return LP(w);case xe:case Ne:return new O(+w);case kt:return zie(w,D);case ln:case gr:case _n:case pi:case or:case mi:case $e:case Xe:case ht:return D3(w,D);case Fe:return new O;case ot:case Pe:return new O(w);case me:return Bie(w);case Re:return new O;case Ee:return Uie(w)}}function soe(w,C){var D=C.length;if(!D)return w;var O=D-1;return C[O]=(D>1?"& ":"")+C[O],C=C.join(D>2?", ":" "),w.replace(_e,`{
|
||
/* [wrapped with `+C+`] */
|
||
`)}function ioe(w){return wt(w)||jf(w)||!!(t3&&w&&w[t3])}function cc(w,C){var D=typeof w;return C=C??U,!!C&&(D=="number"||D!="symbol"&&Mr.test(w))&&w>-1&&w%1==0&&w<C}function qs(w,C,D){if(!Zn(D))return!1;var O=typeof C;return(O=="number"?vi(D)&&cc(C,D.length):O=="string"&&C in D)?va(D[C],w):!1}function qP(w,C){if(wt(w))return!1;var D=typeof w;return D=="number"||D=="symbol"||D=="boolean"||w==null||Qi(w)?!0:Yr.test(w)||!Gi.test(w)||C!=null&&w in Tn(C)}function ooe(w){var C=typeof w;return C=="string"||C=="number"||C=="symbol"||C=="boolean"?w!=="__proto__":w===null}function WP(w){var C=OS(w),D=q[C];if(typeof D!="function"||!(C in Bt.prototype))return!1;if(w===D)return!0;var O=UP(D);return!!O&&w===O[0]}function aoe(w){return!!QF&&QF in w}var loe=uS?uc:cT;function sb(w){var C=w&&w.constructor,D=typeof C=="function"&&C.prototype||lm;return w===D}function Q3(w){return w===w&&!Zn(w)}function Z3(w,C){return function(D){return D==null?!1:D[w]===C&&(C!==n||w in Tn(D))}}function coe(w){var C=zS(w,function(O){return D.size===u&&D.clear(),O}),D=C.cache;return C}function uoe(w,C){var D=w[1],O=C[1],F=D|O,W=F<(y|g|T),J=O==T&&D==x||O==T&&D==E&&w[7].length<=C[8]||O==(T|E)&&C[7].length<=C[8]&&D==x;if(!(W||J))return w;O&y&&(w[2]=C[2],F|=D&y?0:v);var se=C[3];if(se){var ue=w[3];w[3]=ue?O3(ue,se,C[4]):se,w[4]=ue?Mu(w[3],f):C[4]}return se=C[5],se&&(ue=w[5],w[5]=ue?I3(ue,se,C[6]):se,w[6]=ue?Mu(w[5],f):C[6]),se=C[7],se&&(w[7]=se),O&T&&(w[8]=w[8]==null?C[8]:Es(w[8],C[8])),w[9]==null&&(w[9]=C[9]),w[0]=C[0],w[1]=F,w}function doe(w){var C=[];if(w!=null)for(var D in Tn(w))C.push(D);return C}function foe(w){return fS.call(w)}function J3(w,C,D){return C=Ir(C===n?w.length-1:C,0),function(){for(var O=arguments,F=-1,W=Ir(O.length-C,0),J=ve(W);++F<W;)J[F]=O[C+F];F=-1;for(var se=ve(C+1);++F<C;)se[F]=O[F];return se[C]=D(J),Ki(w,this,se)}}function e4(w,C){return C.length<2?w:Mf(w,Lo(C,0,-1))}function hoe(w,C){for(var D=w.length,O=Es(C.length,D),F=gi(w);O--;){var W=C[O];w[O]=cc(W,D)?F[W]:n}return w}function GP(w,C){if(!(C==="constructor"&&typeof w[C]=="function")&&C!="__proto__")return w[C]}var t4=r4(C3),ib=Nse||function(w,C){return as.setTimeout(w,C)},KP=r4(jie);function n4(w,C,D){var O=C+"";return KP(w,soe(O,poe(toe(O),D)))}function r4(w){var C=0,D=0;return function(){var O=Dse(),F=j-(O-D);if(D=O,F>0){if(++C>=I)return arguments[0]}else C=0;return w.apply(n,arguments)}}function jS(w,C){var D=-1,O=w.length,F=O-1;for(C=C===n?O:C;++D<C;){var W=TP(D,F),J=w[W];w[W]=w[D],w[D]=J}return w.length=C,w}var s4=coe(function(w){var C=[];return w.charCodeAt(0)===46&&C.push(""),w.replace(rc,function(D,O,F,W){C.push(F?W.replace(xt,"$1"):O||D)}),C});function al(w){if(typeof w=="string"||Qi(w))return w;var C=w+"";return C=="0"&&1/w==-V?"-0":C}function If(w){if(w!=null){try{return dS.call(w)}catch{}try{return w+""}catch{}}return""}function poe(w,C){return Mo(Z,function(D){var O="_."+D[0];C&D[1]&&!oS(w,O)&&w.push(O)}),w.sort()}function i4(w){if(w instanceof Bt)return w.clone();var C=new Io(w.__wrapped__,w.__chain__);return C.__actions__=gi(w.__actions__),C.__index__=w.__index__,C.__values__=w.__values__,C}function moe(w,C,D){(D?qs(w,C,D):C===n)?C=1:C=Ir(Rt(C),0);var O=w==null?0:w.length;if(!O||C<1)return[];for(var F=0,W=0,J=ve(yS(O/C));F<O;)J[W++]=Lo(w,F,F+=C);return J}function goe(w){for(var C=-1,D=w==null?0:w.length,O=0,F=[];++C<D;){var W=w[C];W&&(F[O++]=W)}return F}function voe(){var w=arguments.length;if(!w)return[];for(var C=ve(w-1),D=arguments[0],O=w;O--;)C[O-1]=arguments[O];return Du(wt(D)?gi(D):[D],ls(C,1))}var yoe=Dt(function(w,C){return vr(w)?Jy(w,ls(C,1,vr,!0)):[]}),boe=Dt(function(w,C){var D=$o(C);return vr(D)&&(D=n),vr(w)?Jy(w,ls(C,1,vr,!0),at(D,2)):[]}),xoe=Dt(function(w,C){var D=$o(C);return vr(D)&&(D=n),vr(w)?Jy(w,ls(C,1,vr,!0),n,D):[]});function woe(w,C,D){var O=w==null?0:w.length;return O?(C=D||C===n?1:Rt(C),Lo(w,C<0?0:C,O)):[]}function _oe(w,C,D){var O=w==null?0:w.length;return O?(C=D||C===n?1:Rt(C),C=O-C,Lo(w,0,C<0?0:C)):[]}function Soe(w,C){return w&&w.length?NS(w,at(C,3),!0,!0):[]}function Coe(w,C){return w&&w.length?NS(w,at(C,3),!0):[]}function Eoe(w,C,D,O){var F=w==null?0:w.length;return F?(D&&typeof D!="number"&&qs(w,C,D)&&(D=0,O=F),vie(w,C,D,O)):[]}function o4(w,C,D){var O=w==null?0:w.length;if(!O)return-1;var F=D==null?0:Rt(D);return F<0&&(F=Ir(O+F,0)),aS(w,at(C,3),F)}function a4(w,C,D){var O=w==null?0:w.length;if(!O)return-1;var F=O-1;return D!==n&&(F=Rt(D),F=D<0?Ir(O+F,0):Es(F,O-1)),aS(w,at(C,3),F,!0)}function l4(w){var C=w==null?0:w.length;return C?ls(w,1):[]}function Aoe(w){var C=w==null?0:w.length;return C?ls(w,V):[]}function Roe(w,C){var D=w==null?0:w.length;return D?(C=C===n?1:Rt(C),ls(w,C)):[]}function Noe(w){for(var C=-1,D=w==null?0:w.length,O={};++C<D;){var F=w[C];O[F[0]]=F[1]}return O}function c4(w){return w&&w.length?w[0]:n}function Poe(w,C,D){var O=w==null?0:w.length;if(!O)return-1;var F=D==null?0:Rt(D);return F<0&&(F=Ir(O+F,0)),sm(w,C,F)}function Toe(w){var C=w==null?0:w.length;return C?Lo(w,0,-1):[]}var koe=Dt(function(w){var C=Xn(w,IP);return C.length&&C[0]===w[0]?EP(C):[]}),Doe=Dt(function(w){var C=$o(w),D=Xn(w,IP);return C===$o(D)?C=n:D.pop(),D.length&&D[0]===w[0]?EP(D,at(C,2)):[]}),Moe=Dt(function(w){var C=$o(w),D=Xn(w,IP);return C=typeof C=="function"?C:n,C&&D.pop(),D.length&&D[0]===w[0]?EP(D,n,C):[]});function Ooe(w,C){return w==null?"":Tse.call(w,C)}function $o(w){var C=w==null?0:w.length;return C?w[C-1]:n}function Ioe(w,C,D){var O=w==null?0:w.length;if(!O)return-1;var F=O;return D!==n&&(F=Rt(D),F=F<0?Ir(O+F,0):Es(F,O-1)),C===C?pse(w,C,F):aS(w,HF,F,!0)}function joe(w,C){return w&&w.length?x3(w,Rt(C)):n}var Loe=Dt(u4);function u4(w,C){return w&&w.length&&C&&C.length?PP(w,C):w}function $oe(w,C,D){return w&&w.length&&C&&C.length?PP(w,C,at(D,2)):w}function Foe(w,C,D){return w&&w.length&&C&&C.length?PP(w,C,n,D):w}var zoe=lc(function(w,C){var D=w==null?0:w.length,O=wP(w,C);return S3(w,Xn(C,function(F){return cc(F,D)?+F:F}).sort(M3)),O});function Boe(w,C){var D=[];if(!(w&&w.length))return D;var O=-1,F=[],W=w.length;for(C=at(C,3);++O<W;){var J=w[O];C(J,O,w)&&(D.push(J),F.push(O))}return S3(w,F),D}function YP(w){return w==null?w:Ose.call(w)}function Uoe(w,C,D){var O=w==null?0:w.length;return O?(D&&typeof D!="number"&&qs(w,C,D)?(C=0,D=O):(C=C==null?0:Rt(C),D=D===n?O:Rt(D)),Lo(w,C,D)):[]}function Hoe(w,C){return RS(w,C)}function Voe(w,C,D){return DP(w,C,at(D,2))}function qoe(w,C){var D=w==null?0:w.length;if(D){var O=RS(w,C);if(O<D&&va(w[O],C))return O}return-1}function Woe(w,C){return RS(w,C,!0)}function Goe(w,C,D){return DP(w,C,at(D,2),!0)}function Koe(w,C){var D=w==null?0:w.length;if(D){var O=RS(w,C,!0)-1;if(va(w[O],C))return O}return-1}function Yoe(w){return w&&w.length?E3(w):[]}function Xoe(w,C){return w&&w.length?E3(w,at(C,2)):[]}function Qoe(w){var C=w==null?0:w.length;return C?Lo(w,1,C):[]}function Zoe(w,C,D){return w&&w.length?(C=D||C===n?1:Rt(C),Lo(w,0,C<0?0:C)):[]}function Joe(w,C,D){var O=w==null?0:w.length;return O?(C=D||C===n?1:Rt(C),C=O-C,Lo(w,C<0?0:C,O)):[]}function eae(w,C){return w&&w.length?NS(w,at(C,3),!1,!0):[]}function tae(w,C){return w&&w.length?NS(w,at(C,3)):[]}var nae=Dt(function(w){return ju(ls(w,1,vr,!0))}),rae=Dt(function(w){var C=$o(w);return vr(C)&&(C=n),ju(ls(w,1,vr,!0),at(C,2))}),sae=Dt(function(w){var C=$o(w);return C=typeof C=="function"?C:n,ju(ls(w,1,vr,!0),n,C)});function iae(w){return w&&w.length?ju(w):[]}function oae(w,C){return w&&w.length?ju(w,at(C,2)):[]}function aae(w,C){return C=typeof C=="function"?C:n,w&&w.length?ju(w,n,C):[]}function XP(w){if(!(w&&w.length))return[];var C=0;return w=ku(w,function(D){if(vr(D))return C=Ir(D.length,C),!0}),hP(C,function(D){return Xn(w,uP(D))})}function d4(w,C){if(!(w&&w.length))return[];var D=XP(w);return C==null?D:Xn(D,function(O){return Ki(C,n,O)})}var lae=Dt(function(w,C){return vr(w)?Jy(w,C):[]}),cae=Dt(function(w){return OP(ku(w,vr))}),uae=Dt(function(w){var C=$o(w);return vr(C)&&(C=n),OP(ku(w,vr),at(C,2))}),dae=Dt(function(w){var C=$o(w);return C=typeof C=="function"?C:n,OP(ku(w,vr),n,C)}),fae=Dt(XP);function hae(w,C){return P3(w||[],C||[],Zy)}function pae(w,C){return P3(w||[],C||[],nb)}var mae=Dt(function(w){var C=w.length,D=C>1?w[C-1]:n;return D=typeof D=="function"?(w.pop(),D):n,d4(w,D)});function f4(w){var C=q(w);return C.__chain__=!0,C}function gae(w,C){return C(w),w}function LS(w,C){return C(w)}var vae=lc(function(w){var C=w.length,D=C?w[0]:0,O=this.__wrapped__,F=function(W){return wP(W,w)};return C>1||this.__actions__.length||!(O instanceof Bt)||!cc(D)?this.thru(F):(O=O.slice(D,+D+(C?1:0)),O.__actions__.push({func:LS,args:[F],thisArg:n}),new Io(O,this.__chain__).thru(function(W){return C&&!W.length&&W.push(n),W}))});function yae(){return f4(this)}function bae(){return new Io(this.value(),this.__chain__)}function xae(){this.__values__===n&&(this.__values__=A4(this.value()));var w=this.__index__>=this.__values__.length,C=w?n:this.__values__[this.__index__++];return{done:w,value:C}}function wae(){return this}function _ae(w){for(var C,D=this;D instanceof _S;){var O=i4(D);O.__index__=0,O.__values__=n,C?F.__wrapped__=O:C=O;var F=O;D=D.__wrapped__}return F.__wrapped__=w,C}function Sae(){var w=this.__wrapped__;if(w instanceof Bt){var C=w;return this.__actions__.length&&(C=new Bt(this)),C=C.reverse(),C.__actions__.push({func:LS,args:[YP],thisArg:n}),new Io(C,this.__chain__)}return this.thru(YP)}function Cae(){return N3(this.__wrapped__,this.__actions__)}var Eae=PS(function(w,C,D){pn.call(w,D)?++w[D]:oc(w,D,1)});function Aae(w,C,D){var O=wt(w)?BF:gie;return D&&qs(w,C,D)&&(C=n),O(w,at(C,3))}function Rae(w,C){var D=wt(w)?ku:d3;return D(w,at(C,3))}var Nae=F3(o4),Pae=F3(a4);function Tae(w,C){return ls($S(w,C),1)}function kae(w,C){return ls($S(w,C),V)}function Dae(w,C,D){return D=D===n?1:Rt(D),ls($S(w,C),D)}function h4(w,C){var D=wt(w)?Mo:Iu;return D(w,at(C,3))}function p4(w,C){var D=wt(w)?Qre:u3;return D(w,at(C,3))}var Mae=PS(function(w,C,D){pn.call(w,D)?w[D].push(C):oc(w,D,[C])});function Oae(w,C,D,O){w=vi(w)?w:gm(w),D=D&&!O?Rt(D):0;var F=w.length;return D<0&&(D=Ir(F+D,0)),HS(w)?D<=F&&w.indexOf(C,D)>-1:!!F&&sm(w,C,D)>-1}var Iae=Dt(function(w,C,D){var O=-1,F=typeof C=="function",W=vi(w)?ve(w.length):[];return Iu(w,function(J){W[++O]=F?Ki(C,J,D):eb(J,C,D)}),W}),jae=PS(function(w,C,D){oc(w,D,C)});function $S(w,C){var D=wt(w)?Xn:v3;return D(w,at(C,3))}function Lae(w,C,D,O){return w==null?[]:(wt(C)||(C=C==null?[]:[C]),D=O?n:D,wt(D)||(D=D==null?[]:[D]),w3(w,C,D))}var $ae=PS(function(w,C,D){w[D?0:1].push(C)},function(){return[[],[]]});function Fae(w,C,D){var O=wt(w)?lP:qF,F=arguments.length<3;return O(w,at(C,4),D,F,Iu)}function zae(w,C,D){var O=wt(w)?Zre:qF,F=arguments.length<3;return O(w,at(C,4),D,F,u3)}function Bae(w,C){var D=wt(w)?ku:d3;return D(w,BS(at(C,3)))}function Uae(w){var C=wt(w)?o3:Oie;return C(w)}function Hae(w,C,D){(D?qs(w,C,D):C===n)?C=1:C=Rt(C);var O=wt(w)?die:Iie;return O(w,C)}function Vae(w){var C=wt(w)?fie:Lie;return C(w)}function qae(w){if(w==null)return 0;if(vi(w))return HS(w)?om(w):w.length;var C=As(w);return C==Fe||C==Re?w.size:RP(w).length}function Wae(w,C,D){var O=wt(w)?cP:$ie;return D&&qs(w,C,D)&&(C=n),O(w,at(C,3))}var Gae=Dt(function(w,C){if(w==null)return[];var D=C.length;return D>1&&qs(w,C[0],C[1])?C=[]:D>2&&qs(C[0],C[1],C[2])&&(C=[C[0]]),w3(w,ls(C,1),[])}),FS=Rse||function(){return as.Date.now()};function Kae(w,C){if(typeof C!="function")throw new Oo(o);return w=Rt(w),function(){if(--w<1)return C.apply(this,arguments)}}function m4(w,C,D){return C=D?n:C,C=w&&C==null?w.length:C,ac(w,T,n,n,n,n,C)}function g4(w,C){var D;if(typeof C!="function")throw new Oo(o);return w=Rt(w),function(){return--w>0&&(D=C.apply(this,arguments)),w<=1&&(C=n),D}}var QP=Dt(function(w,C,D){var O=y;if(D.length){var F=Mu(D,pm(QP));O|=A}return ac(w,O,C,D,F)}),v4=Dt(function(w,C,D){var O=y|g;if(D.length){var F=Mu(D,pm(v4));O|=A}return ac(C,O,w,D,F)});function y4(w,C,D){C=D?n:C;var O=ac(w,x,n,n,n,n,n,C);return O.placeholder=y4.placeholder,O}function b4(w,C,D){C=D?n:C;var O=ac(w,_,n,n,n,n,n,C);return O.placeholder=b4.placeholder,O}function x4(w,C,D){var O,F,W,J,se,ue,Se=0,Ce=!1,Ae=!1,Be=!0;if(typeof w!="function")throw new Oo(o);C=Fo(C)||0,Zn(D)&&(Ce=!!D.leading,Ae="maxWait"in D,W=Ae?Ir(Fo(D.maxWait)||0,C):W,Be="trailing"in D?!!D.trailing:Be);function Qe(yr){var ya=O,fc=F;return O=F=n,Se=yr,J=w.apply(fc,ya),J}function dt(yr){return Se=yr,se=ib(Lt,C),Ce?Qe(yr):J}function Tt(yr){var ya=yr-ue,fc=yr-Se,F4=C-ya;return Ae?Es(F4,W-fc):F4}function ft(yr){var ya=yr-ue,fc=yr-Se;return ue===n||ya>=C||ya<0||Ae&&fc>=W}function Lt(){var yr=FS();if(ft(yr))return Ut(yr);se=ib(Lt,Tt(yr))}function Ut(yr){return se=n,Be&&O?Qe(yr):(O=F=n,J)}function Zi(){se!==n&&T3(se),Se=0,O=ue=F=se=n}function Ws(){return se===n?J:Ut(FS())}function Ji(){var yr=FS(),ya=ft(yr);if(O=arguments,F=this,ue=yr,ya){if(se===n)return dt(ue);if(Ae)return T3(se),se=ib(Lt,C),Qe(ue)}return se===n&&(se=ib(Lt,C)),J}return Ji.cancel=Zi,Ji.flush=Ws,Ji}var Yae=Dt(function(w,C){return c3(w,1,C)}),Xae=Dt(function(w,C,D){return c3(w,Fo(C)||0,D)});function Qae(w){return ac(w,P)}function zS(w,C){if(typeof w!="function"||C!=null&&typeof C!="function")throw new Oo(o);var D=function(){var O=arguments,F=C?C.apply(this,O):O[0],W=D.cache;if(W.has(F))return W.get(F);var J=w.apply(this,O);return D.cache=W.set(F,J)||W,J};return D.cache=new(zS.Cache||ic),D}zS.Cache=ic;function BS(w){if(typeof w!="function")throw new Oo(o);return function(){var C=arguments;switch(C.length){case 0:return!w.call(this);case 1:return!w.call(this,C[0]);case 2:return!w.call(this,C[0],C[1]);case 3:return!w.call(this,C[0],C[1],C[2])}return!w.apply(this,C)}}function Zae(w){return g4(2,w)}var Jae=Fie(function(w,C){C=C.length==1&&wt(C[0])?Xn(C[0],Yi(at())):Xn(ls(C,1),Yi(at()));var D=C.length;return Dt(function(O){for(var F=-1,W=Es(O.length,D);++F<W;)O[F]=C[F].call(this,O[F]);return Ki(w,this,O)})}),ZP=Dt(function(w,C){var D=Mu(C,pm(ZP));return ac(w,A,n,C,D)}),w4=Dt(function(w,C){var D=Mu(C,pm(w4));return ac(w,N,n,C,D)}),ele=lc(function(w,C){return ac(w,E,n,n,n,C)});function tle(w,C){if(typeof w!="function")throw new Oo(o);return C=C===n?C:Rt(C),Dt(w,C)}function nle(w,C){if(typeof w!="function")throw new Oo(o);return C=C==null?0:Ir(Rt(C),0),Dt(function(D){var O=D[C],F=$u(D,0,C);return O&&Du(F,O),Ki(w,this,F)})}function rle(w,C,D){var O=!0,F=!0;if(typeof w!="function")throw new Oo(o);return Zn(D)&&(O="leading"in D?!!D.leading:O,F="trailing"in D?!!D.trailing:F),x4(w,C,{leading:O,maxWait:C,trailing:F})}function sle(w){return m4(w,1)}function ile(w,C){return ZP(jP(C),w)}function ole(){if(!arguments.length)return[];var w=arguments[0];return wt(w)?w:[w]}function ale(w){return jo(w,p)}function lle(w,C){return C=typeof C=="function"?C:n,jo(w,p,C)}function cle(w){return jo(w,l|p)}function ule(w,C){return C=typeof C=="function"?C:n,jo(w,l|p,C)}function dle(w,C){return C==null||l3(w,C,Xr(C))}function va(w,C){return w===C||w!==w&&C!==C}var fle=MS(CP),hle=MS(function(w,C){return w>=C}),jf=p3(function(){return arguments}())?p3:function(w){return cr(w)&&pn.call(w,"callee")&&!e3.call(w,"callee")},wt=ve.isArray,ple=IF?Yi(IF):_ie;function vi(w){return w!=null&&US(w.length)&&!uc(w)}function vr(w){return cr(w)&&vi(w)}function mle(w){return w===!0||w===!1||cr(w)&&Vs(w)==xe}var Fu=Pse||cT,gle=jF?Yi(jF):Sie;function vle(w){return cr(w)&&w.nodeType===1&&!ob(w)}function yle(w){if(w==null)return!0;if(vi(w)&&(wt(w)||typeof w=="string"||typeof w.splice=="function"||Fu(w)||mm(w)||jf(w)))return!w.length;var C=As(w);if(C==Fe||C==Re)return!w.size;if(sb(w))return!RP(w).length;for(var D in w)if(pn.call(w,D))return!1;return!0}function ble(w,C){return tb(w,C)}function xle(w,C,D){D=typeof D=="function"?D:n;var O=D?D(w,C):n;return O===n?tb(w,C,n,D):!!O}function JP(w){if(!cr(w))return!1;var C=Vs(w);return C==Le||C==pe||typeof w.message=="string"&&typeof w.name=="string"&&!ob(w)}function wle(w){return typeof w=="number"&&n3(w)}function uc(w){if(!Zn(w))return!1;var C=Vs(w);return C==Me||C==Oe||C==ce||C==de}function _4(w){return typeof w=="number"&&w==Rt(w)}function US(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=U}function Zn(w){var C=typeof w;return w!=null&&(C=="object"||C=="function")}function cr(w){return w!=null&&typeof w=="object"}var S4=LF?Yi(LF):Eie;function _le(w,C){return w===C||AP(w,C,HP(C))}function Sle(w,C,D){return D=typeof D=="function"?D:n,AP(w,C,HP(C),D)}function Cle(w){return C4(w)&&w!=+w}function Ele(w){if(loe(w))throw new bt(i);return m3(w)}function Ale(w){return w===null}function Rle(w){return w==null}function C4(w){return typeof w=="number"||cr(w)&&Vs(w)==ot}function ob(w){if(!cr(w)||Vs(w)!=At)return!1;var C=mS(w);if(C===null)return!0;var D=pn.call(C,"constructor")&&C.constructor;return typeof D=="function"&&D instanceof D&&dS.call(D)==Sse}var eT=$F?Yi($F):Aie;function Nle(w){return _4(w)&&w>=-U&&w<=U}var E4=FF?Yi(FF):Rie;function HS(w){return typeof w=="string"||!wt(w)&&cr(w)&&Vs(w)==Pe}function Qi(w){return typeof w=="symbol"||cr(w)&&Vs(w)==Ee}var mm=zF?Yi(zF):Nie;function Ple(w){return w===n}function Tle(w){return cr(w)&&As(w)==tt}function kle(w){return cr(w)&&Vs(w)==qt}var Dle=MS(NP),Mle=MS(function(w,C){return w<=C});function A4(w){if(!w)return[];if(vi(w))return HS(w)?ma(w):gi(w);if(Gy&&w[Gy])return dse(w[Gy]());var C=As(w),D=C==Fe?mP:C==Re?lS:gm;return D(w)}function dc(w){if(!w)return w===0?w:0;if(w=Fo(w),w===V||w===-V){var C=w<0?-1:1;return C*Q}return w===w?w:0}function Rt(w){var C=dc(w),D=C%1;return C===C?D?C-D:C:0}function R4(w){return w?Df(Rt(w),0,X):0}function Fo(w){if(typeof w=="number")return w;if(Qi(w))return ne;if(Zn(w)){var C=typeof w.valueOf=="function"?w.valueOf():w;w=Zn(C)?C+"":C}if(typeof w!="string")return w===0?w:+w;w=WF(w);var D=tn.test(w);return D||Jt.test(w)?Kre(w.slice(2),D?2:8):cn.test(w)?ne:+w}function N4(w){return ol(w,yi(w))}function Ole(w){return w?Df(Rt(w),-U,U):w===0?w:0}function un(w){return w==null?"":Xi(w)}var Ile=fm(function(w,C){if(sb(C)||vi(C)){ol(C,Xr(C),w);return}for(var D in C)pn.call(C,D)&&Zy(w,D,C[D])}),P4=fm(function(w,C){ol(C,yi(C),w)}),VS=fm(function(w,C,D,O){ol(C,yi(C),w,O)}),jle=fm(function(w,C,D,O){ol(C,Xr(C),w,O)}),Lle=lc(wP);function $le(w,C){var D=dm(w);return C==null?D:a3(D,C)}var Fle=Dt(function(w,C){w=Tn(w);var D=-1,O=C.length,F=O>2?C[2]:n;for(F&&qs(C[0],C[1],F)&&(O=1);++D<O;)for(var W=C[D],J=yi(W),se=-1,ue=J.length;++se<ue;){var Se=J[se],Ce=w[Se];(Ce===n||va(Ce,lm[Se])&&!pn.call(w,Se))&&(w[Se]=W[Se])}return w}),zle=Dt(function(w){return w.push(n,W3),Ki(T4,n,w)});function Ble(w,C){return UF(w,at(C,3),il)}function Ule(w,C){return UF(w,at(C,3),SP)}function Hle(w,C){return w==null?w:_P(w,at(C,3),yi)}function Vle(w,C){return w==null?w:f3(w,at(C,3),yi)}function qle(w,C){return w&&il(w,at(C,3))}function Wle(w,C){return w&&SP(w,at(C,3))}function Gle(w){return w==null?[]:ES(w,Xr(w))}function Kle(w){return w==null?[]:ES(w,yi(w))}function tT(w,C,D){var O=w==null?n:Mf(w,C);return O===n?D:O}function Yle(w,C){return w!=null&&Y3(w,C,yie)}function nT(w,C){return w!=null&&Y3(w,C,bie)}var Xle=B3(function(w,C,D){C!=null&&typeof C.toString!="function"&&(C=fS.call(C)),w[C]=D},sT(bi)),Qle=B3(function(w,C,D){C!=null&&typeof C.toString!="function"&&(C=fS.call(C)),pn.call(w,C)?w[C].push(D):w[C]=[D]},at),Zle=Dt(eb);function Xr(w){return vi(w)?i3(w):RP(w)}function yi(w){return vi(w)?i3(w,!0):Pie(w)}function Jle(w,C){var D={};return C=at(C,3),il(w,function(O,F,W){oc(D,C(O,F,W),O)}),D}function ece(w,C){var D={};return C=at(C,3),il(w,function(O,F,W){oc(D,F,C(O,F,W))}),D}var tce=fm(function(w,C,D){AS(w,C,D)}),T4=fm(function(w,C,D,O){AS(w,C,D,O)}),nce=lc(function(w,C){var D={};if(w==null)return D;var O=!1;C=Xn(C,function(W){return W=Lu(W,w),O||(O=W.length>1),W}),ol(w,BP(w),D),O&&(D=jo(D,l|d|p,Xie));for(var F=C.length;F--;)MP(D,C[F]);return D});function rce(w,C){return k4(w,BS(at(C)))}var sce=lc(function(w,C){return w==null?{}:kie(w,C)});function k4(w,C){if(w==null)return{};var D=Xn(BP(w),function(O){return[O]});return C=at(C),_3(w,D,function(O,F){return C(O,F[0])})}function ice(w,C,D){C=Lu(C,w);var O=-1,F=C.length;for(F||(F=1,w=n);++O<F;){var W=w==null?n:w[al(C[O])];W===n&&(O=F,W=D),w=uc(W)?W.call(w):W}return w}function oce(w,C,D){return w==null?w:nb(w,C,D)}function ace(w,C,D,O){return O=typeof O=="function"?O:n,w==null?w:nb(w,C,D,O)}var D4=V3(Xr),M4=V3(yi);function lce(w,C,D){var O=wt(w),F=O||Fu(w)||mm(w);if(C=at(C,4),D==null){var W=w&&w.constructor;F?D=O?new W:[]:Zn(w)?D=uc(W)?dm(mS(w)):{}:D={}}return(F?Mo:il)(w,function(J,se,ue){return C(D,J,se,ue)}),D}function cce(w,C){return w==null?!0:MP(w,C)}function uce(w,C,D){return w==null?w:R3(w,C,jP(D))}function dce(w,C,D,O){return O=typeof O=="function"?O:n,w==null?w:R3(w,C,jP(D),O)}function gm(w){return w==null?[]:pP(w,Xr(w))}function fce(w){return w==null?[]:pP(w,yi(w))}function hce(w,C,D){return D===n&&(D=C,C=n),D!==n&&(D=Fo(D),D=D===D?D:0),C!==n&&(C=Fo(C),C=C===C?C:0),Df(Fo(w),C,D)}function pce(w,C,D){return C=dc(C),D===n?(D=C,C=0):D=dc(D),w=Fo(w),xie(w,C,D)}function mce(w,C,D){if(D&&typeof D!="boolean"&&qs(w,C,D)&&(C=D=n),D===n&&(typeof C=="boolean"?(D=C,C=n):typeof w=="boolean"&&(D=w,w=n)),w===n&&C===n?(w=0,C=1):(w=dc(w),C===n?(C=w,w=0):C=dc(C)),w>C){var O=w;w=C,C=O}if(D||w%1||C%1){var F=r3();return Es(w+F*(C-w+Gre("1e-"+((F+"").length-1))),C)}return TP(w,C)}var gce=hm(function(w,C,D){return C=C.toLowerCase(),w+(D?O4(C):C)});function O4(w){return rT(un(w).toLowerCase())}function I4(w){return w=un(w),w&&w.replace(lr,ose).replace(Lre,"")}function vce(w,C,D){w=un(w),C=Xi(C);var O=w.length;D=D===n?O:Df(Rt(D),0,O);var F=D;return D-=C.length,D>=0&&w.slice(D,F)==C}function yce(w){return w=un(w),w&&ar.test(w)?w.replace(Wt,ase):w}function bce(w){return w=un(w),w&&re.test(w)?w.replace(ha,"\\$&"):w}var xce=hm(function(w,C,D){return w+(D?"-":"")+C.toLowerCase()}),wce=hm(function(w,C,D){return w+(D?" ":"")+C.toLowerCase()}),_ce=$3("toLowerCase");function Sce(w,C,D){w=un(w),C=Rt(C);var O=C?om(w):0;if(!C||O>=C)return w;var F=(C-O)/2;return DS(bS(F),D)+w+DS(yS(F),D)}function Cce(w,C,D){w=un(w),C=Rt(C);var O=C?om(w):0;return C&&O<C?w+DS(C-O,D):w}function Ece(w,C,D){w=un(w),C=Rt(C);var O=C?om(w):0;return C&&O<C?DS(C-O,D)+w:w}function Ace(w,C,D){return D||C==null?C=0:C&&(C=+C),Mse(un(w).replace(ae,""),C||0)}function Rce(w,C,D){return(D?qs(w,C,D):C===n)?C=1:C=Rt(C),kP(un(w),C)}function Nce(){var w=arguments,C=un(w[0]);return w.length<3?C:C.replace(w[1],w[2])}var Pce=hm(function(w,C,D){return w+(D?"_":"")+C.toLowerCase()});function Tce(w,C,D){return D&&typeof D!="number"&&qs(w,C,D)&&(C=D=n),D=D===n?X:D>>>0,D?(w=un(w),w&&(typeof C=="string"||C!=null&&!eT(C))&&(C=Xi(C),!C&&im(w))?$u(ma(w),0,D):w.split(C,D)):[]}var kce=hm(function(w,C,D){return w+(D?" ":"")+rT(C)});function Dce(w,C,D){return w=un(w),D=D==null?0:Df(Rt(D),0,w.length),C=Xi(C),w.slice(D,D+C.length)==C}function Mce(w,C,D){var O=q.templateSettings;D&&qs(w,C,D)&&(C=n),w=un(w),C=VS({},C,O,q3);var F=VS({},C.imports,O.imports,q3),W=Xr(F),J=pP(F,W),se,ue,Se=0,Ce=C.interpolate||rl,Ae="__p += '",Be=gP((C.escape||rl).source+"|"+Ce.source+"|"+(Ce===Dr?rt:rl).source+"|"+(C.evaluate||rl).source+"|$","g"),Qe="//# sourceURL="+(pn.call(C,"sourceURL")?(C.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ure+"]")+`
|
||
`;w.replace(Be,function(ft,Lt,Ut,Zi,Ws,Ji){return Ut||(Ut=Zi),Ae+=w.slice(Se,Ji).replace(sl,lse),Lt&&(se=!0,Ae+=`' +
|
||
__e(`+Lt+`) +
|
||
'`),Ws&&(ue=!0,Ae+=`';
|
||
`+Ws+`;
|
||
__p += '`),Ut&&(Ae+=`' +
|
||
((__t = (`+Ut+`)) == null ? '' : __t) +
|
||
'`),Se=Ji+ft.length,ft}),Ae+=`';
|
||
`;var dt=pn.call(C,"variable")&&C.variable;if(!dt)Ae=`with (obj) {
|
||
`+Ae+`
|
||
}
|
||
`;else if(je.test(dt))throw new bt(a);Ae=(ue?Ae.replace(Ze,""):Ae).replace(yt,"$1").replace(Pt,"$1;"),Ae="function("+(dt||"obj")+`) {
|
||
`+(dt?"":`obj || (obj = {});
|
||
`)+"var __t, __p = ''"+(se?", __e = _.escape":"")+(ue?`, __j = Array.prototype.join;
|
||
function print() { __p += __j.call(arguments, '') }
|
||
`:`;
|
||
`)+Ae+`return __p
|
||
}`;var Tt=L4(function(){return nn(W,Qe+"return "+Ae).apply(n,J)});if(Tt.source=Ae,JP(Tt))throw Tt;return Tt}function Oce(w){return un(w).toLowerCase()}function Ice(w){return un(w).toUpperCase()}function jce(w,C,D){if(w=un(w),w&&(D||C===n))return WF(w);if(!w||!(C=Xi(C)))return w;var O=ma(w),F=ma(C),W=GF(O,F),J=KF(O,F)+1;return $u(O,W,J).join("")}function Lce(w,C,D){if(w=un(w),w&&(D||C===n))return w.slice(0,XF(w)+1);if(!w||!(C=Xi(C)))return w;var O=ma(w),F=KF(O,ma(C))+1;return $u(O,0,F).join("")}function $ce(w,C,D){if(w=un(w),w&&(D||C===n))return w.replace(ae,"");if(!w||!(C=Xi(C)))return w;var O=ma(w),F=GF(O,ma(C));return $u(O,F).join("")}function Fce(w,C){var D=k,O=M;if(Zn(C)){var F="separator"in C?C.separator:F;D="length"in C?Rt(C.length):D,O="omission"in C?Xi(C.omission):O}w=un(w);var W=w.length;if(im(w)){var J=ma(w);W=J.length}if(D>=W)return w;var se=D-om(O);if(se<1)return O;var ue=J?$u(J,0,se).join(""):w.slice(0,se);if(F===n)return ue+O;if(J&&(se+=ue.length-se),eT(F)){if(w.slice(se).search(F)){var Se,Ce=ue;for(F.global||(F=gP(F.source,un(st.exec(F))+"g")),F.lastIndex=0;Se=F.exec(Ce);)var Ae=Se.index;ue=ue.slice(0,Ae===n?se:Ae)}}else if(w.indexOf(Xi(F),se)!=se){var Be=ue.lastIndexOf(F);Be>-1&&(ue=ue.slice(0,Be))}return ue+O}function zce(w){return w=un(w),w&&Zt.test(w)?w.replace(St,mse):w}var Bce=hm(function(w,C,D){return w+(D?" ":"")+C.toUpperCase()}),rT=$3("toUpperCase");function j4(w,C,D){return w=un(w),C=D?n:C,C===n?use(w)?yse(w):tse(w):w.match(C)||[]}var L4=Dt(function(w,C){try{return Ki(w,n,C)}catch(D){return JP(D)?D:new bt(D)}}),Uce=lc(function(w,C){return Mo(C,function(D){D=al(D),oc(w,D,QP(w[D],w))}),w});function Hce(w){var C=w==null?0:w.length,D=at();return w=C?Xn(w,function(O){if(typeof O[1]!="function")throw new Oo(o);return[D(O[0]),O[1]]}):[],Dt(function(O){for(var F=-1;++F<C;){var W=w[F];if(Ki(W[0],this,O))return Ki(W[1],this,O)}})}function Vce(w){return mie(jo(w,l))}function sT(w){return function(){return w}}function qce(w,C){return w==null||w!==w?C:w}var Wce=z3(),Gce=z3(!0);function bi(w){return w}function iT(w){return g3(typeof w=="function"?w:jo(w,l))}function Kce(w){return y3(jo(w,l))}function Yce(w,C){return b3(w,jo(C,l))}var Xce=Dt(function(w,C){return function(D){return eb(D,w,C)}}),Qce=Dt(function(w,C){return function(D){return eb(w,D,C)}});function oT(w,C,D){var O=Xr(C),F=ES(C,O);D==null&&!(Zn(C)&&(F.length||!O.length))&&(D=C,C=w,w=this,F=ES(C,Xr(C)));var W=!(Zn(D)&&"chain"in D)||!!D.chain,J=uc(w);return Mo(F,function(se){var ue=C[se];w[se]=ue,J&&(w.prototype[se]=function(){var Se=this.__chain__;if(W||Se){var Ce=w(this.__wrapped__),Ae=Ce.__actions__=gi(this.__actions__);return Ae.push({func:ue,args:arguments,thisArg:w}),Ce.__chain__=Se,Ce}return ue.apply(w,Du([this.value()],arguments))})}),w}function Zce(){return as._===this&&(as._=Cse),this}function aT(){}function Jce(w){return w=Rt(w),Dt(function(C){return x3(C,w)})}var eue=$P(Xn),tue=$P(BF),nue=$P(cP);function $4(w){return qP(w)?uP(al(w)):Die(w)}function rue(w){return function(C){return w==null?n:Mf(w,C)}}var sue=U3(),iue=U3(!0);function lT(){return[]}function cT(){return!1}function oue(){return{}}function aue(){return""}function lue(){return!0}function cue(w,C){if(w=Rt(w),w<1||w>U)return[];var D=X,O=Es(w,X);C=at(C),w-=X;for(var F=hP(O,C);++D<w;)C(D);return F}function uue(w){return wt(w)?Xn(w,al):Qi(w)?[w]:gi(s4(un(w)))}function due(w){var C=++_se;return un(w)+C}var fue=kS(function(w,C){return w+C},0),hue=FP("ceil"),pue=kS(function(w,C){return w/C},1),mue=FP("floor");function gue(w){return w&&w.length?CS(w,bi,CP):n}function vue(w,C){return w&&w.length?CS(w,at(C,2),CP):n}function yue(w){return VF(w,bi)}function bue(w,C){return VF(w,at(C,2))}function xue(w){return w&&w.length?CS(w,bi,NP):n}function wue(w,C){return w&&w.length?CS(w,at(C,2),NP):n}var _ue=kS(function(w,C){return w*C},1),Sue=FP("round"),Cue=kS(function(w,C){return w-C},0);function Eue(w){return w&&w.length?fP(w,bi):0}function Aue(w,C){return w&&w.length?fP(w,at(C,2)):0}return q.after=Kae,q.ary=m4,q.assign=Ile,q.assignIn=P4,q.assignInWith=VS,q.assignWith=jle,q.at=Lle,q.before=g4,q.bind=QP,q.bindAll=Uce,q.bindKey=v4,q.castArray=ole,q.chain=f4,q.chunk=moe,q.compact=goe,q.concat=voe,q.cond=Hce,q.conforms=Vce,q.constant=sT,q.countBy=Eae,q.create=$le,q.curry=y4,q.curryRight=b4,q.debounce=x4,q.defaults=Fle,q.defaultsDeep=zle,q.defer=Yae,q.delay=Xae,q.difference=yoe,q.differenceBy=boe,q.differenceWith=xoe,q.drop=woe,q.dropRight=_oe,q.dropRightWhile=Soe,q.dropWhile=Coe,q.fill=Eoe,q.filter=Rae,q.flatMap=Tae,q.flatMapDeep=kae,q.flatMapDepth=Dae,q.flatten=l4,q.flattenDeep=Aoe,q.flattenDepth=Roe,q.flip=Qae,q.flow=Wce,q.flowRight=Gce,q.fromPairs=Noe,q.functions=Gle,q.functionsIn=Kle,q.groupBy=Mae,q.initial=Toe,q.intersection=koe,q.intersectionBy=Doe,q.intersectionWith=Moe,q.invert=Xle,q.invertBy=Qle,q.invokeMap=Iae,q.iteratee=iT,q.keyBy=jae,q.keys=Xr,q.keysIn=yi,q.map=$S,q.mapKeys=Jle,q.mapValues=ece,q.matches=Kce,q.matchesProperty=Yce,q.memoize=zS,q.merge=tce,q.mergeWith=T4,q.method=Xce,q.methodOf=Qce,q.mixin=oT,q.negate=BS,q.nthArg=Jce,q.omit=nce,q.omitBy=rce,q.once=Zae,q.orderBy=Lae,q.over=eue,q.overArgs=Jae,q.overEvery=tue,q.overSome=nue,q.partial=ZP,q.partialRight=w4,q.partition=$ae,q.pick=sce,q.pickBy=k4,q.property=$4,q.propertyOf=rue,q.pull=Loe,q.pullAll=u4,q.pullAllBy=$oe,q.pullAllWith=Foe,q.pullAt=zoe,q.range=sue,q.rangeRight=iue,q.rearg=ele,q.reject=Bae,q.remove=Boe,q.rest=tle,q.reverse=YP,q.sampleSize=Hae,q.set=oce,q.setWith=ace,q.shuffle=Vae,q.slice=Uoe,q.sortBy=Gae,q.sortedUniq=Yoe,q.sortedUniqBy=Xoe,q.split=Tce,q.spread=nle,q.tail=Qoe,q.take=Zoe,q.takeRight=Joe,q.takeRightWhile=eae,q.takeWhile=tae,q.tap=gae,q.throttle=rle,q.thru=LS,q.toArray=A4,q.toPairs=D4,q.toPairsIn=M4,q.toPath=uue,q.toPlainObject=N4,q.transform=lce,q.unary=sle,q.union=nae,q.unionBy=rae,q.unionWith=sae,q.uniq=iae,q.uniqBy=oae,q.uniqWith=aae,q.unset=cce,q.unzip=XP,q.unzipWith=d4,q.update=uce,q.updateWith=dce,q.values=gm,q.valuesIn=fce,q.without=lae,q.words=j4,q.wrap=ile,q.xor=cae,q.xorBy=uae,q.xorWith=dae,q.zip=fae,q.zipObject=hae,q.zipObjectDeep=pae,q.zipWith=mae,q.entries=D4,q.entriesIn=M4,q.extend=P4,q.extendWith=VS,oT(q,q),q.add=fue,q.attempt=L4,q.camelCase=gce,q.capitalize=O4,q.ceil=hue,q.clamp=hce,q.clone=ale,q.cloneDeep=cle,q.cloneDeepWith=ule,q.cloneWith=lle,q.conformsTo=dle,q.deburr=I4,q.defaultTo=qce,q.divide=pue,q.endsWith=vce,q.eq=va,q.escape=yce,q.escapeRegExp=bce,q.every=Aae,q.find=Nae,q.findIndex=o4,q.findKey=Ble,q.findLast=Pae,q.findLastIndex=a4,q.findLastKey=Ule,q.floor=mue,q.forEach=h4,q.forEachRight=p4,q.forIn=Hle,q.forInRight=Vle,q.forOwn=qle,q.forOwnRight=Wle,q.get=tT,q.gt=fle,q.gte=hle,q.has=Yle,q.hasIn=nT,q.head=c4,q.identity=bi,q.includes=Oae,q.indexOf=Poe,q.inRange=pce,q.invoke=Zle,q.isArguments=jf,q.isArray=wt,q.isArrayBuffer=ple,q.isArrayLike=vi,q.isArrayLikeObject=vr,q.isBoolean=mle,q.isBuffer=Fu,q.isDate=gle,q.isElement=vle,q.isEmpty=yle,q.isEqual=ble,q.isEqualWith=xle,q.isError=JP,q.isFinite=wle,q.isFunction=uc,q.isInteger=_4,q.isLength=US,q.isMap=S4,q.isMatch=_le,q.isMatchWith=Sle,q.isNaN=Cle,q.isNative=Ele,q.isNil=Rle,q.isNull=Ale,q.isNumber=C4,q.isObject=Zn,q.isObjectLike=cr,q.isPlainObject=ob,q.isRegExp=eT,q.isSafeInteger=Nle,q.isSet=E4,q.isString=HS,q.isSymbol=Qi,q.isTypedArray=mm,q.isUndefined=Ple,q.isWeakMap=Tle,q.isWeakSet=kle,q.join=Ooe,q.kebabCase=xce,q.last=$o,q.lastIndexOf=Ioe,q.lowerCase=wce,q.lowerFirst=_ce,q.lt=Dle,q.lte=Mle,q.max=gue,q.maxBy=vue,q.mean=yue,q.meanBy=bue,q.min=xue,q.minBy=wue,q.stubArray=lT,q.stubFalse=cT,q.stubObject=oue,q.stubString=aue,q.stubTrue=lue,q.multiply=_ue,q.nth=joe,q.noConflict=Zce,q.noop=aT,q.now=FS,q.pad=Sce,q.padEnd=Cce,q.padStart=Ece,q.parseInt=Ace,q.random=mce,q.reduce=Fae,q.reduceRight=zae,q.repeat=Rce,q.replace=Nce,q.result=ice,q.round=Sue,q.runInContext=le,q.sample=Uae,q.size=qae,q.snakeCase=Pce,q.some=Wae,q.sortedIndex=Hoe,q.sortedIndexBy=Voe,q.sortedIndexOf=qoe,q.sortedLastIndex=Woe,q.sortedLastIndexBy=Goe,q.sortedLastIndexOf=Koe,q.startCase=kce,q.startsWith=Dce,q.subtract=Cue,q.sum=Eue,q.sumBy=Aue,q.template=Mce,q.times=cue,q.toFinite=dc,q.toInteger=Rt,q.toLength=R4,q.toLower=Oce,q.toNumber=Fo,q.toSafeInteger=Ole,q.toString=un,q.toUpper=Ice,q.trim=jce,q.trimEnd=Lce,q.trimStart=$ce,q.truncate=Fce,q.unescape=zce,q.uniqueId=due,q.upperCase=Bce,q.upperFirst=rT,q.each=h4,q.eachRight=p4,q.first=c4,oT(q,function(){var w={};return il(q,function(C,D){pn.call(q.prototype,D)||(w[D]=C)}),w}(),{chain:!1}),q.VERSION=r,Mo(["bind","bindKey","curry","curryRight","partial","partialRight"],function(w){q[w].placeholder=q}),Mo(["drop","take"],function(w,C){Bt.prototype[w]=function(D){D=D===n?1:Ir(Rt(D),0);var O=this.__filtered__&&!C?new Bt(this):this.clone();return O.__filtered__?O.__takeCount__=Es(D,O.__takeCount__):O.__views__.push({size:Es(D,X),type:w+(O.__dir__<0?"Right":"")}),O},Bt.prototype[w+"Right"]=function(D){return this.reverse()[w](D).reverse()}}),Mo(["filter","map","takeWhile"],function(w,C){var D=C+1,O=D==L||D==K;Bt.prototype[w]=function(F){var W=this.clone();return W.__iteratees__.push({iteratee:at(F,3),type:D}),W.__filtered__=W.__filtered__||O,W}}),Mo(["head","last"],function(w,C){var D="take"+(C?"Right":"");Bt.prototype[w]=function(){return this[D](1).value()[0]}}),Mo(["initial","tail"],function(w,C){var D="drop"+(C?"":"Right");Bt.prototype[w]=function(){return this.__filtered__?new Bt(this):this[D](1)}}),Bt.prototype.compact=function(){return this.filter(bi)},Bt.prototype.find=function(w){return this.filter(w).head()},Bt.prototype.findLast=function(w){return this.reverse().find(w)},Bt.prototype.invokeMap=Dt(function(w,C){return typeof w=="function"?new Bt(this):this.map(function(D){return eb(D,w,C)})}),Bt.prototype.reject=function(w){return this.filter(BS(at(w)))},Bt.prototype.slice=function(w,C){w=Rt(w);var D=this;return D.__filtered__&&(w>0||C<0)?new Bt(D):(w<0?D=D.takeRight(-w):w&&(D=D.drop(w)),C!==n&&(C=Rt(C),D=C<0?D.dropRight(-C):D.take(C-w)),D)},Bt.prototype.takeRightWhile=function(w){return this.reverse().takeWhile(w).reverse()},Bt.prototype.toArray=function(){return this.take(X)},il(Bt.prototype,function(w,C){var D=/^(?:filter|find|map|reject)|While$/.test(C),O=/^(?:head|last)$/.test(C),F=q[O?"take"+(C=="last"?"Right":""):C],W=O||/^find/.test(C);F&&(q.prototype[C]=function(){var J=this.__wrapped__,se=O?[1]:arguments,ue=J instanceof Bt,Se=se[0],Ce=ue||wt(J),Ae=function(Lt){var Ut=F.apply(q,Du([Lt],se));return O&&Be?Ut[0]:Ut};Ce&&D&&typeof Se=="function"&&Se.length!=1&&(ue=Ce=!1);var Be=this.__chain__,Qe=!!this.__actions__.length,dt=W&&!Be,Tt=ue&&!Qe;if(!W&&Ce){J=Tt?J:new Bt(this);var ft=w.apply(J,se);return ft.__actions__.push({func:LS,args:[Ae],thisArg:n}),new Io(ft,Be)}return dt&&Tt?w.apply(this,se):(ft=this.thru(Ae),dt?O?ft.value()[0]:ft.value():ft)})}),Mo(["pop","push","shift","sort","splice","unshift"],function(w){var C=cS[w],D=/^(?:push|sort|unshift)$/.test(w)?"tap":"thru",O=/^(?:pop|shift)$/.test(w);q.prototype[w]=function(){var F=arguments;if(O&&!this.__chain__){var W=this.value();return C.apply(wt(W)?W:[],F)}return this[D](function(J){return C.apply(wt(J)?J:[],F)})}}),il(Bt.prototype,function(w,C){var D=q[C];if(D){var O=D.name+"";pn.call(um,O)||(um[O]=[]),um[O].push({name:C,func:D})}}),um[TS(n,g).name]=[{name:"wrapper",func:n}],Bt.prototype.clone=zse,Bt.prototype.reverse=Bse,Bt.prototype.value=Use,q.prototype.at=vae,q.prototype.chain=yae,q.prototype.commit=bae,q.prototype.next=xae,q.prototype.plant=_ae,q.prototype.reverse=Sae,q.prototype.toJSON=q.prototype.valueOf=q.prototype.value=Cae,q.prototype.first=q.prototype.head,Gy&&(q.prototype[Gy]=wae),q},am=bse();Nf?((Nf.exports=am)._=am,iP._=am):as._=am}).call(pr)})(GE,GE.exports);var dC=GE.exports;const _O=({amount:t,scale:e})=>{const n=10**e;return Number(t)/n},LOe=t=>{const e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${e}-${n}-${r}`},Fk={locale:"es-ES"},Tm={amount:null,currencyCode:au.DEFAULT_CURRENCY_CODE,scale:2},ur=class ur extends P${constructor(n,r,s){super(n);Te(this,"_isNull");Te(this,"_options");Te(this,"isEmpty",()=>this.isNull());Te(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(r),this._options=Object.freeze(s)}static validate(n,r){const s=Kt.any().optional().valid(null),i=Kt.number().label(r.label?r.label:"amount"),o=Kt.alternatives(s,i);return bn.validate(o,n)}static getMonetaryValueInfo(n){const[r,s]=n.split("."),i=s?s.length:0;return[(r+s).replace(/[^0-9]/g,""),i]}static create(n=Tm,r=Fk){if(n===null)throw new Error("InvalidParams: props params is missing");const{amount:s=Tm.amount,currencyCode:i=Tm.currencyCode,scale:o=Tm.scale}=n||{},a=ur.validate(s,r);if(a.isFailure)return an.fail(sf(Za.INVALID_INPUT_DATA,a.error.message,r));const c=ur.sanitize(a.object),u=au.createFromCode(i).object.code,f=T1({amount:Number(c),currency:u,precision:o}).setLocale(r.locale);return an.ok(new this(f,dC.isNull(c),r))}static createFromFormattedValue(n,r,s={locale:Fk.locale}){if(n===null||n==="")return ur.create({amount:null,scale:ur.DEFAULT_SCALE,currencyCode:r});const i=String(n),[o,a]=i.split(",");let c=o,u=2;return a===void 0?u=0:(a===""&&(c=o+a.padEnd(1,"0"),u=1),a.length===1?(c=o+a.padEnd(1,"0"),u=1):a.length===2?(c=o+a.padEnd(2,"0"),u=2):a.length===3?(c=o+a.padEnd(3,"0"),u=3):a.length===4&&(c=o+a.padEnd(4,"0"),u=4)),ur.create({amount:c,scale:u,currencyCode:r},s)}static sanitize(n){let r=null;return typeof n=="string"?r=parseFloat(n):r=n,r}static createFromDinero(n){return an.ok(new ur(n,!1,Fk))}static normalizeScale(n){return T1.normalizePrecision(n.map(r=>r.props)).map(r=>ur.createFromDinero(r).object)}static minimum(n){return ur.createFromDinero(T1.minimum(n.map(r=>r.props))).object}static maximum(n){return ur.createFromDinero(T1.maximum(n.map(r=>r.props))).object}static _toString(n,r,s){if(n===null)return"";new Intl.NumberFormat(s,{useGrouping:!0}).format(n===null?0:_O({amount:n,scale:r}));const i=Math.pow(10,r);return(Number(n)/i).toFixed(r)}toString(){return ur._toString(this.isNull()?null:this.getAmount(),this.getScale(),this._options.locale)}toJSON(){var n;return this._isNull?{}:(n=this.props)==null?void 0:n.toJSON()}toPrimitive(){var n;return this._isNull?null:Number((n=this.props)==null?void 0:n.getAmount())}toPrimitives(){return this.toObject()}getAmount(){return this.props.getAmount()}getScale(){return this.props.getPrecision()}convertScale(n,r="HALF_UP"){return this._isNull?ur.create({amount:null,scale:n,currencyCode:this.getCurrency().code}).object:ur.createFromDinero(this.props.convertPrecision(n,r)).object}getCurrency(){return au.createFromCode(this.props.getCurrency()).object}getLocale(){return this.props.getLocale()}add(n){return ur.createFromDinero(this.props.add(n.props)).object}subtract(n){return ur.createFromDinero(this.props.subtract(n.props)).object}multiply(n,r){return ur.createFromDinero(this.props.multiply(n,r)).object}divide(n,r){return ur.createFromDinero(this.props.divide(n,r)).object}percentage(n,r){return ur.createFromDinero(this.props.percentage(n,r)).object}allocate(n){return this.props.allocate(n).map(r=>ur.createFromDinero(r).object)}equalsTo(n){return this.props.equalsTo(n.props)}lessThan(n){return this.props.lessThan(n.props)}lessThanOrEqual(n){return this.props.lessThanOrEqual(n.props)}greaterThan(n){return this.props.greaterThan(n.props)}greaterThanOrEqual(n){return this.props.greaterThanOrEqual(n.props)}isZero(){return this.props.isZero()}isPositive(){return this.props.isPositive()}isNegative(){return this.props.isNegative()}hasSameCurrency(n){return this.props.hasSameCurrency(n.props)}hasSameAmount(n){return this.props.hasSameAmount(n.props)}toFormat(n,r){return this._isNull?"":this.props.toFormat(n,r)}toUnit(){return this.props.toUnit()}toRoundedUnit(n,r){return this.props.toRoundedUnit(n,r)}toObject(){const n=this.props.toObject();return{amount:this._isNull?null:n.amount,scale:n.precision,currency_code:String(n.currency)}}toNumber(){return this.toUnit()}};Te(ur,"DEFAULT_SCALE",Tm.scale),Te(ur,"DEFAULT_CURRENCY_CODE",Tm.currencyCode);let Oi=ur;class SHe extends Kt.ValidationError{}class uJ{constructor(e){Te(this,"_collection",[]);this._collection=e??[]}add(e){this._collection.push(e)}reset(){this._collection=[]}hasSomeFaultyResult(){return this._collection.some(e=>e.isFailure)}getFirstFaultyResult(){return this._collection.find(e=>e.isFailure)}getAllFaultyResults(){return this._collection.filter(e=>e.isFailure)}get objects(){return this._collection.filter(e=>e.isSuccess).map(e=>e.object)}get errors(){return this._collection.filter(e=>e.isFailure).map(e=>e.error)}}const dJ=2,zk={amount:0,scale:dJ},mn=class mn extends H_{constructor(n,r,s){super(n);Te(this,"_isNull");Te(this,"_options");Te(this,"isEmpty",()=>this.isNull());Te(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(r),this._options=Object.freeze(s)}static validate(n,r,s){const i=bn.RULE_ALLOW_NULL_OR_UNDEFINED,o=bn.RULE_ALLOW_EMPTY,a=bn.RULE_IS_TYPE_NUMBER.label(s.label?s.label:"amount"),c=bn.RULE_IS_TYPE_STRING.regex(/^[-]?\d+$/).label(s.label?s.label:"amount"),u=Kt.number().min(mn.MIN_SCALE).max(mn.MAX_SCALE).label(s.label?s.label:"scale"),f=new uJ([bn.validate(Kt.alternatives(i,o,a,c),n),bn.validate(Kt.alternatives(bn.RULE_IS_TYPE_NUMBER.label(s.label?s.label:"scale"),u),r)]);if(f.hasSomeFaultyResult())return f.getFirstFaultyResult();let l=typeof n=="string"?parseInt(n,10):Number(n),d=dC.isNull(r)?mn.DEFAULT_SCALE:Number(r);const p=l/Math.pow(10,d);return p<mn.MIN_VALUE||p>mn.MAX_VALUE?an.fail(new Error(`Value with scale is out of range: ${p}`)):an.ok()}static create(n=zk,r={}){if(n===null)throw new Error("InvalidParams: props params is missing");const{amount:s=zk.amount,scale:i=zk.scale}=n,o={label:"percentage",...r},a=mn.validate(s,i,o);if(a.isFailure)return an.fail(sf(Za.INVALID_INPUT_DATA,a.error.message,o));let c=mn._sanitize(s);const u={amount:dC.isNull(c)?0:c,scale:i};return an.ok(new this(u,dC.isNull(c),r))}static createFromFormattedValue(n,r={}){if(n===null||n==="")return mn.create({amount:null,scale:mn.DEFAULT_SCALE});const s=String(n),[i,o]=s.split(",");let a=i,c=2;return o===void 0?c=0:(o===""&&(a=i+o.padEnd(1,"0"),c=1),o.length===1?(a=i+o.padEnd(1,"0"),c=1):o.length===2&&(a=i+o.padEnd(2,"0"),c=2)),mn.create({amount:a,scale:c},r)}static _sanitize(n){let r=null;return typeof n=="string"?r=parseInt(n,10):r=n,r}static _toString(n,r){if(n===null)return"";const s=Math.pow(10,r);return(Number(n)/s).toFixed(r)}static _isWithinRange(n,r){const s=Number(mn._toString(n,r));return s>=mn.MIN_VALUE&&s<=mn.MAX_VALUE}get amount(){var n;return this.isNull()?null:Number((n=this.props)==null?void 0:n.amount)}get scale(){var n;return Number((n=this.props)==null?void 0:n.scale)}getAmount(){var n;return this.isNull()?null:Number((n=this.props)==null?void 0:n.amount)}getScale(){var n;return this.isNull()?0:Number((n=this.props)==null?void 0:n.scale)}toString(){return mn._toString(this.amount,this.scale)}toNumber(){return this.isNull()?0:Number(this.toString())}toFormat(){return this._isNull?"":Intl.NumberFormat("es-ES",{maximumFractionDigits:2}).format(this.toNumber())}toPrimitive(){return this.scale!==mn.DEFAULT_SCALE?this.convertScale(mn.DEFAULT_SCALE).toPrimitive():this.amount}toPrimitives(){return this.toObject()}toObject(){return{amount:this.amount,scale:this.scale}}convertScale(n){if(n<mn.MIN_SCALE||n>mn.MAX_SCALE)throw new Error(`Scale out of range: ${n}`);if(this.isNull())return new mn({amount:null,scale:n},!0,this._options);const r=Math.pow(10,this.scale),s=Number(this.amount)/r,i=Math.pow(10,n),o=Math.round(s*i);if(!mn._isWithinRange(o,n))throw new Error(`Value out of range after conversion: ${o} ${n}`);return new mn({amount:o,scale:n},!1,this._options)}hasSameScale(n){return this.scale===n.scale}isWithinRange(){return mn._isWithinRange(this.amount,this.scale)}};Te(mn,"DEFAULT_SCALE",dJ),Te(mn,"MIN_VALUE",0),Te(mn,"MAX_VALUE",100),Te(mn,"MIN_SCALE",0),Te(mn,"MAX_SCALE",2);let of=mn;class CHe extends Kt.ValidationError{}const fJ=2,Bk={amount:0,scale:fJ},Sn=class Sn extends H_{constructor(n,r,s){super(n);Te(this,"_isNull");Te(this,"_options");Te(this,"isEmpty",()=>this.isNull());Te(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(r),this._options=Object.freeze(s)}static validate(n,r,s={}){const i=bn.RULE_ALLOW_NULL_OR_UNDEFINED,o=bn.RULE_ALLOW_EMPTY,a=bn.RULE_IS_TYPE_NUMBER.label(s.label?s.label:"amount"),c=bn.RULE_IS_TYPE_STRING.regex(/^[-]?\d+$/).label(s.label?s.label:"amount"),u=Kt.number().min(Sn.MIN_SCALE).max(Sn.MAX_SCALE).label(s.label?s.label:"scale"),f=new uJ([bn.validate(Kt.alternatives(i,o,a,c),n),bn.validate(Kt.alternatives(bn.RULE_IS_TYPE_NUMBER.label(s.label?s.label:"scale"),u),r)]);return f.hasSomeFaultyResult()?f.getFirstFaultyResult():an.ok()}static create(n=Bk,r={}){if(n===null)throw new Error("InvalidParams: props params is missing");const{amount:s=Bk.amount,scale:i=Bk.scale}=n,o={label:"quantity",...r},a=Sn.validate(s,i,o);if(a.isFailure)return an.fail(sf(Za.INVALID_INPUT_DATA,a.error.message,o));let c=Sn._sanitize(s);const u={amount:c===null?0:c,scale:i};return an.ok(new Sn(u,c===null,r))}static createFromFormattedValue(n,r={}){if(n===null||n==="")return Sn.create({amount:null,scale:Sn.DEFAULT_SCALE});const s=String(n),[i,o]=s.split(",");let a=i,c=2;return o===void 0?c=0:(o===""&&(a=i+o.padEnd(1,"0"),c=1),o.length===1?(a=i+o.padEnd(1,"0"),c=1):o.length===2&&(a=i+o.padEnd(2,"0"),c=2)),Sn.create({amount:a,scale:c},r)}static _sanitize(n){let r=null;return typeof n=="string"?r=parseInt(n,10):r=n,r}static _toString(n,r){if(n===null)return"";const s=Math.pow(10,r);return(Number(n)/s).toFixed(r)}get amount(){var n;return this.isNull()?null:Number((n=this.props)==null?void 0:n.amount)}get scale(){var n;return Number((n=this.props)==null?void 0:n.scale)}getAmount(){var n;return this.isNull()?null:Number((n=this.props)==null?void 0:n.amount)}getScale(){var n;return this.isNull()?0:Number((n=this.props)==null?void 0:n.scale)}toString(){return Sn._toString(this.amount,this.scale)}toNumber(){return this.isNull()?0:Number(this.toString())}toFormat(){return this._isNull?"":Intl.NumberFormat("es-ES",{maximumFractionDigits:2}).format(this.toNumber())}toPrimitive(){return this.scale!==Sn.DEFAULT_SCALE?this.convertScale(Sn.DEFAULT_SCALE).toPrimitive():this.amount}toPrimitives(){return this.toObject()}toObject(){return{amount:this.amount,scale:this.scale}}convertScale(n){if(n<Sn.MIN_SCALE||n>Sn.MAX_SCALE)throw new Error(`Scale out of range: ${n}`);if(this.isNull())return new Sn({amount:null,scale:n},!0,this._options);const r=Math.pow(10,this.scale),s=Number(this.amount)/r,i=Math.pow(10,n),o=Math.round(s*i);return new Sn({amount:o,scale:n},!1,this._options)}hasSameScale(n){return this.scale===n.scale}increment(n){return this.isNull()?n?Sn.create(n.toObject()):Sn.create():n?this.hasSameScale(n)?Sn.create({amount:Number(this.amount)+Number(n.amount),scale:this.scale},this._options):an.fail(Error("No se pueden sumar cantidades con diferentes escalas.")):Sn.create({amount:Number(this.amount)+1,scale:this.scale},this._options)}decrement(n){return this.isNull()?n?Sn.create(n.toObject()):Sn.create():n?this.hasSameScale(n)?Sn.create({amount:Number(this.amount)-Number(n.amount),scale:this.scale},this._options):an.fail(Error("No se pueden restar cantidades con diferentes escalas.")):Sn.create({amount:Number(this.amount)-1,scale:this.scale},this._options)}};Te(Sn,"DEFAULT_SCALE",fJ),Te(Sn,"MIN_SCALE",0),Te(Sn,"MAX_SCALE",2);let af=Sn;const NU=2;class $Oe extends Oi{static create(e){const{amount:n,currencyCode:r,scale:s=NU}=e,i=Oi.create({amount:n,currencyCode:r,scale:s});if(i.isFailure)return i;const o=i.object.convertScale(NU);return an.ok(o)}}class xg extends P${constructor(){super(...arguments);Te(this,"isValid",()=>!isNaN(this.props.valueOf())&&this.props.valueOf()!==0);Te(this,"isEmpty",()=>!this.isValid());Te(this,"toISO8601",()=>this.isValid()?this.props.toISOString():"");Te(this,"toDateString",()=>this.isValid()?this.props.toDateString():"");Te(this,"toLocaleDateString",(n,r)=>this.isValid()?this.props.toLocaleDateString(n,r):"");Te(this,"toLocaleTimeString",()=>this.isValid()?this.props.toLocaleTimeString():"")}static validate(n,r){const s=bn.RULE_ALLOW_EMPTY.default(0),i=Kt.date().label(String(r.label)),o=Kt.alternatives(s,i);return bn.validate(o,n)}static createCurrentDate(){return an.ok(new xg(new Date))}static create(n,r={}){const s={...r,dateFormat:r.dateFormat?r.dateFormat:"YYYY-MM-DD",label:r.label?r.label:"date"},i=xg.validate(n,s);return i.isFailure?an.fail(sf(Za.INVALID_INPUT_DATA,i.error.message,s)):an.ok(new xg(new Date(i.object)))}toString(){if(!this.isEmpty()){const n=this.props.getFullYear(),r=String(this.props.getMonth()+1).padStart(2,"0"),s=String(this.props.getDate()).padStart(2,"0");return`${n}-${r}-${s}`}return""}toPrimitive(){return this.toISO8601()}}const wg=0,T$=10,SO=1,hJ=9999,FOe=({isPending:t,interval:e=1e3,onInterval:n})=>{const[r,s]=S.useState(void 0);return S.useEffect(()=>{let i;return t&&(i=setInterval(()=>{s(o=>o===void 0?e:o+e)},e)),()=>{clearInterval(i),s(void 0)}},[t,e]),S.useEffect(()=>{n&&r&&n(r)},[r]),{elapsedTime:r}},zOe=2*60*1e3,BOe=60*1e3,k$=({queryKey:t,queryFn:e,enabled:n,select:r,queryOptions:s={},overtimeOptions:i})=>{const[o,a]=S.useState(!1),c=JA({queryKey:t,queryFn:e,placeholderData:M8,staleTime:BOe,refetchInterval:zOe,refetchOnWindowFocus:!0,enabled:n&&!!e,select:r,...s});S.useEffect(()=>{c.isSuccess&&dOe(c.data)&&a(c.data.total_items===0)},[c]);const{elapsedTime:u}=FOe({isPending:c.isFetching,interval:i==null?void 0:i.interval,onInterval:i==null?void 0:i.onInterval});return{...c,overtime:{elapsedTime:u},isEmpty:o}},pJ=t=>JA({placeholderData:M8,...t});function UOe(t){return Ol({...t})}const mJ=S.createContext(void 0),HOe=({dataSource:t,children:e})=>b.jsx(mJ.Provider,{value:t,children:e}),VOe=[5,10,15,30,50,75,100],xN=(t=wg,e=T$)=>{const[n,r]=S.useState({pageIndex:t,pageSize:e});return[n,i=>{const o=i;return o.pageIndex<wg&&(o.pageIndex=wg),(i.pageSize<SO||i.pageSize>hJ)&&(o.pageSize=SO),r(a=>({...a,pageIndex:i.pageIndex,pageSize:i.pageSize})),o}]},qOe=(t=wg,e=T$)=>{const[n,r]=FMe(),s=n.get("page_index"),i=n.get("page_size"),o=S.useMemo(()=>{const l=parseInt(s??"",10);let d=isNaN(l)?t:l;return d<t&&(d=t),d},[s,t]),a=S.useMemo(()=>{const l=parseInt(i??"",10);let d=isNaN(l)?e:l;return(d<SO||d>hJ)&&(d=e),d},[i,e]),[c,u]=xN(o,a);return[c,l=>{const d=u(l);r({page_index:String(d.pageIndex),page_size:String(d.pageSize)})}]},WOe=({syncWithLocation:t=!0,initialPageIndex:e,initialPageSize:n})=>{const[r,s]=qOe(),[i,o]=xN(e,n);return t?[r,s]:[i,o]},gJ=S.createContext(null),ny=({syncWithLocation:t=!0,initialGlobalFilter:e=[],initialPageIndex:n,initialPageSize:r,children:s})=>{const[i,o]=WOe({syncWithLocation:t,initialPageIndex:n,initialPageSize:r}),[a,c]=S.useState(e||[]),[u,f]=S.useState([]),l=S.useMemo(()=>!!(a&&a.length),[a]),d=S.useCallback(()=>c([]),[]);return b.jsx(gJ.Provider,{value:{pagination:i,setPagination:o,sorting:u,setSorting:f,globalFilter:a,setGlobalFilter:c,resetGlobalFilter:d,isFiltered:l},children:s})};/**
|
||
* table-core
|
||
*
|
||
* Copyright (c) TanStack
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function GOe(){return{accessor:(t,e)=>typeof t=="function"?{...e,accessorFn:t}:{...e,accessorKey:t},display:t=>t,group:t=>t}}function Bd(t,e){return typeof t=="function"?t(e):t}function Ao(t,e){return n=>{e.setState(r=>({...r,[t]:Bd(n,r[t])}))}}function wN(t){return t instanceof Function}function KOe(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}function YOe(t,e){const n=[],r=s=>{s.forEach(i=>{n.push(i);const o=e(i);o!=null&&o.length&&r(o)})};return r(t),n}function lt(t,e,n){let r=[],s;return i=>{let o;n.key&&n.debug&&(o=Date.now());const a=t(i);if(!(a.length!==r.length||a.some((f,l)=>r[l]!==f)))return s;r=a;let u;if(n.key&&n.debug&&(u=Date.now()),s=e(...a),n==null||n.onChange==null||n.onChange(s),n.key&&n.debug&&n!=null&&n.debug()){const f=Math.round((Date.now()-o)*100)/100,l=Math.round((Date.now()-u)*100)/100,d=l/16,p=(h,m)=>{for(h=String(h);h.length<m;)h=" "+h;return h};console.info(`%c⏱ ${p(l,5)} /${p(f,5)} ms`,`
|
||
font-size: .6rem;
|
||
font-weight: bold;
|
||
color: hsl(${Math.max(0,Math.min(120-120*d,120))}deg 100% 31%);`,n==null?void 0:n.key)}return s}}function ct(t,e,n,r){return{debug:()=>{var s;return(s=t==null?void 0:t.debugAll)!=null?s:t[e]},key:!1,onChange:r}}function XOe(t,e,n,r){const s=()=>{var o;return(o=i.getValue())!=null?o:t.options.renderFallbackValue},i={id:`${e.id}_${n.id}`,row:e,column:n,getValue:()=>e.getValue(r),renderValue:s,getContext:lt(()=>[t,n,e,i],(o,a,c,u)=>({table:o,column:a,row:c,cell:u,getValue:u.getValue,renderValue:u.renderValue}),ct(t.options,"debugCells"))};return t._features.forEach(o=>{o.createCell==null||o.createCell(i,n,e,t)},{}),i}function QOe(t,e,n,r){var s,i;const a={...t._getDefaultColumnDef(),...e},c=a.accessorKey;let u=(s=(i=a.id)!=null?i:c?typeof String.prototype.replaceAll=="function"?c.replaceAll(".","_"):c.replace(/\./g,"_"):void 0)!=null?s:typeof a.header=="string"?a.header:void 0,f;if(a.accessorFn?f=a.accessorFn:c&&(c.includes(".")?f=d=>{let p=d;for(const m of c.split(".")){var h;p=(h=p)==null?void 0:h[m]}return p}:f=d=>d[a.accessorKey]),!u)throw new Error;let l={id:`${String(u)}`,accessorFn:f,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:lt(()=>[!0],()=>{var d;return[l,...(d=l.columns)==null?void 0:d.flatMap(p=>p.getFlatColumns())]},ct(t.options,"debugColumns")),getLeafColumns:lt(()=>[t._getOrderColumnsFn()],d=>{var p;if((p=l.columns)!=null&&p.length){let h=l.columns.flatMap(m=>m.getLeafColumns());return d(h)}return[l]},ct(t.options,"debugColumns"))};for(const d of t._features)d.createColumn==null||d.createColumn(l,t);return l}const Ts="debugHeaders";function PU(t,e,n){var r;let i={id:(r=n.id)!=null?r:e.id,column:e,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const o=[],a=c=>{c.subHeaders&&c.subHeaders.length&&c.subHeaders.map(a),o.push(c)};return a(i),o},getContext:()=>({table:t,header:i,column:e})};return t._features.forEach(o=>{o.createHeader==null||o.createHeader(i,t)}),i}const ZOe={createTable:t=>{t.getHeaderGroups=lt(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r,s)=>{var i,o;const a=(i=r==null?void 0:r.map(l=>n.find(d=>d.id===l)).filter(Boolean))!=null?i:[],c=(o=s==null?void 0:s.map(l=>n.find(d=>d.id===l)).filter(Boolean))!=null?o:[],u=n.filter(l=>!(r!=null&&r.includes(l.id))&&!(s!=null&&s.includes(l.id)));return k1(e,[...a,...u,...c],t)},ct(t.options,Ts)),t.getCenterHeaderGroups=lt(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r,s)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(s!=null&&s.includes(i.id))),k1(e,n,t,"center")),ct(t.options,Ts)),t.getLeftHeaderGroups=lt(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,n,r)=>{var s;const i=(s=r==null?void 0:r.map(o=>n.find(a=>a.id===o)).filter(Boolean))!=null?s:[];return k1(e,i,t,"left")},ct(t.options,Ts)),t.getRightHeaderGroups=lt(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,n,r)=>{var s;const i=(s=r==null?void 0:r.map(o=>n.find(a=>a.id===o)).filter(Boolean))!=null?s:[];return k1(e,i,t,"right")},ct(t.options,Ts)),t.getFooterGroups=lt(()=>[t.getHeaderGroups()],e=>[...e].reverse(),ct(t.options,Ts)),t.getLeftFooterGroups=lt(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),ct(t.options,Ts)),t.getCenterFooterGroups=lt(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),ct(t.options,Ts)),t.getRightFooterGroups=lt(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),ct(t.options,Ts)),t.getFlatHeaders=lt(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),ct(t.options,Ts)),t.getLeftFlatHeaders=lt(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),ct(t.options,Ts)),t.getCenterFlatHeaders=lt(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),ct(t.options,Ts)),t.getRightFlatHeaders=lt(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),ct(t.options,Ts)),t.getCenterLeafHeaders=lt(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ct(t.options,Ts)),t.getLeftLeafHeaders=lt(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ct(t.options,Ts)),t.getRightLeafHeaders=lt(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ct(t.options,Ts)),t.getLeafHeaders=lt(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,n,r)=>{var s,i,o,a,c,u;return[...(s=(i=e[0])==null?void 0:i.headers)!=null?s:[],...(o=(a=n[0])==null?void 0:a.headers)!=null?o:[],...(c=(u=r[0])==null?void 0:u.headers)!=null?c:[]].map(f=>f.getLeafHeaders()).flat()},ct(t.options,Ts))}};function k1(t,e,n,r){var s,i;let o=0;const a=function(d,p){p===void 0&&(p=1),o=Math.max(o,p),d.filter(h=>h.getIsVisible()).forEach(h=>{var m;(m=h.columns)!=null&&m.length&&a(h.columns,p+1)},0)};a(t);let c=[];const u=(d,p)=>{const h={depth:p,id:[r,`${p}`].filter(Boolean).join("_"),headers:[]},m=[];d.forEach(y=>{const g=[...m].reverse()[0],v=y.column.depth===h.depth;let x,_=!1;if(v&&y.column.parent?x=y.column.parent:(x=y.column,_=!0),g&&(g==null?void 0:g.column)===x)g.subHeaders.push(y);else{const A=PU(n,x,{id:[r,p,x.id,y==null?void 0:y.id].filter(Boolean).join("_"),isPlaceholder:_,placeholderId:_?`${m.filter(N=>N.column===x).length}`:void 0,depth:p,index:m.length});A.subHeaders.push(y),m.push(A)}h.headers.push(y),y.headerGroup=h}),c.push(h),p>0&&u(m,p-1)},f=e.map((d,p)=>PU(n,d,{depth:o,index:p}));u(f,o-1),c.reverse();const l=d=>d.filter(h=>h.column.getIsVisible()).map(h=>{let m=0,y=0,g=[0];h.subHeaders&&h.subHeaders.length?(g=[],l(h.subHeaders).forEach(x=>{let{colSpan:_,rowSpan:A}=x;m+=_,g.push(A)})):m=1;const v=Math.min(...g);return y=y+v,h.colSpan=m,h.rowSpan=y,{colSpan:m,rowSpan:y}});return l((s=(i=c[0])==null?void 0:i.headers)!=null?s:[]),c}const D$=(t,e,n,r,s,i,o)=>{let a={id:e,index:r,original:n,depth:s,parentId:o,_valuesCache:{},_uniqueValuesCache:{},getValue:c=>{if(a._valuesCache.hasOwnProperty(c))return a._valuesCache[c];const u=t.getColumn(c);if(u!=null&&u.accessorFn)return a._valuesCache[c]=u.accessorFn(a.original,r),a._valuesCache[c]},getUniqueValues:c=>{if(a._uniqueValuesCache.hasOwnProperty(c))return a._uniqueValuesCache[c];const u=t.getColumn(c);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(a._uniqueValuesCache[c]=u.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[c]):(a._uniqueValuesCache[c]=[a.getValue(c)],a._uniqueValuesCache[c])},renderValue:c=>{var u;return(u=a.getValue(c))!=null?u:t.options.renderFallbackValue},subRows:[],getLeafRows:()=>YOe(a.subRows,c=>c.subRows),getParentRow:()=>a.parentId?t.getRow(a.parentId,!0):void 0,getParentRows:()=>{let c=[],u=a;for(;;){const f=u.getParentRow();if(!f)break;c.push(f),u=f}return c.reverse()},getAllCells:lt(()=>[t.getAllLeafColumns()],c=>c.map(u=>XOe(t,a,u,u.id)),ct(t.options,"debugRows")),_getAllCellsByColumnId:lt(()=>[a.getAllCells()],c=>c.reduce((u,f)=>(u[f.column.id]=f,u),{}),ct(t.options,"debugRows"))};for(let c=0;c<t._features.length;c++){const u=t._features[c];u==null||u.createRow==null||u.createRow(a,t)}return a},JOe={createColumn:(t,e)=>{t._getFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,t.id),t.getFacetedRowModel=()=>t._getFacetedRowModel?t._getFacetedRowModel():e.getPreFilteredRowModel(),t._getFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,t.id),t.getFacetedUniqueValues=()=>t._getFacetedUniqueValues?t._getFacetedUniqueValues():new Map,t._getFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,t.id),t.getFacetedMinMaxValues=()=>{if(t._getFacetedMinMaxValues)return t._getFacetedMinMaxValues()}}},vJ=(t,e,n)=>{var r;const s=n.toLowerCase();return!!(!((r=t.getValue(e))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(s))};vJ.autoRemove=t=>qa(t);const yJ=(t,e,n)=>{var r;return!!(!((r=t.getValue(e))==null||(r=r.toString())==null)&&r.includes(n))};yJ.autoRemove=t=>qa(t);const bJ=(t,e,n)=>{var r;return((r=t.getValue(e))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};bJ.autoRemove=t=>qa(t);const xJ=(t,e,n)=>{var r;return(r=t.getValue(e))==null?void 0:r.includes(n)};xJ.autoRemove=t=>qa(t)||!(t!=null&&t.length);const wJ=(t,e,n)=>!n.some(r=>{var s;return!((s=t.getValue(e))!=null&&s.includes(r))});wJ.autoRemove=t=>qa(t)||!(t!=null&&t.length);const _J=(t,e,n)=>n.some(r=>{var s;return(s=t.getValue(e))==null?void 0:s.includes(r)});_J.autoRemove=t=>qa(t)||!(t!=null&&t.length);const SJ=(t,e,n)=>t.getValue(e)===n;SJ.autoRemove=t=>qa(t);const CJ=(t,e,n)=>t.getValue(e)==n;CJ.autoRemove=t=>qa(t);const M$=(t,e,n)=>{let[r,s]=n;const i=t.getValue(e);return i>=r&&i<=s};M$.resolveFilterValue=t=>{let[e,n]=t,r=typeof e!="number"?parseFloat(e):e,s=typeof n!="number"?parseFloat(n):n,i=e===null||Number.isNaN(r)?-1/0:r,o=n===null||Number.isNaN(s)?1/0:s;if(i>o){const a=i;i=o,o=a}return[i,o]};M$.autoRemove=t=>qa(t)||qa(t[0])&&qa(t[1]);const _c={includesString:vJ,includesStringSensitive:yJ,equalsString:bJ,arrIncludes:xJ,arrIncludesAll:wJ,arrIncludesSome:_J,equals:SJ,weakEquals:CJ,inNumberRange:M$};function qa(t){return t==null||t===""}const eIe={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],...t}),getDefaultOptions:t=>({onColumnFiltersChange:Ao("columnFilters",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(t,e)=>{t.getAutoFilterFn=()=>{const n=e.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(t.id);return typeof r=="string"?_c.includesString:typeof r=="number"?_c.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?_c.equals:Array.isArray(r)?_c.arrIncludes:_c.weakEquals},t.getFilterFn=()=>{var n,r;return wN(t.columnDef.filterFn)?t.columnDef.filterFn:t.columnDef.filterFn==="auto"?t.getAutoFilterFn():(n=(r=e.options.filterFns)==null?void 0:r[t.columnDef.filterFn])!=null?n:_c[t.columnDef.filterFn]},t.getCanFilter=()=>{var n,r,s;return((n=t.columnDef.enableColumnFilter)!=null?n:!0)&&((r=e.options.enableColumnFilters)!=null?r:!0)&&((s=e.options.enableFilters)!=null?s:!0)&&!!t.accessorFn},t.getIsFiltered=()=>t.getFilterIndex()>-1,t.getFilterValue=()=>{var n;return(n=e.getState().columnFilters)==null||(n=n.find(r=>r.id===t.id))==null?void 0:n.value},t.getFilterIndex=()=>{var n,r;return(n=(r=e.getState().columnFilters)==null?void 0:r.findIndex(s=>s.id===t.id))!=null?n:-1},t.setFilterValue=n=>{e.setColumnFilters(r=>{const s=t.getFilterFn(),i=r==null?void 0:r.find(f=>f.id===t.id),o=Bd(n,i?i.value:void 0);if(TU(s,o,t)){var a;return(a=r==null?void 0:r.filter(f=>f.id!==t.id))!=null?a:[]}const c={id:t.id,value:o};if(i){var u;return(u=r==null?void 0:r.map(f=>f.id===t.id?c:f))!=null?u:[]}return r!=null&&r.length?[...r,c]:[c]})}},createRow:(t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},createTable:t=>{t.setColumnFilters=e=>{const n=t.getAllLeafColumns(),r=s=>{var i;return(i=Bd(e,s))==null?void 0:i.filter(o=>{const a=n.find(c=>c.id===o.id);if(a){const c=a.getFilterFn();if(TU(c,o.value,a))return!1}return!0})};t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(r)},t.resetColumnFilters=e=>{var n,r;t.setColumnFilters(e?[]:(n=(r=t.initialState)==null?void 0:r.columnFilters)!=null?n:[])},t.getPreFilteredRowModel=()=>t.getCoreRowModel(),t.getFilteredRowModel=()=>(!t._getFilteredRowModel&&t.options.getFilteredRowModel&&(t._getFilteredRowModel=t.options.getFilteredRowModel(t)),t.options.manualFiltering||!t._getFilteredRowModel?t.getPreFilteredRowModel():t._getFilteredRowModel())}};function TU(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const tIe=(t,e,n)=>n.reduce((r,s)=>{const i=s.getValue(t);return r+(typeof i=="number"?i:0)},0),nIe=(t,e,n)=>{let r;return n.forEach(s=>{const i=s.getValue(t);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},rIe=(t,e,n)=>{let r;return n.forEach(s=>{const i=s.getValue(t);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},sIe=(t,e,n)=>{let r,s;return n.forEach(i=>{const o=i.getValue(t);o!=null&&(r===void 0?o>=o&&(r=s=o):(r>o&&(r=o),s<o&&(s=o)))}),[r,s]},iIe=(t,e)=>{let n=0,r=0;if(e.forEach(s=>{let i=s.getValue(t);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},oIe=(t,e)=>{if(!e.length)return;const n=e.map(i=>i.getValue(t));if(!KOe(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),s=n.sort((i,o)=>i-o);return n.length%2!==0?s[r]:(s[r-1]+s[r])/2},aIe=(t,e)=>Array.from(new Set(e.map(n=>n.getValue(t))).values()),lIe=(t,e)=>new Set(e.map(n=>n.getValue(t))).size,cIe=(t,e)=>e.length,Uk={sum:tIe,min:nIe,max:rIe,extent:sIe,mean:iIe,median:oIe,unique:aIe,uniqueCount:lIe,count:cIe},uIe={getDefaultColumnDef:()=>({aggregatedCell:t=>{var e,n;return(e=(n=t.getValue())==null||n.toString==null?void 0:n.toString())!=null?e:null},aggregationFn:"auto"}),getInitialState:t=>({grouping:[],...t}),getDefaultOptions:t=>({onGroupingChange:Ao("grouping",t),groupedColumnMode:"reorder"}),createColumn:(t,e)=>{t.toggleGrouping=()=>{e.setGrouping(n=>n!=null&&n.includes(t.id)?n.filter(r=>r!==t.id):[...n??[],t.id])},t.getCanGroup=()=>{var n,r;return((n=t.columnDef.enableGrouping)!=null?n:!0)&&((r=e.options.enableGrouping)!=null?r:!0)&&(!!t.accessorFn||!!t.columnDef.getGroupingValue)},t.getIsGrouped=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.includes(t.id)},t.getGroupedIndex=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.indexOf(t.id)},t.getToggleGroupingHandler=()=>{const n=t.getCanGroup();return()=>{n&&t.toggleGrouping()}},t.getAutoAggregationFn=()=>{const n=e.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(t.id);if(typeof r=="number")return Uk.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Uk.extent},t.getAggregationFn=()=>{var n,r;if(!t)throw new Error;return wN(t.columnDef.aggregationFn)?t.columnDef.aggregationFn:t.columnDef.aggregationFn==="auto"?t.getAutoAggregationFn():(n=(r=e.options.aggregationFns)==null?void 0:r[t.columnDef.aggregationFn])!=null?n:Uk[t.columnDef.aggregationFn]}},createTable:t=>{t.setGrouping=e=>t.options.onGroupingChange==null?void 0:t.options.onGroupingChange(e),t.resetGrouping=e=>{var n,r;t.setGrouping(e?[]:(n=(r=t.initialState)==null?void 0:r.grouping)!=null?n:[])},t.getPreGroupedRowModel=()=>t.getFilteredRowModel(),t.getGroupedRowModel=()=>(!t._getGroupedRowModel&&t.options.getGroupedRowModel&&(t._getGroupedRowModel=t.options.getGroupedRowModel(t)),t.options.manualGrouping||!t._getGroupedRowModel?t.getPreGroupedRowModel():t._getGroupedRowModel())},createRow:(t,e)=>{t.getIsGrouped=()=>!!t.groupingColumnId,t.getGroupingValue=n=>{if(t._groupingValuesCache.hasOwnProperty(n))return t._groupingValuesCache[n];const r=e.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(t._groupingValuesCache[n]=r.columnDef.getGroupingValue(t.original),t._groupingValuesCache[n]):t.getValue(n)},t._groupingValuesCache={}},createCell:(t,e,n,r)=>{t.getIsGrouped=()=>e.getIsGrouped()&&e.id===n.groupingColumnId,t.getIsPlaceholder=()=>!t.getIsGrouped()&&e.getIsGrouped(),t.getIsAggregated=()=>{var s;return!t.getIsGrouped()&&!t.getIsPlaceholder()&&!!((s=n.subRows)!=null&&s.length)}}};function dIe(t,e,n){if(!(e!=null&&e.length)||!n)return t;const r=t.filter(i=>!e.includes(i.id));return n==="remove"?r:[...e.map(i=>t.find(o=>o.id===i)).filter(Boolean),...r]}const fIe={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:Ao("columnOrder",t)}),createColumn:(t,e)=>{t.getIndex=lt(n=>[R0(e,n)],n=>n.findIndex(r=>r.id===t.id),ct(e.options,"debugColumns")),t.getIsFirstColumn=n=>{var r;return((r=R0(e,n)[0])==null?void 0:r.id)===t.id},t.getIsLastColumn=n=>{var r;const s=R0(e,n);return((r=s[s.length-1])==null?void 0:r.id)===t.id}},createTable:t=>{t.setColumnOrder=e=>t.options.onColumnOrderChange==null?void 0:t.options.onColumnOrderChange(e),t.resetColumnOrder=e=>{var n;t.setColumnOrder(e?[]:(n=t.initialState.columnOrder)!=null?n:[])},t._getOrderColumnsFn=lt(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,n,r)=>s=>{let i=[];if(!(e!=null&&e.length))i=s;else{const o=[...e],a=[...s];for(;a.length&&o.length;){const c=o.shift(),u=a.findIndex(f=>f.id===c);u>-1&&i.push(a.splice(u,1)[0])}i=[...i,...a]}return dIe(i,n,r)},ct(t.options,"debugTable"))}},Hk=()=>({left:[],right:[]}),hIe={getInitialState:t=>({columnPinning:Hk(),...t}),getDefaultOptions:t=>({onColumnPinningChange:Ao("columnPinning",t)}),createColumn:(t,e)=>{t.pin=n=>{const r=t.getLeafColumns().map(s=>s.id).filter(Boolean);e.setColumnPinning(s=>{var i,o;if(n==="right"){var a,c;return{left:((a=s==null?void 0:s.left)!=null?a:[]).filter(l=>!(r!=null&&r.includes(l))),right:[...((c=s==null?void 0:s.right)!=null?c:[]).filter(l=>!(r!=null&&r.includes(l))),...r]}}if(n==="left"){var u,f;return{left:[...((u=s==null?void 0:s.left)!=null?u:[]).filter(l=>!(r!=null&&r.includes(l))),...r],right:((f=s==null?void 0:s.right)!=null?f:[]).filter(l=>!(r!=null&&r.includes(l)))}}return{left:((i=s==null?void 0:s.left)!=null?i:[]).filter(l=>!(r!=null&&r.includes(l))),right:((o=s==null?void 0:s.right)!=null?o:[]).filter(l=>!(r!=null&&r.includes(l)))}})},t.getCanPin=()=>t.getLeafColumns().some(r=>{var s,i,o;return((s=r.columnDef.enablePinning)!=null?s:!0)&&((i=(o=e.options.enableColumnPinning)!=null?o:e.options.enablePinning)!=null?i:!0)}),t.getIsPinned=()=>{const n=t.getLeafColumns().map(a=>a.id),{left:r,right:s}=e.getState().columnPinning,i=n.some(a=>r==null?void 0:r.includes(a)),o=n.some(a=>s==null?void 0:s.includes(a));return i?"left":o?"right":!1},t.getPinnedIndex=()=>{var n,r;const s=t.getIsPinned();return s?(n=(r=e.getState().columnPinning)==null||(r=r[s])==null?void 0:r.indexOf(t.id))!=null?n:-1:0}},createRow:(t,e)=>{t.getCenterVisibleCells=lt(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,s)=>{const i=[...r??[],...s??[]];return n.filter(o=>!i.includes(o.column.id))},ct(e.options,"debugRows")),t.getLeftVisibleCells=lt(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(o=>o.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),ct(e.options,"debugRows")),t.getRightVisibleCells=lt(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(o=>o.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),ct(e.options,"debugRows"))},createTable:t=>{t.setColumnPinning=e=>t.options.onColumnPinningChange==null?void 0:t.options.onColumnPinningChange(e),t.resetColumnPinning=e=>{var n,r;return t.setColumnPinning(e?Hk():(n=(r=t.initialState)==null?void 0:r.columnPinning)!=null?n:Hk())},t.getIsSomeColumnsPinned=e=>{var n;const r=t.getState().columnPinning;if(!e){var s,i;return!!((s=r.left)!=null&&s.length||(i=r.right)!=null&&i.length)}return!!((n=r[e])!=null&&n.length)},t.getLeftLeafColumns=lt(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(r=>e.find(s=>s.id===r)).filter(Boolean),ct(t.options,"debugColumns")),t.getRightLeafColumns=lt(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(r=>e.find(s=>s.id===r)).filter(Boolean),ct(t.options,"debugColumns")),t.getCenterLeafColumns=lt(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r)=>{const s=[...n??[],...r??[]];return e.filter(i=>!s.includes(i.id))},ct(t.options,"debugColumns"))}},D1={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Vk=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),pIe={getDefaultColumnDef:()=>D1,getInitialState:t=>({columnSizing:{},columnSizingInfo:Vk(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ao("columnSizing",t),onColumnSizingInfoChange:Ao("columnSizingInfo",t)}),createColumn:(t,e)=>{t.getSize=()=>{var n,r,s;const i=e.getState().columnSizing[t.id];return Math.min(Math.max((n=t.columnDef.minSize)!=null?n:D1.minSize,(r=i??t.columnDef.size)!=null?r:D1.size),(s=t.columnDef.maxSize)!=null?s:D1.maxSize)},t.getStart=lt(n=>[n,R0(e,n),e.getState().columnSizing],(n,r)=>r.slice(0,t.getIndex(n)).reduce((s,i)=>s+i.getSize(),0),ct(e.options,"debugColumns")),t.getAfter=lt(n=>[n,R0(e,n),e.getState().columnSizing],(n,r)=>r.slice(t.getIndex(n)+1).reduce((s,i)=>s+i.getSize(),0),ct(e.options,"debugColumns")),t.resetSize=()=>{e.setColumnSizing(n=>{let{[t.id]:r,...s}=n;return s})},t.getCanResize=()=>{var n,r;return((n=t.columnDef.enableResizing)!=null?n:!0)&&((r=e.options.enableColumnResizing)!=null?r:!0)},t.getIsResizing=()=>e.getState().columnSizingInfo.isResizingColumn===t.id},createHeader:(t,e)=>{t.getSize=()=>{let n=0;const r=s=>{if(s.subHeaders.length)s.subHeaders.forEach(r);else{var i;n+=(i=s.column.getSize())!=null?i:0}};return r(t),n},t.getStart=()=>{if(t.index>0){const n=t.headerGroup.headers[t.index-1];return n.getStart()+n.getSize()}return 0},t.getResizeHandler=n=>{const r=e.getColumn(t.column.id),s=r==null?void 0:r.getCanResize();return i=>{if(!r||!s||(i.persist==null||i.persist(),qk(i)&&i.touches&&i.touches.length>1))return;const o=t.getSize(),a=t?t.getLeafHeaders().map(g=>[g.column.id,g.column.getSize()]):[[r.id,r.getSize()]],c=qk(i)?Math.round(i.touches[0].clientX):i.clientX,u={},f=(g,v)=>{typeof v=="number"&&(e.setColumnSizingInfo(x=>{var _,A;const N=e.options.columnResizeDirection==="rtl"?-1:1,T=(v-((_=x==null?void 0:x.startOffset)!=null?_:0))*N,E=Math.max(T/((A=x==null?void 0:x.startSize)!=null?A:0),-.999999);return x.columnSizingStart.forEach(P=>{let[k,M]=P;u[k]=Math.round(Math.max(M+M*E,0)*100)/100}),{...x,deltaOffset:T,deltaPercentage:E}}),(e.options.columnResizeMode==="onChange"||g==="end")&&e.setColumnSizing(x=>({...x,...u})))},l=g=>f("move",g),d=g=>{f("end",g),e.setColumnSizingInfo(v=>({...v,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=n||typeof document<"u"?document:null,h={moveHandler:g=>l(g.clientX),upHandler:g=>{p==null||p.removeEventListener("mousemove",h.moveHandler),p==null||p.removeEventListener("mouseup",h.upHandler),d(g.clientX)}},m={moveHandler:g=>(g.cancelable&&(g.preventDefault(),g.stopPropagation()),l(g.touches[0].clientX),!1),upHandler:g=>{var v;p==null||p.removeEventListener("touchmove",m.moveHandler),p==null||p.removeEventListener("touchend",m.upHandler),g.cancelable&&(g.preventDefault(),g.stopPropagation()),d((v=g.touches[0])==null?void 0:v.clientX)}},y=mIe()?{passive:!1}:!1;qk(i)?(p==null||p.addEventListener("touchmove",m.moveHandler,y),p==null||p.addEventListener("touchend",m.upHandler,y)):(p==null||p.addEventListener("mousemove",h.moveHandler,y),p==null||p.addEventListener("mouseup",h.upHandler,y)),e.setColumnSizingInfo(g=>({...g,startOffset:c,startSize:o,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:t=>{t.setColumnSizing=e=>t.options.onColumnSizingChange==null?void 0:t.options.onColumnSizingChange(e),t.setColumnSizingInfo=e=>t.options.onColumnSizingInfoChange==null?void 0:t.options.onColumnSizingInfoChange(e),t.resetColumnSizing=e=>{var n;t.setColumnSizing(e?{}:(n=t.initialState.columnSizing)!=null?n:{})},t.resetHeaderSizeInfo=e=>{var n;t.setColumnSizingInfo(e?Vk():(n=t.initialState.columnSizingInfo)!=null?n:Vk())},t.getTotalSize=()=>{var e,n;return(e=(n=t.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?e:0},t.getLeftTotalSize=()=>{var e,n;return(e=(n=t.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?e:0},t.getCenterTotalSize=()=>{var e,n;return(e=(n=t.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?e:0},t.getRightTotalSize=()=>{var e,n;return(e=(n=t.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?e:0}}};let M1=null;function mIe(){if(typeof M1=="boolean")return M1;let t=!1;try{const e={get passive(){return t=!0,!1}},n=()=>{};window.addEventListener("test",n,e),window.removeEventListener("test",n)}catch{t=!1}return M1=t,M1}function qk(t){return t.type==="touchstart"}const gIe={getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:Ao("columnVisibility",t)}),createColumn:(t,e)=>{t.toggleVisibility=n=>{t.getCanHide()&&e.setColumnVisibility(r=>({...r,[t.id]:n??!t.getIsVisible()}))},t.getIsVisible=()=>{var n,r;const s=t.columns;return(n=s.length?s.some(i=>i.getIsVisible()):(r=e.getState().columnVisibility)==null?void 0:r[t.id])!=null?n:!0},t.getCanHide=()=>{var n,r;return((n=t.columnDef.enableHiding)!=null?n:!0)&&((r=e.options.enableHiding)!=null?r:!0)},t.getToggleVisibilityHandler=()=>n=>{t.toggleVisibility==null||t.toggleVisibility(n.target.checked)}},createRow:(t,e)=>{t._getAllVisibleCells=lt(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),ct(e.options,"debugRows")),t.getVisibleCells=lt(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,r,s)=>[...n,...r,...s],ct(e.options,"debugRows"))},createTable:t=>{const e=(n,r)=>lt(()=>[r(),r().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),ct(t.options,"debugColumns"));t.getVisibleFlatColumns=e("getVisibleFlatColumns",()=>t.getAllFlatColumns()),t.getVisibleLeafColumns=e("getVisibleLeafColumns",()=>t.getAllLeafColumns()),t.getLeftVisibleLeafColumns=e("getLeftVisibleLeafColumns",()=>t.getLeftLeafColumns()),t.getRightVisibleLeafColumns=e("getRightVisibleLeafColumns",()=>t.getRightLeafColumns()),t.getCenterVisibleLeafColumns=e("getCenterVisibleLeafColumns",()=>t.getCenterLeafColumns()),t.setColumnVisibility=n=>t.options.onColumnVisibilityChange==null?void 0:t.options.onColumnVisibilityChange(n),t.resetColumnVisibility=n=>{var r;t.setColumnVisibility(n?{}:(r=t.initialState.columnVisibility)!=null?r:{})},t.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!t.getIsAllColumnsVisible(),t.setColumnVisibility(t.getAllLeafColumns().reduce((s,i)=>({...s,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},t.getIsAllColumnsVisible=()=>!t.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),t.getIsSomeColumnsVisible=()=>t.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),t.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;t.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function R0(t,e){return e?e==="center"?t.getCenterVisibleLeafColumns():e==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns()}const vIe={createTable:t=>{t._getGlobalFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,"__global__"),t.getGlobalFacetedRowModel=()=>t.options.manualFiltering||!t._getGlobalFacetedRowModel?t.getPreFilteredRowModel():t._getGlobalFacetedRowModel(),t._getGlobalFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,"__global__"),t.getGlobalFacetedUniqueValues=()=>t._getGlobalFacetedUniqueValues?t._getGlobalFacetedUniqueValues():new Map,t._getGlobalFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,"__global__"),t.getGlobalFacetedMinMaxValues=()=>{if(t._getGlobalFacetedMinMaxValues)return t._getGlobalFacetedMinMaxValues()}}},yIe={getInitialState:t=>({globalFilter:void 0,...t}),getDefaultOptions:t=>({onGlobalFilterChange:Ao("globalFilter",t),globalFilterFn:"auto",getColumnCanGlobalFilter:e=>{var n;const r=(n=t.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[e.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(t,e)=>{t.getCanGlobalFilter=()=>{var n,r,s,i;return((n=t.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=e.options.enableGlobalFilter)!=null?r:!0)&&((s=e.options.enableFilters)!=null?s:!0)&&((i=e.options.getColumnCanGlobalFilter==null?void 0:e.options.getColumnCanGlobalFilter(t))!=null?i:!0)&&!!t.accessorFn}},createTable:t=>{t.getGlobalAutoFilterFn=()=>_c.includesString,t.getGlobalFilterFn=()=>{var e,n;const{globalFilterFn:r}=t.options;return wN(r)?r:r==="auto"?t.getGlobalAutoFilterFn():(e=(n=t.options.filterFns)==null?void 0:n[r])!=null?e:_c[r]},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)}}},bIe={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:Ao("expanded",t),paginateExpandedRows:!0}),createTable:t=>{let e=!1,n=!1;t._autoResetExpanded=()=>{var r,s;if(!e){t._queue(()=>{e=!0});return}if((r=(s=t.options.autoResetAll)!=null?s:t.options.autoResetExpanded)!=null?r:!t.options.manualExpanding){if(n)return;n=!0,t._queue(()=>{t.resetExpanded(),n=!1})}},t.setExpanded=r=>t.options.onExpandedChange==null?void 0:t.options.onExpandedChange(r),t.toggleAllRowsExpanded=r=>{r??!t.getIsAllRowsExpanded()?t.setExpanded(!0):t.setExpanded({})},t.resetExpanded=r=>{var s,i;t.setExpanded(r?{}:(s=(i=t.initialState)==null?void 0:i.expanded)!=null?s:{})},t.getCanSomeRowsExpand=()=>t.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),t.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),t.toggleAllRowsExpanded()},t.getIsSomeRowsExpanded=()=>{const r=t.getState().expanded;return r===!0||Object.values(r).some(Boolean)},t.getIsAllRowsExpanded=()=>{const r=t.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||t.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},t.getExpandedDepth=()=>{let r=0;return(t.getState().expanded===!0?Object.keys(t.getRowModel().rowsById):Object.keys(t.getState().expanded)).forEach(i=>{const o=i.split(".");r=Math.max(r,o.length)}),r},t.getPreExpandedRowModel=()=>t.getSortedRowModel(),t.getExpandedRowModel=()=>(!t._getExpandedRowModel&&t.options.getExpandedRowModel&&(t._getExpandedRowModel=t.options.getExpandedRowModel(t)),t.options.manualExpanding||!t._getExpandedRowModel?t.getPreExpandedRowModel():t._getExpandedRowModel())},createRow:(t,e)=>{t.toggleExpanded=n=>{e.setExpanded(r=>{var s;const i=r===!0?!0:!!(r!=null&&r[t.id]);let o={};if(r===!0?Object.keys(e.getRowModel().rowsById).forEach(a=>{o[a]=!0}):o=r,n=(s=n)!=null?s:!i,!i&&n)return{...o,[t.id]:!0};if(i&&!n){const{[t.id]:a,...c}=o;return c}return r})},t.getIsExpanded=()=>{var n;const r=e.getState().expanded;return!!((n=e.options.getIsRowExpanded==null?void 0:e.options.getIsRowExpanded(t))!=null?n:r===!0||r!=null&&r[t.id])},t.getCanExpand=()=>{var n,r,s;return(n=e.options.getRowCanExpand==null?void 0:e.options.getRowCanExpand(t))!=null?n:((r=e.options.enableExpanding)!=null?r:!0)&&!!((s=t.subRows)!=null&&s.length)},t.getIsAllParentsExpanded=()=>{let n=!0,r=t;for(;n&&r.parentId;)r=e.getRow(r.parentId,!0),n=r.getIsExpanded();return n},t.getToggleExpandedHandler=()=>{const n=t.getCanExpand();return()=>{n&&t.toggleExpanded()}}}},CO=0,EO=10,Wk=()=>({pageIndex:CO,pageSize:EO}),xIe={getInitialState:t=>({...t,pagination:{...Wk(),...t==null?void 0:t.pagination}}),getDefaultOptions:t=>({onPaginationChange:Ao("pagination",t)}),createTable:t=>{let e=!1,n=!1;t._autoResetPageIndex=()=>{var r,s;if(!e){t._queue(()=>{e=!0});return}if((r=(s=t.options.autoResetAll)!=null?s:t.options.autoResetPageIndex)!=null?r:!t.options.manualPagination){if(n)return;n=!0,t._queue(()=>{t.resetPageIndex(),n=!1})}},t.setPagination=r=>{const s=i=>Bd(r,i);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(s)},t.resetPagination=r=>{var s;t.setPagination(r?Wk():(s=t.initialState.pagination)!=null?s:Wk())},t.setPageIndex=r=>{t.setPagination(s=>{let i=Bd(r,s.pageIndex);const o=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return i=Math.max(0,Math.min(i,o)),{...s,pageIndex:i}})},t.resetPageIndex=r=>{var s,i;t.setPageIndex(r?CO:(s=(i=t.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?s:CO)},t.resetPageSize=r=>{var s,i;t.setPageSize(r?EO:(s=(i=t.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?s:EO)},t.setPageSize=r=>{t.setPagination(s=>{const i=Math.max(1,Bd(r,s.pageSize)),o=s.pageSize*s.pageIndex,a=Math.floor(o/i);return{...s,pageIndex:a,pageSize:i}})},t.setPageCount=r=>t.setPagination(s=>{var i;let o=Bd(r,(i=t.options.pageCount)!=null?i:-1);return typeof o=="number"&&(o=Math.max(-1,o)),{...s,pageCount:o}}),t.getPageOptions=lt(()=>[t.getPageCount()],r=>{let s=[];return r&&r>0&&(s=[...new Array(r)].fill(null).map((i,o)=>o)),s},ct(t.options,"debugTable")),t.getCanPreviousPage=()=>t.getState().pagination.pageIndex>0,t.getCanNextPage=()=>{const{pageIndex:r}=t.getState().pagination,s=t.getPageCount();return s===-1?!0:s===0?!1:r<s-1},t.previousPage=()=>t.setPageIndex(r=>r-1),t.nextPage=()=>t.setPageIndex(r=>r+1),t.firstPage=()=>t.setPageIndex(0),t.lastPage=()=>t.setPageIndex(t.getPageCount()-1),t.getPrePaginationRowModel=()=>t.getExpandedRowModel(),t.getPaginationRowModel=()=>(!t._getPaginationRowModel&&t.options.getPaginationRowModel&&(t._getPaginationRowModel=t.options.getPaginationRowModel(t)),t.options.manualPagination||!t._getPaginationRowModel?t.getPrePaginationRowModel():t._getPaginationRowModel()),t.getPageCount=()=>{var r;return(r=t.options.pageCount)!=null?r:Math.ceil(t.getRowCount()/t.getState().pagination.pageSize)},t.getRowCount=()=>{var r;return(r=t.options.rowCount)!=null?r:t.getPrePaginationRowModel().rows.length}}},Gk=()=>({top:[],bottom:[]}),wIe={getInitialState:t=>({rowPinning:Gk(),...t}),getDefaultOptions:t=>({onRowPinningChange:Ao("rowPinning",t)}),createRow:(t,e)=>{t.pin=(n,r,s)=>{const i=r?t.getLeafRows().map(c=>{let{id:u}=c;return u}):[],o=s?t.getParentRows().map(c=>{let{id:u}=c;return u}):[],a=new Set([...o,t.id,...i]);e.setRowPinning(c=>{var u,f;if(n==="bottom"){var l,d;return{top:((l=c==null?void 0:c.top)!=null?l:[]).filter(m=>!(a!=null&&a.has(m))),bottom:[...((d=c==null?void 0:c.bottom)!=null?d:[]).filter(m=>!(a!=null&&a.has(m))),...Array.from(a)]}}if(n==="top"){var p,h;return{top:[...((p=c==null?void 0:c.top)!=null?p:[]).filter(m=>!(a!=null&&a.has(m))),...Array.from(a)],bottom:((h=c==null?void 0:c.bottom)!=null?h:[]).filter(m=>!(a!=null&&a.has(m)))}}return{top:((u=c==null?void 0:c.top)!=null?u:[]).filter(m=>!(a!=null&&a.has(m))),bottom:((f=c==null?void 0:c.bottom)!=null?f:[]).filter(m=>!(a!=null&&a.has(m)))}})},t.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:s}=e.options;return typeof r=="function"?r(t):(n=r??s)!=null?n:!0},t.getIsPinned=()=>{const n=[t.id],{top:r,bottom:s}=e.getState().rowPinning,i=n.some(a=>r==null?void 0:r.includes(a)),o=n.some(a=>s==null?void 0:s.includes(a));return i?"top":o?"bottom":!1},t.getPinnedIndex=()=>{var n,r;const s=t.getIsPinned();if(!s)return-1;const i=(n=s==="top"?e.getTopRows():e.getBottomRows())==null?void 0:n.map(o=>{let{id:a}=o;return a});return(r=i==null?void 0:i.indexOf(t.id))!=null?r:-1}},createTable:t=>{t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var n,r;return t.setRowPinning(e?Gk():(n=(r=t.initialState)==null?void 0:r.rowPinning)!=null?n:Gk())},t.getIsSomeRowsPinned=e=>{var n;const r=t.getState().rowPinning;if(!e){var s,i;return!!((s=r.top)!=null&&s.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[e])!=null&&n.length)},t._getPinnedRows=(e,n,r)=>{var s;return((s=t.options.keepPinnedRows)==null||s?(n??[]).map(o=>{const a=t.getRow(o,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(o=>e.find(a=>a.id===o))).filter(Boolean).map(o=>({...o,position:r}))},t.getTopRows=lt(()=>[t.getRowModel().rows,t.getState().rowPinning.top],(e,n)=>t._getPinnedRows(e,n,"top"),ct(t.options,"debugRows")),t.getBottomRows=lt(()=>[t.getRowModel().rows,t.getState().rowPinning.bottom],(e,n)=>t._getPinnedRows(e,n,"bottom"),ct(t.options,"debugRows")),t.getCenterRows=lt(()=>[t.getRowModel().rows,t.getState().rowPinning.top,t.getState().rowPinning.bottom],(e,n,r)=>{const s=new Set([...n??[],...r??[]]);return e.filter(i=>!s.has(i.id))},ct(t.options,"debugRows"))}},_Ie={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:Ao("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:t=>{t.setRowSelection=e=>t.options.onRowSelectionChange==null?void 0:t.options.onRowSelectionChange(e),t.resetRowSelection=e=>{var n;return t.setRowSelection(e?{}:(n=t.initialState.rowSelection)!=null?n:{})},t.toggleAllRowsSelected=e=>{t.setRowSelection(n=>{e=typeof e<"u"?e:!t.getIsAllRowsSelected();const r={...n},s=t.getPreGroupedRowModel().flatRows;return e?s.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):s.forEach(i=>{delete r[i.id]}),r})},t.toggleAllPageRowsSelected=e=>t.setRowSelection(n=>{const r=typeof e<"u"?e:!t.getIsAllPageRowsSelected(),s={...n};return t.getRowModel().rows.forEach(i=>{AO(s,i.id,r,!0,t)}),s}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=lt(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?Kk(t,n):{rows:[],flatRows:[],rowsById:{}},ct(t.options,"debugTable")),t.getFilteredSelectedRowModel=lt(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?Kk(t,n):{rows:[],flatRows:[],rowsById:{}},ct(t.options,"debugTable")),t.getGroupedSelectedRowModel=lt(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?Kk(t,n):{rows:[],flatRows:[],rowsById:{}},ct(t.options,"debugTable")),t.getIsAllRowsSelected=()=>{const e=t.getFilteredRowModel().flatRows,{rowSelection:n}=t.getState();let r=!!(e.length&&Object.keys(n).length);return r&&e.some(s=>s.getCanSelect()&&!n[s.id])&&(r=!1),r},t.getIsAllPageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:n}=t.getState();let r=!!e.length;return r&&e.some(s=>!n[s.id])&&(r=!1),r},t.getIsSomeRowsSelected=()=>{var e;const n=Object.keys((e=t.getState().rowSelection)!=null?e:{}).length;return n>0&&n<t.getFilteredRowModel().flatRows.length},t.getIsSomePageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows;return t.getIsAllPageRowsSelected()?!1:e.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},t.getToggleAllRowsSelectedHandler=()=>e=>{t.toggleAllRowsSelected(e.target.checked)},t.getToggleAllPageRowsSelectedHandler=()=>e=>{t.toggleAllPageRowsSelected(e.target.checked)}},createRow:(t,e)=>{t.toggleSelected=(n,r)=>{const s=t.getIsSelected();e.setRowSelection(i=>{var o;if(n=typeof n<"u"?n:!s,t.getCanSelect()&&s===n)return i;const a={...i};return AO(a,t.id,n,(o=r==null?void 0:r.selectChildren)!=null?o:!0,e),a})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return O$(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return RO(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return RO(t,n)==="all"},t.getCanSelect=()=>{var n;return typeof e.options.enableRowSelection=="function"?e.options.enableRowSelection(t):(n=e.options.enableRowSelection)!=null?n:!0},t.getCanSelectSubRows=()=>{var n;return typeof e.options.enableSubRowSelection=="function"?e.options.enableSubRowSelection(t):(n=e.options.enableSubRowSelection)!=null?n:!0},t.getCanMultiSelect=()=>{var n;return typeof e.options.enableMultiRowSelection=="function"?e.options.enableMultiRowSelection(t):(n=e.options.enableMultiRowSelection)!=null?n:!0},t.getToggleSelectedHandler=()=>{const n=t.getCanSelect();return r=>{var s;n&&t.toggleSelected((s=r.target)==null?void 0:s.checked)}}}},AO=(t,e,n,r,s)=>{var i;const o=s.getRow(e,!0);n?(o.getCanMultiSelect()||Object.keys(t).forEach(a=>delete t[a]),o.getCanSelect()&&(t[e]=!0)):delete t[e],r&&(i=o.subRows)!=null&&i.length&&o.getCanSelectSubRows()&&o.subRows.forEach(a=>AO(t,a.id,n,r,s))};function Kk(t,e){const n=t.getState().rowSelection,r=[],s={},i=function(o,a){return o.map(c=>{var u;const f=O$(c,n);if(f&&(r.push(c),s[c.id]=c),(u=c.subRows)!=null&&u.length&&(c={...c,subRows:i(c.subRows)}),f)return c}).filter(Boolean)};return{rows:i(e.rows),flatRows:r,rowsById:s}}function O$(t,e){var n;return(n=e[t.id])!=null?n:!1}function RO(t,e,n){var r;if(!((r=t.subRows)!=null&&r.length))return!1;let s=!0,i=!1;return t.subRows.forEach(o=>{if(!(i&&!s)&&(o.getCanSelect()&&(O$(o,e)?i=!0:s=!1),o.subRows&&o.subRows.length)){const a=RO(o,e);a==="all"?i=!0:(a==="some"&&(i=!0),s=!1)}}),s?"all":i?"some":!1}const NO=/([0-9]+)/gm,SIe=(t,e,n)=>EJ(lf(t.getValue(n)).toLowerCase(),lf(e.getValue(n)).toLowerCase()),CIe=(t,e,n)=>EJ(lf(t.getValue(n)),lf(e.getValue(n))),EIe=(t,e,n)=>I$(lf(t.getValue(n)).toLowerCase(),lf(e.getValue(n)).toLowerCase()),AIe=(t,e,n)=>I$(lf(t.getValue(n)),lf(e.getValue(n))),RIe=(t,e,n)=>{const r=t.getValue(n),s=e.getValue(n);return r>s?1:r<s?-1:0},NIe=(t,e,n)=>I$(t.getValue(n),e.getValue(n));function I$(t,e){return t===e?0:t>e?1:-1}function lf(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function EJ(t,e){const n=t.split(NO).filter(Boolean),r=e.split(NO).filter(Boolean);for(;n.length&&r.length;){const s=n.shift(),i=r.shift(),o=parseInt(s,10),a=parseInt(i,10),c=[o,a].sort();if(isNaN(c[0])){if(s>i)return 1;if(i>s)return-1;continue}if(isNaN(c[1]))return isNaN(o)?-1:1;if(o>a)return 1;if(a>o)return-1}return n.length-r.length}const Pb={alphanumeric:SIe,alphanumericCaseSensitive:CIe,text:EIe,textCaseSensitive:AIe,datetime:RIe,basic:NIe},PIe={getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:Ao("sorting",t),isMultiSortEvent:e=>e.shiftKey}),createColumn:(t,e)=>{t.getAutoSortingFn=()=>{const n=e.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const s of n){const i=s==null?void 0:s.getValue(t.id);if(Object.prototype.toString.call(i)==="[object Date]")return Pb.datetime;if(typeof i=="string"&&(r=!0,i.split(NO).length>1))return Pb.alphanumeric}return r?Pb.text:Pb.basic},t.getAutoSortDir=()=>{const n=e.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(t.id))=="string"?"asc":"desc"},t.getSortingFn=()=>{var n,r;if(!t)throw new Error;return wN(t.columnDef.sortingFn)?t.columnDef.sortingFn:t.columnDef.sortingFn==="auto"?t.getAutoSortingFn():(n=(r=e.options.sortingFns)==null?void 0:r[t.columnDef.sortingFn])!=null?n:Pb[t.columnDef.sortingFn]},t.toggleSorting=(n,r)=>{const s=t.getNextSortingOrder(),i=typeof n<"u"&&n!==null;e.setSorting(o=>{const a=o==null?void 0:o.find(p=>p.id===t.id),c=o==null?void 0:o.findIndex(p=>p.id===t.id);let u=[],f,l=i?n:s==="desc";if(o!=null&&o.length&&t.getCanMultiSort()&&r?a?f="toggle":f="add":o!=null&&o.length&&c!==o.length-1?f="replace":a?f="toggle":f="replace",f==="toggle"&&(i||s||(f="remove")),f==="add"){var d;u=[...o,{id:t.id,desc:l}],u.splice(0,u.length-((d=e.options.maxMultiSortColCount)!=null?d:Number.MAX_SAFE_INTEGER))}else f==="toggle"?u=o.map(p=>p.id===t.id?{...p,desc:l}:p):f==="remove"?u=o.filter(p=>p.id!==t.id):u=[{id:t.id,desc:l}];return u})},t.getFirstSortDir=()=>{var n,r;return((n=(r=t.columnDef.sortDescFirst)!=null?r:e.options.sortDescFirst)!=null?n:t.getAutoSortDir()==="desc")?"desc":"asc"},t.getNextSortingOrder=n=>{var r,s;const i=t.getFirstSortDir(),o=t.getIsSorted();return o?o!==i&&((r=e.options.enableSortingRemoval)==null||r)&&(!(n&&(s=e.options.enableMultiRemove)!=null)||s)?!1:o==="desc"?"asc":"desc":i},t.getCanSort=()=>{var n,r;return((n=t.columnDef.enableSorting)!=null?n:!0)&&((r=e.options.enableSorting)!=null?r:!0)&&!!t.accessorFn},t.getCanMultiSort=()=>{var n,r;return(n=(r=t.columnDef.enableMultiSort)!=null?r:e.options.enableMultiSort)!=null?n:!!t.accessorFn},t.getIsSorted=()=>{var n;const r=(n=e.getState().sorting)==null?void 0:n.find(s=>s.id===t.id);return r?r.desc?"desc":"asc":!1},t.getSortIndex=()=>{var n,r;return(n=(r=e.getState().sorting)==null?void 0:r.findIndex(s=>s.id===t.id))!=null?n:-1},t.clearSorting=()=>{e.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==t.id):[])},t.getToggleSortingHandler=()=>{const n=t.getCanSort();return r=>{n&&(r.persist==null||r.persist(),t.toggleSorting==null||t.toggleSorting(void 0,t.getCanMultiSort()?e.options.isMultiSortEvent==null?void 0:e.options.isMultiSortEvent(r):!1))}}},createTable:t=>{t.setSorting=e=>t.options.onSortingChange==null?void 0:t.options.onSortingChange(e),t.resetSorting=e=>{var n,r;t.setSorting(e?[]:(n=(r=t.initialState)==null?void 0:r.sorting)!=null?n:[])},t.getPreSortedRowModel=()=>t.getGroupedRowModel(),t.getSortedRowModel=()=>(!t._getSortedRowModel&&t.options.getSortedRowModel&&(t._getSortedRowModel=t.options.getSortedRowModel(t)),t.options.manualSorting||!t._getSortedRowModel?t.getPreSortedRowModel():t._getSortedRowModel())}},TIe=[ZOe,gIe,fIe,hIe,JOe,eIe,vIe,yIe,PIe,uIe,bIe,xIe,wIe,_Ie,pIe];function kIe(t){var e,n;const r=[...TIe,...(e=t._features)!=null?e:[]];let s={_features:r};const i=s._features.reduce((d,p)=>Object.assign(d,p.getDefaultOptions==null?void 0:p.getDefaultOptions(s)),{}),o=d=>s.options.mergeOptions?s.options.mergeOptions(i,d):{...i,...d};let c={...{},...(n=t.initialState)!=null?n:{}};s._features.forEach(d=>{var p;c=(p=d.getInitialState==null?void 0:d.getInitialState(c))!=null?p:c});const u=[];let f=!1;const l={_features:r,options:{...i,...t},initialState:c,_queue:d=>{u.push(d),f||(f=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();f=!1}).catch(p=>setTimeout(()=>{throw p})))},reset:()=>{s.setState(s.initialState)},setOptions:d=>{const p=Bd(d,s.options);s.options=o(p)},getState:()=>s.options.state,setState:d=>{s.options.onStateChange==null||s.options.onStateChange(d)},_getRowId:(d,p,h)=>{var m;return(m=s.options.getRowId==null?void 0:s.options.getRowId(d,p,h))!=null?m:`${h?[h.id,p].join("."):p}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(d,p)=>{let h=(p?s.getPrePaginationRowModel():s.getRowModel()).rowsById[d];if(!h&&(h=s.getCoreRowModel().rowsById[d],!h))throw new Error;return h},_getDefaultColumnDef:lt(()=>[s.options.defaultColumn],d=>{var p;return d=(p=d)!=null?p:{},{header:h=>{const m=h.header.column.columnDef;return m.accessorKey?m.accessorKey:m.accessorFn?m.id:null},cell:h=>{var m,y;return(m=(y=h.renderValue())==null||y.toString==null?void 0:y.toString())!=null?m:null},...s._features.reduce((h,m)=>Object.assign(h,m.getDefaultColumnDef==null?void 0:m.getDefaultColumnDef()),{}),...d}},ct(t,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:lt(()=>[s._getColumnDefs()],d=>{const p=function(h,m,y){return y===void 0&&(y=0),h.map(g=>{const v=QOe(s,g,y,m),x=g;return v.columns=x.columns?p(x.columns,v,y+1):[],v})};return p(d)},ct(t,"debugColumns")),getAllFlatColumns:lt(()=>[s.getAllColumns()],d=>d.flatMap(p=>p.getFlatColumns()),ct(t,"debugColumns")),_getAllFlatColumnsById:lt(()=>[s.getAllFlatColumns()],d=>d.reduce((p,h)=>(p[h.id]=h,p),{}),ct(t,"debugColumns")),getAllLeafColumns:lt(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(d,p)=>{let h=d.flatMap(m=>m.getLeafColumns());return p(h)},ct(t,"debugColumns")),getColumn:d=>s._getAllFlatColumnsById()[d]};Object.assign(s,l);for(let d=0;d<s._features.length;d++){const p=s._features[d];p==null||p.createTable==null||p.createTable(s)}return s}function AJ(){return t=>lt(()=>[t.options.data],e=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(s,i,o){i===void 0&&(i=0);const a=[];for(let u=0;u<s.length;u++){const f=D$(t,t._getRowId(s[u],u,o),s[u],u,i,void 0,o==null?void 0:o.id);if(n.flatRows.push(f),n.rowsById[f.id]=f,a.push(f),t.options.getSubRows){var c;f.originalSubRows=t.options.getSubRows(s[u],u),(c=f.originalSubRows)!=null&&c.length&&(f.subRows=r(f.originalSubRows,i+1,f))}}return a};return n.rows=r(e),n},ct(t.options,"debugTable","getRowModel",()=>t._autoResetPageIndex()))}function RJ(t,e,n){return n.options.filterFromLeafRows?DIe(t,e,n):MIe(t,e,n)}function DIe(t,e,n){var r;const s=[],i={},o=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(c,u){u===void 0&&(u=0);const f=[];for(let d=0;d<c.length;d++){var l;let p=c[d];const h=D$(n,p.id,p.original,p.index,p.depth,void 0,p.parentId);if(h.columnFilters=p.columnFilters,(l=p.subRows)!=null&&l.length&&u<o){if(h.subRows=a(p.subRows,u+1),p=h,e(p)&&!h.subRows.length){f.push(p),i[p.id]=p,s.push(p);continue}if(e(p)||h.subRows.length){f.push(p),i[p.id]=p,s.push(p);continue}}else p=h,e(p)&&(f.push(p),i[p.id]=p,s.push(p))}return f};return{rows:a(t),flatRows:s,rowsById:i}}function MIe(t,e,n){var r;const s=[],i={},o=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(c,u){u===void 0&&(u=0);const f=[];for(let d=0;d<c.length;d++){let p=c[d];if(e(p)){var l;if((l=p.subRows)!=null&&l.length&&u<o){const m=D$(n,p.id,p.original,p.index,p.depth,void 0,p.parentId);m.subRows=a(p.subRows,u+1),p=m}f.push(p),s.push(p),i[p.id]=p}}return f};return{rows:a(t),flatRows:s,rowsById:i}}function OIe(){return(t,e)=>lt(()=>[t.getPreFilteredRowModel(),t.getState().columnFilters,t.getState().globalFilter,t.getFilteredRowModel()],(n,r,s)=>{if(!n.rows.length||!(r!=null&&r.length)&&!s)return n;const i=[...r.map(a=>a.id).filter(a=>a!==e),s?"__global__":void 0].filter(Boolean),o=a=>{for(let c=0;c<i.length;c++)if(a.columnFilters[i[c]]===!1)return!1;return!0};return RJ(n.rows,o,t)},ct(t.options,"debugTable"))}function IIe(){return(t,e)=>lt(()=>{var n;return[(n=t.getColumn(e))==null?void 0:n.getFacetedRowModel()]},n=>{if(!n)return new Map;let r=new Map;for(let i=0;i<n.flatRows.length;i++){const o=n.flatRows[i].getUniqueValues(e);for(let a=0;a<o.length;a++){const c=o[a];if(r.has(c)){var s;r.set(c,((s=r.get(c))!=null?s:0)+1)}else r.set(c,1)}}return r},ct(t.options,"debugTable"))}function jIe(){return t=>lt(()=>[t.getPreFilteredRowModel(),t.getState().columnFilters,t.getState().globalFilter],(e,n,r)=>{if(!e.rows.length||!(n!=null&&n.length)&&!r){for(let d=0;d<e.flatRows.length;d++)e.flatRows[d].columnFilters={},e.flatRows[d].columnFiltersMeta={};return e}const s=[],i=[];(n??[]).forEach(d=>{var p;const h=t.getColumn(d.id);if(!h)return;const m=h.getFilterFn();m&&s.push({id:d.id,filterFn:m,resolvedValue:(p=m.resolveFilterValue==null?void 0:m.resolveFilterValue(d.value))!=null?p:d.value})});const o=(n??[]).map(d=>d.id),a=t.getGlobalFilterFn(),c=t.getAllLeafColumns().filter(d=>d.getCanGlobalFilter());r&&a&&c.length&&(o.push("__global__"),c.forEach(d=>{var p;i.push({id:d.id,filterFn:a,resolvedValue:(p=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?p:r})}));let u,f;for(let d=0;d<e.flatRows.length;d++){const p=e.flatRows[d];if(p.columnFilters={},s.length)for(let h=0;h<s.length;h++){u=s[h];const m=u.id;p.columnFilters[m]=u.filterFn(p,m,u.resolvedValue,y=>{p.columnFiltersMeta[m]=y})}if(i.length){for(let h=0;h<i.length;h++){f=i[h];const m=f.id;if(f.filterFn(p,m,f.resolvedValue,y=>{p.columnFiltersMeta[m]=y})){p.columnFilters.__global__=!0;break}}p.columnFilters.__global__!==!0&&(p.columnFilters.__global__=!1)}}const l=d=>{for(let p=0;p<o.length;p++)if(d.columnFilters[o[p]]===!1)return!1;return!0};return RJ(e.rows,l,t)},ct(t.options,"debugTable","getFilteredRowModel",()=>t._autoResetPageIndex()))}function LIe(){return t=>lt(()=>[t.getState().sorting,t.getPreSortedRowModel()],(e,n)=>{if(!n.rows.length||!(e!=null&&e.length))return n;const r=t.getState().sorting,s=[],i=r.filter(c=>{var u;return(u=t.getColumn(c.id))==null?void 0:u.getCanSort()}),o={};i.forEach(c=>{const u=t.getColumn(c.id);u&&(o[c.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const a=c=>{const u=c.map(f=>({...f}));return u.sort((f,l)=>{for(let p=0;p<i.length;p+=1){var d;const h=i[p],m=o[h.id],y=m.sortUndefined,g=(d=h==null?void 0:h.desc)!=null?d:!1;let v=0;if(y){const x=f.getValue(h.id),_=l.getValue(h.id),A=x===void 0,N=_===void 0;if(A||N){if(y==="first")return A?-1:1;if(y==="last")return A?1:-1;v=A&&N?0:A?y:-y}}if(v===0&&(v=m.sortingFn(f,l,h.id)),v!==0)return g&&(v*=-1),m.invertSorting&&(v*=-1),v}return f.index-l.index}),u.forEach(f=>{var l;s.push(f),(l=f.subRows)!=null&&l.length&&(f.subRows=a(f.subRows))}),u};return{rows:a(n.rows),flatRows:s,rowsById:n.rowsById}},ct(t.options,"debugTable","getSortedRowModel",()=>t._autoResetPageIndex()))}/**
|
||
* react-table
|
||
*
|
||
* Copyright (c) TanStack
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function KE(t,e){return t?$Ie(t)?S.createElement(t,e):t:null}function $Ie(t){return FIe(t)||typeof t=="function"||zIe(t)}function FIe(t){return typeof t=="function"&&(()=>{const e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}function zIe(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}function NJ(t){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[n]=S.useState(()=>({current:kIe(e)})),[r,s]=S.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...t,state:{...r,...t.state},onStateChange:o=>{s(o),t.onStateChange==null||t.onStateChange(o)}})),n.current}const Pp=oe.forwardRef(({className:t,...e},n)=>b.jsx("div",{ref:n,className:ie("flex items-center gap-2",t),...e}));Pp.displayName="ButtonGroup";const PJ=({label:t="Cancelar",...e})=>b.jsx(qe,{type:"button",variant:"secondary",...e,children:t});PJ.displayName="CancelButton";const BIe=({buttonText:t,title:e="",content:n,className:r=""})=>b.jsx("div",{className:`flex items-baseline justify-center mr-4 font-medium ${r}`,children:b.jsxs(Ey,{children:[b.jsx(JL,{asChild:!0,children:b.jsxs(qe,{variant:"link",className:"inline-flex items-center font-medium group",children:[b.jsx("span",{className:"underline-offset-4 group-hover:underline",children:t}),b.jsx(hq,{className:"w-4 h-4 ml-1 text-muted-foreground"})]})}),b.jsxs(Bp,{className:"sm:max-w-[425px]",children:[b.jsx(Up,{children:b.jsx(Vp,{children:e})}),b.jsxs(QR,{className:"grid gap-4 py-2",children:[n,b.jsx(Hp,{children:b.jsx(xE,{asChild:!0,children:b.jsx(qe,{type:"button",children:te("common.close")})})})]})]})]})}),UIe=di("",{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"}}),TJ=oe.forwardRef(({className:t,label:e,size:n,icon:r,children:s,...i},o)=>{const a=!!r;return b.jsxs(qe,{ref:o,size:n,className:ie(a?"gap-1":"",t),...i,children:[a&&b.jsx(r,{className:ie(UIe({size:n}))}),b.jsx(b.Fragment,{children:e||s})]})});TJ.displayName="CustomButton";const _N=({label:t="Enviar",...e})=>b.jsx(TJ,{type:"submit",label:t,variant:"default",...e});_N.displayName="SubmitButton";function HIe(t){let r=0;for(let f=0;f<t.length;f++)r=t.charCodeAt(f)+((r<<5)-r);let s="#";for(let f=0;f<3;f++){const l=r>>f*8&255;s+=("00"+l.toString(16)).substr(-2)}const i=parseInt(s.substr(1,2),16),o=parseInt(s.substr(3,2),16),a=parseInt(s.substr(5,2),16),c=`#${(i*.7|0).toString(16).padStart(2,"0")}${(o*.7|0).toString(16).padStart(2,"0")}${(a*.7|0).toString(16).padStart(2,"0")}`,u=`#${Math.min(255,Math.floor(i+(255-i)*.7)).toString(16).padStart(2,"0")}${Math.min(255,Math.floor(o+(255-o)*.7)).toString(16).padStart(2,"0")}${Math.min(255,Math.floor(a+(255-a)*.7)).toString(16).padStart(2,"0")}`;return[c,u]}const kJ=({label:t,className:e})=>{const[n,r]=HIe(t);return b.jsx(gR,{className:e,style:e?{}:{backgroundColor:r,color:n},children:t})},VIe=di("p-6",{variants:{variant:{full:"w-full",boxed:"container max-w-3xl lg:max-w-5xl mx-auto"}},defaultVariants:{variant:"full"}}),DJ=({className:t,as:e="article",variant:n,...r})=>b.jsx(e,{className:ie(VIe({variant:n,className:t})),...r});DJ.displayName="Container";const j$=()=>{const t=Us();return b.jsxs(qe,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:()=>t(-1),children:[b.jsx(nR,{className:"w-4 h-4"}),b.jsx("span",{className:"sr-only",children:te("common.back")})]})};function MJ({table:t,header:e,className:n}){return e.column.getCanSort()?b.jsx("div",{className:ie("flex items-center space-x-2",n),children:b.jsxs(M_,{children:[b.jsx(O_,{asChild:!0,children:b.jsxs(qe,{"aria-label":e.column.getIsSorted()==="desc"?te("common.sort_desc_description"):e.column.getIsSorted()==="asc"?te("common.sort_asc_description"):te("sort_none_description"),size:"sm",variant:"ghost",className:"-ml-3 h-8 data-[state=open]:bg-accent font-bold text-muted-foreground",children:[KE(e.column.columnDef.header,e.getContext()),e.column.getIsSorted()==="desc"?b.jsx(rB,{className:"w-4 h-4 ml-2","aria-hidden":"true"}):e.column.getIsSorted()==="asc"?b.jsx(sB,{className:"w-4 h-4 ml-2","aria-hidden":"true"}):b.jsx(Tpe,{className:"w-4 h-4 ml-2 text-muted-foreground/30","aria-hidden":"true"})]})}),b.jsxs(Py,{align:"start",children:[e.column.getCanSort()&&b.jsxs(b.Fragment,{children:[b.jsxs(Xd,{onClick:()=>e.column.toggleSorting(!1),"aria-label":te("common.sort_asc"),children:[b.jsx(sB,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),te("common.sort_asc")]}),b.jsxs(Xd,{onClick:()=>e.column.toggleSorting(!0),"aria-label":te("common.sort_desc"),children:[b.jsx(rB,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),te("common.sort_desc")]})]}),e.column.getCanSort()&&e.column.getCanHide()&&b.jsx(Wv,{}),e.column.getCanHide()&&b.jsxs(Xd,{onClick:()=>e.column.toggleVisibility(!1),"aria-label":te("Hide"),children:[b.jsx(mq,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),te("Hide")]})]})]})}):b.jsxs(b.Fragment,{children:[b.jsx("div",{className:ie("data-[state=open]:bg-accent tracking-wide text-ellipsis",n),children:e.isPlaceholder?null:KE(e.column.columnDef.header,e.getContext())}),!1]})}function qIe({table:t,className:e,enablePageSizeSelector:n=!0,visible:r="auto"}){const s=S.useMemo(()=>r===!0,[r]),i=S.useMemo(()=>r==="auto",[r]);return!s||i&&t.getPageCount()<1?null:b.jsxs("div",{className:e,children:[b.jsx("div",{className:"flex-1 text-base text-muted-foreground",children:t.getSelectedRowModel().rows.length>0&&b.jsx(b.Fragment,{children:te("common.rows_selected_of_total",{count:t.getFilteredSelectedRowModel().rows.length,total:t.getFilteredRowModel().rows.length})})}),b.jsxs("div",{className:"flex justify-between space-x-6 lg:space-x-8",children:[n&&b.jsxs("div",{className:"flex items-center space-x-2 grow",children:[b.jsx("p",{className:"text-sm font-medium",children:te("common.rows_per_page")}),b.jsxs(d$,{value:`${t.getState().pagination.pageSize}`,onValueChange:o=>{t.setPageSize(Number(o))},children:[b.jsx(tN,{className:"h-8 w-[70px]",children:b.jsx(f$,{placeholder:t.getState().pagination.pageSize})}),b.jsx(nN,{side:"top",children:VOe.map(o=>b.jsx(bg,{value:`${o}`,children:o},o))})]})]}),b.jsxs("div",{className:ie("flex space-x-2 flex-1",n?"justify-end":"justify-between"),children:[b.jsx("div",{className:"flex w-[150px] items-center justify-start",children:b.jsx("p",{className:"text-sm font-medium ",children:te("common.num_page_of_total",{count:t.getState().pagination.pageIndex+1,total:t.getPageCount()})})}),b.jsxs("div",{className:"flex items-center space-x-2",children:[b.jsxs(qe,{type:"button",variant:"outline",className:"hidden w-8 h-8 p-0 lg:flex",onClick:()=>t.setPageIndex(wg),disabled:!t.getCanPreviousPage(),children:[b.jsx("span",{className:"sr-only",children:te("common.go_to_first_page")}),b.jsx(Dpe,{className:"w-4 h-4"})]}),b.jsxs(qe,{type:"button",variant:"outline",className:"w-8 h-8 p-0",onClick:()=>t.previousPage(),disabled:!t.getCanPreviousPage(),children:[b.jsx("span",{className:"sr-only",children:te("common.go_to_prev_page")}),b.jsx(nR,{className:"w-4 h-4"})]}),b.jsxs(qe,{type:"button",variant:"outline",className:"w-8 h-8 p-0",onClick:()=>t.nextPage(),disabled:!t.getCanNextPage(),children:[b.jsx("span",{className:"sr-only",children:te("common.go_to_next_page")}),b.jsx(fy,{className:"w-4 h-4"})]}),b.jsxs(qe,{type:"button",variant:"outline",className:"hidden w-8 h-8 p-0 lg:flex",onClick:()=>t.setPageIndex(t.getPageCount()+1),disabled:!t.getCanNextPage(),children:[b.jsx("span",{className:"sr-only",children:te("common.go_to_last_page")}),b.jsx(Mpe,{className:"w-4 h-4"})]})]})]})]})]})}function SN({table:t,title:e,description:n,caption:r,paginationOptions:s,headerOptions:i={visible:!0},children:o,className:a,contentClassName:c,footerClassName:u,rowClassName:f,cellClassName:l,onRowClick:d,activeRowIndex:p}){var m;const h=i==null?void 0:i.visible;return b.jsxs(xr,{className:a,children:[(e||n)&&b.jsxs(Ni,{className:"pb-0",children:[b.jsx(ns,{children:e}),b.jsx(ys,{children:n})]}),b.jsxs(wr,{className:ie("pt-6",c),children:[o&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"flex space-x-2",children:o}),b.jsx(iu,{className:"my-4"})]}),b.jsxs(sN,{children:[typeof r<"u"&&b.jsx(kQ,{children:r}),h&&t.getHeaderGroups().length&&b.jsx(iN,{children:t.getHeaderGroups().map(y=>b.jsx(Qd,{className:f,children:y.headers.map(g=>b.jsx(aN,{colSpan:g.colSpan,style:{width:g.getSize()===Number.MAX_SAFE_INTEGER?"auto":g.getSize()},children:b.jsx(MJ,{table:t,header:g})},g.id))},y.id))}),b.jsx(oN,{children:(m=t.getRowModel().rows)!=null&&m.length?t.getRowModel().rows.map(y=>b.jsx(Qd,{onClick:()=>{d&&d(y)},tabIndex:0,"data-state":y.getIsSelected()&&"selected",className:ie(y.getIsSelected()||p===y.index?"bg-accent cursor-pointer hover:bg-accent":"cursor-pointer",f),children:y.getVisibleCells().map(g=>b.jsx(hx,{className:l,style:{width:g.column.getSize()===Number.MAX_SAFE_INTEGER?"auto":g.column.getSize()},children:KE(g.column.columnDef.cell,g.getContext())},g.id))},y.id)):b.jsx(Qd,{className:f,children:b.jsx(hx,{className:ie("h-24 text-center",l),colSpan:t.getAllColumns.length,children:"No hay datos para mostrar"})})})]})]}),b.jsx(Yo,{className:u,children:b.jsx(qIe,{className:"flex-1",table:t,...s})})]})}function WIe({actions:t,rowContext:e}){return b.jsxs(M_,{children:[b.jsx(O_,{asChild:!0,children:b.jsxs(qe,{size:"icon",variant:"outline",className:"w-8 h-8",children:[b.jsx($pe,{className:"h-3.5 w-3.5"}),b.jsx("span",{className:"sr-only",children:te("common.open_menu")})]})}),b.jsxs(Py,{align:"end",children:[b.jsxs(UR,{children:[te("common.actions")," "]}),t&&t(e).map((n,r)=>n.label==="-"?b.jsx(Wv,{},r):b.jsxs(Xd,{onClick:s=>n.onClick?n.onClick(e,s):null,children:[n.icon&&b.jsx(b.Fragment,{children:n.icon}),n.label,n.shortcut&&b.jsx(jK,{children:n.shortcut})]},r))]})]})}function GIe(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return S.useMemo(()=>r=>{e.forEach(s=>s(r))},e)}const CN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ly(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function L$(t){return"nodeType"in t}function hi(t){var e,n;return t?Ly(t)?t:L$(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function $$(t){const{Document:e}=hi(t);return t instanceof e}function V_(t){return Ly(t)?!1:t instanceof hi(t).HTMLElement}function OJ(t){return t instanceof hi(t).SVGElement}function $y(t){return t?Ly(t)?t.document:L$(t)?$$(t)?t:V_(t)||OJ(t)?t.ownerDocument:document:document:document}const ca=CN?S.useLayoutEffect:S.useEffect;function EN(t){const e=S.useRef(t);return ca(()=>{e.current=t}),S.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 KIe(){const t=S.useRef(null),e=S.useCallback((r,s)=>{t.current=setInterval(r,s)},[]),n=S.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function xx(t,e){e===void 0&&(e=[t]);const n=S.useRef(t);return ca(()=>{n.current!==t&&(n.current=t)},e),n}function q_(t,e){const n=S.useRef();return S.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function YE(t){const e=EN(t),n=S.useRef(null),r=S.useCallback(s=>{s!==n.current&&(e==null||e(s,n.current)),n.current=s},[]);return[n,r]}function XE(t){const e=S.useRef();return S.useEffect(()=>{e.current=t},[t]),e.current}let Yk={};function W_(t,e){return S.useMemo(()=>{if(e)return e;const n=Yk[t]==null?0:Yk[t]+1;return Yk[t]=n,t+"-"+n},[t,e])}function IJ(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,o)=>{const a=Object.entries(o);for(const[c,u]of a){const f=i[c];f!=null&&(i[c]=f+t*u)}return i},{...e})}}const _g=IJ(1),QE=IJ(-1);function YIe(t){return"clientX"in t&&"clientY"in t}function AN(t){if(!t)return!1;const{KeyboardEvent:e}=hi(t.target);return e&&t instanceof e}function XIe(t){if(!t)return!1;const{TouchEvent:e}=hi(t.target);return e&&t instanceof e}function ZE(t){if(XIe(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 YIe(t)?{x:t.clientX,y:t.clientY}:null}const Gl=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[Gl.Translate.toString(t),Gl.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),kU="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function QIe(t){return t.matches(kU)?t:t.querySelector(kU)}const ZIe={display:"none"};function JIe(t){let{id:e,value:n}=t;return oe.createElement("div",{id:e,style:ZIe},n)}function eje(t){let{id:e,announcement:n,ariaLiveType:r="assertive"}=t;const s={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return oe.createElement("div",{id:e,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function tje(){const[t,e]=S.useState("");return{announce:S.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const jJ=S.createContext(null);function nje(t){const e=S.useContext(jJ);S.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function rje(){const[t]=S.useState(()=>new Set),e=S.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[S.useCallback(r=>{let{type:s,event:i}=r;t.forEach(o=>{var a;return(a=o[s])==null?void 0:a.call(o,i)})},[t]),e]}const sje={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.
|
||
`},ije={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 oje(t){let{announcements:e=ije,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=sje}=t;const{announce:i,announcement:o}=tje(),a=W_("DndLiveRegion"),[c,u]=S.useState(!1);if(S.useEffect(()=>{u(!0)},[]),nje(S.useMemo(()=>({onDragStart(l){let{active:d}=l;i(e.onDragStart({active:d}))},onDragMove(l){let{active:d,over:p}=l;e.onDragMove&&i(e.onDragMove({active:d,over:p}))},onDragOver(l){let{active:d,over:p}=l;i(e.onDragOver({active:d,over:p}))},onDragEnd(l){let{active:d,over:p}=l;i(e.onDragEnd({active:d,over:p}))},onDragCancel(l){let{active:d,over:p}=l;i(e.onDragCancel({active:d,over:p}))}}),[i,e])),!c)return null;const f=oe.createElement(oe.Fragment,null,oe.createElement(JIe,{id:r,value:s.draggable}),oe.createElement(eje,{id:a,announcement:o}));return n?ss.createPortal(f,n):f}var Vr;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(Vr||(Vr={}));function JE(){}function O1(t,e){return S.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function aje(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return S.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const Ja=Object.freeze({x:0,y:0});function lje(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function cje(t,e){const n=ZE(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 uje(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function dje(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function fje(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function DU(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 hje=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=DU(e,e.left,e.top),i=[];for(const o of r){const{id:a}=o,c=n.get(a);if(c){const u=lje(DU(c),s);i.push({id:a,data:{droppableContainer:o,value:u}})}}return i.sort(uje)};function pje(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),s=Math.min(e.left+e.width,t.left+t.width),i=Math.min(e.top+e.height,t.top+t.height),o=s-r,a=i-n;if(r<s&&n<i){const c=e.width*e.height,u=t.width*t.height,f=o*a,l=f/(c+u-f);return Number(l.toFixed(4))}return 0}const mje=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=[];for(const i of r){const{id:o}=i,a=n.get(o);if(a){const c=pje(a,e);c>0&&s.push({id:o,data:{droppableContainer:i,value:c}})}}return s.sort(dje)};function gje(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function LJ(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:Ja}function vje(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((o,a)=>({...o,top:o.top+t*a.y,bottom:o.bottom+t*a.y,left:o.left+t*a.x,right:o.right+t*a.x}),{...n})}}const yje=vje(1);function $J(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 bje(t,e,n){const r=$J(e);if(!r)return t;const{scaleX:s,scaleY:i,x:o,y:a}=r,c=t.left-o-(1-s)*parseFloat(n),u=t.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),f=s?t.width/s:t.width,l=i?t.height/i:t.height;return{width:f,height:l,top:u,right:c+f,bottom:u+l,left:c}}const xje={ignoreTransform:!1};function Fy(t,e){e===void 0&&(e=xje);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:u,transformOrigin:f}=hi(t).getComputedStyle(t);u&&(n=bje(n,u,f))}const{top:r,left:s,width:i,height:o,bottom:a,right:c}=n;return{top:r,left:s,width:i,height:o,bottom:a,right:c}}function MU(t){return Fy(t,{ignoreTransform:!0})}function wje(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function _je(t,e){return e===void 0&&(e=hi(t).getComputedStyle(t)),e.position==="fixed"}function Sje(t,e){e===void 0&&(e=hi(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 F$(t,e){const n=[];function r(s){if(e!=null&&n.length>=e||!s)return n;if($$(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!V_(s)||OJ(s)||n.includes(s))return n;const i=hi(t).getComputedStyle(s);return s!==t&&Sje(s,i)&&n.push(s),_je(s,i)?n:r(s.parentNode)}return t?r(t):n}function FJ(t){const[e]=F$(t,1);return e??null}function Xk(t){return!CN||!t?null:Ly(t)?t:L$(t)?$$(t)||t===$y(t).scrollingElement?window:V_(t)?t:null:null}function zJ(t){return Ly(t)?t.scrollX:t.scrollLeft}function BJ(t){return Ly(t)?t.scrollY:t.scrollTop}function PO(t){return{x:zJ(t),y:BJ(t)}}var ts;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(ts||(ts={}));function UJ(t){return!CN||!t?!1:t===document.scrollingElement}function HJ(t){const e={x:0,y:0},n=UJ(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},s=t.scrollTop<=e.y,i=t.scrollLeft<=e.x,o=t.scrollTop>=r.y,a=t.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:o,isRight:a,maxScroll:r,minScroll:e}}const Cje={x:.2,y:.2};function Eje(t,e,n,r,s){let{top:i,left:o,right:a,bottom:c}=n;r===void 0&&(r=10),s===void 0&&(s=Cje);const{isTop:u,isBottom:f,isLeft:l,isRight:d}=HJ(t),p={x:0,y:0},h={x:0,y:0},m={height:e.height*s.y,width:e.width*s.x};return!u&&i<=e.top+m.height?(p.y=ts.Backward,h.y=r*Math.abs((e.top+m.height-i)/m.height)):!f&&c>=e.bottom-m.height&&(p.y=ts.Forward,h.y=r*Math.abs((e.bottom-m.height-c)/m.height)),!d&&a>=e.right-m.width?(p.x=ts.Forward,h.x=r*Math.abs((e.right-m.width-a)/m.width)):!l&&o<=e.left+m.width&&(p.x=ts.Backward,h.x=r*Math.abs((e.left+m.width-o)/m.width)),{direction:p,speed:h}}function Aje(t){if(t===document.scrollingElement){const{innerWidth:i,innerHeight:o}=window;return{top:0,left:0,right:i,bottom:o,width:i,height:o}}const{top:e,left:n,right:r,bottom:s}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:s,width:t.clientWidth,height:t.clientHeight}}function VJ(t){return t.reduce((e,n)=>_g(e,PO(n)),Ja)}function Rje(t){return t.reduce((e,n)=>e+zJ(n),0)}function Nje(t){return t.reduce((e,n)=>e+BJ(n),0)}function qJ(t,e){if(e===void 0&&(e=Fy),!t)return;const{top:n,left:r,bottom:s,right:i}=e(t);FJ(t)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const Pje=[["x",["left","right"],Rje],["y",["top","bottom"],Nje]];class z${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=F$(n),s=VJ(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,o,a]of Pje)for(const c of o)Object.defineProperty(this,c,{get:()=>{const u=a(r),f=s[i]-u;return this.rect[c]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class N0{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 Tje(t){const{EventTarget:e}=hi(t);return t instanceof e?t:$y(t)}function Qk(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 Xo;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Xo||(Xo={}));function OU(t){t.preventDefault()}function kje(t){t.stopPropagation()}var dn;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter"})(dn||(dn={}));const WJ={start:[dn.Space,dn.Enter],cancel:[dn.Esc],end:[dn.Space,dn.Enter]},Dje=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case dn.Right:return{...n,x:n.x+25};case dn.Left:return{...n,x:n.x-25};case dn.Down:return{...n,y:n.y+25};case dn.Up:return{...n,y:n.y-25}}};class B${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 N0($y(n)),this.windowListeners=new N0(hi(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Xo.Resize,this.handleCancel),this.windowListeners.add(Xo.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Xo.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&qJ(r),n(Ja)}handleKeyDown(e){if(AN(e)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=WJ,coordinateGetter:o=Dje,scrollBehavior:a="smooth"}=s,{code:c}=e;if(i.end.includes(c)){this.handleEnd(e);return}if(i.cancel.includes(c)){this.handleCancel(e);return}const{collisionRect:u}=r.current,f=u?{x:u.left,y:u.top}:Ja;this.referenceCoordinates||(this.referenceCoordinates=f);const l=o(e,{active:n,context:r.current,currentCoordinates:f});if(l){const d=QE(l,f),p={x:0,y:0},{scrollableAncestors:h}=r.current;for(const m of h){const y=e.code,{isTop:g,isRight:v,isLeft:x,isBottom:_,maxScroll:A,minScroll:N}=HJ(m),T=Aje(m),E={x:Math.min(y===dn.Right?T.right-T.width/2:T.right,Math.max(y===dn.Right?T.left:T.left+T.width/2,l.x)),y:Math.min(y===dn.Down?T.bottom-T.height/2:T.bottom,Math.max(y===dn.Down?T.top:T.top+T.height/2,l.y))},P=y===dn.Right&&!v||y===dn.Left&&!x,k=y===dn.Down&&!_||y===dn.Up&&!g;if(P&&E.x!==l.x){const M=m.scrollLeft+d.x,I=y===dn.Right&&M<=A.x||y===dn.Left&&M>=N.x;if(I&&!d.y){m.scrollTo({left:M,behavior:a});return}I?p.x=m.scrollLeft-M:p.x=y===dn.Right?m.scrollLeft-A.x:m.scrollLeft-N.x,p.x&&m.scrollBy({left:-p.x,behavior:a});break}else if(k&&E.y!==l.y){const M=m.scrollTop+d.y,I=y===dn.Down&&M<=A.y||y===dn.Up&&M>=N.y;if(I&&!d.x){m.scrollTo({top:M,behavior:a});return}I?p.y=m.scrollTop-M:p.y=y===dn.Down?m.scrollTop-A.y:m.scrollTop-N.y,p.y&&m.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(e,_g(QE(l,this.referenceCoordinates),p))}}}handleMove(e,n){const{onMove:r}=this.props;e.preventDefault(),r(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}B$.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=WJ,onActivation:s}=e,{active:i}=n;const{code:o}=t.nativeEvent;if(r.start.includes(o)){const a=i.activatorNode.current;return a&&t.target!==a?!1:(t.preventDefault(),s==null||s({event:t.nativeEvent}),!0)}return!1}}];function IU(t){return!!(t&&"distance"in t)}function jU(t){return!!(t&&"delay"in t)}class U${constructor(e,n,r){var s;r===void 0&&(r=Tje(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:i}=e,{target:o}=i;this.props=e,this.events=n,this.document=$y(o),this.documentListeners=new N0(this.document),this.listeners=new N0(r),this.windowListeners=new N0(hi(o)),this.initialCoordinates=(s=ZE(i))!=null?s:Ja,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(Xo.Resize,this.handleCancel),this.windowListeners.add(Xo.DragStart,OU),this.windowListeners.add(Xo.VisibilityChange,this.handleCancel),this.windowListeners.add(Xo.ContextMenu,OU),this.documentListeners.add(Xo.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(jU(n)){this.timeoutId=setTimeout(this.handleStart,n.delay);return}if(IU(n))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(Xo.Click,kje,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Xo.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:o,options:{activationConstraint:a}}=i;if(!s)return;const c=(n=ZE(e))!=null?n:Ja,u=QE(s,c);if(!r&&a){if(IU(a)){if(a.tolerance!=null&&Qk(u,a.tolerance))return this.handleCancel();if(Qk(u,a.distance))return this.handleStart()}return jU(a)&&Qk(u,a.tolerance)?this.handleCancel():void 0}e.cancelable&&e.preventDefault(),o(c)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===dn.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const Mje={move:{name:"pointermove"},end:{name:"pointerup"}};class H$ extends U${constructor(e){const{event:n}=e,r=$y(n.target);super(e,Mje,r)}}H$.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 Oje={move:{name:"mousemove"},end:{name:"mouseup"}};var TO;(function(t){t[t.RightClick=2]="RightClick"})(TO||(TO={}));class GJ extends U${constructor(e){super(e,Oje,$y(e.event.target))}}GJ.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===TO.RightClick?!1:(r==null||r({event:n}),!0)}}];const Zk={move:{name:"touchmove"},end:{name:"touchend"}};class KJ extends U${constructor(e){super(e,Zk)}static setup(){return window.addEventListener(Zk.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Zk.move.name,e)};function e(){}}}KJ.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 P0;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(P0||(P0={}));var eA;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(eA||(eA={}));function Ije(t){let{acceleration:e,activator:n=P0.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:o=5,order:a=eA.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:f,delta:l,threshold:d}=t;const p=Lje({delta:l,disabled:!i}),[h,m]=KIe(),y=S.useRef({x:0,y:0}),g=S.useRef({x:0,y:0}),v=S.useMemo(()=>{switch(n){case P0.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case P0.DraggableRect:return s}},[n,s,c]),x=S.useRef(null),_=S.useCallback(()=>{const N=x.current;if(!N)return;const T=y.current.x*g.current.x,E=y.current.y*g.current.y;N.scrollBy(T,E)},[]),A=S.useMemo(()=>a===eA.TreeOrder?[...u].reverse():u,[a,u]);S.useEffect(()=>{if(!i||!u.length||!v){m();return}for(const N of A){if((r==null?void 0:r(N))===!1)continue;const T=u.indexOf(N),E=f[T];if(!E)continue;const{direction:P,speed:k}=Eje(N,E,v,e,d);for(const M of["x","y"])p[M][P[M]]||(k[M]=0,P[M]=0);if(k.x>0||k.y>0){m(),x.current=N,h(_,o),y.current=k,g.current=P;return}}y.current={x:0,y:0},g.current={x:0,y:0},m()},[e,_,r,m,i,o,JSON.stringify(v),JSON.stringify(p),h,u,A,f,JSON.stringify(d)])}const jje={x:{[ts.Backward]:!1,[ts.Forward]:!1},y:{[ts.Backward]:!1,[ts.Forward]:!1}};function Lje(t){let{delta:e,disabled:n}=t;const r=XE(e);return q_(s=>{if(n||!r||!s)return jje;const i={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[ts.Backward]:s.x[ts.Backward]||i.x===-1,[ts.Forward]:s.x[ts.Forward]||i.x===1},y:{[ts.Backward]:s.y[ts.Backward]||i.y===-1,[ts.Forward]:s.y[ts.Forward]||i.y===1}}},[n,e,r])}function $je(t,e){const n=e!==null?t.get(e):void 0,r=n?n.node.current:null;return q_(s=>{var i;return e===null?null:(i=r??s)!=null?i:null},[r,e])}function Fje(t,e){return S.useMemo(()=>t.reduce((n,r)=>{const{sensor:s}=r,i=s.activators.map(o=>({eventName:o.eventName,handler:e(o.handler,r)}));return[...n,...i]},[]),[t,e])}var ry;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(ry||(ry={}));var kO;(function(t){t.Optimized="optimized"})(kO||(kO={}));const LU=new Map;function zje(t,e){let{dragging:n,dependencies:r,config:s}=e;const[i,o]=S.useState(null),{frequency:a,measure:c,strategy:u}=s,f=S.useRef(t),l=y(),d=xx(l),p=S.useCallback(function(g){g===void 0&&(g=[]),!d.current&&o(v=>v===null?g:v.concat(g.filter(x=>!v.includes(x))))},[d]),h=S.useRef(null),m=q_(g=>{if(l&&!n)return LU;if(!g||g===LU||f.current!==t||i!=null){const v=new Map;for(let x of t){if(!x)continue;if(i&&i.length>0&&!i.includes(x.id)&&x.rect.current){v.set(x.id,x.rect.current);continue}const _=x.node.current,A=_?new z$(c(_),_):null;x.rect.current=A,A&&v.set(x.id,A)}return v}return g},[t,i,n,l,c]);return S.useEffect(()=>{f.current=t},[t]),S.useEffect(()=>{l||p()},[n,l]),S.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),S.useEffect(()=>{l||typeof a!="number"||h.current!==null||(h.current=setTimeout(()=>{p(),h.current=null},a))},[a,l,p,...r]),{droppableRects:m,measureDroppableContainers:p,measuringScheduled:i!=null};function y(){switch(u){case ry.Always:return!1;case ry.BeforeDragging:return n;default:return!n}}}function V$(t,e){return q_(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function Bje(t,e){return V$(t,e)}function Uje(t){let{callback:e,disabled:n}=t;const r=EN(e),s=S.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return S.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function RN(t){let{callback:e,disabled:n}=t;const r=EN(e),s=S.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return S.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Hje(t){return new z$(Fy(t),t)}function $U(t,e,n){e===void 0&&(e=Hje);const[r,s]=S.useReducer(a,null),i=Uje({callback(c){if(t)for(const u of c){const{type:f,target:l}=u;if(f==="childList"&&l instanceof HTMLElement&&l.contains(t)){s();break}}}}),o=RN({callback:s});return ca(()=>{s(),t?(o==null||o.observe(t),i==null||i.observe(document.body,{childList:!0,subtree:!0})):(o==null||o.disconnect(),i==null||i.disconnect())},[t]),r;function a(c){if(!t)return null;if(t.isConnected===!1){var u;return(u=c??n)!=null?u:null}const f=e(t);return JSON.stringify(c)===JSON.stringify(f)?c:f}}function Vje(t){const e=V$(t);return LJ(t,e)}const FU=[];function qje(t){const e=S.useRef(t),n=q_(r=>t?r&&r!==FU&&t&&e.current&&t.parentNode===e.current.parentNode?r:F$(t):FU,[t]);return S.useEffect(()=>{e.current=t},[t]),n}function Wje(t){const[e,n]=S.useState(null),r=S.useRef(t),s=S.useCallback(i=>{const o=Xk(i.target);o&&n(a=>a?(a.set(o,PO(o)),new Map(a)):null)},[]);return S.useEffect(()=>{const i=r.current;if(t!==i){o(i);const a=t.map(c=>{const u=Xk(c);return u?(u.addEventListener("scroll",s,{passive:!0}),[u,PO(u)]):null}).filter(c=>c!=null);n(a.length?new Map(a):null),r.current=t}return()=>{o(t),o(i)};function o(a){a.forEach(c=>{const u=Xk(c);u==null||u.removeEventListener("scroll",s)})}},[s,t]),S.useMemo(()=>t.length?e?Array.from(e.values()).reduce((i,o)=>_g(i,o),Ja):VJ(t):Ja,[t,e])}function zU(t,e){e===void 0&&(e=[]);const n=S.useRef(null);return S.useEffect(()=>{n.current=null},e),S.useEffect(()=>{const r=t!==Ja;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?QE(t,n.current):Ja}function Gje(t){S.useEffect(()=>{if(!CN)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 Kje(t,e){return S.useMemo(()=>t.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=o=>{i(o,e)},n},{}),[t,e])}function YJ(t){return S.useMemo(()=>t?wje(t):null,[t])}const Jk=[];function Yje(t,e){e===void 0&&(e=Fy);const[n]=t,r=YJ(n?hi(n):null),[s,i]=S.useReducer(a,Jk),o=RN({callback:i});return t.length>0&&s===Jk&&i(),ca(()=>{t.length?t.forEach(c=>o==null?void 0:o.observe(c)):(o==null||o.disconnect(),i())},[t]),s;function a(){return t.length?t.map(c=>UJ(c)?r:new z$(e(c),c)):Jk}}function XJ(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return V_(e)?e:t}function Xje(t){let{measure:e}=t;const[n,r]=S.useState(null),s=S.useCallback(u=>{for(const{target:f}of u)if(V_(f)){r(l=>{const d=e(f);return l?{...l,width:d.width,height:d.height}:d});break}},[e]),i=RN({callback:s}),o=S.useCallback(u=>{const f=XJ(u);i==null||i.disconnect(),f&&(i==null||i.observe(f)),r(f?e(f):null)},[e,i]),[a,c]=YE(o);return S.useMemo(()=>({nodeRef:a,rect:n,setRef:c}),[n,a,c])}const Qje=[{sensor:H$,options:{}},{sensor:B$,options:{}}],Zje={current:{}},fC={draggable:{measure:MU},droppable:{measure:MU,strategy:ry.WhileDragging,frequency:kO.Optimized},dragOverlay:{measure:Fy}};class T0 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 Jje={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new T0,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:JE},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:fC,measureDroppableContainers:JE,windowRect:null,measuringScheduled:!1},QJ={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:JE,draggableNodes:new Map,over:null,measureDroppableContainers:JE},G_=S.createContext(QJ),ZJ=S.createContext(Jje);function eLe(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new T0}}}function tLe(t,e){switch(e.type){case Vr.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case Vr.DragMove:return t.draggable.active?{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}}:t;case Vr.DragEnd:case Vr.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Vr.RegisterDroppable:{const{element:n}=e,{id:r}=n,s=new T0(t.droppable.containers);return s.set(r,n),{...t,droppable:{...t.droppable,containers:s}}}case Vr.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=e,i=t.droppable.containers.get(n);if(!i||r!==i.key)return t;const o=new T0(t.droppable.containers);return o.set(n,{...i,disabled:s}),{...t,droppable:{...t.droppable,containers:o}}}case Vr.UnregisterDroppable:{const{id:n,key:r}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const i=new T0(t.droppable.containers);return i.delete(n),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function nLe(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:s}=S.useContext(G_),i=XE(r),o=XE(n==null?void 0:n.id);return S.useEffect(()=>{if(!e&&!r&&i&&o!=null){if(!AN(i)||document.activeElement===i.target)return;const a=s.get(o);if(!a)return;const{activatorNode:c,node:u}=a;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[c.current,u.current]){if(!f)continue;const l=QIe(f);if(l){l.focus();break}}})}},[r,e,s,o,i]),null}function JJ(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((s,i)=>i({transform:s,...r}),n):n}function rLe(t){return S.useMemo(()=>({draggable:{...fC.draggable,...t==null?void 0:t.draggable},droppable:{...fC.droppable,...t==null?void 0:t.droppable},dragOverlay:{...fC.dragOverlay,...t==null?void 0:t.dragOverlay}}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function sLe(t){let{activeNode:e,measure:n,initialRect:r,config:s=!0}=t;const i=S.useRef(!1),{x:o,y:a}=typeof s=="boolean"?{x:s,y:s}:s;ca(()=>{if(!o&&!a||!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=LJ(f,r);if(o||(l.x=0),a||(l.y=0),i.current=!0,Math.abs(l.x)>0||Math.abs(l.y)>0){const d=FJ(u);d&&d.scrollBy({top:l.y,left:l.x})}},[e,o,a,r,n])}const NN=S.createContext({...Ja,scaleX:1,scaleY:1});var nd;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(nd||(nd={}));const iLe=S.memo(function(e){var n,r,s,i;let{id:o,accessibility:a,autoScroll:c=!0,children:u,sensors:f=Qje,collisionDetection:l=mje,measuring:d,modifiers:p,...h}=e;const m=S.useReducer(tLe,void 0,eLe),[y,g]=m,[v,x]=rje(),[_,A]=S.useState(nd.Uninitialized),N=_===nd.Initialized,{draggable:{active:T,nodes:E,translate:P},droppable:{containers:k}}=y,M=T?E.get(T):null,I=S.useRef({initial:null,translated:null}),j=S.useMemo(()=>{var St;return T!=null?{id:T,data:(St=M==null?void 0:M.data)!=null?St:Zje,rect:I}:null},[T,M]),L=S.useRef(null),[H,K]=S.useState(null),[V,U]=S.useState(null),Q=xx(h,Object.values(h)),ne=W_("DndDescribedBy",o),X=S.useMemo(()=>k.getEnabled(),[k]),G=rLe(d),{droppableRects:Y,measureDroppableContainers:Z,measuringScheduled:he}=zje(X,{dragging:N,dependencies:[P.x,P.y],config:G.droppable}),fe=$je(E,T),ce=S.useMemo(()=>V?ZE(V):null,[V]),xe=Pt(),Ne=Bje(fe,G.draggable.measure);sLe({activeNode:T?E.get(T):null,config:xe.layoutShiftCompensation,initialRect:Ne,measure:G.draggable.measure});const pe=$U(fe,G.draggable.measure,Ne),Le=$U(fe?fe.parentElement:null),Me=S.useRef({activatorEvent:null,active:null,activeNode:fe,collisionRect:null,collisions:null,droppableRects:Y,draggableNodes:E,draggingNode:null,draggingNodeRect:null,droppableContainers:k,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Oe=k.getNodeFor((n=Me.current.over)==null?void 0:n.id),Fe=Xje({measure:G.dragOverlay.measure}),ot=(r=Fe.nodeRef.current)!=null?r:fe,nt=N?(s=Fe.rect)!=null?s:pe:null,At=!!(Fe.nodeRef.current&&Fe.rect),ee=Vje(At?null:pe),de=YJ(ot?hi(ot):null),me=qje(N?Oe??fe:null),Re=Yje(me),Pe=JJ(p,{transform:{x:P.x-ee.x,y:P.y-ee.y,scaleX:1,scaleY:1},activatorEvent:V,active:j,activeNodeRect:pe,containerNodeRect:Le,draggingNodeRect:nt,over:Me.current.over,overlayNodeRect:Fe.rect,scrollableAncestors:me,scrollableAncestorRects:Re,windowRect:de}),Ee=ce?_g(ce,P):null,Ve=Wje(me),tt=zU(Ve),qt=zU(Ve,[pe]),gt=_g(Pe,tt),kt=nt?yje(nt,Pe):null,ln=j&&kt?l({active:j,collisionRect:kt,droppableRects:Y,droppableContainers:X,pointerCoordinates:Ee}):null,gr=fje(ln,"id"),[_n,pi]=S.useState(null),or=At?Pe:_g(Pe,qt),mi=gje(or,(i=_n==null?void 0:_n.rect)!=null?i:null,pe),$e=S.useCallback((St,Wt)=>{let{sensor:Zt,options:ar}=Wt;if(L.current==null)return;const Pn=E.get(L.current);if(!Pn)return;const Cr=St.nativeEvent,Dr=new Zt({active:L.current,activeNode:Pn,event:Cr,options:ar,context:Me,onStart(Yr){const rc=L.current;if(rc==null)return;const ha=E.get(rc);if(!ha)return;const{onDragStart:re}=Q.current,ae={active:{id:rc,data:ha.data,rect:I}};ss.unstable_batchedUpdates(()=>{re==null||re(ae),A(nd.Initializing),g({type:Vr.DragStart,initialCoordinates:Yr,active:rc}),v({type:"onDragStart",event:ae})})},onMove(Yr){g({type:Vr.DragMove,coordinates:Yr})},onEnd:Gi(Vr.DragEnd),onCancel:Gi(Vr.DragCancel)});ss.unstable_batchedUpdates(()=>{K(Dr),U(St.nativeEvent)});function Gi(Yr){return async function(){const{active:ha,collisions:re,over:ae,scrollAdjustedTranslate:ge}=Me.current;let _e=null;if(ha&&ge){const{cancelDrop:ze}=Q.current;_e={activatorEvent:Cr,active:ha,collisions:re,delta:ge,over:ae},Yr===Vr.DragEnd&&typeof ze=="function"&&await Promise.resolve(ze(_e))&&(Yr=Vr.DragCancel)}L.current=null,ss.unstable_batchedUpdates(()=>{g({type:Yr}),A(nd.Uninitialized),pi(null),K(null),U(null);const ze=Yr===Vr.DragEnd?"onDragEnd":"onDragCancel";if(_e){const Ke=Q.current[ze];Ke==null||Ke(_e),v({type:ze,event:_e})}})}}},[E]),Xe=S.useCallback((St,Wt)=>(Zt,ar)=>{const Pn=Zt.nativeEvent,Cr=E.get(ar);if(L.current!==null||!Cr||Pn.dndKit||Pn.defaultPrevented)return;const Dr={active:Cr};St(Zt,Wt.options,Dr)===!0&&(Pn.dndKit={capturedBy:Wt.sensor},L.current=ar,$e(Zt,Wt))},[E,$e]),ht=Fje(f,Xe);Gje(f),ca(()=>{pe&&_===nd.Initializing&&A(nd.Initialized)},[pe,_]),S.useEffect(()=>{const{onDragMove:St}=Q.current,{active:Wt,activatorEvent:Zt,collisions:ar,over:Pn}=Me.current;if(!Wt||!Zt)return;const Cr={active:Wt,activatorEvent:Zt,collisions:ar,delta:{x:gt.x,y:gt.y},over:Pn};ss.unstable_batchedUpdates(()=>{St==null||St(Cr),v({type:"onDragMove",event:Cr})})},[gt.x,gt.y]),S.useEffect(()=>{const{active:St,activatorEvent:Wt,collisions:Zt,droppableContainers:ar,scrollAdjustedTranslate:Pn}=Me.current;if(!St||L.current==null||!Wt||!Pn)return;const{onDragOver:Cr}=Q.current,Dr=ar.get(gr),Gi=Dr&&Dr.rect.current?{id:Dr.id,rect:Dr.rect.current,data:Dr.data,disabled:Dr.disabled}:null,Yr={active:St,activatorEvent:Wt,collisions:Zt,delta:{x:Pn.x,y:Pn.y},over:Gi};ss.unstable_batchedUpdates(()=>{pi(Gi),Cr==null||Cr(Yr),v({type:"onDragOver",event:Yr})})},[gr]),ca(()=>{Me.current={activatorEvent:V,active:j,activeNode:fe,collisionRect:kt,collisions:ln,droppableRects:Y,draggableNodes:E,draggingNode:ot,draggingNodeRect:nt,droppableContainers:k,over:_n,scrollableAncestors:me,scrollAdjustedTranslate:gt},I.current={initial:nt,translated:kt}},[j,fe,ln,kt,E,ot,nt,Y,k,_n,me,gt]),Ije({...xe,delta:P,draggingRect:kt,pointerCoordinates:Ee,scrollableAncestors:me,scrollableAncestorRects:Re});const Ze=S.useMemo(()=>({active:j,activeNode:fe,activeNodeRect:pe,activatorEvent:V,collisions:ln,containerNodeRect:Le,dragOverlay:Fe,draggableNodes:E,droppableContainers:k,droppableRects:Y,over:_n,measureDroppableContainers:Z,scrollableAncestors:me,scrollableAncestorRects:Re,measuringConfiguration:G,measuringScheduled:he,windowRect:de}),[j,fe,pe,V,ln,Le,Fe,E,k,Y,_n,Z,me,Re,G,he,de]),yt=S.useMemo(()=>({activatorEvent:V,activators:ht,active:j,activeNodeRect:pe,ariaDescribedById:{draggable:ne},dispatch:g,draggableNodes:E,over:_n,measureDroppableContainers:Z}),[V,ht,j,pe,g,ne,E,_n,Z]);return oe.createElement(jJ.Provider,{value:x},oe.createElement(G_.Provider,{value:yt},oe.createElement(ZJ.Provider,{value:Ze},oe.createElement(NN.Provider,{value:mi},u)),oe.createElement(nLe,{disabled:(a==null?void 0:a.restoreFocus)===!1})),oe.createElement(oje,{...a,hiddenTextDescribedById:ne}));function Pt(){const St=(H==null?void 0:H.autoScrollEnabled)===!1,Wt=typeof c=="object"?c.enabled===!1:c===!1,Zt=N&&!St&&!Wt;return typeof c=="object"?{...c,enabled:Zt}:{enabled:Zt}}}),oLe=S.createContext(null),BU="button",aLe="Droppable";function lLe(t){let{id:e,data:n,disabled:r=!1,attributes:s}=t;const i=W_(aLe),{activators:o,activatorEvent:a,active:c,activeNodeRect:u,ariaDescribedById:f,draggableNodes:l,over:d}=S.useContext(G_),{role:p=BU,roleDescription:h="draggable",tabIndex:m=0}=s??{},y=(c==null?void 0:c.id)===e,g=S.useContext(y?NN:oLe),[v,x]=YE(),[_,A]=YE(),N=Kje(o,e),T=xx(n);ca(()=>(l.set(e,{id:e,key:i,node:v,activatorNode:_,data:T}),()=>{const P=l.get(e);P&&P.key===i&&l.delete(e)}),[l,e]);const E=S.useMemo(()=>({role:p,tabIndex:m,"aria-disabled":r,"aria-pressed":y&&p===BU?!0:void 0,"aria-roledescription":h,"aria-describedby":f.draggable}),[r,p,m,y,h,f.draggable]);return{active:c,activatorEvent:a,activeNodeRect:u,attributes:E,isDragging:y,listeners:r?void 0:N,node:v,over:d,setNodeRef:x,setActivatorNodeRef:A,transform:g}}function eee(){return S.useContext(ZJ)}const cLe="Droppable",uLe={timeout:25};function dLe(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:s}=t;const i=W_(cLe),{active:o,dispatch:a,over:c,measureDroppableContainers:u}=S.useContext(G_),f=S.useRef({disabled:n}),l=S.useRef(!1),d=S.useRef(null),p=S.useRef(null),{disabled:h,updateMeasurementsFor:m,timeout:y}={...uLe,...s},g=xx(m??r),v=S.useCallback(()=>{if(!l.current){l.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{u(Array.isArray(g.current)?g.current:[g.current]),p.current=null},y)},[y]),x=RN({callback:v,disabled:h||!o}),_=S.useCallback((E,P)=>{x&&(P&&(x.unobserve(P),l.current=!1),E&&x.observe(E))},[x]),[A,N]=YE(_),T=xx(e);return S.useEffect(()=>{!x||!A.current||(x.disconnect(),l.current=!1,x.observe(A.current))},[A,x]),ca(()=>(a({type:Vr.RegisterDroppable,element:{id:r,key:i,disabled:n,node:A,rect:d,data:T}}),()=>a({type:Vr.UnregisterDroppable,key:i,id:r})),[r]),S.useEffect(()=>{n!==f.current.disabled&&(a({type:Vr.SetDroppableDisabled,id:r,key:i,disabled:n}),f.current.disabled=n)},[r,i,n,a]),{active:o,rect:d,isOver:(c==null?void 0:c.id)===r,node:A,over:c,setNodeRef:N}}function fLe(t){let{animation:e,children:n}=t;const[r,s]=S.useState(null),[i,o]=S.useState(null),a=XE(n);return!n&&!r&&a&&s(a),ca(()=>{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]),oe.createElement(oe.Fragment,null,n,r?S.cloneElement(r,{ref:o}):null)}const hLe={x:0,y:0,scaleX:1,scaleY:1};function pLe(t){let{children:e}=t;return oe.createElement(G_.Provider,{value:QJ},oe.createElement(NN.Provider,{value:hLe},e))}const mLe={position:"fixed",touchAction:"none"},gLe=t=>AN(t)?"transform 250ms ease":void 0,vLe=S.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:s,children:i,className:o,rect:a,style:c,transform:u,transition:f=gLe}=t;if(!a)return null;const l=s?u:{...u,scaleX:1,scaleY:1},d={...mLe,width:a.width,height:a.height,top:a.top,left:a.left,transform:Gl.Transform.toString(l),transformOrigin:s&&r?cje(r,a):void 0,transition:typeof f=="function"?f(r):f,...c};return oe.createElement(n,{className:o,style:d,ref:e},i)}),yLe=t=>e=>{let{active:n,dragOverlay:r}=e;const s={},{styles:i,className:o}=t;if(i!=null&&i.active)for(const[a,c]of Object.entries(i.active))c!==void 0&&(s[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,c));if(i!=null&&i.dragOverlay)for(const[a,c]of Object.entries(i.dragOverlay))c!==void 0&&r.node.style.setProperty(a,c);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(const[c,u]of Object.entries(s))n.node.style.setProperty(c,u);o!=null&&o.active&&n.node.classList.remove(o.active)}},bLe=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:Gl.Transform.toString(e)},{transform:Gl.Transform.toString(n)}]},DO={duration:250,easing:"ease",keyframes:bLe,sideEffects:yLe({styles:{active:{opacity:"0"}}})};function xLe(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:s}=t;return EN((i,o)=>{if(e===null)return;const a=n.get(i);if(!a)return;const c=a.node.current;if(!c)return;const u=XJ(o);if(!u)return;const{transform:f}=hi(o).getComputedStyle(o),l=$J(f);if(!l)return;const d=typeof e=="function"?e:wLe(e);return qJ(c,s.draggable.measure),d({active:{id:i,data:a.data,node:c,rect:s.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:o,rect:s.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:s,transform:l})})}function wLe(t){const{duration:e,easing:n,sideEffects:r,keyframes:s}={...DO,...t};return i=>{let{active:o,dragOverlay:a,transform:c,...u}=i;if(!e)return;const f={x:a.rect.left-o.rect.left,y:a.rect.top-o.rect.top},l={scaleX:c.scaleX!==1?o.rect.width*c.scaleX/a.rect.width:1,scaleY:c.scaleY!==1?o.rect.height*c.scaleY/a.rect.height:1},d={x:c.x-f.x,y:c.y-f.y,...l},p=s({...u,active:o,dragOverlay:a,transform:{initial:c,final:d}}),[h]=p,m=p[p.length-1];if(JSON.stringify(h)===JSON.stringify(m))return;const y=r==null?void 0:r({active:o,dragOverlay:a,...u}),g=a.node.animate(p,{duration:e,easing:n,fill:"forwards"});return new Promise(v=>{g.onfinish=()=>{y==null||y(),v()}})}}let UU=0;function _Le(t){return S.useMemo(()=>{if(t!=null)return UU++,UU},[t])}const SLe=oe.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:r,style:s,transition:i,modifiers:o,wrapperElement:a="div",className:c,zIndex:u=999}=t;const{activatorEvent:f,active:l,activeNodeRect:d,containerNodeRect:p,draggableNodes:h,droppableContainers:m,dragOverlay:y,over:g,measuringConfiguration:v,scrollableAncestors:x,scrollableAncestorRects:_,windowRect:A}=eee(),N=S.useContext(NN),T=_Le(l==null?void 0:l.id),E=JJ(o,{activatorEvent:f,active:l,activeNodeRect:d,containerNodeRect:p,draggingNodeRect:y.rect,over:g,overlayNodeRect:y.rect,scrollableAncestors:x,scrollableAncestorRects:_,transform:N,windowRect:A}),P=V$(d),k=xLe({config:r,draggableNodes:h,droppableContainers:m,measuringConfiguration:v}),M=P?y.setRef:void 0;return oe.createElement(pLe,null,oe.createElement(fLe,{animation:k},l&&T?oe.createElement(vLe,{key:T,id:l.id,ref:M,as:a,activatorEvent:f,adjustScale:e,className:c,transition:i,rect:P,style:{zIndex:u,...s},transform:E},n):null))});function tee(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function CLe(t,e){return t.reduce((n,r,s)=>{const i=e.get(r);return i&&(n[s]=i),n},Array(t.length))}function I1(t){return t!==null&&t>=0}function ELe(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 ALe(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const nee=t=>{let{rects:e,activeIndex:n,overIndex:r,index:s}=t;const i=tee(e,r,n),o=e[s],a=i[s];return!a||!o?null:{x:a.left-o.left,y:a.top-o.top,scaleX:a.width/o.width,scaleY:a.height/o.height}},j1={scaleX:1,scaleY:1},RLe=t=>{var e;let{activeIndex:n,activeNodeRect:r,index:s,rects:i,overIndex:o}=t;const a=(e=i[n])!=null?e:r;if(!a)return null;if(s===n){const u=i[o];return u?{x:0,y:n<o?u.top+u.height-(a.top+a.height):u.top-a.top,...j1}:null}const c=NLe(i,s,n);return s>n&&s<=o?{x:0,y:-a.height-c,...j1}:s<n&&s>=o?{x:0,y:a.height+c,...j1}:{x:0,y:0,...j1}};function NLe(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 ree="Sortable",see=oe.createContext({activeIndex:-1,containerId:ree,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:nee,disabled:{draggable:!1,droppable:!1}});function PLe(t){let{children:e,id:n,items:r,strategy:s=nee,disabled:i=!1}=t;const{active:o,dragOverlay:a,droppableRects:c,over:u,measureDroppableContainers:f}=eee(),l=W_(ree,n),d=a.rect!==null,p=S.useMemo(()=>r.map(N=>typeof N=="object"&&"id"in N?N.id:N),[r]),h=o!=null,m=o?p.indexOf(o.id):-1,y=u?p.indexOf(u.id):-1,g=S.useRef(p),v=!ELe(p,g.current),x=y!==-1&&m===-1||v,_=ALe(i);ca(()=>{v&&h&&f(p)},[v,p,h,f]),S.useEffect(()=>{g.current=p},[p]);const A=S.useMemo(()=>({activeIndex:m,containerId:l,disabled:_,disableTransforms:x,items:p,overIndex:y,useDragOverlay:d,sortedRects:CLe(p,c),strategy:s}),[m,l,_.draggable,_.droppable,x,p,y,c,d,s]);return oe.createElement(see.Provider,{value:A},e)}const TLe=t=>{let{id:e,items:n,activeIndex:r,overIndex:s}=t;return tee(n,r,s).indexOf(e)},iee=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:s,items:i,newIndex:o,previousItems:a,previousContainerId:c,transition:u}=t;return!u||!r||a!==i&&s===o?!1:n?!0:o!==s&&e===c},kLe={duration:200,easing:"ease"},oee="transform",DLe=Gl.Transition.toString({property:oee,duration:0,easing:"linear"}),MLe={roleDescription:"sortable"};function OLe(t){let{disabled:e,index:n,node:r,rect:s}=t;const[i,o]=S.useState(null),a=S.useRef(n);return ca(()=>{if(!e&&n!==a.current&&r.current){const c=s.current;if(c){const u=Fy(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)&&o(f)}}n!==a.current&&(a.current=n)},[e,n,r,s]),S.useEffect(()=>{i&&o(null)},[i]),i}function aee(t){let{animateLayoutChanges:e=iee,attributes:n,disabled:r,data:s,getNewIndex:i=TLe,id:o,strategy:a,resizeObserverConfig:c,transition:u=kLe}=t;const{items:f,containerId:l,activeIndex:d,disabled:p,disableTransforms:h,sortedRects:m,overIndex:y,useDragOverlay:g,strategy:v}=S.useContext(see),x=ILe(r,p),_=f.indexOf(o),A=S.useMemo(()=>({sortable:{containerId:l,index:_,items:f},...s}),[l,s,_,f]),N=S.useMemo(()=>f.slice(f.indexOf(o)),[f,o]),{rect:T,node:E,isOver:P,setNodeRef:k}=dLe({id:o,data:A,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:N,...c}}),{active:M,activatorEvent:I,activeNodeRect:j,attributes:L,setNodeRef:H,listeners:K,isDragging:V,over:U,setActivatorNodeRef:Q,transform:ne}=lLe({id:o,data:A,attributes:{...MLe,...n},disabled:x.draggable}),X=GIe(k,H),G=!!M,Y=G&&!h&&I1(d)&&I1(y),Z=!g&&V,he=Z&&Y?ne:null,ce=Y?he??(a??v)({rects:m,activeNodeRect:j,activeIndex:d,overIndex:y,index:_}):null,xe=I1(d)&&I1(y)?i({id:o,items:f,activeIndex:d,overIndex:y}):_,Ne=M==null?void 0:M.id,pe=S.useRef({activeId:Ne,items:f,newIndex:xe,containerId:l}),Le=f!==pe.current.items,Me=e({active:M,containerId:l,isDragging:V,isSorting:G,id:o,index:_,items:f,newIndex:pe.current.newIndex,previousItems:pe.current.items,previousContainerId:pe.current.containerId,transition:u,wasDragging:pe.current.activeId!=null}),Oe=OLe({disabled:!Me,index:_,node:E,rect:T});return S.useEffect(()=>{G&&pe.current.newIndex!==xe&&(pe.current.newIndex=xe),l!==pe.current.containerId&&(pe.current.containerId=l),f!==pe.current.items&&(pe.current.items=f)},[G,xe,l,f]),S.useEffect(()=>{if(Ne===pe.current.activeId)return;if(Ne&&!pe.current.activeId){pe.current.activeId=Ne;return}const ot=setTimeout(()=>{pe.current.activeId=Ne},50);return()=>clearTimeout(ot)},[Ne]),{active:M,activeIndex:d,attributes:L,data:A,rect:T,index:_,newIndex:xe,items:f,isOver:P,isSorting:G,isDragging:V,listeners:K,node:E,overIndex:y,over:U,setNodeRef:X,setActivatorNodeRef:Q,setDroppableNodeRef:k,setDraggableNodeRef:H,transform:Oe??ce,transition:Fe()};function Fe(){if(Oe||Le&&pe.current.newIndex===_)return DLe;if(!(Z&&!AN(I)||!u)&&(G||Me))return Gl.Transition.toString({...u,property:oee})}}function ILe(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}}dn.Down,dn.Right,dn.Up,dn.Left;const jLe=({rowId:t,className:e})=>{const{attributes:n,listeners:r,isDragging:s}=aee({id:t});return b.jsxs(qe,{onClick:i=>{i.preventDefault()},size:"icon",variant:"link",className:ie(s?"cursor-grabbing":"cursor-grab","w-4 h-4 mt-2 text-ring hover:text-muted-foreground",e),...n,...r,children:[b.jsx(gq,{className:"w-4 h-4"}),b.jsx("span",{className:"sr-only",children:te("common.move_row")})]})};function LLe(){return{id:"select",header:({table:t})=>b.jsx(nx,{id:"select-all",checked:t.getIsAllPageRowsSelected()||t.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:e=>t.toggleAllPageRowsSelected(!!e),"aria-label":"Seleccionar todo",className:"translate-y-[2px]"}),cell:({row:t})=>b.jsx(nx,{id:`select-row-${t.id}`,checked:t.getIsSelected(),onCheckedChange:e=>{t.toggleSelected(!!e)},"aria-label":"Seleccionar file",className:"translate-y-[2px]"}),enableSorting:!1,enableHiding:!1}}function PN({columnCount:t,rowCount:e=10,searchableColumnCount:n=0,filterableColumnCount:r=0,showViewOptions:s=!0,cellWidths:i=["auto"],withPagination:o=!0,shrinkZero:a=!1,className:c,...u}){return b.jsxs("div",{className:ie("w-full space-y-2.5 overflow-auto",c),...u,children:[b.jsxs("div",{className:"flex items-center justify-between w-full p-1 space-x-2 overflow-auto",children:[b.jsxs("div",{className:"flex items-center flex-1 space-x-2",children:[n>0?Array.from({length:n}).map((f,l)=>b.jsx(_i,{className:"w-40 h-7 lg:w-60"},l)):null,r>0?Array.from({length:r}).map((f,l)=>b.jsx(_i,{className:"h-7 w-[4.5rem] border-dashed"},l)):null]}),s?b.jsx(_i,{className:"ml-auto hidden h-7 w-[4.5rem] lg:flex"}):null]}),b.jsx("div",{className:"border rounded-md",children:b.jsxs(sN,{children:[b.jsx(iN,{children:Array.from({length:1}).map((f,l)=>b.jsx(Qd,{className:"hover:bg-transparent",children:Array.from({length:t}).map((d,p)=>b.jsx(aN,{style:{width:i[p],minWidth:a?i[p]:"auto"},children:b.jsx(_i,{className:"w-full h-6"})},p))},l))}),b.jsx(oN,{children:Array.from({length:e}).map((f,l)=>b.jsx(Qd,{className:"hover:bg-transparent",children:Array.from({length:t}).map((d,p)=>b.jsx(hx,{style:{width:i[p],minWidth:a?i[p]:"auto"},children:b.jsx(_i,{className:"w-full h-6"})},p))},l))})]})}),o?b.jsxs("div",{className:"flex items-center justify-between w-full gap-4 p-1 overflow-auto sm:gap-8",children:[b.jsx(_i,{className:"w-40 h-7 shrink-0"}),b.jsxs("div",{className:"flex items-center gap-4 sm:gap-6 lg:gap-8",children:[b.jsxs("div",{className:"flex items-center space-x-2",children:[b.jsx(_i,{className:"w-24 h-7"}),b.jsx(_i,{className:"h-7 w-[4.5rem]"})]}),b.jsx("div",{className:"flex items-center justify-center text-sm font-medium",children:b.jsx(_i,{className:"w-20 h-7"})}),b.jsxs("div",{className:"flex items-center space-x-2",children:[b.jsx(_i,{className:"hidden size-7 lg:block"}),b.jsx(_i,{className:"size-7"}),b.jsx(_i,{className:"size-7"}),b.jsx(_i,{className:"hidden size-7 lg:block"})]})]})]}):null]})}const TN=({title:t="Esto está muy vacío",subtitle:e="Empieza dando de alta un item",buttonText:n="Nuevo item",onButtonClick:r=()=>{},actions:s=void 0})=>b.jsxs("div",{className:"text-center",children:[b.jsx("svg",{className:"w-12 h-12 mx-auto text-slate-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:b.jsx("path",{vectorEffect:"non-scaling-stroke",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})}),b.jsx("h3",{className:"mt-2 text-lg font-semibold text-slate-900",children:t}),b.jsx("p",{className:"mt-1 text-base text-slate-500",children:e}),b.jsxs("div",{className:"items-center mt-6",children:[s&&b.jsx(b.Fragment,{children:s}),!s&&b.jsxs(qe,{className:"my-4",onClick:r,children:[b.jsx(gL,{}),n]})]})]}),_f=({title:t="Se ha producido un error",subtitle:e=void 0,description:n=void 0,errorMessage:r=void 0})=>{const s=Us();return b.jsx("div",{className:"grid h-screen place-items-center ",children:b.jsxs("div",{className:"text-center",children:[b.jsx("h2",{className:"mt-2 text-xl font-semibold text-center text-slate-900",children:t}),b.jsxs("p",{className:"mt-1 font-medium text-slate-500",children:[e||r,b.jsx("br",{}),n]}),b.jsxs("div",{className:"mt-6 space-x-8 md:ml-4",children:[b.jsx(j$,{}),b.jsxs(qe,{onClick:()=>s("/"),children:[b.jsx(Bpe,{className:"w-4 h-4 mr-2"})," Ir al inicio"]})]})]})})};_f.displayName="ErrorOverlay";var En=function(){return En=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},En.apply(this,arguments)};function $Le(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 no(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 Kl=function(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")},FLe={k:1e3,m:1e6,b:1e9},zLe=function(t,e){e===void 0&&(e=".");var n=new RegExp("(\\d+(".concat(Kl(e),"\\d*)?)([kmb])$"),"i"),r=t.match(n);if(r){var s=r[1],i=r[3],o=FLe[i.toLowerCase()];return Number(s.replace(e,"."))*o}},BLe=function(t,e){e===void 0&&(e=",");var n=new RegExp(Kl(e),"g");return t.replace(n,"")},ULe=function(t,e){var n=Kl(e.join("")),r=new RegExp("[^\\d".concat(n,"]"),"gi");return t.replace(r,"")},eD=function(t){var e=t.value,n=t.groupSeparator,r=n===void 0?",":n,s=t.decimalSeparator,i=s===void 0?".":s,o=t.allowDecimals,a=o===void 0?!0:o,c=t.decimalsLimit,u=c===void 0?2:c,f=t.allowNegativeValue,l=f===void 0?!0:f,d=t.disableAbbreviations,p=d===void 0?!1:d,h=t.prefix,m=h===void 0?"":h,y=t.transformRawValue,g=y===void 0?function(ne){return ne}:y,v=g(e);if(v==="-")return v;var x=p?[]:["k","m","b"],_=new RegExp("((^|\\D)-\\d)|(-".concat(Kl(m),")")),A=_.test(v),N=RegExp("(\\d+)-?".concat(Kl(m))).exec(e)||[],T=N[0],E=N[1],P=m?T?v.replace(T,"").concat(E):v.replace(m,""):v,k=BLe(P,r),M=ULe(k,no([r,i],x,!0)),I=M;if(!p){if(x.some(function(ne){return ne===M.toLowerCase().replace(i,"")}))return"";var j=zLe(M,i);j&&(I=String(j))}var L=A&&l?"-":"";if(i&&I.includes(i)){var H=M.split(i),K=H[0],V=H[1],U=u&&V?V.slice(0,u):V,Q=a?"".concat(i).concat(U):"";return"".concat(L).concat(K).concat(Q)}return"".concat(L).concat(I)},HLe=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 o=t.length>n?new RegExp("(\\d+)(\\d{".concat(n,"})")):new RegExp("(\\d)(\\d+)"),a=t.match(o);if(a){var s=a[1],i=a[2];return"".concat(s).concat(e).concat(i)}}return t},lee=function(t,e){var n=e.groupSeparator,r=n===void 0?",":n,s=e.decimalSeparator,i=s===void 0?".":s,o=new RegExp("\\d([^".concat(Kl(r)).concat(Kl(i),"0-9]+)")),a=t.match(o);return a?a[1]:void 0},Tb=function(t){var e=t.value,n=t.decimalSeparator,r=t.intlConfig,s=t.decimalScale,i=t.prefix,o=i===void 0?"":i,a=t.suffix,c=a===void 0?"":a;if(e===""||e===void 0)return"";if(e==="-")return"-";var u=new RegExp("^\\d?-".concat(o?"".concat(Kl(o),"?"):"","\\d")).test(e),f=n!=="."?VLe(e,n,u):e;n&&n!=="-"&&f.startsWith(n)&&(f="0"+f);var l={minimumFractionDigits:s||0,maximumFractionDigits:20},d=r?new Intl.NumberFormat(r.locale,r.currency?En(En({},l),{style:"currency",currency:r.currency}):l):new Intl.NumberFormat(void 0,l),p=d.formatToParts(Number(f)),h=qLe(p,t),m=lee(h,En({},t)),y=e.slice(-1)===n?n:"",g=f.match(RegExp("\\d+\\.(\\d+)"))||[],v=g[1];return s===void 0&&v&&n&&(h.includes(n)?h=h.replace(RegExp("(\\d+)(".concat(Kl(n),")(\\d+)"),"g"),"$1$2".concat(v)):m&&!c?h=h.replace(m,"".concat(n).concat(v).concat(m)):h="".concat(h).concat(n).concat(v)),c&&y?"".concat(h).concat(y).concat(c):m&&y?h.replace(m,"".concat(y).concat(m)):m&&c?h.replace(m,"".concat(y).concat(c)):[h,y,c].join("")},VLe=function(t,e,n){var r=t;return e&&e!=="."&&(r=r.replace(RegExp(Kl(e),"g"),"."),n&&e==="-"&&(r="-".concat(r.slice(1)))),r},qLe=function(t,e){var n=e.prefix,r=e.groupSeparator,s=e.decimalSeparator,i=e.decimalScale,o=e.disableGroupSeparators,a=o===void 0?!1:o;return t.reduce(function(c,u,f){var l=u.type,d=u.value;return f===0&&n?l==="minusSign"?[d,n]:l==="currency"?no(no([],c,!0),[n],!1):[n,d]:l==="currency"?n?c:no(no([],c,!0),[d],!1):l==="group"?a?c:no(no([],c,!0),[r!==void 0?r:d],!1):l==="decimal"?i!==void 0&&i===0?c:no(no([],c,!0),[s!==void 0?s:d],!1):l==="fraction"?no(no([],c,!0),[i!==void 0?d.slice(0,i):d],!1):no(no([],c,!0),[d],!1)},[""]).join("")},WLe={currencySymbol:"",groupSeparator:"",decimalSeparator:"",prefix:"",suffix:""},GLe=function(t){var e=t||{},n=e.locale,r=e.currency,s=n?new Intl.NumberFormat(n,r?{currency:r,style:"currency"}:void 0):new Intl.NumberFormat;return s.formatToParts(1000.1).reduce(function(i,o,a){return o.type==="currency"?a===0?En(En({},i),{currencySymbol:o.value,prefix:o.value}):En(En({},i),{currencySymbol:o.value,suffix:o.value}):o.type==="group"?En(En({},i),{groupSeparator:o.value}):o.type==="decimal"?En(En({},i),{decimalSeparator:o.value}):i},WLe)},HU=function(t){return RegExp(/\d/,"gi").test(t)},KLe=function(t,e,n){if(e===void 0&&(e="."),n===void 0||t===""||t===void 0)return t;if(!t.match(/\d/g))return"";var r=t.split(e),s=r[0],i=r[1];if(n===0)return s;var o=i||"";if(o.length<n)for(;o.length<n;)o+="0";else o=o.slice(0,n);return"".concat(s).concat(e).concat(o)},YLe=function(t){var e=t.selectionStart,n=t.value,r=t.lastKeyStroke,s=t.stateValue,i=t.groupSeparator,o=e,a=n;if(s&&o){var c=n.split("");return r==="Backspace"&&s[o]===i&&(c.splice(o-1,1),o-=1),r==="Delete"&&s[o]===i&&(c.splice(o,1),o+=1),a=c.join(""),{modifiedValue:a,cursorPosition:o}}return{modifiedValue:a,cursorPosition:e}},kN=S.forwardRef(function(t,e){var n=t.allowDecimals,r=n===void 0?!0:n,s=t.allowNegativeValue,i=s===void 0?!0:s,o=t.id,a=t.name,c=t.className,u=t.customInput,f=t.decimalsLimit,l=t.defaultValue,d=t.disabled,p=d===void 0?!1:d,h=t.maxLength,m=t.value,y=t.onValueChange,g=t.fixedDecimalLength,v=t.placeholder,x=t.decimalScale,_=t.prefix,A=t.suffix,N=t.intlConfig,T=t.step,E=t.min,P=t.max,k=t.disableGroupSeparators,M=k===void 0?!1:k,I=t.disableAbbreviations,j=I===void 0?!1:I,L=t.decimalSeparator,H=t.groupSeparator,K=t.onChange,V=t.onFocus,U=t.onBlur,Q=t.onKeyDown,ne=t.onKeyUp,X=t.transformRawValue,G=t.formatValueOnBlur,Y=G===void 0?!0:G,Z=$Le(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(L&&HU(L))throw new Error("decimalSeparator cannot be a number");if(H&&HU(H))throw new Error("groupSeparator cannot be a number");var he=S.useMemo(function(){return GLe(N)},[N]),fe=L||he.decimalSeparator||"",ce=H||he.groupSeparator||"";if(fe&&ce&&fe===ce&&M===!1)throw new Error("decimalSeparator cannot be the same as groupSeparator");var xe={decimalSeparator:fe,groupSeparator:ce,disableGroupSeparators:M,intlConfig:N,prefix:_||he.prefix,suffix:A},Ne={decimalSeparator:fe,groupSeparator:ce,allowDecimals:r,decimalsLimit:f||g||2,allowNegativeValue:i,disableAbbreviations:j,prefix:_||he.prefix,transformRawValue:X},pe=S.useState(function(){return l!=null?Tb(En(En({},xe),{decimalScale:x,value:String(l)})):m!=null?Tb(En(En({},xe),{decimalScale:x,value:String(m)})):""}),Le=pe[0],Me=pe[1],Oe=S.useState(!1),Fe=Oe[0],ot=Oe[1],nt=S.useState(0),At=nt[0],ee=nt[1],de=S.useState(0),me=de[0],Re=de[1],Pe=S.useState(null),Ee=Pe[0],Ve=Pe[1],tt=S.useRef(null);S.useImperativeHandle(e,function(){return tt.current});var qt=function($e,Xe){ot(!0);var ht=YLe({selectionStart:Xe,value:$e,lastKeyStroke:Ee,stateValue:Le,groupSeparator:ce}),Ze=ht.modifiedValue,yt=ht.cursorPosition,Pt=eD(En({value:Ze},Ne));if(!(h&&Pt.replace(/-/g,"").length>h)){if(Pt===""||Pt==="-"||Pt===fe){y&&y(void 0,a,{float:null,formatted:"",value:""}),Me(Pt),ee(1);return}var St=fe?Pt.replace(fe,"."):Pt,Wt=parseFloat(St),Zt=Tb(En({value:Pt},xe));if(yt!=null){var ar=yt+(Zt.length-$e.length);ar=ar<=0?_?_.length:0:ar,ee(ar),Re(me+1)}if(Me(Zt),y){var Pn={float:Wt,formatted:Zt,value:Pt};y(Pt,a,Pn)}}},gt=function($e){var Xe=$e.target,ht=Xe.value,Ze=Xe.selectionStart;qt(ht,Ze),K&&K($e)},kt=function($e){return V&&V($e),Le?Le.length:0},ln=function($e){var Xe=$e.target.value,ht=eD(En({value:Xe},Ne));if(ht==="-"||ht===fe||!ht){Me(""),U&&U($e);return}var Ze=HLe(ht,fe,g),yt=KLe(Ze,fe,x!==void 0?x:g),Pt=parseFloat(yt.replace(fe,".")),St=Tb(En(En({},xe),{value:yt}));y&&Y&&y(yt,a,{float:Pt,formatted:St,value:yt}),Me(St),U&&U($e)},gr=function($e){var Xe=$e.key;if(Ve(Xe),T&&(Xe==="ArrowUp"||Xe==="ArrowDown")){$e.preventDefault(),ee(Le.length);var ht=parseFloat(m!=null?String(m).replace(fe,"."):eD(En({value:Le},Ne)))||0,Ze=Xe==="ArrowUp"?ht+T:ht-T;if(E!==void 0&&Ze<Number(E)||P!==void 0&&Ze>Number(P))return;var yt=String(T).includes(".")?Number(String(T).split(".")[1].length):void 0;qt(String(yt?Ze.toFixed(yt):Ze).replace(".",fe))}Q&&Q($e)},_n=function($e){var Xe=$e.key,ht=$e.currentTarget.selectionStart;if(Xe!=="ArrowUp"&&Xe!=="ArrowDown"&&Le!=="-"){var Ze=lee(Le,{groupSeparator:ce,decimalSeparator:fe});if(Ze&&ht&&ht>Le.length-Ze.length&&tt.current){var yt=Le.length-Ze.length;tt.current.setSelectionRange(yt,yt)}}ne&&ne($e)};S.useEffect(function(){m==null&&l==null&&Me("")},[l,m]),S.useEffect(function(){Fe&&Le!=="-"&&tt.current&&document.activeElement===tt.current&&tt.current.setSelectionRange(At,At)},[Le,At,tt,Fe,me]);var pi=function(){return m!=null&&Le!=="-"&&(!fe||Le!==fe)?Tb(En(En({},xe),{decimalScale:Fe?void 0:x,value:String(m)})):Le},or=En({type:"text",inputMode:"decimal",id:o,name:a,className:c,onChange:gt,onBlur:ln,onFocus:kt,onKeyDown:gr,onKeyUp:_n,placeholder:v,disabled:p,value:pi(),ref:tt},Z);if(u){var mi=u;return oe.createElement(mi,En({},or))}return oe.createElement("input",En({},or))});kN.displayName="CurrencyInput";const Qp=S.forwardRef(({children:t,...e},n)=>{var i;const{error:r}=ky();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=te("common.required_field"))),b.jsx(o9,{ref:n,...e,children:s})});Qp.displayName="FormErrorMessage";const Zp=oe.forwardRef(({label:t,hint:e,required:n,...r},s)=>{const{error:i}=ky(),o=e||(n?te("common.required"):void 0),a=i?"text-destructive font-semibold":"";return b.jsxs(i9,{ref:s,className:"flex justify-between text-sm",...r,children:[b.jsx("span",{className:`block font-semibold ${a}`,children:t}),o&&b.jsx("span",{className:`text-sm font-medium ${a} `,children:o})]})});Zp.displayName="FormLabel";const XLe=di("flex h-10 w-full rounded-md bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border border-input ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ",outline:"focus-visible:border focus-visible:border-input",ghost:"bg-transparent"}},defaultVariants:{variant:"default"}}),hC=S.forwardRef((t,e)=>{const{name:n,label:r,hint:s,description:i,placeholder:o,className:a,disabled:c,defaultValue:u,rules:f,readOnly:l,scale:d,currency:p,language:h,variant:m}=t,{control:y}=qi(),[g,v]=S.useState(""),x={input:_=>{if(typeof _!="object")return _;const A=Oi.create(_);if(A.isFailure)throw A.error;const N=A.object.toString();return g.endsWith(",")?N.replace(/.0$/,","):N},output:(_,A,N)=>{const{value:T}=N??{value:null};v(T??"");const E=Oi.createFromFormattedValue(T,p.code);if(E.isFailure)throw E.error;return E.object.toObject()}};return b.jsx(Ty,{defaultValue:u,control:y,name:n,disabled:c,rules:f,render:({field:_})=>b.jsxs(Kp,{ref:e,className:ie(a,"space-y-3"),children:[r&&b.jsx(Zp,{label:r,hint:s,required:!!((f==null?void 0:f.required)??!1)}),b.jsx(Yp,{children:b.jsx(kN,{intlConfig:{locale:h.code},name:_.name,onBlur:_.onBlur,disabled:_.disabled,readOnly:l,className:ie(XLe({variant:m,className:a})),suffix:` ${p==null?void 0:p.symbol}`,groupSeparator:".",decimalSeparator:",",placeholder:o,decimalsLimit:d,decimalScale:d,step:1,value:x.input(_.value),onValueChange:(A,N,T)=>_.onChange(x.output(A,N,T))})}),i&&b.jsx(Xp,{children:i}),b.jsx(Qp,{})]})})});hC.displayName="FormCurrencyField";const cee=S.forwardRef((t,e)=>{const{label:n,placeholder:r,hint:s,description:i,required:o,className:a,name:c}=t,{control:u}=qi(),[f,l]=S.useState(!1);return b.jsx(Ty,{control:u,name:c,rules:{required:o},render:({field:d})=>b.jsxs(Kp,{ref:e,className:ie(a,"flex flex-col"),children:[n&&b.jsx(Zp,{label:n,hint:s,required:o}),b.jsxs(zNe,{open:f,onOpenChange:l,children:[b.jsx(BNe,{asChild:!0,children:b.jsx(Yp,{children:b.jsxs(qe,{variant:"secondary",className:ie("pl-3 text-left font-normal",!d.value&&"text-muted-foreground"),children:[d.value?new Date(d.value).toLocaleDateString():r||b.jsx("span",{children:te("common.pick_date")}),b.jsx(kpe,{className:"w-4 h-4 ml-auto text-"})]})})}),b.jsx(CY,{className:"w-auto p-0",align:"start",children:b.jsx(JW,{className:"bg-background",mode:"single",captionLayout:"buttons",defaultMonth:d.value,selected:new Date(d.value),onSelect:p=>{d.onChange(p),l(!1)},disabled:p=>p<new Date("1980-01-01"),weekStartsOn:1,fixedWeeks:!0,fromYear:2024,toYear:new Date().getFullYear()+1,initialFocus:!0})})]}),i&&b.jsx(Xp,{children:i}),b.jsx(Qp,{})]})})}),tA=oe.forwardRef(({className:t,title:e,description:n,actions:r,footerActions:s,children:i},o)=>{const a=oe.useId(),c=S.useMemo(()=>e||n||r,[e,n,r]);return b.jsxs(xr,{id:a,className:ie(c?"":"pt-6",t),ref:o,children:[c&&b.jsxs(Ni,{className:"flex flex-row flex-wrap items-center justify-between sm:flex-nowrap",children:[b.jsxs("div",{children:[e&&b.jsx(ns,{className:"text-lg leading-normal",children:e}),n&&b.jsx(ys,{className:"leading-loose",children:n})]}),r&&b.jsx("div",{className:"flex-shrink-0",children:r})]}),b.jsx(wr,{className:"grid items-start gap-6",children:i}),s&&b.jsx(Yo,{className:"px-6 py-4 border-t",style:{borderStyle:"inherit"},children:s})]})});tA.displayName="FormGroup";const QLe=di("flex h-10 w-full rounded-md bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border border-input ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ",outline:"focus-visible:border focus-visible:border-input"}},defaultVariants:{variant:"default"}}),nA=S.forwardRef((t,e)=>{const{name:n,label:r,hint:s,description:i,placeholder:o,className:a,disabled:c,defaultValue:u,rules:f,readOnly:l,scale:d,variant:p}=t,{control:h}=qi(),[m,y]=S.useState(""),g={input:v=>{if(typeof v!="object")return v;const x=of.create(v);if(x.isFailure)throw x.error;const _=x.object.toString();return m.endsWith(",")?_.replace(/.0$/,","):_},output:(v,x,_)=>{const{value:A}=_??{value:null};y(A??"");const N=of.createFromFormattedValue(A);if(N.isFailure)throw N.error;return N.object.toObject()}};return b.jsx(Ty,{defaultValue:u,control:h,name:n,disabled:c,rules:{max:100,min:0,...f},render:({field:v})=>b.jsxs(Kp,{ref:e,className:ie(a,"space-y-3"),children:[r&&b.jsx(Zp,{label:r,hint:s,required:!!((f==null?void 0:f.required)??!1)}),b.jsx(Yp,{children:b.jsx(kN,{name:v.name,onBlur:v.onBlur,disabled:v.disabled,readOnly:l,className:ie(QLe({variant:p,className:a})),groupSeparator:".",decimalSeparator:",",placeholder:o,allowDecimals:d!==0,decimalsLimit:d,decimalScale:d,step:1,value:g.input(v.value),onValueChange:(x,_,A)=>v.onChange(g.output(x,_,A))})}),i&&b.jsx(Xp,{children:i}),b.jsx(Qp,{})]})})}),ZLe=di("flex h-10 w-full rounded-md bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border border-input ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ",outline:"focus-visible:border focus-visible:border-input"}},defaultVariants:{variant:"default"}}),JLe=S.forwardRef((t,e)=>{const{name:n,label:r,hint:s,description:i,placeholder:o,className:a,disabled:c,defaultValue:u,rules:f,readOnly:l,scale:d,variant:p}=t,{control:h}=qi(),[m,y]=S.useState(""),g={input:v=>{if(typeof v!="object")return v;const x=af.create(v);if(x.isFailure)throw x.error;const _=x.object.toString();return m.endsWith(",")?_.replace(/.0$/,","):_},output:(v,x,_)=>{const{value:A}=_??{value:null};y(A??"");const N=af.createFromFormattedValue(A);if(N.isFailure)throw N.error;return N.object.toObject()}};return b.jsx(Ty,{defaultValue:u,control:h,name:n,disabled:c,rules:f,render:({field:v})=>b.jsxs(Kp,{ref:e,className:ie(a,"space-y-3"),children:[r&&b.jsx(Zp,{label:r,hint:s,required:!!((f==null?void 0:f.required)??!1)}),b.jsx(Yp,{children:b.jsx(kN,{name:v.name,onBlur:v.onBlur,disabled:v.disabled,readOnly:l,className:ie(ZLe({variant:p,className:a})),groupSeparator:".",decimalSeparator:",",placeholder:o,allowDecimals:d!==0,decimalsLimit:d,decimalScale:d,step:1,value:g.input(v.value),onValueChange:(x,_,A)=>v.onChange(g.output(x,_,A))})}),i&&b.jsx(Xp,{children:i}),b.jsx(Qp,{})]})})}),VU=di("",{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"}}),Ba=S.forwardRef(({name:t,label:e,hint:n,placeholder:r,description:s,required:i,className:o,autoSize:a,variant:c,...u},f)=>{const{control:l}=qi();return b.jsx(Ty,{control:l,name:t,rules:{required:i},render:({field:d,fieldState:p})=>b.jsxs(Kp,{ref:f,className:ie(o,"flex flex-col space-y-3"),children:[e&&b.jsx(Zp,{label:e,hint:n,required:i}),b.jsx(Yp,{className:"grow",children:a?b.jsx(CW,{placeholder:r,className:ie(p.error?"border-destructive focus-visible:ring-destructive":"","resize-y",VU({variant:c,className:o})),...u,...d}):b.jsx(qQ,{placeholder:r,className:ie(p.error?"border-destructive focus-visible:ring-destructive":"","resize-y",VU({variant:c,className:o})),...u,...d})}),s&&b.jsx(Xp,{children:s}),b.jsx(Qp,{})]})})}),e2e=di("",{variants:{variant:{default:"",ghost:"border-0 focus-visible:border focus-visible:border-input focus-visible:ring-0 focus-visible:ring-offset-0 "}},defaultVariants:{variant:"default"}}),sh=S.forwardRef((t,e)=>{const{name:n,label:r,hint:s,description:i,placeholder:o,className:a,disabled:c,defaultValue:u,rules:f,type:l,variant:d,required:p,button:h,leadIcon:m,trailIcon:y}=t,{control:g}=qi();return b.jsx(Ty,{defaultValue:u,control:g,name:n,disabled:c,rules:{required:p,...f},render:({field:v,fieldState:x})=>b.jsxs(Kp,{ref:e,className:ie(a,"space-y-3"),children:[r&&b.jsx(Zp,{label:r,hint:s,required:!!((f==null?void 0:f.required)??p)}),b.jsxs("div",{className:ie(h?"flex":null),children:[b.jsxs("div",{className:ie(m?"relative flex items-stretch flex-grow focus-within:z-10":""),children:[m&&b.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:S.createElement(m,{className:"h-5 w-5 text-muted-foreground","aria-hidden":!0},null)}),b.jsx(Yp,{className:ie("block",m?"pl-10":"",y?"pr-10":""),children:b.jsx(F_,{type:l,placeholder:o,className:ie(x.error?"border-destructive focus-visible:ring-destructive":"",e2e({variant:d,className:a})),...v})}),y&&b.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pl-3 pointer-events-none",children:S.createElement(y,{className:"h-5 w-5 text-muted-foreground","aria-hidden":!0},null)})]}),h&&b.jsx(b.Fragment,{children:S.createElement(h)})]}),i&&b.jsx(Xp,{children:i}),b.jsx(Qp,{})]})})}),zy=({className:t,children:e})=>b.jsx(Une,{children:b.jsx("div",{className:ie("flex flex-col w-full min-h-screen",t),children:e})});zy.displayName="Layout";const By=({className:t,children:e})=>b.jsxs(b.Fragment,{children:[b.jsx("main",{className:ie("flex min-h-[calc(100vh_-_theme(spacing.36))] flex-1 flex-col gap-4 bg-muted/40 p-4 md:gap-8 md:p-10",t),children:e}),b.jsx(gZ,{})]});By.displayName="LayoutContent";const qU=(t,e,n)=>{if(t&&"reportValidity"in t){const r=Ie(n,e);t.setCustomValidity(r&&r.message||""),t.reportValidity()}},uee=(t,e)=>{for(const n in e.fields){const r=e.fields[n];r&&r.ref&&"reportValidity"in r.ref?qU(r.ref,n,t):r.refs&&r.refs.forEach(s=>qU(s,n,t))}},t2e=(t,e)=>{e.shouldUseNativeValidation&&uee(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(n2e(e.names||Object.keys(t),r)){const o=Object.assign({},Ie(n,r));sn(o,"root",i),sn(n,r,o)}else sn(n,r,i)}return n},n2e=(t,e)=>t.some(n=>n.startsWith(e+"."));var q$=function(t,e,n){return e===void 0&&(e={abortEarly:!1}),n===void 0&&(n={}),function(r,s,i){try{var o=function(){return c.error?{values:{},errors:t2e((f=c.error,l=!i.shouldUseNativeValidation&&i.criteriaMode==="all",f.details.length?f.details.reduce(function(d,p){var h=p.path.join(".");if(d[h]||(d[h]={message:p.message,type:p.type}),l){var m=d[h].types,y=m&&m[p.type];d[h]=GK(h,l,d,p.type,y?[].concat(y,p.message):p.message)}return d},{}):{}),i)}:(i.shouldUseNativeValidation&&uee({},i),{errors:{},values:c.value});var f,l},a=Object.assign({},e,{context:s}),c={},u=function(){if(n.mode==="sync")c=t.validate(r,a);else{var f=function(l,d){try{var p=l()}catch(h){return d(h)}return p&&p.then?p.then(void 0,d):p}(function(){return Promise.resolve(t.validateAsync(r,a)).then(function(l){c.value=l})},function(l){c.error=l});if(f&&f.then)return f.then(function(){})}}();return Promise.resolve(u&&u.then?u.then(o):o())}catch(f){return Promise.reject(f)}}},dee={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(self,()=>{return n={7629:(s,i,o)=>{const a=o(375),c=o(8571),u=o(9474),f=o(1687),l=o(8652),d=o(8160),p=o(3292),h=o(6354),m=o(8901),y=o(9708),g=o(6914),v=o(2294),x=o(6133),_=o(1152),A=o(8863),N=o(2036),T={Base:class{constructor(E){this.type=E,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new v.Ids,this._preferences=null,this._refs=new x.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return a(typeof y.describe=="function","Manifest functionality disabled"),y.describe(this)}allow(...E){return d.verifyFlat(E,"allow"),this._values(E,"_valids")}alter(E){a(E&&typeof E=="object"&&!Array.isArray(E),"Invalid targets argument"),a(!this._inRuleset(),"Cannot set alterations inside a ruleset");const P=this.clone();P.$_terms.alterations=P.$_terms.alterations||[];for(const k in E){const M=E[k];a(typeof M=="function","Alteration adjuster for",k,"must be a function"),P.$_terms.alterations.push({target:k,adjuster:M})}return P.$_temp.ruleset=!1,P}artifact(E){return a(E!==void 0,"Artifact cannot be undefined"),a(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",E)}cast(E){return a(E===!1||typeof E=="string","Invalid to value"),a(E===!1||this._definition.cast[E],"Type",this.type,"does not support casting to",E),this.$_setFlag("cast",E===!1?void 0:E)}default(E,P){return this._default("default",E,P)}description(E){return a(E&&typeof E=="string","Description must be a non-empty string"),this.$_setFlag("description",E)}empty(E){const P=this.clone();return E!==void 0&&(E=P.$_compile(E,{override:!1})),P.$_setFlag("empty",E,{clone:!1})}error(E){return a(E,"Missing error"),a(E instanceof Error||typeof E=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",E)}example(E,P={}){return a(E!==void 0,"Missing example"),d.assertOptions(P,["override"]),this._inner("examples",E,{single:!0,override:P.override})}external(E,P){return typeof E=="object"&&(a(!P,"Cannot combine options with description"),P=E.description,E=E.method),a(typeof E=="function","Method must be a function"),a(P===void 0||P&&typeof P=="string","Description must be a non-empty string"),this._inner("externals",{method:E,description:P},{single:!0})}failover(E,P){return this._default("failover",E,P)}forbidden(){return this.presence("forbidden")}id(E){return E?(a(typeof E=="string","id must be a non-empty string"),a(/^[^\.]+$/.test(E),"id cannot contain period character"),this.$_setFlag("id",E)):this.$_setFlag("id",void 0)}invalid(...E){return this._values(E,"_invalids")}label(E){return a(E&&typeof E=="string","Label name must be a non-empty string"),this.$_setFlag("label",E)}meta(E){return a(E!==void 0,"Meta cannot be undefined"),this._inner("metas",E,{single:!0})}note(...E){a(E.length,"Missing notes");for(const P of E)a(P&&typeof P=="string","Notes must be non-empty strings");return this._inner("notes",E)}only(E=!0){return a(typeof E=="boolean","Invalid mode:",E),this.$_setFlag("only",E)}optional(){return this.presence("optional")}prefs(E){a(E,"Missing preferences"),a(E.context===void 0,"Cannot override context"),a(E.externals===void 0,"Cannot override externals"),a(E.warnings===void 0,"Cannot override warnings"),a(E.debug===void 0,"Cannot override debug"),d.checkPreferences(E);const P=this.clone();return P._preferences=d.preferences(P._preferences,E),P}presence(E){return a(["optional","required","forbidden"].includes(E),"Unknown presence mode",E),this.$_setFlag("presence",E)}raw(E=!0){return this.$_setFlag("result",E?"raw":void 0)}result(E){return a(["raw","strip"].includes(E),"Unknown result mode",E),this.$_setFlag("result",E)}required(){return this.presence("required")}strict(E){const P=this.clone(),k=E!==void 0&&!E;return P._preferences=d.preferences(P._preferences,{convert:k}),P}strip(E=!0){return this.$_setFlag("result",E?"strip":void 0)}tag(...E){a(E.length,"Missing tags");for(const P of E)a(P&&typeof P=="string","Tags must be non-empty strings");return this._inner("tags",E)}unit(E){return a(E&&typeof E=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",E)}valid(...E){d.verifyFlat(E,"valid");const P=this.allow(...E);return P.$_setFlag("only",!!P._valids,{clone:!1}),P}when(E,P){const k=this.clone();k.$_terms.whens||(k.$_terms.whens=[]);const M=p.when(k,E,P);if(!["any","link"].includes(k.type)){const I=M.is?[M]:M.switch;for(const j of I)a(!j.then||j.then.type==="any"||j.then.type===k.type,"Cannot combine",k.type,"with",j.then&&j.then.type),a(!j.otherwise||j.otherwise.type==="any"||j.otherwise.type===k.type,"Cannot combine",k.type,"with",j.otherwise&&j.otherwise.type)}return k.$_terms.whens.push(M),k.$_mutateRebuild()}cache(E){a(!this._inRuleset(),"Cannot set caching inside a ruleset"),a(!this._cache,"Cannot override schema cache"),a(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const P=this.clone();return P._cache=E||l.provider.provision(),P.$_temp.ruleset=!1,P}clone(){const E=Object.create(Object.getPrototypeOf(this));return this._assign(E)}concat(E){a(d.isSchema(E),"Invalid schema object"),a(this.type==="any"||E.type==="any"||E.type===this.type,"Cannot merge type",this.type,"with another type:",E.type),a(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),a(!E._inRuleset(),"Cannot concatenate a schema with open ruleset");let P=this.clone();if(this.type==="any"&&E.type!=="any"){const k=E.clone();for(const M of Object.keys(P))M!=="type"&&(k[M]=P[M]);P=k}P._ids.concat(E._ids),P._refs.register(E,x.toSibling),P._preferences=P._preferences?d.preferences(P._preferences,E._preferences):E._preferences,P._valids=N.merge(P._valids,E._valids,E._invalids),P._invalids=N.merge(P._invalids,E._invalids,E._valids);for(const k of E._singleRules.keys())P._singleRules.has(k)&&(P._rules=P._rules.filter(M=>M.keep||M.name!==k),P._singleRules.delete(k));for(const k of E._rules)E._definition.rules[k.method].multi||P._singleRules.set(k.name,k),P._rules.push(k);if(P._flags.empty&&E._flags.empty){P._flags.empty=P._flags.empty.concat(E._flags.empty);const k=Object.assign({},E._flags);delete k.empty,f(P._flags,k)}else if(E._flags.empty){P._flags.empty=E._flags.empty;const k=Object.assign({},E._flags);delete k.empty,f(P._flags,k)}else f(P._flags,E._flags);for(const k in E.$_terms){const M=E.$_terms[k];M?P.$_terms[k]?P.$_terms[k]=P.$_terms[k].concat(M):P.$_terms[k]=M.slice():P.$_terms[k]||(P.$_terms[k]=M)}return this.$_root._tracer&&this.$_root._tracer._combine(P,[this,E]),P.$_mutateRebuild()}extend(E){return a(!E.base,"Cannot extend type with another base"),m.type(this,E)}extract(E){return E=Array.isArray(E)?E:E.split("."),this._ids.reach(E)}fork(E,P){a(!this._inRuleset(),"Cannot fork inside a ruleset");let k=this;for(let M of[].concat(E))M=Array.isArray(M)?M:M.split("."),k=k._ids.fork(M,P,k);return k.$_temp.ruleset=!1,k}rule(E){const P=this._definition;d.assertOptions(E,Object.keys(P.modifiers)),a(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const k=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;a(k>=0&&k<this._rules.length,"Cannot apply rules to empty ruleset");const M=this.clone();for(let I=k;I<M._rules.length;++I){const j=M._rules[I],L=c(j);for(const H in E)P.modifiers[H](L,E[H]),a(L.name===j.name,"Cannot change rule name");M._rules[I]=L,M._singleRules.get(L.name)===j&&M._singleRules.set(L.name,L)}return M.$_temp.ruleset=!1,M.$_mutateRebuild()}get ruleset(){a(!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),a(!this._inRuleset(),"Cannot tailor inside a ruleset");let P=this;if(this.$_terms.alterations)for(const{target:k,adjuster:M}of this.$_terms.alterations)E.includes(k)&&(P=M(P),a(d.isSchema(P),"Alteration adjuster for",k,"failed to return a schema object"));return P=P.$_modify({each:k=>k.tailor(E),ref:!1}),P.$_temp.ruleset=!1,P.$_mutateRebuild()}tracer(){return _.location?_.location(this):this}validate(E,P){return A.entry(E,this,P)}validateAsync(E,P){return A.entryAsync(E,this,P)}$_addRule(E){typeof E=="string"&&(E={name:E}),a(E&&typeof E=="object","Invalid options"),a(E.name&&typeof E.name=="string","Invalid rule name");for(const j in E)a(j[0]!=="_","Cannot set private rule properties");const P=Object.assign({},E);P._resolve=[],P.method=P.method||P.name;const k=this._definition.rules[P.method],M=P.args;a(k,"Unknown rule",P.method);const I=this.clone();if(M){a(Object.keys(M).length===1||Object.keys(M).length===this._definition.rules[P.name].args.length,"Invalid rule definition for",this.type,P.name);for(const j in M){let L=M[j];if(k.argsByName){const H=k.argsByName.get(j);if(H.ref&&d.isResolvable(L))P._resolve.push(j),I.$_mutateRegister(L);else if(H.normalize&&(L=H.normalize(L),M[j]=L),H.assert){const K=d.validateArg(L,j,H);a(!K,K,"or reference")}}L!==void 0?M[j]=L:delete M[j]}}return k.multi||(I._ruleRemove(P.name,{clone:!1}),I._singleRules.set(P.name,P)),I.$_temp.ruleset===!1&&(I.$_temp.ruleset=null),k.priority?I._rules.unshift(P):I._rules.push(P),I}$_compile(E,P){return p.schema(this.$_root,E,P)}$_createError(E,P,k,M,I,j={}){const L=j.flags!==!1?this._flags:{},H=j.messages?g.merge(this._definition.messages,j.messages):this._definition.messages;return new h.Report(E,P,k,L,H,M,I)}$_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,P,k,M){(k=Object.assign({},k)).abortEarly=!0,k._externals=!1,P.snapshot();const I=!A.validate(E,this,P,k,M).errors;return P.restore(),I}$_modify(E){return d.assertOptions(E,["each","once","ref","schema"]),v.schema(this,E)||this}$_mutateRebuild(){return a(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(E,{source:P,name:k,path:M,key:I})=>{const j=this._definition[P][k]&&this._definition[P][k].register;j!==!1&&this.$_mutateRegister(E,{family:j,key:I})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(E,{family:P,key:k}={}){this._refs.register(E,P),this._ids.register(E,{key:k})}$_property(E){return this._definition.properties[E]}$_reach(E){return this._ids.reach(E)}$_rootReferences(){return this._refs.roots()}$_setFlag(E,P,k={}){a(E[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const M=this._definition.flags[E]||{};if(u(P,M.default)&&(P=void 0),u(P,this._flags[E]))return this;const I=k.clone!==!1?this.clone():this;return P!==void 0?(I._flags[E]=P,I.$_mutateRegister(P)):delete I._flags[E],E[0]!=="_"&&(I.$_temp.ruleset=!1),I}$_parent(E,...P){return this[E][d.symbols.parent].call(this,...P)}$_validate(E,P,k){return A.validate(E,this,P,k)}_assign(E){E.type=this.type,E.$_root=this.$_root,E.$_temp=Object.assign({},this.$_temp),E.$_temp.whens={},E._ids=this._ids.clone(),E._preferences=this._preferences,E._valids=this._valids&&this._valids.clone(),E._invalids=this._invalids&&this._invalids.clone(),E._rules=this._rules.slice(),E._singleRules=c(this._singleRules,{shallow:!0}),E._refs=this._refs.clone(),E._flags=Object.assign({},this._flags),E._cache=null,E.$_terms={};for(const P in this.$_terms)E.$_terms[P]=this.$_terms[P]?this.$_terms[P].slice():null;E.$_super={};for(const P in this.$_super)E.$_super[P]=this._super[P].bind(E);return E}_bare(){const E=this.clone();E._reset();const P=E._definition.terms;for(const k in P){const M=P[k];E.$_terms[k]=M.init}return E.$_mutateRebuild()}_default(E,P,k={}){return d.assertOptions(k,"literal"),a(P!==void 0,"Missing",E,"value"),a(typeof P=="function"||!k.literal,"Only function value supports literal option"),typeof P=="function"&&k.literal&&(P={[d.symbols.literal]:!0,literal:P}),this.$_setFlag(E,P)}_generate(E,P,k){if(!this.$_terms.whens)return{schema:this};const M=[],I=[];for(let H=0;H<this.$_terms.whens.length;++H){const K=this.$_terms.whens[H];if(K.concat){M.push(K.concat),I.push(`${H}.concat`);continue}const V=K.ref?K.ref.resolve(E,P,k):E,U=K.is?[K]:K.switch,Q=I.length;for(let ne=0;ne<U.length;++ne){const{is:X,then:G,otherwise:Y}=U[ne],Z=`${H}${K.switch?"."+ne:""}`;if(X.$_match(V,P.nest(X,`${Z}.is`),k)){if(G){const he=P.localize([...P.path,`${Z}.then`],P.ancestors,P.schemas),{schema:fe,id:ce}=G._generate(E,he,k);M.push(fe),I.push(`${Z}.then${ce?`(${ce})`:""}`);break}}else if(Y){const he=P.localize([...P.path,`${Z}.otherwise`],P.ancestors,P.schemas),{schema:fe,id:ce}=Y._generate(E,he,k);M.push(fe),I.push(`${Z}.otherwise${ce?`(${ce})`:""}`);break}}if(K.break&&I.length>Q)break}const j=I.join(", ");if(P.mainstay.tracer.debug(P,"rule","when",j),!j)return{schema:this};if(!P.mainstay.tracer.active&&this.$_temp.whens[j])return{schema:this.$_temp.whens[j],id:j};let L=this;this._definition.generate&&(L=this._definition.generate(this,E,P,k));for(const H of M)L=L.concat(H);return this.$_root._tracer&&this.$_root._tracer._combine(L,[this,...M]),this.$_temp.whens[j]=L,{schema:L,id:j}}_inner(E,P,k={}){a(!this._inRuleset(),`Cannot set ${E} inside a ruleset`);const M=this.clone();return M.$_terms[E]&&!k.override||(M.$_terms[E]=[]),k.single?M.$_terms[E].push(P):M.$_terms[E].push(...P),M.$_temp.ruleset=!1,M}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(E,P={}){if(!this._singleRules.has(E))return this;const k=P.clone!==!1?this.clone():this;k._singleRules.delete(E);const M=[];for(let I=0;I<k._rules.length;++I){const j=k._rules[I];j.name!==E||j.keep?M.push(j):k._inRuleset()&&I<k.$_temp.ruleset&&--k.$_temp.ruleset}return k._rules=M,k}_values(E,P){d.verifyFlat(E,P.slice(1,-1));const k=this.clone(),M=E[0]===d.symbols.override;if(M&&(E=E.slice(1)),!k[P]&&E.length?k[P]=new N:M&&(k[P]=E.length?new N:null,k.$_mutateRebuild()),!k[P])return k;M&&k[P].override();for(const I of E){a(I!==void 0,"Cannot call allow/valid/invalid with undefined"),a(I!==d.symbols.override,"Override must be the first value");const j=P==="_invalids"?"_valids":"_invalids";k[j]&&(k[j].remove(I),k[j].length||(a(P==="_valids"||!k._flags.only,"Setting invalid value",I,"leaves schema rejecting all values due to previous valid rule"),k[j]=null)),k[P].add(I,k._refs)}return k}}};T.Base.prototype[d.symbols.any]={version:d.version,compile:p.compile,root:"$_root"},T.Base.prototype.isImmutable=!0,T.Base.prototype.deny=T.Base.prototype.invalid,T.Base.prototype.disallow=T.Base.prototype.invalid,T.Base.prototype.equal=T.Base.prototype.valid,T.Base.prototype.exist=T.Base.prototype.required,T.Base.prototype.not=T.Base.prototype.invalid,T.Base.prototype.options=T.Base.prototype.prefs,T.Base.prototype.preferences=T.Base.prototype.prefs,s.exports=new T.Base},8652:(s,i,o)=>{const a=o(375),c=o(8571),u=o(8160),f={max:1e3,supported:new Set(["undefined","boolean","number","string"])};i.provider={provision:l=>new f.Cache(l)},f.Cache=class{constructor(l={}){u.assertOptions(l,["max"]),a(l.max===void 0||l.max&&l.max>0&&isFinite(l.max),"Invalid max cache size"),this._max=l.max||f.max,this._map=new Map,this._list=new f.List}get length(){return this._map.size}set(l,d){if(l!==null&&!f.supported.has(typeof l))return;let p=this._map.get(l);if(p)return p.value=d,void this._list.first(p);p=this._list.unshift({key:l,value:d}),this._map.set(l,p),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:p}=l;return d.prev=p,p&&(p.next=d),l===this.tail&&(this.tail=d),l.prev=null,l.next=null,l}}},8160:(s,i,o)=>{const a=o(375),c=o(7916),u=o(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(p,h,m="Options"){a(p&&typeof p=="object"&&!Array.isArray(p),"Options must be of type object");const y=Object.keys(p).filter(g=>!h.includes(g));a(y.length===0,`${m} contain unknown keys: ${y}`)},i.checkPreferences=function(p){l=l||o(3378);const h=l.preferences.validate(p);if(h.error)throw new c([h.error.details[0].message])},i.compare=function(p,h,m){switch(m){case"=":return p===h;case">":return p>h;case"<":return p<h;case">=":return p>=h;case"<=":return p<=h}},i.default=function(p,h){return p===void 0?h:p},i.isIsoDate=function(p){return d.isoDate.test(p)},i.isNumber=function(p){return typeof p=="number"&&!isNaN(p)},i.isResolvable=function(p){return!!p&&(p[i.symbols.ref]||p[i.symbols.template])},i.isSchema=function(p,h={}){const m=p&&p[i.symbols.any];return!!m&&(a(h.legacy||m.version===i.version,"Cannot mix different versions of joi schemas"),!0)},i.isValues=function(p){return p[i.symbols.values]},i.limit=function(p){return Number.isSafeInteger(p)&&p>=0},i.preferences=function(p,h){f=f||o(6914),p=p||{},h=h||{};const m=Object.assign({},p,h);return h.errors&&p.errors&&(m.errors=Object.assign({},p.errors,h.errors),m.errors.wrap=Object.assign({},p.errors.wrap,h.errors.wrap)),h.messages&&(m.messages=f.compile(h.messages,p.messages)),delete m[i.symbols.prefs],m},i.tryWithPath=function(p,h,m={}){try{return p()}catch(y){throw y.path!==void 0?y.path=h+"."+y.path:y.path=h,m.append&&(y.message=`${y.message} (${y.path})`),y}},i.validateArg=function(p,h,{assert:m,message:y}){if(i.isSchema(m)){const g=m.validate(p);return g.error?g.error.message:void 0}if(!m(p))return h?`${h} ${y}`:y},i.verifyFlat=function(p,h){for(const m of p)a(!Array.isArray(m),"Method no longer accepts array arguments:",h)}},3292:(s,i,o)=>{const a=o(375),c=o(8160),u=o(6133),f={};i.schema=function(l,d,p={}){c.assertOptions(p,["appendPath","override"]);try{return f.schema(l,d,p)}catch(h){throw p.appendPath&&h.path!==void 0&&(h.message=`${h.message} (${h.path})`),h}},f.schema=function(l,d,p){a(d!==void 0,"Invalid undefined schema"),Array.isArray(d)&&(a(d.length,"Invalid empty array schema"),d.length===1&&(d=d[0]));const h=(m,...y)=>p.override!==!1?m.valid(l.override,...y):m.valid(...y);if(f.simple(d))return h(l,d);if(typeof d=="function")return l.custom(d);if(a(typeof d=="object","Invalid schema content:",typeof d),c.isResolvable(d))return h(l,d);if(c.isSchema(d))return d;if(Array.isArray(d)){for(const m of d)if(!f.simple(m))return l.alternatives().try(...d);return h(l,...d)}return d instanceof RegExp?l.string().regex(d):d instanceof Date?h(l.date(),d):(a(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,p={}){c.assertOptions(p,["legacy"]);const h=d&&d[c.symbols.any];if(h)return a(p.legacy||h.version===c.version,"Cannot mix different versions of joi schemas:",h.version,c.version),d;if(typeof d!="object"||!p.legacy)return i.schema(l,d,{appendPath:!0});const m=f.walk(d);return m?m.compile(m.root,d):i.schema(l,d,{appendPath:!0})},f.walk=function(l){if(typeof l!="object")return null;if(Array.isArray(l)){for(const p of l){const h=f.walk(p);if(h)return h}return null}const d=l[c.symbols.any];if(d)return{root:l[d.root],compile:d.compile};a(Object.getPrototypeOf(l)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const p in l){const h=f.walk(l[p]);if(h)return h}return null},f.simple=function(l){return l===null||["boolean","string","number"].includes(typeof l)},i.when=function(l,d,p){if(p===void 0&&(a(d&&typeof d=="object","Missing options"),p=d,d=u.create(".")),Array.isArray(p)&&(p={switch:p}),c.assertOptions(p,["is","not","then","otherwise","switch","break"]),c.isSchema(d))return a(p.is===void 0,'"is" can not be used with a schema condition'),a(p.not===void 0,'"not" can not be used with a schema condition'),a(p.switch===void 0,'"switch" can not be used with a schema condition'),f.condition(l,{is:d,then:p.then,otherwise:p.otherwise,break:p.break});if(a(u.isRef(d)||typeof d=="string","Invalid condition:",d),a(p.not===void 0||p.is===void 0,'Cannot combine "is" with "not"'),p.switch===void 0){let m=p;p.not!==void 0&&(m={is:p.not,then:p.otherwise,otherwise:p.then,break:p.break});let y=m.is!==void 0?l.$_compile(m.is):l.$_root.invalid(null,!1,0,"").required();return a(m.then!==void 0||m.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),a(m.break===void 0||m.then===void 0||m.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),p.is===void 0||u.isRef(p.is)||c.isSchema(p.is)||(y=y.required()),f.condition(l,{ref:i.ref(d),is:y,then:m.then,otherwise:m.otherwise,break:m.break})}a(Array.isArray(p.switch),'"switch" must be an array'),a(p.is===void 0,'Cannot combine "switch" with "is"'),a(p.not===void 0,'Cannot combine "switch" with "not"'),a(p.then===void 0,'Cannot combine "switch" with "then"');const h={ref:i.ref(d),switch:[],break:p.break};for(let m=0;m<p.switch.length;++m){const y=p.switch[m],g=m===p.switch.length-1;c.assertOptions(y,g?["is","then","otherwise"]:["is","then"]),a(y.is!==void 0,'Switch statement missing "is"'),a(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){a(p.otherwise===void 0||y.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');const x=p.otherwise!==void 0?p.otherwise:y.otherwise;x!==void 0&&(a(h.break===void 0,"Cannot specify both otherwise and break"),v.otherwise=l.$_compile(x))}h.switch.push(v)}return h},f.condition=function(l,d){for(const p of["then","otherwise"])d[p]===void 0?delete d[p]:d[p]=l.$_compile(d[p]);return d}},6354:(s,i,o)=>{const a=o(5688),c=o(8160),u=o(3328);i.Report=class{constructor(f,l,d,p,h,m,y){if(this.code=f,this.flags=p,this.messages=h,this.path=m.path,this.prefs=y,this.state=m,this.value=l,this.message=null,this.template=null,this.local=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,p,h){if(!l)return;if(u.isTemplate(l))return d!=="root"?l:null;let m=h.errors.language;if(c.isResolvable(m)&&(m=m.resolve(f,p,h)),m&&l[m]){if(l[m][d]!==void 0)return l[m][d];if(l[m]["*"]!==void 0)return l[m]["*"]}return l[d]?l[d]:l["*"]},i.label=function(f,l,d,p){if(!d.errors.label)return"";if(f.label)return f.label;let h=l.path;return d.errors.label==="key"&&l.path.length>1&&(h=l.path.slice(-1)),i.path(h)||i.template(null,d.messages,"root",l,d)||p&&i.template(null,p,"root",l,d)||"value"},i.process=function(f,l,d){if(!f)return null;const{override:p,message:h,details:m}=i.details(f);if(p)return p;if(d.errors.stack)return new i.ValidationError(h,m,l);const y=Error.stackTraceLimit;Error.stackTraceLimit=0;const g=new i.ValidationError(h,m,l);return Error.stackTraceLimit=y,g},i.details=function(f,l={}){let d=[];const p=[];for(const h of f){if(h instanceof Error){if(l.override!==!1)return{override:h};const y=h.toString();d.push(y),p.push({message:y,type:"override",context:{error:h}});continue}const m=h.toString();d.push(m),p.push({message:m,path:h.path.filter(y=>typeof y!="object"),type:h.code,context:h.local})}return d.length>1&&(d=[...new Set(d)]),{message:d.join(". "),details:p}},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=a.error},8901:(s,i,o)=>{const a=o(375),c=o(8571),u=o(8160),f=o(6914),l={};i.type=function(d,p){const h=Object.getPrototypeOf(d),m=c(h),y=d._assign(Object.create(m)),g=Object.assign({},p);delete g.base,m._definition=g;const v=h._definition||{};g.messages=f.merge(v.messages,g.messages),g.properties=Object.assign({},v.properties,g.properties),y.type=g.type,g.flags=Object.assign({},v.flags,g.flags);const x=Object.assign({},v.terms);if(g.terms)for(const T in g.terms){const E=g.terms[T];a(y.$_terms[T]===void 0,"Invalid term override for",g.type,T),y.$_terms[T]=E.init,x[T]=E}g.terms=x,g.args||(g.args=v.args),g.prepare=l.prepare(g.prepare,v.prepare),g.coerce&&(typeof g.coerce=="function"&&(g.coerce={method:g.coerce}),g.coerce.from&&!Array.isArray(g.coerce.from)&&(g.coerce={method:g.coerce.method,from:[].concat(g.coerce.from)})),g.coerce=l.coerce(g.coerce,v.coerce),g.validate=l.validate(g.validate,v.validate);const _=Object.assign({},v.rules);if(g.rules)for(const T in g.rules){const E=g.rules[T];a(typeof E=="object","Invalid rule definition for",g.type,T);let P=E.method;if(P===void 0&&(P=function(){return this.$_addRule(T)}),P&&(a(!m[T],"Rule conflict in",g.type,T),m[T]=P),a(!_[T],"Rule conflict in",g.type,T),_[T]=E,E.alias){const k=[].concat(E.alias);for(const M of k)m[M]=E.method}E.args&&(E.argsByName=new Map,E.args=E.args.map(k=>(typeof k=="string"&&(k={name:k}),a(!E.argsByName.has(k.name),"Duplicated argument name",k.name),u.isSchema(k.assert)&&(k.assert=k.assert.strict().label(k.name)),E.argsByName.set(k.name,k),k)))}g.rules=_;const A=Object.assign({},v.modifiers);if(g.modifiers)for(const T in g.modifiers){a(!m[T],"Rule conflict in",g.type,T);const E=g.modifiers[T];a(typeof E=="function","Invalid modifier definition for",g.type,T);const P=function(k){return this.rule({[T]:k})};m[T]=P,A[T]=E}if(g.modifiers=A,g.overrides){m._super=h,y.$_super={};for(const T in g.overrides)a(h[T],"Cannot override missing",T),g.overrides[T][u.symbols.parent]=h[T],y.$_super[T]=h[T].bind(y);Object.assign(m,g.overrides)}g.cast=Object.assign({},v.cast,g.cast);const N=Object.assign({},v.manifest,g.manifest);return N.build=l.build(g.manifest&&g.manifest.build,v.manifest&&v.manifest.build),g.manifest=N,g.rebuild=l.rebuild(g.rebuild,v.rebuild),y},l.build=function(d,p){return d&&p?function(h,m){return p(d(h,m),m)}:d||p},l.coerce=function(d,p){return d&&p?{from:d.from&&p.from?[...new Set([...d.from,...p.from])]:null,method(h,m){let y;if((!p.from||p.from.includes(typeof h))&&(y=p.method(h,m),y)){if(y.errors||y.value===void 0)return y;h=y.value}if(!d.from||d.from.includes(typeof h)){const g=d.method(h,m);if(g)return g}return y}}:d||p},l.prepare=function(d,p){return d&&p?function(h,m){const y=d(h,m);if(y){if(y.errors||y.value===void 0)return y;h=y.value}return p(h,m)||y}:d||p},l.rebuild=function(d,p){return d&&p?function(h){p(h),d(h)}:d||p},l.validate=function(d,p){return d&&p?function(h,m){const y=p(h,m);if(y){if(y.errors&&(!Array.isArray(y.errors)||y.errors.length))return y;h=y.value}return d(h,m)||y}:d||p}},5107:(s,i,o)=>{const a=o(375),c=o(8571),u=o(8652),f=o(8160),l=o(3292),d=o(6354),p=o(8901),h=o(9708),m=o(6133),y=o(3328),g=o(1152);let v;const x={types:{alternatives:o(4946),any:o(8068),array:o(546),boolean:o(4937),date:o(7500),function:o(390),link:o(8785),number:o(3832),object:o(8966),string:o(7417),symbol:o(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const _={_types:new Set(Object.keys(x.types))};for(const A of _._types)_[A]=function(...N){return a(!N.length||["alternatives","link","object"].includes(A),"The",A,"type does not allow arguments"),x.generate(this,x.types[A],N)};for(const A of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])_[A]=function(...N){return this.any()[A](...N)};Object.assign(_,x.methods);for(const A in x.aliases){const N=x.aliases[A];_[A]=_[N]}return _.x=_.expression,g.setup&&g.setup(_),_}};x.methods={ValidationError:d.ValidationError,version:f.version,cache:u.provider,assert(_,A,...N){x.assert(_,A,!0,N)},attempt:(_,A,...N)=>x.assert(_,A,!1,N),build(_){return a(typeof h.build=="function","Manifest functionality disabled"),h.build(this,_)},checkPreferences(_){f.checkPreferences(_)},compile(_,A){return l.compile(this,_,A)},defaults(_){a(typeof _=="function","modifier must be a function");const A=Object.assign({},this);for(const N of A._types){const T=_(A[N]());a(f.isSchema(T),"modifier must return a valid schema object"),A[N]=function(...E){return x.generate(this,T,E)}}return A},expression:(..._)=>new y(..._),extend(..._){f.verifyFlat(_,"extend"),v=v||o(3378),a(_.length,"You need to provide at least one extension"),this.assert(_,v.extensions);const A=Object.assign({},this);A._types=new Set(A._types);for(let N of _){typeof N=="function"&&(N=N(A)),this.assert(N,v.extension);const T=x.expandExtension(N,A);for(const E of T){a(A[E.type]===void 0||A._types.has(E.type),"Cannot override name",E.type);const P=E.base||this.any(),k=p.type(P,E);A._types.add(E.type),A[E.type]=function(...M){return x.generate(this,k,M)}}}return A},isError:d.ValidationError.isError,isExpression:y.isTemplate,isRef:m.isRef,isSchema:f.isSchema,in:(..._)=>m.in(..._),override:f.symbols.override,ref:(..._)=>m.create(..._),types(){const _={};for(const A of this._types)_[A]=this[A]();for(const A in x.aliases)_[A]=this[A]();return _}},x.assert=function(_,A,N,T){const E=T[0]instanceof Error||typeof T[0]=="string"?T[0]:null,P=E!==null?T[1]:T[0],k=A.validate(_,f.preferences({errors:{stack:!0}},P||{}));let M=k.error;if(!M)return k.value;if(E instanceof Error)throw E;const I=N&&typeof M.annotate=="function"?M.annotate():M.message;throw M instanceof d.ValidationError==0&&(M=c(M)),M.message=E?`${E} ${I}`:I,M},x.generate=function(_,A,N){return a(_,"Must be invoked on a Joi instance."),A.$_root=_,A._definition.args&&N.length?A._definition.args(A,...N):A},x.expandExtension=function(_,A){if(typeof _.type=="string")return[_];const N=[];for(const T of A._types)if(_.type.test(T)){const E=Object.assign({},_);E.type=T,E.base=A[T](),N.push(E)}return N},s.exports=x.root()},6914:(s,i,o)=>{const a=o(375),c=o(8571),u=o(3328);i.compile=function(f,l){if(typeof f=="string")return a(!l,"Cannot set single message string"),new u(f);if(u.isTemplate(f))return a(!l,"Cannot set single message template"),f;a(typeof f=="object"&&!Array.isArray(f),"Invalid message options"),l=l?c(l):{};for(let d in f){const p=f[d];if(d==="root"||u.isTemplate(p)){l[d]=p;continue}if(typeof p=="string"){l[d]=new u(p);continue}a(typeof p=="object"&&!Array.isArray(p),"Invalid message for",d);const h=d;for(d in l[h]=l[h]||{},p){const m=p[d];d==="root"||u.isTemplate(m)?l[h][d]=m:(a(typeof m=="string","Invalid message for",d,"in",h),l[h][d]=new u(m))}}return l},i.decompile=function(f){const l={};for(let d in f){const p=f[d];if(d==="root"){l.root=p;continue}if(u.isTemplate(p)){l[d]=p.describe({compact:!0});continue}const h=d;for(d in l[h]={},p){const m=p[d];d!=="root"?l[h][d]=m.describe({compact:!0}):l[h].root=m}}return l},i.merge=function(f,l){if(!f)return i.compile(l);if(!l)return f;if(typeof l=="string")return new u(l);if(u.isTemplate(l))return l;const d=c(f);for(let p in l){const h=l[p];if(p==="root"||u.isTemplate(h)){d[p]=h;continue}if(typeof h=="string"){d[p]=new u(h);continue}a(typeof h=="object"&&!Array.isArray(h),"Invalid message for",p);const m=p;for(p in d[m]=d[m]||{},h){const y=h[p];p==="root"||u.isTemplate(y)?d[m][p]=y:(a(typeof y=="string","Invalid message for",p,"in",m),d[m][p]=new u(y))}}return d}},2294:(s,i,o)=>{const a=o(375),c=o(8160),u=o(6133),f={};i.Ids=f.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const l=new f.Ids;return l._byId=new Map(this._byId),l._byKey=new Map(this._byKey),l._schemaChain=this._schemaChain,l}concat(l){l._schemaChain&&(this._schemaChain=!0);for(const[d,p]of l._byId.entries())a(!this._byKey.has(d),"Schema id conflicts with existing key:",d),this._byId.set(d,p);for(const[d,p]of l._byKey.entries())a(!this._byId.has(d),"Schema key conflicts with existing id:",d),this._byKey.set(d,p)}fork(l,d,p){const h=this._collect(l);h.push({schema:p});const m=h.shift();let y={id:m.id,schema:d(m.schema)};a(c.isSchema(y.schema),"adjuster function failed to return a joi schema type");for(const g of h)y={id:g.id,schema:f.fork(g.schema,y.id,y.schema)};return y.schema}labels(l,d=[]){const p=l[0],h=this._get(p);if(!h)return[...d,...l].join(".");const m=l.slice(1);return d=[...d,h.schema._flags.label||p],m.length?h.schema._ids.labels(m,d):d.join(".")}reach(l,d=[]){const p=l[0],h=this._get(p);a(h,"Schema does not contain path",[...d,...l].join("."));const m=l.slice(1);return m.length?h.schema._ids.reach(m,[...d,p]):h.schema}register(l,{key:d}={}){if(!l||!c.isSchema(l))return;(l.$_property("schemaChain")||l._ids._schemaChain)&&(this._schemaChain=!0);const p=l._flags.id;if(p){const h=this._byId.get(p);a(!h||h.schema===l,"Cannot add different schemas with the same id:",p),a(!this._byKey.has(p),"Schema id conflicts with existing key:",p),this._byId.set(p,{schema:l,id:p})}d&&(a(!this._byKey.has(d),"Schema already contains key:",d),a(!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=[],p=[]){const h=l[0],m=this._get(h);a(m,"Schema does not contain path",[...d,...l].join(".")),p=[m,...p];const y=l.slice(1);return y.length?m.schema._ids._collect(y,[...d,h],p):p}_get(l){return this._byId.get(l)||this._byKey.get(l)}},f.fork=function(l,d,p){const h=i.schema(l,{each:(m,{key:y})=>{if(d===(m._flags.id||y))return p},ref:!1});return h?h.$_mutateRebuild():l},i.schema=function(l,d){let p;for(const h in l._flags){if(h[0]==="_")continue;const m=f.scan(l._flags[h],{source:"flags",name:h},d);m!==void 0&&(p=p||l.clone(),p._flags[h]=m)}for(let h=0;h<l._rules.length;++h){const m=l._rules[h],y=f.scan(m.args,{source:"rules",name:m.name},d);if(y!==void 0){p=p||l.clone();const g=Object.assign({},m);g.args=y,p._rules[h]=g,p._singleRules.get(m.name)===m&&p._singleRules.set(m.name,g)}}for(const h in l.$_terms){if(h[0]==="_")continue;const m=f.scan(l.$_terms[h],{source:"terms",name:h},d);m!==void 0&&(p=p||l.clone(),p.$_terms[h]=m)}return p},f.scan=function(l,d,p,h,m){const y=h||[];if(l===null||typeof l!="object")return;let g;if(Array.isArray(l)){for(let v=0;v<l.length;++v){const x=d.source==="terms"&&d.name==="keys"&&l[v].key,_=f.scan(l[v],d,p,[v,...y],x);_!==void 0&&(g=g||l.slice(),g[v]=_)}return g}if(p.schema!==!1&&c.isSchema(l)||p.ref!==!1&&u.isRef(l)){const v=p.each(l,{...d,path:y,key:m});return v===l?void 0:v}for(const v in l){if(v[0]==="_")continue;const x=f.scan(l[v],d,p,[v,...y],m);x!==void 0&&(g=g||Object.assign({},l),g[v]=x)}return g}},6133:(s,i,o)=>{const a=o(375),c=o(8571),u=o(9621),f=o(8160);let l;const d={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};i.create=function(p,h={}){a(typeof p=="string","Invalid reference key:",p),f.assertOptions(h,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),a(!h.prefix||typeof h.prefix=="object","options.prefix must be of type object");const m=Object.assign({},d.defaults,h);delete m.prefix;const y=m.separator,g=d.context(p,y,h.prefix);if(m.type=g.type,p=g.key,m.type==="value")if(g.root&&(a(!y||p[0]!==y,"Cannot specify relative path with root prefix"),m.ancestor="root",p||(p=null)),y&&y===p)p=null,m.ancestor=0;else if(m.ancestor!==void 0)a(!y||!p||p[0]!==y,"Cannot combine prefix with ancestor option");else{const[v,x]=d.ancestor(p,y);x&&(p=p.slice(x))===""&&(p=null),m.ancestor=v}return m.path=y?p===null?[]:p.split(y):[p],new d.Ref(m)},i.in=function(p,h={}){return i.create(p,{...h,in:!0})},i.isRef=function(p){return!!p&&!!p[f.symbols.ref]},d.Ref=class{constructor(p){a(typeof p=="object","Invalid reference construction"),f.assertOptions(p,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),a([!1,void 0].includes(p.separator)||typeof p.separator=="string"&&p.separator.length===1,"Invalid separator"),a(!p.adjust||typeof p.adjust=="function","options.adjust must be a function"),a(!p.map||Array.isArray(p.map),"options.map must be an array"),a(!p.map||!p.adjust,"Cannot set both map and adjust options"),Object.assign(this,d.defaults,p),a(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(p,h,m,y,g={}){return a(!this.in||g.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(m.context,h,g):this.type==="local"?this._resolve(y,h,g):this.ancestor?this.ancestor==="root"?this._resolve(h.ancestors[h.ancestors.length-1],h,g):(a(this.ancestor<=h.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(h.ancestors[this.ancestor-1],h,g)):this._resolve(p,h,g)}_resolve(p,h,m){let y;if(this.type==="value"&&h.mainstay.shadow&&m.shadow!==!1&&(y=h.mainstay.shadow.get(this.absolute(h))),y===void 0&&(y=u(p,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(y=this.adjust(y)),this.map){const g=this.map.get(y);g!==void 0&&(y=g)}return h.mainstay&&h.mainstay.tracer.resolve(h,this,y),y}toString(){return this.display}absolute(p){return[...p.path.slice(0,-this.ancestor),...this.path]}clone(){return new d.Ref(this)}describe(){const p={path:this.path};this.type!=="value"&&(p.type=this.type),this.separator!=="."&&(p.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(p.ancestor=this.ancestor),this.map&&(p.map=[...this.map]);for(const h of["adjust","iterables","render"])this[h]!==null&&this[h]!==void 0&&(p[h]=this[h]);return this.in!==!1&&(p.in=!0),{ref:p}}updateDisplay(){const p=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${p}`);if(!this.separator)return void(this.display=`ref:${p}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${p}`);if(this.ancestor==="root")return void(this.display=`ref:root:${p}`);if(this.ancestor===1)return void(this.display=`ref:${p||".."}`);const h=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${h}${p||""}`}},d.Ref.prototype[f.symbols.ref]=!0,i.build=function(p){return(p=Object.assign({},d.defaults,p)).type==="value"&&p.ancestor===void 0&&(p.ancestor=1),new d.Ref(p)},d.context=function(p,h,m={}){if(p=p.trim(),m){const y=m.global===void 0?"$":m.global;if(y!==h&&p.startsWith(y))return{key:p.slice(y.length),type:"global"};const g=m.local===void 0?"#":m.local;if(g!==h&&p.startsWith(g))return{key:p.slice(g.length),type:"local"};const v=m.root===void 0?"/":m.root;if(v!==h&&p.startsWith(v))return{key:p.slice(v.length),type:"value",root:!0}}return{key:p,type:"value"}},d.ancestor=function(p,h){if(!h)return[1,0];if(p[0]!==h)return[1,0];if(p[1]!==h)return[0,1];let m=2;for(;p[m]===h;)++m;return[m-1,m]},i.toSibling=0,i.toParent=1,i.Manager=class{constructor(){this.refs=[]}register(p,h){if(p)if(h=h===void 0?i.toParent:h,Array.isArray(p))for(const m of p)this.register(m,h);else if(f.isSchema(p))for(const m of p._refs.refs)m.ancestor-h>=0&&this.refs.push({ancestor:m.ancestor-h,root:m.root});else i.isRef(p)&&p.type==="value"&&p.ancestor-h>=0&&this.refs.push({ancestor:p.ancestor-h,root:p.root}),l=l||o(3328),l.isTemplate(p)&&this.register(p.refs(),h)}get length(){return this.refs.length}clone(){const p=new i.Manager;return p.refs=c(this.refs),p}reset(){this.refs=[]}roots(){return this.refs.filter(p=>!p.ancestor).map(p=>p.root)}}},3378:(s,i,o)=>{const a=o(5107),c={};c.wrap=a.string().min(1).max(2).allow(!1),i.preferences=a.object({allowUnknown:a.boolean(),abortEarly:a.boolean(),artifacts:a.boolean(),cache:a.boolean(),context:a.object(),convert:a.boolean(),dateFormat:a.valid("date","iso","string","time","utc"),debug:a.boolean(),errors:{escapeHtml:a.boolean(),label:a.valid("path","key",!1),language:[a.string(),a.object().ref()],render:a.boolean(),stack:a.boolean(),wrap:{label:c.wrap,array:c.wrap,string:c.wrap}},externals:a.boolean(),messages:a.object(),noDefaults:a.boolean(),nonEnumerables:a.boolean(),presence:a.valid("required","optional","forbidden"),skipFunctions:a.boolean(),stripUnknown:a.object({arrays:a.boolean(),objects:a.boolean()}).or("arrays","objects").allow(!0,!1),warnings:a.boolean()}).strict(),c.nameRx=/^[a-zA-Z0-9]\w*$/,c.rule=a.object({alias:a.array().items(a.string().pattern(c.nameRx)).single(),args:a.array().items(a.string(),a.object({name:a.string().pattern(c.nameRx).required(),ref:a.boolean(),assert:a.alternatives([a.function(),a.object().schema()]).conditional("ref",{is:!0,then:a.required()}),normalize:a.function(),message:a.string().when("assert",{is:a.function(),then:a.required()})})),convert:a.boolean(),manifest:a.boolean(),method:a.function().allow(!1),multi:a.boolean(),validate:a.function()}),i.extension=a.object({type:a.alternatives([a.string(),a.object().regex()]).required(),args:a.function(),cast:a.object().pattern(c.nameRx,a.object({from:a.function().maxArity(1).required(),to:a.function().minArity(1).maxArity(2).required()})),base:a.object().schema().when("type",{is:a.object().regex(),then:a.forbidden()}),coerce:[a.function().maxArity(3),a.object({method:a.function().maxArity(3).required(),from:a.array().items(a.string()).single()})],flags:a.object().pattern(c.nameRx,a.object({setter:a.string(),default:a.any()})),manifest:{build:a.function().arity(2)},messages:[a.object(),a.string()],modifiers:a.object().pattern(c.nameRx,a.function().minArity(1).maxArity(2)),overrides:a.object().pattern(c.nameRx,a.function()),prepare:a.function().maxArity(3),rebuild:a.function().arity(1),rules:a.object().pattern(c.nameRx,c.rule),terms:a.object().pattern(c.nameRx,a.object({init:a.array().allow(null).required(),manifest:a.object().pattern(/.+/,[a.valid("schema","single"),a.object({mapped:a.object({from:a.string().required(),to:a.string().required()}).required()})])})),validate:a.function().maxArity(3)}).strict(),i.extensions=a.array().items(a.object(),a.function().arity(1)).strict(),c.desc={buffer:a.object({buffer:a.string()}),func:a.object({function:a.function().required(),options:{literal:!0}}),override:a.object({override:!0}),ref:a.object({ref:a.object({type:a.valid("value","global","local"),path:a.array().required(),separator:a.string().length(1).allow(!1),ancestor:a.number().min(0).integer().allow("root"),map:a.array().items(a.array().length(2)).min(1),adjust:a.function(),iterables:a.boolean(),in:a.boolean(),render:a.boolean()}).required()}),regex:a.object({regex:a.string().min(3)}),special:a.object({special:a.valid("deep").required()}),template:a.object({template:a.string().required(),options:a.object()}),value:a.object({value:a.alternatives([a.object(),a.array()]).required()})},c.desc.entity=a.alternatives([a.array().items(a.link("...")),a.boolean(),a.function(),a.number(),a.string(),c.desc.buffer,c.desc.func,c.desc.ref,c.desc.regex,c.desc.special,c.desc.template,c.desc.value,a.link("/")]),c.desc.values=a.array().items(null,a.boolean(),a.function(),a.number().allow(1/0,-1/0),a.string().allow(""),a.symbol(),c.desc.buffer,c.desc.func,c.desc.override,c.desc.ref,c.desc.regex,c.desc.template,c.desc.value),c.desc.messages=a.object().pattern(/.+/,[a.string(),c.desc.template,a.object().pattern(/.+/,[a.string(),c.desc.template])]),i.description=a.object({type:a.string().required(),flags:a.object({cast:a.string(),default:a.any(),description:a.string(),empty:a.link("/"),failover:c.desc.entity,id:a.string(),label:a.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:a.boolean(),unit:a.string()}).unknown(),preferences:{allowUnknown:a.boolean(),abortEarly:a.boolean(),artifacts:a.boolean(),cache:a.boolean(),convert:a.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:a.boolean(),label:["path","key"],language:[a.string(),c.desc.ref],wrap:{label:c.wrap,array:c.wrap}},externals:a.boolean(),messages:c.desc.messages,noDefaults:a.boolean(),nonEnumerables:a.boolean(),presence:["required","optional","forbidden"],skipFunctions:a.boolean(),stripUnknown:a.object({arrays:a.boolean(),objects:a.boolean()}).or("arrays","objects").allow(!0,!1),warnings:a.boolean()},allow:c.desc.values,invalid:c.desc.values,rules:a.array().min(1).items({name:a.string().required(),args:a.object().min(1),keep:a.boolean(),message:[a.string(),c.desc.messages],warn:a.boolean()}),keys:a.object().pattern(/.*/,a.link("/")),link:c.desc.ref}).pattern(/^[a-z]\w*$/,a.any())},493:(s,i,o)=>{const a=o(8571),c=o(9621),u=o(8160),f={value:Symbol("value")};s.exports=f.State=class{constructor(l,d,p){this.path=l,this.ancestors=d,this.mainstay=p.mainstay,this.schemas=p.schemas,this.debug=null}localize(l,d=null,p=null){const h=new f.State(l,d,this);return p&&h.schemas&&(h.schemas=[f.schemas(p),...h.schemas]),h}nest(l,d){const p=new f.State(this.path,this.ancestors,this);return p.schemas=p.schemas&&[f.schemas(l),...p.schemas],p.debug=d,p}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=a(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}},f.schemas=function(l){return u.isSchema(l)?{schema:l}:l},f.Shadow=class{constructor(){this._values=null}set(l,d,p){if(!l.length||p==="strip"&&typeof l[l.length-1]=="number")return;this._values=this._values||new Map;let h=this._values;for(let m=0;m<l.length;++m){const y=l[m];let g=h.get(y);g||(g=new Map,h.set(y,g)),h=g}h[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 p=l.slice(0,-1),h=l[l.length-1],m=c(this._values,p,{iterables:!0});d?m.set(h,d):m&&m.delete(h)}}},3328:(s,i,o)=>{const a=o(375),c=o(8571),u=o(5277),f=o(1447),l=o(8160),d=o(6354),p=o(6133),h={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};s.exports=h.Template=class{constructor(m,y){if(a(typeof m=="string","Template source must be a string"),a(!m.includes("\0")&&!m.includes(""),"Template source cannot contain reserved control characters"),this.source=m,this.rendered=m,this._template=null,y){const{functions:g,...v}=y;this._settings=Object.keys(v).length?c(v):void 0,this._functions=g,this._functions&&(a(Object.keys(this._functions).every(x=>typeof x=="string"),"Functions keys must be strings"),a(Object.values(this._functions).every(x=>typeof x=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const m=h.encode(this.source),y=h.split(m);let g=!1;const v=[],x=y.shift();x&&v.push(x);for(const _ of y){const A=_[0]!=="{",N=A?"}":"}}",T=_.indexOf(N);if(T===-1||_[1]==="{"){v.push(`{${h.decode(_)}`);continue}let E=_.slice(A?0:1,T);const P=E[0]===":";P&&(E=E.slice(1));const k=this._ref(h.decode(E),{raw:A,wrapped:P});v.push(k),typeof k!="string"&&(g=!0);const M=_.slice(T+N.length);M&&v.push(h.decode(M))}g?this._template=v:this.rendered=v.join("")}static date(m,y){return h.dateFormat[y.dateFormat].call(m)}describe(m={}){if(!this._settings&&m.compact)return this.source;const y={template:this.source};return this._settings&&(y.options=this._settings),this._functions&&(y.functions=this._functions),y}static build(m){return new h.Template(m.template,m.options||m.functions?{...m.options,functions:m.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(m){return!!m&&!!m[l.symbols.template]}refs(){if(!this._template)return;const m=[];for(const y of this._template)typeof y!="string"&&m.push(...y.refs);return m}resolve(m,y,g,v){return this._template&&this._template.length===1?this._part(this._template[0],m,y,g,v,{}):this.render(m,y,g,v)}_part(m,...y){return m.ref?m.ref.resolve(...y):m.formula.evaluate(y)}render(m,y,g,v,x={}){if(!this.isDynamic())return this.rendered;const _=[];for(const A of this._template)if(typeof A=="string")_.push(A);else{const N=this._part(A,m,y,g,v,x),T=h.stringify(N,m,y,g,v,x);if(T!==void 0){const E=A.raw||(x.errors&&x.errors.escapeHtml)===!1?T:u(T);_.push(h.wrap(E,A.wrapped&&g.errors.wrap.label))}}return _.join("")}_ref(m,{raw:y,wrapped:g}){const v=[],x=A=>{const N=p.create(A,this._settings);return v.push(N),T=>{const E=N.resolve(...T);return E!==void 0?E:null}};try{const A=this._functions?{...h.functions,...this._functions}:h.functions;var _=new f.Parser(m,{reference:x,functions:A,constants:h.constants})}catch(A){throw A.message=`Invalid template variable "${m}" fails due to: ${A.message}`,A}if(_.single){if(_.single.type==="reference"){const A=v[0];return{ref:A,raw:y,refs:v,wrapped:g||A.type==="local"&&A.key==="label"}}return h.stringify(_.single.value)}return{formula:_,raw:y,refs:v}}toString(){return this.source}},h.Template.prototype[l.symbols.template]=!0,h.Template.prototype.isImmutable=!0,h.encode=function(m){return m.replace(/\\(\{+)/g,(y,g)=>h.opens.slice(0,g.length)).replace(/\\(\}+)/g,(y,g)=>h.closes.slice(0,g.length))},h.decode=function(m){return m.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},h.split=function(m){const y=[];let g="";for(let v=0;v<m.length;++v){const x=m[v];if(x==="{"){let _="";for(;v+1<m.length&&m[v+1]==="{";)_+="{",++v;y.push(g),g=_}else g+=x}return y.push(g),y},h.wrap=function(m,y){return y?y.length===1?`${y}${m}${y}`:`${y[0]}${m}${y[1]}`:m},h.stringify=function(m,y,g,v,x,_={}){const A=typeof m,N=v&&v.errors&&v.errors.wrap||{};let T=!1;if(p.isRef(m)&&m.render&&(T=m.in,m=m.resolve(y,g,v,x,{in:m.in,..._})),m===null)return"null";if(A==="string")return h.wrap(m,_.arrayItems&&N.string);if(A==="number"||A==="function"||A==="symbol")return m.toString();if(A!=="object")return JSON.stringify(m);if(m instanceof Date)return h.Template.date(m,v);if(m instanceof Map){const P=[];for(const[k,M]of m.entries())P.push(`${k.toString()} -> ${M.toString()}`);m=P}if(!Array.isArray(m))return m.toString();const E=[];for(const P of m)E.push(h.stringify(P,y,g,v,x,{arrayItems:!0,..._}));return h.wrap(E.join(", "),!T&&N.array)},h.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},h.functions={if:(m,y,g)=>m?y:g,length:m=>typeof m=="string"?m.length:m&&typeof m=="object"?Array.isArray(m)?m.length:Object.keys(m).length:null,msg(m){const[y,g,v,x,_]=this,A=_.messages;if(!A)return"";const N=d.template(y,A[0],m,g,v)||d.template(y,A[1],m,g,v);return N?N.render(y,g,v,x,_):""},number:m=>typeof m=="number"?m:typeof m=="string"?parseFloat(m):typeof m=="boolean"?m?1:0:m instanceof Date?m.getTime():null}},4946:(s,i,o)=>{const a=o(375),c=o(1687),u=o(8068),f=o(8160),l=o(3292),d=o(6354),p=o(6133),h={};s.exports=u.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:p.toSibling}},args:(m,...y)=>y.length===1&&Array.isArray(y[0])?m.try(...y[0]):m.try(...y),validate(m,y){const{schema:g,error:v,state:x,prefs:_}=y;if(g._flags.match){const N=[],T=[];for(let P=0;P<g.$_terms.matches.length;++P){const k=g.$_terms.matches[P],M=x.nest(k.schema,`match.${P}`);M.snapshot();const I=k.schema.$_validate(m,M,_);I.errors?(T.push(I.errors),M.restore()):(N.push(I.value),M.commit())}if(N.length===0)return{errors:v("alternatives.any",{details:T.map(P=>d.details(P,{override:!1}))})};if(g._flags.match==="one")return N.length===1?{value:N[0]}:{errors:v("alternatives.one")};if(N.length!==g.$_terms.matches.length)return{errors:v("alternatives.all",{details:T.map(P=>d.details(P,{override:!1}))})};const E=P=>P.$_terms.matches.some(k=>k.schema.type==="object"||k.schema.type==="alternatives"&&E(k.schema));return E(g)?{value:N.reduce((P,k)=>c(P,k,{mergeArrays:!1}))}:{value:N[N.length-1]}}const A=[];for(let N=0;N<g.$_terms.matches.length;++N){const T=g.$_terms.matches[N];if(T.schema){const k=x.nest(T.schema,`match.${N}`);k.snapshot();const M=T.schema.$_validate(m,k,_);if(!M.errors)return k.commit(),M;k.restore(),A.push({schema:T.schema,reports:M.errors});continue}const E=T.ref?T.ref.resolve(m,x,_):m,P=T.is?[T]:T.switch;for(let k=0;k<P.length;++k){const M=P[k],{is:I,then:j,otherwise:L}=M,H=`match.${N}${T.switch?"."+k:""}`;if(I.$_match(E,x.nest(I,`${H}.is`),_)){if(j)return j.$_validate(m,x.nest(j,`${H}.then`),_)}else if(L)return L.$_validate(m,x.nest(L,`${H}.otherwise`),_)}}return h.errors(A,y)},rules:{conditional:{method(m,y){a(!this._flags._endedSwitch,"Unreachable condition"),a(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),a(y.break===void 0,"Cannot use break option with alternatives conditional");const g=this.clone(),v=l.when(g,m,y),x=v.is?[v]:v.switch;for(const _ of x)if(_.then&&_.otherwise){g.$_setFlag("_endedSwitch",!0,{clone:!1});break}return g.$_terms.matches.push(v),g.$_mutateRebuild()}},match:{method(m){if(a(["any","one","all"].includes(m),"Invalid alternatives match mode",m),m!=="any")for(const y of this.$_terms.matches)a(y.schema,"Cannot combine match mode",m,"with conditional rules");return this.$_setFlag("match",m)}},try:{method(...m){a(m.length,"Missing alternative schemas"),f.verifyFlat(m,"try"),a(!this._flags._endedSwitch,"Unreachable condition");const y=this.clone();for(const g of m)y.$_terms.matches.push({schema:y.$_compile(g)});return y.$_mutateRebuild()}}},overrides:{label(m){return this.$_parent("label",m).$_modify({each:(y,g)=>g.path[0]!=="is"&&typeof y._flags.label!="string"?y.label(m):void 0,ref:!1})}},rebuild(m){m.$_modify({each:y=>{f.isSchema(y)&&y.type==="array"&&m.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(m,y){if(y.matches)for(const g of y.matches){const{schema:v,ref:x,is:_,not:A,then:N,otherwise:T}=g;m=v?m.try(v):x?m.conditional(x,{is:_,then:N,not:A,otherwise:T,switch:g.switch}):m.conditional(_,{then:N,otherwise:T})}return m}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),h.errors=function(m,{error:y,state:g}){if(!m.length)return{errors:y("alternatives.any")};if(m.length===1)return{errors:m[0].reports};const v=new Set,x=[];for(const{reports:_,schema:A}of m){if(_.length>1)return h.unmatched(m,y);const N=_[0];if(N instanceof d.Report==0)return h.unmatched(m,y);if(N.state.path.length!==g.path.length){x.push({type:A.type,report:N});continue}if(N.code==="any.only"){for(const P of N.local.valids)v.add(P);continue}const[T,E]=N.code.split(".");E!=="base"?x.push({type:A.type,report:N}):N.code==="object.base"?v.add(N.local.type):v.add(T)}return x.length?x.length===1?{errors:x[0].report}:h.unmatched(m,y):{errors:y("alternatives.types",{types:[...v]})}},h.unmatched=function(m,y){const g=[];for(const v of m)g.push(...v.reports);return{errors:y("alternatives.match",d.details(g,{override:!1}))}}},8068:(s,i,o)=>{const a=o(375),c=o(7629),u=o(8160),f=o(6914);s.exports=c.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(l,d){return a(typeof l=="function","Method must be a function"),a(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:p}){try{return p(l,d)}catch(h){return d.error("any.custom",{error:h})}},args:["method","description"],multi:!0},messages:{method(l){return this.prefs({messages:l})}},shared:{method(l){a(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 a(l&&typeof l=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:l,local:d},warn:!0})},validate:(l,d,{code:p,local:h})=>d.error(p,h),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 p in d){const h=d[p];if(["examples","externals","metas","notes","tags"].includes(p))for(const m of h)l=l[p.slice(0,-1)](m);else if(p!=="alterations")if(p!=="whens"){if(p==="shared")for(const m of h)l=l.shared(m)}else for(const m of h){const{ref:y,is:g,not:v,then:x,otherwise:_,concat:A}=m;l=A?l.concat(A):y?l.when(y,{is:g,not:v,then:x,otherwise:_,switch:m.switch,break:m.break}):l.when(g,{then:x,otherwise:_,break:m.break})}else{const m={};for(const{target:y,adjuster:g}of h)m[y]=g;l=l.alter(m)}}return l}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(s,i,o)=>{const a=o(375),c=o(9474),u=o(9621),f=o(8068),l=o(8160),d=o(3292),p={};s.exports=f.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(h,{schema:m,state:y,prefs:g}){if(!Array.isArray(h))return;const v=m.$_getRule("sort");return v?p.sort(m,h,v.args.options,y,g):void 0}},validate(h,{schema:m,error:y}){if(!Array.isArray(h)){if(m._flags.single){const g=[h];return g[l.symbols.arraySingle]=!0,{value:g}}return{errors:y("array.base")}}if(m.$_getRule("items")||m.$_terms.externals)return{value:h.slice()}},rules:{has:{method(h){h=this.$_compile(h,{appendPath:!0});const m=this.$_addRule({name:"has",args:{schema:h}});return m.$_mutateRegister(h),m},validate(h,{state:m,prefs:y,error:g},{schema:v}){const x=[h,...m.ancestors];for(let A=0;A<h.length;++A){const N=m.localize([...m.path,A],x,v);if(v.$_match(h[A],N,y))return h}const _=v._flags.label;return _?g("array.hasKnown",{patternLabel:_}):g("array.hasUnknown",null)},multi:!0},items:{method(...h){l.verifyFlat(h,"items");const m=this.$_addRule("items");for(let y=0;y<h.length;++y){const g=l.tryWithPath(()=>this.$_compile(h[y]),y,{append:!0});m.$_terms.items.push(g)}return m.$_mutateRebuild()},validate(h,{schema:m,error:y,state:g,prefs:v,errorsArray:x}){const _=m.$_terms._requireds.slice(),A=m.$_terms.ordered.slice(),N=[...m.$_terms._inclusions,..._],T=!h[l.symbols.arraySingle];delete h[l.symbols.arraySingle];const E=x();let P=h.length;for(let k=0;k<P;++k){const M=h[k];let I=!1,j=!1;const L=T?k:new Number(k),H=[...g.path,L];if(!m._flags.sparse&&M===void 0){if(E.push(y("array.sparse",{key:L,path:H,pos:k,value:void 0},g.localize(H))),v.abortEarly)return E;A.shift();continue}const K=[h,...g.ancestors];for(const ne of m.$_terms._exclusions)if(ne.$_match(M,g.localize(H,K,ne),v,{presence:"ignore"})){if(E.push(y("array.excludes",{pos:k,value:M},g.localize(H))),v.abortEarly)return E;I=!0,A.shift();break}if(I)continue;if(m.$_terms.ordered.length){if(A.length){const ne=A.shift(),X=ne.$_validate(M,g.localize(H,K,ne),v);if(X.errors){if(E.push(...X.errors),v.abortEarly)return E}else if(ne._flags.result==="strip")p.fastSplice(h,k),--k,--P;else{if(!m._flags.sparse&&X.value===void 0){if(E.push(y("array.sparse",{key:L,path:H,pos:k,value:void 0},g.localize(H))),v.abortEarly)return E;continue}h[k]=X.value}continue}if(!m.$_terms.items.length){if(E.push(y("array.orderedLength",{pos:k,limit:m.$_terms.ordered.length})),v.abortEarly)return E;break}}const V=[];let U=_.length;for(let ne=0;ne<U;++ne){const X=g.localize(H,K,_[ne]);X.snapshot();const G=_[ne].$_validate(M,X,v);if(V[ne]=G,!G.errors){if(X.commit(),h[k]=G.value,j=!0,p.fastSplice(_,ne),--ne,--U,!m._flags.sparse&&G.value===void 0&&(E.push(y("array.sparse",{key:L,path:H,pos:k,value:void 0},g.localize(H))),v.abortEarly))return E;break}X.restore()}if(j)continue;const Q=v.stripUnknown&&!!v.stripUnknown.arrays||!1;U=N.length;for(const ne of N){let X;const G=_.indexOf(ne);if(G!==-1)X=V[G];else{const Y=g.localize(H,K,ne);if(Y.snapshot(),X=ne.$_validate(M,Y,v),!X.errors){Y.commit(),ne._flags.result==="strip"?(p.fastSplice(h,k),--k,--P):m._flags.sparse||X.value!==void 0?h[k]=X.value:(E.push(y("array.sparse",{key:L,path:H,pos:k,value:void 0},g.localize(H))),I=!0),j=!0;break}Y.restore()}if(U===1){if(Q){p.fastSplice(h,k),--k,--P,j=!0;break}if(E.push(...X.errors),v.abortEarly)return E;I=!0;break}}if(!I&&(m.$_terms._inclusions.length||m.$_terms._requireds.length)&&!j){if(Q){p.fastSplice(h,k),--k,--P;continue}if(E.push(y("array.includes",{pos:k,value:M},g.localize(H))),v.abortEarly)return E}}return _.length&&p.fillMissedErrors(m,E,_,h,g,v),A.length&&(p.fillOrderedErrors(m,E,A,h,g,v),E.length||p.fillDefault(A,h,g,v)),E.length?E:h},priority:!0,manifest:!1},length:{method(h){return this.$_addRule({name:"length",args:{limit:h},operator:"="})},validate:(h,m,{limit:y},{name:g,operator:v,args:x})=>l.compare(h.length,y,v)?h:m.error("array."+g,{limit:x.limit,value:h}),args:[{name:"limit",ref:!0,assert:l.limit,message:"must be a positive integer"}]},max:{method(h){return this.$_addRule({name:"max",method:"length",args:{limit:h},operator:"<="})}},min:{method(h){return this.$_addRule({name:"min",method:"length",args:{limit:h},operator:">="})}},ordered:{method(...h){l.verifyFlat(h,"ordered");const m=this.$_addRule("items");for(let y=0;y<h.length;++y){const g=l.tryWithPath(()=>this.$_compile(h[y]),y,{append:!0});p.validateSingle(g,m),m.$_mutateRegister(g),m.$_terms.ordered.push(g)}return m.$_mutateRebuild()}},single:{method(h){const m=h===void 0||!!h;return a(!m||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",m)}},sort:{method(h={}){l.assertOptions(h,["by","order"]);const m={order:h.order||"ascending"};return h.by&&(m.by=d.ref(h.by,{ancestor:0}),a(!m.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:m}})},validate(h,{error:m,state:y,prefs:g,schema:v},{options:x}){const{value:_,errors:A}=p.sort(v,h,x,y,g);if(A)return A;for(let N=0;N<h.length;++N)if(h[N]!==_[N])return m("array.sort",{order:x.order,by:x.by?x.by.key:"value"});return h},convert:!0},sparse:{method(h){const m=h===void 0||!!h;return this._flags.sparse===m?this:(m?this.clone():this.$_addRule("items")).$_setFlag("sparse",m,{clone:!1})}},unique:{method(h,m={}){a(!h||typeof h=="function"||typeof h=="string","comparator must be a function or a string"),l.assertOptions(m,["ignoreUndefined","separator"]);const y={name:"unique",args:{options:m,comparator:h}};if(h)if(typeof h=="string"){const g=l.default(m.separator,".");y.path=g?h.split(g):[h]}else y.comparator=h;return this.$_addRule(y)},validate(h,{state:m,error:y,schema:g},{comparator:v,options:x},{comparator:_,path:A}){const N={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},T=_||c,E=x.ignoreUndefined;for(let P=0;P<h.length;++P){const k=A?u(h[P],A):h[P],M=_?N.custom:N[typeof k];if(a(M,"Failed to find unique map container for type",typeof k),M instanceof Map){const I=M.entries();let j;for(;!(j=I.next()).done;)if(T(j.value[0],k)){const L=m.localize([...m.path,P],[h,...m.ancestors]),H={pos:P,value:h[P],dupePos:j.value[1],dupeValue:h[j.value[1]]};return A&&(H.path=v),y("array.unique",H,L)}M.set(k,P)}else{if((!E||k!==void 0)&&M[k]!==void 0){const I={pos:P,value:h[P],dupePos:M[k],dupeValue:h[M[k]]};return A&&(I.path=v),y("array.unique",I,m.localize([...m.path,P],[h,...m.ancestors]))}M[k]=P}}return h},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(h,m)=>new Set(h)}},rebuild(h){h.$_terms._inclusions=[],h.$_terms._exclusions=[],h.$_terms._requireds=[];for(const m of h.$_terms.items)p.validateSingle(m,h),m._flags.presence==="required"?h.$_terms._requireds.push(m):m._flags.presence==="forbidden"?h.$_terms._exclusions.push(m):h.$_terms._inclusions.push(m);for(const m of h.$_terms.ordered)p.validateSingle(m,h)},manifest:{build:(h,m)=>(m.items&&(h=h.items(...m.items)),m.ordered&&(h=h.ordered(...m.ordered)),h)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),p.fillMissedErrors=function(h,m,y,g,v,x){const _=[];let A=0;for(const N of y){const T=N._flags.label;T?_.push(T):++A}_.length?A?m.push(h.$_createError("array.includesRequiredBoth",g,{knownMisses:_,unknownMisses:A},v,x)):m.push(h.$_createError("array.includesRequiredKnowns",g,{knownMisses:_},v,x)):m.push(h.$_createError("array.includesRequiredUnknowns",g,{unknownMisses:A},v,x))},p.fillOrderedErrors=function(h,m,y,g,v,x){const _=[];for(const A of y)A._flags.presence==="required"&&_.push(A);_.length&&p.fillMissedErrors(h,m,_,g,v,x)},p.fillDefault=function(h,m,y,g){const v=[];let x=!0;for(let _=h.length-1;_>=0;--_){const A=h[_],N=[m,...y.ancestors],T=A.$_validate(void 0,y.localize(y.path,N,A),g).value;if(x){if(T===void 0)continue;x=!1}v.unshift(T)}v.length&&m.push(...v)},p.fastSplice=function(h,m){let y=m;for(;y<h.length;)h[y++]=h[y];--h.length},p.validateSingle=function(h,m){(h.type==="array"||h._flags._arrayItems)&&(a(!m._flags.single,"Cannot specify array item with single rule enabled"),m.$_setFlag("_arrayItems",!0,{clone:!1}))},p.sort=function(h,m,y,g,v){const x=y.order==="ascending"?1:-1,_=-1*x,A=x,N=(T,E)=>{let P=p.compare(T,E,_,A);if(P!==null||(y.by&&(T=y.by.resolve(T,g,v),E=y.by.resolve(E,g,v)),P=p.compare(T,E,_,A),P!==null))return P;const k=typeof T;if(k!==typeof E)throw h.$_createError("array.sort.mismatching",m,null,g,v);if(k!=="number"&&k!=="string")throw h.$_createError("array.sort.unsupported",m,{type:k},g,v);return k==="number"?(T-E)*x:T<E?_:A};try{return{value:m.slice().sort(N)}}catch(T){return{errors:T}}},p.compare=function(h,m,y,g){return h===m?0:h===void 0?1:m===void 0?-1:h===null?g:m===null?y:null}},4937:(s,i,o)=>{const a=o(375),c=o(8068),u=o(8160),f=o(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:p}){if(typeof d!="boolean"){if(typeof d=="string"){const h=p._flags.sensitive?d:d.toLowerCase();d=h==="true"||h!=="false"&&d}return typeof d!="boolean"&&(d=p.$_terms.truthy&&p.$_terms.truthy.has(d,null,null,!p._flags.sensitive)||(!p.$_terms.falsy||!p.$_terms.falsy.has(d,null,null,!p._flags.sensitive))&&d),{value:d}}},validate(d,{error:p}){if(typeof d!="boolean")return{value:d,errors:p("boolean.base")}},rules:{truthy:{method(...d){u.verifyFlat(d,"truthy");const p=this.clone();p.$_terms.truthy=p.$_terms.truthy||new f;for(let h=0;h<d.length;++h){const m=d[h];a(m!==void 0,"Cannot call truthy with undefined"),p.$_terms.truthy.add(m)}return p}},falsy:{method(...d){u.verifyFlat(d,"falsy");const p=this.clone();p.$_terms.falsy=p.$_terms.falsy||new f;for(let h=0;h<d.length;++h){const m=d[h];a(m!==void 0,"Cannot call falsy with undefined"),p.$_terms.falsy.add(m)}return p}},sensitive:{method(d=!0){return this.$_setFlag("sensitive",d)}}},cast:{number:{from:l.isBool,to:(d,p)=>d?1:0},string:{from:l.isBool,to:(d,p)=>d?"true":"false"}},manifest:{build:(d,p)=>(p.truthy&&(d=d.truthy(...p.truthy)),p.falsy&&(d=d.falsy(...p.falsy)),d)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(s,i,o)=>{const a=o(375),c=o(8068),u=o(8160),f=o(3328),l={isDate:function(d){return d instanceof Date}};s.exports=c.extend({type:"date",coerce:{from:["number","string"],method:(d,{schema:p})=>({value:l.parse(d,p._flags.format)||d})},validate(d,{schema:p,error:h,prefs:m}){if(d instanceof Date&&!isNaN(d.getTime()))return;const y=p._flags.format;return m.convert&&y&&typeof d=="string"?{value:d,errors:h("date.format",{format:y})}:{value:d,errors:h("date.base")}},rules:{compare:{method:!1,validate(d,p,{date:h},{name:m,operator:y,args:g}){const v=h==="now"?Date.now():h.getTime();return u.compare(d.getTime(),v,y)?d:p.error("date."+m,{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 a(["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 a(["javascript","unix"].includes(d),'"type" must be one of "javascript, unix"'),this.format(d)}}},cast:{number:{from:l.isDate,to:(d,p)=>d.getTime()},string:{from:l.isDate,to:(d,{prefs:p})=>f.date(d,p)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),l.parse=function(d,p){if(d instanceof Date)return d;if(typeof d!="string"&&(isNaN(d)||!isFinite(d))||/^\s*$/.test(d))return null;if(p==="iso")return u.isIsoDate(d)?l.date(d.toString()):null;const h=d;if(typeof d=="string"&&/^[+-]?\d+(\.\d+)?$/.test(d)&&(d=parseFloat(d)),p){if(p==="javascript")return l.date(1*d);if(p==="unix")return l.date(1e3*d);if(typeof h=="string")return null}return l.date(d)},l.date=function(d){const p=new Date(d);return isNaN(p.getTime())?null:p}},390:(s,i,o)=>{const a=o(375),c=o(7824);s.exports=c.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(u){return a(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 a(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 a(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,o)=>{const a=o(978),c=o(375),u=o(8571),f=o(3652),l=o(8068),d=o(8160),p=o(3292),h=o(6354),m=o(6133),y=o(3328),g={renameDefaults:{alias:!1,multiple:!1,override:!1}};s.exports=l.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:void 0}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(v,x)=>v.keys(x),validate(v,{schema:x,error:_,state:A,prefs:N}){if(!v||typeof v!==x.$_property("typeof")||Array.isArray(v))return{value:v,errors:_("object.base",{type:x.$_property("typeof")})};if(!(x.$_terms.renames||x.$_terms.dependencies||x.$_terms.keys||x.$_terms.patterns||x.$_terms.externals))return;v=g.clone(v,N);const T=[];if(x.$_terms.renames&&!g.rename(x,v,A,N,T))return{value:v,errors:T};if(!x.$_terms.keys&&!x.$_terms.patterns&&!x.$_terms.dependencies)return{value:v,errors:T};const E=new Set(Object.keys(v));if(x.$_terms.keys){const P=[v,...A.ancestors];for(const k of x.$_terms.keys){const M=k.key,I=v[M];E.delete(M);const j=A.localize([...A.path,M],P,k),L=k.schema.$_validate(I,j,N);if(L.errors){if(N.abortEarly)return{value:v,errors:L.errors};L.value!==void 0&&(v[M]=L.value),T.push(...L.errors)}else k.schema._flags.result==="strip"||L.value===void 0&&I!==void 0?delete v[M]:L.value!==void 0&&(v[M]=L.value)}}if(E.size||x._flags._hasPatternMatch){const P=g.unknown(x,v,E,T,A,N);if(P)return P}if(x.$_terms.dependencies)for(const P of x.$_terms.dependencies){if(P.key!==null&&g.isPresent(P.options)(P.key.resolve(v,A,N,null,{shadow:!1}))===!1)continue;const k=g.dependencies[P.rel](x,P,v,A,N);if(k){const M=x.$_createError(k.code,v,k.context,A,N);if(N.abortEarly)return{value:v,errors:M};T.push(M)}}return{value:v,errors:T}},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,x,_){y.isTemplate(v)||(v=p.ref(v)),c(_===void 0||typeof _=="string","Message must be a string"),x=this.$_compile(x,{appendPath:!0});const A=this.$_addRule({name:"assert",args:{subject:v,schema:x,message:_}});return A.$_mutateRegister(v),A.$_mutateRegister(x),A},validate(v,{error:x,prefs:_,state:A},{subject:N,schema:T,message:E}){const P=N.resolve(v,A,_),k=m.isRef(N)?N.absolute(A):[];return T.$_match(P,A.localize(k,[v,...A.ancestors],T),_)?v:x("object.assert",{subject:N,message:E})},args:["subject","schema","message"],multi:!0},instance:{method(v,x){return c(typeof v=="function","constructor must be a function"),x=x||v.name,this.$_addRule({name:"instance",args:{constructor:v,name:x}})},validate:(v,x,{constructor:_,name:A})=>v instanceof _?v:x.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 x=this.clone();if(v)if(Object.keys(v).length){x.$_terms.keys=x.$_terms.keys?x.$_terms.keys.filter(_=>!v.hasOwnProperty(_.key)):new g.Keys;for(const _ in v)d.tryWithPath(()=>x.$_terms.keys.push({key:_,schema:this.$_compile(v[_])}),_)}else x.$_terms.keys=new g.Keys;else x.$_terms.keys=null;return x.$_mutateRebuild()}},length:{method(v){return this.$_addRule({name:"length",args:{limit:v},operator:"="})},validate:(v,x,{limit:_},{name:A,operator:N,args:T})=>d.compare(Object.keys(v).length,_,N)?v:x.error("object."+A,{limit:T.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,x,_={}){const A=v instanceof RegExp;A||(v=this.$_compile(v,{appendPath:!0})),c(x!==void 0,"Invalid rule"),d.assertOptions(_,["fallthrough","matches"]),A&&c(!v.flags.includes("g")&&!v.flags.includes("y"),"pattern should not use global or sticky mode"),x=this.$_compile(x,{appendPath:!0});const N=this.clone();N.$_terms.patterns=N.$_terms.patterns||[];const T={[A?"regex":"schema"]:v,rule:x};return _.matches&&(T.matches=this.$_compile(_.matches),T.matches.type!=="array"&&(T.matches=T.matches.$_root.array().items(T.matches)),N.$_mutateRegister(T.matches),N.$_setFlag("_hasPatternMatch",!0,{clone:!1})),_.fallthrough&&(T.fallthrough=!0),N.$_terms.patterns.push(T),N.$_mutateRegister(x),N}},ref:{method(){return this.$_addRule("ref")},validate:(v,x)=>m.isRef(v)?v:x.error("object.refType",{value:v})},regex:{method(){return this.$_addRule("regex")},validate:(v,x)=>v instanceof RegExp?v:x.error("object.regex",{value:v})},rename:{method(v,x,_={}){c(typeof v=="string"||v instanceof RegExp,"Rename missing the from argument"),c(typeof x=="string"||x instanceof y,"Invalid rename to argument"),c(x!==v,"Cannot rename key to same name:",v),d.assertOptions(_,["alias","ignoreUndefined","override","multiple"]);const A=this.clone();A.$_terms.renames=A.$_terms.renames||[];for(const N of A.$_terms.renames)c(N.from!==v,"Cannot rename the same key multiple times");return x instanceof y&&A.$_mutateRegister(x),A.$_terms.renames.push({from:v,to:x,options:a(g.renameDefaults,_)}),A}},schema:{method(v="any"){return this.$_addRule({name:"schema",args:{type:v}})},validate:(v,x,{type:_})=>!d.isSchema(v)||_!=="any"&&v.type!==_?x.error("object.schema",{type:_}):v},unknown:{method(v){return this.$_setFlag("unknown",v!==!1)}},with:{method(v,x,_={}){return g.dependency(this,"with",v,x,_)}},without:{method(v,x,_={}){return g.dependency(this,"without",v,x,_)}},xor:{method(...v){return d.verifyFlat(v,"xor"),g.dependency(this,"xor",null,v)}}},overrides:{default(v,x){return v===void 0&&(v=d.symbols.deepDefault),this.$_parent("default",v,x)}},rebuild(v){if(v.$_terms.keys){const x=new f.Sorter;for(const _ of v.$_terms.keys)d.tryWithPath(()=>x.add(_,{after:_.schema.$_rootReferences(),group:_.key}),_.key);v.$_terms.keys=new g.Keys(...x.nodes)}},manifest:{build(v,x){if(x.keys&&(v=v.keys(x.keys)),x.dependencies)for(const{rel:_,key:A=null,peers:N,options:T}of x.dependencies)v=g.dependency(v,_,A,N,T);if(x.patterns)for(const{regex:_,schema:A,rule:N,fallthrough:T,matches:E}of x.patterns)v=v.pattern(_||A,N,{fallthrough:T,matches:E});if(x.renames)for(const{from:_,to:A,options:N}of x.renames)v=v.rename(_,A,N);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,x){if(typeof v=="object"){if(x.nonEnumerables)return u(v,{shallow:!0});const A=Object.create(Object.getPrototypeOf(v));return Object.assign(A,v),A}const _=function(...A){return v.apply(this,A)};return _.prototype=u(v.prototype),Object.defineProperty(_,"name",{value:v.name,writable:!1}),Object.defineProperty(_,"length",{value:v.length,writable:!1}),Object.assign(_,v),_},g.dependency=function(v,x,_,A,N){c(_===null||typeof _=="string",x,"key must be a strings"),N||(N=A.length>1&&typeof A[A.length-1]=="object"?A.pop():{}),d.assertOptions(N,["separator","isPresent"]),A=[].concat(A);const T=d.default(N.separator,"."),E=[];for(const k of A)c(typeof k=="string",x,"peers must be strings"),E.push(p.ref(k,{separator:T,ancestor:0,prefix:!1}));_!==null&&(_=p.ref(_,{separator:T,ancestor:0,prefix:!1}));const P=v.clone();return P.$_terms.dependencies=P.$_terms.dependencies||[],P.$_terms.dependencies.push(new g.Dependency(x,_,E,A,N)),P},g.dependencies={and(v,x,_,A,N){const T=[],E=[],P=x.peers.length,k=g.isPresent(x.options);for(const M of x.peers)k(M.resolve(_,A,N,null,{shadow:!1}))===!1?T.push(M.key):E.push(M.key);if(T.length!==P&&E.length!==P)return{code:"object.and",context:{present:E,presentWithLabels:g.keysToLabels(v,E),missing:T,missingWithLabels:g.keysToLabels(v,T)}}},nand(v,x,_,A,N){const T=[],E=g.isPresent(x.options);for(const M of x.peers)E(M.resolve(_,A,N,null,{shadow:!1}))&&T.push(M.key);if(T.length!==x.peers.length)return;const P=x.paths[0],k=x.paths.slice(1);return{code:"object.nand",context:{main:P,mainWithLabel:g.keysToLabels(v,P),peers:k,peersWithLabels:g.keysToLabels(v,k)}}},or(v,x,_,A,N){const T=g.isPresent(x.options);for(const E of x.peers)if(T(E.resolve(_,A,N,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:x.paths,peersWithLabels:g.keysToLabels(v,x.paths)}}},oxor(v,x,_,A,N){const T=[],E=g.isPresent(x.options);for(const k of x.peers)E(k.resolve(_,A,N,null,{shadow:!1}))&&T.push(k.key);if(!T.length||T.length===1)return;const P={peers:x.paths,peersWithLabels:g.keysToLabels(v,x.paths)};return P.present=T,P.presentWithLabels=g.keysToLabels(v,T),{code:"object.oxor",context:P}},with(v,x,_,A,N){const T=g.isPresent(x.options);for(const E of x.peers)if(T(E.resolve(_,A,N,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:x.key.key,mainWithLabel:g.keysToLabels(v,x.key.key),peer:E.key,peerWithLabel:g.keysToLabels(v,E.key)}}},without(v,x,_,A,N){const T=g.isPresent(x.options);for(const E of x.peers)if(T(E.resolve(_,A,N,null,{shadow:!1})))return{code:"object.without",context:{main:x.key.key,mainWithLabel:g.keysToLabels(v,x.key.key),peer:E.key,peerWithLabel:g.keysToLabels(v,E.key)}}},xor(v,x,_,A,N){const T=[],E=g.isPresent(x.options);for(const k of x.peers)E(k.resolve(_,A,N,null,{shadow:!1}))&&T.push(k.key);if(T.length===1)return;const P={peers:x.paths,peersWithLabels:g.keysToLabels(v,x.paths)};return T.length===0?{code:"object.missing",context:P}:(P.present=T,P.presentWithLabels=g.keysToLabels(v,T),{code:"object.xor",context:P})}},g.keysToLabels=function(v,x){return Array.isArray(x)?x.map(_=>v.$_mapLabels(_)):v.$_mapLabels(x)},g.isPresent=function(v){return typeof v.isPresent=="function"?v.isPresent:x=>x!==void 0},g.rename=function(v,x,_,A,N){const T={};for(const E of v.$_terms.renames){const P=[],k=typeof E.from!="string";if(k)for(const M in x){if(x[M]===void 0&&E.options.ignoreUndefined||M===E.to)continue;const I=E.from.exec(M);I&&P.push({from:M,to:E.to,match:I})}else!Object.prototype.hasOwnProperty.call(x,E.from)||x[E.from]===void 0&&E.options.ignoreUndefined||P.push(E);for(const M of P){const I=M.from;let j=M.to;if(j instanceof y&&(j=j.render(x,_,A,M.match)),I!==j){if(!E.options.multiple&&T[j]&&(N.push(v.$_createError("object.rename.multiple",x,{from:I,to:j,pattern:k},_,A)),A.abortEarly)||Object.prototype.hasOwnProperty.call(x,j)&&!E.options.override&&!T[j]&&(N.push(v.$_createError("object.rename.override",x,{from:I,to:j,pattern:k},_,A)),A.abortEarly))return!1;x[I]===void 0?delete x[j]:x[j]=x[I],T[j]=!0,E.options.alias||delete x[I]}}}return!0},g.unknown=function(v,x,_,A,N,T){if(v.$_terms.patterns){let E=!1;const P=v.$_terms.patterns.map(M=>{if(M.matches)return E=!0,[]}),k=[x,...N.ancestors];for(const M of _){const I=x[M],j=[...N.path,M];for(let L=0;L<v.$_terms.patterns.length;++L){const H=v.$_terms.patterns[L];if(H.regex){const U=H.regex.test(M);if(N.mainstay.tracer.debug(N,"rule",`pattern.${L}`,U?"pass":"error"),!U)continue}else if(!H.schema.$_match(M,N.nest(H.schema,`pattern.${L}`),T))continue;_.delete(M);const K=N.localize(j,k,{schema:H.rule,key:M}),V=H.rule.$_validate(I,K,T);if(V.errors){if(T.abortEarly)return{value:x,errors:V.errors};A.push(...V.errors)}if(H.matches&&P[L].push(M),x[M]=V.value,!H.fallthrough)break}}if(E)for(let M=0;M<P.length;++M){const I=P[M];if(!I)continue;const j=v.$_terms.patterns[M].matches,L=N.localize(N.path,k,j),H=j.$_validate(I,L,T);if(H.errors){const K=h.details(H.errors,{override:!1});K.matches=I;const V=v.$_createError("object.pattern.match",x,K,N,T);if(T.abortEarly)return{value:x,errors:V};A.push(V)}}}if(_.size&&(v.$_terms.keys||v.$_terms.patterns)){if(T.stripUnknown&&v._flags.unknown===void 0||T.skipFunctions){const E=!(!T.stripUnknown||T.stripUnknown!==!0&&!T.stripUnknown.objects);for(const P of _)E?(delete x[P],_.delete(P)):typeof x[P]=="function"&&_.delete(P)}if(!d.default(v._flags.unknown,T.allowUnknown))for(const E of _){const P=N.localize([...N.path,E],[]),k=v.$_createError("object.unknown",x[E],{child:E},P,T,{flags:!1});if(T.abortEarly)return{value:x,errors:k};A.push(k)}}},g.Dependency=class{constructor(v,x,_,A,N){this.rel=v,this.key=x,this.peers=_,this.paths=A,this.options=N}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 x=this.slice(),_=new Map;for(let A=0;A<x.length;++A)_.set(x[A].key,A);for(const A of v){const N=A.key,T=_.get(N);T!==void 0?x[T]={key:N,schema:x[T].schema.concat(A.schema)}:x.push(A)}return x}}},8785:(s,i,o)=>{const a=o(375),c=o(8068),u=o(8160),f=o(3292),l=o(6354),d={};s.exports=c.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(p,h)=>p.ref(h),validate(p,{schema:h,state:m,prefs:y}){a(h.$_terms.link,"Uninitialized link schema");const g=d.generate(h,p,m,y),v=h.$_terms.link[0].ref;return g.$_validate(p,m.nest(g,`link:${v.display}:${g.type}`),y)},generate:(p,h,m,y)=>d.generate(p,h,m,y),rules:{ref:{method(p){a(!this.$_terms.link,"Cannot reinitialize schema"),p=f.ref(p),a(p.type==="value"||p.type==="local","Invalid reference type:",p.type),a(p.type==="local"||p.ancestor==="root"||p.ancestor>0,"Link cannot reference itself");const h=this.clone();return h.$_terms.link=[{ref:p}],h}},relative:{method(p=!0){return this.$_setFlag("relative",p)}}},overrides:{concat(p){a(this.$_terms.link,"Uninitialized link schema"),a(u.isSchema(p),"Invalid schema object"),a(p.type!=="link","Cannot merge type link with another link");const h=this.clone();return h.$_terms.whens||(h.$_terms.whens=[]),h.$_terms.whens.push({concat:p}),h.$_mutateRebuild()}},manifest:{build:(p,h)=>(a(h.link,"Invalid link description missing link"),p.ref(h.link))}}),d.generate=function(p,h,m,y){let g=m.mainstay.links.get(p);if(g)return g._generate(h,m,y).schema;const v=p.$_terms.link[0].ref,{perspective:x,path:_}=d.perspective(v,m);d.assert(x,"which is outside of schema boundaries",v,p,m,y);try{g=_.length?x.$_reach(_):x}catch{d.assert(!1,"to non-existing schema",v,p,m,y)}return d.assert(g.type!=="link","which is another link",v,p,m,y),p._flags.relative||m.mainstay.links.set(p,g),g._generate(h,m,y).schema},d.perspective=function(p,h){if(p.type==="local"){for(const{schema:m,key:y}of h.schemas){if((m._flags.id||y)===p.path[0])return{perspective:m,path:p.path.slice(1)};if(m.$_terms.shared){for(const g of m.$_terms.shared)if(g._flags.id===p.path[0])return{perspective:g,path:p.path.slice(1)}}}return{perspective:null,path:null}}return p.ancestor==="root"?{perspective:h.schemas[h.schemas.length-1].schema,path:p.path}:{perspective:h.schemas[p.ancestor]&&h.schemas[p.ancestor].schema,path:p.path}},d.assert=function(p,h,m,y,g,v){p||a(!1,`"${l.label(y._flags,g,v)}" contains link reference "${m.display}" ${h}`)}},3832:(s,i,o)=>{const a=o(375),c=o(8068),u=o(8160),f={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(l){const d=l.toString(),p=d.indexOf("."),h=d.indexOf("e");return(p<0?0:(h<0?d.length:h)-p-1)+(h<0?0:Math.max(0,-parseInt(d.slice(h+1))))}};s.exports=c.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(l,{schema:d,error:p}){if(!l.match(f.numberRx))return;l=l.trim();const h={value:parseFloat(l)};if(h.value===0&&(h.value=0),!d._flags.unsafe)if(l.match(/e/i)){if(f.extractSignificantDigits(l)!==f.extractSignificantDigits(String(h.value)))return h.errors=p("number.unsafe"),h}else{const m=h.value.toString();if(m.match(/e/i))return h;if(m!==f.normalizeDecimal(l))return h.errors=p("number.unsafe"),h}return h}},validate(l,{schema:d,error:p,prefs:h}){if(l===1/0||l===-1/0)return{value:l,errors:p("number.infinity")};if(!u.isNumber(l))return{value:l,errors:p("number.base")};const m={value:l};if(h.convert){const y=d.$_getRule("precision");if(y){const g=Math.pow(10,y.args.limit);m.value=Math.round(m.value*g)/g}}return m.value===0&&(m.value=0),!d._flags.unsafe&&(l>Number.MAX_SAFE_INTEGER||l<Number.MIN_SAFE_INTEGER)&&(m.errors=p("number.unsafe")),m},rules:{compare:{method:!1,validate:(l,d,{limit:p},{name:h,operator:m,args:y})=>u.compare(l,p,m)?l:d.error("number."+h,{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,p=Math.pow(10,d);return this.$_addRule({name:"multiple",args:{base:l,baseDecimalPlace:d,pfactor:p}})},validate:(l,d,{base:p,baseDecimalPlace:h,pfactor:m},y)=>f.decimalPlaces(l)>h?d.error("number.multiple",{multiple:y.args.base,value:l}):Math.round(m*l)%Math.round(m*p)==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 a(Number.isSafeInteger(l),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:l}})},validate(l,d,{limit:p}){const h=l.toString().match(f.precisionRx);return Math.max((h[1]?h[1].length:0)-(h[2]?parseInt(h[2],10):0),0)<=p?l:d.error("number.precision",{limit:p,value:l})},convert:!0},sign:{method(l){return a(["negative","positive"].includes(l),"Invalid sign",l),this.$_addRule({name:"sign",args:{sign:l}})},validate:(l,d,{sign:p})=>p==="negative"&&l<0||p==="positive"&&l>0?l:d.error(`number.${p}`)},unsafe:{method(l=!0){return a(typeof l=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",l)}}},cast:{string:{from:l=>typeof l=="number",to:(l,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,o)=>{const a=o(7824);s.exports=a.extend({type:"object",cast:{map:{from:c=>c&&typeof c=="object",to:(c,u)=>new Map(Object.entries(c))}}})},7417:(s,i,o)=>{const a=o(375),c=o(5380),u=o(1745),f=o(9959),l=o(6064),d=o(9926),p=o(5752),h=o(8068),m=o(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=h.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(g,{schema:v,state:x,prefs:_}){const A=v.$_getRule("normalize");A&&(g=g.normalize(A.args.form));const N=v.$_getRule("case");N&&(g=N.args.direction==="upper"?g.toLocaleUpperCase():g.toLocaleLowerCase());const T=v.$_getRule("trim");if(T&&T.args.enabled&&(g=g.trim()),v.$_terms.replacements)for(const P of v.$_terms.replacements)g=g.replace(P.pattern,P.replacement);const E=v.$_getRule("hex");if(E&&E.args.options.byteAligned&&g.length%2!=0&&(g=`0${g}`),v.$_getRule("isoDate")){const P=y.isoDate(g);P&&(g=P)}if(v._flags.truncate){const P=v.$_getRule("max");if(P){let k=P.args.limit;if(m.isResolvable(k)&&(k=k.resolve(g,x,_),!m.limit(k)))return{value:g,errors:v.$_createError("any.ref",k,{ref:P.args.limit,arg:"limit",reason:"must be a positive integer"},x,_)};g=g.slice(0,k)}}return{value:g}}},validate(g,{schema:v,error:x}){if(typeof g!="string")return{value:g,errors:x("string.base")};if(g===""){const _=v.$_getRule("min");return _&&_.args.limit===0?void 0:{value:g,errors:x("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(g,v)=>/^[a-zA-Z0-9]+$/.test(g)?g:v.error("string.alphanum")},base64:{method(g={}){return m.assertOptions(g,["paddingRequired","urlSafe"]),g={urlSafe:!1,paddingRequired:!0,...g},a(typeof g.paddingRequired=="boolean","paddingRequired must be boolean"),a(typeof g.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:g}})},validate:(g,v,{options:x})=>y.base64Regex[x.paddingRequired][x.urlSafe].test(g)?g:v.error("string.base64")},case:{method(g){return a(["lower","upper"].includes(g),"Invalid case:",g),this.$_addRule({name:"case",args:{direction:g}})},validate:(g,v,{direction:x})=>x==="lower"&&g===g.toLocaleLowerCase()||x==="upper"&&g===g.toLocaleUpperCase()?g:v.error(`string.${x}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(g,v){let x=g.length,_=0,A=1;for(;x--;){const N=g.charAt(x)*A;_+=N-9*(N>9),A^=3}return _>0&&_%10==0?g:v.error("string.creditCard")}},dataUri:{method(g={}){return m.assertOptions(g,["paddingRequired"]),g={paddingRequired:!0,...g},a(typeof g.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:g}})},validate(g,v,{options:x}){const _=g.match(y.dataUriRegex);return _&&(!_[2]||_[2]!=="base64"||y.base64Regex[x.paddingRequired].false.test(_[3]))?g:v.error("string.dataUri")}},domain:{method(g){g&&m.assertOptions(g,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const v=y.addressOptions(g);return this.$_addRule({name:"domain",args:{options:g},address:v})},validate:(g,v,x,{address:_})=>c.isValid(g,_)?g:v.error("string.domain")},email:{method(g={}){m.assertOptions(g,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),a(g.multiple===void 0||typeof g.multiple=="boolean","multiple option must be an boolean");const v=y.addressOptions(g),x=new RegExp(`\\s*[${g.separator?l(g.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:g},regex:x,address:v})},validate(g,v,{options:x},{regex:_,address:A}){const N=x.multiple?g.split(_):[g],T=[];for(const E of N)u.isValid(E,A)||T.push(E);return T.length?v.error("string.email",{value:g,invalids:T}):g}},guid:{alias:"uuid",method(g={}){m.assertOptions(g,["version","separator"]);let v="";if(g.version){const A=[].concat(g.version);a(A.length>=1,"version must have at least 1 valid version specified");const N=new Set;for(let T=0;T<A.length;++T){const E=A[T];a(typeof E=="string","version at position "+T+" must be a string");const P=y.guidVersions[E.toLowerCase()];a(P,"version at position "+T+" must be one of "+Object.keys(y.guidVersions).join(", ")),a(!N.has(P),"version at position "+T+" must not be a duplicate"),v+=P,N.add(P)}}a(y.guidSeparators.has(g.separator),'separator must be one of true, false, "-", or ":"');const x=g.separator===void 0?"[:-]?":g.separator===!0?"[:-]":g.separator===!1?"[]?":`\\${g.separator}`,_=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${x})[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:_})},validate(g,v,x,{regex:_}){const A=_.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 m.assertOptions(g,["byteAligned","prefix"]),g={byteAligned:!1,prefix:!1,...g},a(typeof g.byteAligned=="boolean","byteAligned must be boolean"),a(typeof g.prefix=="boolean"||g.prefix==="optional",'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:g}})},validate:(g,v,{options:x})=>(x.prefix==="optional"?y.hexRegex.withOptionalPrefix:x.prefix===!0?y.hexRegex.withPrefix:y.hexRegex.withoutPrefix).test(g)?x.byteAligned&&g.length%2!=0?v.error("string.hexAlign"):g:v.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(g,v)=>c.isValid(g,{minDomainSegments:1})||y.ipRegex.test(g)?g:v.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(g={}){m.assertOptions(g,["cidr","version"]);const{cidr:v,versions:x,regex:_}=f.regex(g),A=g.version?x:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:v,version:A}},regex:_})},validate:(g,v,{options:x},{regex:_})=>_.test(g)?g:x.version?v.error("string.ipVersion",{value:g,cidr:x.cidr,version:x.version}):v.error("string.ip",{value:g,cidr:x.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:x,encoding:_},{name:A,operator:N,args:T}){const E=!_&&g.length;return m.compare(E,x,N)?g:v.error("string."+A,{limit:T.limit,value:g,encoding:_})},args:[{name:"limit",ref:!0,assert:m.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(g,v){return y.length(this,"max",g,"<=",v)},args:["limit","encoding"]},min:{method(g,v){return y.length(this,"min",g,">=",v)},args:["limit","encoding"]},normalize:{method(g="NFC"){return a(y.normalizationForms.includes(g),"normalization form must be one of "+y.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:g}})},validate:(g,{error:v},{form:x})=>g===g.normalize(x)?g:v("string.normalize",{value:g,form:x}),convert:!0},pattern:{alias:"regex",method(g,v={}){a(g instanceof RegExp,"regex must be a RegExp"),a(!g.flags.includes("g")&&!g.flags.includes("y"),"regex should not use global or sticky mode"),typeof v=="string"&&(v={name:v}),m.assertOptions(v,["invert","name"]);const x=["string.pattern",v.invert?".invert":"",v.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:g,options:v},errorCode:x})},validate:(g,v,{regex:x,options:_},{errorCode:A})=>x.test(g)^_.invert?g:v.error(A,{name:_.name,regex:x,value:g}),args:["regex","options"],multi:!0},replace:{method(g,v){typeof g=="string"&&(g=new RegExp(l(g),"g")),a(g instanceof RegExp,"pattern must be a RegExp"),a(typeof v=="string","replacement must be a String");const x=this.clone();return x.$_terms.replacements||(x.$_terms.replacements=[]),x.$_terms.replacements.push({pattern:g,replacement:v}),x}},token:{method(){return this.$_addRule("token")},validate:(g,v)=>/^\w+$/.test(g)?g:v.error("string.token")},trim:{method(g=!0){return a(typeof g=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:g}})},validate:(g,v,{enabled:x})=>x&&g!==g.trim()?v.error("string.trim"):g,convert:!0},truncate:{method(g=!0){return a(typeof g=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",g)}},uppercase:{method(){return this.case("upper")}},uri:{method(g={}){m.assertOptions(g,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),g.domain&&m.assertOptions(g.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:v,scheme:x}=p.regex(g),_=g.domain?y.addressOptions(g.domain):null;return this.$_addRule({name:"uri",args:{options:g},regex:v,domain:_,scheme:x})},validate(g,v,{options:x},{regex:_,domain:A,scheme:N}){if(["http:/","https:/"].includes(g))return v.error("string.uri");let T=_.exec(g);if(!T&&v.prefs.convert&&x.encodeUri){const E=encodeURI(g);T=_.exec(E),T&&(g=E)}if(T){const E=T[1]||T[2];return!A||x.allowRelative&&!E||c.isValid(E,A)?g:v.error("string.domain",{value:E})}return x.relativeOnly?v.error("string.uriRelativeOnly"):x.scheme?v.error("string.uriCustomScheme",{scheme:N,value:g}):v.error("string.uri")}}},manifest:{build(g,v){if(v.replacements)for(const{pattern:x,replacement:_}of v.replacements)g=g.replace(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(a(g.minDomainSegments===void 0||Number.isSafeInteger(g.minDomainSegments)&&g.minDomainSegments>0,"minDomainSegments must be a positive integer"),a(g.maxDomainSegments===void 0||Number.isSafeInteger(g.maxDomainSegments)&&g.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),g.tlds===!1)return g;if(g.tlds===!0||g.tlds===void 0)return a(y.tlds,"Built-in TLD list disabled"),Object.assign({},g,y.tlds);a(typeof g.tlds=="object","tlds must be true, false, or an object");const v=g.tlds.deny;if(v)return Array.isArray(v)&&(g=Object.assign({},g,{tlds:{deny:new Set(v)}})),a(g.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),a(!g.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),y.validateTlds(g.tlds.deny,"tlds.deny"),g;const x=g.tlds.allow;return x?x===!0?(a(y.tlds,"Built-in TLD list disabled"),Object.assign({},g,y.tlds)):(Array.isArray(x)&&(g=Object.assign({},g,{tlds:{allow:new Set(x)}})),a(g.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),y.validateTlds(g.tlds.allow,"tlds.allow"),g):g},y.validateTlds=function(g,v){for(const x of g)a(c.isValid(x,{minDomainSegments:1,maxDomainSegments:1}),`${v} must contain valid top level domain names`)},y.isoDate=function(g){if(!m.isIsoDate(g))return null;/.*T.*[+-]\d\d$/.test(g)&&(g+="00");const v=new Date(g);return isNaN(v.getTime())?null:v.toISOString()},y.length=function(g,v,x,_,A){return a(!A||!1,"Invalid encoding:",A),g.$_addRule({name:v,method:"length",args:{limit:x,encoding:A},operator:_})}},8826:(s,i,o)=>{const a=o(375),c=o(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 p=l.$_terms.map.get(f);return p&&(f=p),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)),a(f&&f[Symbol.iterator],"Iterable must be an iterable or object");const l=this.clone(),d=[];for(const p of f){a(p&&p[Symbol.iterator],"Entry must be an iterable");const[h,m]=p;a(typeof h!="object"&&typeof h!="function"&&typeof h!="symbol","Key must not be of type object, function, or Symbol"),a(typeof m=="symbol","Value must be a Symbol"),l.$_terms.map.set(h,m),d.push(m)}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,o)=>{const a=o(375),c=o(8571),u=o(738),f=o(9621),l=o(8160),d=o(6354),p=o(493),h={result:Symbol("result")};i.entry=function(m,y,g){let v=l.defaults;g&&(a(g.warnings===void 0,"Cannot override warnings preference in synchronous validation"),a(g.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),v=l.preferences(l.defaults,g));const x=h.entry(m,y,v);a(!x.mainstay.externals.length,"Schema with external rules must use validateAsync()");const _={value:x.value};return x.error&&(_.error=x.error),x.mainstay.warnings.length&&(_.warning=d.details(x.mainstay.warnings)),x.mainstay.debug&&(_.debug=x.mainstay.debug),x.mainstay.artifacts&&(_.artifacts=x.mainstay.artifacts),_},i.entryAsync=async function(m,y,g){let v=l.defaults;g&&(v=l.preferences(l.defaults,g));const x=h.entry(m,y,v),_=x.mainstay;if(x.error)throw _.debug&&(x.error.debug=_.debug),x.error;if(_.externals.length){let N=x.value;const T=[];for(const E of _.externals){const P=E.state.path,k=E.schema.type==="link"?_.links.get(E.schema):null;let M,I,j=N;const L=P.length?[N]:[],H=P.length?f(m,P):m;if(P.length){M=P[P.length-1];let K=N;for(const V of P.slice(0,-1))K=K[V],L.unshift(K);I=L[0],j=I[M]}try{const K=(U,Q)=>(k||E.schema).$_createError(U,j,Q,E.state,v),V=await E.method(j,{schema:E.schema,linked:k,state:E.state,prefs:g,original:H,error:K,errorsArray:h.errorsArray,warn:(U,Q)=>_.warnings.push((k||E.schema).$_createError(U,j,Q,E.state,v)),message:(U,Q)=>(k||E.schema).$_createError("external",j,Q,E.state,v,{messages:U})});if(V===void 0||V===j)continue;if(V instanceof d.Report){if(_.tracer.log(E.schema,E.state,"rule","external","error"),T.push(V),v.abortEarly)break;continue}if(Array.isArray(V)&&V[l.symbols.errors]){if(_.tracer.log(E.schema,E.state,"rule","external","error"),T.push(...V),v.abortEarly)break;continue}I?(_.tracer.value(E.state,"rule",j,V,"external"),I[M]=V):(_.tracer.value(E.state,"rule",N,V,"external"),N=V)}catch(K){throw v.errors.label&&(K.message+=` (${E.label})`),K}}if(x.value=N,T.length)throw x.error=d.process(T,m,v),_.debug&&(x.error.debug=_.debug),x.error}if(!v.warnings&&!v.debug&&!v.artifacts)return x.value;const A={value:x.value};return _.warnings.length&&(A.warning=d.details(_.warnings)),_.debug&&(A.debug=_.debug),_.artifacts&&(A.artifacts=_.artifacts),A},h.Mainstay=class{constructor(m,y,g){this.externals=[],this.warnings=[],this.tracer=m,this.debug=y,this.links=g,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const m=this._snapshots.pop();this.externals=m.externals,this.warnings=m.warnings}commit(){this._snapshots.pop()}},h.entry=function(m,y,g){const{tracer:v,cleanup:x}=h.tracer(y,g),_=g.debug?[]:null,A=y._ids._schemaChain?new Map:null,N=new h.Mainstay(v,_,A),T=y._ids._schemaChain?[{schema:y}]:null,E=new p([],[],{mainstay:N,schemas:T}),P=i.validate(m,y,E,g);x&&y.$_root.untrace();const k=d.process(P.errors,m,g);return{value:P.value,error:k,mainstay:N}},h.tracer=function(m,y){return m.$_root._tracer?{tracer:m.$_root._tracer._register(m)}:y.debug?(a(m.$_root.trace,"Debug mode not supported"),{tracer:m.$_root.trace()._register(m),cleanup:!0}):{tracer:h.ignore}},i.validate=function(m,y,g,v,x={}){if(y.$_terms.whens&&(y=y._generate(m,g,v).schema),y._preferences&&(v=h.prefs(y,v)),y._cache&&v.cache){const k=y._cache.get(m);if(g.mainstay.tracer.debug(g,"validate","cached",!!k),k)return k}const _=(k,M,I)=>y.$_createError(k,m,M,I||g,v),A={original:m,prefs:v,schema:y,state:g,error:_,errorsArray:h.errorsArray,warn:(k,M,I)=>g.mainstay.warnings.push(_(k,M,I)),message:(k,M)=>y.$_createError("custom",m,M,g,v,{messages:k})};g.mainstay.tracer.entry(y,g);const N=y._definition;if(N.prepare&&m!==void 0&&v.convert){const k=N.prepare(m,A);if(k){if(g.mainstay.tracer.value(g,"prepare",m,k.value),k.errors)return h.finalize(k.value,[].concat(k.errors),A);m=k.value}}if(N.coerce&&m!==void 0&&v.convert&&(!N.coerce.from||N.coerce.from.includes(typeof m))){const k=N.coerce.method(m,A);if(k){if(g.mainstay.tracer.value(g,"coerced",m,k.value),k.errors)return h.finalize(k.value,[].concat(k.errors),A);m=k.value}}const T=y._flags.empty;T&&T.$_match(h.trim(m,y),g.nest(T),l.defaults)&&(g.mainstay.tracer.value(g,"empty",m,void 0),m=void 0);const E=x.presence||y._flags.presence||(y._flags._endedSwitch?null:v.presence);if(m===void 0){if(E==="forbidden")return h.finalize(m,null,A);if(E==="required")return h.finalize(m,[y.$_createError("any.required",m,null,g,v)],A);if(E==="optional"){if(y._flags.default!==l.symbols.deepDefault)return h.finalize(m,null,A);g.mainstay.tracer.value(g,"default",m,{}),m={}}}else if(E==="forbidden")return h.finalize(m,[y.$_createError("any.unknown",m,null,g,v)],A);const P=[];if(y._valids){const k=y._valids.get(m,g,v,y._flags.insensitive);if(k)return v.convert&&(g.mainstay.tracer.value(g,"valids",m,k.value),m=k.value),g.mainstay.tracer.filter(y,g,"valid",k),h.finalize(m,null,A);if(y._flags.only){const M=y.$_createError("any.only",m,{valids:y._valids.values({display:!0})},g,v);if(v.abortEarly)return h.finalize(m,[M],A);P.push(M)}}if(y._invalids){const k=y._invalids.get(m,g,v,y._flags.insensitive);if(k){g.mainstay.tracer.filter(y,g,"invalid",k);const M=y.$_createError("any.invalid",m,{invalids:y._invalids.values({display:!0})},g,v);if(v.abortEarly)return h.finalize(m,[M],A);P.push(M)}}if(N.validate){const k=N.validate(m,A);if(k&&(g.mainstay.tracer.value(g,"base",m,k.value),m=k.value,k.errors)){if(!Array.isArray(k.errors))return P.push(k.errors),h.finalize(m,P,A);if(k.errors.length)return P.push(...k.errors),h.finalize(m,P,A)}}return y._rules.length?h.rules(m,P,A):h.finalize(m,P,A)},h.rules=function(m,y,g){const{schema:v,state:x,prefs:_}=g;for(const A of v._rules){const N=v._definition.rules[A.method];if(N.convert&&_.convert){x.mainstay.tracer.log(v,x,"rule",A.name,"full");continue}let T,E=A.args;if(A._resolve.length){E=Object.assign({},E);for(const k of A._resolve){const M=N.argsByName.get(k),I=E[k].resolve(m,x,_),j=M.normalize?M.normalize(I):I,L=l.validateArg(j,null,M);if(L){T=v.$_createError("any.ref",I,{arg:k,ref:E[k],reason:L},x,_);break}E[k]=j}}T=T||N.validate(m,g,E,A);const P=h.rule(T,A);if(P.errors){if(x.mainstay.tracer.log(v,x,"rule",A.name,"error"),A.warn){x.mainstay.warnings.push(...P.errors);continue}if(_.abortEarly)return h.finalize(m,P.errors,g);y.push(...P.errors)}else x.mainstay.tracer.log(v,x,"rule",A.name,"pass"),x.mainstay.tracer.value(x,"rule",m,P.value,A.name),m=P.value}return h.finalize(m,y,g)},h.rule=function(m,y){return m instanceof d.Report?(h.error(m,y),{errors:[m],value:null}):Array.isArray(m)&&m[l.symbols.errors]?(m.forEach(g=>h.error(g,y)),{errors:m,value:null}):{errors:null,value:m}},h.error=function(m,y){return y.message&&m._setTemplate(y.message),m},h.finalize=function(m,y,g){y=y||[];const{schema:v,state:x,prefs:_}=g;if(y.length){const N=h.default("failover",void 0,y,g);N!==void 0&&(x.mainstay.tracer.value(x,"failover",m,N),m=N,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 N of y)a(N instanceof Error||N instanceof d.Report,"error() must return an Error object")}else y=[v._flags.error];if(m===void 0){const N=h.default("default",m,y,g);x.mainstay.tracer.value(x,"default",m,N),m=N}if(v._flags.cast&&m!==void 0){const N=v._definition.cast[v._flags.cast];if(N.from(m)){const T=N.to(m,g);x.mainstay.tracer.value(x,"cast",m,T,v._flags.cast),m=T}}if(v.$_terms.externals&&_.externals&&_._externals!==!1)for(const{method:N}of v.$_terms.externals)x.mainstay.externals.push({method:N,schema:v,state:x,label:d.label(v._flags,x,_)});const A={value:m,errors:y.length?y:null};return v._flags.result&&(A.value=v._flags.result==="strip"?void 0:g.original,x.mainstay.tracer.value(x,v._flags.result,m,A.value),x.shadow(m,v._flags.result)),v._cache&&_.cache!==!1&&!v._refs.length&&v._cache.set(g.original,A),m===void 0||A.errors||v._flags.artifact===void 0||(x.mainstay.artifacts=x.mainstay.artifacts||new Map,x.mainstay.artifacts.has(v._flags.artifact)||x.mainstay.artifacts.set(v._flags.artifact,[]),x.mainstay.artifacts.get(v._flags.artifact).push(x.path)),A},h.prefs=function(m,y){const g=y===l.defaults;return g&&m._preferences[l.symbols.prefs]?m._preferences[l.symbols.prefs]:(y=l.preferences(y,m._preferences),g&&(m._preferences[l.symbols.prefs]=y),y)},h.default=function(m,y,g,v){const{schema:x,state:_,prefs:A}=v,N=x._flags[m];if(A.noDefaults||N===void 0)return y;if(_.mainstay.tracer.log(x,_,"rule",m,"full"),!N)return N;if(typeof N=="function"){const T=N.length?[c(_.ancestors[0]),v]:[];try{return N(...T)}catch(E){return void g.push(x.$_createError(`any.${m}`,null,{error:E},_,A))}}return typeof N!="object"?N:N[l.symbols.literal]?N.literal:l.isResolvable(N)?N.resolve(y,_,A):c(N)},h.trim=function(m,y){if(typeof m!="string")return m;const g=y.$_getRule("trim");return g&&g.args.enabled?m.trim():m},h.ignore={active:!1,debug:u,entry:u,filter:u,log:u,resolve:u,value:u},h.errorsArray=function(){const m=[];return m[l.symbols.errors]=!0,m}},2036:(s,i,o)=>{const a=o(375),c=o(9474),u=o(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,p){if(l=l||new f.Values,d){if(d._override)return d.clone();for(const h of[...d._values,...d._refs])l.add(h)}if(p)for(const h of[...p._values,...p._refs])l.remove(h);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,p,h){return!!this.get(l,d,p,h)}get(l,d,p,h){if(!this.length)return!1;if(this._values.has(l))return{value:l};if(typeof l=="string"&&l&&h){const m=this._lowercase.get(l.toLowerCase());if(m)return{value:m}}if(!this._refs.size&&typeof l!="object")return!1;if(typeof l=="object"){for(const m of this._values)if(c(m,l))return{value:m}}if(d)for(const m of this._refs){const y=m.resolve(l,d,p,null,{in:!0});if(y===void 0)continue;const g=m.in&&typeof y=="object"?Array.isArray(y)?y:Object.keys(y):[y];for(const v of g)if(typeof v==typeof l){if(h&&l&&typeof l=="string"){if(v.toLowerCase()===l.toLowerCase())return{value:v,ref:m}}else if(c(v,l))return{value:v,ref:m}}}return!1}override(){this._override=!0}values(l){if(l&&l.display){const d=[];for(const p of[...this._values,...this._refs])p!==void 0&&d.push(p);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){a(!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 p of l)typeof p=="string"&&d.set(p.toLowerCase(),p);return d}},978:(s,i,o)=>{const a=o(375),c=o(8571),u=o(1687),f=o(9621),l={};s.exports=function(d,p,h={}){if(a(d&&typeof d=="object","Invalid defaults value: must be an object"),a(!p||p===!0||typeof p=="object","Invalid source value: must be true, falsy or an object"),a(typeof h=="object","Invalid options: must be an object"),!p)return null;if(h.shallow)return l.applyToDefaultsWithShallow(d,p,h);const m=c(d);if(p===!0)return m;const y=h.nullOverride!==void 0&&h.nullOverride;return u(m,p,{nullOverride:y,mergeArrays:!1})},l.applyToDefaultsWithShallow=function(d,p,h){const m=h.shallow;a(Array.isArray(m),"Invalid keys");const y=new Map,g=p===!0?null:new Set;for(let _ of m){_=Array.isArray(_)?_:_.split(".");const A=f(d,_);A&&typeof A=="object"?y.set(A,g&&f(p,_)||A):g&&g.add(_)}const v=c(d,{},y);if(!g)return v;for(const _ of g)l.reachCopy(v,p,_);const x=h.nullOverride!==void 0&&h.nullOverride;return u(v,p,{nullOverride:x,mergeArrays:!1})},l.reachCopy=function(d,p,h){for(const g of h){if(!(g in p))return;const v=p[g];if(typeof v!="object"||v===null)return;p=v}const m=p;let y=d;for(let g=0;g<h.length-1;++g){const v=h[g];typeof y[v]!="object"&&(y[v]={}),y=y[v]}y[h[h.length-1]]=m}},375:(s,i,o)=>{const a=o(7916);s.exports=function(c,...u){if(!c)throw u.length===1&&u[0]instanceof Error?u[0]:new a(u)}},8571:(s,i,o)=>{const a=o(9621),c=o(4277),u=o(7043),f={needsProtoHack:new Set([c.set,c.map,c.weakSet,c.weakMap])};s.exports=f.clone=function(l,d={},p=null){if(typeof l!="object"||l===null)return l;let h=f.clone,m=p;if(d.shallow){if(d.shallow!==!0)return f.cloneWithShallow(l,d);h=x=>x}else if(m){const x=m.get(l);if(x)return x}else m=new Map;const y=c.getInternalProto(l);if(y===c.buffer)return!1;if(y===c.date)return new Date(l.getTime());if(y===c.regex)return new RegExp(l);const g=f.base(l,y,d);if(g===l)return l;if(m&&m.set(l,g),y===c.set)for(const x of l)g.add(h(x,d,m));else if(y===c.map)for(const[x,_]of l)g.set(x,h(_,d,m));const v=u.keys(l,d);for(const x of v){if(x==="__proto__")continue;if(y===c.array&&x==="length"){g.length=l.length;continue}const _=Object.getOwnPropertyDescriptor(l,x);_?_.get||_.set?Object.defineProperty(g,x,_):_.enumerable?g[x]=h(l[x],d,m):Object.defineProperty(g,x,{enumerable:!1,writable:!0,configurable:!0,value:h(l[x],d,m)}):Object.defineProperty(g,x,{enumerable:!0,writable:!0,configurable:!0,value:h(l[x],d,m)})}return g},f.cloneWithShallow=function(l,d){const p=d.shallow;(d=Object.assign({},d)).shallow=!1;const h=new Map;for(const m of p){const y=a(l,m);typeof y!="object"&&typeof y!="function"||h.set(y,y)}return f.clone(l,d,h)},f.base=function(l,d,p){if(p.prototype===!1)return f.needsProtoHack.has(d)?new d.constructor:d===c.array?[]:{};const h=Object.getPrototypeOf(l);if(h&&h.isImmutable)return l;if(d===c.array){const m=[];return h!==d&&Object.setPrototypeOf(m,h),m}if(f.needsProtoHack.has(d)){const m=new h.constructor;return h!==d&&Object.setPrototypeOf(m,h),m}return Object.create(h)}},9474:(s,i,o)=>{const a=o(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 p=typeof u;if(p!==typeof f||u===null||f===null)return!1;if(p==="function"){if(!l.deepFunction||u.toString()!==f.toString())return!1}else if(p!=="object")return u!=u&&f!=f;const h=c.getSharedType(u,f,!!l.prototype);switch(h){case a.buffer:return!1;case a.promise:return u===f;case a.regex:return u.toString()===f.toString();case c.mismatched:return!1}for(let m=d.length-1;m>=0;--m)if(d[m].isSame(u,f))return!0;d.push(new c.SeenEntry(u,f));try{return!!c.isDeepEqualObj(h,u,f,l,d)}finally{d.pop()}},c.getSharedType=function(u,f,l){if(l)return Object.getPrototypeOf(u)!==Object.getPrototypeOf(f)?c.mismatched:a.getInternalProto(u);const d=a.getInternalProto(u);return d!==a.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,p){const{isDeepEqual:h,valueOf:m,hasOwnEnumerableProperty:y}=c,{keys:g,getOwnPropertySymbols:v}=Object;if(u===a.array){if(!d.part){if(f.length!==l.length)return!1;for(let T=0;T<f.length;++T)if(!h(f[T],l[T],d,p))return!1;return!0}for(const T of f)for(const E of l)if(h(T,E,d,p))return!0}else if(u===a.set){if(f.size!==l.size)return!1;if(!c.isSetSimpleEqual(f,l)){const T=new Set(Set.prototype.values.call(l));for(const E of Set.prototype.values.call(f)){if(T.delete(E))continue;let P=!1;for(const k of T)if(h(E,k,d,p)){T.delete(k),P=!0;break}if(!P)return!1}}}else if(u===a.map){if(f.size!==l.size)return!1;for(const[T,E]of Map.prototype.entries.call(f))if(E===void 0&&!Map.prototype.has.call(l,T)||!h(E,Map.prototype.get.call(l,T),d,p))return!1}else if(u===a.error&&(f.name!==l.name||f.message!==l.message))return!1;const x=m(f),_=m(l);if((f!==x||l!==_)&&!h(x,_,d,p))return!1;const A=g(f);if(!d.part&&A.length!==g(l).length&&!d.skip)return!1;let N=0;for(const T of A)if(d.skip&&d.skip.includes(T))l[T]===void 0&&++N;else if(!y(l,T)||!h(f[T],l[T],d,p))return!1;if(!d.part&&A.length-N!==g(l).length)return!1;if(d.symbols!==!1){const T=v(f),E=new Set(v(l));for(const P of T){if(!d.skip||!d.skip.includes(P)){if(y(f,P)){if(!y(l,P)||!h(f[P],l[P],d,p))return!1}else if(y(l,P))return!1}E.delete(P)}for(const P of E)if(y(l,P))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,o)=>{const a=o(8761);s.exports=class extends Error{constructor(c){super(c.filter(u=>u!=="").map(u=>typeof u=="string"?u:u instanceof Error?u.message:a(u)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,i.assert)}}},5277:s=>{const i={};s.exports=function(o){if(!o)return"";let a="";for(let c=0;c<o.length;++c){const u=o.charCodeAt(c);i.isSafe(u)?a+=o[c]:a+=i.escapeHtmlChar(u)}return a},i.escapeHtmlChar=function(o){return i.namedHtml.get(o)||(o>=256?"&#"+o+";":`&#x${o.toString(16).padStart(2,"0")};`)},i.isSafe=function(o){return i.safeCharCodes.has(o)},i.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),i.safeCharCodes=function(){const o=new Set;for(let a=32;a<123;++a)(a>=97||a>=65&&a<=90||a>=48&&a<=57||a===32||a===46||a===44||a===45||a===58||a===95)&&o.add(a);return o}()},6064:s=>{s.exports=function(i){return i.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:s=>{s.exports=function(){}},1687:(s,i,o)=>{const a=o(375),c=o(8571),u=o(7043),f={};s.exports=f.merge=function(l,d,p){if(a(l&&typeof l=="object","Invalid target value: must be an object"),a(d==null||typeof d=="object","Invalid source value: must be null, undefined, or an object"),!d)return l;if(p=Object.assign({nullOverride:!0,mergeArrays:!0},p),Array.isArray(d)){a(Array.isArray(l),"Cannot merge array onto an object"),p.mergeArrays||(l.length=0);for(let m=0;m<d.length;++m)l.push(c(d[m],{symbols:p.symbols}));return l}const h=u.keys(d,p);for(let m=0;m<h.length;++m){const y=h[m];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:p.symbols}):f.merge(l[y],g,p)}else(g!=null||p.nullOverride)&&(l[y]=g)}return l}},9621:(s,i,o)=>{const a=o(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);a(!d||!l.separator,"Separator option is not valid for array-based chain");const p=d?f:f.split(l.separator||".");let h=u;for(let m=0;m<p.length;++m){let y=p[m];const g=l.iterables&&c.iterables(h);if(Array.isArray(h)||g==="set"){const v=Number(y);Number.isInteger(v)&&(y=v<0?h.length+v:v)}if(!h||typeof h=="function"&&l.functions===!1||!g&&h[y]===void 0){a(!l.strict||m+1===p.length,"Missing segment",y,"in reach path ",f),a(typeof h=="object"||l.functions===!0||typeof h!="function","Invalid segment",y,"in reach path ",f),h=l.default;break}h=g?g==="set"?[...h][y]:h.get(y):h[y]}return h},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(o){return"[Cannot display object: "+o.message+"]"}}},4277:(s,i)=>{const o={};i=s.exports={array:Array.prototype,buffer:!1,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},o.typeMap=new Map([["[object Error]",i.error],["[object Map]",i.map],["[object Promise]",i.promise],["[object Set]",i.set],["[object WeakMap]",i.weakMap],["[object WeakSet]",i.weakSet]]),i.getInternalProto=function(a){if(Array.isArray(a))return i.array;if(a instanceof Date)return i.date;if(a instanceof RegExp)return i.regex;if(a instanceof Error)return i.error;const c=Object.prototype.toString.call(a);return o.typeMap.get(c)||i.generic}},7043:(s,i)=>{i.keys=function(o,a={}){return a.symbols!==!1?Reflect.ownKeys(o):Object.getOwnPropertyNames(o)}},3652:(s,i,o)=>{const a=o(375),c={};i.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(u,f){const l=[].concat((f=f||{}).before||[]),d=[].concat(f.after||[]),p=f.group||"?",h=f.sort||0;a(!l.includes(p),`Item cannot come before itself: ${p}`),a(!l.includes("?"),"Item cannot come before unassociated items"),a(!d.includes(p),`Item cannot come after itself: ${p}`),a(!d.includes("?"),"Item cannot come after unassociated items"),Array.isArray(u)||(u=[u]);for(const m of u){const y={seq:this._items.length,sort:h,before:l,after:d,group:p,node:m};this._items.push(y)}if(!f.manual){const m=this._sort();a(m,"item",p!=="?"?`added into group ${p}`:"","created a dependencies error")}return this.nodes}merge(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 a(f,"merge created a dependencies error"),this.nodes}sort(){const u=this._sort();return a(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 x of y.after)f[x]=f[x]||[],f[x].push(g)}for(const y in u){const g=[];for(const v in u[y]){const x=u[y][v];l[x]=l[x]||[],g.push(...l[x])}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 p={},h=[];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(p[v]===!0)continue;d[v]||(d[v]=[]);const x=d[v].length;let _=0;for(let A=0;A<x;++A)p[d[v][A]]&&++_;if(_===x){g=v;break}}}g!==null&&(p[g]=!0,h.push(g))}if(h.length!==this._items.length)return!1;const m={};for(const y of this._items)m[y.seq]=y;this._items=[],this.nodes=[];for(const y of h){const g=m[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,o)=>{const a=o(443),c=o(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:a.URL||URL};i.analyze=function(f,l={}){if(!f)return c.code("DOMAIN_NON_EMPTY_STRING");if(typeof f!="string")throw new Error("Invalid input: domain must be a string");if(f.length>256)return c.code("DOMAIN_TOO_LONG");if(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,p=f.split(".");if(p.length<d)return c.code("DOMAIN_SEGMENTS_COUNT");if(l.maxDomainSegments&&p.length>l.maxDomainSegments)return c.code("DOMAIN_SEGMENTS_COUNT_MAX");const h=l.tlds;if(h){const m=p[p.length-1].toLowerCase();if(h.deny&&h.deny.has(m)||h.allow&&!h.allow.has(m))return c.code("DOMAIN_FORBIDDEN_TLDS")}for(let m=0;m<p.length;++m){const y=p[m];if(!y.length)return c.code("DOMAIN_EMPTY_SEGMENT");if(y.length>63)return c.code("DOMAIN_LONG_SEGMENT");if(m<p.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,o)=>{const a=o(9848),c=o(5380),u=o(2178),f={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(a.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 p=!f.nonAsciiRx.test(l);if(!p){if(d.allowUnicode===!1)return u.code("FORBIDDEN_UNICODE");l=l.normalize("NFC")}const h=l.split("@");if(h.length!==2)return h.length>2?u.code("MULTIPLE_AT_CHAR"):u.code("MISSING_AT_CHAR");const[m,y]=h;if(!m)return u.code("EMPTY_LOCAL");if(!d.ignoreLength){if(l.length>254)return u.code("ADDRESS_TOO_LONG");if(f.encoder.encode(m).length>64)return u.code("LOCAL_TOO_LONG")}return f.local(m,p)||c.analyze(y,d)},f.local=function(l,d){const p=l.split(".");for(const h of p){if(!h.length)return u.code("EMPTY_LOCAL_SEGMENT");if(d){if(!f.atextRx.test(h))return u.code("INVALID_LOCAL_CHARS")}else for(const m of h){if(f.atextRx.test(m))continue;const y=f.binary(m);if(!f.atomRx.test(y))return 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(o){return{code:o,error:i.codes[o]}}},9959:(s,i,o)=>{const a=o(375),c=o(5752);i.regex=function(u={}){a(u.cidr===void 0||typeof u.cidr=="string","options.cidr must be a string");const f=u.cidr?u.cidr.toLowerCase():"optional";a(["required","optional","forbidden"].includes(f),"options.cidr must be one of required, optional, forbidden"),a(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]),a(l.length>=1,"options.version must have at least 1 version specified");for(let h=0;h<l.length;++h)a(typeof l[h]=="string","options.version must only contain strings"),l[h]=l[h].toLowerCase(),a(["ipv4","ipv6","ipvfuture"].includes(l[h]),"options.version contains unknown version "+l[h]+" - must be one of ipv4, ipv6, ipvfuture");l=Array.from(new Set(l));const d=`(?:${l.map(h=>{if(f==="forbidden")return c.ip[h];const m=`\\/${h==="ipv4"?c.ip.v4Cidr:c.ip.v6Cidr}`;return f==="required"?`${c.ip[h]}${m}`:`${c.ip[h]}(?:${m})?`}).join("|")})`,p=new RegExp(`^${d}$`);return{cidr:f,versions:l,regex:p,raw:d}}},5752:(s,i,o)=>{const a=o(375),c=o(6064),u={generate:function(){const f={},l="\\dA-Fa-f",d="["+l+"]",p="\\w-\\.~",h="!\\$&'\\(\\)\\*\\+,;=",m="%"+l,y=p+m+h+":@",g="["+y+"]",v="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";f.ipv4address="(?:"+v+"\\.){3}"+v;const x=d+"{1,4}",_="(?:"+x+":"+x+"|"+f.ipv4address+")",A="(?:"+x+":){6}"+_,N="::(?:"+x+":){5}"+_,T="(?:"+x+")?::(?:"+x+":){4}"+_,E="(?:(?:"+x+":){0,1}"+x+")?::(?:"+x+":){3}"+_,P="(?:(?:"+x+":){0,2}"+x+")?::(?:"+x+":){2}"+_,k="(?:(?:"+x+":){0,3}"+x+")?::"+x+":"+_,M="(?:(?:"+x+":){0,4}"+x+")?::"+_,I="(?:(?:"+x+":){0,5}"+x+")?::"+x,j="(?:(?:"+x+":){0,6}"+x+")?::";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+"|"+N+"|"+T+"|"+E+"|"+P+"|"+k+"|"+M+"|"+I+"|"+j+")",f.ipvFuture="v"+d+"+\\.["+p+h+":]+",f.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",f.schemeRegex=new RegExp(f.scheme);const L="["+p+m+h+":]*",H="["+p+m+h+"]{1,255}",K="(?:\\[(?:"+f.ipv6address+"|"+f.ipvFuture+")\\]|"+f.ipv4address+"|"+H+")",V="(?:"+L+"@)?"+K+"(?::\\d*)?",U="(?:"+L+"@)?("+K+")(?::\\d*)?",Q=g+"*",ne=g+"+",X="(?:\\/"+Q+")*",G="\\/(?:"+ne+X+")?",Y=ne+X,Z="["+p+m+h+"@]+"+X,he="(?:\\/\\/\\/"+Q+X+")";return f.hierPart="(?:(?:\\/\\/"+V+X+")|"+G+"|"+Y+"|"+he+")",f.hierPartCapture="(?:(?:\\/\\/"+U+X+")|"+G+"|"+Y+")",f.relativeRef="(?:(?:\\/\\/"+V+X+")|"+G+"|"+Z+"|)",f.relativeRefCapture="(?:(?:\\/\\/"+U+X+")|"+G+"|"+Z+"|)",f.query="["+y+"\\/\\?]*(?=#|$)",f.queryWithSquareBrackets="["+y+"\\[\\]\\/\\?]*(?=#|$)",f.fragment="["+y+"\\/\\?]*",f}};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+")?",p=f.domain?l.relativeRefCapture:l.relativeRef;if(f.relativeOnly)return u.wrap(p+d);let h="";if(f.scheme){a(f.scheme instanceof RegExp||typeof f.scheme=="string"||Array.isArray(f.scheme),"scheme must be a RegExp, String, or Array");const g=[].concat(f.scheme);a(g.length>=1,"scheme must have at least 1 scheme specified");const v=[];for(let x=0;x<g.length;++x){const _=g[x];a(_ instanceof RegExp||typeof _=="string","scheme at position "+x+" must be a RegExp or String"),_ instanceof RegExp?v.push(_.source.toString()):(a(l.schemeRegex.test(_),"scheme at position "+x+" must be a valid scheme"),v.push(c(_)))}h=v.join("|")}const m="(?:"+(h?"(?:"+h+")":l.scheme)+":"+(f.domain?l.hierPartCapture:l.hierPart)+")",y=f.allowRelative?"(?:"+m+"|"+p+")":m;return u.wrap(y+d,h)},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 o={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};i.Parser=class{constructor(a,c={}){if(!c[o.settings]&&c.constants)for(const 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[o.settings]?c:Object.assign({[o.settings]:!0,constants:{},functions:{}},c),this.single=null,this._parts=null,this._parse(a)}_parse(a){let c=[],u="",f=0,l=!1;const d=h=>{if(f)throw new Error("Formula missing closing parenthesis");const m=c.length?c[c.length-1]:null;if(l||u||h){if(m&&m.type==="reference"&&h===")")return m.type="function",m.value=this._subFormula(u,m.value),void(u="");if(h===")"){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(o.operatorCharacters.includes(u))m&&m.type==="operator"&&o.operators.includes(m.value+u)?m.value+=u:c.push({type:"operator",value:u});else if(u.match(o.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(o.tokenRx))throw new Error(`Formula contains invalid token: ${u}`);c.push({type:"reference",value:u})}u=""}};for(const h of a)l?h===l?(d(),l=!1):u+=h:f?h==="("?(u+=h,++f):h===")"?(--f,f?u+=h:d(h)):u+=h:h in o.literals?l=o.literals[h]:h==="("?(d(),++f):o.operatorCharacters.includes(h)?(d(),u=h,d()):h!==" "?u+=h:d();d(),c=c.map((h,m)=>h.type!=="operator"||h.value!=="-"||m&&c[m-1].type!=="operator"?h:{type:"operator",value:"n"});let p=!1;for(const h of c){if(h.type==="operator"){if(o.operatorsPrefix.includes(h.value))continue;if(!p)throw new Error("Formula contains an operator in invalid position");if(!o.operators.includes(h.value))throw new Error(`Formula contains an unknown operator ${h.value}`)}else if(p)throw new Error("Formula missing expected operator");p=!p}if(!p)throw new Error("Formula contains invalid trailing operator");c.length===1&&["reference","literal","constant"].includes(c[0].type)&&(this.single={type:c[0].type==="reference"?"reference":"value",value:c[0].value}),this._parts=c.map(h=>{if(h.type==="operator")return o.operatorsPrefix.includes(h.value)?h:h.value;if(h.type!=="reference")return h.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(h.value))throw new Error(`Formula contains invalid reference ${h.value}`);return this.settings.reference?this.settings.reference(h.value):o.reference(h.value)})}_subFormula(a,c){const u=this.settings.functions[c];if(typeof u!="function")throw new Error(`Formula contains unknown function ${c}`);let f=[];if(a){let l="",d=0,p=!1;const h=()=>{if(!l)throw new Error(`Formula contains function ${c} with invalid arguments ${a}`);f.push(l),l=""};for(let m=0;m<a.length;++m){const y=a[m];p?(l+=y,y===p&&(p=!1)):y in o.literals&&!d?(l+=y,p=o.literals[y]):y!==","||d?(l+=y,y==="("?++d:y===")"&&--d):h()}h()}return f=f.map(l=>new i.Parser(l,this.settings)),function(l){const d=[];for(const p of f)d.push(p.evaluate(l));return u.call(l,...d)}}evaluate(a){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=o.evaluate(l,a);c[u]=o.single(f.value,d)}}return o.operatorsOrder.forEach(u=>{for(let f=1;f<c.length-1;)if(u.includes(c[f])){const l=c[f],d=o.evaluate(c[f-1],a),p=o.evaluate(c[f+1],a);c.splice(f,2);const h=o.calculate(l,d,p);c[f-1]=h===0?0:h}else f+=2}),o.evaluate(c[0],a)}},i.Parser.prototype[o.symbol]=!0,o.reference=function(a){return function(c){return c&&c[a]!==void 0?c[a]:null}},o.evaluate=function(a,c){return a===null?null:typeof a=="function"?a(c):a[o.symbol]?a.evaluate(c):a},o.single=function(a,c){if(a==="!")return!c;const u=-c;return u===0?0:u},o.calculate=function(a,c,u){if(a==="??")return o.exists(c)?c:u;if(typeof c=="string"||typeof u=="string"){if(a==="+")return(c=o.exists(c)?c:"")+(o.exists(u)?u:"")}else switch(a){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(a){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},o.exists=function(a){return a!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:s=>{s.exports=JSON.parse('{"version":"17.13.3"}')}},r={},function s(i){var o=r[i];if(o!==void 0)return o.exports;var a=r[i]={exports:{}};return n[i](a,a.exports,s),a.exports}(5107);var n,r})})(dee);var r2e=dee.exports;const ru=_u(r2e),sy=()=>{const t=S.useContext(mJ);if(t===void 0)throw new Error("useDataSource must be used within a DataSourceProvider");return t},s2e=()=>{const t=sy();return{useSubmitIncidence:e=>{const{mutateOptions:n={}}=e||{};return Ol({mutationFn:r=>t.createOne({resource:"support",data:r}),...n})}}},i2e=ru.object({incidence:ru.string().min(10).required().messages({"string.empty":"Debe escribir algo antes de enviar","string.min":"El texto es demasiado corto. Debe tener al menos 10 caracteres","string.max":"El texto es demasiado largo.","any.required":"La descripción es requerida"})});function o2e(){const[t,e]=S.useState(!1),[n,r]=S.useState(!1),{toast:s}=tc(),{useSubmitIncidence:i}=s2e(),o=L_({mode:"onBlur",resolver:q$(i2e),defaultValues:{incidence:""}}),{handleSubmit:a,watch:c,reset:u}=o,f=c("incidence"),{mutate:l}=i({mutateOptions:{onSuccess:()=>{s({title:"Incidencia enviada",description:"La incidencia se ha enviado correctamente",variant:"success"}),e(!1),u()},onError:()=>{s({title:"Error en el envío",description:"No se ha podido enviar la incidencia correctamente. Por favor, inténtalo de nuevo.",variant:"destructive"})}}}),d=async m=>{l(m)},p=()=>{f.trim()?r(!0):(e(!1),u())},h=()=>{r(!1),e(!1),u()};return b.jsxs(b.Fragment,{children:[b.jsxs(Ey,{open:t,onOpenChange:e,children:[b.jsx(JL,{asChild:!0,children:b.jsxs(qe,{variant:"outline",size:"icon",className:"overflow-hidden rounded-full bg-primary text-primary-foreground",onClick:()=>e(!0),children:[b.jsx(hq,{className:"w-5 h-5"}),b.jsx("span",{className:"sr-only",children:"Abrir ventana de soporte"})]})}),b.jsxs(Bp,{className:"sm:max-w-xl",children:[b.jsxs(Up,{className:"mb-2",children:[b.jsx(Vp,{children:te("support.modal.title")}),b.jsx(C_,{children:te("support.modal.subtitle")})]}),b.jsx($_,{...o,children:b.jsxs("form",{onSubmit:a(d),className:"space-y-4",children:[b.jsx(Ba,{name:"incidence",placeholder:"Describe la incidencia aquí...",className:"min-h-96"}),b.jsxs(Hp,{children:[b.jsx(qe,{type:"button",variant:"outline",onClick:p,children:"Cancelar"}),b.jsx(qe,{type:"submit",children:"Enviar incidencia"})]})]})})]})]}),b.jsx(PL,{open:n,onOpenChange:r,children:b.jsxs(cR,{children:[b.jsxs(uR,{children:[b.jsx(fR,{children:"¿Estás seguro de que quieres cancelar?"}),b.jsx(hR,{children:"Has escrito texto en el campo de descripción. Si cierras la ventana, perderás los cambios no guardados."})]}),b.jsxs(dR,{children:[b.jsx(mR,{onClick:()=>r(!1),children:"Volver al formulario"}),b.jsx(pR,{onClick:h,children:"Sí, cerrar"})]})]})})]})}var a2e={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 l2e=_u(a2e);var c2e=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function WU(t){var e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=t.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(e.name=n[1],(l2e[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(c2e),i=null;(i=s.exec(t))!==null;)if(i[0].trim())if(i[1]){var o=i[1].trim(),a=[o,""];o.indexOf("=")>-1&&(a=o.split("=")),e.attrs[a[0]]=a[1],s.lastIndex--}else i[2]&&(e.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return e}var u2e=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,d2e=/^\s*$/,f2e=Object.create(null);function fee(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(fee,"")+"</"+e.name+">";case"comment":return t+"<!--"+e.comment+"-->"}}var h2e={parse:function(t,e){e||(e={}),e.components||(e.components=f2e);var n,r=[],s=[],i=-1,o=!1;if(t.indexOf("<")!==0){var a=t.indexOf("<");r.push({type:"text",content:a===-1?t:t.substring(0,a)})}return t.replace(u2e,function(c,u){if(o){if(c!=="</"+n.name+">")return;o=!1}var f,l=c.charAt(1)!=="/",d=c.startsWith("<!--"),p=u+c.length,h=t.charAt(p);if(d){var m=WU(c);return i<0?(r.push(m),r):((f=s[i]).children.push(m),r)}if(l&&(i++,(n=WU(c)).type==="tag"&&e.components[n.name]&&(n.type="component",o=!0),n.voidElement||o||!h||h==="<"||n.children.push({type:"text",content:t.slice(p,t.indexOf("<",p))}),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]),!o&&h!=="<"&&h)){f=i===-1?r:s[i].children;var y=t.indexOf("<",p),g=t.slice(p,y===-1?void 0:y);d2e.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+fee("",n)},"")}};const pC=(...t)=>{console!=null&&console.warn&&(ia(t[0])&&(t[0]=`react-i18next:: ${t[0]}`),console.warn(...t))},GU={},rA=(...t)=>{ia(t[0])&&GU[t[0]]||(ia(t[0])&&(GU[t[0]]=new Date),pC(...t))},hee=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},KU=(t,e,n)=>{t.loadNamespaces(e,hee(t,n))},YU=(t,e,n,r)=>{ia(n)&&(n=[n]),n.forEach(s=>{t.options.ns.indexOf(s)<0&&t.options.ns.push(s)}),t.loadLanguages(e,hee(t,r))},p2e=(t,e,n={})=>!e.languages||!e.languages.length?(rA("i18n.languages were undefined or empty",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}}),ia=t=>typeof t=="string",ng=t=>typeof t=="object"&&t!==null,m2e=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,g2e={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},v2e=t=>g2e[t],y2e=t=>t.replace(m2e,v2e);let MO={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:y2e};const b2e=(t={})=>{MO={...MO,...t}},pee=()=>MO;let mee;const x2e=t=>{mee=t},W$=()=>mee,tD=(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},nD=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?rg(e):e},w2e=t=>Array.isArray(t)&&t.every(S.isValidElement),rg=t=>Array.isArray(t)?t:[t],_2e=(t,e)=>{const n={...e};return n.props=Object.assign(t.props,e.props),n},gee=(t,e)=>{if(!t)return"";let n="";const r=rg(t),s=e!=null&&e.transSupportBasicHtmlNodes?e.transKeepBasicHtmlNodesFor??[]:[];return r.forEach((i,o)=>{if(ia(i))n+=`${i}`;else if(S.isValidElement(i)){const{props:a,type:c}=i,u=Object.keys(a).length,f=s.indexOf(c)>-1,l=a.children;if(!l&&f&&!u)n+=`<${c}/>`;else if(!l&&(!f||u)||a.i18nIsDynamicList)n+=`<${o}></${o}>`;else if(f&&u===1&&ia(l))n+=`<${c}>${l}</${c}>`;else{const d=gee(l,e);n+=`<${o}>${d}</${o}>`}}else if(i===null)pC("Trans: the passed in value is invalid - seems you passed in a null child.");else if(ng(i)){const{format:a,...c}=i,u=Object.keys(c);if(u.length===1){const f=a?`${u[0]}, ${a}`:u[0];n+=`{{${f}}}`}else pC("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",i)}else pC("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",i)}),n},S2e=(t,e,n,r,s,i)=>{if(e==="")return[];const o=r.transKeepBasicHtmlNodesFor||[],a=e&&new RegExp(o.map(y=>`<${y}`).join("|")).test(e);if(!t&&!a&&!i)return[e];const c={},u=y=>{rg(y).forEach(v=>{ia(v)||(tD(v)?u(nD(v)):ng(v)&&!S.isValidElement(v)&&Object.assign(c,v))})};u(t);const f=h2e.parse(`<0>${e}</0>`),l={...c,...s},d=(y,g,v)=>{var A;const x=nD(y),_=h(x,g.children,v);return w2e(x)&&_.length===0||(A=y.props)!=null&&A.i18nIsDynamicList?x:_},p=(y,g,v,x,_)=>{y.dummy?(y.children=g,v.push(S.cloneElement(y,{key:x},_?void 0:g))):v.push(...S.Children.map([y],A=>{const N={...A.props};return delete N.i18nIsDynamicList,S.createElement(A.type,{...N,key:x,ref:A.ref},_?null:g)}))},h=(y,g,v)=>{const x=rg(y);return rg(g).reduce((A,N,T)=>{var P,k;const E=((k=(P=N.children)==null?void 0:P[0])==null?void 0:k.content)&&n.services.interpolator.interpolate(N.children[0].content,l,n.language);if(N.type==="tag"){let M=x[parseInt(N.name,10)];v.length===1&&!M&&(M=v[0][N.name]),M||(M={});const I=Object.keys(N.attrs).length!==0?_2e({props:N.attrs},M):M,j=S.isValidElement(I),L=j&&tD(N,!0)&&!N.voidElement,H=a&&ng(I)&&I.dummy&&!j,K=ng(t)&&Object.hasOwnProperty.call(t,N.name);if(ia(I)){const V=n.services.interpolator.interpolate(I,l,n.language);A.push(V)}else if(tD(I)||L){const V=d(I,N,v);p(I,V,A,T)}else if(H){const V=h(x,N.children,v);p(I,V,A,T)}else if(Number.isNaN(parseFloat(N.name)))if(K){const V=d(I,N,v);p(I,V,A,T,N.voidElement)}else if(r.transSupportBasicHtmlNodes&&o.indexOf(N.name)>-1)if(N.voidElement)A.push(S.createElement(N.name,{key:`${N.name}-${T}`}));else{const V=h(x,N.children,v);A.push(S.createElement(N.name,{key:`${N.name}-${T}`},V))}else if(N.voidElement)A.push(`<${N.name} />`);else{const V=h(x,N.children,v);A.push(`<${N.name}>${V}</${N.name}>`)}else if(ng(I)&&!j){const V=N.children[0]?E:null;V&&A.push(V)}else p(I,E,A,T,N.children.length!==1||!E)}else if(N.type==="text"){const M=r.transWrapTextNodes,I=i?r.unescape(n.services.interpolator.interpolate(N.content,l,n.language)):n.services.interpolator.interpolate(N.content,l,n.language);M?A.push(S.createElement(M,{key:`${N.name}-${T}`},I)):A.push(I)}return A},[])},m=h([{dummy:!0,children:t||[]}],f,rg(t||[]));return nD(m[0])};function C2e({children:t,count:e,parent:n,i18nKey:r,context:s,tOptions:i={},values:o,defaults:a,components:c,ns:u,i18n:f,t:l,shouldUnescape:d,...p}){var M,I,j,L;const h=f||W$();if(!h)return rA("You will need to pass in an i18next instance by using i18nextReactModule"),t;const m=l||h.t.bind(h)||(H=>H),y={...pee(),...(M=h.options)==null?void 0:M.react};let g=u||m.ns||((I=h.options)==null?void 0:I.defaultNS);g=ia(g)?[g]:g||["translation"];const v=gee(t,y),x=a||v||y.transEmptyNodeValue||r,{hashTransKey:_}=y,A=r||(_?_(v||x):v||x);(L=(j=h.options)==null?void 0:j.interpolation)!=null&&L.defaultVariables&&(o=o&&Object.keys(o).length>0?{...o,...h.options.interpolation.defaultVariables}:{...h.options.interpolation.defaultVariables});const N=o||e!==void 0||!t?i.interpolation:{interpolation:{...i.interpolation,prefix:"#$?",suffix:"?$#"}},T={...i,context:s||i.context,count:e,...o,...N,defaultValue:x,ns:g},E=A?m(A,T):x;c&&Object.keys(c).forEach(H=>{const K=c[H];if(typeof K.type=="function"||!K.props||!K.props.children||E.indexOf(`${H}/>`)<0&&E.indexOf(`${H} />`)<0)return;function V(){return S.createElement(S.Fragment,null,K)}c[H]=S.createElement(V)});const P=S2e(c||t,E,h,y,T,d),k=n??y.defaultTransParent;return k?S.createElement(k,p,P):P}const E2e={type:"3rdParty",init(t){b2e(t.options.react),x2e(t)}},G$=S.createContext();class A2e{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{var r;(r=this.usedNamespaces)[n]??(r[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function Mt({children:t,count:e,parent:n,i18nKey:r,context:s,tOptions:i={},values:o,defaults:a,components:c,ns:u,i18n:f,t:l,shouldUnescape:d,...p}){var v;const{i18n:h,defaultNS:m}=S.useContext(G$)||{},y=f||h||W$(),g=l||(y==null?void 0:y.t.bind(y));return C2e({children:t,count:e,parent:n,i18nKey:r,context:s,tOptions:i,values:o,defaults:a,components:c,ns:u||(g==null?void 0:g.ns)||m||((v=y==null?void 0:y.options)==null?void 0:v.defaultNS),i18n:y,t:l,shouldUnescape:d,...p})}const R2e=(t,e)=>{const n=S.useRef();return S.useEffect(()=>{n.current=t},[t,e]),n.current},vee=(t,e,n,r)=>t.getFixedT(e,n,r),N2e=(t,e,n,r)=>S.useCallback(vee(t,e,n,r),[t,e,n,r]),K$=(t,e={})=>{var _,A,N,T;const{i18n:n}=e,{i18n:r,defaultNS:s}=S.useContext(G$)||{},i=n||r||W$();if(i&&!i.reportNamespaces&&(i.reportNamespaces=new A2e),!i){rA("You will need to pass in an i18next instance by using initReactI18next");const E=(k,M)=>ia(M)?M:ng(M)&&ia(M.defaultValue)?M.defaultValue:Array.isArray(k)?k[k.length-1]:k,P=[E,{},!1];return P.t=E,P.i18n={},P.ready=!1,P}(_=i.options.react)!=null&&_.wait&&rA("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...pee(),...i.options.react,...e},{useSuspense:a,keyPrefix:c}=o;let u=s||((A=i.options)==null?void 0:A.defaultNS);u=ia(u)?[u]:u||["translation"],(T=(N=i.reportNamespaces).addUsedNamespaces)==null||T.call(N,u);const f=(i.isInitialized||i.initializedStoreOnce)&&u.every(E=>p2e(E,i,o)),l=N2e(i,e.lng||null,o.nsMode==="fallback"?u:u[0],c),d=()=>l,p=()=>vee(i,e.lng||null,o.nsMode==="fallback"?u:u[0],c),[h,m]=S.useState(d);let y=u.join();e.lng&&(y=`${e.lng}${y}`);const g=R2e(y),v=S.useRef(!0);S.useEffect(()=>{const{bindI18n:E,bindI18nStore:P}=o;v.current=!0,!f&&!a&&(e.lng?YU(i,e.lng,u,()=>{v.current&&m(p)}):KU(i,u,()=>{v.current&&m(p)})),f&&g&&g!==y&&v.current&&m(p);const k=()=>{v.current&&m(p)};return E&&(i==null||i.on(E,k)),P&&(i==null||i.store.on(P,k)),()=>{v.current=!1,i&&(E==null||E.split(" ").forEach(M=>i.off(M,k))),P&&i&&P.split(" ").forEach(M=>i.store.off(M,k))}},[i,y]),S.useEffect(()=>{v.current&&f&&m(d)},[i,c,f]);const x=[h,i,f];if(x.t=h,x.i18n=i,x.ready=f,f||!f&&!a)return x;throw new Promise(E=>{e.lng?YU(i,e.lng,u,()=>E()):KU(i,u,()=>E())})};function P2e({i18n:t,defaultNS:e,children:n}){const r=S.useMemo(()=>({i18n:t,defaultNS:e}),[t,e]);return S.createElement(G$.Provider,{value:r},n)}const OO=({className:t,...e})=>b.jsx("svg",{viewBox:"0 0 336 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,...e,children:b.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})}),T2e=()=>{const[t,e]=S.useState(!1),n=Us(),{openDialog:r,DialogComponent:s}=cOe({title:te("main_menu.logout_dialog.title"),description:te("main_menu.logout_dialog.description"),confirmLabel:te("main_menu.logout_dialog.confirm_label"),cancelLabel:te("main_menu.logout_dialog.cancel_label"),onConfirm:()=>{n("/logout")}}),{data:i,status:o}=iL(),a=c=>{c.preventDefault(),e(!0)};return b.jsxs(b.Fragment,{children:[o==="success"&&b.jsxs("div",{className:"grid gap-1 text-right",children:[b.jsx("p",{className:"text-xs font-medium leading-none",children:i==null?void 0:i.name}),b.jsx("p",{className:"text-xs text-muted-foreground",children:i==null?void 0:i.email})]}),b.jsxs(M_,{open:t,onOpenChange:e,children:[b.jsx(O_,{asChild:!0,children:b.jsxs(qe,{variant:"outline",size:"icon",className:"overflow-hidden rounded-full",onClick:a,children:[b.jsx(Ipe,{className:"w-5 h-5 accent-current"}),b.jsx("span",{className:"sr-only",children:te("main_menu.user.user_menu")})]})}),b.jsxs(Py,{align:"end",className:"w-56",children:[b.jsx(UR,{children:te("main_menu.user.my_account")}),b.jsx(Wv,{}),b.jsx(LAe,{children:b.jsxs(Xd,{onSelect:()=>n("/settings"),children:[b.jsx(Xpe,{className:"w-4 h-4 mr-2"}),b.jsx("span",{children:te("main_menu.user.settings")})]})}),b.jsx(Wv,{}),b.jsxs(Xd,{onSelect:()=>r(),children:[b.jsx(Vpe,{className:"w-4 h-4 mr-2"}),b.jsx("span",{children:te("main_menu.user.logout")})]})]}),s]})]})},XU=[{label:"main_menu.quotes",to:"/quotes"},{label:"main_menu.catalog",to:"/catalog"},{label:"main_menu.settings",to:"/settings"}],Uy=()=>{const t=wf(),e=S.useCallback(n=>t.pathname===n,[t.pathname]);return b.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:[b.jsxs("nav",{className:"flex-col hidden gap-6 text-lg font-medium md:flex md:flex-row md:items-center md:text-sm",children:[b.jsxs(eu,{to:"/",className:"flex items-center mr-6 font-semibold",children:[b.jsx(OO,{className:"w-24"}),b.jsx("span",{className:"sr-only",children:"Uecko"})]}),XU.map(n=>b.jsx(eu,{to:n.to,className:ie("transition-colors text-muted-foreground hover:text-foreground",e(n.to)?"text-foreground font-bold":"text-muted-foreground font-semibold"),children:b.jsx(Mt,{i18nKey:n.label})},n.to))]}),b.jsxs(ATe,{children:[b.jsx(RTe,{asChild:!0,children:b.jsxs(qe,{variant:"outline",size:"icon",className:"shrink-0 md:hidden",children:[b.jsx(qpe,{className:"w-5 h-5"}),b.jsx("span",{className:"sr-only",children:"Toggle navigation menu"})]})}),b.jsx(uQ,{side:"left",children:b.jsxs("nav",{className:"grid gap-6 text-lg font-medium",children:[b.jsxs(eu,{to:"/",className:"flex items-center gap-2 text-lg font-semibold",children:[b.jsx(Wpe,{className:"w-6 h-6"}),b.jsx("span",{className:"sr-only",children:"Uecko"})]}),XU.map(n=>b.jsx(eu,{to:n.to,className:ie("flex items-center gap-4 px-4 py-3 rounded-lg transition-colors","hover:bg-primary-light hover:text-primary text-muted-foreground"),children:b.jsx(Mt,{i18nKey:n.label})},n.to))]})})]}),b.jsxs(eu,{to:"/",className:"flex items-center font-semibold shrink-0 md:hidden",children:[b.jsx(OO,{className:"w-24"}),b.jsx("span",{className:"sr-only",children:"Uecko"})]}),b.jsxs("div",{className:"flex items-center justify-end w-full gap-4 md:ml-auto md:gap-2 lg:gap-4",children:[b.jsx(T2e,{}),b.jsx(o2e,{})]})]})};Uy.displayName="LayoutHeader";const k2e="_container_1cqh6_1",D2e="_LoadingIndicator_1cqh6_4",M2e="_LoadingIndicator__title_1cqh6_9",O2e="_LoadingIndicator__subtitle_1cqh6_13",I2e="_LoadingIndicator__lighttext_1cqh6_17",j2e="_LoadingIndicator__darktext_1cqh6_21",Ff={container:k2e,LoadingIndicator:D2e,LoadingIndicator__title:M2e,LoadingIndicator__subtitle:O2e,LoadingIndicator__lighttext:I2e,LoadingIndicator__darktext:j2e},L2e=({size:t=5,color:e="brand",className:n})=>b.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:[b.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),b.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"})]}),yee=({active:t=!0,look:e="dark",title:n=te("components.loading_indicator.title"),subtitle:r=""})=>{const s=e==="dark",i=s?"text-brand":"text-white";if(t)return b.jsxs("div",{className:Ff.LoadingIndicator,children:[b.jsx(L2e,{size:12,className:i}),n?b.jsx("h2",{className:ie(Ff.LoadingIndicator__title,s?Ff.LoadingIndicator__darktext:Ff.LoadingIndicator__lighttext),children:n}):null,r?b.jsx("p",{className:ie(Ff.LoadingIndicator__subtitle,s?Ff.LoadingIndicator__darktext:Ff.LoadingIndicator__lighttext),children:r}):null]})};yee.displayName="LoadingIndicator";const Yl=({title:t=te("components.loading_overlay.title"),subtitle:e=te("components.loading_overlay.subtitle"),...n})=>b.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:b.jsx(yee,{look:"dark",title:t,subtitle:e})});Yl.displayName="LoadingOverlay";const $2e="w-6 h-6 rounded-full animate-spin",bee=S.forwardRef((t,e)=>{const{className:n,...r}=t;return b.jsx(Hpe,{ref:e,className:ie($2e,n),...r})});bee.displayName="LoadingSpinner";function F2e(t,e,n){S.useEffect(()=>{if(!t||!("ResizeObserver"in window))return;const r=new ResizeObserver(n);return r.observe(t,e),()=>{r.disconnect()}},[t,e,n])}function z2e(t=!1){const[e,n]=S.useState(t);return[e,()=>n(s=>!s)]}const B2e="modulepreload",U2e=function(t){return"/"+t},QU={},L1=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),o=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));s=Promise.all(n.map(a=>{if(a=U2e(a),a in QU)return;QU[a]=!0;const c=a.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${u}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":B2e,c||(f.as="script",f.crossOrigin=""),f.href=a,o&&f.setAttribute("nonce",o),document.head.appendChild(f),c)return new Promise((l,d)=>{f.addEventListener("load",l),f.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${a}`)))})}))}return s.then(()=>e()).catch(i=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=i,window.dispatchEvent(o),!o.defaultPrevented)throw i})};var k0={};k0.d=(t,e)=>{for(var n in e)k0.o(e,n)&&!k0.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})};k0.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var mt=globalThis.pdfjsLib={};k0.d(mt,{AbortException:()=>em,AnnotationEditorLayer:()=>VI,AnnotationEditorParamsType:()=>vt,AnnotationEditorType:()=>Gt,AnnotationEditorUIManager:()=>kp,AnnotationLayer:()=>zFe,AnnotationMode:()=>ld,CMapCompressionType:()=>jO,ColorPicker:()=>uA,DOMSVGFactory:()=>Q$,DrawLayer:()=>KI,FeatureTest:()=>Ii,GlobalWorkerOptions:()=>lu,ImageKind:()=>mC,InvalidPDFException:()=>wee,MissingPDFException:()=>Jp,OPS:()=>_a,Outliner:()=>EI,PDFDataRangeTransport:()=>gte,PDFDateString:()=>Nee,PDFWorker:()=>Cg,PasswordResponses:()=>W2e,PermissionFlag:()=>q2e,PixelsPerInch:()=>cf,RenderingCancelledException:()=>Z$,TextLayer:()=>lA,UnexpectedResponseException:()=>IN,Util:()=>Je,VerbosityLevel:()=>DN,XfaLayer:()=>yte,build:()=>xFe,createValidAbsoluteUrl:()=>X2e,fetchData:()=>zN,getDocument:()=>dFe,getFilenameFromUrl:()=>o$e,getPdfFilenameFromUrl:()=>a$e,getXfaPageViewport:()=>l$e,isDataScheme:()=>J$,isPdfFile:()=>eF,noContextMenu:()=>Bi,normalizeUnicode:()=>n$e,renderTextLayer:()=>nFe,setLayerDimensions:()=>Tp,shadow:()=>Yt,updateTextLayer:()=>rFe,version:()=>bFe});const Fs=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),xee=[1,0,0,1,0,0],IO=[.001,0,0,.001,0,0],H2e=1e7,rD=1.35,Go={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},ld={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},V2e="pdfjs_internal_editor_",Gt={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},vt={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},q2e={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},ks={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},mC={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},jr={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,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},kb={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},DN={ERRORS:0,WARNINGS:1,INFOS:5},jO={NONE:0,BINARY:1},_a={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},W2e={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let MN=DN.WARNINGS;function G2e(t){Number.isInteger(t)&&(MN=t)}function K2e(){return MN}function ON(t){MN>=DN.INFOS&&console.log(`Info: ${t}`)}function jt(t){MN>=DN.WARNINGS&&console.log(`Warning: ${t}`)}function Rn(t){throw new Error(t)}function Wr(t,e){t||Rn(e)}function Y2e(t){switch(t==null?void 0:t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function X2e(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=t$e(t)}catch{}}const r=e?new URL(t,e):new URL(t);if(Y2e(r))return r}catch{}return null}function Yt(t,e,n,r=!1){return Object.defineProperty(t,e,{value:n,enumerable:!r,configurable:!0,writable:!1}),n}const Sf=function(){function e(n,r){this.constructor===e&&Rn("Cannot initialize BaseException."),this.message=n,this.name=r}return e.prototype=new Error,e.constructor=e,e}();class LO extends Sf{constructor(e,n){super(e,"PasswordException"),this.code=n}}class $O extends Sf{constructor(e,n){super(e,"UnknownErrorException"),this.details=n}}class wee extends Sf{constructor(e){super(e,"InvalidPDFException")}}class Jp extends Sf{constructor(e){super(e,"MissingPDFException")}}class IN extends Sf{constructor(e,n){super(e,"UnexpectedResponseException"),this.status=n}}class Q2e extends Sf{constructor(e){super(e,"FormatError")}}class em extends Sf{constructor(e){super(e,"AbortException")}}function _ee(t){(typeof t!="object"||(t==null?void 0:t.length)===void 0)&&Rn("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),o=t.subarray(s,i);r.push(String.fromCharCode.apply(null,o))}return r.join("")}function jN(t){typeof t!="string"&&Rn("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 Z2e(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,t&255)}function Y$(t){const e=Object.create(null);for(const[n,r]of t)e[n]=r;return e}function J2e(){const t=new Uint8Array(4);return t[0]=1,new Uint32Array(t.buffer,0,1)[0]===1}function e$e(){try{return new Function(""),!0}catch{return!1}}class Ii{static get isLittleEndian(){return Yt(this,"isLittleEndian",J2e())}static get isEvalSupported(){return Yt(this,"isEvalSupported",e$e())}static get isOffscreenCanvasSupported(){return Yt(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator<"u"&&typeof(navigator==null?void 0:navigator.platform)=="string"?Yt(this,"platform",{isMac:navigator.platform.includes("Mac")}):Yt(this,"platform",{isMac:!1})}static get isCSSRoundSupported(){var e,n;return Yt(this,"isCSSRoundSupported",(n=(e=globalThis.CSS)==null?void 0:e.supports)==null?void 0:n.call(e,"width: round(1.5px, 1px)"))}}const sD=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0"));var du,gC,FO;class Je{static makeHexColor(e,n,r){return`#${sD[e]}${sD[n]}${sD[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),o=this.applyTransform([e[2],e[1]],n);return[Math.min(r[0],s[0],i[0],o[0]),Math.min(r[1],s[1],i[1],o[1]),Math.max(r[0],s[0],i[0],o[0]),Math.max(r[1],s[1],i[1],o[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],o=e[2]*n[1]+e[3]*n[3],a=(r+o)/2,c=Math.sqrt((r+o)**2-4*(r*o-i*s))/2,u=a+c||1,f=a-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])),o=Math.min(Math.max(e[1],e[3]),Math.max(n[1],n[3]));return i>o?null:[r,i,s,o]}static bezierBoundingBox(e,n,r,s,i,o,a,c,u){return u?(u[0]=Math.min(u[0],e,a),u[1]=Math.min(u[1],n,c),u[2]=Math.max(u[2],e,a),u[3]=Math.max(u[3],n,c)):u=[Math.min(e,a),Math.min(n,c),Math.max(e,a),Math.max(n,c)],z(this,du,FO).call(this,e,r,i,a,n,s,o,c,3*(-e+3*(r-i)+a),6*(e-2*r+i),3*(r-e),u),z(this,du,FO).call(this,e,r,i,a,n,s,o,c,3*(-n+3*(s-o)+c),6*(n-2*s+o),3*(s-n),u),u}}du=new WeakSet,gC=function(e,n,r,s,i,o,a,c,u,f){if(u<=0||u>=1)return;const l=1-u,d=u*u,p=d*u,h=l*(l*(l*e+3*u*n)+3*d*r)+p*s,m=l*(l*(l*i+3*u*o)+3*d*a)+p*c;f[0]=Math.min(f[0],h),f[1]=Math.min(f[1],m),f[2]=Math.max(f[2],h),f[3]=Math.max(f[3],m)},FO=function(e,n,r,s,i,o,a,c,u,f,l,d){if(Math.abs(u)<1e-12){Math.abs(f)>=1e-12&&z(this,du,gC).call(this,e,n,r,s,i,o,a,c,-l/f,d);return}const p=f**2-4*l*u;if(p<0)return;const h=Math.sqrt(p),m=2*u;z(this,du,gC).call(this,e,n,r,s,i,o,a,c,(-f+h)/m,d),z(this,du,gC).call(this,e,n,r,s,i,o,a,c,(-f-h)/m,d)},B(Je,du);function t$e(t){return decodeURIComponent(escape(t))}let iD=null,ZU=null;function n$e(t){return iD||(iD=/([\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,ZU=new Map([["ſt","ſt"]])),t.replaceAll(iD,(e,n,r)=>n?n.normalize("NFKC"):ZU.get(r))}function r$e(){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 _ee(t)}const See="pdfjs_internal_id_",gc={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 LN{constructor(){this.constructor===LN&&Rn("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 Rx;const vF=class vF{constructor({enableHWA:e=!1}={}){B(this,Rx,!1);this.constructor===vF&&Rn("Cannot initialize BaseCanvasFactory."),$(this,Rx,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:!R(this,Rx)})}}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){Rn("Abstract method `_createCanvas` called.")}};Rx=new WeakMap;let sA=vF;class $N{constructor({baseUrl:e=null,isCompressed:n=!0}){this.constructor===$N&&Rn("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?jO.BINARY:jO.NONE;return this._fetchData(n,r).catch(s=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${n}`)})}_fetchData(e,n){Rn("Abstract method `_fetchData` called.")}}class FN{constructor({baseUrl:e=null}){this.constructor===FN&&Rn("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){Rn("Abstract method `_fetchData` called.")}}class X${constructor(){this.constructor===X$&&Rn("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){Rn("Abstract method `_createSVG` called.")}}const bc="http://www.w3.org/2000/svg",Yf=class Yf{};Te(Yf,"CSS",96),Te(Yf,"PDF",72),Te(Yf,"PDF_TO_CSS_UNITS",Yf.CSS/Yf.PDF);let cf=Yf;var hh,ml,Pc,Ei,gA,ph,Ye,Ds,Im,jm,vC,Cee,zO,Lm,Kb,Yb,BO,Xb;class s$e extends LN{constructor({docId:n,ownerDocument:r=globalThis.document}={}){super();B(this,Ye);B(this,hh);B(this,ml);B(this,Pc);B(this,Ei);B(this,gA);B(this,ph,0);$(this,Pc,n),$(this,Ei,r)}addFilter(n){if(!n)return"none";let r=R(this,Ye,Ds).get(n);if(r)return r;const[s,i,o]=z(this,Ye,vC).call(this,n),a=n.length===1?s:`${s}${i}${o}`;if(r=R(this,Ye,Ds).get(a),r)return R(this,Ye,Ds).set(n,r),r;const c=`g_${R(this,Pc)}_transfer_map_${Rs(this,ph)._++}`,u=`url(#${c})`;R(this,Ye,Ds).set(n,u),R(this,Ye,Ds).set(a,u);const f=z(this,Ye,Lm).call(this,c);return z(this,Ye,Yb).call(this,s,i,o,f),u}addHCMFilter(n,r){var h;const s=`${n}-${r}`,i="base";let o=R(this,Ye,Im).get(i);if((o==null?void 0:o.key)===s||(o?((h=o.filter)==null||h.remove(),o.key=s,o.url="none",o.filter=null):(o={key:s,url:"none",filter:null},R(this,Ye,Im).set(i,o)),!n||!r))return o.url;const a=z(this,Ye,Xb).call(this,n);n=Je.makeHexColor(...a);const c=z(this,Ye,Xb).call(this,r);if(r=Je.makeHexColor(...c),R(this,Ye,jm).style.color="",n==="#000000"&&r==="#ffffff"||n===r)return o.url;const u=new Array(256);for(let m=0;m<=255;m++){const y=m/255;u[m]=y<=.03928?y/12.92:((y+.055)/1.055)**2.4}const f=u.join(","),l=`g_${R(this,Pc)}_hcm_filter`,d=o.filter=z(this,Ye,Lm).call(this,l);z(this,Ye,Yb).call(this,f,f,f,d),z(this,Ye,zO).call(this,d);const p=(m,y)=>{const g=a[m]/255,v=c[m]/255,x=new Array(y+1);for(let _=0;_<=y;_++)x[_]=g+_/y*(v-g);return x.join(",")};return z(this,Ye,Yb).call(this,p(0,5),p(1,5),p(2,5),d),o.url=`url(#${l})`,o.url}addAlphaFilter(n){let r=R(this,Ye,Ds).get(n);if(r)return r;const[s]=z(this,Ye,vC).call(this,[n]),i=`alpha_${s}`;if(r=R(this,Ye,Ds).get(i),r)return R(this,Ye,Ds).set(n,r),r;const o=`g_${R(this,Pc)}_alpha_map_${Rs(this,ph)._++}`,a=`url(#${o})`;R(this,Ye,Ds).set(n,a),R(this,Ye,Ds).set(i,a);const c=z(this,Ye,Lm).call(this,o);return z(this,Ye,BO).call(this,s,c),a}addLuminosityFilter(n){let r=R(this,Ye,Ds).get(n||"luminosity");if(r)return r;let s,i;if(n?([s]=z(this,Ye,vC).call(this,[n]),i=`luminosity_${s}`):i="luminosity",r=R(this,Ye,Ds).get(i),r)return R(this,Ye,Ds).set(n,r),r;const o=`g_${R(this,Pc)}_luminosity_map_${Rs(this,ph)._++}`,a=`url(#${o})`;R(this,Ye,Ds).set(n,a),R(this,Ye,Ds).set(i,a);const c=z(this,Ye,Lm).call(this,o);return z(this,Ye,Cee).call(this,c),n&&z(this,Ye,BO).call(this,s,c),a}addHighlightHCMFilter(n,r,s,i,o){var v;const a=`${r}-${s}-${i}-${o}`;let c=R(this,Ye,Im).get(n);if((c==null?void 0:c.key)===a||(c?((v=c.filter)==null||v.remove(),c.key=a,c.url="none",c.filter=null):(c={key:a,url:"none",filter:null},R(this,Ye,Im).set(n,c)),!r||!s))return c.url;const[u,f]=[r,s].map(z(this,Ye,Xb).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]),[p,h]=[i,o].map(z(this,Ye,Xb).bind(this));d<l&&([l,d,p,h]=[d,l,h,p]),R(this,Ye,jm).style.color="";const m=(x,_,A)=>{const N=new Array(256),T=(d-l)/A,E=x/255,P=(_-x)/(255*A);let k=0;for(let M=0;M<=A;M++){const I=Math.round(l+M*T),j=E+M*P;for(let L=k;L<=I;L++)N[L]=j;k=I+1}for(let M=k;M<256;M++)N[M]=N[k-1];return N.join(",")},y=`g_${R(this,Pc)}_hcm_${n}_filter`,g=c.filter=z(this,Ye,Lm).call(this,y);return z(this,Ye,zO).call(this,g),z(this,Ye,Yb).call(this,m(p[0],h[0],5),m(p[1],h[1],5),m(p[2],h[2],5),g),c.url=`url(#${y})`,c.url}destroy(n=!1){n&&R(this,Ye,Im).size!==0||(R(this,ml)&&(R(this,ml).parentNode.parentNode.remove(),$(this,ml,null)),R(this,hh)&&(R(this,hh).clear(),$(this,hh,null)),$(this,ph,0))}}hh=new WeakMap,ml=new WeakMap,Pc=new WeakMap,Ei=new WeakMap,gA=new WeakMap,ph=new WeakMap,Ye=new WeakSet,Ds=function(){return R(this,hh)||$(this,hh,new Map)},Im=function(){return R(this,gA)||$(this,gA,new Map)},jm=function(){if(!R(this,ml)){const n=R(this,Ei).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=R(this,Ei).createElementNS(bc,"svg");s.setAttribute("width",0),s.setAttribute("height",0),$(this,ml,R(this,Ei).createElementNS(bc,"defs")),n.append(s),s.append(R(this,ml)),R(this,Ei).body.append(n)}return R(this,ml)},vC=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,o=new Array(256),a=new Array(256),c=new Array(256);for(let u=0;u<256;u++)o[u]=r[u]/255,a[u]=s[u]/255,c[u]=i[u]/255;return[o.join(","),a.join(","),c.join(",")]},Cee=function(n){const r=R(this,Ei).createElementNS(bc,"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)},zO=function(n){const r=R(this,Ei).createElementNS(bc,"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)},Lm=function(n){const r=R(this,Ei).createElementNS(bc,"filter");return r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("id",n),R(this,Ye,jm).append(r),r},Kb=function(n,r,s){const i=R(this,Ei).createElementNS(bc,r);i.setAttribute("type","discrete"),i.setAttribute("tableValues",s),n.append(i)},Yb=function(n,r,s,i){const o=R(this,Ei).createElementNS(bc,"feComponentTransfer");i.append(o),z(this,Ye,Kb).call(this,o,"feFuncR",n),z(this,Ye,Kb).call(this,o,"feFuncG",r),z(this,Ye,Kb).call(this,o,"feFuncB",s)},BO=function(n,r){const s=R(this,Ei).createElementNS(bc,"feComponentTransfer");r.append(s),z(this,Ye,Kb).call(this,s,"feFuncA",n)},Xb=function(n){return R(this,Ye,jm).style.color=n,tF(getComputedStyle(R(this,Ye,jm)).getPropertyValue("color"))};class i$e extends sA{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 zN(t,e="text"){if(Qb(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 Eee extends $N{_fetchData(e,n){return zN(e,this.isCompressed?"arraybuffer":"text").then(r=>({cMapData:r instanceof ArrayBuffer?new Uint8Array(r):jN(r),compressionType:n}))}}class Aee extends FN{_fetchData(e){return zN(e,"arraybuffer").then(n=>new Uint8Array(n))}}class Q$ extends X${_createSVG(e){return document.createElementNS(bc,e)}}class K_{constructor({viewBox:e,scale:n,rotation:r,offsetX:s=0,offsetY:i=0,dontFlip:o=!1}){this.viewBox=e,this.scale=n,this.rotation=r,this.offsetX=s,this.offsetY=i;const a=(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.")}o&&(l=-l,d=-d);let p,h,m,y;u===0?(p=Math.abs(c-e[1])*n+s,h=Math.abs(a-e[0])*n+i,m=(e[3]-e[1])*n,y=(e[2]-e[0])*n):(p=Math.abs(a-e[0])*n+s,h=Math.abs(c-e[1])*n+i,m=(e[2]-e[0])*n,y=(e[3]-e[1])*n),this.transform=[u*n,f*n,l*n,d*n,p-u*n*a-l*n*c,h-f*n*a-d*n*c],this.width=m,this.height=y}get rawDims(){const{viewBox:e}=this;return Yt(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 K_({viewBox:this.viewBox.slice(),scale:e,rotation:n,offsetX:r,offsetY:s,dontFlip:i})}convertToViewportPoint(e,n){return Je.applyTransform([e,n],this.transform)}convertToViewportRectangle(e){const n=Je.applyTransform([e[0],e[1]],this.transform),r=Je.applyTransform([e[2],e[3]],this.transform);return[n[0],n[1],r[0],r[1]]}convertToPdfPoint(e,n){return Je.applyInverseTransform([e,n],this.transform)}}class Z$ extends Sf{constructor(e,n=0){super(e,"RenderingCancelledException"),this.extraDelay=n}}function J$(t){const e=t.length;let n=0;for(;n<e&&t[n].trim()==="";)n++;return t.substring(n,n+5).toLowerCase()==="data:"}function eF(t){return typeof t=="string"&&/\.pdf$/i.test(t)}function o$e(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)}function a$e(t,e="document.pdf"){if(typeof t!="string")return e;if(J$(t))return jt('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 JU{constructor(){Te(this,"started",Object.create(null));Te(this,"times",[])}time(e){e in this.started&&jt(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||jt(`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 Qb(t,e){try{const{protocol:n}=e?new URL(t,e):new URL(t);return n==="http:"||n==="https:"}catch{return!1}}function Bi(t){t.preventDefault()}function Ree(t){console.log("Deprecated API usage: "+t)}let eH;class Nee{static toDateObject(e){if(!e||typeof e!="string")return null;eH||(eH=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const n=eH.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 o=parseInt(n[4],10);o=o>=0&&o<=23?o:0;let a=parseInt(n[5],10);a=a>=0&&a<=59?a: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==="-"?(o+=f,a+=l):u==="+"&&(o-=f,a-=l),new Date(Date.UTC(r,s,i,o,a,c))}}function l$e(t,{scale:e=1,rotation:n=0}){const{width:r,height:s}=t.attributes.style,i=[0,0,parseInt(r),parseInt(s)];return new K_({viewBox:i,scale:e,rotation:n})}function tF(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):(jt(`Not a valid color format: "${t}"`),[0,0,0])}function c$e(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,tF(r))}e.remove()}function er(t){const{a:e,b:n,c:r,d:s,e:i,f:o}=t.getTransform();return[e,n,r,s,i,o]}function vc(t){const{a:e,b:n,c:r,d:s,e:i,f:o}=t.getTransform().invertSelf();return[e,n,r,s,i,o]}function Tp(t,e,n=!1,r=!0){if(e instanceof K_){const{pageWidth:s,pageHeight:i}=e.rawDims,{style:o}=t,a=Ii.isCSSRoundSupported,c=`var(--scale-factor) * ${s}px`,u=`var(--scale-factor) * ${i}px`,f=a?`round(${c}, 1px)`:`calc(${c})`,l=a?`round(${u}, 1px)`:`calc(${u})`;!n||e.rotation%180===0?(o.width=f,o.height=l):(o.width=l,o.height=f)}r&&t.setAttribute("data-main-rotation",e.rotation)}var mh,gh,oo,vh,vA,Pee,oi,Tee,kee,yC,Dee,HO;const yA=class yA{constructor(e){B(this,oi);B(this,mh,null);B(this,gh,null);B(this,oo);B(this,vh,null);$(this,oo,e)}render(){const e=$(this,mh,document.createElement("div"));e.className="editToolbar",e.setAttribute("role","toolbar");const n=R(this,oo)._uiManager._signal;e.addEventListener("contextmenu",Bi,{signal:n}),e.addEventListener("pointerdown",z(yA,vA,Pee),{signal:n});const r=$(this,vh,document.createElement("div"));r.className="buttons",e.append(r);const s=R(this,oo).toolbarPosition;if(s){const{style:i}=e,o=R(this,oo)._uiManager.direction==="ltr"?1-s[0]:s[0];i.insetInlineEnd=`${100*o}%`,i.top=`calc(${100*s[1]}% + var(--editor-toolbar-vert-offset))`}return z(this,oi,Dee).call(this),e}hide(){var e;R(this,mh).classList.add("hidden"),(e=R(this,gh))==null||e.hideDropdown()}show(){R(this,mh).classList.remove("hidden")}addAltTextButton(e){z(this,oi,yC).call(this,e),R(this,vh).prepend(e,R(this,oi,HO))}addColorPicker(e){$(this,gh,e);const n=e.renderButton();z(this,oi,yC).call(this,n),R(this,vh).prepend(n,R(this,oi,HO))}remove(){var e;R(this,mh).remove(),(e=R(this,gh))==null||e.destroy(),$(this,gh,null)}};mh=new WeakMap,gh=new WeakMap,oo=new WeakMap,vh=new WeakMap,vA=new WeakSet,Pee=function(e){e.stopPropagation()},oi=new WeakSet,Tee=function(e){R(this,oo)._focusEventsAllowed=!1,e.preventDefault(),e.stopPropagation()},kee=function(e){R(this,oo)._focusEventsAllowed=!0,e.preventDefault(),e.stopPropagation()},yC=function(e){const n=R(this,oo)._uiManager._signal;e.addEventListener("focusin",z(this,oi,Tee).bind(this),{capture:!0,signal:n}),e.addEventListener("focusout",z(this,oi,kee).bind(this),{capture:!0,signal:n}),e.addEventListener("contextmenu",Bi,{signal:n})},Dee=function(){const e=document.createElement("button");e.className="delete",e.tabIndex=0,e.setAttribute("data-l10n-id",`pdfjs-editor-remove-${R(this,oo).editorType}-button`),z(this,oi,yC).call(this,e),e.addEventListener("click",n=>{R(this,oo)._uiManager.delete()},{signal:R(this,oo)._uiManager._signal}),R(this,vh).append(e)},HO=function(){const e=document.createElement("div");return e.className="divider",e},B(yA,vA);let UO=yA;var Nx,yh,bh,uf,Mee,Oee,Iee;class u$e{constructor(e){B(this,uf);B(this,Nx,null);B(this,yh,null);B(this,bh);$(this,bh,e)}show(e,n,r){const[s,i]=z(this,uf,Oee).call(this,n,r),{style:o}=R(this,yh)||$(this,yh,z(this,uf,Mee).call(this));e.append(R(this,yh)),o.insetInlineEnd=`${100*s}%`,o.top=`calc(${100*i}% + var(--editor-toolbar-vert-offset))`}hide(){R(this,yh).remove()}}Nx=new WeakMap,yh=new WeakMap,bh=new WeakMap,uf=new WeakSet,Mee=function(){const e=$(this,yh,document.createElement("div"));e.className="editToolbar",e.setAttribute("role","toolbar"),e.addEventListener("contextmenu",Bi,{signal:R(this,bh)._signal});const n=$(this,Nx,document.createElement("div"));return n.className="buttons",e.append(n),z(this,uf,Iee).call(this),e},Oee=function(e,n){let r=0,s=0;for(const i of e){const o=i.y+i.height;if(o<r)continue;const a=i.x+(n?i.width:0);if(o>r){s=a,r=o;continue}n?a>s&&(s=a):a<s&&(s=a)}return[n?1-s:s,r]},Iee=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=R(this,bh)._signal;e.addEventListener("contextmenu",Bi,{signal:r}),e.addEventListener("click",()=>{R(this,bh).highlightSelection("floating_button")},{signal:r}),R(this,Nx).append(e)};function iA(t,e,n){for(const r of n)e.addEventListener(r,t[r].bind(t))}function d$e(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")}var bA;class f$e{constructor(){B(this,bA,0)}get id(){return`${V2e}${Rs(this,bA)._++}`}}bA=new WeakMap;var Px,xA,Uo,Tx,qO;const yF=class yF{constructor(){B(this,Tx);B(this,Px,r$e());B(this,xA,0);B(this,Uo,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 Yt(this,"_isSVGFittingCanvas",i)}async getFromFile(e){const{lastModified:n,name:r,size:s,type:i}=e;return z(this,Tx,qO).call(this,`${n}_${r}_${s}_${i}`,e)}async getFromUrl(e){return z(this,Tx,qO).call(this,e,e)}async getFromId(e){R(this,Uo)||$(this,Uo,new Map);const n=R(this,Uo).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=R(this,Uo).get(e);return n!=null&&n.isSvg?n.svgUrl:null}deleteId(e){R(this,Uo)||$(this,Uo,new Map);const n=R(this,Uo).get(e);n&&(n.refCounter-=1,n.refCounter===0&&(n.bitmap=null))}isValidId(e){return e.startsWith(`image_${R(this,Px)}_`)}};Px=new WeakMap,xA=new WeakMap,Uo=new WeakMap,Tx=new WeakSet,qO=async function(e,n){R(this,Uo)||$(this,Uo,new Map);let r=R(this,Uo).get(e);if(r===null)return null;if(r!=null&&r.bitmap)return r.refCounter+=1,r;try{r||(r={bitmap:null,id:`image_${R(this,Px)}_${Rs(this,xA)._++}`,refCounter:0,isSvg:!1});let s;if(typeof n=="string"?(r.url=n,s=await zN(n,"blob")):s=r.file=n,s.type==="image/svg+xml"){const i=yF._isSVGFittingCanvas,o=new FileReader,a=new Image,c=new Promise((u,f)=>{a.onload=()=>{r.bitmap=a,r.isSvg=!0,u()},o.onload=async()=>{const l=r.svgUrl=o.result;a.src=await i?`${l}#svgView(preserveAspectRatio(none))`:l},a.onerror=o.onerror=f});o.readAsDataURL(s),await c}else r.bitmap=await createImageBitmap(s);r.refCounter=1}catch(s){console.error(s),r=null}return R(this,Uo).set(e,r),r&&R(this,Uo).set(r.id,r),r};let VO=yF;var Zr,vd,kx,Jr;class h$e{constructor(e=128){B(this,Zr,[]);B(this,vd,!1);B(this,kx);B(this,Jr,-1);$(this,kx,e)}add({cmd:e,undo:n,post:r,mustExec:s,type:i=NaN,overwriteIfSameType:o=!1,keepUndo:a=!1}){if(s&&e(),R(this,vd))return;const c={cmd:e,undo:n,post:r,type:i};if(R(this,Jr)===-1){R(this,Zr).length>0&&(R(this,Zr).length=0),$(this,Jr,0),R(this,Zr).push(c);return}if(o&&R(this,Zr)[R(this,Jr)].type===i){a&&(c.undo=R(this,Zr)[R(this,Jr)].undo),R(this,Zr)[R(this,Jr)]=c;return}const u=R(this,Jr)+1;u===R(this,kx)?R(this,Zr).splice(0,1):($(this,Jr,u),u<R(this,Zr).length&&R(this,Zr).splice(u)),R(this,Zr).push(c)}undo(){if(R(this,Jr)===-1)return;$(this,vd,!0);const{undo:e,post:n}=R(this,Zr)[R(this,Jr)];e(),n==null||n(),$(this,vd,!1),$(this,Jr,R(this,Jr)-1)}redo(){if(R(this,Jr)<R(this,Zr).length-1){$(this,Jr,R(this,Jr)+1),$(this,vd,!0);const{cmd:e,post:n}=R(this,Zr)[R(this,Jr)];e(),n==null||n(),$(this,vd,!1)}}hasSomethingToUndo(){return R(this,Jr)!==-1}hasSomethingToRedo(){return R(this,Jr)<R(this,Zr).length-1}destroy(){$(this,Zr,null)}}Zr=new WeakMap,vd=new WeakMap,kx=new WeakMap,Jr=new WeakMap;var wA,jee;class Y_{constructor(e){B(this,wA);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:n}=Ii.platform;for(const[r,s,i={}]of e)for(const o of r){const a=o.startsWith("mac+");n&&a?(this.callbacks.set(o.slice(4),{callback:s,options:i}),this.allKeys.add(o.split("+").at(-1))):!n&&!a&&(this.callbacks.set(o,{callback:s,options:i}),this.allKeys.add(o.split("+").at(-1)))}}exec(e,n){if(!this.allKeys.has(n.key))return;const r=this.callbacks.get(z(this,wA,jee).call(this,n));if(!r)return;const{callback:s,options:{bubbles:i=!1,args:o=[],checker:a=null}}=r;a&&!a(e,n)||(s.bind(e,...o,n)(),i||(n.stopPropagation(),n.preventDefault()))}}wA=new WeakSet,jee=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 _A=class _A{get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return c$e(e),Yt(this,"_colors",e)}convert(e){const n=tF(e);if(!window.matchMedia("(forced-colors: active)").matches)return n;for(const[r,s]of this._colors)if(s.every((i,o)=>i===n[o]))return _A._colorsMapping.get(r);return n}getHexCode(e){const n=this._colors.get(e);return n?Je.makeHexColor(...n):e}};Te(_A,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let WO=_A;var zg,ao,Lr,ds,Bg,Tc,Ug,Ca,Hg,xh,gl,Ea,wh,Dx,Mx,vl,Vg,yd,yl,SA,bd,Ox,_h,Ix,qg,fs,gn,kc,Sh,jx,Lx,$x,Fx,zx,Bx,Ux,Hx,Vx,qx,Wx,Gx,Kx,xd,bl,Dc,Yx,Ue,bC,Lee,$ee,xC,Fee,zee,Bee,GO,Uee,KO,YO,Hee,Gs,Xu,Vee,qee,XO,Wee,Zb,QO;const sg=class sg{constructor(e,n,r,s,i,o,a,c,u){B(this,Ue);B(this,zg,new AbortController);B(this,ao,null);B(this,Lr,new Map);B(this,ds,new Map);B(this,Bg,null);B(this,Tc,null);B(this,Ug,null);B(this,Ca,new h$e);B(this,Hg,0);B(this,xh,new Set);B(this,gl,null);B(this,Ea,null);B(this,wh,new Set);B(this,Dx,!1);B(this,Mx,null);B(this,vl,null);B(this,Vg,null);B(this,yd,!1);B(this,yl,null);B(this,SA,new f$e);B(this,bd,!1);B(this,Ox,!1);B(this,_h,null);B(this,Ix,null);B(this,qg,null);B(this,fs,Gt.NONE);B(this,gn,new Set);B(this,kc,null);B(this,Sh,null);B(this,jx,null);B(this,Lx,this.blur.bind(this));B(this,$x,this.focus.bind(this));B(this,Fx,this.copy.bind(this));B(this,zx,this.cut.bind(this));B(this,Bx,this.paste.bind(this));B(this,Ux,this.keydown.bind(this));B(this,Hx,this.keyup.bind(this));B(this,Vx,this.onEditingAction.bind(this));B(this,qx,this.onPageChanging.bind(this));B(this,Wx,this.onScaleChanging.bind(this));B(this,Gx,this.onRotationChanging.bind(this));B(this,Kx,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1});B(this,xd,[0,0]);B(this,bl,null);B(this,Dc,null);B(this,Yx,null);this._signal=R(this,zg).signal,$(this,Dc,e),$(this,Yx,n),$(this,Bg,r),this._eventBus=s,this._eventBus._on("editingaction",R(this,Vx)),this._eventBus._on("pagechanging",R(this,qx)),this._eventBus._on("scalechanging",R(this,Wx)),this._eventBus._on("rotationchanging",R(this,Gx)),z(this,Ue,Fee).call(this),z(this,Ue,Hee).call(this),z(this,Ue,GO).call(this),$(this,Tc,i.annotationStorage),$(this,Mx,i.filterFactory),$(this,Sh,o),$(this,Vg,a||null),$(this,Dx,c),$(this,qg,u||null),this.viewParameters={realScale:cf.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}static get _keyboardManager(){const e=sg.prototype,n=o=>R(o,Dc).contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&o.hasSomethingToControl(),r=(o,{target:a})=>{if(a instanceof HTMLInputElement){const{type:c}=a;return c!=="text"&&c!=="number"}return!0},s=this.TRANSLATE_SMALL,i=this.TRANSLATE_BIG;return Yt(this,"_keyboardManager",new Y_([[["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:(o,{target:a})=>!(a instanceof HTMLButtonElement)&&R(o,Dc).contains(a)&&!o.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(o,{target:a})=>!(a instanceof HTMLButtonElement)&&R(o,Dc).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=R(this,zg))==null||e.abort(),$(this,zg,null),this._signal=null,this._eventBus._off("editingaction",R(this,Vx)),this._eventBus._off("pagechanging",R(this,qx)),this._eventBus._off("scalechanging",R(this,Wx)),this._eventBus._off("rotationchanging",R(this,Gx));for(const s of R(this,ds).values())s.destroy();R(this,ds).clear(),R(this,Lr).clear(),R(this,wh).clear(),$(this,ao,null),R(this,gn).clear(),R(this,Ca).destroy(),(n=R(this,Bg))==null||n.destroy(),(r=R(this,yl))==null||r.hide(),$(this,yl,null),R(this,vl)&&(clearTimeout(R(this,vl)),$(this,vl,null)),R(this,bl)&&(clearTimeout(R(this,bl)),$(this,bl,null))}async mlGuess(e){var n;return((n=R(this,qg))==null?void 0:n.guess(e))||null}get hasMLManager(){return!!R(this,qg)}get hcmFilter(){return Yt(this,"hcmFilter",R(this,Sh)?R(this,Mx).addHCMFilter(R(this,Sh).foreground,R(this,Sh).background):"none")}get direction(){return Yt(this,"direction",getComputedStyle(R(this,Dc)).direction)}get highlightColors(){return Yt(this,"highlightColors",R(this,Vg)?new Map(R(this,Vg).split(",").map(e=>e.split("=").map(n=>n.trim()))):null)}get highlightColorNames(){return Yt(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}setMainHighlightColorPicker(e){$(this,Ix,e)}editAltText(e){var n;(n=R(this,Bg))==null||n.editAltText(this,e)}onPageChanging({pageNumber:e}){$(this,Hg,e-1)}focusMainContainer(){R(this,Dc).focus()}findParent(e,n){for(const r of R(this,ds).values()){const{x:s,y:i,width:o,height:a}=r.div.getBoundingClientRect();if(e>=s&&e<=s+o&&n>=i&&n<=i+a)return r}return null}disableUserSelect(e=!1){R(this,Yx).classList.toggle("noUserSelect",e)}addShouldRescale(e){R(this,wh).add(e)}removeShouldRescale(e){R(this,wh).delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*cf.PDF_TO_CSS_UNITS;for(const n of R(this,wh))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:o}=n,a=n.toString(),u=z(this,Ue,bC).call(this,n).closest(".textLayer"),f=this.getSelectionBoxes(u);if(f){n.empty(),R(this,fs)===Gt.NONE&&(this._eventBus.dispatch("showannotationeditorui",{source:this,mode:Gt.HIGHLIGHT}),this.showAllEditors("highlight",!0,!0));for(const l of R(this,ds).values())if(l.hasTextLayer(u)){l.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:f,anchorNode:r,anchorOffset:s,focusNode:i,focusOffset:o,text:a});break}}}addToAnnotationStorage(e){!e.isEmpty()&&R(this,Tc)&&!R(this,Tc).has(e.id)&&R(this,Tc).setValue(e.id,e)}blur(){if(this.isShiftKeyDown=!1,R(this,yd)&&($(this,yd,!1),z(this,Ue,xC).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const n of R(this,gn))if(n.div.contains(e)){$(this,_h,[n,e]),n._focusEventsAllowed=!1;break}}focus(){if(!R(this,_h))return;const[e,n]=R(this,_h);$(this,_h,null),n.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),n.focus()}addEditListeners(){z(this,Ue,GO).call(this),z(this,Ue,KO).call(this)}removeEditListeners(){z(this,Ue,Uee).call(this),z(this,Ue,YO).call(this)}dragOver(e){for(const{type:n}of e.dataTransfer.items)for(const r of R(this,Ea))if(r.isHandlingMimeForPasting(n)){e.dataTransfer.dropEffect="copy",e.preventDefault();return}}drop(e){for(const n of e.dataTransfer.items)for(const r of R(this,Ea))if(r.isHandlingMimeForPasting(n.type)){r.paste(n,this.currentLayer),e.preventDefault();return}}copy(e){var r;if(e.preventDefault(),(r=R(this,ao))==null||r.commitOrRemove(),!this.hasSelection)return;const n=[];for(const s of R(this,gn)){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 o of R(this,Ea))if(o.isHandlingMimeForPasting(i.type)){o.paste(i,this.currentLayer);return}let r=n.getData("application/pdfjs");if(!r)return;try{r=JSON.parse(r)}catch(i){jt(`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 o=()=>{for(const c of i)z(this,Ue,XO).call(this,c);z(this,Ue,QO).call(this,i)},a=()=>{for(const c of i)c.remove()};this.addCommands({cmd:o,undo:a,mustExec:!0})}catch(i){jt(`paste: "${i.message}".`)}}keydown(e){!this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!0),R(this,fs)!==Gt.NONE&&!this.isEditorHandlingKeyboard&&sg._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!1,R(this,yd)&&($(this,yd,!1),z(this,Ue,xC).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?(z(this,Ue,zee).call(this),z(this,Ue,KO).call(this),z(this,Ue,Gs).call(this,{isEditing:R(this,fs)!==Gt.NONE,isEmpty:z(this,Ue,Zb).call(this),hasSomethingToUndo:R(this,Ca).hasSomethingToUndo(),hasSomethingToRedo:R(this,Ca).hasSomethingToRedo(),hasSelectedEditor:!1})):(z(this,Ue,Bee).call(this),z(this,Ue,YO).call(this),z(this,Ue,Gs).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!R(this,Ea)){$(this,Ea,e);for(const n of R(this,Ea))z(this,Ue,Xu).call(this,n.defaultPropertiesToUpdate)}}getId(){return R(this,SA).id}get currentLayer(){return R(this,ds).get(R(this,Hg))}getLayer(e){return R(this,ds).get(e)}get currentPageIndex(){return R(this,Hg)}addLayer(e){R(this,ds).set(e.pageIndex,e),R(this,bd)?e.enable():e.disable()}removeLayer(e){R(this,ds).delete(e.pageIndex)}updateMode(e,n=null,r=!1){if(R(this,fs)!==e){if($(this,fs,e),e===Gt.NONE){this.setEditingState(!1),z(this,Ue,qee).call(this);return}this.setEditingState(!0),z(this,Ue,Vee).call(this),this.unselectAll();for(const s of R(this,ds).values())s.updateMode(e);if(!n&&r){this.addNewEditorFromKeyboard();return}if(n){for(const s of R(this,Lr).values())if(s.annotationElementId===n){this.setSelected(s),s.enterInEditMode();break}}}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e!==R(this,fs)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,n){var r;if(R(this,Ea)){switch(e){case vt.CREATE:this.currentLayer.addNewEditor();return;case vt.HIGHLIGHT_DEFAULT_COLOR:(r=R(this,Ix))==null||r.updateColor(n);break;case vt.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(R(this,jx)||$(this,jx,new Map)).set(e,n),this.showAllEditors("highlight",n);break}for(const s of R(this,gn))s.updateParams(e,n);for(const s of R(this,Ea))s.updateDefaultParams(e,n)}}showAllEditors(e,n,r=!1){var i;for(const o of R(this,Lr).values())o.editorType===e&&o.show(n);(((i=R(this,jx))==null?void 0:i.get(vt.HIGHLIGHT_SHOW_ALL))??!0)!==n&&z(this,Ue,Xu).call(this,[[vt.HIGHLIGHT_SHOW_ALL,n]])}enableWaiting(e=!1){if(R(this,Ox)!==e){$(this,Ox,e);for(const n of R(this,ds).values())e?n.disableClick():n.enableClick(),n.div.classList.toggle("waiting",e)}}getEditors(e){const n=[];for(const r of R(this,Lr).values())r.pageIndex===e&&n.push(r);return n}getEditor(e){return R(this,Lr).get(e)}addEditor(e){R(this,Lr).set(e.id,e)}removeEditor(e){var n;e.div.contains(document.activeElement)&&(R(this,vl)&&clearTimeout(R(this,vl)),$(this,vl,setTimeout(()=>{this.focusMainContainer(),$(this,vl,null)},0))),R(this,Lr).delete(e.id),this.unselect(e),(!e.annotationElementId||!R(this,xh).has(e.annotationElementId))&&((n=R(this,Tc))==null||n.remove(e.id))}addDeletedAnnotationElement(e){R(this,xh).add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return R(this,xh).has(e)}removeDeletedAnnotationElement(e){R(this,xh).delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}setActiveEditor(e){R(this,ao)!==e&&($(this,ao,e),e&&z(this,Ue,Xu).call(this,e.propertiesToUpdate))}updateUI(e){R(this,Ue,Wee)===e&&z(this,Ue,Xu).call(this,e.propertiesToUpdate)}toggleSelected(e){if(R(this,gn).has(e)){R(this,gn).delete(e),e.unselect(),z(this,Ue,Gs).call(this,{hasSelectedEditor:this.hasSelection});return}R(this,gn).add(e),e.select(),z(this,Ue,Xu).call(this,e.propertiesToUpdate),z(this,Ue,Gs).call(this,{hasSelectedEditor:!0})}setSelected(e){for(const n of R(this,gn))n!==e&&n.unselect();R(this,gn).clear(),R(this,gn).add(e),e.select(),z(this,Ue,Xu).call(this,e.propertiesToUpdate),z(this,Ue,Gs).call(this,{hasSelectedEditor:!0})}isSelected(e){return R(this,gn).has(e)}get firstSelectedEditor(){return R(this,gn).values().next().value}unselect(e){e.unselect(),R(this,gn).delete(e),z(this,Ue,Gs).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return R(this,gn).size!==0}get isEnterHandled(){return R(this,gn).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){R(this,Ca).undo(),z(this,Ue,Gs).call(this,{hasSomethingToUndo:R(this,Ca).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:z(this,Ue,Zb).call(this)})}redo(){R(this,Ca).redo(),z(this,Ue,Gs).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:R(this,Ca).hasSomethingToRedo(),isEmpty:z(this,Ue,Zb).call(this)})}addCommands(e){R(this,Ca).add(e),z(this,Ue,Gs).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:z(this,Ue,Zb).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const e=[...R(this,gn)],n=()=>{for(const s of e)s.remove()},r=()=>{for(const s of e)z(this,Ue,XO).call(this,s)};this.addCommands({cmd:n,undo:r,mustExec:!0})}commitOrRemove(){var e;(e=R(this,ao))==null||e.commitOrRemove()}hasSomethingToControl(){return R(this,ao)||this.hasSelection}selectAll(){for(const e of R(this,gn))e.commit();z(this,Ue,QO).call(this,R(this,Lr).values())}unselectAll(){if(!(R(this,ao)&&(R(this,ao).commitOrRemove(),R(this,fs)!==Gt.NONE))&&this.hasSelection){for(const e of R(this,gn))e.unselect();R(this,gn).clear(),z(this,Ue,Gs).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(e,n,r=!1){if(r||this.commitOrRemove(),!this.hasSelection)return;R(this,xd)[0]+=e,R(this,xd)[1]+=n;const[s,i]=R(this,xd),o=[...R(this,gn)],a=1e3;R(this,bl)&&clearTimeout(R(this,bl)),$(this,bl,setTimeout(()=>{$(this,bl,null),R(this,xd)[0]=R(this,xd)[1]=0,this.addCommands({cmd:()=>{for(const c of o)R(this,Lr).has(c.id)&&c.translateInPage(s,i)},undo:()=>{for(const c of o)R(this,Lr).has(c.id)&&c.translateInPage(-s,-i)},mustExec:!1})},a));for(const c of o)c.translateInPage(e,n)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),$(this,gl,new Map);for(const e of R(this,gn))R(this,gl).set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!R(this,gl))return!1;this.disableUserSelect(!1);const e=R(this,gl);$(this,gl,null);let n=!1;for(const[{x:s,y:i,pageIndex:o},a]of e)a.newX=s,a.newY=i,a.newPageIndex=o,n||(n=s!==a.savedX||i!==a.savedY||o!==a.savedPageIndex);if(!n)return!1;const r=(s,i,o,a)=>{if(R(this,Lr).has(s.id)){const c=R(this,ds).get(a);c?s._setParentAndPosition(c,i,o):(s.pageIndex=a,s.x=i,s.y=o)}};return this.addCommands({cmd:()=>{for(const[s,{newX:i,newY:o,newPageIndex:a}]of e)r(s,i,o,a)},undo:()=>{for(const[s,{savedX:i,savedY:o,savedPageIndex:a}]of e)r(s,i,o,a)},mustExec:!0}),!0}dragSelectedEditors(e,n){if(R(this,gl))for(const r of R(this,gl).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())||R(this,gn).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return R(this,ao)===e}getActive(){return R(this,ao)}getMode(){return R(this,fs)}get imageManager(){return Yt(this,"imageManager",new VO)}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:o}=e.getBoundingClientRect();let a;switch(e.getAttribute("data-main-rotation")){case"90":a=(u,f,l,d)=>({x:(f-s)/o,y:1-(u+l-r)/i,width:d/o,height:l/i});break;case"180":a=(u,f,l,d)=>({x:1-(u+l-r)/i,y:1-(f+d-s)/o,width:l/i,height:d/o});break;case"270":a=(u,f,l,d)=>({x:1-(f+d-s)/o,y:(u-r)/i,width:d/o,height:l/i});break;default:a=(u,f,l,d)=>({x:(u-r)/i,y:(f-s)/o,width:l/i,height:d/o});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:p,width:h,height:m}of l.getClientRects())h===0||m===0||c.push(a(d,p,h,m))}return c.length===0?null:c}addChangedExistingAnnotation({annotationElementId:e,id:n}){(R(this,Ug)||$(this,Ug,new Map)).set(e,n)}removeChangedExistingAnnotation({annotationElementId:e}){var n;(n=R(this,Ug))==null||n.delete(e)}renderAnnotationElement(e){var s;const n=(s=R(this,Ug))==null?void 0:s.get(e.data.id);if(!n)return;const r=R(this,Tc).getRawValue(n);r&&(R(this,fs)===Gt.NONE&&!r.hasBeenModified||r.renderAnnotationElement(e))}};zg=new WeakMap,ao=new WeakMap,Lr=new WeakMap,ds=new WeakMap,Bg=new WeakMap,Tc=new WeakMap,Ug=new WeakMap,Ca=new WeakMap,Hg=new WeakMap,xh=new WeakMap,gl=new WeakMap,Ea=new WeakMap,wh=new WeakMap,Dx=new WeakMap,Mx=new WeakMap,vl=new WeakMap,Vg=new WeakMap,yd=new WeakMap,yl=new WeakMap,SA=new WeakMap,bd=new WeakMap,Ox=new WeakMap,_h=new WeakMap,Ix=new WeakMap,qg=new WeakMap,fs=new WeakMap,gn=new WeakMap,kc=new WeakMap,Sh=new WeakMap,jx=new WeakMap,Lx=new WeakMap,$x=new WeakMap,Fx=new WeakMap,zx=new WeakMap,Bx=new WeakMap,Ux=new WeakMap,Hx=new WeakMap,Vx=new WeakMap,qx=new WeakMap,Wx=new WeakMap,Gx=new WeakMap,Kx=new WeakMap,xd=new WeakMap,bl=new WeakMap,Dc=new WeakMap,Yx=new WeakMap,Ue=new WeakSet,bC=function({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e},Lee=function(){const e=document.getSelection();if(!e||e.isCollapsed)return;const r=z(this,Ue,bC).call(this,e).closest(".textLayer"),s=this.getSelectionBoxes(r);s&&(R(this,yl)||$(this,yl,new u$e(this)),R(this,yl).show(r,s,this.direction==="ltr"))},$ee=function(){var i,o,a;const e=document.getSelection();if(!e||e.isCollapsed){R(this,kc)&&((i=R(this,yl))==null||i.hide(),$(this,kc,null),z(this,Ue,Gs).call(this,{hasSelectedText:!1}));return}const{anchorNode:n}=e;if(n===R(this,kc))return;if(!z(this,Ue,bC).call(this,e).closest(".textLayer")){R(this,kc)&&((o=R(this,yl))==null||o.hide(),$(this,kc,null),z(this,Ue,Gs).call(this,{hasSelectedText:!1}));return}if((a=R(this,yl))==null||a.hide(),$(this,kc,n),z(this,Ue,Gs).call(this,{hasSelectedText:!0}),!(R(this,fs)!==Gt.HIGHLIGHT&&R(this,fs)!==Gt.NONE)&&(R(this,fs)===Gt.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),$(this,yd,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"&&z(this,Ue,xC).call(this,"main_toolbar"))};window.addEventListener("pointerup",u,{signal:c}),window.addEventListener("blur",u,{signal:c})}},xC=function(e=""){R(this,fs)===Gt.HIGHLIGHT?this.highlightSelection(e):R(this,Dx)&&z(this,Ue,Lee).call(this)},Fee=function(){document.addEventListener("selectionchange",z(this,Ue,$ee).bind(this),{signal:this._signal})},zee=function(){const e=this._signal;window.addEventListener("focus",R(this,$x),{signal:e}),window.addEventListener("blur",R(this,Lx),{signal:e})},Bee=function(){window.removeEventListener("focus",R(this,$x)),window.removeEventListener("blur",R(this,Lx))},GO=function(){const e=this._signal;window.addEventListener("keydown",R(this,Ux),{signal:e}),window.addEventListener("keyup",R(this,Hx),{signal:e})},Uee=function(){window.removeEventListener("keydown",R(this,Ux)),window.removeEventListener("keyup",R(this,Hx))},KO=function(){const e=this._signal;document.addEventListener("copy",R(this,Fx),{signal:e}),document.addEventListener("cut",R(this,zx),{signal:e}),document.addEventListener("paste",R(this,Bx),{signal:e})},YO=function(){document.removeEventListener("copy",R(this,Fx)),document.removeEventListener("cut",R(this,zx)),document.removeEventListener("paste",R(this,Bx))},Hee=function(){const e=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:e}),document.addEventListener("drop",this.drop.bind(this),{signal:e})},Gs=function(e){Object.entries(e).some(([r,s])=>R(this,Kx)[r]!==s)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(R(this,Kx),e)}),R(this,fs)===Gt.HIGHLIGHT&&e.hasSelectedEditor===!1&&z(this,Ue,Xu).call(this,[[vt.HIGHLIGHT_FREE,!0]]))},Xu=function(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})},Vee=function(){if(!R(this,bd)){$(this,bd,!0);for(const e of R(this,ds).values())e.enable();for(const e of R(this,Lr).values())e.enable()}},qee=function(){if(this.unselectAll(),R(this,bd)){$(this,bd,!1);for(const e of R(this,ds).values())e.disable();for(const e of R(this,Lr).values())e.disable()}},XO=function(e){const n=R(this,ds).get(e.pageIndex);n?n.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))},Wee=function(){let e=null;for(e of R(this,gn));return e},Zb=function(){if(R(this,Lr).size===0)return!0;if(R(this,Lr).size===1)for(const e of R(this,Lr).values())return e.isEmpty();return!1},QO=function(e){for(const n of R(this,gn))n.unselect();R(this,gn).clear();for(const n of e)n.isEmpty()||(R(this,gn).add(n),n.select());z(this,Ue,Gs).call(this,{hasSelectedEditor:this.hasSelection})},Te(sg,"TRANSLATE_SMALL",1),Te(sg,"TRANSLATE_BIG",10);let kp=sg;var Mc,Oc,Aa,Ic,lo,Wg,Ra,Xx,ZO;const Sc=class Sc{constructor(e){B(this,Xx);B(this,Mc,"");B(this,Oc,!1);B(this,Aa,null);B(this,Ic,null);B(this,lo,null);B(this,Wg,!1);B(this,Ra,null);$(this,Ra,e)}static initialize(e){Sc._l10nPromise||(Sc._l10nPromise=e)}async render(){const e=$(this,Aa,document.createElement("button"));e.className="altText";const n=await Sc._l10nPromise.get("pdfjs-editor-alt-text-button-label");e.textContent=n,e.setAttribute("aria-label",n),e.tabIndex="0";const r=R(this,Ra)._uiManager._signal;e.addEventListener("contextmenu",Bi,{signal:r}),e.addEventListener("pointerdown",i=>i.stopPropagation(),{signal:r});const s=i=>{i.preventDefault(),R(this,Ra)._uiManager.editAltText(R(this,Ra))};return e.addEventListener("click",s,{capture:!0,signal:r}),e.addEventListener("keydown",i=>{i.target===e&&i.key==="Enter"&&($(this,Wg,!0),s(i))},{signal:r}),await z(this,Xx,ZO).call(this),e}finish(){R(this,Aa)&&(R(this,Aa).focus({focusVisible:R(this,Wg)}),$(this,Wg,!1))}isEmpty(){return!R(this,Mc)&&!R(this,Oc)}get data(){return{altText:R(this,Mc),decorative:R(this,Oc)}}set data({altText:e,decorative:n}){R(this,Mc)===e&&R(this,Oc)===n||($(this,Mc,e),$(this,Oc,n),z(this,Xx,ZO).call(this))}toggle(e=!1){R(this,Aa)&&(!e&&R(this,lo)&&(clearTimeout(R(this,lo)),$(this,lo,null)),R(this,Aa).disabled=!e)}destroy(){var e;(e=R(this,Aa))==null||e.remove(),$(this,Aa,null),$(this,Ic,null)}};Mc=new WeakMap,Oc=new WeakMap,Aa=new WeakMap,Ic=new WeakMap,lo=new WeakMap,Wg=new WeakMap,Ra=new WeakMap,Xx=new WeakSet,ZO=async function(){var s;const e=R(this,Aa);if(!e)return;if(!R(this,Mc)&&!R(this,Oc)){e.classList.remove("done"),(s=R(this,Ic))==null||s.remove();return}e.classList.add("done"),Sc._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then(i=>{e.setAttribute("aria-label",i)});let n=R(this,Ic);if(!n){$(this,Ic,n=document.createElement("span")),n.className="tooltip",n.setAttribute("role","tooltip");const i=n.id=`alt-text-tooltip-${R(this,Ra).id}`;e.setAttribute("aria-describedby",i);const o=100,a=R(this,Ra)._uiManager._signal;a.addEventListener("abort",()=>{clearTimeout(R(this,lo)),$(this,lo,null)},{once:!0}),e.addEventListener("mouseenter",()=>{$(this,lo,setTimeout(()=>{$(this,lo,null),R(this,Ic).classList.add("show"),R(this,Ra)._reportTelemetry({action:"alt_text_tooltip"})},o))},{signal:a}),e.addEventListener("mouseleave",()=>{var c;R(this,lo)&&(clearTimeout(R(this,lo)),$(this,lo,null)),(c=R(this,Ic))==null||c.classList.remove("show")},{signal:a})}n.innerText=R(this,Oc)?await Sc._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):R(this,Mc),n.parentNode||e.append(n);const r=R(this,Ra).getImageForAltText();r==null||r.setAttribute("aria-describedby",n.id)},Te(Sc,"_l10nPromise",null);let oA=Sc;var Ch,Na,Os,Gg,Eh,hs,Ah,Kg,Yg,Is,Qx,Rh,wd,Zx,Nh,jc,xl,Xg,Qg,Ho,Jx,CA,$t,JO,ew,eI,tI,Gee,Kee,nI,rI,sI,Yee,Xee,Qee,Zee,iI,Jb;const kn=class kn{constructor(e){B(this,$t);B(this,Ch,null);B(this,Na,null);B(this,Os,null);B(this,Gg,!1);B(this,Eh,!1);B(this,hs,null);B(this,Ah,null);B(this,Kg,this.focusin.bind(this));B(this,Yg,this.focusout.bind(this));B(this,Is,null);B(this,Qx,"");B(this,Rh,!1);B(this,wd,null);B(this,Zx,!1);B(this,Nh,!1);B(this,jc,!1);B(this,xl,null);B(this,Xg,0);B(this,Qg,0);B(this,Ho,null);Te(this,"_initialOptions",Object.create(null));Te(this,"_isVisible",!0);Te(this,"_uiManager",null);Te(this,"_focusEventsAllowed",!0);Te(this,"_l10nPromise",null);B(this,Jx,!1);B(this,CA,kn._zIndex++);this.constructor===kn&&Rn("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:o}}=this.parent.viewport;this.rotation=n,this.pageRotation=(360+n-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[r,s],this.pageTranslation=[i,o];const[a,c]=this.parentDimensions;this.x=e.x/a,this.y=e.y/c,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){const e=kn.prototype._resizeWithKeyboard,n=kp.TRANSLATE_SMALL,r=kp.TRANSLATE_BIG;return Yt(this,"_resizerKeyboardManager",new Y_([[["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"],kn.prototype._stopResizingWithKeyboard]]))}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return Yt(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const n=new p$e({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(kn._l10nPromise||(kn._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,o=>`-${o.toLowerCase()}`))]))),r!=null&&r.strings)for(const i of r.strings)kn._l10nPromise.set(i,e.get(i));if(kn._borderLineWidth!==-1)return;const s=getComputedStyle(document.documentElement);kn._borderLineWidth=parseFloat(s.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,n){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,n){Rn("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return R(this,Jx)}set _isDraggable(e){var n;$(this,Jx,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=R(this,CA)}setParent(e){e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):z(this,$t,Jb).call(this),this.parent=e}focusin(e){this._focusEventsAllowed&&(R(this,Rh)?$(this,Rh,!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,o]=this.parentDimensions;[r,s]=this.screenToPageTranslation(r,s),this.x=(e+r)/i,this.y=(n+s)/o,this.fixAndSetPosition()}translate(e,n){z(this,$t,JO).call(this,this.parentDimensions,e,n)}translateInPage(e,n){R(this,wd)||$(this,wd,[this.x,this.y]),z(this,$t,JO).call(this,this.pageDimensions,e,n),this.div.scrollIntoView({block:"nearest"})}drag(e,n){R(this,wd)||$(this,wd,[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:o}=this;const[a,c]=this.getBaseTranslation();i+=a,o+=c,this.div.style.left=`${(100*i).toFixed(2)}%`,this.div.style.top=`${(100*o).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!R(this,wd)&&(R(this,wd)[0]!==this.x||R(this,wd)[1]!==this.y)}getBaseTranslation(){const[e,n]=this.parentDimensions,{_borderLineWidth:r}=kn,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:o,height:a}=this;if(o*=n,a*=r,s*=n,i*=r,this._mustFixPosition)switch(e){case 0:s=Math.max(0,Math.min(n-o,s)),i=Math.max(0,Math.min(r-a,i));break;case 90:s=Math.max(0,Math.min(n-a,s)),i=Math.min(r,Math.max(o,i));break;case 180:s=Math.min(n,Math.max(o,s)),i=Math.min(r,Math.max(a,i));break;case 270:s=Math.min(n,Math.max(a,s)),i=Math.max(0,Math.min(r-o,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 z(r=kn,ew,eI).call(r,e,n,this.parentRotation)}pageTranslationToScreen(e,n){var r;return z(r=kn,ew,eI).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 Ii.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)}%`,R(this,Eh)||(this.div.style.height=`${(100*n/s).toFixed(2)}%`)}fixDims(){const{style:e}=this.div,{height:n,width:r}=e,s=r.endsWith("%"),i=!R(this,Eh)&&n.endsWith("%");if(s&&i)return;const[o,a]=this.parentDimensions;s||(e.width=`${(100*parseFloat(r)/o).toFixed(2)}%`),!R(this,Eh)&&!i&&(e.height=`${(100*parseFloat(n)/a).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}altTextFinish(){var e;(e=R(this,Os))==null||e.finish()}async addEditToolbar(){return R(this,Is)||R(this,Nh)?R(this,Is):($(this,Is,new UO(this)),this.div.append(R(this,Is).render()),R(this,Os)&&R(this,Is).addAltTextButton(await R(this,Os).render()),R(this,Is))}removeEditToolbar(){var e;R(this,Is)&&(R(this,Is).remove(),$(this,Is,null),(e=R(this,Os))==null||e.destroy())}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){R(this,Os)||(oA.initialize(kn._l10nPromise),$(this,Os,new oA(this)),R(this,Ch)&&(R(this,Os).data=R(this,Ch),$(this,Ch,null)),await this.addEditToolbar())}get altTextData(){var e;return(e=R(this,Os))==null?void 0:e.data}set altTextData(e){R(this,Os)&&(R(this,Os).data=e)}hasAltText(){var e;return!((e=R(this,Os))!=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=R(this,Gg)?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground();const e=this._uiManager._signal;this.div.addEventListener("focusin",R(this,Kg),{signal:e}),this.div.addEventListener("focusout",R(this,Yg),{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),iA(this,this.div,["pointerdown"]),this.div}pointerdown(e){const{isMac:n}=Ii.platform;if(e.button!==0||e.ctrlKey&&n){e.preventDefault();return}if($(this,Rh,!0),this._isDraggable){z(this,$t,Yee).call(this,e);return}z(this,$t,sI).call(this,e)}moveInDOM(){R(this,xl)&&clearTimeout(R(this,xl)),$(this,xl,setTimeout(()=>{var e;$(this,xl,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,o]=this.pageDimensions,[a,c]=this.pageTranslation,u=e/s,f=n/s,l=this.x*i,d=this.y*o,p=this.width*i,h=this.height*o;switch(r){case 0:return[l+u+a,o-d-f-h+c,l+u+p+a,o-d-f+c];case 90:return[l+f+a,o-d+u+c,l+f+h+a,o-d+u+p+c];case 180:return[l-u-p+a,o-d+f+c,l-u+a,o-d+f+h+c];case 270:return[l-f-h+a,o-d-u-p+c,l-f+a,o-d-u+c];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,n){const[r,s,i,o]=e,a=i-r,c=o-s;switch(this.rotation){case 0:return[r,n-o,a,c];case 90:return[r,n-s,c,a];case 180:return[i,n-s,a,c];case 270:return[i,n-o,c,a];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){$(this,Nh,!0)}disableEditMode(){$(this,Nh,!1)}isInEditMode(){return R(this,Nh)}shouldGetKeyboardEvents(){return R(this,jc)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var n,r;const e=this._uiManager._signal;(n=this.div)==null||n.addEventListener("focusin",R(this,Kg),{signal:e}),(r=this.div)==null||r.addEventListener("focusout",R(this,Yg),{signal:e})}rotate(e){}serialize(e=!1,n=null){Rn("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,Ch,e.accessibilityData);const[i,o]=s.pageDimensions,[a,c,u,f]=s.getRectInCurrentCoords(e.rect,o);return s.x=a/i,s.y=c/o,s.width=u/i,s.height=f/o,s}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.div.removeEventListener("focusin",R(this,Kg)),this.div.removeEventListener("focusout",R(this,Yg)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),R(this,xl)&&(clearTimeout(R(this,xl)),$(this,xl,null)),z(this,$t,Jb).call(this),this.removeEditToolbar(),R(this,Ho)){for(const e of R(this,Ho).values())clearTimeout(e);$(this,Ho,null)}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(z(this,$t,Gee).call(this),R(this,hs).classList.remove("hidden"),iA(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,Ah,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const n=R(this,hs).children;if(!R(this,Na)){$(this,Na,Array.from(n));const o=z(this,$t,Xee).bind(this),a=z(this,$t,Qee).bind(this),c=this._uiManager._signal;for(const u of R(this,Na)){const f=u.getAttribute("data-resizer-name");u.setAttribute("role","spinbutton"),u.addEventListener("keydown",o,{signal:c}),u.addEventListener("blur",a,{signal:c}),u.addEventListener("focus",z(this,$t,Zee).bind(this,f),{signal:c}),kn._l10nPromise.get(`pdfjs-editor-resizer-label-${f}`).then(l=>u.setAttribute("aria-label",l))}}const r=R(this,Na)[0];let s=0;for(const o of n){if(o===r)break;s++}const i=(360-this.rotation+this.parentRotation)%360/90*(R(this,Na).length/4);if(i!==s){if(i<s)for(let a=0;a<s-i;a++)R(this,hs).append(R(this,hs).firstChild);else if(i>s)for(let a=0;a<i-s;a++)R(this,hs).firstChild.before(R(this,hs).lastChild);let o=0;for(const a of n){const u=R(this,Na)[o++].getAttribute("data-resizer-name");kn._l10nPromise.get(`pdfjs-editor-resizer-label-${u}`).then(f=>a.setAttribute("aria-label",f))}}z(this,$t,iI).call(this,0),$(this,jc,!0),R(this,hs).firstChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}_resizeWithKeyboard(e,n){R(this,jc)&&z(this,$t,rI).call(this,R(this,Qx),{movementX:e,movementY:n})}_stopResizingWithKeyboard(){z(this,$t,Jb).call(this),this.div.focus()}select(){var e,n;if(this.makeResizable(),(e=this.div)==null||e.classList.add("selectedEditor"),!R(this,Is)){this.addEditToolbar().then(()=>{var r,s;(r=this.div)!=null&&r.classList.contains("selectedEditor")&&((s=R(this,Is))==null||s.show())});return}(n=R(this,Is))==null||n.show()}unselect(){var e,n,r,s;(e=R(this,hs))==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=R(this,Is))==null||s.hide()}updateParams(e,n){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return R(this,Zx)}set isEditing(e){$(this,Zx,e),this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(e,n){$(this,Eh,!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){R(this,Ho)||$(this,Ho,new Map);const{action:r}=e;let s=R(this,Ho).get(r);s&&clearTimeout(s),s=setTimeout(()=>{this._reportTelemetry(e),R(this,Ho).delete(r),R(this,Ho).size===0&&$(this,Ho,null)},kn._telemetryTimeout),R(this,Ho).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,Gg,!1)}disable(){this.div&&(this.div.tabIndex=-1),$(this,Gg,!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()}};Ch=new WeakMap,Na=new WeakMap,Os=new WeakMap,Gg=new WeakMap,Eh=new WeakMap,hs=new WeakMap,Ah=new WeakMap,Kg=new WeakMap,Yg=new WeakMap,Is=new WeakMap,Qx=new WeakMap,Rh=new WeakMap,wd=new WeakMap,Zx=new WeakMap,Nh=new WeakMap,jc=new WeakMap,xl=new WeakMap,Xg=new WeakMap,Qg=new WeakMap,Ho=new WeakMap,Jx=new WeakMap,CA=new WeakMap,$t=new WeakSet,JO=function([e,n],r,s){[r,s]=this.screenToPageTranslation(r,s),this.x+=r/e,this.y+=s/n,this.fixAndSetPosition()},ew=new WeakSet,eI=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]}},tI=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]}},Gee=function(){if(R(this,hs))return;$(this,hs,document.createElement("div")),R(this,hs).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");R(this,hs).append(s),s.classList.add("resizer",r),s.setAttribute("data-resizer-name",r),s.addEventListener("pointerdown",z(this,$t,Kee).bind(this,r),{signal:n}),s.addEventListener("contextmenu",Bi,{signal:n}),s.tabIndex=-1}this.div.prepend(R(this,hs))},Kee=function(e,n){var m;n.preventDefault();const{isMac:r}=Ii.platform;if(n.button!==0||n.ctrlKey&&r)return;(m=R(this,Os))==null||m.toggle(!1);const s=z(this,$t,rI).bind(this,e),i=this._isDraggable;this._isDraggable=!1;const o=this._uiManager._signal,a={passive:!0,capture:!0,signal:o};this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",s,a),window.addEventListener("contextmenu",Bi,{signal:o});const c=this.x,u=this.y,f=this.width,l=this.height,d=this.parent.div.style.cursor,p=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(n.target).cursor;const h=()=>{var y;this.parent.togglePointerEvents(!0),(y=R(this,Os))==null||y.toggle(!0),this._isDraggable=i,window.removeEventListener("pointerup",h),window.removeEventListener("blur",h),window.removeEventListener("pointermove",s,a),window.removeEventListener("contextmenu",Bi),this.parent.div.style.cursor=d,this.div.style.cursor=p,z(this,$t,nI).call(this,c,u,f,l)};window.addEventListener("pointerup",h,{signal:o}),window.addEventListener("blur",h,{signal:o})},nI=function(e,n,r,s){const i=this.x,o=this.y,a=this.width,c=this.height;i===e&&o===n&&a===r&&c===s||this.addCommands({cmd:()=>{this.width=a,this.height=c,this.x=i,this.y=o;const[u,f]=this.parentDimensions;this.setDims(u*a,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})},rI=function(e,n){const[r,s]=this.parentDimensions,i=this.x,o=this.y,a=this.width,c=this.height,u=kn.MIN_SIZE/r,f=kn.MIN_SIZE/s,l=V=>Math.round(V*1e4)/1e4,d=z(this,$t,tI).call(this,this.rotation),p=(V,U)=>[d[0]*V+d[2]*U,d[1]*V+d[3]*U],h=z(this,$t,tI).call(this,360-this.rotation),m=(V,U)=>[h[0]*V+h[2]*U,h[1]*V+h[3]*U];let y,g,v=!1,x=!1;switch(e){case"topLeft":v=!0,y=(V,U)=>[0,0],g=(V,U)=>[V,U];break;case"topMiddle":y=(V,U)=>[V/2,0],g=(V,U)=>[V/2,U];break;case"topRight":v=!0,y=(V,U)=>[V,0],g=(V,U)=>[0,U];break;case"middleRight":x=!0,y=(V,U)=>[V,U/2],g=(V,U)=>[0,U/2];break;case"bottomRight":v=!0,y=(V,U)=>[V,U],g=(V,U)=>[0,0];break;case"bottomMiddle":y=(V,U)=>[V/2,U],g=(V,U)=>[V/2,0];break;case"bottomLeft":v=!0,y=(V,U)=>[0,U],g=(V,U)=>[V,0];break;case"middleLeft":x=!0,y=(V,U)=>[0,U/2],g=(V,U)=>[V,U/2];break}const _=y(a,c),A=g(a,c);let N=p(...A);const T=l(i+N[0]),E=l(o+N[1]);let P=1,k=1,[M,I]=this.screenToPageTranslation(n.movementX,n.movementY);if([M,I]=m(M/r,I/s),v){const V=Math.hypot(a,c);P=k=Math.max(Math.min(Math.hypot(A[0]-_[0]-M,A[1]-_[1]-I)/V,1/a,1/c),u/a,f/c)}else x?P=Math.max(u,Math.min(1,Math.abs(A[0]-_[0]-M)))/a:k=Math.max(f,Math.min(1,Math.abs(A[1]-_[1]-I)))/c;const j=l(a*P),L=l(c*k);N=p(...g(j,L));const H=T-N[0],K=E-N[1];this.width=j,this.height=L,this.x=H,this.y=K,this.setDims(r*j,s*L),this.fixAndSetPosition()},sI=function(e){const{isMac:n}=Ii.platform;e.ctrlKey&&!n||e.shiftKey||e.metaKey&&n?this.parent.toggleSelected(this):this.parent.setSelected(this)},Yee=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,Xg,e.clientX),$(this,Qg,e.clientY),s=a=>{const{clientX:c,clientY:u}=a,[f,l]=this.screenToPageTranslation(c-R(this,Xg),u-R(this,Qg));$(this,Xg,c),$(this,Qg,u),this._uiManager.dragSelectedEditors(f,l)},window.addEventListener("pointermove",s,r));const o=()=>{window.removeEventListener("pointerup",o),window.removeEventListener("blur",o),n&&(this.div.classList.remove("moving"),window.removeEventListener("pointermove",s,r)),$(this,Rh,!1),this._uiManager.endDragSession()||z(this,$t,sI).call(this,e)};window.addEventListener("pointerup",o,{signal:i}),window.addEventListener("blur",o,{signal:i})},Xee=function(e){kn._resizerKeyboardManager.exec(this,e)},Qee=function(e){var n;R(this,jc)&&((n=e.relatedTarget)==null?void 0:n.parentNode)!==R(this,hs)&&z(this,$t,Jb).call(this)},Zee=function(e){$(this,Qx,R(this,jc)?e:"")},iI=function(e){if(R(this,Na))for(const n of R(this,Na))n.tabIndex=e},Jb=function(){if($(this,jc,!1),z(this,$t,iI).call(this,-1),R(this,Ah)){const{savedX:e,savedY:n,savedWidth:r,savedHeight:s}=R(this,Ah);z(this,$t,nI).call(this,e,n,r,s),$(this,Ah,null)}},B(kn,ew),Te(kn,"_borderLineWidth",-1),Te(kn,"_colorManager",new WO),Te(kn,"_zIndex",1),Te(kn,"_telemetryTimeout",1e3);let yn=kn;class p$e extends yn{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}const tH=3285377520,zo=4294901760,cl=65535;class Jee{constructor(e){this.h1=e?e&4294967295:tH,this.h2=e?e&4294967295:tH}update(e){let n,r;if(typeof e=="string"){n=new Uint8Array(e.length*2),r=0;for(let m=0,y=e.length;m<y;m++){const g=e.charCodeAt(m);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,o=new Uint32Array(n.buffer,0,s);let a=0,c=0,u=this.h1,f=this.h2;const l=3432918353,d=461845907,p=l&cl,h=d&cl;for(let m=0;m<s;m++)m&1?(a=o[m],a=a*l&zo|a*p&cl,a=a<<15|a>>>17,a=a*d&zo|a*h&cl,u^=a,u=u<<13|u>>>19,u=u*5+3864292196):(c=o[m],c=c*l&zo|c*p&cl,c=c<<15|c>>>17,c=c*d&zo|c*h&cl,f^=c,f=f<<13|f>>>19,f=f*5+3864292196);switch(a=0,i){case 3:a^=n[s*4+2]<<16;case 2:a^=n[s*4+1]<<8;case 1:a^=n[s*4],a=a*l&zo|a*p&cl,a=a<<15|a>>>17,a=a*d&zo|a*h&cl,s&1?u^=a:f^=a}this.h1=u,this.h2=f}hexdigest(){let e=this.h1,n=this.h2;return e^=n>>>1,e=e*3981806797&zo|e*36045&cl,n=n*4283543511&zo|((n<<16|e>>>16)*2950163797&zo)>>>16,e^=n>>>1,e=e*444984403&zo|e*60499&cl,n=n*3301882366&zo|((n<<16|e>>>16)*3120437893&zo)>>>16,e^=n>>>1,(e>>>0).toString(16).padStart(8,"0")+(n>>>0).toString(16).padStart(8,"0")}}const oI=Object.freeze({map:null,hash:"",transfer:void 0});var Ph,ps,EA,ete;class nF{constructor(){B(this,EA);B(this,Ph,!1);B(this,ps,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,n){const r=R(this,ps).get(e);return r===void 0?n:Object.assign(n,r)}getRawValue(e){return R(this,ps).get(e)}remove(e){if(R(this,ps).delete(e),R(this,ps).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const n of R(this,ps).values())if(n instanceof yn)return;this.onAnnotationEditor(null)}}setValue(e,n){const r=R(this,ps).get(e);let s=!1;if(r!==void 0)for(const[i,o]of Object.entries(n))r[i]!==o&&(s=!0,r[i]=o);else s=!0,R(this,ps).set(e,n);s&&z(this,EA,ete).call(this),n instanceof yn&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(n.constructor._type)}has(e){return R(this,ps).has(e)}getAll(){return R(this,ps).size>0?Y$(R(this,ps)):null}setAll(e){for(const[n,r]of Object.entries(e))this.setValue(n,r)}get size(){return R(this,ps).size}resetModified(){R(this,Ph)&&($(this,Ph,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new tte(this)}get serializable(){if(R(this,ps).size===0)return oI;const e=new Map,n=new Jee,r=[],s=Object.create(null);let i=!1;for(const[o,a]of R(this,ps)){const c=a instanceof yn?a.serialize(!1,s):a;c&&(e.set(o,c),n.update(`${o}:${JSON.stringify(c)}`),i||(i=!!c.bitmap))}if(i)for(const o of e.values())o.bitmap&&r.push(o.bitmap);return e.size>0?{map:e,hash:n.hexdigest(),transfer:r}:oI}get editorStats(){let e=null;const n=new Map;for(const r of R(this,ps).values()){if(!(r instanceof yn))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 o=e[i]||(e[i]=new Map);for(const[a,c]of Object.entries(s)){if(a==="type")continue;let u=o.get(a);u||(u=new Map,o.set(a,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}}Ph=new WeakMap,ps=new WeakMap,EA=new WeakSet,ete=function(){R(this,Ph)||($(this,Ph,!0),typeof this.onSetModified=="function"&&this.onSetModified())};var tw;class tte extends nF{constructor(n){super();B(this,tw);const{map:r,hash:s,transfer:i}=n.serializable,o=structuredClone(r,i?{transfer:i}:null);$(this,tw,{map:o,hash:s,transfer:i})}get print(){Rn("Should not call PrintAnnotationStorage.print")}get serializable(){return R(this,tw)}}tw=new WeakMap;var Zg;class m$e{constructor({ownerDocument:e=globalThis.document,styleElement:n=null}){B(this,Zg,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(),R(this,Zg).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,_inspectFont:n}){if(!(!e||R(this,Zg).has(e.loadedName))){if(Wr(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:r,src:s,style:i}=e,o=new FontFace(r,s,i);this.addNativeFontFace(o);try{await o.load(),R(this,Zg).add(r),n==null||n(e)}catch{jt(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(o)}return}Rn("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 jt(`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 Yt(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){let e=!1;return(Fs||typeof navigator<"u"&&typeof(navigator==null?void 0:navigator.userAgent)=="string"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),Yt(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){function n(){for(Wr(!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 Yt(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,n){function r(_,A){return _.charCodeAt(A)<<24|_.charCodeAt(A+1)<<16|_.charCodeAt(A+2)<<8|_.charCodeAt(A+3)&255}function s(_,A,N,T){const E=_.substring(0,A),P=_.substring(A+N);return E+T+P}let i,o;const a=this._document.createElement("canvas");a.width=1,a.height=1;const c=a.getContext("2d");let u=0;function f(_,A){if(++u>30){jt("Load test font never loaded."),A();return}if(c.font="30px "+_,c.fillText(".",0,20),c.getImageData(0,0,1,1).data[3]>0){A();return}setTimeout(f.bind(null,_,A))}const l=`lt${Date.now()}${this.loadTestFontId++}`;let d=this._loadTestFont;d=s(d,976,l.length,l);const h=16,m=1482184792;let y=r(d,h);for(i=0,o=l.length-3;i<o;i+=4)y=y-m+r(l,i)|0;i<l.length&&(y=y-m+r(l+"XXX",i)|0),d=s(d,h,4,Z2e(y));const g=`url(data:font/opentype;base64,${btoa(d)});`,v=`@font-face {font-family:"${l}";src:${g}}`;this.insertRule(v);const x=this._document.createElement("div");x.style.visibility="hidden",x.style.width=x.style.height="10px",x.style.position="absolute",x.style.top=x.style.left="0px";for(const _ of[e.loadedName,l]){const A=this._document.createElement("span");A.textContent="Hi",A.style.fontFamily=_,x.append(A)}this._document.body.append(x),f(l,()=>{x.remove(),n.complete()})}}Zg=new WeakMap;class g$e{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=_ee(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){jt(`getPathGenerator - ignoring character: "${i}".`)}if(!Array.isArray(r)||r.length===0)return this.compiledGlyphs[n]=function(i,o){};const s=[];for(let i=0,o=r.length;i<o;)switch(r[i++]){case gc.BEZIER_CURVE_TO:{const[a,c,u,f,l,d]=r.slice(i,i+6);s.push(p=>p.bezierCurveTo(a,c,u,f,l,d)),i+=6}break;case gc.MOVE_TO:{const[a,c]=r.slice(i,i+2);s.push(u=>u.moveTo(a,c)),i+=2}break;case gc.LINE_TO:{const[a,c]=r.slice(i,i+2);s.push(u=>u.lineTo(a,c)),i+=2}break;case gc.QUADRATIC_CURVE_TO:{const[a,c,u,f]=r.slice(i,i+4);s.push(l=>l.quadraticCurveTo(a,c,u,f)),i+=4}break;case gc.RESTORE:s.push(a=>a.restore());break;case gc.SAVE:s.push(a=>a.save());break;case gc.SCALE:Wr(s.length===2,"Scale command is only valid at the third position.");break;case gc.TRANSFORM:{const[a,c,u,f,l,d]=r.slice(i,i+6);s.push(p=>p.transform(a,c,u,f,l,d)),i+=6}break;case gc.TRANSLATE:{const[a,c]=r.slice(i,i+2);s.push(u=>u.translate(a,c)),i+=2}break}return this.compiledGlyphs[n]=function(o,a){s[0](o),s[1](o),o.scale(a,-a);for(let c=2,u=s.length;c<u;c++)s[c](o)}}}if(Fs){var aI=Promise.withResolvers(),D0=null;(async()=>{const e=await L1(()=>Promise.resolve().then(()=>c0),[]),n=await L1(()=>Promise.resolve().then(()=>c0),void 0),r=await L1(()=>Promise.resolve().then(()=>c0),void 0),s=await L1(()=>Promise.resolve().then(()=>c0),void 0);let i,o;return new Map(Object.entries({fs:e,http:n,https:r,url:s,canvas:i,path2d:o}))})().then(e=>{D0=e,aI.resolve()},e=>{jt(`loadPackages: ${e}`),D0=new Map,aI.resolve()})}class Xl{static get promise(){return aI.promise}static get(e){return D0==null?void 0:D0.get(e)}}const nte=function(t){return Xl.get("fs").promises.readFile(t).then(n=>new Uint8Array(n))};class v$e extends LN{}class y$e extends sA{_createCanvas(e,n){return Xl.get("canvas").createCanvas(e,n)}}class b$e extends $N{_fetchData(e,n){return nte(e).then(r=>({cMapData:r,compressionType:n}))}}class x$e extends FN{_fetchData(e){return nte(e)}}const ri={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function lI(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 X_{constructor(){this.constructor===X_&&Rn("Cannot initialize BaseShadingPattern.")}getPattern(){Rn("Abstract method `getPattern` called.")}}class w$e extends X_{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===ri.STROKE||s===ri.FILL){const o=n.current.getClippedPathBoundingBox(s,er(e))||[0,0,0,0],a=Math.ceil(o[2]-o[0])||1,c=Math.ceil(o[3]-o[1])||1,u=n.cachedCanvases.getCanvas("pattern",a,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(-o[0],-o[1]),r=Je.transform(r,[1,0,0,1,o[0],o[1]]),f.transform(...n.baseTransform),this.matrix&&f.transform(...this.matrix),lI(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 lI(e,this._bbox),i=this._createGradient(e);return i}}function oD(t,e,n,r,s,i,o,a){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=o,o=d),c[r+1]>c[s+1]&&(d=r,r=s,s=d,d=o,o=a,a=d),c[n+1]>c[r+1]&&(d=n,n=r,r=d,d=i,i=o,o=d);const p=(c[n]+e.offsetX)*e.scaleX,h=(c[n+1]+e.offsetY)*e.scaleY,m=(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(h>=v)return;const x=u[i],_=u[i+1],A=u[i+2],N=u[o],T=u[o+1],E=u[o+2],P=u[a],k=u[a+1],M=u[a+2],I=Math.round(h),j=Math.round(v);let L,H,K,V,U,Q,ne,X;for(let G=I;G<=j;G++){if(G<y){const ce=G<h?0:(h-G)/(h-y);L=p-(p-m)*ce,H=x-(x-N)*ce,K=_-(_-T)*ce,V=A-(A-E)*ce}else{let ce;G>v?ce=1:y===v?ce=0:ce=(y-G)/(y-v),L=m-(m-g)*ce,H=N-(N-P)*ce,K=T-(T-k)*ce,V=E-(E-M)*ce}let Y;G<h?Y=0:G>v?Y=1:Y=(h-G)/(h-v),U=p-(p-g)*Y,Q=x-(x-P)*Y,ne=_-(_-k)*Y,X=A-(A-M)*Y;const Z=Math.round(Math.min(L,U)),he=Math.round(Math.max(L,U));let fe=l*G+Z*4;for(let ce=Z;ce<=he;ce++)Y=(L-ce)/(L-U),Y<0?Y=0:Y>1&&(Y=1),f[fe++]=H-(H-Q)*Y|0,f[fe++]=K-(K-ne)*Y|0,f[fe++]=V-(V-X)*Y|0,f[fe++]=255}}function _$e(t,e,n){const r=e.coords,s=e.colors;let i,o;switch(e.type){case"lattice":const a=e.verticesPerRow,c=Math.floor(r.length/a)-1,u=a-1;for(i=0;i<c;i++){let f=i*a;for(let l=0;l<u;l++,f++)oD(t,n,r[f],r[f+1],r[f+a],s[f],s[f+1],s[f+a]),oD(t,n,r[f+a+1],r[f+1],r[f+a],s[f+a+1],s[f+1],s[f+a])}break;case"triangles":for(i=0,o=r.length;i<o;i+=3)oD(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 S$e extends X_{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 a=Math.floor(this._bounds[0]),c=Math.floor(this._bounds[1]),u=Math.ceil(this._bounds[2])-a,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),p=u/l,h=f/d,m={coords:this._coords,colors:this._colors,offsetX:-a,offsetY:-c,scaleX:1/p,scaleY:1/h},y=l+2*2,g=d+2*2,v=r.getCanvas("mesh",y,g,!1),x=v.context,_=x.createImageData(l,d);if(n){const N=_.data;for(let T=0,E=N.length;T<E;T+=4)N[T]=n[0],N[T+1]=n[1],N[T+2]=n[2],N[T+3]=255}for(const N of this._figures)_$e(_,N,m);return x.putImageData(_,2,2),{canvas:v.canvas,offsetX:a-2*p,offsetY:c-2*h,scaleX:p,scaleY:h}}getPattern(e,n,r,s){lI(e,this._bbox);let i;if(s===ri.SHADING)i=Je.singularValueDecompose2dScale(er(e));else if(i=Je.singularValueDecompose2dScale(n.baseTransform),this.matrix){const a=Je.singularValueDecompose2dScale(this.matrix);i=[i[0]*a[0],i[1]*a[1]]}const o=this._createMeshCanvas(i,s===ri.SHADING?null:this._background,n.cachedCanvases);return s!==ri.SHADING&&(e.setTransform(...n.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(o.offsetX,o.offsetY),e.scale(o.scaleX,o.scaleY),e.createPattern(o.canvas,"no-repeat")}}class C$e extends X_{getPattern(){return"hotpink"}}function E$e(t){switch(t[0]){case"RadialAxial":return new w$e(t);case"Mesh":return new S$e(t);case"Dummy":return new C$e}throw new Error(`Unknown IR type: ${t[0]}`)}const nH={COLORED:1,UNCOLORED:2},AA=class AA{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,o=this.paintType,a=this.tilingType,c=this.color,u=this.canvasGraphicsFactory;ON("TilingType: "+a);const f=r[0],l=r[1],d=r[2],p=r[3],h=Je.singularValueDecompose2dScale(this.matrix),m=Je.singularValueDecompose2dScale(this.baseTransform),y=[h[0]*m[0],h[1]*m[1]],g=this.getSizeAndScale(s,this.ctx.canvas.width,y[0]),v=this.getSizeAndScale(i,this.ctx.canvas.height,y[1]),x=e.cachedCanvases.getCanvas("pattern",g.size,v.size,!0),_=x.context,A=u.createCanvasGraphics(_);A.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(A,o,c);let N=f,T=l,E=d,P=p;return f<0&&(N=0,E+=Math.abs(f)),l<0&&(T=0,P+=Math.abs(l)),_.translate(-(g.scale*N),-(v.scale*T)),A.transform(g.scale,0,0,v.scale,0,0),_.save(),this.clipBbox(A,N,T,E,P),A.baseTransform=er(A.ctx),A.executeOperatorList(n),A.endDrawing(),{canvas:x.canvas,scaleX:g.scale,scaleY:v.scale,offsetX:N,offsetY:T}}getSizeAndScale(e,n,r){e=Math.abs(e);const s=Math.max(AA.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 o=s-n,a=i-r;e.ctx.rect(n,r,o,a),e.current.updateRectMinMax(er(e.ctx),[n,r,s,i]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,n,r){const s=e.ctx,i=e.current;switch(n){case nH.COLORED:const o=this.ctx;s.fillStyle=o.fillStyle,s.strokeStyle=o.strokeStyle,i.fillColor=o.fillStyle,i.strokeColor=o.strokeStyle;break;case nH.UNCOLORED:const a=Je.makeHexColor(r[0],r[1],r[2]);s.fillStyle=a,s.strokeStyle=a,i.fillColor=a,i.strokeColor=a;break;default:throw new Q2e(`Unsupported paint type: ${n}`)}}getPattern(e,n,r,s){let i=r;s!==ri.SHADING&&(i=Je.transform(i,n.baseTransform),this.matrix&&(i=Je.transform(i,this.matrix)));const o=this.createPatternCanvas(n);let a=new DOMMatrix(i);a=a.translate(o.offsetX,o.offsetY),a=a.scale(1/o.scaleX,1/o.scaleY);const c=e.createPattern(o.canvas,"repeat");return c.setTransform(a),c}};Te(AA,"MAX_PATTERN_SIZE",3e3);let cI=AA;function A$e({src:t,srcPos:e=0,dest:n,width:r,height:s,nonBlackColor:i=4294967295,inverseDecode:o=!1}){const a=Ii.isLittleEndian?4278190080:255,[c,u]=o?[i,a]:[a,i],f=r>>3,l=r&7,d=t.length;n=new Uint32Array(n.buffer);let p=0;for(let h=0;h<s;h++){for(const y=e+f;e<y;e++){const g=e<d?t[e]:255;n[p++]=g&128?u:c,n[p++]=g&64?u:c,n[p++]=g&32?u:c,n[p++]=g&16?u:c,n[p++]=g&8?u:c,n[p++]=g&4?u:c,n[p++]=g&2?u:c,n[p++]=g&1?u:c}if(l===0)continue;const m=e<d?t[e++]:255;for(let y=0;y<l;y++)n[p++]=m&1<<7-y?u:c}return{srcPos:e,destPos:p}}const rH=16,sH=100,R$e=15,iH=10,oH=1e3,Ri=16;function N$e(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,o,a,c){e.transform(r,s,i,o,a,c),this.__originalTransform(r,s,i,o,a,c)},t.setTransform=function(r,s,i,o,a,c){e.setTransform(r,s,i,o,a,c),this.__originalSetTransform(r,s,i,o,a,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,o,a){e.bezierCurveTo(n,r,s,i,o,a),this.__originalBezierCurveTo(n,r,s,i,o,a)},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 P$e{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 $1(t,e,n,r,s,i,o,a,c,u){const[f,l,d,p,h,m]=er(t);if(l===0&&d===0){const v=o*f+h,x=Math.round(v),_=a*p+m,A=Math.round(_),N=(o+c)*f+h,T=Math.abs(Math.round(N)-x)||1,E=(a+u)*p+m,P=Math.abs(Math.round(E)-A)||1;return t.setTransform(Math.sign(f),0,0,Math.sign(p),x,A),t.drawImage(e,n,r,s,i,0,0,T,P),t.setTransform(f,l,d,p,h,m),[T,P]}if(f===0&&p===0){const v=a*d+h,x=Math.round(v),_=o*l+m,A=Math.round(_),N=(a+u)*d+h,T=Math.abs(Math.round(N)-x)||1,E=(o+c)*l+m,P=Math.abs(Math.round(E)-A)||1;return t.setTransform(0,Math.sign(l),Math.sign(d),0,x,A),t.drawImage(e,n,r,s,i,0,0,P,T),t.setTransform(f,l,d,p,h,m),[P,T]}t.drawImage(e,n,r,s,i,o,a,c,u);const y=Math.hypot(f,l),g=Math.hypot(d,p);return[y*c,g*u]}function T$e(t){const{width:e,height:n}=t;if(e>oH||n>oH)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 o=new Uint8Array(i*(n+1)),a,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 p=0;for(d=0,l[d]!==0&&(o[0]=1,++p),c=1;c<e;c++)l[d]!==l[d+1]&&(o[c]=l[d]?2:1,++p),d++;for(l[d]!==0&&(o[c]=2,++p),a=1;a<n;a++){d=a*f,u=a*i,l[d-f]!==l[d]&&(o[u]=l[d]?1:8,++p);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]&&(o[u+c]=s[g],++p),d++;if(l[d-f]!==l[d]&&(o[u+c]=l[d]?2:4,++p),p>r)return null}for(d=f*(n-1),u=a*i,l[d]!==0&&(o[u]=8,++p),c=1;c<e;c++)l[d]!==l[d+1]&&(o[u+c]=l[d]?4:8,++p),d++;if(l[d]!==0&&(o[u+c]=4,++p),p>r)return null;const h=new Int32Array([0,i,-1,0,-i,0,0,0,1]),m=new Path2D;for(a=0;p&&a<=n;a++){let g=a*i;const v=g+e;for(;g<v&&!o[g];)g++;if(g===v)continue;m.moveTo(g%i,a);const x=g;let _=o[g];do{const A=h[_];do g+=A;while(!o[g]);const N=o[g];N!==5&&N!==10?(_=N,o[g]=0):(_=N&51*_>>4,o[g]&=_>>2|_<<2),m.lineTo(g%i,g/i|0),o[g]||--p}while(x!==g);--a}return l=null,o=null,function(g){g.save(),g.scale(1/e,-1/n),g.translate(0,-n),g.fill(m),g.beginPath(),g.restore()}}class aH{constructor(e,n){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=xee,this.textMatrixScale=1,this.fontMatrix=IO,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=ks.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]=Je.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=Je.applyTransform(n,e),s=Je.applyTransform(n.slice(2),e),i=Je.applyTransform([n[0],n[3]],e),o=Je.applyTransform([n[2],n[1]],e);this.minX=Math.min(this.minX,r[0],s[0],i[0],o[0]),this.minY=Math.min(this.minY,r[1],s[1],i[1],o[1]),this.maxX=Math.max(this.maxX,r[0],s[0],i[0],o[0]),this.maxY=Math.max(this.maxY,r[1],s[1],i[1],o[1])}updateScalingPathMinMax(e,n){Je.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,o,a,c,u,f){const l=Je.bezierBoundingBox(n,r,s,i,o,a,c,u,f);f||this.updateRectMinMax(e,l)}getPathBoundingBox(e=ri.FILL,n=null){const r=[this.minX,this.minY,this.maxX,this.maxY];if(e===ri.STROKE){n||Rn("Stroke bounding box must include transform.");const s=Je.singularValueDecompose2dScale(n),i=s[0]*this.lineWidth/2,o=s[1]*this.lineWidth/2;r[0]-=i,r[1]-=o,r[2]+=i,r[3]+=o}return r}updateClipFromPath(){const e=Je.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=ri.FILL,n=null){return Je.intersect(this.clipBox,this.getPathBoundingBox(e,n))}}function lH(t,e){if(typeof ImageData<"u"&&e instanceof ImageData){t.putImageData(e,0,0);return}const n=e.height,r=e.width,s=n%Ri,i=(n-s)/Ri,o=s===0?i:i+1,a=t.createImageData(r,Ri);let c=0,u;const f=e.data,l=a.data;let d,p,h,m;if(e.kind===mC.GRAYSCALE_1BPP){const y=f.byteLength,g=new Uint32Array(l.buffer,0,l.byteLength>>2),v=g.length,x=r+7>>3,_=4294967295,A=Ii.isLittleEndian?4278190080:255;for(d=0;d<o;d++){for(h=d<i?Ri:s,u=0,p=0;p<h;p++){const N=y-c;let T=0;const E=N>x?r:N*8-7,P=E&-8;let k=0,M=0;for(;T<P;T+=8)M=f[c++],g[u++]=M&128?_:A,g[u++]=M&64?_:A,g[u++]=M&32?_:A,g[u++]=M&16?_:A,g[u++]=M&8?_:A,g[u++]=M&4?_:A,g[u++]=M&2?_:A,g[u++]=M&1?_:A;for(;T<E;T++)k===0&&(M=f[c++],k=128),g[u++]=M&k?_:A,k>>=1}for(;u<v;)g[u++]=0;t.putImageData(a,0,d*Ri)}}else if(e.kind===mC.RGBA_32BPP){for(p=0,m=r*Ri*4,d=0;d<i;d++)l.set(f.subarray(c,c+m)),c+=m,t.putImageData(a,0,p),p+=Ri;d<o&&(m=r*s*4,l.set(f.subarray(c,c+m)),t.putImageData(a,0,p))}else if(e.kind===mC.RGB_24BPP)for(h=Ri,m=r*h,d=0;d<o;d++){for(d>=i&&(h=s,m=r*h),u=0,p=m;p--;)l[u++]=f[c++],l[u++]=f[c++],l[u++]=f[c++],l[u++]=255;t.putImageData(a,0,d*Ri)}else throw new Error(`bad image kind: ${e.kind}`)}function cH(t,e){if(e.bitmap){t.drawImage(e.bitmap,0,0);return}const n=e.height,r=e.width,s=n%Ri,i=(n-s)/Ri,o=s===0?i:i+1,a=t.createImageData(r,Ri);let c=0;const u=e.data,f=a.data;for(let l=0;l<o;l++){const d=l<i?Ri:s;({srcPos:c}=A$e({src:u,srcPos:c,dest:f,width:r,height:d,nonBlackColor:0})),t.putImageData(a,0,l*Ri)}}function Db(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 F1(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),!Fs){const{filter:e}=t;e!=="none"&&e!==""&&(t.filter="none")}}function uH(t,e){if(e)return!0;const n=Je.singularValueDecompose2dScale(t);n[0]=Math.fround(n[0]),n[1]=Math.fround(n[1]);const r=Math.fround((globalThis.devicePixelRatio||1)*cf.PDF_TO_CSS_UNITS);return n[0]<=r&&n[1]<=r}const k$e=["butt","round","square"],D$e=["miter","round","bevel"],M$e={},dH={};var df,uI,dI;const bF=class bF{constructor(e,n,r,s,i,{optionalContentConfig:o,markedContentStack:a=null},c,u){B(this,df);this.ctx=e,this.current=new aH(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=a||[],this.optionalContentConfig=o,this.cachedCanvases=new P$e(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,o=this.ctx.canvas.height,a=this.ctx.fillStyle;if(this.ctx.fillStyle=s||"#ffffff",this.ctx.fillRect(0,0,i,o),this.ctx.fillStyle=a,r){const c=this.cachedCanvases.getCanvas("transparent",i,o);this.compositeCtx=this.ctx,this.transparentCanvas=c.canvas,this.ctx=c.context,this.ctx.save(),this.ctx.transform(...er(this.compositeCtx))}this.ctx.save(),F1(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=er(this.ctx)}executeOperatorList(e,n,r,s){const i=e.argsArray,o=e.fnArray;let a=n||0;const c=i.length;if(c===a)return a;const u=c-a>iH&&typeof r=="function",f=u?Date.now()+R$e:0;let l=0;const d=this.commonObjs,p=this.objs;let h;for(;;){if(s!==void 0&&a===s.nextBreakPoint)return s.breakIt(a,r),a;if(h=o[a],h!==_a.dependency)this[h].apply(this,i[a]);else for(const m of i[a]){const y=m.startsWith("g_")?d:p;if(!y.has(m))return y.get(m,r),a}if(a++,a===c)return a;if(u&&++l>iH){if(Date.now()>f)return r(),a;l=0}}}endDrawing(){z(this,df,uI).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(),z(this,df,dI).call(this)}_scaleImage(e,n){const r=e.width,s=e.height;let i=Math.max(Math.hypot(n[0],n[1]),1),o=Math.max(Math.hypot(n[2],n[3]),1),a=r,c=s,u="prescale1",f,l;for(;i>2&&a>1||o>2&&c>1;){let d=a,p=c;i>2&&a>1&&(d=a>=16384?Math.floor(a/2)-1||1:Math.ceil(a/2),i/=a/d),o>2&&c>1&&(p=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,o/=c/p),f=this.cachedCanvases.getCanvas(u,d,p),l=f.context,l.clearRect(0,0,d,p),l.drawImage(e,0,0,a,c,0,0,d,p),e=f.canvas,a=d,c=p,u=u==="prescale1"?"prescale2":"prescale1"}return{img:e,paintWidth:a,paintHeight:c}}_createMaskCanvas(e){const n=this.ctx,{width:r,height:s}=e,i=this.current.fillColor,o=this.current.patternFill,a=er(n);let c,u,f,l;if((e.bitmap||e.data)&&e.count>1){const E=e.bitmap||e.data.buffer;u=JSON.stringify(o?a:[a.slice(0,4),i]),c=this._cachedBitmapsMap.get(E),c||(c=new Map,this._cachedBitmapsMap.set(E,c));const P=c.get(u);if(P&&!o){const k=Math.round(Math.min(a[0],a[2])+a[4]),M=Math.round(Math.min(a[1],a[3])+a[5]);return{canvas:P,offsetX:k,offsetY:M}}f=P}f||(l=this.cachedCanvases.getCanvas("maskCanvas",r,s),cH(l.context,e));let d=Je.transform(a,[1/r,0,0,-1/s,0,0]);d=Je.transform(d,[1,0,0,1,0,-s]);const[p,h,m,y]=Je.getAxialAlignedBoundingBox([0,0,r,s],d),g=Math.round(m-p)||1,v=Math.round(y-h)||1,x=this.cachedCanvases.getCanvas("fillCanvas",g,v),_=x.context,A=p,N=h;_.translate(-A,-N),_.transform(...d),f||(f=this._scaleImage(l.canvas,vc(_)),f=f.img,c&&o&&c.set(u,f)),_.imageSmoothingEnabled=uH(er(_),e.interpolate),$1(_,f,0,0,f.width,f.height,0,0,r,s),_.globalCompositeOperation="source-in";const T=Je.transform(vc(_),[1,0,0,1,-A,-N]);return _.fillStyle=o?i.getPattern(n,this,T,ri.FILL):i,_.fillRect(0,0,r,s),c&&!o&&(this.cachedCanvases.delete("fillCanvas"),c.set(u,x.canvas)),{canvas:x.canvas,offsetX:Math.round(A),offsetY:Math.round(N)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=k$e[e]}setLineJoin(e){this.ctx.lineJoin=D$e[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(...er(this.suspendedCtx)),Db(this.suspendedCtx,i),N$e(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(),Db(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],o=s[1],a=s[2]-i,c=s[3]-o;a===0||c===0||(this.genericComposeSMask(n.context,r,a,c,n.subtype,n.backdrop,n.transferMap,i,o,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,o,a,c,u,f,l){let d=e.canvas,p=c-f,h=u-l;if(o){if(p<0||h<0||p+r>d.width||h+s>d.height){const y=this.cachedCanvases.getCanvas("maskExtension",r,s),g=y.context;g.drawImage(d,-p,-h),o.some(v=>v!==0)&&(g.globalCompositeOperation="destination-atop",g.fillStyle=Je.makeHexColor(...o),g.fillRect(0,0,r,s),g.globalCompositeOperation="source-over"),d=y.canvas,p=h=0}else if(o.some(y=>y!==0)){e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);const y=new Path2D;y.rect(p,h,r,s),e.clip(y),e.globalCompositeOperation="destination-atop",e.fillStyle=Je.makeHexColor(...o),e.fillRect(p,h,r,s),e.restore()}}n.save(),n.globalAlpha=1,n.setTransform(1,0,0,1,0,0),i==="Alpha"&&a?n.filter=this.filterFactory.addAlphaFilter(a):i==="Luminosity"&&(n.filter=this.filterFactory.addLuminosityFilter(a));const m=new Path2D;m.rect(c,u,r,s),n.clip(m),n.globalCompositeOperation="destination-in",n.drawImage(d,p,h,r,s,c,u,r,s),n.restore()}save(){this.inSMaskMode?(Db(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(),Db(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,o){this.ctx.transform(e,n,r,s,i,o),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,n,r){const s=this.ctx,i=this.current;let o=i.x,a=i.y,c,u;const f=er(s),l=f[0]===0&&f[3]===0||f[1]===0&&f[2]===0,d=l?r.slice(0):null;for(let p=0,h=0,m=e.length;p<m;p++)switch(e[p]|0){case _a.rectangle:o=n[h++],a=n[h++];const y=n[h++],g=n[h++],v=o+y,x=a+g;s.moveTo(o,a),y===0||g===0?s.lineTo(v,x):(s.lineTo(v,a),s.lineTo(v,x),s.lineTo(o,x)),l||i.updateRectMinMax(f,[o,a,v,x]),s.closePath();break;case _a.moveTo:o=n[h++],a=n[h++],s.moveTo(o,a),l||i.updatePathMinMax(f,o,a);break;case _a.lineTo:o=n[h++],a=n[h++],s.lineTo(o,a),l||i.updatePathMinMax(f,o,a);break;case _a.curveTo:c=o,u=a,o=n[h+4],a=n[h+5],s.bezierCurveTo(n[h],n[h+1],n[h+2],n[h+3],o,a),i.updateCurvePathMinMax(f,c,u,n[h],n[h+1],n[h+2],n[h+3],o,a,d),h+=6;break;case _a.curveTo2:c=o,u=a,s.bezierCurveTo(o,a,n[h],n[h+1],n[h+2],n[h+3]),i.updateCurvePathMinMax(f,c,u,o,a,n[h],n[h+1],n[h+2],n[h+3],d),o=n[h+2],a=n[h+3],h+=4;break;case _a.curveTo3:c=o,u=a,o=n[h+2],a=n[h+3],s.bezierCurveTo(n[h],n[h+1],o,a,o,a),i.updateCurvePathMinMax(f,c,u,n[h],n[h+1],o,a,o,a,d),h+=4;break;case _a.closePath:s.closePath();break}l&&i.updateScalingPathMinMax(f,d),i.setCurrentPoint(o,a)}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,vc(n),ri.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,vc(n),ri.FILL),i=!0);const o=this.current.getClippedPathBoundingBox();this.contentVisible&&o!==null&&(this.pendingEOFill?(n.fill("evenodd"),this.pendingEOFill=!1):n.fill()),i&&n.restore(),e&&this.consumePath(o)}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=M$e}eoClip(){this.pendingClip=dH}beginText(){this.current.textMatrix=xee,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||IO,(s.fontMatrix[0]===0||s.fontMatrix[3]===0)&&jt("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",o=((f=r.systemFontInfo)==null?void 0:f.css)||`"${i}", ${r.fallbackName}`;let a="normal";r.black?a="900":r.bold&&(a="bold");const c=r.italic?"italic":"normal";let u=n;n<rH?u=rH:n>sH&&(u=sH),this.current.fontSizeScale=n/u,this.ctx.font=`${c} ${a} ${u}px ${o}`}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,o){this.current.textMatrix=[e,n,r,s,i,o],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,o=this.current,a=o.font,c=o.textRenderingMode,u=o.fontSize/o.fontSizeScale,f=c&ks.FILL_STROKE_MASK,l=!!(c&ks.ADD_TO_PATH_FLAG),d=o.patternFill&&!a.missingFile;let p;(a.disableFontFace||l||d)&&(p=a.getPathGenerator(this.commonObjs,e)),a.disableFontFace||d?(i.save(),i.translate(n,r),i.beginPath(),p(i,u),s&&i.setTransform(...s),(f===ks.FILL||f===ks.FILL_STROKE)&&i.fill(),(f===ks.STROKE||f===ks.FILL_STROKE)&&i.stroke(),i.restore()):((f===ks.FILL||f===ks.FILL_STROKE)&&i.fillText(e,n,r),(f===ks.STROKE||f===ks.FILL_STROKE)&&i.strokeText(e,n,r)),l&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:er(i),x:n,y:r,fontSize:u,addToPath:p})}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 Yt(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,o=n.fontSizeScale,a=n.charSpacing,c=n.wordSpacing,u=n.fontDirection,f=n.textHScale*u,l=e.length,d=r.vertical,p=d?1:-1,h=r.defaultVMetrics,m=s*n.fontMatrix[0],y=n.textRenderingMode===ks.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 N=n.fillColor.getPattern(i,this,vc(i),ri.FILL);g=er(i),i.restore(),i.fillStyle=N}let v=n.lineWidth;const x=n.textMatrixScale;if(x===0||v===0){const N=n.textRenderingMode&ks.FILL_STROKE_MASK;(N===ks.STROKE||N===ks.FILL_STROKE)&&(v=this.getSinglePixelWidth())}else v/=x;if(o!==1&&(i.scale(o,o),v/=o),i.lineWidth=v,r.isInvalidPDFjsFont){const N=[];let T=0;for(const E of e)N.push(E.unicode),T+=E.width;i.fillText(N.join(""),0,0),n.x+=T*m*f,i.restore(),this.compose();return}let _=0,A;for(A=0;A<l;++A){const N=e[A];if(typeof N=="number"){_+=p*N*s/1e3;continue}let T=!1;const E=(N.isSpace?c:0)+a,P=N.fontChar,k=N.accent;let M,I,j=N.width;if(d){const H=N.vmetric||h,K=-(N.vmetric?H[1]:j*.5)*m,V=H[2]*m;j=H?-H[0]:j,M=K/o,I=(_+V)/o}else M=_/o,I=0;if(r.remeasure&&j>0){const H=i.measureText(P).width*1e3/s*o;if(j<H&&this.isFontSubpixelAAEnabled){const K=j/H;T=!0,i.save(),i.scale(K,1),M/=K}else j!==H&&(M+=(j-H)/2e3*s/o)}if(this.contentVisible&&(N.isInFont||r.missingFile)){if(y&&!k)i.fillText(P,M,I);else if(this.paintChar(P,M,I,g),k){const H=M+s*k.offset.x/o,K=I-s*k.offset.y/o;this.paintChar(k.fontChar,H,K,g)}}const L=d?j*m-E*u:j*m+E*u;_+=L,T&&i.restore()}d?n.y-=_:n.x+=_*f,i.restore(),this.compose()}showType3Text(e){const n=this.ctx,r=this.current,s=r.font,i=r.fontSize,o=r.fontDirection,a=s.vertical?1:-1,c=r.charSpacing,u=r.wordSpacing,f=r.textHScale*o,l=r.fontMatrix||IO,d=e.length,p=r.textRenderingMode===ks.INVISIBLE;let h,m,y,g;if(!(p||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,o),h=0;h<d;++h){if(m=e[h],typeof m=="number"){g=a*m*i/1e3,this.ctx.translate(g,0),r.x+=g*f;continue}const v=(m.isSpace?u:0)+c,x=s.charProcOperatorList[m.operatorListId];if(!x){jt(`Type3 character "${m.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=m,this.save(),n.scale(i,i),n.transform(...l),this.executeOperatorList(x),this.restore()),y=Je.applyTransform([m.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,o){this.ctx.rect(r,s,i-r,o-s),this.ctx.clip(),this.endPath()}getColorN_Pattern(e){let n;if(e[0]==="TilingPattern"){const r=e[1],s=this.baseTransform||er(this.ctx),i={createCanvasGraphics:o=>new bF(o,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};n=new cI(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=Je.makeHexColor(e,n,r);this.ctx.strokeStyle=s,this.current.strokeColor=s}setFillRGBColor(e,n,r){const s=Je.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=E$e(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,vc(n),ri.SHADING);const s=vc(n);if(s){const{width:i,height:o}=n.canvas,[a,c,u,f]=Je.getAxialAlignedBoundingBox([0,0,i,o],s);this.ctx.fillRect(a,c,u-a,f-c)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){Rn("Should not call beginInlineImage")}beginImageData(){Rn("Should not call beginImageData")}paintFormXObjectBegin(e,n){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),e&&this.transform(...e),this.baseTransform=er(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(er(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||ON("TODO: Support non-isolated groups."),e.knockout&&jt("Knockout groups not supported.");const r=er(n);if(e.matrix&&n.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let s=Je.getAxialAlignedBoundingBox(e.bbox,er(n));const i=[0,0,n.canvas.width,n.canvas.height];s=Je.intersect(s,i)||[0,0,0,0];const o=Math.floor(s[0]),a=Math.floor(s[1]),c=Math.max(Math.ceil(s[2])-o,1),u=Math.max(Math.ceil(s[3])-a,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(-o,-a),d.transform(...r),e.smask?this.smaskStack.push({canvas:l.canvas,context:d,offsetX:o,offsetY:a,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(o,a),n.save()),Db(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=er(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...s);const i=Je.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(z(this,df,uI).call(this),F1(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),n){const o=n[2]-n[0],a=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]=o,n[3]=a;const[c,u]=Je.singularValueDecompose2dScale(er(this.ctx)),{viewportScale:f}=this,l=Math.ceil(o*this.outputScaleX*f),d=Math.ceil(a*this.outputScaleY*f);this.annotationCanvas=this.canvasFactory.create(l,d);const{canvas:p,context:h}=this.annotationCanvas;this.annotationCanvasMap.set(e,p),this.annotationCanvas.savedCtx=this.ctx,this.ctx=h,this.ctx.save(),this.ctx.setTransform(c,0,0,-u,0,a*u),F1(this.ctx)}else F1(this.ctx),this.ctx.rect(n[0],n[1],o,a),this.ctx.clip(),this.endPath()}this.current=new aH(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...r),this.transform(...s)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),z(this,df,dI).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=T$e(e)),s.compiled)){s.compiled(r);return}const i=this._createMaskCanvas(e),o=i.canvas;r.save(),r.setTransform(1,0,0,1,0,0),r.drawImage(o,i.offsetX,i.offsetY),r.restore(),this.compose()}paintImageMaskXObjectRepeat(e,n,r=0,s=0,i,o){if(!this.contentVisible)return;e=this.getObject(e.data,e);const a=this.ctx;a.save();const c=er(a);a.transform(n,r,s,i,0,0);const u=this._createMaskCanvas(e);a.setTransform(1,0,0,1,u.offsetX-c[4],u.offsetY-c[5]);for(let f=0,l=o.length;f<l;f+=2){const d=Je.transform(c,[n,r,s,i,o[f],o[f+1]]),[p,h]=Je.applyTransform([0,0],d);a.drawImage(u.canvas,p,h)}a.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:o,width:a,height:c,transform:u}=i,f=this.cachedCanvases.getCanvas("maskCanvas",a,c),l=f.context;l.save();const d=this.getObject(o,i);cH(l,d),l.globalCompositeOperation="source-in",l.fillStyle=s?r.getPattern(l,this,vc(n),ri.FILL):r,l.fillRect(0,0,a,c),l.restore(),n.save(),n.transform(...u),n.scale(1,-1),$1(n,f.canvas,0,0,a,c,0,-1,1,1),n.restore()}this.compose()}paintImageXObject(e){if(!this.contentVisible)return;const n=this.getObject(e);if(!n){jt("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){jt("Dependent image isn't ready yet");return}const o=i.width,a=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:o,h:a});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),o=i.context;return o.filter=this.current.transferMaps,o.drawImage(n,0,0),o.filter="none",i.canvas}paintInlineImageXObject(e){if(!this.contentVisible)return;const n=e.width,r=e.height,s=this.ctx;if(this.save(),!Fs){const{filter:a}=s;a!=="none"&&a!==""&&(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;lH(c,e),i=this.applyTransferMapsToCanvas(c)}const o=this._scaleImage(i,vc(s));s.imageSmoothingEnabled=uH(er(s),e.interpolate),$1(s,o.img,0,0,o.paintWidth,o.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,o=e.height,c=this.cachedCanvases.getCanvas("inlineImage",i,o).context;lH(c,e),s=this.applyTransferMapsToCanvas(c)}for(const i of n)r.save(),r.transform(...i.transform),r.scale(1,-1),$1(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===dH?r.clip("evenodd"):r.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),r.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const e=er(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 o,a;if(r===0&&s===0){const c=Math.abs(n),u=Math.abs(i);if(c===u)if(e===0)o=a=1/c;else{const f=c*e;o=a=f<1?1/f:1}else if(e===0)o=1/c,a=1/u;else{const f=c*e,l=u*e;o=f<1?1/f:1,a=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)o=f/c,a=u/c;else{const l=e*c;o=f>l?f/l:1,a=u>l?u/l:1}}this._cachedScaleForStroking[0]=o,this._cachedScaleForStroking[1]=a}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 o=n.getLineDash();if(e&&n.save(),n.scale(s,i),o.length>0){const a=Math.max(s,i);n.setLineDash(o.map(c=>c/a)),n.lineDashOffset/=a}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}};df=new WeakSet,uI=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)},dI=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 Sg=bF;for(const t in _a)Sg.prototype[t]!==void 0&&(Sg.prototype[_a[t]]=Sg.prototype[t]);var nw,rw;class lu{static get workerPort(){return R(this,nw)}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&e!==null)throw new Error("Invalid `workerPort` type.");$(this,nw,e)}static get workerSrc(){return R(this,rw)}static set workerSrc(e){if(typeof e!="string")throw new Error("Invalid `workerSrc` type.");$(this,rw,e)}}nw=new WeakMap,rw=new WeakMap,B(lu,nw,null),B(lu,rw,"");const z1={UNKNOWN:0,DATA:1,ERROR:2},Er={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function eo(t){switch(t instanceof Error||typeof t=="object"&&t!==null||Rn('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new em(t.message);case"MissingPDFException":return new Jp(t.message);case"PasswordException":return new LO(t.message,t.code);case"UnexpectedResponseException":return new IN(t.message,t.status);case"UnknownErrorException":return new $O(t.message,t.details);default:return new $O(t.message,t.toString())}}var Ul,rte,ste,wC;class e0{constructor(e,n,r){B(this,Ul);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){z(this,Ul,ste).call(this,i);return}if(i.callback){const a=i.callbackId,c=this.callbackCapabilities[a];if(!c)throw new Error(`Cannot resolve callback ${a}`);if(delete this.callbackCapabilities[a],i.callback===z1.DATA)c.resolve(i.data);else if(i.callback===z1.ERROR)c.reject(eo(i.reason));else throw new Error("Unexpected callback case");return}const o=this.actionHandler[i.action];if(!o)throw new Error(`Unknown action from worker: ${i.action}`);if(i.callbackId){const a=this.sourceName,c=i.sourceName;new Promise(function(u){u(o(i.data))}).then(function(u){r.postMessage({sourceName:a,targetName:c,callback:z1.DATA,callbackId:i.callbackId,data:u})},function(u){r.postMessage({sourceName:a,targetName:c,callback:z1.ERROR,callbackId:i.callbackId,reason:eo(u)})});return}if(i.streamId){z(this,Ul,rte).call(this,i);return}o(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(o){i.reject(o)}return i.promise}sendWithStream(e,n,r,s){const i=this.streamId++,o=this.sourceName,a=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:o,targetName:a,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:o,targetName:a,stream:Er.PULL,streamId:i,desiredSize:u.desiredSize}),f.promise},cancel:u=>{Wr(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:o,targetName:a,stream:Er.CANCEL,streamId:i,reason:eo(u)}),f.promise}},r)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}Ul=new WeakSet,rte=function(e){const n=e.streamId,r=this.sourceName,s=e.sourceName,i=this.comObj,o=this,a=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:Er.ENQUEUE,streamId:n,chunk:u},l)},close(){this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:r,targetName:s,stream:Er.CLOSE,streamId:n}),delete o.streamSinks[n])},error(u){Wr(u instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,i.postMessage({sourceName:r,targetName:s,stream:Er.ERROR,streamId:n,reason:eo(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(a(e.data,c))}).then(function(){i.postMessage({sourceName:r,targetName:s,stream:Er.START_COMPLETE,streamId:n,success:!0})},function(u){i.postMessage({sourceName:r,targetName:s,stream:Er.START_COMPLETE,streamId:n,reason:eo(u)})})},ste=function(e){const n=e.streamId,r=this.sourceName,s=e.sourceName,i=this.comObj,o=this.streamControllers[n],a=this.streamSinks[n];switch(e.stream){case Er.START_COMPLETE:e.success?o.startCall.resolve():o.startCall.reject(eo(e.reason));break;case Er.PULL_COMPLETE:e.success?o.pullCall.resolve():o.pullCall.reject(eo(e.reason));break;case Er.PULL:if(!a){i.postMessage({sourceName:r,targetName:s,stream:Er.PULL_COMPLETE,streamId:n,success:!0});break}a.desiredSize<=0&&e.desiredSize>0&&a.sinkCapability.resolve(),a.desiredSize=e.desiredSize,new Promise(function(c){var u;c((u=a.onPull)==null?void 0:u.call(a))}).then(function(){i.postMessage({sourceName:r,targetName:s,stream:Er.PULL_COMPLETE,streamId:n,success:!0})},function(c){i.postMessage({sourceName:r,targetName:s,stream:Er.PULL_COMPLETE,streamId:n,reason:eo(c)})});break;case Er.ENQUEUE:if(Wr(o,"enqueue should have stream controller"),o.isClosed)break;o.controller.enqueue(e.chunk);break;case Er.CLOSE:if(Wr(o,"close should have stream controller"),o.isClosed)break;o.isClosed=!0,o.controller.close(),z(this,Ul,wC).call(this,o,n);break;case Er.ERROR:Wr(o,"error should have stream controller"),o.controller.error(eo(e.reason)),z(this,Ul,wC).call(this,o,n);break;case Er.CANCEL_COMPLETE:e.success?o.cancelCall.resolve():o.cancelCall.reject(eo(e.reason)),z(this,Ul,wC).call(this,o,n);break;case Er.CANCEL:if(!a)break;new Promise(function(c){var u;c((u=a.onCancel)==null?void 0:u.call(a,eo(e.reason)))}).then(function(){i.postMessage({sourceName:r,targetName:s,stream:Er.CANCEL_COMPLETE,streamId:n,success:!0})},function(c){i.postMessage({sourceName:r,targetName:s,stream:Er.CANCEL_COMPLETE,streamId:n,reason:eo(c)})}),a.sinkCapability.reject(eo(e.reason)),a.isCancelled=!0,delete this.streamSinks[n];break;default:throw new Error("Unexpected stream case")}},wC=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,sw;class O$e{constructor({parsedData:e,rawData:n}){B(this,Th);B(this,sw);$(this,Th,e),$(this,sw,n)}getRaw(){return R(this,sw)}get(e){return R(this,Th).get(e)??null}getAll(){return Y$(R(this,Th))}has(e){return R(this,Th).has(e)}}Th=new WeakMap,sw=new WeakMap;const Qu=Symbol("INTERNAL");var iw,ow,aw,Jg;class I$e{constructor(e,{name:n,intent:r,usage:s}){B(this,iw,!1);B(this,ow,!1);B(this,aw,!1);B(this,Jg,!0);$(this,iw,!!(e&Go.DISPLAY)),$(this,ow,!!(e&Go.PRINT)),this.name=n,this.intent=r,this.usage=s}get visible(){if(R(this,aw))return R(this,Jg);if(!R(this,Jg))return!1;const{print:e,view:n}=this.usage;return R(this,iw)?(n==null?void 0:n.viewState)!=="OFF":R(this,ow)?(e==null?void 0:e.printState)!=="OFF":!0}_setVisible(e,n,r=!1){e!==Qu&&Rn("Internal method `_setVisible` called."),$(this,aw,r),$(this,Jg,n)}}iw=new WeakMap,ow=new WeakMap,aw=new WeakMap,Jg=new WeakMap;var _d,Cn,ev,tv,lw,fI;class j$e{constructor(e,n=Go.DISPLAY){B(this,lw);B(this,_d,null);B(this,Cn,new Map);B(this,ev,null);B(this,tv,null);if(this.renderingIntent=n,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,$(this,tv,e.order);for(const r of e.groups)R(this,Cn).set(r.id,new I$e(n,r));if(e.baseState==="OFF")for(const r of R(this,Cn).values())r._setVisible(Qu,!1);for(const r of e.on)R(this,Cn).get(r)._setVisible(Qu,!0);for(const r of e.off)R(this,Cn).get(r)._setVisible(Qu,!1);$(this,ev,this.getHash())}}isVisible(e){if(R(this,Cn).size===0)return!0;if(!e)return ON("Optional content group not defined."),!0;if(e.type==="OCG")return R(this,Cn).has(e.id)?R(this,Cn).get(e.id).visible:(jt(`Optional content group not found: ${e.id}`),!0);if(e.type==="OCMD"){if(e.expression)return z(this,lw,fI).call(this,e.expression);if(!e.policy||e.policy==="AnyOn"){for(const n of e.ids){if(!R(this,Cn).has(n))return jt(`Optional content group not found: ${n}`),!0;if(R(this,Cn).get(n).visible)return!0}return!1}else if(e.policy==="AllOn"){for(const n of e.ids){if(!R(this,Cn).has(n))return jt(`Optional content group not found: ${n}`),!0;if(!R(this,Cn).get(n).visible)return!1}return!0}else if(e.policy==="AnyOff"){for(const n of e.ids){if(!R(this,Cn).has(n))return jt(`Optional content group not found: ${n}`),!0;if(!R(this,Cn).get(n).visible)return!0}return!1}else if(e.policy==="AllOff"){for(const n of e.ids){if(!R(this,Cn).has(n))return jt(`Optional content group not found: ${n}`),!0;if(R(this,Cn).get(n).visible)return!1}return!0}return jt(`Unknown optional content policy ${e.policy}.`),!0}return jt(`Unknown group type ${e.type}.`),!0}setVisibility(e,n=!0){const r=R(this,Cn).get(e);if(!r){jt(`Optional content group not found: ${e}`);return}r._setVisible(Qu,!!n,!0),$(this,_d,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=R(this,Cn).get(s);if(i)switch(r){case"ON":i._setVisible(Qu,!0);break;case"OFF":i._setVisible(Qu,!1);break;case"Toggle":i._setVisible(Qu,!i.visible);break}}$(this,_d,null)}get hasInitialVisibility(){return R(this,ev)===null||this.getHash()===R(this,ev)}getOrder(){return R(this,Cn).size?R(this,tv)?R(this,tv).slice():[...R(this,Cn).keys()]:null}getGroups(){return R(this,Cn).size>0?Y$(R(this,Cn)):null}getGroup(e){return R(this,Cn).get(e)||null}getHash(){if(R(this,_d)!==null)return R(this,_d);const e=new Jee;for(const[n,r]of R(this,Cn))e.update(`${n}:${r.visible}`);return $(this,_d,e.hexdigest())}}_d=new WeakMap,Cn=new WeakMap,ev=new WeakMap,tv=new WeakMap,lw=new WeakSet,fI=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 o;if(Array.isArray(i))o=z(this,lw,fI).call(this,i);else if(R(this,Cn).has(i))o=R(this,Cn).get(i).visible;else return jt(`Optional content group not found: ${i}`),!0;switch(r){case"And":if(!o)return!1;break;case"Or":if(o)return!0;break;case"Not":return!o;default:return!0}}return r==="And"};class L$e{constructor(e,{disableRange:n=!1,disableStream:r=!1}){Wr(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:s,initialData:i,progressiveDone:o,contentDispositionFilename:a}=e;if(this._queuedChunks=[],this._progressiveDone=o,this._contentDispositionFilename=a,(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)});Wr(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(){Wr(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new $$e(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,n){if(n<=this._progressiveDataLength)return null;const r=new F$e(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 $$e{constructor(e,n,r=!1,s=null){this._stream=e,this._done=r||!1,this._filename=eF(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 F$e{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 z$e(t){let e=!0,n=r("filename\\*","i").exec(t);if(n){n=n[1];let f=a(n);return f=unescape(f),f=c(f),f=u(f),i(f)}if(n=o(t),n){const f=u(n);return i(f)}if(n=r("filename","i").exec(t),n){n=n[1];let f=a(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}),p=jN(l);l=d.decode(p),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 o(f){const l=[];let d;const p=r("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(d=p.exec(f))!==null;){let[,m,y,g]=d;if(m=parseInt(m,10),m in l){if(m===0)break;continue}l[m]=[y,g]}const h=[];for(let m=0;m<l.length&&m in l;++m){let[y,g]=l[m];g=a(g),y&&(g=unescape(g),m===0&&(g=c(g))),h.push(g)}return h.join("")}function a(f){if(f.startsWith('"')){const l=f.slice(1).split('\\"');for(let d=0;d<l.length;++d){const p=l[d].indexOf('"');p!==-1&&(l[d]=l[d].slice(0,p),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),h=f.slice(l+1).replace(/^[^']*'/,"");return s(d,h)}function u(f){return!f.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(f)?f:f.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(l,d,p,h){if(p==="q"||p==="Q")return h=h.replaceAll("_"," "),h=h.replaceAll(/=([0-9a-fA-F]{2})/g,function(m,y){return String.fromCharCode(parseInt(y,16))}),s(d,h);try{h=atob(h)}catch{}return s(d,h)})}return""}function rF({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 sF(t){const e=t("Content-Disposition");if(e){let n=z$e(e);if(n.includes("%"))try{n=decodeURIComponent(n)}catch{}if(eF(n))return n}return null}function BN(t,e){return t===404||t===0&&e.startsWith("file:")?new Jp('Missing PDF "'+e+'".'):new IN(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)}function ite(t){return t===200||t===206}function ote(t,e,n){return{method:"GET",headers:t,signal:n.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function ate(t){const e=new Headers;for(const n in t){const r=t[n];r!==void 0&&e.append(n,r)}return e}function lte(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(jt(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}class fH{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 Wr(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new B$e(this),this._fullRequestReader}getRangeReader(e,n){if(n<=this._progressiveDataLength)return null;const r=new U$e(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 B$e{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=ate(this._stream.httpHeaders);const r=n.url;fetch(r,ote(this._headers,this._withCredentials,this._abortController)).then(s=>{if(!ite(s.status))throw BN(s.status,r);this._reader=s.body.getReader(),this._headersCapability.resolve();const i=c=>s.headers.get(c),{allowRangeRequests:o,suggestedLength:a}=rF({getResponseHeader:i,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=o,this._contentLength=a||this._contentLength,this._filename=sF(i),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new em("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:lte(e),done:!1})}cancel(e){var n;(n=this._reader)==null||n.cancel(e),this._abortController.abort()}}class U$e{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=ate(this._stream.httpHeaders),this._headers.append("Range",`bytes=${n}-${r-1}`);const i=s.url;fetch(i,ote(this._headers,this._withCredentials,this._abortController)).then(o=>{if(!ite(o.status))throw BN(o.status,i);this._readCapability.resolve(),this._reader=o.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:lte(e),done:!1})}cancel(e){var n;(n=this._reader)==null||n.cancel(e),this._abortController.abort()}}const aD=200,lD=206;function H$e(t){const e=t.response;return typeof e!="string"?e:jN(e).buffer}class V$e{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 o=this.httpHeaders[i];o!==void 0&&n.setRequestHeader(i,o)}return this.isHttp&&"begin"in e&&"end"in e?(n.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),s.expectedStatus=lD):s.expectedStatus=aD,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||aD;if(!(i===aD&&r.expectedStatus===lD)&&i!==r.expectedStatus){(u=r.onError)==null||u.call(r,s.status);return}const a=H$e(s);if(i===lD){const l=s.getResponseHeader("Content-Range"),d=/bytes (\d+)-(\d+)\/(\d+)/.exec(l);r.onDone({begin:parseInt(d[1],10),chunk:a})}else a?r.onDone({begin:0,chunk:a}):(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 q$e{constructor(e){this._source=e,this._manager=new V$e(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 Wr(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new W$e(this._manager,this._source),this._fullRequestReader}getRangeReader(e,n){const r=new G$e(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 W$e{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=o=>n.getResponseHeader(o),{allowRangeRequests:s,suggestedLength:i}=rF({getResponseHeader:r,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});s&&(this._isRangeSupported=!0),this._contentLength=i||this._contentLength,this._filename=sF(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=BN(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 G$e{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=BN(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 cte=/^file:\/\/\/[a-zA-Z]:\//;function K$e(t){const e=Xl.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 Y$e{constructor(e){this.source=e,this.url=K$e(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 Wr(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new Z$e(this):new X$e(this),this._fullRequestReader}getRangeReader(e,n){if(n<=this._progressiveDataLength)return null;const r=this.isFsUrl?new J$e(this,e,n):new Q$e(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 ute{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 em("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class dte{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 aA(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class X$e extends ute{constructor(e){super(e);const n=r=>{if(r.statusCode===404){const a=new Jp(`Missing PDF "${this._url}".`);this._storedError=a,this._headersCapability.reject(a);return}this._headersCapability.resolve(),this._setReadableStream(r);const s=a=>this._readableStream.headers[a.toLowerCase()],{allowRangeRequests:i,suggestedLength:o}=rF({getResponseHeader:s,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=i,this._contentLength=o||this._contentLength,this._filename=sF(s)};if(this._request=null,this._url.protocol==="http:"){const r=Xl.get("http");this._request=r.request(aA(this._url,e.httpHeaders),n)}else{const r=Xl.get("https");this._request=r.request(aA(this._url,e.httpHeaders),n)}this._request.on("error",r=>{this._storedError=r,this._headersCapability.reject(r)}),this._request.end()}}class Q$e extends dte{constructor(e,n,r){super(e),this._httpHeaders={};for(const i in e.httpHeaders){const o=e.httpHeaders[i];o!==void 0&&(this._httpHeaders[i]=o)}this._httpHeaders.Range=`bytes=${n}-${r-1}`;const s=i=>{if(i.statusCode===404){const o=new Jp(`Missing PDF "${this._url}".`);this._storedError=o;return}this._setReadableStream(i)};if(this._request=null,this._url.protocol==="http:"){const i=Xl.get("http");this._request=i.request(aA(this._url,this._httpHeaders),s)}else{const i=Xl.get("https");this._request=i.request(aA(this._url,this._httpHeaders),s)}this._request.on("error",i=>{this._storedError=i}),this._request.end()}}class Z$e extends ute{constructor(e){super(e);let n=decodeURIComponent(this._url.path);cte.test(this._url.href)&&(n=n.replace(/^\//,""));const r=Xl.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 Jp(`Missing PDF "${n}".`)),this._storedError=s,this._headersCapability.reject(s)})}}class J$e extends dte{constructor(e,n,r){super(e);let s=decodeURIComponent(this._url.path);cte.test(this._url.href)&&(s=s.replace(/^\//,""));const i=Xl.get("fs");this._setReadableStream(i.createReadStream(s,{start:n,end:r-1}))}}const eFe=1e5,xi=30,tFe=.8;var m6,Sd,Ai,cw,uw,kh,Lc,dw,fw,Dh,nv,rv,Cd,sv,hw,iv,Mh,pw,mw,Ur,Oh,Ih,Ed,ov,xu,fte,hte,hI,Hl,_C,pte,mte;let lA=(Ur=class{constructor({textContentSource:e,container:n,viewport:r}){B(this,xu);B(this,Sd,Promise.withResolvers());B(this,Ai,null);B(this,cw,!1);B(this,uw,!!((m6=globalThis.FontInspector)!=null&&m6.enabled));B(this,kh,null);B(this,Lc,null);B(this,dw,0);B(this,fw,0);B(this,Dh,null);B(this,nv,null);B(this,rv,0);B(this,Cd,0);B(this,sv,Object.create(null));B(this,hw,[]);B(this,iv,null);B(this,Mh,[]);B(this,pw,new WeakMap);B(this,mw,null);var c;if(e instanceof ReadableStream)$(this,iv,e);else if(typeof e=="object")$(this,iv,new ReadableStream({start(u){u.enqueue(e),u.close()}}));else throw new Error('No "textContentSource" parameter specified.');$(this,Ai,$(this,nv,n)),$(this,Cd,r.scale*(globalThis.devicePixelRatio||1)),$(this,rv,r.rotation),$(this,Lc,{prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:null});const{pageWidth:s,pageHeight:i,pageX:o,pageY:a}=r.rawDims;$(this,mw,[1,0,0,-1,-o,a+i]),$(this,fw,s),$(this,dw,i),z(c=Ur,Hl,pte).call(c),Tp(n,r),R(this,Sd).promise.catch(()=>{}).then(()=>{R(Ur,ov).delete(this),$(this,Lc,null),$(this,sv,null)})}render(){const e=()=>{R(this,Dh).read().then(({value:n,done:r})=>{if(r){R(this,Sd).resolve();return}R(this,kh)??$(this,kh,n.lang),Object.assign(R(this,sv),n.styles),z(this,xu,fte).call(this,n.items),e()},R(this,Sd).reject)};return $(this,Dh,R(this,iv).getReader()),R(Ur,ov).add(this),e(),R(this,Sd).promise}update({viewport:e,onBefore:n=null}){var i;const r=e.scale*(globalThis.devicePixelRatio||1),s=e.rotation;if(s!==R(this,rv)&&(n==null||n(),$(this,rv,s),Tp(R(this,nv),{rotation:s})),r!==R(this,Cd)){n==null||n(),$(this,Cd,r);const o={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:z(i=Ur,Hl,_C).call(i,R(this,kh))};for(const a of R(this,Mh))o.properties=R(this,pw).get(a),o.div=a,z(this,xu,hI).call(this,o)}}cancel(){var n;const e=new em("TextLayer task cancelled.");(n=R(this,Dh))==null||n.cancel(e).catch(()=>{}),$(this,Dh,null),R(this,Sd).reject(e)}get textDivs(){return R(this,Mh)}get textContentItemsStr(){return R(this,hw)}static cleanup(){if(!(R(this,ov).size>0)){R(this,Oh).clear();for(const{canvas:e}of R(this,Ih).values())e.remove();R(this,Ih).clear()}}},Sd=new WeakMap,Ai=new WeakMap,cw=new WeakMap,uw=new WeakMap,kh=new WeakMap,Lc=new WeakMap,dw=new WeakMap,fw=new WeakMap,Dh=new WeakMap,nv=new WeakMap,rv=new WeakMap,Cd=new WeakMap,sv=new WeakMap,hw=new WeakMap,iv=new WeakMap,Mh=new WeakMap,pw=new WeakMap,mw=new WeakMap,Oh=new WeakMap,Ih=new WeakMap,Ed=new WeakMap,ov=new WeakMap,xu=new WeakSet,fte=function(e){var s,i;if(R(this,cw))return;(i=R(this,Lc)).ctx??(i.ctx=z(s=Ur,Hl,_C).call(s,R(this,kh)));const n=R(this,Mh),r=R(this,hw);for(const o of e){if(n.length>eFe){jt("Ignoring additional textDivs for performance reasons."),$(this,cw,!0);return}if(o.str===void 0){if(o.type==="beginMarkedContentProps"||o.type==="beginMarkedContent"){const a=R(this,Ai);$(this,Ai,document.createElement("span")),R(this,Ai).classList.add("markedContent"),o.id!==null&&R(this,Ai).setAttribute("id",`${o.id}`),a.append(R(this,Ai))}else o.type==="endMarkedContent"&&$(this,Ai,R(this,Ai).parentNode);continue}r.push(o.str),z(this,xu,hte).call(this,o)}},hte=function(e){var m;const n=document.createElement("span"),r={angle:0,canvasWidth:0,hasText:e.str!=="",hasEOL:e.hasEOL,fontSize:0};R(this,Mh).push(n);const s=Je.transform(R(this,mw),e.transform);let i=Math.atan2(s[1],s[0]);const o=R(this,sv)[e.fontName];o.vertical&&(i+=Math.PI/2);const a=R(this,uw)&&o.fontSubstitution||o.fontFamily,c=Math.hypot(s[2],s[3]),u=c*z(m=Ur,Hl,mte).call(m,a,R(this,kh));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)*",p=n.style;R(this,Ai)===R(this,nv)?(p.left=`${(100*f/R(this,fw)).toFixed(2)}%`,p.top=`${(100*l/R(this,dw)).toFixed(2)}%`):(p.left=`${d}${f.toFixed(2)}px)`,p.top=`${d}${l.toFixed(2)}px)`),p.fontSize=`${d}${(R(Ur,Ed)*c).toFixed(2)}px)`,p.fontFamily=a,r.fontSize=c,n.setAttribute("role","presentation"),n.textContent=e.str,n.dir=e.dir,R(this,uw)&&(n.dataset.fontName=o.fontSubstitutionLoadedName||e.fontName),i!==0&&(r.angle=i*(180/Math.PI));let h=!1;if(e.str.length>1)h=!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&&(h=!0)}if(h&&(r.canvasWidth=o.vertical?e.height:e.width),R(this,pw).set(n,r),R(this,Lc).div=n,R(this,Lc).properties=r,z(this,xu,hI).call(this,R(this,Lc)),r.hasText&&R(this,Ai).append(n),r.hasEOL){const y=document.createElement("br");y.setAttribute("role","presentation"),R(this,Ai).append(y)}},hI=function(e){const{div:n,properties:r,ctx:s,prevFontSize:i,prevFontFamily:o}=e,{style:a}=n;let c="";if(R(Ur,Ed)>1&&(c=`scale(${1/R(Ur,Ed)})`),r.canvasWidth!==0&&r.hasText){const{fontFamily:u}=a,{canvasWidth:f,fontSize:l}=r;(i!==l||o!==u)&&(s.font=`${l*R(this,Cd)}px ${u}`,e.prevFontSize=l,e.prevFontFamily=u);const{width:d}=s.measureText(n.textContent);d>0&&(c=`scaleX(${f*R(this,Cd)/d}) ${c}`)}r.angle!==0&&(c=`rotate(${r.angle}deg) ${c}`),c.length>0&&(a.transform=c)},Hl=new WeakSet,_C=function(e=null){let n=R(this,Ih).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}),R(this,Ih).set(e,n)}return n},pte=function(){if(R(this,Ed)!==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,Ed,e.getBoundingClientRect().height),e.remove()},mte=function(e,n){const r=R(this,Oh).get(e);if(r)return r;const s=z(this,Hl,_C).call(this,n),i=s.font;s.canvas.width=s.canvas.height=xi,s.font=`${xi}px ${e}`;const o=s.measureText("");let a=o.fontBoundingBoxAscent,c=Math.abs(o.fontBoundingBoxDescent);if(a){const l=a/(a+c);return R(this,Oh).set(e,l),s.canvas.width=s.canvas.height=0,s.font=i,l}s.strokeStyle="red",s.clearRect(0,0,xi,xi),s.strokeText("g",0,0);let u=s.getImageData(0,0,xi,xi).data;c=0;for(let l=u.length-1-3;l>=0;l-=4)if(u[l]>0){c=Math.ceil(l/4/xi);break}s.clearRect(0,0,xi,xi),s.strokeText("A",0,xi),u=s.getImageData(0,0,xi,xi).data,a=0;for(let l=0,d=u.length;l<d;l+=4)if(u[l]>0){a=xi-Math.floor(l/4/xi);break}s.canvas.width=s.canvas.height=0,s.font=i;const f=a?a/(a+c):tFe;return R(this,Oh).set(e,f),f},B(Ur,Hl),B(Ur,Oh,new Map),B(Ur,Ih,new Map),B(Ur,Ed,null),B(Ur,ov,new Set),Ur);function nFe(){Ree("`renderTextLayer`, please use `TextLayer` instead.");const{textContentSource:t,container:e,viewport:n,...r}=arguments[0],s=Object.keys(r);s.length>0&&jt("Ignoring `renderTextLayer` parameters: "+s.join(", "));const i=new lA({textContentSource:t,container:e,viewport:n}),{textDivs:o,textContentItemsStr:a}=i;return{promise:i.render(),textDivs:o,textContentItemsStr:a}}function rFe(){Ree("`updateTextLayer`, please use `TextLayer` instead.")}class wx{static textContent(e){const n=[],r={items:n,styles:Object.create(null)};function s(i){var c;if(!i)return;let o=null;const a=i.name;if(a==="#text")o=i.value;else if(wx.shouldBuildText(a))(c=i==null?void 0:i.attributes)!=null&&c.textContent?o=i.attributes.textContent:i.value&&(o=i.value);else return;if(o!==null&&n.push({str:o}),!!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 sFe=65536,iFe=100,oFe=5e3,aFe=Fs?y$e:i$e,lFe=Fs?b$e:Eee,cFe=Fs?v$e:s$e,uFe=Fs?x$e:Aee;function dFe(t={}){typeof t=="string"||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});const e=new pI,{docId:n}=e,r=t.url?fFe(t.url):null,s=t.data?hFe(t.data):null,i=t.httpHeaders||null,o=t.withCredentials===!0,a=t.password??null,c=t.range instanceof gte?t.range:null,u=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:sFe;let f=t.worker instanceof Cg?t.worker:null;const l=t.verbosity,d=typeof t.docBaseUrl=="string"&&!J$(t.docBaseUrl)?t.docBaseUrl:null,p=typeof t.cMapUrl=="string"?t.cMapUrl:null,h=t.cMapPacked!==!1,m=t.CMapReaderFactory||lFe,y=typeof t.standardFontDataUrl=="string"?t.standardFontDataUrl:null,g=t.StandardFontDataFactory||uFe,v=t.stopAtErrors!==!0,x=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,_=t.isEvalSupported!==!1,A=typeof t.isOffscreenCanvasSupported=="boolean"?t.isOffscreenCanvasSupported:!Fs,N=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,T=typeof t.disableFontFace=="boolean"?t.disableFontFace:Fs,E=t.fontExtraProperties===!0,P=t.enableXfa===!0,k=t.ownerDocument||globalThis.document,M=t.disableRange===!0,I=t.disableStream===!0,j=t.disableAutoFetch===!0,L=t.pdfBug===!0,H=t.enableHWA===!0,K=c?c.length:t.length??NaN,V=typeof t.useSystemFonts=="boolean"?t.useSystemFonts:!Fs&&!T,U=typeof t.useWorkerFetch=="boolean"?t.useWorkerFetch:m===Eee&&g===Aee&&p&&y&&Qb(p,document.baseURI)&&Qb(y,document.baseURI),Q=t.canvasFactory||new aFe({ownerDocument:k,enableHWA:H}),ne=t.filterFactory||new cFe({docId:n,ownerDocument:k}),X=null;G2e(l);const G={canvasFactory:Q,filterFactory:ne};if(U||(G.cMapReaderFactory=new m({baseUrl:p,isCompressed:h}),G.standardFontDataFactory=new g({baseUrl:y})),!f){const he={verbosity:l,port:lu.workerPort};f=he.port?Cg.fromPort(he):new Cg(he),e._worker=f}const Y={docId:n,apiVersion:"4.4.168",data:s,password:a,disableAutoFetch:j,rangeChunkSize:u,length:K,docBaseUrl:d,enableXfa:P,evaluatorOptions:{maxImageSize:x,disableFontFace:T,ignoreErrors:v,isEvalSupported:_,isOffscreenCanvasSupported:A,canvasMaxAreaInBytes:N,fontExtraProperties:E,useSystemFonts:V,cMapUrl:U?p:null,standardFontDataUrl:U?y:null}},Z={disableFontFace:T,fontExtraProperties:E,ownerDocument:k,pdfBug:L,styleElement:X,loadingParams:{disableAutoFetch:j,enableXfa:P}};return f.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(f.destroyed)throw new Error("Worker was destroyed");const he=f.messageHandler.sendWithPromise("GetDocRequest",Y,s?[s.buffer]:null);let fe;if(c)fe=new L$e(c,{disableRange:M,disableStream:I});else if(!s){if(!r)throw new Error("getDocument - no `url` parameter provided.");fe=(xe=>Fs?function(){return typeof fetch<"u"&&typeof Response<"u"&&"body"in Response.prototype}()&&Qb(xe.url)?new fH(xe):new Y$e(xe):Qb(xe.url)?new fH(xe):new q$e(xe))({url:r,length:K,httpHeaders:i,withCredentials:o,rangeChunkSize:u,disableRange:M,disableStream:I})}return he.then(ce=>{if(e.destroyed)throw new Error("Loading aborted");if(f.destroyed)throw new Error("Worker was destroyed");const xe=new e0(n,ce,f.port),Ne=new vFe(xe,e,fe,Z,G);e._transport=Ne,xe.send("Ready",null)})}).catch(e._capability.reject),e}function fFe(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch{if(Fs&&typeof t=="string")return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function hFe(t){if(Fs&&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 jN(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 hH(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 RA;const NA=class NA{constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${Rs(NA,RA)._++}`,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)}};RA=new WeakMap,B(NA,RA,0);let pI=NA,gte=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){Rn("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};class pFe{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 Yt(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 Ad,$c,ea,$m,SC;class mFe{constructor(e,n,r,s=!1){B(this,ea);B(this,Ad,null);B(this,$c,!1);this._pageIndex=e,this._pageInfo=n,this._transport=r,this._stats=s?new JU:null,this._pdfBug=s,this.commonObjs=r.commonObjs,this.objs=new vte,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 K_({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 Yt(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=ld.ENABLE,transform:i=null,background:o=null,optionalContentConfigPromise:a=null,annotationCanvasMap:c=null,pageColors:u=null,printAnnotationStorage:f=null}){var x,_;(x=this._stats)==null||x.time("Overall");const l=this._transport.getRenderingIntent(r,s,f),{renderingIntent:d,cacheKey:p}=l;$(this,$c,!1),z(this,ea,SC).call(this),a||(a=this._transport.getOptionalContentConfig(d));let h=this._intentStates.get(p);h||(h=Object.create(null),this._intentStates.set(p,h)),h.streamReaderCancelTimeout&&(clearTimeout(h.streamReaderCancelTimeout),h.streamReaderCancelTimeout=null);const m=!!(d&Go.PRINT);h.displayReadyCapability||(h.displayReadyCapability=Promise.withResolvers(),h.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(_=this._stats)==null||_.time("Page Request"),this._pumpOperatorList(l));const y=A=>{var N;h.renderTasks.delete(g),(this._maybeCleanupAfterRender||m)&&$(this,$c,!0),z(this,ea,$m).call(this,!m),A?(g.capability.reject(A),this._abortOperatorList({intentState:h,reason:A instanceof Error?A:new Error(A)})):g.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),(N=globalThis.Stats)!=null&&N.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},g=new gI({callback:y,params:{canvasContext:e,viewport:n,transform:i,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:h.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!m,pdfBug:this._pdfBug,pageColors:u});(h.renderTasks||(h.renderTasks=new Set)).add(g);const v=g.task;return Promise.all([h.displayReadyCapability.promise,a]).then(([A,N])=>{var T;if(this.destroyed){y();return}if((T=this._stats)==null||T.time("Rendering"),!(N.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:N}),g.operatorListChanged()}).catch(y),v}getOperatorList({intent:e="display",annotationMode:n=ld.ENABLE,printAnnotationStorage:r=null}={}){var c;function s(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(a))}const i=this._transport.getRenderingIntent(e,n,r,!0);let o=this._intentStates.get(i.cacheKey);o||(o=Object.create(null),this._intentStates.set(i.cacheKey,o));let a;return o.opListReadCapability||(a=Object.create(null),a.operatorListChanged=s,o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||(o.renderTasks=new Set)).add(a),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(c=this._stats)==null||c.time("Page Request"),this._pumpOperatorList(i)),o.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=>wx.textContent(r));const n=this.streamTextContent(e);return new Promise(function(r,s){function i(){o.read().then(function({value:c,done:u}){if(u){r(a);return}a.lang??(a.lang=c.lang),Object.assign(a.styles,c.styles),a.items.push(...c.items),i()},s)}const o=n.getReader(),a={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,$c,!1),z(this,ea,SC).call(this),Promise.all(e)}cleanup(e=!1){$(this,$c,!0);const n=z(this,ea,$m).call(this,!1);return e&&n&&this._stats&&(this._stats=new JU),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&&z(this,ea,$m).call(this,!0)}_pumpOperatorList({renderingIntent:e,cacheKey:n,annotationStorageSerializable:r}){const{map:s,transfer:i}=r,a=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:n,annotationStorage:s},i).getReader(),c=this._intentStates.get(n);c.streamReader=a;const u=()=>{a.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();z(this,ea,$m).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 Z$){let s=iFe;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 em(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}}Ad=new WeakMap,$c=new WeakMap,ea=new WeakSet,$m=function(e=!1){if(z(this,ea,SC).call(this),!R(this,$c)||this.destroyed)return!1;if(e)return $(this,Ad,setTimeout(()=>{$(this,Ad,null),z(this,ea,$m).call(this,!1)},oFe)),!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,$c,!1),!0},SC=function(){R(this,Ad)&&(clearTimeout(R(this,Ad)),$(this,Ad,null))};var jh,PA;class gFe{constructor(){B(this,jh,new Set);B(this,PA,Promise.resolve())}postMessage(e,n){const r={data:structuredClone(e,n?{transfer:n}:null)};R(this,PA).then(()=>{for(const s of R(this,jh))s.call(this,r)})}addEventListener(e,n){R(this,jh).add(n)}removeEventListener(e,n){R(this,jh).delete(n)}terminate(){R(this,jh).clear()}}jh=new WeakMap,PA=new WeakMap;const Rc={isWorkerDisabled:!1,fakeWorkerId:0};Fs&&(Rc.isWorkerDisabled=!0,lu.workerSrc||(lu.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,av,CC,lv,EC;const so=class so{constructor({name:e=null,port:n=null,verbosity:r=K2e()}={}){B(this,av);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=R(so,Lh))!=null&&s.has(n))throw new Error("Cannot use more than one PDFWorker per port.");(R(so,Lh)||$(so,Lh,new WeakMap)).set(n,this),this._initializeFromPort(n);return}this._initialize()}get promise(){return Fs?Promise.all([Xl.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 e0("main","worker",e),this._messageHandler.on("ready",function(){}),z(this,av,CC).call(this)}_initialize(){if(Rc.isWorkerDisabled||R(so,lv,EC)){this._setupFakeWorker();return}let{workerSrc:e}=so;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 e0("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",a=>{if(i.abort(),this.destroyed||!a){s();return}this._messageHandler=r,this._port=n,this._webWorker=n,z(this,av,CC).call(this)}),r.on("ready",a=>{if(i.abort(),this.destroyed){s();return}try{o()}catch{this._setupFakeWorker()}});const o=()=>{const a=new Uint8Array;r.send("test",a,[a.buffer])};o();return}catch{ON("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){Rc.isWorkerDisabled||(jt("Setting up fake worker."),Rc.isWorkerDisabled=!0),so._setupFakeWorkerGlobal.then(e=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const n=new gFe;this._port=n;const r=`fake${Rc.fakeWorkerId++}`,s=new e0(r+"_worker",r,n);e.setup(s,n),this._messageHandler=new e0(r,r+"_worker",n),z(this,av,CC).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=R(so,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=R(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 so(e)}static get workerSrc(){if(lu.workerSrc)return lu.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return Yt(this,"_setupFakeWorkerGlobal",(async()=>R(this,lv,EC)?R(this,lv,EC):(await import(this.workerSrc)).WorkerMessageHandler)())}};Lh=new WeakMap,av=new WeakSet,CC=function(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})},lv=new WeakSet,EC=function(){var e;try{return((e=globalThis.pdfjsWorker)==null?void 0:e.WorkerMessageHandler)||null}catch{return null}},B(so,lv),B(so,Lh);let Cg=so;var Fc,wl,cv,uv,_l,$h,t0;class vFe{constructor(e,n,r,s,i){B(this,$h);B(this,Fc,new Map);B(this,wl,new Map);B(this,cv,new Map);B(this,uv,new Map);B(this,_l,null);this.messageHandler=e,this.loadingTask=n,this.commonObjs=new vte,this.fontLoader=new m$e({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 Yt(this,"annotationStorage",new nF)}getRenderingIntent(e,n=ld.ENABLE,r=null,s=!1){let i=Go.DISPLAY,o=oI;switch(e){case"any":i=Go.ANY;break;case"display":break;case"print":i=Go.PRINT;break;default:jt(`getRenderingIntent - invalid intent: ${e}`)}switch(n){case ld.DISABLE:i+=Go.ANNOTATIONS_DISABLE;break;case ld.ENABLE:break;case ld.ENABLE_FORMS:i+=Go.ANNOTATIONS_FORMS;break;case ld.ENABLE_STORAGE:i+=Go.ANNOTATIONS_STORAGE,o=(i&Go.PRINT&&r instanceof tte?r:this.annotationStorage).serializable;break;default:jt(`getRenderingIntent - invalid annotationMode: ${n}`)}return s&&(i+=Go.OPLIST),{renderingIntent:i,cacheKey:`${i}_${o.hash}`,annotationStorageSerializable:o}}destroy(){var r;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),(r=R(this,_l))==null||r.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const s of R(this,wl).values())e.push(s._destroy());R(this,wl).clear(),R(this,cv).clear(),R(this,uv).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(),R(this,Fc).clear(),this.filterFactory.destroy(),lA.cleanup(),(s=this._networkStream)==null||s.cancelAllRequests(new em("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)=>{Wr(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:o}){if(o){s.close();return}Wr(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(o=>{if(!this.destroyed)throw o})}}),e.on("ReaderHeadersReady",r=>{const s=Promise.withResolvers(),i=this._fullReader;return i.headersReady.then(()=>{var o;(!i.isStreamingSupported||!i.isRangeSupported)&&(this._lastProgress&&((o=n.onProgress)==null||o.call(n,this._lastProgress)),i.onProgress=a=>{var c;(c=n.onProgress)==null||c.call(n,{loaded:a.loaded,total:a.total})}),s.resolve({isStreamingSupported:i.isStreamingSupported,isRangeSupported:i.isRangeSupported,contentLength:i.contentLength})},s.reject),s.promise}),e.on("GetRangeReader",(r,s)=>{Wr(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:o,done:a}){if(a){s.close();return}Wr(o instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),s.enqueue(new Uint8Array(o),1,[o])}).catch(o=>{s.error(o)})},s.onCancel=o=>{i.cancel(o),s.ready.catch(a=>{if(!this.destroyed)throw a})}}),e.on("GetDoc",({pdfInfo:r})=>{this._numPages=r.numPages,this._htmlForXfa=r.htmlForXfa,delete r.htmlForXfa,n._capability.resolve(new pFe(r,this))}),e.on("DocException",function(r){let s;switch(r.name){case"PasswordException":s=new LO(r.message,r.code);break;case"InvalidPDFException":s=new wee(r.message);break;case"MissingPDFException":s=new Jp(r.message);break;case"UnexpectedResponseException":s=new IN(r.message,r.status);break;case"UnknownErrorException":s=new $O(r.message,r.details);break;default:Rn("DocException - expected a valid Error.")}n._capability.reject(s)}),e.on("PasswordRequest",r=>{if($(this,_l,Promise.withResolvers()),n.onPassword){const s=i=>{i instanceof Error?R(this,_l).reject(i):R(this,_l).resolve({password:i})};try{n.onPassword(s,r.code)}catch(i){R(this,_l).reject(i)}}else R(this,_l).reject(new LO(r.message,r.code));return R(this,_l).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;R(this,wl).get(r.pageIndex)._startRenderPage(r.transparency,r.cacheKey)}),e.on("commonobj",([r,s,i])=>{var o;if(this.destroyed||this.commonObjs.has(r))return null;switch(s){case"Font":const{disableFontFace:a,fontExtraProperties:c,pdfBug:u}=this._params;if("error"in i){const p=i.error;jt(`Error during font loading: ${p}`),this.commonObjs.resolve(r,p);break}const f=u&&((o=globalThis.FontInspector)!=null&&o.enabled)?(p,h)=>globalThis.FontInspector.fontAdded(p,h):null,l=new g$e(i,{disableFontFace:a,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;Wr(d,"The imageRef must be defined.");for(const p of R(this,wl).values())for(const[,h]of p.objs)if((h==null?void 0:h.ref)===d)return h.dataLen?(this.commonObjs.resolve(r,structuredClone(h)),h.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,o])=>{var c;if(this.destroyed)return;const a=R(this,wl).get(s);if(!a.objs.has(r)){if(a._intentStates.size===0){(c=o==null?void 0:o.bitmap)==null||c.close();return}switch(i){case"Image":a.objs.resolve(r,o),(o==null?void 0:o.dataLen)>H2e&&(a._maybeCleanupAfterRender=!0);break;case"Pattern":a.objs.resolve(r,o);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&&jt("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=R(this,cv).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&&R(this,uv).set(i.refStr,e);const o=new mFe(n,i,this,this._params.pdfBug);return R(this,wl).set(n,o),o});return R(this,cv).set(n,s),s}getPageIndex(e){return hH(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 z(this,$h,t0).call(this,"GetFieldObjects")}hasJSActions(){return z(this,$h,t0).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 z(this,$h,t0).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 z(this,$h,t0).call(this,"GetOptionalContentConfig").then(n=>new j$e(n,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",n=R(this,Fc).get(e);if(n)return n;const r=this.messageHandler.sendWithPromise(e,null).then(s=>{var i,o;return{info:s[0],metadata:s[1]?new O$e(s[1]):null,contentDispositionFilename:((i=this._fullReader)==null?void 0:i.filename)??null,contentLength:((o=this._fullReader)==null?void 0:o.contentLength)??null}});return R(this,Fc).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 R(this,wl).values())if(!n.cleanup())throw new Error(`startCleanup: Page ${n.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),R(this,Fc).clear(),this.filterFactory.destroy(!0),lA.cleanup()}}cachedPageNumber(e){if(!hH(e))return null;const n=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;return R(this,uv).get(n)??null}}Fc=new WeakMap,wl=new WeakMap,cv=new WeakMap,uv=new WeakMap,_l=new WeakMap,$h=new WeakSet,t0=function(e,n=null){const r=R(this,Fc).get(e);if(r)return r;const s=this.messageHandler.sendWithPromise(e,n);return R(this,Fc).set(e,s),s};const B1=Symbol("INITIAL_DATA");var Pa,gw,mI;class vte{constructor(){B(this,gw);B(this,Pa,Object.create(null))}get(e,n=null){if(n){const s=z(this,gw,mI).call(this,e);return s.promise.then(()=>n(s.data)),null}const r=R(this,Pa)[e];if(!r||r.data===B1)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return r.data}has(e){const n=R(this,Pa)[e];return!!n&&n.data!==B1}resolve(e,n=null){const r=z(this,gw,mI).call(this,e);r.data=n,r.resolve()}clear(){var e;for(const n in R(this,Pa)){const{data:r}=R(this,Pa)[n];(e=r==null?void 0:r.bitmap)==null||e.close()}$(this,Pa,Object.create(null))}*[Symbol.iterator](){for(const e in R(this,Pa)){const{data:n}=R(this,Pa)[e];n!==B1&&(yield[e,n])}}}Pa=new WeakMap,gw=new WeakSet,mI=function(e){var n;return(n=R(this,Pa))[e]||(n[e]={...Promise.withResolvers(),data:B1})};var Rd;class yFe{constructor(e){B(this,Rd,null);$(this,Rd,e),this.onContinue=null}get promise(){return R(this,Rd).capability.promise}cancel(e=0){R(this,Rd).cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=R(this,Rd).operatorList;if(!e)return!1;const{annotationCanvasMap:n}=R(this,Rd);return e.form||e.canvas&&(n==null?void 0:n.size)>0}}Rd=new WeakMap;var Nd,Fh;const Xf=class Xf{constructor({callback:e,params:n,objs:r,commonObjs:s,annotationCanvasMap:i,operatorList:o,pageIndex:a,canvasFactory:c,filterFactory:u,useRequestAnimationFrame:f=!1,pdfBug:l=!1,pageColors:d=null}){B(this,Nd,null);this.callback=e,this.params=n,this.objs=r,this.commonObjs=s,this.annotationCanvasMap=i,this.operatorListIdx=null,this.operatorList=o,this._pageIndex=a,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 yFe(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 a,c;if(this.cancelled)return;if(this._canvas){if(R(Xf,Fh).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.");R(Xf,Fh).add(this._canvas)}this._pdfBug&&((a=globalThis.StepperManager)!=null&&a.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:o}=this.params;this.gfx=new Sg(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:o}),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(),R(this,Nd)&&(window.cancelAnimationFrame(R(this,Nd)),$(this,Nd,null)),R(Xf,Fh).delete(this._canvas),this.callback(e||new Z$(`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,Nd,window.requestAnimationFrame(()=>{$(this,Nd,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(),R(Xf,Fh).delete(this._canvas),this.callback())))}};Nd=new WeakMap,Fh=new WeakMap,B(Xf,Fh,new WeakSet);let gI=Xf;const bFe="4.4.168",xFe="19fbc8998";function pH(t){return Math.floor(Math.max(0,Math.min(1,t))*255).toString(16).padStart(2,"0")}function Mb(t){return Math.max(0,Math.min(255,255*t))}class mH{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=Mb(e),[e,e,e]}static G_HTML([e]){const n=pH(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(Mb)}static RGB_HTML(e){return`#${e.map(pH).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[Mb(1-Math.min(1,e+s)),Mb(1-Math.min(1,r+s)),Mb(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,o=1-r,a=Math.min(s,i,o);return["CMYK",s,i,o,a]}}class yte{static setupStorage(e,n,r,s,i){const o=s.getValue(n,{value:null});switch(r.name){case"textarea":if(o.value!==null&&(e.textContent=o.value),i==="print")break;e.addEventListener("input",a=>{s.setValue(n,{value:a.target.value})});break;case"input":if(r.attributes.type==="radio"||r.attributes.type==="checkbox"){if(o.value===r.attributes.xfaOn?e.setAttribute("checked",!0):o.value===r.attributes.xfaOff&&e.removeAttribute("checked"),i==="print")break;e.addEventListener("change",a=>{s.setValue(n,{value:a.target.checked?a.target.getAttribute("xfaOn"):a.target.getAttribute("xfaOff")})})}else{if(o.value!==null&&e.setAttribute("value",o.value),i==="print")break;e.addEventListener("input",a=>{s.setValue(n,{value:a.target.value})})}break;case"select":if(o.value!==null){e.setAttribute("value",o.value);for(const a of r.children)a.attributes.value===o.value?a.attributes.selected=!0:a.attributes.hasOwnProperty("selected")&&delete a.attributes.selected}e.addEventListener("input",a=>{const c=a.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:o}=n,a=e instanceof HTMLAnchorElement;o.type==="radio"&&(o.name=`${o.name}-${s}`);for(const[c,u]of Object.entries(o))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:(!a||c!=="href"&&c!=="newWindow")&&e.setAttribute(c,u)}a&&i.addLinkAttributes(e,o.href,o.newWindow),r&&o.dataId&&this.setupStorage(e,o.dataId,n,r)}static render(e){var l,d;const n=e.annotationStorage,r=e.linkService,s=e.xfaHtml,i=e.intent||"display",o=document.createElement(s.name);s.attributes&&this.setAttributes({html:o,element:s,intent:i,linkService:r});const a=i!=="richText",c=e.div;if(c.append(o),e.viewport){const p=`matrix(${e.viewport.transform.join(",")})`;c.style.transform=p}a&&c.setAttribute("class","xfaLayer xfaFont");const u=[];if(s.children.length===0){if(s.value){const p=document.createTextNode(s.value);o.append(p),a&&wx.shouldBuildText(s.name)&&u.push(p)}return{textDivs:u}}const f=[[s,-1,o]];for(;f.length>0;){const[p,h,m]=f.at(-1);if(h+1===p.children.length){f.pop();continue}const y=p.children[++f.at(-1)[1]];if(y===null)continue;const{name:g}=y;if(g==="#text"){const x=document.createTextNode(y.value);u.push(x),m.append(x);continue}const v=(l=y==null?void 0:y.attributes)!=null&&l.xmlns?document.createElementNS(y.attributes.xmlns,g):document.createElement(g);if(m.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 x=document.createTextNode(y.value);a&&wx.shouldBuildText(g)&&u.push(x),v.append(x)}}for(const p of c.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))p.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 Q_=1e3,wFe=9,Dp=new WeakSet;function cu(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class _Fe{static create(e){switch(e.data.annotationType){case jr.LINK:return new bte(e);case jr.TEXT:return new SFe(e);case jr.WIDGET:switch(e.data.fieldType){case"Tx":return new CFe(e);case"Btn":return e.data.radioButton?new _te(e):e.data.checkBox?new AFe(e):new RFe(e);case"Ch":return new NFe(e);case"Sig":return new EFe(e)}return new tm(e);case jr.POPUP:return new yI(e);case jr.FREETEXT:return new Rte(e);case jr.LINE:return new TFe(e);case jr.SQUARE:return new kFe(e);case jr.CIRCLE:return new DFe(e);case jr.POLYLINE:return new Nte(e);case jr.CARET:return new OFe(e);case jr.INK:return new Pte(e);case jr.POLYGON:return new MFe(e);case jr.HIGHLIGHT:return new IFe(e);case jr.UNDERLINE:return new jFe(e);case jr.SQUIGGLY:return new LFe(e);case jr.STRIKEOUT:return new $Fe(e);case jr.STAMP:return new Tte(e);case jr.FILEATTACHMENT:return new FFe(e);default:return new Sr(e)}}}var zh,dv,fv,vw,vI;const xF=class xF{constructor(e,{isRenderable:n=!1,ignoreBorder:r=!1,createQuadrilaterals:s=!1}={}){B(this,vw);B(this,zh,null);B(this,dv,!1);B(this,fv,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 xF._hasPopupData(this.data)}updateEdited(e){var r;if(!this.container)return;R(this,zh)||$(this,zh,{rect:this.data.rect.slice(0)});const{rect:n}=e;n&&z(this,vw,vI).call(this,n),(r=R(this,fv))==null||r.popup.updateEdited(e)}resetEdited(){var e;R(this,zh)&&(z(this,vw,vI).call(this,R(this,zh).rect),(e=R(this,fv))==null||e.popup.resetEdited(),$(this,zh,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 tm||(i.tabIndex=Q_);const{style:o}=i;if(o.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 yI){const{rotation:m}=n;return!n.hasOwnCanvas&&m!==0&&this.setRotation(m,i),i}const{width:a,height:c}=cu(n.rect);if(!e&&n.borderStyle.width>0){o.borderWidth=`${n.borderStyle.width}px`;const m=n.borderStyle.horizontalCornerRadius,y=n.borderStyle.verticalCornerRadius;if(m>0||y>0){const v=`calc(${m}px * var(--scale-factor)) / calc(${y}px * var(--scale-factor))`;o.borderRadius=v}else if(this instanceof _te){const v=`calc(${a}px * var(--scale-factor)) / calc(${c}px * var(--scale-factor))`;o.borderRadius=v}switch(n.borderStyle.style){case kb.SOLID:o.borderStyle="solid";break;case kb.DASHED:o.borderStyle="dashed";break;case kb.BEVELED:jt("Unimplemented border style: beveled");break;case kb.INSET:jt("Unimplemented border style: inset");break;case kb.UNDERLINE:o.borderBottomStyle="solid";break}const g=n.borderColor||null;g?($(this,dv,!0),o.borderColor=Je.makeHexColor(g[0]|0,g[1]|0,g[2]|0)):o.borderWidth=0}const u=Je.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:p}=s.rawDims;o.left=`${100*(u[0]-d)/f}%`,o.top=`${100*(u[1]-p)/l}%`;const{rotation:h}=n;return n.hasOwnCanvas||h===0?(o.width=`${100*a/f}%`,o.height=`${100*c/l}%`):this.setRotation(h,i),i}setRotation(e,n=this.container){if(!this.data.rect)return;const{pageWidth:r,pageHeight:s}=this.parent.viewport.rawDims,{width:i,height:o}=cu(this.data.rect);let a,c;e%180===0?(a=100*i/r,c=100*o/s):(a=100*o/r,c=100*i/s),n.style.width=`${a}%`,n.style.height=`${c}%`,n.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(n,r,s)=>{const i=s.detail[n],o=i[0],a=i.slice(1);s.target.style[r]=mH[`${o}_HTML`](a),this.annotationStorage.setValue(this.data.id,{[r]:mH[`${o}_rgb`](a)})};return Yt(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 o=r[s];if(o){const a={detail:{[s]:i},target:e};o(a),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(m=>Math.fround(m));if(e.length===8){const[m,y,g,v]=e.subarray(2,6);if(s===m&&i===y&&n===g&&r===v)return}const{style:o}=this.container;let a;if(R(this,dv)){const{borderColor:m,borderWidth:y}=o;o.borderWidth=0,a=["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="${m}" 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 p=f.createElement("clipPath"),h=`clippath_${this.data.id}`;p.setAttribute("id",h),p.setAttribute("clipPathUnits","objectBoundingBox"),d.append(p);for(let m=2,y=e.length;m<y;m+=8){const g=e[m],v=e[m+1],x=e[m+2],_=e[m+3],A=f.createElement("rect"),N=(x-n)/c,T=(i-v)/u,E=(g-x)/c,P=(v-_)/u;A.setAttribute("x",N),A.setAttribute("y",T),A.setAttribute("width",E),A.setAttribute("height",P),p.append(A),a==null||a.push(`<rect vector-effect="non-scaling-stroke" x="${N}" y="${T}" width="${E}" height="${P}"/>`)}R(this,dv)&&(a.push("</g></svg>')"),o.backgroundImage=a.join("")),this.container.append(l),this.container.style.clipPath=`url(#${h})`}_createPopup(){const{container:e,data:n}=this;e.setAttribute("aria-haspopup","dialog");const r=$(this,fv,new yI({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(){Rn("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:o,exportValues:a}of s){if(i===-1||o===n)continue;const c=typeof a=="string"?a:null,u=document.querySelector(`[data-element-id="${o}"]`);if(u&&!Dp.has(u)){jt(`_getElementsByName - element not allowed: ${o}`);continue}r.push({id:o,exportValue:c,domElement:u})}return r}for(const s of document.getElementsByName(e)){const{exportValue:i}=s,o=s.getAttribute("data-element-id");o!==n&&Dp.has(s)&&r.push({id:o,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})})}};zh=new WeakMap,dv=new WeakMap,fv=new WeakMap,vw=new WeakSet,vI=function(e){const{container:{style:n},data:{rect:r,rotation:s},parent:{viewport:{rawDims:{pageWidth:i,pageHeight:o,pageX:a,pageY:c}}}}=this;r==null||r.splice(0,4,...e);const{width:u,height:f}=cu(e);n.left=`${100*(e[0]-a)/i}%`,n.top=`${100*(o-e[3]+c)/o}%`,s===0?(n.width=`${100*u/i}%`,n.height=`${100*f/o}%`):this.setRotation(s)};let Sr=xF;var bo,Vf,xte,wte;class bte extends Sr{constructor(n,r=null){super(n,{isRenderable:!0,ignoreBorder:!!(r!=null&&r.ignoreBorder),createQuadrilaterals:!0});B(this,bo);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?(z(this,bo,xte).call(this,s,n.attachment,n.attachmentDest),i=!0):n.setOCGState?(z(this,bo,wte).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==="")&&z(this,bo,Vf).call(this)}_bindNamedAction(n,r){n.href=this.linkService.getAnchorUrl(""),n.onclick=()=>(this.linkService.executeNamedAction(r),!1),z(this,bo,Vf).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 o=s.get(i);o&&(n[o]=()=>{var a;return(a=this.linkService.eventBus)==null||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r.id,name:i}}),!1})}n.onclick||(n.onclick=()=>!1),z(this,bo,Vf).call(this)}_bindResetFormAction(n,r){const s=n.onclick;if(s||(n.href=this.linkService.getAnchorUrl("")),z(this,bo,Vf).call(this),!this._fieldObjects){jt('_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:o,include:a}=r,c=[];if(i.length!==0||o.length!==0){const d=new Set(o);for(const p of i){const h=this._fieldObjects[p]||[];for(const{id:m}of h)d.add(m)}for(const p of Object.values(this._fieldObjects))for(const h of p)d.has(h.id)===a&&c.push(h)}else for(const d of Object.values(this._fieldObjects))c.push(...d);const u=this.annotationStorage,f=[];for(const d of c){const{id:p}=d;switch(f.push(p),d.type){case"text":{const m=d.defaultValue||"";u.setValue(p,{value:m});break}case"checkbox":case"radiobutton":{const m=d.defaultValue===d.exportValues;u.setValue(p,{value:m});break}case"combobox":case"listbox":{const m=d.defaultValue||"";u.setValue(p,{value:m});break}default:continue}const h=document.querySelector(`[data-element-id="${p}"]`);if(h){if(!Dp.has(h)){jt(`_bindResetFormAction - element not allowed: ${p}`);continue}}else continue;h.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}}}bo=new WeakSet,Vf=function(){this.container.setAttribute("data-internal-link","")},xte=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},z(this,bo,Vf).call(this)},wte=function(n,r){n.href=this.linkService.getAnchorUrl(""),n.onclick=()=>(this.linkService.executeSetOCGState(r),!1),z(this,bo,Vf).call(this)};class SFe extends Sr{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 tm extends Sr{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 Ii.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,n,r,s,i){r.includes("mouse")?e.addEventListener(r,o=>{var a;(a=this.linkService.eventBus)==null||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:i(o),shift:o.shiftKey,modifier:this._getKeyModifier(o)}})}):e.addEventListener(r,o=>{var a;if(r==="blur"){if(!n.focused||!o.relatedTarget)return;n.focused=!1}else if(r==="focus"){if(n.focused)return;n.focused=!0}i&&((a=this.linkService.eventBus)==null||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:i(o)}}))})}_setEventListeners(e,n,r,s){var i,o,a;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"&&!((o=this.data.actions)!=null&&o.Blur)?this._setEventListener(e,n,"blur","Blur",null):u==="Blur"&&!((a=this.data.actions)!=null&&a.Focus)&&this._setEventListener(e,n,"focus","Focus",null))}_setBackgroundColor(e){const n=this.data.backgroundColor||null;e.style.backgroundColor=n===null?"transparent":Je.makeHexColor(n[0],n[1],n[2])}_setTextStyle(e){const n=["left","center","right"],{fontColor:r}=this.data.defaultAppearanceData,s=this.data.defaultAppearanceData.fontSize||wFe,i=e.style;let o;const a=2,c=u=>Math.round(10*u)/10;if(this.data.multiLine){const u=Math.abs(this.data.rect[3]-this.data.rect[1]-a),f=Math.round(u/(rD*s))||1,l=u/f;o=Math.min(s,c(l/rD))}else{const u=Math.abs(this.data.rect[3]-this.data.rect[1]-a);o=Math.min(s,c(u/rD))}i.fontSize=`calc(${o}px * var(--scale-factor))`,i.color=Je.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 CFe extends tm{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 o of this._getElementsByName(e.name,e.id))o.domElement&&(o.domElement[n]=r),i.setValue(o.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 o=e.getValue(n,{value:this.data.fieldValue});let a=o.value||"";const c=e.getValue(n,{charLimit:this.data.maxLen}).charLimit;c&&a.length>c&&(a=a.slice(0,c));let u=o.formattedValue||((s=this.data.textContent)==null?void 0:s.join(`
|
||
`))||null;u&&this.data.comb&&(u=u.replaceAll(/\s+/g,""));const f={userValue:a,formattedValue:u,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(r=document.createElement("textarea"),r.textContent=u??a,this.data.doNotScroll&&(r.style.overflowY="hidden")):(r=document.createElement("input"),r.type="text",r.setAttribute("value",u??a),this.data.doNotScroll&&(r.style.overflowX="hidden")),this.data.hasOwnCanvas&&(r.hidden=!0),Dp.add(r),r.setAttribute("data-element-id",n),r.disabled=this.data.readOnly,r.name=this.data.fieldName,r.tabIndex=Q_,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 p=this.data.defaultFieldValue??"";r.value=f.userValue=p,f.formattedValue=null});let l=d=>{const{formattedValue:p}=f;p!=null&&(d.target.value=p),d.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){r.addEventListener("focus",p=>{var m;if(f.focused)return;const{target:h}=p;f.userValue&&(h.value=f.userValue),f.lastCommittedValue=h.value,f.commitKey=1,(m=this.data.actions)!=null&&m.Focus||(f.focused=!0)}),r.addEventListener("updatefromsandbox",p=>{this.showElementAndHideCanvas(p.target);const h={value(m){f.userValue=m.detail.value??"",e.setValue(n,{value:f.userValue.toString()}),m.target.value=f.userValue},formattedValue(m){const{formattedValue:y}=m.detail;f.formattedValue=y,y!=null&&m.target!==document.activeElement&&(m.target.value=y),e.setValue(n,{formattedValue:y})},selRange(m){m.target.setSelectionRange(...m.detail.selRange)},charLimit:m=>{var x;const{charLimit:y}=m.detail,{target:g}=m;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}),(x=this.linkService.eventBus)==null||x.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:v,willCommit:!0,commitKey:1,selStart:g.selectionStart,selEnd:g.selectionEnd}}))}};this._dispatchEventFromSandbox(h,p)}),r.addEventListener("keydown",p=>{var y;f.commitKey=1;let h=-1;if(p.key==="Escape"?h=0:p.key==="Enter"&&!this.data.multiLine?h=2:p.key==="Tab"&&(f.commitKey=3),h===-1)return;const{value:m}=p.target;f.lastCommittedValue!==m&&(f.lastCommittedValue=m,f.userValue=m,(y=this.linkService.eventBus)==null||y.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:m,willCommit:!0,commitKey:h,selStart:p.target.selectionStart,selEnd:p.target.selectionEnd}}))});const d=l;l=null,r.addEventListener("blur",p=>{var m,y;if(!f.focused||!p.relatedTarget)return;(m=this.data.actions)!=null&&m.Blur||(f.focused=!1);const{value:h}=p.target;f.userValue=h,f.lastCommittedValue!==h&&((y=this.linkService.eventBus)==null||y.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:h,willCommit:!0,commitKey:f.commitKey,selStart:p.target.selectionStart,selEnd:p.target.selectionEnd}})),d(p)}),(i=this.data.actions)!=null&&i.Keystroke&&r.addEventListener("beforeinput",p=>{var A;f.lastCommittedValue=null;const{data:h,target:m}=p,{value:y,selectionStart:g,selectionEnd:v}=m;let x=g,_=v;switch(p.inputType){case"deleteWordBackward":{const N=y.substring(0,g).match(/\w*[^\w]*$/);N&&(x-=N[0].length);break}case"deleteWordForward":{const N=y.substring(g).match(/^[^\w]*\w*/);N&&(_+=N[0].length);break}case"deleteContentBackward":g===v&&(x-=1);break;case"deleteContentForward":g===v&&(_+=1);break}p.preventDefault(),(A=this.linkService.eventBus)==null||A.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:y,change:h||"",willCommit:!1,selStart:x,selEnd:_}})}),this._setEventListeners(r,f,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],p=>p.target.value)}if(l&&r.addEventListener("blur",l),this.data.comb){const p=(this.data.rect[2]-this.data.rect[0])/c;r.classList.add("comb"),r.style.letterSpacing=`calc(${p}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 EFe extends tm{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class AFe extends tm{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 Dp.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=Q_,i.addEventListener("change",o=>{const{name:a,checked:c}=o.target;for(const u of this._getElementsByName(a,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",o=>{const a=n.defaultFieldValue||"Off";o.target.checked=a===n.exportValue}),this.enableScripting&&this.hasJSActions&&(i.addEventListener("updatefromsandbox",o=>{const a={value(c){c.target.checked=c.detail.value!=="Off",e.setValue(r,{value:c.target.checked})}};this._dispatchEventFromSandbox(a,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)),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class _te extends tm{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 o of this._getElementsByName(n.fieldName,r))e.setValue(o.id,{value:!1});const i=document.createElement("input");if(Dp.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=Q_,i.addEventListener("change",o=>{const{name:a,checked:c}=o.target;for(const u of this._getElementsByName(a,r))e.setValue(u.id,{value:!1});e.setValue(r,{value:c})}),i.addEventListener("resetform",o=>{const a=n.defaultFieldValue;o.target.checked=a!=null&&a===n.buttonValue}),this.enableScripting&&this.hasJSActions){const o=n.buttonValue;i.addEventListener("updatefromsandbox",a=>{const c={value:u=>{const f=o===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,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)}return this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class RFe extends bte{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 NFe extends tm{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");Dp.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=Q_;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 o=null;if(i){const f=document.createElement("option");f.value=" ",f.setAttribute("hidden",!0),f.setAttribute("selected",!0),s.prepend(f),o=()=>{f.remove(),s.removeEventListener("input",o),o=null},s.addEventListener("input",o)}const a=f=>{const l=f?"value":"textContent",{options:d,multiple:p}=s;return p?Array.prototype.filter.call(d,h=>h.selected).map(h=>h[l]):d.selectedIndex===-1?null:d[d.selectedIndex][l]};let c=a(!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){o==null||o();const p=d.detail.value,h=new Set(Array.isArray(p)?p:[p]);for(const m of s.options)m.selected=h.has(m.value);e.setValue(n,{value:a(!0)}),c=a(!1)},multipleSelection(d){s.multiple=!0},remove(d){const p=s.options,h=d.detail.remove;p[h].selected=!1,s.remove(h),p.length>0&&Array.prototype.findIndex.call(p,y=>y.selected)===-1&&(p[0].selected=!0),e.setValue(n,{value:a(!0),items:u(d)}),c=a(!1)},clear(d){for(;s.length!==0;)s.remove(0);e.setValue(n,{value:null,items:[]}),c=a(!1)},insert(d){const{index:p,displayValue:h,exportValue:m}=d.detail.insert,y=s.children[p],g=document.createElement("option");g.textContent=h,g.value=m,y?y.before(g):s.append(g),e.setValue(n,{value:a(!0),items:u(d)}),c=a(!1)},items(d){const{items:p}=d.detail;for(;s.length!==0;)s.remove(0);for(const h of p){const{displayValue:m,exportValue:y}=h,g=document.createElement("option");g.textContent=m,g.value=y,s.append(g)}s.options.length>0&&(s.options[0].selected=!0),e.setValue(n,{value:a(!0),items:u(d)}),c=a(!1)},indices(d){const p=new Set(d.detail.indices);for(const h of d.target.options)h.selected=p.has(h.index);e.setValue(n,{value:a(!0)}),c=a(!1)},editable(d){d.target.disabled=!d.detail.editable}};this._dispatchEventFromSandbox(l,f)}),s.addEventListener("input",f=>{var p;const l=a(!0),d=a(!1);e.setValue(n,{value:l}),f.preventDefault(),(p=this.linkService.eventBus)==null||p.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:a(!0)})}),this.data.combo&&this._setTextStyle(s),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class yI extends Sr{constructor(e){const{data:n,elements:r}=e;super(e,{isRenderable:Sr._hasPopupData(n)}),this.elements=r,this.popup=null}render(){this.container.classList.add("popupAnnotation");const e=this.popup=new PFe({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=>`${See}${r}`).join(",")),this.container}}var hv,TA,kA,pv,Bh,fr,zc,Uh,yw,bw,mv,Bc,Ta,Uc,xw,Hc,ww,Hh,Vh,Nn,AC,bI,Ste,Cte,Ete,Ate,RC,NC,xI;class PFe{constructor({container:e,color:n,elements:r,titleObj:s,modificationDate:i,contentsObj:o,richText:a,parent:c,rect:u,parentRect:f,open:l}){B(this,Nn);B(this,hv,z(this,Nn,Ete).bind(this));B(this,TA,z(this,Nn,xI).bind(this));B(this,kA,z(this,Nn,NC).bind(this));B(this,pv,z(this,Nn,RC).bind(this));B(this,Bh,null);B(this,fr,null);B(this,zc,null);B(this,Uh,null);B(this,yw,null);B(this,bw,null);B(this,mv,null);B(this,Bc,!1);B(this,Ta,null);B(this,Uc,null);B(this,xw,null);B(this,Hc,null);B(this,ww,null);B(this,Hh,null);B(this,Vh,!1);var d;$(this,fr,e),$(this,ww,s),$(this,zc,o),$(this,Hc,a),$(this,bw,c),$(this,Bh,n),$(this,xw,u),$(this,mv,f),$(this,yw,r),$(this,Uh,Nee.toDateObject(i)),this.trigger=r.flatMap(p=>p.getElementsToTriggerPopup());for(const p of this.trigger)p.addEventListener("click",R(this,pv)),p.addEventListener("mouseenter",R(this,kA)),p.addEventListener("mouseleave",R(this,TA)),p.classList.add("popupTriggerArea");for(const p of r)(d=p.container)==null||d.addEventListener("keydown",R(this,hv));R(this,fr).hidden=!0,l&&z(this,Nn,RC).call(this)}render(){if(R(this,Ta))return;const e=$(this,Ta,document.createElement("div"));if(e.className="popup",R(this,Bh)){const i=e.style.outlineColor=Je.makeHexColor(...R(this,Bh));CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?e.style.backgroundColor=`color-mix(in srgb, ${i} 30%, white)`:e.style.backgroundColor=Je.makeHexColor(...R(this,Bh).map(a=>Math.floor(.7*(255-a)+a)))}const n=document.createElement("span");n.className="header";const r=document.createElement("h1");if(n.append(r),{dir:r.dir,str:r.textContent}=R(this,ww),e.append(n),R(this,Uh)){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:R(this,Uh).toLocaleDateString(),time:R(this,Uh).toLocaleTimeString()})),n.append(i)}const s=R(this,Nn,AC);if(s)yte.render({xfaHtml:s,intent:"richText",div:e}),e.lastChild.classList.add("richText","popupContent");else{const i=this._formatContents(R(this,zc));e.append(i)}R(this,fr).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,o=s.length;i<o;++i){const a=s[i];r.append(document.createTextNode(a)),i<o-1&&r.append(document.createElement("br"))}return r}updateEdited({rect:e,popupContent:n}){var r;R(this,Hh)||$(this,Hh,{contentsObj:R(this,zc),richText:R(this,Hc)}),e&&$(this,Uc,null),n&&($(this,Hc,z(this,Nn,Cte).call(this,n)),$(this,zc,null)),(r=R(this,Ta))==null||r.remove(),$(this,Ta,null)}resetEdited(){var e;R(this,Hh)&&({contentsObj:Rs(this,zc)._,richText:Rs(this,Hc)._}=R(this,Hh),$(this,Hh,null),(e=R(this,Ta))==null||e.remove(),$(this,Ta,null),$(this,Uc,null))}forceHide(){$(this,Vh,this.isVisible),R(this,Vh)&&(R(this,fr).hidden=!0)}maybeShow(){R(this,Vh)&&(R(this,Ta)||z(this,Nn,NC).call(this),$(this,Vh,!1),R(this,fr).hidden=!1)}get isVisible(){return R(this,fr).hidden===!1}}hv=new WeakMap,TA=new WeakMap,kA=new WeakMap,pv=new WeakMap,Bh=new WeakMap,fr=new WeakMap,zc=new WeakMap,Uh=new WeakMap,yw=new WeakMap,bw=new WeakMap,mv=new WeakMap,Bc=new WeakMap,Ta=new WeakMap,Uc=new WeakMap,xw=new WeakMap,Hc=new WeakMap,ww=new WeakMap,Hh=new WeakMap,Vh=new WeakMap,Nn=new WeakSet,AC=function(){const e=R(this,Hc),n=R(this,zc);return e!=null&&e.str&&(!(n!=null&&n.str)||n.str===e.str)&&R(this,Hc).html||null},bI=function(){var e,n,r;return((r=(n=(e=R(this,Nn,AC))==null?void 0:e.attributes)==null?void 0:n.style)==null?void 0:r.fontSize)||0},Ste=function(){var e,n,r;return((r=(n=(e=R(this,Nn,AC))==null?void 0:e.attributes)==null?void 0:n.style)==null?void 0:r.color)||null},Cte=function(e){const n=[],r={str:e,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:n}]}},s={style:{color:R(this,Nn,Ste),fontSize:R(this,Nn,bI)?`calc(${R(this,Nn,bI)}px * var(--scale-factor))`:""}};for(const i of e.split(`
|
||
`))n.push({name:"span",value:i,attributes:s});return r},Ete=function(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key==="Enter"||e.key==="Escape"&&R(this,Bc))&&z(this,Nn,RC).call(this)},Ate=function(){if(R(this,Uc)!==null)return;const{page:{view:e},viewport:{rawDims:{pageWidth:n,pageHeight:r,pageX:s,pageY:i}}}=R(this,bw);let o=!!R(this,mv),a=o?R(this,mv):R(this,xw);for(const h of R(this,yw))if(!a||Je.intersect(h.data.rect,a)!==null){a=h.data.rect,o=!0;break}const c=Je.normalizeRect([a[0],e[3]-a[1]+e[1],a[2],e[3]-a[3]+e[1]]),f=o?a[2]-a[0]+5:0,l=c[0]+f,d=c[1];$(this,Uc,[100*(l-s)/n,100*(d-i)/r]);const{style:p}=R(this,fr);p.left=`${R(this,Uc)[0]}%`,p.top=`${R(this,Uc)[1]}%`},RC=function(){$(this,Bc,!R(this,Bc)),R(this,Bc)?(z(this,Nn,NC).call(this),R(this,fr).addEventListener("click",R(this,pv)),R(this,fr).addEventListener("keydown",R(this,hv))):(z(this,Nn,xI).call(this),R(this,fr).removeEventListener("click",R(this,pv)),R(this,fr).removeEventListener("keydown",R(this,hv)))},NC=function(){R(this,Ta)||this.render(),this.isVisible?R(this,Bc)&&R(this,fr).classList.add("focused"):(z(this,Nn,Ate).call(this),R(this,fr).hidden=!1,R(this,fr).style.zIndex=parseInt(R(this,fr).style.zIndex)+1e3)},xI=function(){R(this,fr).classList.remove("focused"),!(R(this,Bc)||!this.isVisible)&&(R(this,fr).hidden=!0,R(this,fr).style.zIndex=parseInt(R(this,fr).style.zIndex)-1e3)};class Rte extends Sr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=Gt.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 _w;class TFe extends Sr{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0});B(this,_w,null)}render(){this.container.classList.add("lineAnnotation");const n=this.data,{width:r,height:s}=cu(n.rect),i=this.svgFactory.create(r,s,!0),o=$(this,_w,this.svgFactory.createElement("svg:line"));return o.setAttribute("x1",n.rect[2]-n.lineCoordinates[0]),o.setAttribute("y1",n.rect[3]-n.lineCoordinates[1]),o.setAttribute("x2",n.rect[2]-n.lineCoordinates[2]),o.setAttribute("y2",n.rect[3]-n.lineCoordinates[3]),o.setAttribute("stroke-width",n.borderStyle.width||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 R(this,_w)}addHighlightArea(){this.container.classList.add("highlightArea")}}_w=new WeakMap;var Sw;class kFe extends Sr{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0});B(this,Sw,null)}render(){this.container.classList.add("squareAnnotation");const n=this.data,{width:r,height:s}=cu(n.rect),i=this.svgFactory.create(r,s,!0),o=n.borderStyle.width,a=$(this,Sw,this.svgFactory.createElement("svg:rect"));return a.setAttribute("x",o/2),a.setAttribute("y",o/2),a.setAttribute("width",r-o),a.setAttribute("height",s-o),a.setAttribute("stroke-width",o||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 R(this,Sw)}addHighlightArea(){this.container.classList.add("highlightArea")}}Sw=new WeakMap;var Cw;class DFe extends Sr{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0});B(this,Cw,null)}render(){this.container.classList.add("circleAnnotation");const n=this.data,{width:r,height:s}=cu(n.rect),i=this.svgFactory.create(r,s,!0),o=n.borderStyle.width,a=$(this,Cw,this.svgFactory.createElement("svg:ellipse"));return a.setAttribute("cx",r/2),a.setAttribute("cy",s/2),a.setAttribute("rx",r/2-o/2),a.setAttribute("ry",s/2-o/2),a.setAttribute("stroke-width",o||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 R(this,Cw)}addHighlightArea(){this.container.classList.add("highlightArea")}}Cw=new WeakMap;var Ew;class Nte extends Sr{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0});B(this,Ew,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:o,height:a}=cu(n),c=this.svgFactory.create(o,a,!0);let u=[];for(let l=0,d=r.length;l<d;l+=2){const p=r[l]-n[0],h=n[3]-r[l+1];u.push(`${p},${h}`)}u=u.join(" ");const f=$(this,Ew,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 R(this,Ew)}addHighlightArea(){this.container.classList.add("highlightArea")}}Ew=new WeakMap;class MFe extends Nte{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class OFe extends Sr{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 Aw;class Pte extends Sr{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0});B(this,Aw,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=Gt.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:n,inkLists:r,borderStyle:s,popupRef:i}}=this,{width:o,height:a}=cu(n),c=this.svgFactory.create(o,a,!0);for(const u of r){let f=[];for(let d=0,p=u.length;d<p;d+=2){const h=u[d]-n[0],m=n[3]-u[d+1];f.push(`${h},${m}`)}f=f.join(" ");const l=this.svgFactory.createElement(this.svgElementName);R(this,Aw).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 R(this,Aw)}addHighlightArea(){this.container.classList.add("highlightArea")}}Aw=new WeakMap;class IFe extends Sr{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 jFe extends Sr{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 LFe extends Sr{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 $Fe extends Sr{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 Tte extends Sr{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 Rw,Nw,wI;class FFe extends Sr{constructor(n){var s;super(n,{isRenderable:!0});B(this,Nw);B(this,Rw,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",z(this,Nw,wI).bind(this)),$(this,Rw,s);const{isMac:i}=Ii.platform;return n.addEventListener("keydown",o=>{o.key==="Enter"&&(i?o.metaKey:o.ctrlKey)&&z(this,Nw,wI).call(this)}),!r.popupRef&&this.hasPopupData?this._createPopup():s.classList.add("popupTriggerArea"),n.append(s),n}getElementsToTriggerPopup(){return R(this,Rw)}addHighlightArea(){this.container.classList.add("highlightArea")}}Rw=new WeakMap,Nw=new WeakSet,wI=function(){var n;(n=this.downloadManager)==null||n.openOrDownloadData(this.content,this.filename)};var Pw,qh,gv,Ip,kte,_I,g6;let zFe=(g6=class{constructor({div:e,accessibilityManager:n,annotationCanvasMap:r,annotationEditorUIManager:s,page:i,viewport:o}){B(this,Ip);B(this,Pw,null);B(this,qh,null);B(this,gv,new Map);this.div=e,$(this,Pw,n),$(this,qh,r),this.page=i,this.viewport=o,this.zIndex=0,this._annotationEditorUIManager=s}async render(e){var o;const{annotations:n}=e,r=this.div;Tp(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 Q$,annotationStorage:e.annotationStorage||new nF,enableScripting:e.enableScripting===!0,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(const a of n){if(a.noHTML)continue;const c=a.annotationType===jr.POPUP;if(c){const l=s.get(a.id);if(!l)continue;i.elements=l}else{const{width:l,height:d}=cu(a.rect);if(l<=0||d<=0)continue}i.data=a;const u=_Fe.create(i);if(!u.isRenderable)continue;if(!c&&a.popupRef){const l=s.get(a.popupRef);l?l.push(u):s.set(a.popupRef,[u])}const f=u.render();a.hidden&&(f.style.visibility="hidden"),z(this,Ip,kte).call(this,f,a.id),u.annotationEditorType>0&&(R(this,gv).set(u.data.id,u),(o=this._annotationEditorUIManager)==null||o.renderAnnotationElement(u))}z(this,Ip,_I).call(this)}update({viewport:e}){const n=this.div;this.viewport=e,Tp(n,{rotation:e.rotation}),z(this,Ip,_I).call(this),n.hidden=!1}getEditableAnnotations(){return Array.from(R(this,gv).values())}getEditableAnnotation(e){return R(this,gv).get(e)}},Pw=new WeakMap,qh=new WeakMap,gv=new WeakMap,Ip=new WeakSet,kte=function(e,n){var s;const r=e.firstChild||e;r.id=`${See}${n}`,this.div.append(e),(s=R(this,Pw))==null||s.moveElementInDOM(this.div,e,r,!1)},_I=function(){if(!R(this,qh))return;const e=this.div;for(const[n,r]of R(this,qh)){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)}R(this,qh).clear()},g6);const U1=/\r\n?|\n/g;var Tw,kw,Dw,Mw,Ow,ka,co,Iw,uo,vv,Tr,Dte,Mte,Ote,PC,fu,TC,kC,Ite,CI,jte;const $n=class $n extends yn{constructor(n){super({...n,name:"freeTextEditor"});B(this,Tr);B(this,Tw,this.editorDivBlur.bind(this));B(this,kw,this.editorDivFocus.bind(this));B(this,Dw,this.editorDivInput.bind(this));B(this,Mw,this.editorDivKeydown.bind(this));B(this,Ow,this.editorDivPaste.bind(this));B(this,ka);B(this,co,"");B(this,Iw,`${this.id}-editor`);B(this,uo);B(this,vv,null);$(this,ka,n.color||$n._defaultColor||yn._defaultLineColor),$(this,uo,n.fontSize||$n._defaultFontSize)}static get _keyboardManager(){const n=$n.prototype,r=o=>o.isEmpty(),s=kp.TRANSLATE_SMALL,i=kp.TRANSLATE_BIG;return Yt(this,"_keyboardManager",new Y_([[["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){yn.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 vt.FREETEXT_SIZE:$n._defaultFontSize=r;break;case vt.FREETEXT_COLOR:$n._defaultColor=r;break}}updateParams(n,r){switch(n){case vt.FREETEXT_SIZE:z(this,Tr,Dte).call(this,r);break;case vt.FREETEXT_COLOR:z(this,Tr,Mte).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[vt.FREETEXT_SIZE,$n._defaultFontSize],[vt.FREETEXT_COLOR,$n._defaultColor||yn._defaultLineColor]]}get propertiesToUpdate(){return[[vt.FREETEXT_SIZE,R(this,uo)],[vt.FREETEXT_COLOR,R(this,ka)]]}_translateEmpty(n,r){this._uiManager.translateSelectedEditors(n,r,!0)}getInitialTranslation(){const n=this.parentScale;return[-$n._internalPadding*n,-($n._internalPadding+R(this,uo))*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(Gt.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",R(this,Mw),{signal:n}),this.editorDiv.addEventListener("focus",R(this,kw),{signal:n}),this.editorDiv.addEventListener("blur",R(this,Tw),{signal:n}),this.editorDiv.addEventListener("input",R(this,Dw),{signal:n}),this.editorDiv.addEventListener("paste",R(this,Ow),{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",R(this,Iw)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",R(this,Mw)),this.editorDiv.removeEventListener("focus",R(this,kw)),this.editorDiv.removeEventListener("blur",R(this,Tw)),this.editorDiv.removeEventListener("input",R(this,Dw)),this.editorDiv.removeEventListener("paste",R(this,Ow)),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=R(this,co),r=$(this,co,z(this,Tr,Ote).call(this).trimEnd());if(n===r)return;const s=i=>{if($(this,co,i),!i){this.remove();return}z(this,Tr,kC).call(this),this._uiManager.rebuild(this),z(this,Tr,PC).call(this)};this.addCommands({cmd:()=>{s(r)},undo:()=>{s(n)},mustExec:!1}),z(this,Tr,PC).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){$n._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",R(this,Iw)),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text"),this.enableEditing(),yn._l10nPromise.get("pdfjs-free-text-default-content").then(i=>{var o;return(o=this.editorDiv)==null?void 0:o.setAttribute("default-content",i)}),this.editorDiv.contentEditable=!0;const{style:s}=this.editorDiv;if(s.fontSize=`calc(${R(this,uo)}px * var(--scale-factor))`,s.color=R(this,ka),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),iA(this,this.div,["dblclick","keydown"]),this.width){const[i,o]=this.parentDimensions;if(this.annotationElementId){const{position:a}=R(this,vv);let[c,u]=this.getInitialTranslation();[c,u]=this.pageTranslationToScreen(c,u);const[f,l]=this.pageDimensions,[d,p]=this.pageTranslation;let h,m;switch(this.rotation){case 0:h=n+(a[0]-d)/f,m=r+this.height-(a[1]-p)/l;break;case 90:h=n+(a[0]-d)/f,m=r-(a[1]-p)/l,[c,u]=[u,-c];break;case 180:h=n-this.width+(a[0]-d)/f,m=r-(a[1]-p)/l,[c,u]=[-c,-u];break;case 270:h=n+(a[0]-d-this.height*l)/f,m=r+(a[1]-p-this.width*f)/l,[c,u]=[-u,c];break}this.setAt(h*i,m*o,c,u)}else this.setAt(n*i,r*o,this.width*i,this.height*o);z(this,Tr,kC).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(n){var h,m,y;const r=n.clipboardData||window.clipboardData,{types:s}=r;if(s.length===1&&s[0]==="text/plain")return;n.preventDefault();const i=z(h=$n,fu,CI).call(h,r.getData("text")||"").replaceAll(U1,`
|
||
`);if(!i)return;const o=window.getSelection();if(!o.rangeCount)return;this.editorDiv.normalize(),o.deleteFromDocument();const a=o.getRangeAt(0);if(!i.includes(`
|
||
`)){a.insertNode(document.createTextNode(i)),this.editorDiv.normalize(),o.collapseToStart();return}const{startContainer:c,startOffset:u}=a,f=[],l=[];if(c.nodeType===Node.TEXT_NODE){const g=c.parentElement;if(l.push(c.nodeValue.slice(u).replaceAll(U1,"")),g!==this.editorDiv){let v=f;for(const x of this.editorDiv.childNodes){if(x===g){v=l;continue}v.push(z(m=$n,fu,TC).call(m,x))}}f.push(c.nodeValue.slice(0,u).replaceAll(U1,""))}else if(c===this.editorDiv){let g=f,v=0;for(const x of this.editorDiv.childNodes)v++===u&&(g=l),g.push(z(y=$n,fu,TC).call(y,x))}$(this,co,`${f.join(`
|
||
`)}${i}${l.join(`
|
||
`)}`),z(this,Tr,kC).call(this);const d=new Range;let p=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(p<=v){d.setStart(g,p),d.setEnd(g,p);break}p-=v}o.removeAllRanges(),o.addRange(d)}get contentDiv(){return this.editorDiv}static deserialize(n,r,s){var a;let i=null;if(n instanceof Rte){const{data:{defaultAppearanceData:{fontSize:c,fontColor:u},rect:f,rotation:l,id:d},textContent:p,textPosition:h,parent:{page:{pageNumber:m}}}=n;if(!p||p.length===0)return null;i=n={annotationType:Gt.FREETEXT,color:Array.from(u),fontSize:c,value:p.join(`
|
||
`),position:h,pageIndex:m-1,rect:f.slice(0),rotation:l,id:d,deleted:!1}}const o=super.deserialize(n,r,s);return $(o,uo,n.fontSize),$(o,ka,Je.makeHexColor(...n.color)),$(o,co,z(a=$n,fu,CI).call(a,n.value)),o.annotationElementId=n.id||null,$(o,vv,i),o}serialize(n=!1){if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const r=$n._internalPadding*this.parentScale,s=this.getRect(r,r),i=yn._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:R(this,ka)),o={annotationType:Gt.FREETEXT,color:i,fontSize:R(this,uo),value:z(this,Tr,Ite).call(this),pageIndex:this.pageIndex,rect:s,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return n?o:this.annotationElementId&&!z(this,Tr,jte).call(this,o)?null:(o.id=this.annotationElementId,o)}renderAnnotationElement(n){const r=super.renderAnnotationElement(n);if(this.deleted)return r;const{style:s}=r;s.fontSize=`calc(${R(this,uo)}px * var(--scale-factor))`,s.color=R(this,ka),r.replaceChildren();for(const o of R(this,co).split(`
|
||
`)){const a=document.createElement("div");a.append(o?document.createTextNode(o):document.createElement("br")),r.append(a)}const i=$n._internalPadding*this.parentScale;return n.updateEdited({rect:this.getRect(i,i),popupContent:R(this,co)}),r}resetAnnotationElement(n){super.resetAnnotationElement(n),n.resetEdited()}};Tw=new WeakMap,kw=new WeakMap,Dw=new WeakMap,Mw=new WeakMap,Ow=new WeakMap,ka=new WeakMap,co=new WeakMap,Iw=new WeakMap,uo=new WeakMap,vv=new WeakMap,Tr=new WeakSet,Dte=function(n){const r=i=>{this.editorDiv.style.fontSize=`calc(${i}px * var(--scale-factor))`,this.translate(0,-(i-R(this,uo))*this.parentScale),$(this,uo,i),z(this,Tr,PC).call(this)},s=R(this,uo);this.addCommands({cmd:r.bind(this,n),undo:r.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:vt.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},Mte=function(n){const r=i=>{$(this,ka,this.editorDiv.style.color=i)},s=R(this,ka);this.addCommands({cmd:r.bind(this,n),undo:r.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:vt.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},Ote=function(){var r;const n=[];this.editorDiv.normalize();for(const s of this.editorDiv.childNodes)n.push(z(r=$n,fu,TC).call(r,s));return n.join(`
|
||
`)},PC=function(){const[n,r]=this.parentDimensions;let s;if(this.isAttachedToDOM)s=this.div.getBoundingClientRect();else{const{currentLayer:i,div:o}=this,a=o.style.display,c=o.classList.contains("hidden");o.classList.remove("hidden"),o.style.display="hidden",i.div.append(this.div),s=o.getBoundingClientRect(),o.remove(),o.style.display=a,o.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()},fu=new WeakSet,TC=function(n){return(n.nodeType===Node.TEXT_NODE?n.nodeValue:n.innerText).replaceAll(U1,"")},kC=function(){if(this.editorDiv.replaceChildren(),!!R(this,co))for(const n of R(this,co).split(`
|
||
`)){const r=document.createElement("div");r.append(n?document.createTextNode(n):document.createElement("br")),this.editorDiv.append(r)}},Ite=function(){return R(this,co).replaceAll(" "," ")},CI=function(n){return n.replaceAll(" "," ")},jte=function(n){const{value:r,fontSize:s,color:i,pageIndex:o}=R(this,vv);return this._hasBeenMoved||n.value!==r||n.fontSize!==s||n.color.some((a,c)=>a!==i[c])||n.pageIndex!==o},B($n,fu),Te($n,"_freeTextDefaultContent",""),Te($n,"_internalPadding",0),Te($n,"_defaultColor",null),Te($n,"_defaultFontSize",10),Te($n,"_type","freetext"),Te($n,"_editorType",Gt.FREETEXT);let SI=$n;var jw,Pd,Da,ai,Lte,DC,$te,Fte,AI;class EI{constructor(e,n=0,r=0,s=!0){B(this,ai);B(this,jw);B(this,Pd,[]);B(this,Da,[]);let i=1/0,o=-1/0,a=1/0,c=-1/0;const f=10**-4;for(const{x:g,y:v,width:x,height:_}of e){const A=Math.floor((g-n)/f)*f,N=Math.ceil((g+x+n)/f)*f,T=Math.floor((v-n)/f)*f,E=Math.ceil((v+_+n)/f)*f,P=[A,T,E,!0],k=[N,T,E,!1];R(this,Pd).push(P,k),i=Math.min(i,A),o=Math.max(o,N),a=Math.min(a,T),c=Math.max(c,E)}const l=o-i+2*r,d=c-a+2*r,p=i-r,h=a-r,m=R(this,Pd).at(s?-1:-2),y=[m[0],m[2]];for(const g of R(this,Pd)){const[v,x,_]=g;g[0]=(v-p)/l,g[1]=(x-h)/d,g[2]=(_-h)/d}$(this,jw,{x:p,y:h,width:l,height:d,lastPoint:y})}getOutlines(){R(this,Pd).sort((n,r)=>n[0]-r[0]||n[1]-r[1]||n[2]-r[2]);const e=[];for(const n of R(this,Pd))n[3]?(e.push(...z(this,ai,AI).call(this,n)),z(this,ai,$te).call(this,n)):(z(this,ai,Fte).call(this,n),e.push(...z(this,ai,AI).call(this,n)));return z(this,ai,Lte).call(this,e)}}jw=new WeakMap,Pd=new WeakMap,Da=new WeakMap,ai=new WeakSet,Lte=function(e){const n=[],r=new Set;for(const o of e){const[a,c,u]=o;n.push([a,c,o],[a,u,o])}n.sort((o,a)=>o[1]-a[1]||o[0]-a[0]);for(let o=0,a=n.length;o<a;o+=2){const c=n[o][2],u=n[o+1][2];c.push(u),u.push(c),r.add(c),r.add(u)}const s=[];let i;for(;r.size>0;){const o=r.values().next().value;let[a,c,u,f,l]=o;r.delete(o);let d=a,p=c;for(i=[a,u],s.push(i);;){let h;if(r.has(f))h=f;else if(r.has(l))h=l;else break;r.delete(h),[a,c,u,f,l]=h,d!==a&&(i.push(d,p,a,p===c?c:u),d=a),p=p===c?u:c}i.push(d,p)}return new BFe(s,R(this,jw))},DC=function(e){const n=R(this,Da);let r=0,s=n.length-1;for(;r<=s;){const i=r+s>>1,o=n[i][0];if(o===e)return i;o<e?r=i+1:s=i-1}return s+1},$te=function([,e,n]){const r=z(this,ai,DC).call(this,e);R(this,Da).splice(r,0,[e,n])},Fte=function([,e,n]){const r=z(this,ai,DC).call(this,e);for(let s=r;s<R(this,Da).length;s++){const[i,o]=R(this,Da)[s];if(i!==e)break;if(i===e&&o===n){R(this,Da).splice(s,1);return}}for(let s=r-1;s>=0;s--){const[i,o]=R(this,Da)[s];if(i!==e)break;if(i===e&&o===n){R(this,Da).splice(s,1);return}}},AI=function(e){const[n,r,s]=e,i=[[n,r,s]],o=z(this,ai,DC).call(this,s);for(let a=0;a<o;a++){const[c,u]=R(this,Da)[a];for(let f=0,l=i.length;f<l;f++){const[,d,p]=i[f];if(!(u<=d||p<=c)){if(d>=c){if(p>u)i[f][1]=u;else{if(l===1)return[];i.splice(f,1),f--,l--}continue}i[f][2]=c,p>u&&i.push([n,u,p])}}}return i};class zte{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 NI}}var Lw,yv;class BFe extends zte{constructor(n,r){super();B(this,Lw);B(this,yv);$(this,yv,n),$(this,Lw,r)}toSVGPath(){const n=[];for(const r of R(this,yv)){let[s,i]=r;n.push(`M${s} ${i}`);for(let o=2;o<r.length;o+=2){const a=r[o],c=r[o+1];a===s?(n.push(`V${c}`),i=c):c===i&&(n.push(`H${a}`),s=a)}n.push("Z")}return n.join(" ")}serialize([n,r,s,i],o){const a=[],c=s-n,u=i-r;for(const f of R(this,yv)){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;a.push(l)}return a}get box(){return R(this,Lw)}}Lw=new WeakMap,yv=new WeakMap;var Sl,Vc,bv,xv,Cl,Vt,Wh,Gh,$w,Fw,wv,_v,Td,zw,DA,MA,Bw,RI;const Cc=class Cc{constructor({x:e,y:n},r,s,i,o,a=0){B(this,Bw);B(this,Sl);B(this,Vc,[]);B(this,bv);B(this,xv);B(this,Cl,[]);B(this,Vt,new Float64Array(18));B(this,Wh);B(this,Gh);B(this,$w);B(this,Fw);B(this,wv);B(this,_v);B(this,Td,[]);$(this,Sl,r),$(this,_v,i*s),$(this,xv,o),R(this,Vt).set([NaN,NaN,NaN,NaN,e,n],6),$(this,bv,a),$(this,Fw,R(Cc,zw)*s),$(this,$w,R(Cc,MA)*s),$(this,wv,s),R(this,Td).push(e,n)}get free(){return!0}isEmpty(){return isNaN(R(this,Vt)[8])}add({x:e,y:n}){var P;$(this,Wh,e),$(this,Gh,n);const[r,s,i,o]=R(this,Sl);let[a,c,u,f]=R(this,Vt).subarray(8,12);const l=e-u,d=n-f,p=Math.hypot(l,d);if(p<R(this,$w))return!1;const h=p-R(this,Fw),m=h/p,y=m*l,g=m*d;let v=a,x=c;a=u,c=f,u+=y,f+=g,(P=R(this,Td))==null||P.push(e,n);const _=-g/h,A=y/h,N=_*R(this,_v),T=A*R(this,_v);return R(this,Vt).set(R(this,Vt).subarray(2,8),0),R(this,Vt).set([u+N,f+T],4),R(this,Vt).set(R(this,Vt).subarray(14,18),12),R(this,Vt).set([u-N,f-T],16),isNaN(R(this,Vt)[6])?(R(this,Cl).length===0&&(R(this,Vt).set([a+N,c+T],2),R(this,Cl).push(NaN,NaN,NaN,NaN,(a+N-r)/i,(c+T-s)/o),R(this,Vt).set([a-N,c-T],14),R(this,Vc).push(NaN,NaN,NaN,NaN,(a-N-r)/i,(c-T-s)/o)),R(this,Vt).set([v,x,a,c,u,f],6),!this.isEmpty()):(R(this,Vt).set([v,x,a,c,u,f],6),Math.abs(Math.atan2(x-c,v-a)-Math.atan2(g,y))<Math.PI/2?([a,c,u,f]=R(this,Vt).subarray(2,6),R(this,Cl).push(NaN,NaN,NaN,NaN,((a+u)/2-r)/i,((c+f)/2-s)/o),[a,c,v,x]=R(this,Vt).subarray(14,18),R(this,Vc).push(NaN,NaN,NaN,NaN,((v+a)/2-r)/i,((x+c)/2-s)/o),!0):([v,x,a,c,u,f]=R(this,Vt).subarray(0,6),R(this,Cl).push(((v+5*a)/6-r)/i,((x+5*c)/6-s)/o,((5*a+u)/6-r)/i,((5*c+f)/6-s)/o,((a+u)/2-r)/i,((c+f)/2-s)/o),[u,f,a,c,v,x]=R(this,Vt).subarray(12,18),R(this,Vc).push(((v+5*a)/6-r)/i,((x+5*c)/6-s)/o,((5*a+u)/6-r)/i,((5*c+f)/6-s)/o,((a+u)/2-r)/i,((c+f)/2-s)/o),!0))}toSVGPath(){if(this.isEmpty())return"";const e=R(this,Cl),n=R(this,Vc),r=R(this,Vt).subarray(4,6),s=R(this,Vt).subarray(16,18),[i,o,a,c]=R(this,Sl),[u,f,l,d]=z(this,Bw,RI).call(this);if(isNaN(R(this,Vt)[6])&&!this.isEmpty())return`M${(R(this,Vt)[2]-i)/a} ${(R(this,Vt)[3]-o)/c} L${(R(this,Vt)[4]-i)/a} ${(R(this,Vt)[5]-o)/c} L${u} ${f} L${l} ${d} L${(R(this,Vt)[16]-i)/a} ${(R(this,Vt)[17]-o)/c} L${(R(this,Vt)[14]-i)/a} ${(R(this,Vt)[15]-o)/c} Z`;const p=[];p.push(`M${e[4]} ${e[5]}`);for(let h=6;h<e.length;h+=6)isNaN(e[h])?p.push(`L${e[h+4]} ${e[h+5]}`):p.push(`C${e[h]} ${e[h+1]} ${e[h+2]} ${e[h+3]} ${e[h+4]} ${e[h+5]}`);p.push(`L${(r[0]-i)/a} ${(r[1]-o)/c} L${u} ${f} L${l} ${d} L${(s[0]-i)/a} ${(s[1]-o)/c}`);for(let h=n.length-6;h>=6;h-=6)isNaN(n[h])?p.push(`L${n[h+4]} ${n[h+5]}`):p.push(`C${n[h]} ${n[h+1]} ${n[h+2]} ${n[h+3]} ${n[h+4]} ${n[h+5]}`);return p.push(`L${n[4]} ${n[5]} Z`),p.join(" ")}getOutlines(){var g;const e=R(this,Cl),n=R(this,Vc),r=R(this,Vt),s=r.subarray(4,6),i=r.subarray(16,18),[o,a,c,u]=R(this,Sl),f=new Float64Array((((g=R(this,Td))==null?void 0:g.length)??0)+2);for(let v=0,x=f.length-2;v<x;v+=2)f[v]=(R(this,Td)[v]-o)/c,f[v+1]=(R(this,Td)[v+1]-a)/u;f[f.length-2]=(R(this,Wh)-o)/c,f[f.length-1]=(R(this,Gh)-a)/u;const[l,d,p,h]=z(this,Bw,RI).call(this);if(isNaN(r[6])&&!this.isEmpty()){const v=new Float64Array(36);return v.set([NaN,NaN,NaN,NaN,(r[2]-o)/c,(r[3]-a)/u,NaN,NaN,NaN,NaN,(r[4]-o)/c,(r[5]-a)/u,NaN,NaN,NaN,NaN,l,d,NaN,NaN,NaN,NaN,p,h,NaN,NaN,NaN,NaN,(r[16]-o)/c,(r[17]-a)/u,NaN,NaN,NaN,NaN,(r[14]-o)/c,(r[15]-a)/u],0),new NI(v,f,R(this,Sl),R(this,wv),R(this,bv),R(this,xv))}const m=new Float64Array(R(this,Cl).length+24+R(this,Vc).length);let y=e.length;for(let v=0;v<y;v+=2){if(isNaN(e[v])){m[v]=m[v+1]=NaN;continue}m[v]=e[v],m[v+1]=e[v+1]}m.set([NaN,NaN,NaN,NaN,(s[0]-o)/c,(s[1]-a)/u,NaN,NaN,NaN,NaN,l,d,NaN,NaN,NaN,NaN,p,h,NaN,NaN,NaN,NaN,(i[0]-o)/c,(i[1]-a)/u],y),y+=24;for(let v=n.length-6;v>=6;v-=6)for(let x=0;x<6;x+=2){if(isNaN(n[v+x])){m[y]=m[y+1]=NaN,y+=2;continue}m[y]=n[v+x],m[y+1]=n[v+x+1],y+=2}return m.set([NaN,NaN,NaN,NaN,n[4],n[5]],y),new NI(m,f,R(this,Sl),R(this,wv),R(this,bv),R(this,xv))}};Sl=new WeakMap,Vc=new WeakMap,bv=new WeakMap,xv=new WeakMap,Cl=new WeakMap,Vt=new WeakMap,Wh=new WeakMap,Gh=new WeakMap,$w=new WeakMap,Fw=new WeakMap,wv=new WeakMap,_v=new WeakMap,Td=new WeakMap,zw=new WeakMap,DA=new WeakMap,MA=new WeakMap,Bw=new WeakSet,RI=function(){const e=R(this,Vt).subarray(4,6),n=R(this,Vt).subarray(16,18),[r,s,i,o]=R(this,Sl);return[(R(this,Wh)+(e[0]-n[0])/2-r)/i,(R(this,Gh)+(e[1]-n[1])/2-s)/o,(R(this,Wh)+(n[0]-e[0])/2-r)/i,(R(this,Gh)+(n[1]-e[1])/2-s)/o]},B(Cc,zw,8),B(Cc,DA,2),B(Cc,MA,R(Cc,zw)+R(Cc,DA));let cA=Cc;var Sv,Kh,qc,Uw,fo,Hw,br,ji,n0,r0,Bte;class NI extends zte{constructor(n,r,s,i,o,a){super();B(this,ji);B(this,Sv);B(this,Kh,null);B(this,qc);B(this,Uw);B(this,fo);B(this,Hw);B(this,br);$(this,br,n),$(this,fo,r),$(this,Sv,s),$(this,Hw,i),$(this,qc,o),$(this,Uw,a),z(this,ji,Bte).call(this,a);const{x:c,y:u,width:f,height:l}=R(this,Kh);for(let d=0,p=n.length;d<p;d+=2)n[d]=(n[d]-c)/f,n[d+1]=(n[d+1]-u)/l;for(let d=0,p=r.length;d<p;d+=2)r[d]=(r[d]-c)/f,r[d+1]=(r[d+1]-u)/l}toSVGPath(){const n=[`M${R(this,br)[4]} ${R(this,br)[5]}`];for(let r=6,s=R(this,br).length;r<s;r+=6){if(isNaN(R(this,br)[r])){n.push(`L${R(this,br)[r+4]} ${R(this,br)[r+5]}`);continue}n.push(`C${R(this,br)[r]} ${R(this,br)[r+1]} ${R(this,br)[r+2]} ${R(this,br)[r+3]} ${R(this,br)[r+4]} ${R(this,br)[r+5]}`)}return n.push("Z"),n.join(" ")}serialize([n,r,s,i],o){const a=s-n,c=i-r;let u,f;switch(o){case 0:u=z(this,ji,n0).call(this,R(this,br),n,i,a,-c),f=z(this,ji,n0).call(this,R(this,fo),n,i,a,-c);break;case 90:u=z(this,ji,r0).call(this,R(this,br),n,r,a,c),f=z(this,ji,r0).call(this,R(this,fo),n,r,a,c);break;case 180:u=z(this,ji,n0).call(this,R(this,br),s,r,-a,c),f=z(this,ji,n0).call(this,R(this,fo),s,r,-a,c);break;case 270:u=z(this,ji,r0).call(this,R(this,br),s,i,-a,-c),f=z(this,ji,r0).call(this,R(this,fo),s,i,-a,-c);break}return{outline:Array.from(u),points:[Array.from(f)]}}get box(){return R(this,Kh)}getNewOutline(n,r){const{x:s,y:i,width:o,height:a}=R(this,Kh),[c,u,f,l]=R(this,Sv),d=o*f,p=a*l,h=s*f+c,m=i*l+u,y=new cA({x:R(this,fo)[0]*d+h,y:R(this,fo)[1]*p+m},R(this,Sv),R(this,Hw),n,R(this,Uw),r??R(this,qc));for(let g=2;g<R(this,fo).length;g+=2)y.add({x:R(this,fo)[g]*d+h,y:R(this,fo)[g+1]*p+m});return y.getOutlines()}}Sv=new WeakMap,Kh=new WeakMap,qc=new WeakMap,Uw=new WeakMap,fo=new WeakMap,Hw=new WeakMap,br=new WeakMap,ji=new WeakSet,n0=function(n,r,s,i,o){const a=new Float64Array(n.length);for(let c=0,u=n.length;c<u;c+=2)a[c]=r+n[c]*i,a[c+1]=s+n[c+1]*o;return a},r0=function(n,r,s,i,o){const a=new Float64Array(n.length);for(let c=0,u=n.length;c<u;c+=2)a[c]=r+n[c+1]*i,a[c+1]=s+n[c]*o;return a},Bte=function(n){const r=R(this,br);let s=r[4],i=r[5],o=s,a=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]))o=Math.min(o,r[g+4]),a=Math.min(a,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 x=Je.bezierBoundingBox(s,i,...r.slice(g,g+6));o=Math.min(o,x[0]),a=Math.min(a,x[1]),c=Math.max(c,x[2]),u=Math.max(u,x[3]),l<x[3]?(f=x[2],l=x[3]):l===x[3]&&(f=d(f,x[2]))}s=r[g+4],i=r[g+5]}const p=o-R(this,qc),h=a-R(this,qc),m=c-o+2*R(this,qc),y=u-a+2*R(this,qc);$(this,Kh,{x:p,y:h,width:m,height:y,lastPoint:[f,l]})};var Vw,qw,Ma,Yh,Cv,$r,Ww,Ev,Gw,Kw,Oa,Av,On,PI,TI,Ute,qf,Hte,Zu;const Ec=class Ec{constructor({editor:e=null,uiManager:n=null}){B(this,On);B(this,Vw,z(this,On,Ute).bind(this));B(this,qw,z(this,On,Hte).bind(this));B(this,Ma,null);B(this,Yh,null);B(this,Cv);B(this,$r,null);B(this,Ww,!1);B(this,Ev,!1);B(this,Gw,null);B(this,Kw);B(this,Oa,null);B(this,Av);var r;e?($(this,Ev,!1),$(this,Av,vt.HIGHLIGHT_COLOR),$(this,Gw,e)):($(this,Ev,!0),$(this,Av,vt.HIGHLIGHT_DEFAULT_COLOR)),$(this,Oa,(e==null?void 0:e._uiManager)||n),$(this,Kw,R(this,Oa)._eventBus),$(this,Cv,(e==null?void 0:e.color)||((r=R(this,Oa))==null?void 0:r.highlightColors.values().next().value)||"#FFFF98")}static get _keyboardManager(){return Yt(this,"_keyboardManager",new Y_([[["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,Ma,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=R(this,Oa)._signal;e.addEventListener("click",z(this,On,qf).bind(this),{signal:n}),e.addEventListener("keydown",R(this,Vw),{signal:n});const r=$(this,Yh,document.createElement("span"));return r.className="swatch",r.setAttribute("aria-hidden",!0),r.style.backgroundColor=R(this,Cv),e.append(r),e}renderMainDropdown(){const e=$(this,$r,z(this,On,PI).call(this));return e.setAttribute("aria-orientation","horizontal"),e.setAttribute("aria-labelledby","highlightColorPickerLabel"),e}_colorSelectFromKeyboard(e){if(e.target===R(this,Ma)){z(this,On,qf).call(this,e);return}const n=e.target.getAttribute("data-color");n&&z(this,On,TI).call(this,n,e)}_moveToNext(e){var n,r;if(!R(this,On,Zu)){z(this,On,qf).call(this,e);return}if(e.target===R(this,Ma)){(n=R(this,$r).firstChild)==null||n.focus();return}(r=e.target.nextSibling)==null||r.focus()}_moveToPrevious(e){var n,r;if(e.target===((n=R(this,$r))==null?void 0:n.firstChild)||e.target===R(this,Ma)){R(this,On,Zu)&&this._hideDropdownFromKeyboard();return}R(this,On,Zu)||z(this,On,qf).call(this,e),(r=e.target.previousSibling)==null||r.focus()}_moveToBeginning(e){var n;if(!R(this,On,Zu)){z(this,On,qf).call(this,e);return}(n=R(this,$r).firstChild)==null||n.focus()}_moveToEnd(e){var n;if(!R(this,On,Zu)){z(this,On,qf).call(this,e);return}(n=R(this,$r).lastChild)==null||n.focus()}hideDropdown(){var e;(e=R(this,$r))==null||e.classList.add("hidden"),window.removeEventListener("pointerdown",R(this,qw))}_hideDropdownFromKeyboard(){var e;if(!R(this,Ev)){if(!R(this,On,Zu)){(e=R(this,Gw))==null||e.unselect();return}this.hideDropdown(),R(this,Ma).focus({preventScroll:!0,focusVisible:R(this,Ww)})}}updateColor(e){if(R(this,Yh)&&(R(this,Yh).style.backgroundColor=e),!R(this,$r))return;const n=R(this,Oa).highlightColors.values();for(const r of R(this,$r).children)r.setAttribute("aria-selected",n.next().value===e)}destroy(){var e,n;(e=R(this,Ma))==null||e.remove(),$(this,Ma,null),$(this,Yh,null),(n=R(this,$r))==null||n.remove(),$(this,$r,null)}};Vw=new WeakMap,qw=new WeakMap,Ma=new WeakMap,Yh=new WeakMap,Cv=new WeakMap,$r=new WeakMap,Ww=new WeakMap,Ev=new WeakMap,Gw=new WeakMap,Kw=new WeakMap,Oa=new WeakMap,Av=new WeakMap,On=new WeakSet,PI=function(){const e=document.createElement("div"),n=R(this,Oa)._signal;e.addEventListener("contextmenu",Bi,{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 R(this,Oa).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 o=document.createElement("span");i.append(o),o.className="swatch",o.style.backgroundColor=s,i.setAttribute("aria-selected",s===R(this,Cv)),i.addEventListener("click",z(this,On,TI).bind(this,s),{signal:n}),e.append(i)}return e.addEventListener("keydown",R(this,Vw),{signal:n}),e},TI=function(e,n){n.stopPropagation(),R(this,Kw).dispatch("switchannotationeditorparams",{source:this,type:R(this,Av),value:e})},Ute=function(e){Ec._keyboardManager.exec(this,e)},qf=function(e){if(R(this,On,Zu)){this.hideDropdown();return}if($(this,Ww,e.detail===0),window.addEventListener("pointerdown",R(this,qw),{signal:R(this,Oa)._signal}),R(this,$r)){R(this,$r).classList.remove("hidden");return}const n=$(this,$r,z(this,On,PI).call(this));R(this,Ma).append(n)},Hte=function(e){var n;(n=R(this,$r))!=null&&n.contains(e.target)||this.hideDropdown()},Zu=function(){return R(this,$r)&&!R(this,$r).classList.contains("hidden")};let uA=Ec;var Rv,Yw,kd,Xh,Nv,Vo,Xw,Qw,Qh,Ia,Xs,ho,OA,Pv,Zh,Fr,Tv,El,Zw,Ft,kI,DI,Vte,qte,Wte,MI,s0,ta,Fm,Gte,MC,i0,Kte,Yte,Xte,Qte;const rn=class rn extends yn{constructor(n){super({...n,name:"highlightEditor"});B(this,Ft);B(this,Rv,null);B(this,Yw,0);B(this,kd);B(this,Xh,null);B(this,Nv,null);B(this,Vo,null);B(this,Xw,null);B(this,Qw,0);B(this,Qh,null);B(this,Ia,null);B(this,Xs,null);B(this,ho,!1);B(this,OA,z(this,Ft,Gte).bind(this));B(this,Pv,null);B(this,Zh);B(this,Fr,null);B(this,Tv,"");B(this,El);B(this,Zw,"");this.color=n.color||rn._defaultColor,$(this,El,n.thickness||rn._defaultThickness),$(this,Zh,n.opacity||rn._defaultOpacity),$(this,kd,n.boxes||null),$(this,Zw,n.methodOfCreation||""),$(this,Tv,n.text||""),this._isDraggable=!1,n.highlightId>-1?($(this,ho,!0),z(this,Ft,DI).call(this,n),z(this,Ft,s0).call(this)):($(this,Rv,n.anchorNode),$(this,Yw,n.anchorOffset),$(this,Xw,n.focusNode),$(this,Qw,n.focusOffset),z(this,Ft,kI).call(this),z(this,Ft,s0).call(this),this.rotate(this.rotation))}static get _keyboardManager(){const n=rn.prototype;return Yt(this,"_keyboardManager",new Y_([[["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:R(this,ho)?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:R(this,El),methodOfCreation:R(this,Zw)}}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;yn.initialize(n,r),rn._defaultColor||(rn._defaultColor=((s=r.highlightColors)==null?void 0:s.values().next().value)||"#fff066")}static updateDefaultParams(n,r){switch(n){case vt.HIGHLIGHT_DEFAULT_COLOR:rn._defaultColor=r;break;case vt.HIGHLIGHT_THICKNESS:rn._defaultThickness=r;break}}translateInPage(n,r){}get toolbarPosition(){return R(this,Pv)}updateParams(n,r){switch(n){case vt.HIGHLIGHT_COLOR:z(this,Ft,Vte).call(this,r);break;case vt.HIGHLIGHT_THICKNESS:z(this,Ft,qte).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[vt.HIGHLIGHT_DEFAULT_COLOR,rn._defaultColor],[vt.HIGHLIGHT_THICKNESS,rn._defaultThickness]]}get propertiesToUpdate(){return[[vt.HIGHLIGHT_COLOR,this.color||rn._defaultColor],[vt.HIGHLIGHT_THICKNESS,R(this,El)||rn._defaultThickness],[vt.HIGHLIGHT_FREE,R(this,ho)]]}async addEditToolbar(){const n=await super.addEditToolbar();return n?(this._uiManager.highlightColors&&($(this,Nv,new uA({editor:this})),n.addColorPicker(R(this,Nv))),n):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(z(this,Ft,i0).call(this))}getBaseTranslation(){return[0,0]}getRect(n,r){return super.getRect(n,r,z(this,Ft,i0).call(this))}onceAdded(){this.parent.addUndoableEditor(this),this.div.focus()}remove(){z(this,Ft,MI).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(z(this,Ft,s0).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(n){var s;let r=!1;this.parent&&!n?z(this,Ft,MI).call(this):n&&(z(this,Ft,s0).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,o,a;const{drawLayer:r}=this.parent;let s;R(this,ho)?(n=(n-this.rotation+360)%360,s=z(i=rn,ta,Fm).call(i,R(this,Ia).box,n)):s=z(o=rn,ta,Fm).call(o,this,n),r.rotate(R(this,Xs),n),r.rotate(R(this,Fr),n),r.updateBox(R(this,Xs),s),r.updateBox(R(this,Fr),z(a=rn,ta,Fm).call(a,R(this,Vo).box,n))}render(){if(this.div)return this.div;const n=super.render();R(this,Tv)&&(n.setAttribute("aria-label",R(this,Tv)),n.setAttribute("role","mark")),R(this,ho)?n.classList.add("free"):this.div.addEventListener("keydown",R(this,OA),{signal:this._uiManager._signal});const r=$(this,Qh,document.createElement("div"));n.append(r),r.setAttribute("aria-hidden","true"),r.className="internal",r.style.clipPath=R(this,Xh);const[s,i]=this.parentDimensions;return this.setDims(this.width*s,this.height*i),iA(this,R(this,Qh),["pointerover","pointerleave"]),this.enableEditing(),n}pointerover(){this.parent.drawLayer.addClass(R(this,Fr),"hovered")}pointerleave(){this.parent.drawLayer.removeClass(R(this,Fr),"hovered")}_moveCaret(n){switch(this.parent.unselect(this),n){case 0:case 2:z(this,Ft,MC).call(this,!0);break;case 1:case 3:z(this,Ft,MC).call(this,!1);break}}select(){var n,r;super.select(),R(this,Fr)&&((n=this.parent)==null||n.drawLayer.removeClass(R(this,Fr),"hovered"),(r=this.parent)==null||r.drawLayer.addClass(R(this,Fr),"selected"))}unselect(){var n;super.unselect(),R(this,Fr)&&((n=this.parent)==null||n.drawLayer.removeClass(R(this,Fr),"selected"),R(this,ho)||z(this,Ft,MC).call(this,!1))}get _mustFixPosition(){return!R(this,ho)}show(n=this._isVisible){super.show(n),this.parent&&(this.parent.drawLayer.show(R(this,Xs),n),this.parent.drawLayer.show(R(this,Fr),n))}static startHighlighting(n,r,{target:s,x:i,y:o}){const{x:a,y:c,width:u,height:f}=s.getBoundingClientRect(),l=y=>{z(this,ta,Xte).call(this,n,y)},d=n._signal,p={capture:!0,passive:!1,signal:d},h=y=>{y.preventDefault(),y.stopPropagation()},m=y=>{s.removeEventListener("pointermove",l),window.removeEventListener("blur",m),window.removeEventListener("pointerup",m),window.removeEventListener("pointerdown",h,p),window.removeEventListener("contextmenu",Bi),z(this,ta,Qte).call(this,n,y)};window.addEventListener("blur",m,{signal:d}),window.addEventListener("pointerup",m,{signal:d}),window.addEventListener("pointerdown",h,p),window.addEventListener("contextmenu",Bi,{signal:d}),s.addEventListener("pointermove",l,{signal:d}),this._freeHighlight=new cA({x:i,y:o},[a,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 m;const i=super.deserialize(n,r,s),{rect:[o,a,c,u],color:f,quadPoints:l}=n;i.color=Je.makeHexColor(...f),$(i,Zh,n.opacity);const[d,p]=i.pageDimensions;i.width=(c-o)/d,i.height=(u-a)/p;const h=$(i,kd,[]);for(let y=0;y<l.length;y+=8)h.push({x:(l[4]-c)/d,y:(u-(1-l[y+5]))/p,width:(l[y+2]-l[y])/d,height:(l[y+5]-l[y+1])/p});return z(m=i,Ft,kI).call(m),i}serialize(n=!1){if(this.isEmpty()||n)return null;const r=this.getRect(0,0),s=yn._colorManager.convert(this.color);return{annotationType:Gt.HIGHLIGHT,color:s,opacity:R(this,Zh),thickness:R(this,El),quadPoints:z(this,Ft,Kte).call(this),outlines:z(this,Ft,Yte).call(this,r),pageIndex:this.pageIndex,rect:r,rotation:z(this,Ft,i0).call(this),structTreeParentId:this._structTreeParentId}}static canCreateNewEmptyEditor(){return!1}};Rv=new WeakMap,Yw=new WeakMap,kd=new WeakMap,Xh=new WeakMap,Nv=new WeakMap,Vo=new WeakMap,Xw=new WeakMap,Qw=new WeakMap,Qh=new WeakMap,Ia=new WeakMap,Xs=new WeakMap,ho=new WeakMap,OA=new WeakMap,Pv=new WeakMap,Zh=new WeakMap,Fr=new WeakMap,Tv=new WeakMap,El=new WeakMap,Zw=new WeakMap,Ft=new WeakSet,kI=function(){const n=new EI(R(this,kd),.001);$(this,Ia,n.getOutlines()),{x:this.x,y:this.y,width:this.width,height:this.height}=R(this,Ia).box;const r=new EI(R(this,kd),.0025,.001,this._uiManager.direction==="ltr");$(this,Vo,r.getOutlines());const{lastPoint:s}=R(this,Vo).box;$(this,Pv,[(s[0]-this.x)/this.width,(s[1]-this.y)/this.height])},DI=function({highlightOutlines:n,highlightId:r,clipPathId:s}){var l,d;if($(this,Ia,n),$(this,Vo,n.getNewOutline(R(this,El)/2+1.5,.0025)),r>=0)$(this,Xs,r),$(this,Xh,s),this.parent.drawLayer.finalizeLine(r,n),$(this,Fr,this.parent.drawLayer.highlightOutline(R(this,Vo)));else if(this.parent){const p=this.parent.viewport.rotation;this.parent.drawLayer.updateLine(R(this,Xs),n),this.parent.drawLayer.updateBox(R(this,Xs),z(l=rn,ta,Fm).call(l,R(this,Ia).box,(p-this.rotation+360)%360)),this.parent.drawLayer.updateLine(R(this,Fr),R(this,Vo)),this.parent.drawLayer.updateBox(R(this,Fr),z(d=rn,ta,Fm).call(d,R(this,Vo).box,p))}const{x:o,y:a,width:c,height:u}=n.box;switch(this.rotation){case 0:this.x=o,this.y=a,this.width=c,this.height=u;break;case 90:{const[p,h]=this.parentDimensions;this.x=a,this.y=1-o,this.width=c*h/p,this.height=u*p/h;break}case 180:this.x=1-o,this.y=1-a,this.width=c,this.height=u;break;case 270:{const[p,h]=this.parentDimensions;this.x=1-a,this.y=o,this.width=c*h/p,this.height=u*p/h;break}}const{lastPoint:f}=R(this,Vo).box;$(this,Pv,[(f[0]-o)/c,(f[1]-a)/u])},Vte=function(n){const r=i=>{var o,a;this.color=i,(o=this.parent)==null||o.drawLayer.changeColor(R(this,Xs),i),(a=R(this,Nv))==null||a.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:vt.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(n)},!0)},qte=function(n){const r=R(this,El),s=i=>{$(this,El,i),z(this,Ft,Wte).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:vt.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:n},!0)},Wte=function(n){if(!R(this,ho))return;z(this,Ft,DI).call(this,{highlightOutlines:R(this,Ia).getNewOutline(n/2)}),this.fixAndSetPosition();const[r,s]=this.parentDimensions;this.setDims(this.width*r,this.height*s)},MI=function(){R(this,Xs)===null||!this.parent||(this.parent.drawLayer.remove(R(this,Xs)),$(this,Xs,null),this.parent.drawLayer.remove(R(this,Fr)),$(this,Fr,null))},s0=function(n=this.parent){R(this,Xs)===null&&({id:Rs(this,Xs)._,clipPathId:Rs(this,Xh)._}=n.drawLayer.highlight(R(this,Ia),this.color,R(this,Zh)),$(this,Fr,n.drawLayer.highlightOutline(R(this,Vo))),R(this,Qh)&&(R(this,Qh).style.clipPath=R(this,Xh)))},ta=new WeakSet,Fm=function({x:n,y:r,width:s,height:i},o){switch(o){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}},Gte=function(n){rn._keyboardManager.exec(this,n)},MC=function(n){if(!R(this,Rv))return;const r=window.getSelection();n?r.setPosition(R(this,Rv),R(this,Yw)):r.setPosition(R(this,Xw),R(this,Qw))},i0=function(){return R(this,ho)?this.rotation:0},Kte=function(){if(R(this,ho))return null;const[n,r]=this.pageDimensions,s=R(this,kd),i=new Float32Array(s.length*8);let o=0;for(const{x:a,y:c,width:u,height:f}of s){const l=a*n,d=(1-c-f)*r;i[o]=i[o+4]=l,i[o+1]=i[o+3]=d,i[o+2]=i[o+6]=l+u*n,i[o+5]=i[o+7]=d+f*r,o+=8}return i},Yte=function(n){return R(this,Ia).serialize(n,z(this,Ft,i0).call(this))},Xte=function(n,r){this._freeHighlight.add(r)&&n.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)},Qte=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=""},B(rn,ta),Te(rn,"_defaultColor",null),Te(rn,"_defaultOpacity",1),Te(rn,"_defaultThickness",12),Te(rn,"_l10nPromise"),Te(rn,"_type","highlight"),Te(rn,"_editorType",Gt.HIGHLIGHT),Te(rn,"_freeHighlightId",-1),Te(rn,"_freeHighlight",null),Te(rn,"_freeHighlightClipId","");let dA=rn;var Jh,ep,Jw,e_,t_,tp,Al,Wc,qo,np,rp,Gc,sp,ip,Dd,He,Zte,Jte,ene,tne,II,nne,jI,rne,sne,ine,one,ane,Wf,LI,OC,IC,zm,$I,jC,wu,lne,FI,cne,une,zI,LC,o0;const Jn=class Jn extends yn{constructor(n){super({...n,name:"inkEditor"});B(this,He);B(this,Jh,0);B(this,ep,0);B(this,Jw,this.canvasPointermove.bind(this));B(this,e_,this.canvasPointerleave.bind(this));B(this,t_,this.canvasPointerup.bind(this));B(this,tp,this.canvasPointerdown.bind(this));B(this,Al,null);B(this,Wc,new Path2D);B(this,qo,!1);B(this,np,!1);B(this,rp,!1);B(this,Gc,null);B(this,sp,0);B(this,ip,0);B(this,Dd,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){yn.initialize(n,r)}static updateDefaultParams(n,r){switch(n){case vt.INK_THICKNESS:Jn._defaultThickness=r;break;case vt.INK_COLOR:Jn._defaultColor=r;break;case vt.INK_OPACITY:Jn._defaultOpacity=r/100;break}}updateParams(n,r){switch(n){case vt.INK_THICKNESS:z(this,He,Zte).call(this,r);break;case vt.INK_COLOR:z(this,He,Jte).call(this,r);break;case vt.INK_OPACITY:z(this,He,ene).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[vt.INK_THICKNESS,Jn._defaultThickness],[vt.INK_COLOR,Jn._defaultColor||yn._defaultLineColor],[vt.INK_OPACITY,Math.round(Jn._defaultOpacity*100)]]}get propertiesToUpdate(){return[[vt.INK_THICKNESS,this.thickness||Jn._defaultThickness],[vt.INK_COLOR,this.color||Jn._defaultColor||yn._defaultLineColor],[vt.INK_OPACITY,Math.round(100*(this.opacity??Jn._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.canvas||(z(this,He,OC).call(this),z(this,He,IC).call(this)),this.isAttachedToDOM||(this.parent.add(this),z(this,He,zm).call(this)),z(this,He,o0).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,R(this,Al)&&(clearTimeout(R(this,Al)),$(this,Al,null)),(n=R(this,Gc))==null||n.disconnect(),$(this,Gc,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(){R(this,qo)||this.canvas===null||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",R(this,tp),{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",R(this,tp)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}commit(){R(this,qo)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),$(this,qo,!0),this.div.classList.add("disabled"),z(this,He,o0).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()||R(this,qo)||(this.setInForeground(),n.preventDefault(),this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0}),z(this,He,nne).call(this,n.offsetX,n.offsetY))}canvasPointermove(n){n.preventDefault(),z(this,He,jI).call(this,n.offsetX,n.offsetY)}canvasPointerup(n){n.preventDefault(),z(this,He,LI).call(this,n)}canvasPointerleave(n){z(this,He,LI).call(this,n)}get isResizable(){return!this.isEmpty()&&R(this,qo)}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,o,a]=z(this,He,tne).call(this);if(this.setAt(s,i,0,0),this.setDims(o,a),z(this,He,OC).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,rp,!0),z(this,He,zm).call(this),this.setDims(this.width*c,this.height*u),z(this,He,Wf).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return z(this,He,IC).call(this),this.div}setDimensions(n,r){const s=Math.round(n),i=Math.round(r);if(R(this,sp)===s&&R(this,ip)===i)return;$(this,sp,s),$(this,ip,i),this.canvas.style.visibility="hidden";const[o,a]=this.parentDimensions;this.width=n/o,this.height=r/a,this.fixAndSetPosition(),R(this,qo)&&z(this,He,$I).call(this,n,r),z(this,He,zm).call(this),z(this,He,Wf).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(n,r,s){var y,g,v;if(n instanceof Pte)return null;const i=super.deserialize(n,r,s);i.thickness=n.thickness,i.color=Je.makeHexColor(...n.color),i.opacity=n.opacity;const[o,a]=i.pageDimensions,c=i.width*o,u=i.height*a,f=i.parentScale,l=n.thickness/2;$(i,qo,!0),$(i,sp,Math.round(c)),$(i,ip,Math.round(u));const{paths:d,rect:p,rotation:h}=n;for(let{bezier:x}of d){x=z(y=Jn,wu,cne).call(y,x,p,h);const _=[];i.paths.push(_);let A=f*(x[0]-l),N=f*(x[1]-l);for(let E=2,P=x.length;E<P;E+=6){const k=f*(x[E]-l),M=f*(x[E+1]-l),I=f*(x[E+2]-l),j=f*(x[E+3]-l),L=f*(x[E+4]-l),H=f*(x[E+5]-l);_.push([[A,N],[k,M],[I,j],[L,H]]),A=L,N=H}const T=z(this,wu,lne).call(this,_);i.bezierPath2D.push(T)}const m=z(g=i,He,zI).call(g);return $(i,ep,Math.max(yn.MIN_SIZE,m[2]-m[0])),$(i,Jh,Math.max(yn.MIN_SIZE,m[3]-m[1])),z(v=i,He,$I).call(v,c,u),i}serialize(){if(this.isEmpty())return null;const n=this.getRect(0,0),r=yn._colorManager.convert(this.ctx.strokeStyle);return{annotationType:Gt.INK,color:r,thickness:this.thickness,opacity:this.opacity,paths:z(this,He,une).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,n),pageIndex:this.pageIndex,rect:n,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}};Jh=new WeakMap,ep=new WeakMap,Jw=new WeakMap,e_=new WeakMap,t_=new WeakMap,tp=new WeakMap,Al=new WeakMap,Wc=new WeakMap,qo=new WeakMap,np=new WeakMap,rp=new WeakMap,Gc=new WeakMap,sp=new WeakMap,ip=new WeakMap,Dd=new WeakMap,He=new WeakSet,Zte=function(n){const r=i=>{this.thickness=i,z(this,He,o0).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:vt.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},Jte=function(n){const r=i=>{this.color=i,z(this,He,Wf).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:vt.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},ene=function(n){const r=i=>{this.opacity=i,z(this,He,Wf).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:vt.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},tne=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]}},II=function(){const{ctx:n,color:r,opacity:s,thickness:i,parentScale:o,scaleFactor:a}=this;n.lineWidth=i*o/a,n.lineCap="round",n.lineJoin="round",n.miterLimit=10,n.strokeStyle=`${r}${d$e(s)}`},nne=function(n,r){const s=this._uiManager._signal;this.canvas.addEventListener("contextmenu",Bi,{signal:s}),this.canvas.addEventListener("pointerleave",R(this,e_),{signal:s}),this.canvas.addEventListener("pointermove",R(this,Jw),{signal:s}),this.canvas.addEventListener("pointerup",R(this,t_),{signal:s}),this.canvas.removeEventListener("pointerdown",R(this,tp)),this.isEditing=!0,R(this,rp)||($(this,rp,!0),z(this,He,zm).call(this),this.thickness||(this.thickness=Jn._defaultThickness),this.color||(this.color=Jn._defaultColor||yn._defaultLineColor),this.opacity??(this.opacity=Jn._defaultOpacity)),this.currentPath.push([n,r]),$(this,np,!1),z(this,He,II).call(this),$(this,Dd,()=>{z(this,He,ine).call(this),R(this,Dd)&&window.requestAnimationFrame(R(this,Dd))}),window.requestAnimationFrame(R(this,Dd))},jI=function(n,r){const[s,i]=this.currentPath.at(-1);if(this.currentPath.length>1&&n===s&&r===i)return;const o=this.currentPath;let a=R(this,Wc);if(o.push([n,r]),$(this,np,!0),o.length<=2){a.moveTo(...o[0]),a.lineTo(n,r);return}o.length===3&&($(this,Wc,a=new Path2D),a.moveTo(...o[0])),z(this,He,one).call(this,a,...o.at(-3),...o.at(-2),n,r)},rne=function(){if(this.currentPath.length===0)return;const n=this.currentPath.at(-1);R(this,Wc).lineTo(...n)},sne=function(n,r){$(this,Dd,null),n=Math.min(Math.max(n,0),this.canvas.width),r=Math.min(Math.max(r,0),this.canvas.height),z(this,He,jI).call(this,n,r),z(this,He,rne).call(this);let s;if(this.currentPath.length!==1)s=z(this,He,ane).call(this);else{const u=[n,r];s=[[u,u.slice(),u.slice(),u]]}const i=R(this,Wc),o=this.currentPath;this.currentPath=[],$(this,Wc,new Path2D);const a=()=>{this.allRawPaths.push(o),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||(z(this,He,OC).call(this),z(this,He,IC).call(this)),z(this,He,o0).call(this))};this.addCommands({cmd:a,undo:c,mustExec:!0})},ine=function(){if(!R(this,np))return;$(this,np,!1);const n=Math.ceil(this.thickness*this.parentScale),r=this.currentPath.slice(-3),s=r.map(a=>a[0]),i=r.map(a=>a[1]);Math.min(...s)-n,Math.max(...s)+n,Math.min(...i)-n,Math.max(...i)+n;const{ctx:o}=this;o.save(),o.clearRect(0,0,this.canvas.width,this.canvas.height);for(const a of this.bezierPath2D)o.stroke(a);o.stroke(R(this,Wc)),o.restore()},one=function(n,r,s,i,o,a,c){const u=(r+i)/2,f=(s+o)/2,l=(i+a)/2,d=(o+c)/2;n.bezierCurveTo(u+2*(i-u)/3,f+2*(o-f)/3,l+2*(i-l)/3,d+2*(o-d)/3,l,d)},ane=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,o]=n[0];for(s=1;s<n.length-2;s++){const[p,h]=n[s],[m,y]=n[s+1],g=(p+m)/2,v=(h+y)/2,x=[i+2*(p-i)/3,o+2*(h-o)/3],_=[g+2*(p-g)/3,v+2*(h-v)/3];r.push([[i,o],x,_,[g,v]]),[i,o]=[g,v]}const[a,c]=n[s],[u,f]=n[s+1],l=[i+2*(a-i)/3,o+2*(c-o)/3],d=[u+2*(a-u)/3,f+2*(c-f)/3];return r.push([[i,o],l,d,[u,f]]),r},Wf=function(){if(this.isEmpty()){z(this,He,jC).call(this);return}z(this,He,II).call(this);const{canvas:n,ctx:r}=this;r.setTransform(1,0,0,1,0,0),r.clearRect(0,0,n.width,n.height),z(this,He,jC).call(this);for(const s of this.bezierPath2D)r.stroke(s)},LI=function(n){this.canvas.removeEventListener("pointerleave",R(this,e_)),this.canvas.removeEventListener("pointermove",R(this,Jw)),this.canvas.removeEventListener("pointerup",R(this,t_)),this.canvas.addEventListener("pointerdown",R(this,tp),{signal:this._uiManager._signal}),R(this,Al)&&clearTimeout(R(this,Al)),$(this,Al,setTimeout(()=>{$(this,Al,null),this.canvas.removeEventListener("contextmenu",Bi)},10)),z(this,He,sne).call(this,n.offsetX,n.offsetY),this.addToAnnotationStorage(),this.setInBackground()},OC=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")},IC=function(){$(this,Gc,new ResizeObserver(n=>{const r=n[0].contentRect;r.width&&r.height&&this.setDimensions(r.width,r.height)})),R(this,Gc).observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{var n;(n=R(this,Gc))==null||n.disconnect(),$(this,Gc,null)},{once:!0})},zm=function(){if(!R(this,rp))return;const[n,r]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*n),this.canvas.height=Math.ceil(this.height*r),z(this,He,jC).call(this)},$I=function(n,r){const s=z(this,He,LC).call(this),i=(n-s)/R(this,ep),o=(r-s)/R(this,Jh);this.scaleFactor=Math.min(i,o)},jC=function(){const n=z(this,He,LC).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+n,this.translationY*this.scaleFactor+n)},wu=new WeakSet,lne=function(n){const r=new Path2D;for(let s=0,i=n.length;s<i;s++){const[o,a,c,u]=n[s];s===0&&r.moveTo(...o),r.bezierCurveTo(a[0],a[1],c[0],c[1],u[0],u[1])}return r},FI=function(n,r,s){const[i,o,a,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+o}break;case 180:for(let u=0,f=n.length;u<f;u+=2)n[u]=a-n[u],n[u+1]+=o;break;case 270:for(let u=0,f=n.length;u<f;u+=2){const l=n[u];n[u]=a-n[u+1],n[u+1]=c-l}break;default:throw new Error("Invalid rotation")}return n},cne=function(n,r,s){const[i,o,a,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]-o,n[u+1]=l-i}break;case 180:for(let u=0,f=n.length;u<f;u+=2)n[u]=a-n[u],n[u+1]-=o;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]=a-l}break;default:throw new Error("Invalid rotation")}return n},une=function(n,r,s,i){var f,l;const o=[],a=this.thickness/2,c=n*r+a,u=n*s+a;for(const d of this.paths){const p=[],h=[];for(let m=0,y=d.length;m<y;m++){const[g,v,x,_]=d[m];if(g[0]===_[0]&&g[1]===_[1]&&y===1){const j=n*g[0]+c,L=n*g[1]+u;p.push(j,L),h.push(j,L);break}const A=n*g[0]+c,N=n*g[1]+u,T=n*v[0]+c,E=n*v[1]+u,P=n*x[0]+c,k=n*x[1]+u,M=n*_[0]+c,I=n*_[1]+u;m===0&&(p.push(A,N),h.push(A,N)),p.push(T,E,P,k,M,I),h.push(T,E),m===y-1&&h.push(M,I)}o.push({bezier:z(f=Jn,wu,FI).call(f,p,i,this.rotation),points:z(l=Jn,wu,FI).call(l,h,i,this.rotation)})}return o},zI=function(){let n=1/0,r=-1/0,s=1/0,i=-1/0;for(const o of this.paths)for(const[a,c,u,f]of o){const l=Je.bezierBoundingBox(...a,...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]},LC=function(){return R(this,qo)?Math.ceil(this.thickness*this.parentScale):0},o0=function(n=!1){if(this.isEmpty())return;if(!R(this,qo)){z(this,He,Wf).call(this);return}const r=z(this,He,zI).call(this),s=z(this,He,LC).call(this);$(this,ep,Math.max(yn.MIN_SIZE,r[2]-r[0])),$(this,Jh,Math.max(yn.MIN_SIZE,r[3]-r[1]));const i=Math.ceil(s+R(this,ep)*this.scaleFactor),o=Math.ceil(s+R(this,Jh)*this.scaleFactor),[a,c]=this.parentDimensions;this.width=i/a,this.height=o/c,this.setAspectRatio(i,o);const u=this.translationX,f=this.translationY;this.translationX=-r[0],this.translationY=-r[1],z(this,He,zm).call(this),z(this,He,Wf).call(this),$(this,sp,i),$(this,ip,o),this.setDims(i,o);const l=n?s/this.scaleFactor/2:0;this.translate(u-this.translationX-l,f-this.translationY-l)},B(Jn,wu),Te(Jn,"_defaultColor",null),Te(Jn,"_defaultOpacity",1),Te(Jn,"_defaultThickness",1),Te(Jn,"_type","ink"),Te(Jn,"_editorType",Gt.INK);let OI=Jn;var ms,gs,Md,Kc,Od,kv,Rl,Yc,Nl,ja,n_,en,a0,l0,$C,UI,dne,fne,HI,FC,hne;const M0=class M0 extends yn{constructor(n){super({...n,name:"stampEditor"});B(this,en);B(this,ms,null);B(this,gs,null);B(this,Md,null);B(this,Kc,null);B(this,Od,null);B(this,kv,"");B(this,Rl,null);B(this,Yc,null);B(this,Nl,null);B(this,ja,!1);B(this,n_,!1);$(this,Kc,n.bitmapUrl),$(this,Od,n.bitmapFile)}static initialize(n,r){yn.initialize(n,r)}static get supportedTypes(){return Yt(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map(r=>`image/${r}`))}static get supportedTypesStr(){return Yt(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(n){return this.supportedTypes.includes(n)}static paste(n,r){r.pasteEditor(Gt.STAMP,{bitmapFile:n.getAsFile()})}remove(){var n,r;R(this,gs)&&($(this,ms,null),this._uiManager.imageManager.deleteId(R(this,gs)),(n=R(this,Rl))==null||n.remove(),$(this,Rl,null),(r=R(this,Yc))==null||r.disconnect(),$(this,Yc,null),R(this,Nl)&&(clearTimeout(R(this,Nl)),$(this,Nl,null))),super.remove()}rebuild(){if(!this.parent){R(this,gs)&&z(this,en,$C).call(this);return}super.rebuild(),this.div!==null&&(R(this,gs)&&R(this,Rl)===null&&z(this,en,$C).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(R(this,Md)||R(this,ms)||R(this,Kc)||R(this,Od)||R(this,gs))}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(),R(this,ms)?z(this,en,UI).call(this):z(this,en,$C).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 R(this,Rl)}static deserialize(n,r,s){if(n instanceof Tte)return null;const i=super.deserialize(n,r,s),{rect:o,bitmapUrl:a,bitmapId:c,isSvg:u,accessibilityData:f}=n;c&&s.imageManager.isValidId(c)?$(i,gs,c):$(i,Kc,a),$(i,ja,u);const[l,d]=i.pageDimensions;return i.width=(o[2]-o[0])/l,i.height=(o[3]-o[1])/d,f&&(i.altTextData=f),i}serialize(n=!1,r=null){if(this.isEmpty())return null;const s={annotationType:Gt.STAMP,bitmapId:R(this,gs),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:R(this,ja),structTreeParentId:this._structTreeParentId};if(n)return s.bitmapUrl=z(this,en,FC).call(this,!0),s.accessibilityData=this.altTextData,s;const{decorative:i,altText:o}=this.altTextData;if(!i&&o&&(s.accessibilityData={type:"Figure",alt:o}),r===null)return s;r.stamps||(r.stamps=new Map);const a=R(this,ja)?(s.rect[2]-s.rect[0])*(s.rect[3]-s.rect[1]):null;if(!r.stamps.has(R(this,gs)))r.stamps.set(R(this,gs),{area:a,serialized:s}),s.bitmap=z(this,en,FC).call(this,!1);else if(R(this,ja)){const c=r.stamps.get(R(this,gs));a>c.area&&(c.area=a,c.serialized.bitmap.close(),c.serialized.bitmap=z(this,en,FC).call(this,!1))}return s}};ms=new WeakMap,gs=new WeakMap,Md=new WeakMap,Kc=new WeakMap,Od=new WeakMap,kv=new WeakMap,Rl=new WeakMap,Yc=new WeakMap,Nl=new WeakMap,ja=new WeakMap,n_=new WeakMap,en=new WeakSet,a0=function(n,r=!1){if(!n){this.remove();return}$(this,ms,n.bitmap),r||($(this,gs,n.id),$(this,ja,n.isSvg)),n.file&&$(this,kv,n.file.name),z(this,en,UI).call(this)},l0=function(){$(this,Md,null),this._uiManager.enableWaiting(!1),R(this,Rl)&&this.div.focus()},$C=function(){if(R(this,gs)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(R(this,gs)).then(s=>z(this,en,a0).call(this,s,!0)).finally(()=>z(this,en,l0).call(this));return}if(R(this,Kc)){const s=R(this,Kc);$(this,Kc,null),this._uiManager.enableWaiting(!0),$(this,Md,this._uiManager.imageManager.getFromUrl(s).then(i=>z(this,en,a0).call(this,i)).finally(()=>z(this,en,l0).call(this)));return}if(R(this,Od)){const s=R(this,Od);$(this,Od,null),this._uiManager.enableWaiting(!0),$(this,Md,this._uiManager.imageManager.getFromFile(s).then(i=>z(this,en,a0).call(this,i)).finally(()=>z(this,en,l0).call(this)));return}const n=document.createElement("input");n.type="file",n.accept=M0.supportedTypesStr;const r=this._uiManager._signal;$(this,Md,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]);z(this,en,a0).call(this,i)}s()},{signal:r}),n.addEventListener("cancel",()=>{this.remove(),s()},{signal:r})}).finally(()=>z(this,en,l0).call(this))),n.click()},UI=function(){const{div:n}=this;let{width:r,height:s}=R(this,ms);const[i,o]=this.pageDimensions,a=.75;if(this.width)r=this.width*i,s=this.height*o;else if(r>a*i||s>a*o){const l=Math.min(a*i/r,a*o/s);r*=l,s*=l}const[c,u]=this.parentDimensions;this.setDims(r*c/i,s*u/o),this._uiManager.enableWaiting(!1);const f=$(this,Rl,document.createElement("canvas"));n.append(f),n.hidden=!1,z(this,en,HI).call(this,r,s),z(this,en,hne).call(this),R(this,n_)||(this.parent.addUndoableEditor(this),$(this,n_,!0)),this._reportTelemetry({action:"inserted_image"}),R(this,kv)&&f.setAttribute("aria-label",R(this,kv))},dne=function(n,r){var a;const[s,i]=this.parentDimensions;this.width=n/s,this.height=r/i,this.setDims(n,r),(a=this._initialOptions)!=null&&a.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,R(this,Nl)!==null&&clearTimeout(R(this,Nl)),$(this,Nl,setTimeout(()=>{$(this,Nl,null),z(this,en,HI).call(this,n,r)},200))},fne=function(n,r){const{width:s,height:i}=R(this,ms);let o=s,a=i,c=R(this,ms);for(;o>2*n||a>2*r;){const u=o,f=a;o>2*n&&(o=o>=16384?Math.floor(o/2)-1:Math.ceil(o/2)),a>2*r&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2));const l=new OffscreenCanvas(o,a);l.getContext("2d").drawImage(c,0,0,u,f,0,0,o,a),c=l.transferToImageBitmap()}return c},HI=function(n,r){n=Math.ceil(n),r=Math.ceil(r);const s=R(this,Rl);if(!s||s.width===n&&s.height===r)return;s.width=n,s.height=r;const i=R(this,ja)?R(this,ms):z(this,en,fne).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 o=s.getContext("2d");o.filter=this._uiManager.hcmFilter,o.drawImage(i,0,0,i.width,i.height,0,0,n,r)},FC=function(n){if(n){if(R(this,ja)){const i=this._uiManager.imageManager.getSvgUrl(R(this,gs));if(i)return i}const r=document.createElement("canvas");return{width:r.width,height:r.height}=R(this,ms),r.getContext("2d").drawImage(R(this,ms),0,0),r.toDataURL()}if(R(this,ja)){const[r,s]=this.pageDimensions,i=Math.round(this.width*r*cf.PDF_TO_CSS_UNITS),o=Math.round(this.height*s*cf.PDF_TO_CSS_UNITS),a=new OffscreenCanvas(i,o);return a.getContext("2d").drawImage(R(this,ms),0,0,R(this,ms).width,R(this,ms).height,0,0,i,o),a.transferToImageBitmap()}return structuredClone(R(this,ms))},hne=function(){this._uiManager._signal&&($(this,Yc,new ResizeObserver(n=>{const r=n[0].contentRect;r.width&&r.height&&z(this,en,dne).call(this,r.width,r.height)})),R(this,Yc).observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{var n;(n=R(this,Yc))==null||n.disconnect(),$(this,Yc,null)},{once:!0}))},Te(M0,"_type","stamp"),Te(M0,"_editorType",Gt.STAMP);let BI=M0;var op,Dv,Pl,ap,Xc,Qc,Zc,po,Id,Mv,Ov,Qs,it,jd,_s,pne,qI,WI,GI,zC;const xa=class xa{constructor({uiManager:e,pageIndex:n,div:r,accessibilityManager:s,annotationLayer:i,drawLayer:o,textLayer:a,viewport:c,l10n:u}){B(this,_s);B(this,op);B(this,Dv,!1);B(this,Pl,null);B(this,ap,null);B(this,Xc,null);B(this,Qc,null);B(this,Zc,null);B(this,po,new Map);B(this,Id,!1);B(this,Mv,!1);B(this,Ov,!1);B(this,Qs,null);B(this,it);const f=[...R(xa,jd).values()];if(!xa._initialized){xa._initialized=!0;for(const l of f)l.initialize(u,e)}e.registerEditorTypes(f),$(this,it,e),this.pageIndex=n,this.div=r,$(this,op,s),$(this,Pl,i),this.viewport=c,$(this,Qs,a),this.drawLayer=o,R(this,it).addLayer(this)}get isEmpty(){return R(this,po).size===0}get isInvisible(){return this.isEmpty&&R(this,it).getMode()===Gt.NONE}updateToolbar(e){R(this,it).updateToolbar(e)}updateMode(e=R(this,it).getMode()){switch(z(this,_s,zC).call(this),e){case Gt.NONE:this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case Gt.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case Gt.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 R(xa,jd).values())n.toggle(`${r._type}Editing`,e===r._editorType);this.div.hidden=!1}hasTextLayer(e){var n;return e===((n=R(this,Qs))==null?void 0:n.div)}addInkEditorIfNeeded(e){if(R(this,it).getMode()!==Gt.INK)return;if(!e){for(const r of R(this,po).values())if(r.isEmpty()){r.setInBackground();return}}this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(e){R(this,it).setEditingState(e)}addCommands(e){R(this,it).addCommands(e)}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}toggleAnnotationLayerPointerEvents(e=!1){var n;(n=R(this,Pl))==null||n.div.classList.toggle("disabled",!e)}enable(){this.div.tabIndex=0,this.togglePointerEvents(!0);const e=new Set;for(const r of R(this,po).values())r.enableEditing(),r.show(!0),r.annotationElementId&&(R(this,it).removeChangedExistingAnnotation(r),e.add(r.annotationElementId));if(!R(this,Pl))return;const n=R(this,Pl).getEditableAnnotations();for(const r of n){if(r.hide(),R(this,it).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,Ov,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1);const e=new Map,n=new Map;for(const i of R(this,po).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(R(this,Pl)){const i=R(this,Pl).getEditableAnnotations();for(const o of i){const{id:a}=o.data;if(R(this,it).isDeletedAnnotationElement(a))continue;let c=n.get(a);if(c){c.resetAnnotationElement(o),c.show(!1),o.show();continue}c=e.get(a),c&&(R(this,it).addChangedExistingAnnotation(c),c.renderAnnotationElement(o),c.show(!1)),o.show()}}z(this,_s,zC).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:r}=this.div;for(const i of R(xa,jd).values())r.remove(`${i._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),$(this,Ov,!1)}getEditableAnnotation(e){var n;return((n=R(this,Pl))==null?void 0:n.getEditableAnnotation(e))||null}setActiveEditor(e){R(this,it).getActive()!==e&&R(this,it).setActiveEditor(e)}enableTextSelection(){var e;this.div.tabIndex=-1,(e=R(this,Qs))!=null&&e.div&&!R(this,Qc)&&($(this,Qc,z(this,_s,pne).bind(this)),R(this,Qs).div.addEventListener("pointerdown",R(this,Qc),{signal:R(this,it)._signal}),R(this,Qs).div.classList.add("highlighting"))}disableTextSelection(){var e;this.div.tabIndex=0,(e=R(this,Qs))!=null&&e.div&&R(this,Qc)&&(R(this,Qs).div.removeEventListener("pointerdown",R(this,Qc)),$(this,Qc,null),R(this,Qs).div.classList.remove("highlighting"))}enableClick(){if(R(this,Xc))return;const e=R(this,it)._signal;$(this,Xc,this.pointerdown.bind(this)),$(this,ap,this.pointerup.bind(this)),this.div.addEventListener("pointerdown",R(this,Xc),{signal:e}),this.div.addEventListener("pointerup",R(this,ap),{signal:e})}disableClick(){R(this,Xc)&&(this.div.removeEventListener("pointerdown",R(this,Xc)),this.div.removeEventListener("pointerup",R(this,ap)),$(this,Xc,null),$(this,ap,null))}attach(e){R(this,po).set(e.id,e);const{annotationElementId:n}=e;n&&R(this,it).isDeletedAnnotationElement(n)&&R(this,it).removeDeletedAnnotationElement(e)}detach(e){var n;R(this,po).delete(e.id),(n=R(this,op))==null||n.removePointerInTextLayer(e.contentDiv),!R(this,Ov)&&e.annotationElementId&&R(this,it).addDeletedAnnotationElement(e)}remove(e){this.detach(e),R(this,it).removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1,R(this,Mv)||this.addInkEditorIfNeeded(!1)}changeParent(e){var n;e.parent!==this&&(e.parent&&e.annotationElementId&&(R(this,it).addDeletedAnnotationElement(e.annotationElementId),yn.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),R(this,it).addEditor(e),this.attach(e),!e.isAttachedToDOM){const n=e.render();this.div.append(n),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(),R(this,it).addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){var r;if(!e.isAttachedToDOM)return;const{activeElement:n}=document;e.div.contains(n)&&!R(this,Zc)&&(e._focusEventsAllowed=!1,$(this,Zc,setTimeout(()=>{$(this,Zc,null),e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:R(this,it)._signal}),n.focus())},0))),e._structTreeParentId=(r=R(this,op))==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 R(this,it).getId()}get _signal(){return R(this,it)._signal}canCreateNewEmptyEditor(){var e;return(e=R(this,_s,qI))==null?void 0:e.canCreateNewEmptyEditor()}pasteEditor(e,n){R(this,it).updateToolbar(e),R(this,it).updateMode(e);const{offsetX:r,offsetY:s}=z(this,_s,GI).call(this),i=this.getNextId(),o=z(this,_s,WI).call(this,{parent:this,id:i,x:r,y:s,uiManager:R(this,it),isCentered:!0,...n});o&&this.add(o)}deserialize(e){var n;return((n=R(xa,jd).get(e.annotationType??e.annotationEditorType))==null?void 0:n.deserialize(e,this,R(this,it)))||null}createAndAddNewEditor(e,n,r={}){const s=this.getNextId(),i=z(this,_s,WI).call(this,{parent:this,id:s,x:e.offsetX,y:e.offsetY,uiManager:R(this,it),isCentered:n,...r});return i&&this.add(i),i}addNewEditor(){this.createAndAddNewEditor(z(this,_s,GI).call(this),!0)}setSelected(e){R(this,it).setSelected(e)}toggleSelected(e){R(this,it).toggleSelected(e)}isSelected(e){return R(this,it).isSelected(e)}unselect(e){R(this,it).unselect(e)}pointerup(e){const{isMac:n}=Ii.platform;if(!(e.button!==0||e.ctrlKey&&n)&&e.target===this.div&&R(this,Id)){if($(this,Id,!1),!R(this,Dv)){$(this,Dv,!0);return}if(R(this,it).getMode()===Gt.STAMP){R(this,it).unselectAll();return}this.createAndAddNewEditor(e,!1)}}pointerdown(e){if(R(this,it).getMode()===Gt.HIGHLIGHT&&this.enableTextSelection(),R(this,Id)){$(this,Id,!1);return}const{isMac:n}=Ii.platform;if(e.button!==0||e.ctrlKey&&n||e.target!==this.div)return;$(this,Id,!0);const r=R(this,it).getActive();$(this,Dv,!r||r.isEmpty())}findNewParent(e,n,r){const s=R(this,it).findParent(n,r);return s===null||s===this?!1:(s.changeParent(e),!0)}destroy(){var e,n;((e=R(this,it).getActive())==null?void 0:e.parent)===this&&(R(this,it).commitOrRemove(),R(this,it).setActiveEditor(null)),R(this,Zc)&&(clearTimeout(R(this,Zc)),$(this,Zc,null));for(const r of R(this,po).values())(n=R(this,op))==null||n.removePointerInTextLayer(r.contentDiv),r.setParent(null),r.isAttachedToDOM=!1,r.div.remove();this.div=null,R(this,po).clear(),R(this,it).removeLayer(this)}render({viewport:e}){this.viewport=e,Tp(this.div,e);for(const n of R(this,it).getEditors(this.pageIndex))this.add(n),n.rebuild();this.updateMode()}update({viewport:e}){R(this,it).commitOrRemove(),z(this,_s,zC).call(this);const n=this.viewport.rotation,r=e.rotation;if(this.viewport=e,Tp(this.div,{rotation:r}),n!==r)for(const s of R(this,po).values())s.rotate(r);this.addInkEditorIfNeeded(!1)}get pageDimensions(){const{pageWidth:e,pageHeight:n}=this.viewport.rawDims;return[e,n]}get scale(){return R(this,it).viewParameters.realScale}};op=new WeakMap,Dv=new WeakMap,Pl=new WeakMap,ap=new WeakMap,Xc=new WeakMap,Qc=new WeakMap,Zc=new WeakMap,po=new WeakMap,Id=new WeakMap,Mv=new WeakMap,Ov=new WeakMap,Qs=new WeakMap,it=new WeakMap,jd=new WeakMap,_s=new WeakSet,pne=function(e){if(R(this,it).unselectAll(),e.target===R(this,Qs).div){const{isMac:n}=Ii.platform;if(e.button!==0||e.ctrlKey&&n)return;R(this,it).showAllEditors("highlight",!0,!0),R(this,Qs).div.classList.add("free"),dA.startHighlighting(this,R(this,it).direction==="ltr",e),R(this,Qs).div.addEventListener("pointerup",()=>{R(this,Qs).div.classList.remove("free")},{once:!0,signal:R(this,it)._signal}),e.preventDefault()}},qI=function(){return R(xa,jd).get(R(this,it).getMode())},WI=function(e){const n=R(this,_s,qI);return n?new n.prototype.constructor(e):null},GI=function(){const{x:e,y:n,width:r,height:s}=this.div.getBoundingClientRect(),i=Math.max(0,e),o=Math.max(0,n),a=Math.min(window.innerWidth,e+r),c=Math.min(window.innerHeight,n+s),u=(i+a)/2-e,f=(o+c)/2-n,[l,d]=this.viewport.rotation%180===0?[u,f]:[f,u];return{offsetX:l,offsetY:d}},zC=function(){$(this,Mv,!0);for(const e of R(this,po).values())e.isEmpty()&&e.remove();$(this,Mv,!1)},Te(xa,"_initialized",!1),B(xa,jd,new Map([SI,OI,BI,dA].map(e=>[e._editorType,e])));let VI=xa;var Tl,r_,zr,Ld,s_,YI,jp,XI,mne;const us=class us{constructor({pageIndex:e}){B(this,jp);B(this,Tl,null);B(this,r_,0);B(this,zr,new Map);B(this,Ld,new Map);this.pageIndex=e}setParent(e){if(!R(this,Tl)){$(this,Tl,e);return}if(R(this,Tl)!==e){if(R(this,zr).size>0)for(const n of R(this,zr).values())n.remove(),e.append(n);$(this,Tl,e)}}static get _svgFactory(){return Yt(this,"_svgFactory",new Q$)}highlight(e,n,r,s=!1){const i=Rs(this,r_)._++,o=z(this,jp,XI).call(this,e.box);o.classList.add("highlight"),e.free&&o.classList.add("free");const a=us._svgFactory.createElement("defs");o.append(a);const c=us._svgFactory.createElement("path");a.append(c);const u=`path_p${this.pageIndex}_${i}`;c.setAttribute("id",u),c.setAttribute("d",e.toSVGPath()),s&&R(this,Ld).set(i,c);const f=z(this,jp,mne).call(this,a,u),l=us._svgFactory.createElement("use");return o.append(l),o.setAttribute("fill",n),o.setAttribute("fill-opacity",r),l.setAttribute("href",`#${u}`),R(this,zr).set(i,o),{id:i,clipPathId:`url(#${f})`}}highlightOutline(e){const n=Rs(this,r_)._++,r=z(this,jp,XI).call(this,e.box);r.classList.add("highlightOutline");const s=us._svgFactory.createElement("defs");r.append(s);const i=us._svgFactory.createElement("path");s.append(i);const o=`path_p${this.pageIndex}_${n}`;i.setAttribute("id",o),i.setAttribute("d",e.toSVGPath()),i.setAttribute("vector-effect","non-scaling-stroke");let a;if(e.free){r.classList.add("free");const f=us._svgFactory.createElement("mask");s.append(f),a=`mask_p${this.pageIndex}_${n}`,f.setAttribute("id",a),f.setAttribute("maskUnits","objectBoundingBox");const l=us._svgFactory.createElement("rect");f.append(l),l.setAttribute("width","1"),l.setAttribute("height","1"),l.setAttribute("fill","white");const d=us._svgFactory.createElement("use");f.append(d),d.setAttribute("href",`#${o}`),d.setAttribute("stroke","none"),d.setAttribute("fill","black"),d.setAttribute("fill-rule","nonzero"),d.classList.add("mask")}const c=us._svgFactory.createElement("use");r.append(c),c.setAttribute("href",`#${o}`),a&&c.setAttribute("mask",`url(#${a})`);const u=c.cloneNode();return r.append(u),c.classList.add("mainOutline"),u.classList.add("secondaryOutline"),R(this,zr).set(n,r),n}finalizeLine(e,n){const r=R(this,Ld).get(e);R(this,Ld).delete(e),this.updateBox(e,n.box),r.setAttribute("d",n.toSVGPath())}updateLine(e,n){R(this,zr).get(e).firstChild.firstChild.setAttribute("d",n.toSVGPath())}removeFreeHighlight(e){this.remove(e),R(this,Ld).delete(e)}updatePath(e,n){R(this,Ld).get(e).setAttribute("d",n.toSVGPath())}updateBox(e,n){var r;z(r=us,s_,YI).call(r,R(this,zr).get(e),n)}show(e,n){R(this,zr).get(e).classList.toggle("hidden",!n)}rotate(e,n){R(this,zr).get(e).setAttribute("data-main-rotation",n)}changeColor(e,n){R(this,zr).get(e).setAttribute("fill",n)}changeOpacity(e,n){R(this,zr).get(e).setAttribute("fill-opacity",n)}addClass(e,n){R(this,zr).get(e).classList.add(n)}removeClass(e,n){R(this,zr).get(e).classList.remove(n)}remove(e){R(this,Tl)!==null&&(R(this,zr).get(e).remove(),R(this,zr).delete(e))}destroy(){$(this,Tl,null);for(const e of R(this,zr).values())e.remove();R(this,zr).clear()}};Tl=new WeakMap,r_=new WeakMap,zr=new WeakMap,Ld=new WeakMap,s_=new WeakSet,YI=function(e,{x:n=0,y:r=0,width:s=1,height:i=1}={}){const{style:o}=e;o.top=`${100*r}%`,o.left=`${100*n}%`,o.width=`${100*s}%`,o.height=`${100*i}%`},jp=new WeakSet,XI=function(e){var r;const n=us._svgFactory.create(1,1,!0);return R(this,Tl).append(n),n.setAttribute("aria-hidden",!0),z(r=us,s_,YI).call(r,n,e),n},mne=function(e,n){const r=us._svgFactory.createElement("clipPath");e.append(r);const s=`clip_${n}`;r.setAttribute("id",s),r.setAttribute("clipPathUnits","objectBoundingBox");const i=us._svgFactory.createElement("use");return r.append(i),i.setAttribute("href",`#${n}`),i.classList.add("clip"),s},B(us,s_);let KI=us;var UFe=mt.AbortException,HFe=mt.AnnotationEditorLayer,VFe=mt.AnnotationEditorParamsType,qFe=mt.AnnotationEditorType,WFe=mt.AnnotationEditorUIManager,gne=mt.AnnotationLayer,vne=mt.AnnotationMode,GFe=mt.CMapCompressionType,KFe=mt.ColorPicker,YFe=mt.DOMSVGFactory,XFe=mt.DrawLayer,QFe=mt.FeatureTest,iF=mt.GlobalWorkerOptions,ZFe=mt.ImageKind,JFe=mt.InvalidPDFException,e3e=mt.MissingPDFException,t3e=mt.OPS,n3e=mt.Outliner,r3e=mt.PDFDataRangeTransport,s3e=mt.PDFDateString,i3e=mt.PDFWorker,o3e=mt.PasswordResponses,a3e=mt.PermissionFlag,l3e=mt.PixelsPerInch,c3e=mt.RenderingCancelledException,yne=mt.TextLayer,u3e=mt.UnexpectedResponseException,d3e=mt.Util,f3e=mt.VerbosityLevel,h3e=mt.XfaLayer,p3e=mt.build,m3e=mt.createValidAbsoluteUrl,g3e=mt.fetchData,bne=mt.getDocument,v3e=mt.getFilenameFromUrl,y3e=mt.getPdfFilenameFromUrl,b3e=mt.getXfaPageViewport,x3e=mt.isDataScheme,w3e=mt.isPdfFile,_3e=mt.noContextMenu,S3e=mt.normalizeUnicode,C3e=mt.renderTextLayer,E3e=mt.setLayerDimensions,A3e=mt.shadow,R3e=mt.updateTextLayer,xne=mt.version;const N3e=Object.freeze(Object.defineProperty({__proto__:null,AbortException:UFe,AnnotationEditorLayer:HFe,AnnotationEditorParamsType:VFe,AnnotationEditorType:qFe,AnnotationEditorUIManager:WFe,AnnotationLayer:gne,AnnotationMode:vne,CMapCompressionType:GFe,ColorPicker:KFe,DOMSVGFactory:YFe,DrawLayer:XFe,FeatureTest:QFe,GlobalWorkerOptions:iF,ImageKind:ZFe,InvalidPDFException:JFe,MissingPDFException:e3e,OPS:t3e,Outliner:n3e,PDFDataRangeTransport:r3e,PDFDateString:s3e,PDFWorker:i3e,PasswordResponses:o3e,PermissionFlag:a3e,PixelsPerInch:l3e,RenderingCancelledException:c3e,TextLayer:yne,UnexpectedResponseException:u3e,Util:d3e,VerbosityLevel:f3e,XfaLayer:h3e,build:p3e,createValidAbsoluteUrl:m3e,fetchData:g3e,getDocument:bne,getFilenameFromUrl:v3e,getPdfFilenameFromUrl:y3e,getXfaPageViewport:b3e,isDataScheme:x3e,isPdfFile:w3e,noContextMenu:_3e,normalizeUnicode:S3e,renderTextLayer:C3e,setLayerDimensions:E3e,shadow:A3e,updateTextLayer:R3e,version:xne},Symbol.toStringTag,{value:"Module"}));var Qr=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))},P3e=["onCopy","onCut","onPaste"],T3e=["onCompositionEnd","onCompositionStart","onCompositionUpdate"],k3e=["onFocus","onBlur"],D3e=["onInput","onInvalid","onReset","onSubmit"],M3e=["onLoad","onError"],O3e=["onKeyDown","onKeyPress","onKeyUp"],I3e=["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],j3e=["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],L3e=["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],$3e=["onSelect"],F3e=["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],z3e=["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],B3e=["onScroll"],U3e=["onWheel"],H3e=["onAnimationStart","onAnimationEnd","onAnimationIteration"],V3e=["onTransitionEnd"],q3e=["onToggle"],W3e=["onChange"],G3e=Qr(Qr(Qr(Qr(Qr(Qr(Qr(Qr(Qr(Qr(Qr(Qr(Qr(Qr(Qr(Qr(Qr(Qr([],P3e,!0),T3e,!0),k3e,!0),D3e,!0),M3e,!0),O3e,!0),I3e,!0),j3e,!0),L3e,!0),$3e,!0),F3e,!0),z3e,!0),B3e,!0),U3e,!0),H3e,!0),V3e,!0),W3e,!0),q3e,!0);function wne(t,e){var n={};return G3e.forEach(function(r){var s=t[r];s&&(e?n[r]=function(i){return s(i,e(r))}:n[r]=s)}),n}function Z_(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 K3e=function(){},Y3e=K3e;const $s=_u(Y3e);var gH=Object.prototype.hasOwnProperty;function vH(t,e,n){for(n of t.keys())if(Eg(n,e))return n}function Eg(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--&&Eg(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=vH(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=vH(e,s),!s)||!Eg(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(gH.call(t,n)&&++r&&!gH.call(e,n)||!(n in e)||!Eg(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}const _ne=S.createContext(null);function Ag({children:t,type:e}){return b.jsx("div",{className:`react-pdf__message react-pdf__message--${e}`,children:t})}const X3e="noopener noreferrer nofollow";class Q3e{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 Mn(this.pdfViewer),this.pdfViewer.currentPageNumber||0}set page(e){Mn(this.pdfViewer),this.pdfViewer.currentPageNumber=e}get rotation(){return 0}set rotation(e){}goToDestination(e){return new Promise(n=>{Mn(this.pdfDocument),Mn(e),typeof e=="string"?this.pdfDocument.getDestination(e).then(n):Array.isArray(e)?n(e):e.then(n)}).then(n=>{Mn(Array.isArray(n));const r=n[0];new Promise(s=>{Mn(this.pdfDocument),r instanceof Object?this.pdfDocument.getPageIndex(r).then(i=>{s(i)}).catch(()=>{Mn(!1)}):typeof r=="number"?s(r):Mn(!1)}).then(s=>{const i=s+1;Mn(this.pdfViewer),Mn(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;Mn(this.pdfViewer),Mn(e>=1&&e<=this.pagesCount),this.pdfViewer.scrollPageIntoView({pageIndex:n,pageNumber:e})}addLinkAttributes(e,n,r){e.href=n,e.rel=this.externalLinkRel||X3e,e.target=r?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const yH={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},UN=typeof document<"u",Sne=UN&&window.location.protocol==="file:";function Z3e(t){return typeof t<"u"}function zf(t){return Z3e(t)&&t!==null}function J3e(t){return typeof t=="string"}function e4e(t){return t instanceof ArrayBuffer}function t4e(t){return Mn(UN),t instanceof Blob}function QI(t){return J3e(t)&&/^data:/.test(t)}function bH(t){Mn(QI(t));const[e="",n=""]=t.split(",");return e.split(";").indexOf("base64")!==-1?atob(n):unescape(n)}function n4e(){return UN&&window.devicePixelRatio||1}const Cne="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function xH(){$s(!Sne,`Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ${Cne}`)}function r4e(){$s(!Sne,`Loading PDF.js worker may not work on protocols other than HTTP/HTTPS. ${Cne}`)}function Mp(t){t!=null&&t.cancel&&t.cancel()}function ZI(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 s4e(t){return t.name==="RenderingCancelledException"}function i4e(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 o4e(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 iy(){return S.useReducer(o4e,{value:void 0,error:void 0})}var a4e=function(t,e,n,r){function s(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function a(f){try{u(r.next(f))}catch(l){o(l)}}function c(f){try{u(r.throw(f))}catch(l){o(l)}}function u(f){f.done?i(f.value):s(f.value).then(a,c)}u((r=r.apply(t,e||[])).next())})},wH=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:l4e}=N3e,c4e=(t,e)=>{switch(e){case yH.NEED_PASSWORD:{const n=prompt("Enter the password to open this PDF file.");t(n);break}case yH.INCORRECT_PASSWORD:{const n=prompt("Invalid password. Please try again.");t(n);break}}};function _H(t){return typeof t=="object"&&t!==null&&("data"in t||"range"in t||"url"in t)}const u4e=S.forwardRef(function(e,n){var{children:r,className:s,error:i="Failed to load PDF file.",externalLinkRel:o,externalLinkTarget:a,file:c,inputRef:u,imageResourcesPath:f,loading:l="Loading PDF…",noData:d="No PDF file specified.",onItemClick:p,onLoadError:h,onLoadProgress:m,onLoadSuccess:y,onPassword:g=c4e,onSourceError:v,onSourceSuccess:x,options:_,renderMode:A,rotate:N}=e,T=wH(e,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[E,P]=iy(),{value:k,error:M}=E,[I,j]=iy(),{value:L,error:H}=I,K=S.useRef(new Q3e),V=S.useRef([]),U=S.useRef(void 0),Q=S.useRef(void 0);c&&c!==U.current&&_H(c)&&($s(!Eg(c,U.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.`),U.current=c),_&&_!==Q.current&&($s(!Eg(_,Q.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.`),Q.current=_);const ne=S.useRef({scrollPageIntoView:Oe=>{const{dest:Fe,pageNumber:ot,pageIndex:nt=ot-1}=Oe;if(p){p({dest:Fe,pageIndex:nt,pageNumber:ot});return}const At=V.current[nt];if(At){At.scrollIntoView();return}$s(!1,`An internal link leading to page ${ot} 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>.`)}});S.useImperativeHandle(n,()=>({linkService:K,pages:V,viewer:ne}),[]);function X(){x&&x()}function G(){M&&($s(!1,M.toString()),v&&v(M))}function Y(){P({type:"RESET"})}S.useEffect(Y,[c,P]);const Z=S.useCallback(()=>a4e(this,void 0,void 0,function*(){if(!c)return null;if(typeof c=="string")return QI(c)?{data:bH(c)}:(xH(),{url:c});if(c instanceof l4e)return{range:c};if(e4e(c))return{data:c};if(UN&&t4e(c))return{data:yield i4e(c)};if(Mn(typeof c=="object"),Mn(_H(c)),"url"in c&&typeof c.url=="string"){if(QI(c.url)){const{url:Oe}=c,Fe=wH(c,["url"]),ot=bH(Oe);return Object.assign({data:ot},Fe)}xH()}return c}),[c]);S.useEffect(()=>{const Oe=Z_(Z());return Oe.promise.then(Fe=>{P({type:"RESOLVE",value:Fe})}).catch(Fe=>{P({type:"REJECT",error:Fe})}),()=>{Mp(Oe)}},[Z,P]),S.useEffect(()=>{if(!(typeof k>"u")){if(k===!1){G();return}X()}},[k]);function he(){L&&(y&&y(L),V.current=new Array(L.numPages),K.current.setDocument(L))}function fe(){H&&($s(!1,H.toString()),h&&h(H))}S.useEffect(function(){j({type:"RESET"})},[j,k]),S.useEffect(function(){if(!k)return;const Fe=Object.assign(Object.assign({},k),_),ot=bne(Fe);m&&(ot.onProgress=m),g&&(ot.onPassword=g);const nt=ot;return nt.promise.then(At=>{j({type:"RESOLVE",value:At})}).catch(At=>{nt.destroyed||j({type:"REJECT",error:At})}),()=>{nt.destroy()}},[_,j,k]),S.useEffect(()=>{if(!(typeof L>"u")){if(L===!1){fe();return}he()}},[L]),S.useEffect(function(){K.current.setViewer(ne.current),K.current.setExternalLinkRel(o),K.current.setExternalLinkTarget(a)},[o,a]);const ce=S.useCallback((Oe,Fe)=>{V.current[Oe]=Fe},[]),xe=S.useCallback(Oe=>{delete V.current[Oe]},[]),Ne=S.useMemo(()=>({imageResourcesPath:f,linkService:K.current,onItemClick:p,pdf:L,registerPage:ce,renderMode:A,rotate:N,unregisterPage:xe}),[f,p,L,ce,A,N,xe]),pe=S.useMemo(()=>wne(T,()=>L),[T,L]);function Le(){return b.jsx(_ne.Provider,{value:Ne,children:r})}function Me(){return c?L==null?b.jsx(Ag,{type:"loading",children:typeof l=="function"?l():l}):L===!1?b.jsx(Ag,{type:"error",children:typeof i=="function"?i():i}):Le():b.jsx(Ag,{type:"no-data",children:typeof d=="function"?d():d})}return b.jsx("div",Object.assign({className:hy("react-pdf__Document",s),ref:u,style:{"--scale-factor":"1"}},pe,{children:Me()}))});function Ene(){return S.useContext(_ne)}function Ane(){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(o){typeof o=="function"?o(i):o&&(o.current=i)})}}const Rne=S.createContext(null),Nne={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},d4e=/^H(\d+)$/;function f4e(t){return t in Nne}function HN(t){return"children"in t}function Pne(t){return HN(t)?t.children.length===1&&0 in t.children&&"id"in t.children[0]:!1}function h4e(t){const e={};if(HN(t)){const{role:n}=t,r=n.match(d4e);if(r)e.role="heading",e["aria-level"]=Number(r[1]);else if(f4e(n)){const s=Nne[n];s&&(e.role=s)}}return e}function Tne(t){const e={};if(HN(t)){if(t.alt!==void 0&&(e["aria-label"]=t.alt),t.lang!==void 0&&(e.lang=t.lang),Pne(t)){const[n]=t.children;if(n){const r=Tne(n);return Object.assign(Object.assign({},e),r)}}}else"id"in t&&(e["aria-owns"]=t.id);return e}function p4e(t){return t?Object.assign(Object.assign({},h4e(t)),Tne(t)):null}function kne({className:t,node:e}){const n=S.useMemo(()=>p4e(e),[e]),r=S.useMemo(()=>!HN(e)||Pne(e)?null:e.children.map((s,i)=>b.jsx(kne,{node:s},i)),[e]);return b.jsx("span",Object.assign({className:t},n,{children:r}))}function VN(){return S.useContext(Rne)}function m4e(){const t=VN();Mn(t);const{onGetStructTreeError:e,onGetStructTreeSuccess:n}=t,[r,s]=iy(),{value:i,error:o}=r,{customTextRenderer:a,page:c}=t;function u(){i&&n&&n(i)}function f(){o&&($s(!1,o.toString()),e&&e(o))}return S.useEffect(function(){s({type:"RESET"})},[s,c]),S.useEffect(function(){if(a||!c)return;const d=Z_(c.getStructTree()),p=d;return d.promise.then(h=>{s({type:"RESOLVE",value:h})}).catch(h=>{s({type:"REJECT",error:h})}),()=>Mp(p)},[a,c,s]),S.useEffect(()=>{if(i!==void 0){if(i===!1){f();return}u()}},[i]),i?b.jsx(kne,{className:"react-pdf__Page__structTree structTree",node:i}):null}const SH=vne;function g4e(t){const e=VN();Mn(e);const n=Object.assign(Object.assign({},e),t),{_className:r,canvasBackground:s,devicePixelRatio:i=n4e(),onRenderError:o,onRenderSuccess:a,page:c,renderForms:u,renderTextLayer:f,rotate:l,scale:d}=n,{canvasRef:p}=t;Mn(c);const h=S.useRef(null);function m(){c&&a&&a(ZI(c,d))}function y(_){s4e(_)||($s(!1,_.toString()),o&&o(_))}const g=S.useMemo(()=>c.getViewport({scale:d*i,rotation:l}),[i,c,l,d]),v=S.useMemo(()=>c.getViewport({scale:d,rotation:l}),[c,l,d]);S.useEffect(function(){if(!c)return;c.cleanup();const{current:A}=h;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 N={annotationMode:u?SH.ENABLE_FORMS:SH.ENABLE,canvasContext:A.getContext("2d",{alpha:!1}),viewport:g};s&&(N.background=s);const T=c.render(N),E=T;return T.promise.then(()=>{A.style.visibility="",m()}).catch(y),()=>Mp(E)},[s,c,u,g,v]);const x=S.useCallback(()=>{const{current:_}=h;_&&(_.width=0,_.height=0)},[]);return S.useEffect(()=>x,[x]),b.jsx("canvas",{className:`${r}__canvas`,dir:"ltr",ref:Ane(p,h),style:{display:"block",userSelect:"none"},children:f?b.jsx(m4e,{}):null})}function v4e(t){return"str"in t}function y4e(){const t=VN();Mn(t);const{customTextRenderer:e,onGetTextError:n,onGetTextSuccess:r,onRenderTextLayerError:s,onRenderTextLayerSuccess:i,page:o,pageIndex:a,pageNumber:c,rotate:u,scale:f}=t;Mn(o);const[l,d]=iy(),{value:p,error:h}=l,m=S.useRef(null),y=S.useRef(void 0);$s(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(){p&&r&&r(p)}function v(){h&&($s(!1,h.toString()),n&&n(h))}S.useEffect(function(){d({type:"RESET"})},[o,d]),S.useEffect(function(){if(!o)return;const P=Z_(o.getTextContent()),k=P;return P.promise.then(M=>{d({type:"RESOLVE",value:M})}).catch(M=>{d({type:"REJECT",error:M})}),()=>Mp(k)},[o,d]),S.useEffect(()=>{if(p!==void 0){if(p===!1){v();return}g()}},[p]);const x=S.useCallback(()=>{i&&i()},[i]),_=S.useCallback(E=>{$s(!1,E.toString()),s&&s(E)},[s]);function A(){const E=y.current;E&&E.classList.add("active")}function N(){const E=y.current;E&&E.classList.remove("active")}const T=S.useMemo(()=>o.getViewport({scale:f,rotation:u}),[o,u,f]);return S.useLayoutEffect(function(){if(!o||!p)return;const{current:P}=m;if(!P)return;P.innerHTML="";const k=o.streamTextContent({includeMarkedContent:!0}),M={container:P,textContentSource:k,viewport:T},I=new yne(M),j=I;return I.render().then(()=>{const L=document.createElement("div");L.className="endOfContent",P.append(L),y.current=L;const H=P.querySelectorAll('[role="presentation"]');if(e){let K=0;p.items.forEach((V,U)=>{if(!v4e(V))return;const Q=H[K];if(!Q)return;const ne=e(Object.assign({pageIndex:a,pageNumber:c,itemIndex:U},V));Q.innerHTML=ne,K+=V.str&&V.hasEOL?2:1})}x()}).catch(_),()=>Mp(j)},[e,_,x,o,a,c,p,T]),b.jsx("div",{className:hy("react-pdf__Page__textContent","textLayer"),onMouseUp:N,onMouseDown:A,ref:m})}function b4e(){const t=Ene(),e=VN();Mn(e);const n=Object.assign(Object.assign({},t),e),{imageResourcesPath:r,linkService:s,onGetAnnotationsError:i,onGetAnnotationsSuccess:o,onRenderAnnotationLayerError:a,onRenderAnnotationLayerSuccess:c,page:u,pdf:f,renderForms:l,rotate:d,scale:p=1}=n;Mn(f),Mn(u),Mn(s);const[h,m]=iy(),{value:y,error:g}=h,v=S.useRef(null);$s(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 x(){y&&o&&o(y)}function _(){g&&($s(!1,g.toString()),i&&i(g))}S.useEffect(function(){m({type:"RESET"})},[m,u]),S.useEffect(function(){if(!u)return;const P=Z_(u.getAnnotations()),k=P;return P.promise.then(M=>{m({type:"RESOLVE",value:M})}).catch(M=>{m({type:"REJECT",error:M})}),()=>{Mp(k)}},[m,u]),S.useEffect(()=>{if(y!==void 0){if(y===!1){_();return}x()}},[y]);function A(){c&&c()}function N(E){$s(!1,`${E}`),a&&a(E)}const T=S.useMemo(()=>u.getViewport({scale:p,rotation:d}),[u,d,p]);return S.useEffect(function(){if(!f||!u||!s||!y)return;const{current:P}=v;if(!P)return;const k=T.clone({dontFlip:!0}),M={accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,div:P,l10n:null,page:u,viewport:k},I={annotations:y,annotationStorage:f.annotationStorage,div:P,imageResourcesPath:r,linkService:s,page:u,renderForms:l,viewport:k};P.innerHTML="";try{new gne(M).render(I),A()}catch(j){N(j)}return()=>{}},[y,r,s,u,f,l,T]),b.jsx("div",{className:hy("react-pdf__Page__annotations","annotationLayer"),ref:v})}var x4e=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 CH=1;function EH(t){const e=Ene(),n=Object.assign(Object.assign({},e),t),{_className:r="react-pdf__Page",_enableRegisterUnregisterPage:s=!0,canvasBackground:i,canvasRef:o,children:a,className:c,customRenderer:u,customTextRenderer:f,devicePixelRatio:l,error:d="Failed to load the page.",height:p,inputRef:h,loading:m="Loading page…",noData:y="No page specified.",onGetAnnotationsError:g,onGetAnnotationsSuccess:v,onGetStructTreeError:x,onGetStructTreeSuccess:_,onGetTextError:A,onGetTextSuccess:N,onLoadError:T,onLoadSuccess:E,onRenderAnnotationLayerError:P,onRenderAnnotationLayerSuccess:k,onRenderError:M,onRenderSuccess:I,onRenderTextLayerError:j,onRenderTextLayerSuccess:L,pageIndex:H,pageNumber:K,pdf:V,registerPage:U,renderAnnotationLayer:Q=!0,renderForms:ne=!1,renderMode:X="canvas",renderTextLayer:G=!0,rotate:Y,scale:Z=CH,unregisterPage:he,width:fe}=n,ce=x4e(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"]),[xe,Ne]=iy(),{value:pe,error:Le}=xe,Me=S.useRef(null);Mn(V);const Oe=zf(K)?K-1:H??null,Fe=K??(zf(H)?H+1:null),ot=Y??(pe?pe.rotate:null),nt=S.useMemo(()=>{if(!pe)return null;let gt=1;const kt=Z??CH;if(fe||p){const ln=pe.getViewport({scale:1,rotation:ot});fe?gt=fe/ln.width:p&&(gt=p/ln.height)}return kt*gt},[p,pe,ot,Z,fe]);S.useEffect(function(){return()=>{zf(Oe)&&s&&he&&he(Oe)}},[s,V,Oe,he]);function At(){if(E){if(!pe||!nt)return;E(ZI(pe,nt))}if(s&&U){if(!zf(Oe)||!Me.current)return;U(Oe,Me.current)}}function ee(){Le&&($s(!1,Le.toString()),T&&T(Le))}S.useEffect(function(){Ne({type:"RESET"})},[Ne,V,Oe]),S.useEffect(function(){if(!V||!Fe)return;const kt=Z_(V.getPage(Fe)),ln=kt;return kt.promise.then(gr=>{Ne({type:"RESOLVE",value:gr})}).catch(gr=>{Ne({type:"REJECT",error:gr})}),()=>Mp(ln)},[Ne,V,Fe]),S.useEffect(()=>{if(pe!==void 0){if(pe===!1){ee();return}At()}},[pe,nt]);const de=S.useMemo(()=>pe&&zf(Oe)&&Fe&&zf(ot)&&zf(nt)?{_className:r,canvasBackground:i,customTextRenderer:f,devicePixelRatio:l,onGetAnnotationsError:g,onGetAnnotationsSuccess:v,onGetStructTreeError:x,onGetStructTreeSuccess:_,onGetTextError:A,onGetTextSuccess:N,onRenderAnnotationLayerError:P,onRenderAnnotationLayerSuccess:k,onRenderError:M,onRenderSuccess:I,onRenderTextLayerError:j,onRenderTextLayerSuccess:L,page:pe,pageIndex:Oe,pageNumber:Fe,renderForms:ne,renderTextLayer:G,rotate:ot,scale:nt}:null,[r,i,f,l,g,v,x,_,A,N,P,k,M,I,j,L,pe,Oe,Fe,ne,G,ot,nt]),me=S.useMemo(()=>wne(ce,()=>pe&&(nt?ZI(pe,nt):void 0)),[ce,pe,nt]),Re=`${Oe}@${nt}/${ot}`;function Pe(){switch(X){case"custom":return Mn(u),b.jsx(u,{},`${Re}_custom`);case"none":return null;case"canvas":default:return b.jsx(g4e,{canvasRef:o},`${Re}_canvas`)}}function Ee(){return G?b.jsx(y4e,{},`${Re}_text`):null}function Ve(){return Q?b.jsx(b4e,{},`${Re}_annotations`):null}function tt(){return b.jsxs(Rne.Provider,{value:de,children:[Pe(),Ee(),Ve(),a]})}function qt(){return Fe?V===null||pe===void 0||pe===null?b.jsx(Ag,{type:"loading",children:typeof m=="function"?m():m}):V===!1||pe===!1?b.jsx(Ag,{type:"error",children:typeof d=="function"?d():d}):tt():b.jsx(Ag,{type:"no-data",children:typeof y=="function"?y():y})}return b.jsx("div",Object.assign({className:hy(r,c),"data-page-number":Fe,ref:Ane(h,Me),style:{"--scale-factor":`${nt}`,backgroundColor:i||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},me,{children:qt()}))}r4e();iF.workerSrc="pdf.worker.mjs";iF.workerSrc=`//unpkg.com/pdfjs-dist@${xne}/build/pdf.worker.min.mjs`;const km=800,w4e={},_4e=({file:t,onThumbnailClick:e,className:n})=>{const[r,s]=S.useState(0),[i,o]=S.useState(1),[a,c]=S.useState(void 0),[u,f]=S.useState(null),[l,d]=S.useState(),p=S.useCallback(A=>{const[N]=A;N&&d(N.contentRect.width)},[]);F2e(u,w4e,p);const h=S.useCallback(()=>{c(i)},[c,i]);function m({numPages:A}){o(1),s(A)}const y=S.useCallback(A=>o(N=>A>0?Math.min(N+A,r):Math.max(N+A,1)),[r]),g=S.useCallback(()=>y(1),[y]),v=S.useCallback(()=>y(-1),[y]),x=S.useMemo(()=>a!==i,[a,i]),_=S.useMemo(()=>({cMapUrl:"/cmaps/",standardFontDataUrl:"/standard_fonts/"}),[]);return b.jsxs("div",{className:ie("flex flex-col cursor-default text-center",n),ref:f,children:[b.jsxs(u4e,{file:t,onLoadSuccess:m,loading:b.jsx(bee,{className:"w-full mx-auto mt-32"}),options:_,className:ie(`w-full aspect-[3/4] relative bg-white shadow w-[${l?Math.min(l,km):km}]`,e?"cursor-pointer":""),children:[b.jsx(EH,{className:x&&a?"visible":"hidden",pageNumber:a,canvasBackground:"white",width:l?Math.min(l,km):km,onClick:()=>e?e():null},`page_${a}`),b.jsx(EH,{className:ie(x&&a?"hidden":"visible","text-center"),pageNumber:i,canvasBackground:"white",onRenderSuccess:h,width:l?Math.min(l,km):km,onClick:()=>e?e():null},i)]}),b.jsxs("div",{className:"flex flex-row justify-center w-full mt-4 space-x-4",children:[b.jsxs(qe,{type:"button",variant:"outline",className:"w-8 h-8 p-0",onClick:v,disabled:x,children:[b.jsx("span",{className:"sr-only",children:te("common.go_to_prev_page")}),b.jsx(nR,{className:"w-4 h-4"})]}),b.jsxs(qe,{type:"button",variant:"outline",className:"w-8 h-8 p-0",onClick:g,disabled:x,children:[b.jsx("span",{className:"sr-only",children:te("common.go_to_next_page")}),b.jsx(fy,{className:"w-4 h-4"})]})]}),b.jsx("p",{className:"mt-4 text-sm font-medium text-center",children:te("common.num_page_of_total",{count:i,total:r})})]})},oy=({children:t})=>{const e=wf(),n=S.useId(),{isSuccess:r,isLoading:s,data:{authenticated:i=!1,redirectTo:o="/login"}={}}=Ghe(),{isSuccess:a,isLoading:c,error:u,data:f}=iL({enabled:r&&i});return s||c?b.jsx(Yl,{}):u?(console.error("Error loading profile:",u),b.jsx(_f,{subtitle:u.message})):r&&!i||a&&!(f!=null&&f.id)?b.jsx(tJ,{to:o,state:{from:e},replace:!0}):b.jsx("div",{id:`${n}-${f==null?void 0:f.lang_code}`,children:t??null})},H1={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"}},S4e=S.forwardRef(({status:t,isEditable:e,className:n,...r},s)=>b.jsx("div",{ref:s,children:b.jsxs(gR,{className:ie(H1[t].bgColor,H1[t].color,H1[t].hoverBgColor,H1[t].hoverColor,"transition-colors duration-200 cursor-pointer flex items-center group",n),...r,children:[te(`quotes.status.${t}`),e&&b.jsx(vq,{className:"w-3 h-3 ml-2 transition-opacity opacity-0 group-hover:opacity-100"})]})}));function C4e(){return null}const nm=()=>{const t=S.useContext(gJ);if(t===null)throw new Error("useDataTableContext must be used within a DataTableProvider");return t};function qN({data:t,columns:e,pageCount:n,enableSorting:r=!1,enableHiding:s=!1,enableRowSelection:i=!1,initialState:o,onPaginationChange:a}){const{pagination:c,setPagination:u,sorting:f}=nm(),[l,d]=oe.useState({}),[p,h]=oe.useState((o==null?void 0:o.columnVisibility)||{}),m=x=>{if(typeof x=="function"){const _=x(c);u(_)}a&&a(x)},y=x=>{},g=S.useCallback(()=>{const x=e;return i&&x.unshift(LLe()),x},[e,i]);return{table:NJ({data:t,columns:g(),pageCount:n??-1,getCoreRowModel:AJ(),initialState:o,state:{pagination:c,sorting:f,columnVisibility:p,rowSelection:l},enableRowSelection:i,onRowSelectionChange:d,manualSorting:!0,enableSorting:r,getSortedRowModel:LIe(),onSortingChange:y,enableHiding:s,onColumnVisibilityChange:h,manualPagination:!0,onPaginationChange:m,manualFiltering:!0,getFilteredRowModel:jIe(),getFacetedRowModel:OIe(),getFacetedUniqueValues:IIe(),debugTable:!1,debugHeaders:!1,debugColumns:!1,defaultColumn:{minSize:0,size:Number.MAX_SAFE_INTEGER,maxSize:Number.MAX_SAFE_INTEGER}})}}const E4e=({setSize:t,setControllerCallback:e,setPercentageCallback:n,setErrorCallback:r})=>s=>{if(!s.ok)throw Error(`${s.status} ${s.type} ${s.statusText}`);if(!s.body)throw Error("ReadableStream not yet supported in this browser.");const i=s.body,o=s.headers.get("content-encoding"),a=s.headers.get(o?"x-file-size":"content-length"),c=parseInt(a||"0",10);t(()=>c);let u=0;const f=new ReadableStream({start(l){e(l);const d=i.getReader();async function p(){return d.read().then(({done:h,value:m})=>h?l.close():(u+=(m==null?void 0:m.byteLength)||0,m&&l.enqueue(m),n({loaded:u,total:c}),p())).catch(h=>(r(h),d.cancel("Cancelled"),l.error(h)))}return p()}});return new Response(f)},AH=(t,e,n)=>{const r=[t],s=new Blob(r,{type:n||"application/octet-stream"});if(typeof window.navigator.msSaveBlob<"u")return window.navigator.msSaveBlob(s,e);const i=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(s):window.webkitURL.createObjectURL(s),o=document.createElement("a");return o.style.display="none",o.href=i,o.setAttribute("download",e),typeof o.download>"u"&&o.setAttribute("target","_blank"),document.body.appendChild(o),o.click(),setTimeout(()=>{document.body.removeChild(o),window.URL.revokeObjectURL(i)},200)};function RH({customHandleDownload:t,...e}={}){var _;let n=!1;try{n=process?!!((_=process==null?void 0:process.env)!=null&&_.REACT_APP_DEBUG_MODE):!1}catch{n=!1}const[r,s]=S.useState(0),[i,o]=S.useState(0),[a,c]=S.useState(0),[u,f]=S.useState(null),[l,d]=S.useState(!1),p=S.useRef(null),h=S.useCallback(({loaded:A,total:N})=>{const T=Math.round(A/N*100);o(()=>T)},[]),m=S.useCallback(A=>{const N={"Failed to execute 'enqueue' on 'ReadableStreamDefaultController': Cannot enqueue a chunk into an errored readable stream":"Download canceled","The user aborted a request.":"Download timed out"};f(()=>({errorMessage:N[A.message]?N[A.message]:A.message}))},[]),y=S.useCallback(A=>{p.current=A},[]),g=S.useCallback(()=>{p.current&&p.current.error()},[]),v=S.useCallback(()=>{y(null),s(()=>0),o(()=>0),c(()=>0),d(()=>!1)},[y]),x=S.useCallback(async(A,N,T=0,E={})=>{if(l)return null;v(),f(()=>null),d(()=>!0);const P=setInterval(()=>s(L=>L+1),n?1:1e3),k=E4e({setSize:c,setControllerCallback:y,setPercentageCallback:h,setErrorCallback:m}),M=new AbortController,I=setTimeout(()=>{T>0&&M.abort()},T),j=t||AH;try{const L=await fetch(A,{method:"GET",...e,...E,signal:M.signal}),K=await k(L).blob();j(K,N),v()}catch(L){v(),f(H=>{const{message:K}=L;return K!=="Failed to fetch"?{errorMessage:K}:H}),clearTimeout(I)}finally{clearInterval(P)}},[l,v,n,y,h,m,e,t]);return S.useMemo(()=>({elapsed:r,percentage:i,size:a,download:x,cancel:g,error:u,isInProgress:l,jsDownload:AH}),[r,i,a,x,g,u,l])}const A4e=()=>{const{i18n:t}=K$();return Dne({locale:t.language})},Dne=t=>{const{locale:e}=t,n=S.useCallback(i=>{if(i==null)return"";const{amount:o,scale:a,currency_code:c}=i;return new Intl.NumberFormat(e??"ES",{style:"currency",currency:c,currencyDisplay:"symbol",useGrouping:!0,maximumFractionDigits:a}).format(o===null?0:_O({amount:o,scale:a}))},[e]),r=S.useCallback(i=>{if(i==null)return"";const{amount:o,scale:a}=i;return new Intl.NumberFormat("es",{minimumFractionDigits:a,useGrouping:!0}).format(o===null?0:_O({amount:o,scale:a}))},[e]),s=S.useCallback(i=>{if(i==null)return"";const{amount:o,scale:a}=i;return new Intl.NumberFormat(e,{style:"decimal",minimumFractionDigits:a}).format(o===null?0:o)},[e]);return{formatCurrency:n,formatNumber:r,formatPercentage:s}};function Mne(t){const[e,n]=S.useState(!1);return S.useEffect(()=>{function r(i){n(i.matches)}const s=matchMedia(t);return s.addEventListener("change",r),n(s.matches),()=>s.removeEventListener("change",r)},[t]),e}var oF={},J_={},One={exports:{}};function R4e(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 cD={exports:{}};const N4e={},c0=Object.freeze(Object.defineProperty({__proto__:null,default:N4e},Symbol.toStringTag,{value:"Module"})),P4e=Pue(c0);var NH;function Cf(){return NH||(NH=1,function(t,e){(function(n,r){t.exports=r()})(pr,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 pr<"u"&&pr.crypto&&(i=pr.crypto),!i&&typeof R4e=="function")try{i=P4e}catch{}var o=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.")},a=Object.create||function(){function v(){}return function(x){var _;return v.prototype=x,_=new v,v.prototype=null,_}}(),c={},u=c.lib={},f=u.Base=function(){return{extend:function(v){var x=a(this);return v&&x.mixIn(v),(!x.hasOwnProperty("init")||this.init===x.init)&&(x.init=function(){x.$super.init.apply(this,arguments)}),x.init.prototype=x,x.$super=this,x},create:function(){var v=this.extend();return v.init.apply(v,arguments),v},init:function(){},mixIn:function(v){for(var x in v)v.hasOwnProperty(x)&&(this[x]=v[x]);v.hasOwnProperty("toString")&&(this.toString=v.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),l=u.WordArray=f.extend({init:function(v,x){v=this.words=v||[],x!=s?this.sigBytes=x:this.sigBytes=v.length*4},toString:function(v){return(v||p).stringify(this)},concat:function(v){var x=this.words,_=v.words,A=this.sigBytes,N=v.sigBytes;if(this.clamp(),A%4)for(var T=0;T<N;T++){var E=_[T>>>2]>>>24-T%4*8&255;x[A+T>>>2]|=E<<24-(A+T)%4*8}else for(var P=0;P<N;P+=4)x[A+P>>>2]=_[P>>>2];return this.sigBytes+=N,this},clamp:function(){var v=this.words,x=this.sigBytes;v[x>>>2]&=4294967295<<32-x%4*8,v.length=r.ceil(x/4)},clone:function(){var v=f.clone.call(this);return v.words=this.words.slice(0),v},random:function(v){for(var x=[],_=0;_<v;_+=4)x.push(o());return new l.init(x,v)}}),d=c.enc={},p=d.Hex={stringify:function(v){for(var x=v.words,_=v.sigBytes,A=[],N=0;N<_;N++){var T=x[N>>>2]>>>24-N%4*8&255;A.push((T>>>4).toString(16)),A.push((T&15).toString(16))}return A.join("")},parse:function(v){for(var x=v.length,_=[],A=0;A<x;A+=2)_[A>>>3]|=parseInt(v.substr(A,2),16)<<24-A%8*4;return new l.init(_,x/2)}},h=d.Latin1={stringify:function(v){for(var x=v.words,_=v.sigBytes,A=[],N=0;N<_;N++){var T=x[N>>>2]>>>24-N%4*8&255;A.push(String.fromCharCode(T))}return A.join("")},parse:function(v){for(var x=v.length,_=[],A=0;A<x;A++)_[A>>>2]|=(v.charCodeAt(A)&255)<<24-A%4*8;return new l.init(_,x)}},m=d.Utf8={stringify:function(v){try{return decodeURIComponent(escape(h.stringify(v)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(v){return h.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=m.parse(v)),this._data.concat(v),this._nDataBytes+=v.sigBytes},_process:function(v){var x,_=this._data,A=_.words,N=_.sigBytes,T=this.blockSize,E=T*4,P=N/E;v?P=r.ceil(P):P=r.max((P|0)-this._minBufferSize,0);var k=P*T,M=r.min(k*4,N);if(k){for(var I=0;I<k;I+=T)this._doProcessBlock(A,I);x=A.splice(0,k),_.sigBytes-=M}return new l.init(x,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 x=this._doFinalize();return x},blockSize:16,_createHelper:function(v){return function(x,_){return new v.init(_).finalize(x)}},_createHmacHelper:function(v){return function(x,_){return new g.HMAC.init(v,_).finalize(x)}}});var g=c.algo={};return c}(Math);return n})}(cD)),cD.exports}(function(t,e){(function(n,r){t.exports=r(Cf())})(pr,function(n){return n.enc.Utf8})})(One);var T4e=One.exports,Ine={exports:{}},uD={exports:{}},PH;function k4e(){return PH||(PH=1,function(t,e){(function(n,r){t.exports=r(Cf())})(pr,function(n){return function(){var r=n,s=r.lib,i=s.WordArray,o=r.enc;o.Base64={stringify:function(c){var u=c.words,f=c.sigBytes,l=this._map;c.clamp();for(var d=[],p=0;p<f;p+=3)for(var h=u[p>>>2]>>>24-p%4*8&255,m=u[p+1>>>2]>>>24-(p+1)%4*8&255,y=u[p+2>>>2]>>>24-(p+2)%4*8&255,g=h<<16|m<<8|y,v=0;v<4&&p+v*.75<f;v++)d.push(l.charAt(g>>>6*(3-v)&63));var x=l.charAt(64);if(x)for(;d.length%4;)d.push(x);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 p=f.charAt(64);if(p){var h=c.indexOf(p);h!==-1&&(u=h)}return a(c,u,l)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function a(c,u,f){for(var l=[],d=0,p=0;p<u;p++)if(p%4){var h=f[c.charCodeAt(p-1)]<<p%4*2,m=f[c.charCodeAt(p)]>>>6-p%4*2,y=h|m;l[d>>>2]|=y<<24-d%4*8,d++}return i.create(l,d)}}(),n.enc.Base64})}(uD)),uD.exports}var dD={exports:{}},TH;function D4e(){return TH||(TH=1,function(t,e){(function(n,r){t.exports=r(Cf())})(pr,function(n){return function(r){var s=n,i=s.lib,o=i.WordArray,a=i.Hasher,c=s.algo,u=[];(function(){for(var m=0;m<64;m++)u[m]=r.abs(r.sin(m+1))*4294967296|0})();var f=c.MD5=a.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(m,y){for(var g=0;g<16;g++){var v=y+g,x=m[v];m[v]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}var _=this._hash.words,A=m[y+0],N=m[y+1],T=m[y+2],E=m[y+3],P=m[y+4],k=m[y+5],M=m[y+6],I=m[y+7],j=m[y+8],L=m[y+9],H=m[y+10],K=m[y+11],V=m[y+12],U=m[y+13],Q=m[y+14],ne=m[y+15],X=_[0],G=_[1],Y=_[2],Z=_[3];X=l(X,G,Y,Z,A,7,u[0]),Z=l(Z,X,G,Y,N,12,u[1]),Y=l(Y,Z,X,G,T,17,u[2]),G=l(G,Y,Z,X,E,22,u[3]),X=l(X,G,Y,Z,P,7,u[4]),Z=l(Z,X,G,Y,k,12,u[5]),Y=l(Y,Z,X,G,M,17,u[6]),G=l(G,Y,Z,X,I,22,u[7]),X=l(X,G,Y,Z,j,7,u[8]),Z=l(Z,X,G,Y,L,12,u[9]),Y=l(Y,Z,X,G,H,17,u[10]),G=l(G,Y,Z,X,K,22,u[11]),X=l(X,G,Y,Z,V,7,u[12]),Z=l(Z,X,G,Y,U,12,u[13]),Y=l(Y,Z,X,G,Q,17,u[14]),G=l(G,Y,Z,X,ne,22,u[15]),X=d(X,G,Y,Z,N,5,u[16]),Z=d(Z,X,G,Y,M,9,u[17]),Y=d(Y,Z,X,G,K,14,u[18]),G=d(G,Y,Z,X,A,20,u[19]),X=d(X,G,Y,Z,k,5,u[20]),Z=d(Z,X,G,Y,H,9,u[21]),Y=d(Y,Z,X,G,ne,14,u[22]),G=d(G,Y,Z,X,P,20,u[23]),X=d(X,G,Y,Z,L,5,u[24]),Z=d(Z,X,G,Y,Q,9,u[25]),Y=d(Y,Z,X,G,E,14,u[26]),G=d(G,Y,Z,X,j,20,u[27]),X=d(X,G,Y,Z,U,5,u[28]),Z=d(Z,X,G,Y,T,9,u[29]),Y=d(Y,Z,X,G,I,14,u[30]),G=d(G,Y,Z,X,V,20,u[31]),X=p(X,G,Y,Z,k,4,u[32]),Z=p(Z,X,G,Y,j,11,u[33]),Y=p(Y,Z,X,G,K,16,u[34]),G=p(G,Y,Z,X,Q,23,u[35]),X=p(X,G,Y,Z,N,4,u[36]),Z=p(Z,X,G,Y,P,11,u[37]),Y=p(Y,Z,X,G,I,16,u[38]),G=p(G,Y,Z,X,H,23,u[39]),X=p(X,G,Y,Z,U,4,u[40]),Z=p(Z,X,G,Y,A,11,u[41]),Y=p(Y,Z,X,G,E,16,u[42]),G=p(G,Y,Z,X,M,23,u[43]),X=p(X,G,Y,Z,L,4,u[44]),Z=p(Z,X,G,Y,V,11,u[45]),Y=p(Y,Z,X,G,ne,16,u[46]),G=p(G,Y,Z,X,T,23,u[47]),X=h(X,G,Y,Z,A,6,u[48]),Z=h(Z,X,G,Y,I,10,u[49]),Y=h(Y,Z,X,G,Q,15,u[50]),G=h(G,Y,Z,X,k,21,u[51]),X=h(X,G,Y,Z,V,6,u[52]),Z=h(Z,X,G,Y,E,10,u[53]),Y=h(Y,Z,X,G,H,15,u[54]),G=h(G,Y,Z,X,N,21,u[55]),X=h(X,G,Y,Z,j,6,u[56]),Z=h(Z,X,G,Y,ne,10,u[57]),Y=h(Y,Z,X,G,M,15,u[58]),G=h(G,Y,Z,X,U,21,u[59]),X=h(X,G,Y,Z,P,6,u[60]),Z=h(Z,X,G,Y,K,10,u[61]),Y=h(Y,Z,X,G,T,15,u[62]),G=h(G,Y,Z,X,L,21,u[63]),_[0]=_[0]+X|0,_[1]=_[1]+G|0,_[2]=_[2]+Y|0,_[3]=_[3]+Z|0},_doFinalize:function(){var m=this._data,y=m.words,g=this._nDataBytes*8,v=m.sigBytes*8;y[v>>>5]|=128<<24-v%32;var x=r.floor(g/4294967296),_=g;y[(v+64>>>9<<4)+15]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,y[(v+64>>>9<<4)+14]=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,m.sigBytes=(y.length+1)*4,this._process();for(var A=this._hash,N=A.words,T=0;T<4;T++){var E=N[T];N[T]=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360}return A},clone:function(){var m=a.clone.call(this);return m._hash=this._hash.clone(),m}});function l(m,y,g,v,x,_,A){var N=m+(y&g|~y&v)+x+A;return(N<<_|N>>>32-_)+y}function d(m,y,g,v,x,_,A){var N=m+(y&v|g&~v)+x+A;return(N<<_|N>>>32-_)+y}function p(m,y,g,v,x,_,A){var N=m+(y^g^v)+x+A;return(N<<_|N>>>32-_)+y}function h(m,y,g,v,x,_,A){var N=m+(g^(y|~v))+x+A;return(N<<_|N>>>32-_)+y}s.MD5=a._createHelper(f),s.HmacMD5=a._createHmacHelper(f)}(Math),n.MD5})}(dD)),dD.exports}var fD={exports:{}},hD={exports:{}},kH;function M4e(){return kH||(kH=1,function(t,e){(function(n,r){t.exports=r(Cf())})(pr,function(n){return function(){var r=n,s=r.lib,i=s.WordArray,o=s.Hasher,a=r.algo,c=[],u=a.SHA1=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(f,l){for(var d=this._hash.words,p=d[0],h=d[1],m=d[2],y=d[3],g=d[4],v=0;v<80;v++){if(v<16)c[v]=f[l+v]|0;else{var x=c[v-3]^c[v-8]^c[v-14]^c[v-16];c[v]=x<<1|x>>>31}var _=(p<<5|p>>>27)+g+c[v];v<20?_+=(h&m|~h&y)+1518500249:v<40?_+=(h^m^y)+1859775393:v<60?_+=(h&m|h&y|m&y)-1894007588:_+=(h^m^y)-899497514,g=y,y=m,m=h<<30|h>>>2,h=p,p=_}d[0]=d[0]+p|0,d[1]=d[1]+h|0,d[2]=d[2]+m|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,p=f.sigBytes*8;return l[p>>>5]|=128<<24-p%32,l[(p+64>>>9<<4)+14]=Math.floor(d/4294967296),l[(p+64>>>9<<4)+15]=d,f.sigBytes=l.length*4,this._process(),this._hash},clone:function(){var f=o.clone.call(this);return f._hash=this._hash.clone(),f}});r.SHA1=o._createHelper(u),r.HmacSHA1=o._createHmacHelper(u)}(),n.SHA1})}(hD)),hD.exports}var pD={exports:{}},DH;function O4e(){return DH||(DH=1,function(t,e){(function(n,r){t.exports=r(Cf())})(pr,function(n){(function(){var r=n,s=r.lib,i=s.Base,o=r.enc,a=o.Utf8,c=r.algo;c.HMAC=i.extend({init:function(u,f){u=this._hasher=new u.init,typeof f=="string"&&(f=a.parse(f));var l=u.blockSize,d=l*4;f.sigBytes>d&&(f=u.finalize(f)),f.clamp();for(var p=this._oKey=f.clone(),h=this._iKey=f.clone(),m=p.words,y=h.words,g=0;g<l;g++)m[g]^=1549556828,y[g]^=909522486;p.sigBytes=h.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}})})()})}(pD)),pD.exports}var MH;function jne(){return MH||(MH=1,function(t,e){(function(n,r,s){t.exports=r(Cf(),M4e(),O4e())})(pr,function(n){return function(){var r=n,s=r.lib,i=s.Base,o=s.WordArray,a=r.algo,c=a.MD5,u=a.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,p=this.cfg,h=p.hasher.create(),m=o.create(),y=m.words,g=p.keySize,v=p.iterations;y.length<g;){d&&h.update(d),d=h.update(f).finalize(l),h.reset();for(var x=1;x<v;x++)d=h.finalize(d),h.reset();m.concat(d)}return m.sigBytes=g*4,m}});r.EvpKDF=function(f,l,d){return u.create(d).compute(f,l)}}(),n.EvpKDF})}(fD)),fD.exports}var mD={exports:{}},OH;function I4e(){return OH||(OH=1,function(t,e){(function(n,r,s){t.exports=r(Cf(),jne())})(pr,function(n){n.lib.Cipher||function(r){var s=n,i=s.lib,o=i.Base,a=i.WordArray,c=i.BufferedBlockAlgorithm,u=s.enc;u.Utf8;var f=u.Base64,l=s.algo,d=l.EvpKDF,p=i.Cipher=c.extend({cfg:o.extend(),createEncryptor:function(k,M){return this.create(this._ENC_XFORM_MODE,k,M)},createDecryptor:function(k,M){return this.create(this._DEC_XFORM_MODE,k,M)},init:function(k,M,I){this.cfg=this.cfg.extend(I),this._xformMode=k,this._key=M,this.reset()},reset:function(){c.reset.call(this),this._doReset()},process:function(k){return this._append(k),this._process()},finalize:function(k){k&&this._append(k);var M=this._doFinalize();return M},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function k(M){return typeof M=="string"?P:N}return function(M){return{encrypt:function(I,j,L){return k(j).encrypt(M,I,j,L)},decrypt:function(I,j,L){return k(j).decrypt(M,I,j,L)}}}}()});i.StreamCipher=p.extend({_doFinalize:function(){var k=this._process(!0);return k},blockSize:1});var h=s.mode={},m=i.BlockCipherMode=o.extend({createEncryptor:function(k,M){return this.Encryptor.create(k,M)},createDecryptor:function(k,M){return this.Decryptor.create(k,M)},init:function(k,M){this._cipher=k,this._iv=M}}),y=h.CBC=function(){var k=m.extend();k.Encryptor=k.extend({processBlock:function(I,j){var L=this._cipher,H=L.blockSize;M.call(this,I,j,H),L.encryptBlock(I,j),this._prevBlock=I.slice(j,j+H)}}),k.Decryptor=k.extend({processBlock:function(I,j){var L=this._cipher,H=L.blockSize,K=I.slice(j,j+H);L.decryptBlock(I,j),M.call(this,I,j,H),this._prevBlock=K}});function M(I,j,L){var H,K=this._iv;K?(H=K,this._iv=r):H=this._prevBlock;for(var V=0;V<L;V++)I[j+V]^=H[V]}return k}(),g=s.pad={},v=g.Pkcs7={pad:function(k,M){for(var I=M*4,j=I-k.sigBytes%I,L=j<<24|j<<16|j<<8|j,H=[],K=0;K<j;K+=4)H.push(L);var V=a.create(H,j);k.concat(V)},unpad:function(k){var M=k.words[k.sigBytes-1>>>2]&255;k.sigBytes-=M}};i.BlockCipher=p.extend({cfg:p.cfg.extend({mode:y,padding:v}),reset:function(){var k;p.reset.call(this);var M=this.cfg,I=M.iv,j=M.mode;this._xformMode==this._ENC_XFORM_MODE?k=j.createEncryptor:(k=j.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==k?this._mode.init(this,I&&I.words):(this._mode=k.call(j,this,I&&I.words),this._mode.__creator=k)},_doProcessBlock:function(k,M){this._mode.processBlock(k,M)},_doFinalize:function(){var k,M=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(M.pad(this._data,this.blockSize),k=this._process(!0)):(k=this._process(!0),M.unpad(k)),k},blockSize:128/32});var x=i.CipherParams=o.extend({init:function(k){this.mixIn(k)},toString:function(k){return(k||this.formatter).stringify(this)}}),_=s.format={},A=_.OpenSSL={stringify:function(k){var M,I=k.ciphertext,j=k.salt;return j?M=a.create([1398893684,1701076831]).concat(j).concat(I):M=I,M.toString(f)},parse:function(k){var M,I=f.parse(k),j=I.words;return j[0]==1398893684&&j[1]==1701076831&&(M=a.create(j.slice(2,4)),j.splice(0,4),I.sigBytes-=16),x.create({ciphertext:I,salt:M})}},N=i.SerializableCipher=o.extend({cfg:o.extend({format:A}),encrypt:function(k,M,I,j){j=this.cfg.extend(j);var L=k.createEncryptor(I,j),H=L.finalize(M),K=L.cfg;return x.create({ciphertext:H,key:I,iv:K.iv,algorithm:k,mode:K.mode,padding:K.padding,blockSize:k.blockSize,formatter:j.format})},decrypt:function(k,M,I,j){j=this.cfg.extend(j),M=this._parse(M,j.format);var L=k.createDecryptor(I,j).finalize(M.ciphertext);return L},_parse:function(k,M){return typeof k=="string"?M.parse(k,this):k}}),T=s.kdf={},E=T.OpenSSL={execute:function(k,M,I,j,L){if(j||(j=a.random(64/8)),L)var H=d.create({keySize:M+I,hasher:L}).compute(k,j);else var H=d.create({keySize:M+I}).compute(k,j);var K=a.create(H.words.slice(M),I*4);return H.sigBytes=M*4,x.create({key:H,iv:K,salt:j})}},P=i.PasswordBasedCipher=N.extend({cfg:N.cfg.extend({kdf:E}),encrypt:function(k,M,I,j){j=this.cfg.extend(j);var L=j.kdf.execute(I,k.keySize,k.ivSize,j.salt,j.hasher);j.iv=L.iv;var H=N.encrypt.call(this,k,M,L.key,j);return H.mixIn(L),H},decrypt:function(k,M,I,j){j=this.cfg.extend(j),M=this._parse(M,j.format);var L=j.kdf.execute(I,k.keySize,k.ivSize,M.salt,j.hasher);j.iv=L.iv;var H=N.decrypt.call(this,k,M,L.key,j);return H}})}()})}(mD)),mD.exports}(function(t,e){(function(n,r,s){t.exports=r(Cf(),k4e(),D4e(),jne(),I4e())})(pr,function(n){return function(){var r=n,s=r.lib,i=s.BlockCipher,o=r.algo,a=[],c=[],u=[],f=[],l=[],d=[],p=[],h=[],m=[],y=[];(function(){for(var x=[],_=0;_<256;_++)_<128?x[_]=_<<1:x[_]=_<<1^283;for(var A=0,N=0,_=0;_<256;_++){var T=N^N<<1^N<<2^N<<3^N<<4;T=T>>>8^T&255^99,a[A]=T,c[T]=A;var E=x[A],P=x[E],k=x[P],M=x[T]*257^T*16843008;u[A]=M<<24|M>>>8,f[A]=M<<16|M>>>16,l[A]=M<<8|M>>>24,d[A]=M;var M=k*16843009^P*65537^E*257^A*16843008;p[T]=M<<24|M>>>8,h[T]=M<<16|M>>>16,m[T]=M<<8|M>>>24,y[T]=M,A?(A=E^x[x[x[k^E]]],N^=x[x[N]]):A=N=1}})();var g=[0,1,2,4,8,16,32,64,128,27,54],v=o.AES=i.extend({_doReset:function(){var x;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var _=this._keyPriorReset=this._key,A=_.words,N=_.sigBytes/4,T=this._nRounds=N+6,E=(T+1)*4,P=this._keySchedule=[],k=0;k<E;k++)k<N?P[k]=A[k]:(x=P[k-1],k%N?N>6&&k%N==4&&(x=a[x>>>24]<<24|a[x>>>16&255]<<16|a[x>>>8&255]<<8|a[x&255]):(x=x<<8|x>>>24,x=a[x>>>24]<<24|a[x>>>16&255]<<16|a[x>>>8&255]<<8|a[x&255],x^=g[k/N|0]<<24),P[k]=P[k-N]^x);for(var M=this._invKeySchedule=[],I=0;I<E;I++){var k=E-I;if(I%4)var x=P[k];else var x=P[k-4];I<4||k<=4?M[I]=x:M[I]=p[a[x>>>24]]^h[a[x>>>16&255]]^m[a[x>>>8&255]]^y[a[x&255]]}}},encryptBlock:function(x,_){this._doCryptBlock(x,_,this._keySchedule,u,f,l,d,a)},decryptBlock:function(x,_){var A=x[_+1];x[_+1]=x[_+3],x[_+3]=A,this._doCryptBlock(x,_,this._invKeySchedule,p,h,m,y,c);var A=x[_+1];x[_+1]=x[_+3],x[_+3]=A},_doCryptBlock:function(x,_,A,N,T,E,P,k){for(var M=this._nRounds,I=x[_]^A[0],j=x[_+1]^A[1],L=x[_+2]^A[2],H=x[_+3]^A[3],K=4,V=1;V<M;V++){var U=N[I>>>24]^T[j>>>16&255]^E[L>>>8&255]^P[H&255]^A[K++],Q=N[j>>>24]^T[L>>>16&255]^E[H>>>8&255]^P[I&255]^A[K++],ne=N[L>>>24]^T[H>>>16&255]^E[I>>>8&255]^P[j&255]^A[K++],X=N[H>>>24]^T[I>>>16&255]^E[j>>>8&255]^P[L&255]^A[K++];I=U,j=Q,L=ne,H=X}var U=(k[I>>>24]<<24|k[j>>>16&255]<<16|k[L>>>8&255]<<8|k[H&255])^A[K++],Q=(k[j>>>24]<<24|k[L>>>16&255]<<16|k[H>>>8&255]<<8|k[I&255])^A[K++],ne=(k[L>>>24]<<24|k[H>>>16&255]<<16|k[I>>>8&255]<<8|k[j&255])^A[K++],X=(k[H>>>24]<<24|k[I>>>16&255]<<16|k[j>>>8&255]<<8|k[L&255])^A[K++];x[_]=U,x[_+1]=Q,x[_+2]=ne,x[_+3]=X},keySize:256/32});r.AES=i._createHelper(v)}(),n.AES})})(Ine);var j4e=Ine.exports,WN={},eS={},si={};Object.defineProperty(eS,"__esModule",{value:!0});eS.default=void 0;var L4e=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 si<"u"?e=si.SECURE_LOCAL_STORAGE_HASH_KEY||si.REACT_APP_SECURE_LOCAL_STORAGE_HASH_KEY||si.NEXT_PUBLIC_SECURE_LOCAL_STORAGE_HASH_KEY||si.VITE_SECURE_LOCAL_STORAGE_HASH_KEY:console.warn("react-secure-storage : process is not defined! Just a warning!")}catch{return null}return e},$4e=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 si<"u"?e=si.SECURE_LOCAL_STORAGE_PREFIX||si.REACT_APP_SECURE_LOCAL_STORAGE_PREFIX||si.NEXT_PUBLIC_SECURE_LOCAL_STORAGE_PREFIX||si.VITE_SECURE_LOCAL_STORAGE_PREFIX:console.warn("react-secure-storage : process is not defined! Just a warning!")}catch{return null}return e},F4e=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 si<"u"?e=si.SECURE_LOCAL_STORAGE_DISABLED_KEYS||si.REACT_APP_SECURE_LOCAL_STORAGE_DISABLED_KEYS||si.NEXT_PUBLIC_SECURE_LOCAL_STORAGE_DISABLED_KEYS||si.VITE_SECURE_LOCAL_STORAGE_DISABLED_KEYS:console.warn("react-secure-storage : process is not defined! Just a warning!")}catch{return null}return e},z4e={getHashKey:L4e,getStoragePrefix:$4e,getDisabledKeys:F4e},B4e=z4e;eS.default=B4e;var GN={},Lne={exports:{}};(function(t){function e(n,r){var s,i,o,a,c,u,f,l;for(s=n.length&3,i=n.length-s,o=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,o^=f,o=o<<13|o>>>19,a=(o&65535)*5+(((o>>>16)*5&65535)<<16)&4294967295,o=(a&65535)+27492+(((a>>>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,o^=f}return o^=n.length,o^=o>>>16,o=(o&65535)*2246822507+(((o>>>16)*2246822507&65535)<<16)&4294967295,o^=o>>>13,o=(o&65535)*3266489909+(((o>>>16)*3266489909&65535)<<16)&4294967295,o^=o>>>16,o>>>0}t.exports=e})(Lne);var U4e=Lne.exports,Bl={};Object.defineProperty(Bl,"__esModule",{value:!0});Bl.getSecurePrefix=Bl.getDisabledKeys=Bl.FINGERPRINT_KEYS=void 0;var $ne=H4e(eS);function H4e(t){return t&&t.__esModule?t:{default:t}}var V4e=function(){var e=$ne.default.getStoragePrefix()||"@secure.";return e.endsWith(".")?e:e+"."};Bl.getSecurePrefix=V4e;var ro={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=ro;var q4e=function(){var e=$ne.default.getDisabledKeys()||"";if(e==="")return[];var n=[ro.USERAGENT,ro.SCREEN_PRINT,ro.PLUGINS,ro.FONTS,ro.LOCAL_STORAGE,ro.SESSION_STORAGE,ro.TIMEZONE,ro.LANGUAGE,ro.SYSTEM_LANGUAGE,ro.COOKIE,ro.CANVAS,ro.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=q4e;Object.defineProperty(GN,"__esModule",{value:!0});GN.default=void 0;var W4e=G4e(U4e),to=Bl;function G4e(t){return t&&t.__esModule?t:{default:t}}function K4e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Y4e(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 X4e(t,e,n){return e&&Y4e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var Q4e=function(){function t(){K4e(this,t)}return X4e(t,[{key:"getFingerprint",value:function(){var n="|",r=(0,to.getDisabledKeys)(),s="";r.includes(to.FINGERPRINT_KEYS.USERAGENT)||(s+=navigator.userAgent+n),r.includes(to.FINGERPRINT_KEYS.HOSTNAME)||(s+=window.location.hostname+n),r.includes(to.FINGERPRINT_KEYS.SCREEN_PRINT)||(s+=this.getScreenPrint()+n),r.includes(to.FINGERPRINT_KEYS.PLUGINS)||(s+=this.getPlugins()+n),r.includes(to.FINGERPRINT_KEYS.FONTS)||(s+=this.getFonts()+n),r.includes(to.FINGERPRINT_KEYS.LOCAL_STORAGE)||(s+=this.isLocalStorage()+n),r.includes(to.FINGERPRINT_KEYS.SESSION_STORAGE)||(s+=this.isSessionStorage()+n),r.includes(to.FINGERPRINT_KEYS.TIMEZONE)||(s+=this.getTimeZone()+n),r.includes(to.FINGERPRINT_KEYS.LANGUAGE)||(s+=this.getLanguage()+n),r.includes(to.FINGERPRINT_KEYS.SYSTEM_LANGUAGE)||(s+=this.getSystemLanguage()+n),r.includes(to.FINGERPRINT_KEYS.COOKIE)||(s+=this.isCookie()+n),r.includes(to.FINGERPRINT_KEYS.CANVAS)||(s+=this.getCanvasPrint()),s.endsWith(n)&&(s=s.substring(0,s.length-1));var i=256;return(0,W4e.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}(),Z4e=new Q4e,J4e=Z4e;GN.default=J4e;Object.defineProperty(WN,"__esModule",{value:!0});WN.default=void 0;var eze=Fne(eS),tze=Fne(GN);function Fne(t){return t&&t.__esModule?t:{default:t}}var nze="E86E2612010258B35137",rze=function(){var e=eze.default.getHashKey()||nze;return typeof window>"u"?e:tze.default.getFingerprint()+e},sze=rze;WN.default=sze;Object.defineProperty(J_,"__esModule",{value:!0});J_.default=void 0;var ize=aF(T4e),IH=aF(j4e),oze=aF(WN);function aF(t){return t&&t.__esModule?t:{default:t}}function aze(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lze(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 cze(t,e,n){return e&&lze(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function uze(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var dze=function(){function t(){aze(this,t),uze(this,"secureKey",""),this.secureKey=(0,oze.default)()}return cze(t,[{key:"encrypt",value:function(n){return IH.default.encrypt(n,this.secureKey).toString()}},{key:"decrypt",value:function(n){try{var r=IH.default.decrypt(n,this.secureKey);return r.toString(ize.default)||null}catch{return null}}}]),t}(),fze=dze;J_.default=fze;var KN={};Object.defineProperty(KN,"__esModule",{value:!0});KN.default=void 0;var hze=mze(J_),pze=Bl;function mze(t){return t&&t.__esModule?t:{default:t}}function gze(t,e){return xze(t)||bze(t,e)||yze(t,e)||vze()}function vze(){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 yze(t,e){if(t){if(typeof t=="string")return jH(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 jH(t,e)}}function jH(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 bze(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],s=!0,i=!1,o,a;try{for(n=n.call(t);!(s=(o=n.next()).done)&&(r.push(o.value),!(e&&r.length===e));s=!0);}catch(c){i=!0,a=c}finally{try{!s&&n.return!=null&&n.return()}finally{if(i)throw a}}return r}}function xze(t){if(Array.isArray(t))return t}var LH=(0,pze.getSecurePrefix)(),wze=function(){var e={};if(typeof window<"u")for(var n=new hze.default,r=0,s=Object.entries(localStorage);r<s.length;r++){var i=gze(s[r],2),o=i[0],a=i[1];if(o.startsWith(LH)){var c=o.replace(LH,"")[0],u=o.replace(/[.][bjns][.]/,"."),f=n.decrypt(a),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},_ze=wze;KN.default=_ze;Object.defineProperty(oF,"__esModule",{value:!0});var Ko=oF.default=void 0,Sze=zne(J_),Cze=zne(KN),Eze=Bl;function zne(t){return t&&t.__esModule?t:{default:t}}function Aze(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Rze(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 Nze(t,e,n){return e&&Rze(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Pze(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fA(t){"@babel/helpers - typeof";return fA=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},fA(t)}var BC=(0,Eze.getSecurePrefix)(),Tze=function(e){return fA(e)==="object"?"j":typeof e=="boolean"?"b":typeof e=="number"?"n":"s"},$H=function(e,n){var r=Tze(n);return BC+"".concat(r,".")+e},kze=function(){function t(){Aze(this,t),Pze(this,"_localStorageItems",{}),this._localStorageItems=(0,Cze.default)()}return Nze(t,[{key:"setItem",value:function(n,r){if(r==null)this.removeItem(n);else{var s=fA(r)==="object"?JSON.stringify(r):r+"",i=$H(n,r),o=BC+n;n!=null&&(this._localStorageItems[o]=r);var a=new Sze.default;localStorage.setItem(i,a.encrypt(s))}}},{key:"getItem",value:function(n){var r,s=BC+n;return(r=this._localStorageItems[s])!==null&&r!==void 0?r:null}},{key:"removeItem",value:function(n){var r=BC+n,s=this._localStorageItems[r],i=$H(n,s);this._localStorageItems[r]!==void 0&&delete this._localStorageItems[r],localStorage.removeItem(i)}},{key:"clear",value:function(){this._localStorageItems={},localStorage.clear()}}]),t}(),Dze=new kze,Mze=Dze;Ko=oF.default=Mze;const Oze={theme:"system",setTheme:()=>null},Ize=S.createContext(Oze);function jze({children:t,defaultTheme:e="system",storageKey:n="vite-ui-theme",...r}){const[s,i]=S.useState(()=>Ko.getItem(n)||e);S.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),s==="system"){const c=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(c);return}a.classList.add(s)},[s]);const o={theme:s,setTheme:a=>{Ko.setItem(n,a),i(a)}};return b.jsx(Ize.Provider,{...r,value:o,children:t})}const Bne=S.createContext(null),Lze=()=>{const t=S.useContext(Bne);if(t===null)throw new Error("useWarnAboutChange must be used within a UnsavedWarnProvider");return t},lF=({isDirty:t=!1,title:e=te("hooks.use_unsaved_changes_notifier.title"),subtitle:n=te("hooks.use_unsaved_changes_notifier.subtitle"),confirmText:r=te("hooks.use_unsaved_changes_notifier.confirm_text"),cancelText:s=te("hooks.use_unsaved_changes_notifier.cancel_text"),onConfirm:i,onCancel:o,type:a="warning"})=>{const c=hMe(t),{show:u}=Lze(),f=S.useCallback(()=>t?new Promise(l=>{u({title:e,subtitle:n,confirmText:r,cancelText:s,type:a,onConfirm:()=>{l(!0),i==null||i()},onCancel:()=>{l(!1),o==null||o()}})}):Promise.resolve(!0),[s,r,t,o,i,u,n,e,a]);return S.useEffect(()=>{c.state==="blocked"&&f().then(l=>{l?c.proceed():c.reset()})},[c,f]),S.useEffect(()=>(t&&(window.onbeforeunload=()=>n),()=>{window.onbeforeunload=null}),[t,n]),{confirm:f}},Une=({children:t})=>{const[e,n]=S.useState(null),[r,s]=S.useState(!1),i=S.useCallback(u=>{n(u),s(!0)},[s,n]),o=()=>{var u;(u=e==null?void 0:e.onConfirm)==null||u.call(e),s(!1)},a=()=>{var u;(u=e==null?void 0:e.onCancel)==null||u.call(e),s(!1)},c=S.useMemo(()=>({show:i}),[i]);return b.jsxs(Bne.Provider,{value:c,children:[t,b.jsx(nJ,{onCancel:()=>{a()},onConfirm:()=>o(),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})]})};var $ze=function(){return null};const Hne=t=>{const{isSubmitting:e,isLoading:n,isValidating:r}=qK();return b.jsx(_N,{disabled:e||n||r,...t})};Hne.displayName="FormSubmitButton";const Vne={"any.unknown":"{{#label}}: no está permitido","any.invalid":"{{#label}}: contiene un valor invalido","any.empty":"{{#label}}: no está permitido que sea vacío","any.required":"{{#label}}: es un campo requerido","any.allowOnly":"{{#label}}: debería ser uno de las siguientes variantes: {{valids}}","any.default":"emitió un error cuando se ejecutó el metodo default","alternatives.base":"{{#label}}: no coincide con ninguna de las alternativas permitidas","array.base":"{{#label}}: debe ser un array","array.includes":"{{#label}}: en la posición {{pos}} no coincide con ninguno de los tipos permitidos","array.includesSingle":'{{#label}}: el valor de "{{!key}}" no coincide con ninguno de los tipos permitidos',"array.includesOne":"{{#label}}: en la posición {{pos}} falló porque {{reason}}","array.includesOneSingle":'{{#label}}: el valor "{{!key}}" falló porque {{reason}}',"array.includesRequiredUnknowns":"{{#label}}: no contiene valor/es requerido/s: {{unknownMisses}} ","array.includesRequiredKnowns":"{{#label}}: no contiene: {{knownMisses}}","array.includesRequiredBoth":"{{#label}}: no contiene {{knownMisses}} y {{unknownMisses}} otros valores requeridos","array.excludes":"{{#label}}: en la posición {{pos}} contiene un valor excluído","array.excludesSingle":'{{#label}}: el valor "{{!key}}" contiene un valor excluído',"array.min":"{{#label}}: debe contener al menos {{limit}} items","array.max":"{{#label}}: debe contener máximo {{limit}} items","array.length":"{{#label}}: debe contener exactamente {{limit}} items","array.ordered":"{{#label}}: en la posición {{pos}} falló porque {{reason}}","array.orderedLength":"{{#label}}: en la posición {{pos}} falló porque el array debre contener como máximo {{limit}} items","array.sparse":"{{#label}}: no debe ser un array esparcido","array.unique":"{{#label}}: posición {{pos}} contiene un valor duplicado","boolean.base":"{{#label}}: debe ser un valor verdadero/falso o si/no","binary.base":"{{#label}}: debe ser un buffer o un string","binary.min":"{{#label}}: debe ser como mínimo de {{limit}} bytes","binary.max":"{{#label}}: debe ser como máximo de {{limit}} bytes","binary.length":"{{#label}}: debe tener exactamente {{limit}} bytes","date.base":"{{#label}}: debe ser una cantidad de milisegundos o una fecha en cadena de texto válida","date.min":'{{#label}}: debe ser mayor o igual a "{{limit}}"',"date.max":'{{#label}}: debe ser menor o igual que "{{limit}}"',"date.isoDate":"{{#label}}: debe ser una fecha en formato ISO 8601","date.ref":'referencia a "{{ref}}", que no es una fecha válida',"function.base":"{{#label}}: debe ser una función","object.base":"{{#label}}: debe ser un objeto","object.child":'hijo "{{!key}}" falló porque {{reason}}',"object.min":"{{#label}}: debe tener como mínimo {{limit}} hijo","object.max":"{{#label}}: debe tener menos o a lo sumo {{limit}} hijo","object.length":"{{#label}}: debe tener máximo {{limit}} hijo/s","object.allowUnknown":"no está permitido","object.with":'peer faltante: "{{peer}}"',"object.without":'conflicto con peer prohibido: "{{peer}}"',"object.missing":"{{#label}}: debe contener al menos uno de: {{peers}}","object.xor":"{{#label}}: contiene un conflicto con alguno de: {{peers}}","object.or":"{{#label}}: debe contener al menos uno de: {{peers}}","object.and":"contiene {{present}} sin el requerido: {{missing}}","object.nand":'!!"{{main}}" no debe existir simultáneamente con {{peers}}',"object.assert":'!!"{{ref}}" falló validacion porque "{{ref}}" falló a {{message}}',"object.rename.multiple":'{{#label}}: no se puede renombrar el hijo "{{from}}" porque múltiples re-nombramientos estan deshabilitados y otra clave fue renombrada a "{{to}}"',"object.rename.override":'{{#label}}: no se puede renombrar el hijo "{{from}}" porque la sobre escritura esta deshabilitada y el target "{{to}}" existe',"object.type":'{{#label}}: debe ser una instancia de "{{type}}"',"number.base":"{{#label}}: debe ser un número","number.min":"{{#label}}: debe ser mayor o igual que {{limit}}","number.max":"{{#label}}: debe ser menor o igual que {{limit}}","number.less":"{{#label}}: debe ser menor a {{limit}}","number.greater":"{{#label}}: debe ser mayor a {{limit}}","number.float":"{{#label}}: debe ser un numero flotante","number.integer":"{{#label}}: debe ser un número entero","number.negative":"{{#label}}: debe ser un número negativo","number.positive":"{{#label}}: debe ser un número positivo","number.precision":"{{#label}}: no debe tener mas de {{limit}} decimales","number.ref":'{{#label}}: referencia a "{{ref}}" que no es un número',"number.multiple":"{{#label}}: debe ser un múltiplo de {{multiple}}","string.base":"{{#label}}: debe ser una cadena de texto","string.empty":"{{#label}}: no está permitido que sea vacío","string.min":"{{#label}}: debe ser mínimo de {{limit}} caracteres de largo","string.max":"{{#label}}: debe ser de máximo {{limit}} caracteres de largo","string.length":"{{#label}}: debe ser exactamente de {{limit}} caracteres de largo","string.alphanum":"{{#label}}: debe contener solo letras y números","string.token":"{{#label}}: debe contener solo letras, números y guines bajos","string.regex.base":'{{#label}}: el valor "{{!value}}" no coincide con el pattern requerido: {{pattern}}',"string.regex.name":'{{#label}}: el valor "{{!value}}" no coincide con el nombre de pattern {{name}}',"string.email":"{{#label}}: debe ser un email válido","string.uri":"{{#label}}: debe sre una uri válida","string.uriCustomScheme":"{{#label}}: debe ser una uri válida con el esquema concidiente con el patrón {{scheme}}","string.isoDate":"{{#label}}: debe ser una fecha en formato ISO 8601 válida","string.guid":"{{#label}}: debe ser un GUID valido","string.hex":"{{#label}}: debe contener solo caracteres hexadecimales","string.hostname":"{{#label}}: deber ser un hostname válido","string.lowercase":"{{#label}}: solo debe contener minúsculas","string.uppercase":"{{#label}}: solo debe contener mayúsculas","string.trim":"{{#label}}: no debe tener espacios en blanco delante o atrás","string.creditCard":"{{#label}}: debe ser una tarjeta de crédito","string.ref":'Referencia "{{ref}}" que no es un número',"string.ip":"{{#label}}: debe ser una dirección ip válida con un CDIR {{cidr}}","string.ipVersion":"{{#label}}: debe ser una dirección ip válida de una de las siguientes versiones {{version}} con un CDIR {{cidr}}","object.unknown":"{{#label}}: es un campo no es permitido","luxon.lt":"{{#label}}: must be before {{#date}}","luxon.gt":"{{#label}}: must be after {{#date}}","luxon.lte":"{{#label}}: must be same as or before {{#date}}","luxon.gte":"{{#label}}: must be same as or after {{#date}}"},V1=[{code:"en",name:"English",flag:()=>b.jsx("span",{className:"fi fi-gb"})},{code:"es",name:"Español",flag:()=>b.jsx("span",{className:"fi fi-es"})}],Fze=()=>{var f,l,d,p;const{t,i18n:e}=K$(),[n,r]=S.useState(e.language),s=Us(),{toast:i}=tc();S.useEffect(()=>{const h=navigator.language.split("-")[0],m=V1.find(y=>y.code===h);m&&o(m.code)},[]);const o=h=>{e.changeLanguage(h),r(h)},{mutate:a}=Khe({onSuccess:h=>{const{success:m,error:y}=h;!m&&y&&c.setError("root",y),m&&s("/quotes",{replace:!0})},onError:h=>{const{message:m}=h;i({description:m,title:"Error"}),console.debug(h)}}),c=L_({mode:"onBlur",defaultValues:{email:"",password:""},resolver:q$(ru.object({email:ru.string().email({tlds:{allow:!1}}).required(),password:ru.string().min(4).alphanum().required()}),{messages:Vne})}),u=async h=>{a({email:h.email,password:h.password},{})};return b.jsxs(DJ,{variant:"full",className:"p-0 lg:grid lg:min-h-[600px] lg:grid-cols-2 xl:min-h-[800px] h-screen ",children:[b.jsx("div",{className:"flex items-center justify-center py-12 ",children:b.jsxs("div",{className:"mx-auto grid w-[650px] gap-6 relative ",children:[b.jsx("div",{className:"absolute flex space-x-2 top-4 right-4 ",children:b.jsxs(M_,{children:[b.jsx(O_,{asChild:!0,children:b.jsxs(qe,{variant:"outline",className:"w-[140px] justify-start",children:[b.jsx("span",{className:"mr-2",children:(f=V1.find(h=>h.code===n))==null?void 0:f.flag()}),(l=V1.find(h=>h.code===n))==null?void 0:l.name,b.jsx(dy,{className:"w-4 h-4 ml-auto opacity-50"})]})}),b.jsx(Py,{className:"w-[140px]",children:V1.map(h=>b.jsxs(Xd,{onSelect:()=>o(h.code),children:[b.jsx("span",{className:"mr-2",children:h.flag()}),h.name]},h.code))})]})}),b.jsxs(xr,{className:"px-12 py-6 bg-muted/50",children:[b.jsxs(Ni,{children:[b.jsx(OO,{className:"inline-block m-auto mb-6 align-middle max-w-32"}),b.jsx(ns,{children:b.jsx(Mt,{i18nKey:"login_page.title"})}),b.jsx(ys,{children:b.jsx(Mt,{i18nKey:"login_page.description"})})]}),b.jsx(wr,{children:b.jsx($_,{...c,children:b.jsx("form",{onSubmit:c.handleSubmit(u),children:b.jsxs("div",{className:"grid items-start gap-6",children:[b.jsx("div",{className:"grid gap-6",children:b.jsx(sh,{required:!0,name:"email",label:t("login_page.email_label"),type:"email",placeholder:t("login_page.email_placeholder")})}),b.jsxs("div",{className:"grid gap-6",children:[b.jsx(sh,{required:!0,name:"password",label:t("login_page.password_label"),type:"password"}),b.jsxs("div",{className:"mb-4 -mt-2 text-sm",children:[b.jsx(Mt,{i18nKey:"login_page.forgotten_password"}),b.jsx("br",{}),b.jsx(eu,{to:"https://uecko.com/distribuidores",className:"underline",children:b.jsx(Mt,{i18nKey:"login_page.contact_us"})})]})]}),((d=c.formState.errors.root)==null?void 0:d.message)&&b.jsxs(bL,{variant:"destructive",children:[b.jsx(fq,{className:"w-4 h-4"}),b.jsx(xL,{children:b.jsx(Mt,{i18nKey:"common.error"})}),b.jsx(wL,{children:(p=c.formState.errors.root)==null?void 0:p.message})]}),b.jsx(Hne,{className:"w-full",label:t("login_page.login")}),b.jsxs("div",{className:"mt-4 text-sm text-center",children:[b.jsx(Mt,{i18nKey:"login_page.become_dealer"}),b.jsx("br",{}),b.jsx(eu,{to:"https://uecko.com/distribuidores",className:"underline",children:b.jsx(Mt,{i18nKey:"login_page.contact_us"})})]})]})})})})]}),b.jsx("img",{className:"block w-11/12 mx-auto aspect-auto",src:"/img/uecko-footer_logos.jpg"})]})}),b.jsx("div",{className:"hidden bg-muted lg:block",children:b.jsx("img",{src:"/img/nara2.jpg",alt:"Image",width:"1920",height:"1080",className:"h-full w-full object-cover dark:brightness-[0.2] dark:grayscale"})})]})},zze=t=>{const{onSuccess:e,onError:n,...r}=t||{},s=Dl(),i=vu(),{logout:o}=ZA(),a=Us(),{toast:c}=tc();return Ol({mutationKey:i().auth().action("logout").get(),mutationFn:o,onSuccess:async(u,f,l)=>{s.clear();const{success:d,redirectTo:p}=u;d&&p&&a(p||"/"),e&&e(u,f,l)},onError:(u,f,l)=>{const{message:d}=u;c({title:"Error",description:d,variant:"destructive"}),n&&n(u,f,l)},...r})},Bze=()=>{const{mutate:t}=zze({});return S.useEffect(()=>t(),[t]),b.jsx(Yl,{})},Uze=S.createContext(null),Hze=({children:t})=>{const[e,n]=xN();return b.jsx(Uze.Provider,{value:{pagination:e,setPagination:n},children:t})},Vze=({children:t})=>b.jsx(oy,{children:b.jsx(Hze,{children:b.jsxs(zy,{className:"catalog-layout",children:[b.jsx(Uy,{}),b.jsx(By,{children:t})]})})}),qne=t=>{const e=sy(),n=vu(),{pagination:r,searchTerm:s=[],enabled:i=!0,queryOptions:o}=t;return k$({queryKey:n().data().resource("catalog").action("list").params(t).get(),queryFn:()=>e.getList({resource:"catalog",quickSearchTerm:s,pagination:r}),enabled:i,queryOptions:o})};function Wne({table:t,className:e,children:n,...r}){const{globalFilter:s,isFiltered:i,setGlobalFilter:o,resetGlobalFilter:a}=nm(),c=oe.useRef(null),[u,f]=oe.useState(""),l=oe.useCallback(h=>{h.key==="Enter"&&u.trim()&&(h.preventDefault(),o(m=>[...m,u.trim()]),f("")),h.key==="Backspace"&&!u&&s.length>0&&(h.preventDefault(),o(m=>m.slice(0,-1)))},[s,u]),d=oe.useCallback(h=>{o(m=>m.filter(y=>y!==h))},[]),p=oe.useCallback(()=>{var h;u.trim()&&(o(m=>[...m,u.trim()]),f(""),(h=c.current)==null||h.focus())},[u]);return b.jsx(LZ,{children:b.jsxs("div",{className:"w-full space-y-2",...r,children:[b.jsxs("div",{className:ie("relative flex items-center flex-1 p-2 space-x-2 border rounded-md",i?"border-primary":"border-input"),children:[b.jsx(vL,{className:ie("w-4 h-4 text-gray-500")}),b.jsxs("div",{className:"flex flex-wrap items-center flex-1 gap-2",children:[s&&s.map(h=>b.jsxs(gR,{variant:"default",className:"px-1 text-base font-normal rounded-sm",children:[h,b.jsxs(qe,{variant:"ghost",onClick:()=>d(h),className:"h-auto p-0 px-1 ml-1 hover:bg-transparent",children:[b.jsxs(bs,{children:[b.jsx(xs,{asChild:!0,children:b.jsx(Hv,{className:"w-4 h-4"})}),b.jsx(rs,{children:b.jsx("p",{children:te("catalog.filter.badget_remove_tooltip")})})]}),b.jsx("span",{className:"sr-only",children:te("catalog.filter.badget_remove_tooltip")})]})]},h)),b.jsxs("div",{className:"flex-1 flex items-center min-w-[300px]",children:[b.jsx("input",{ref:c,value:u,onChange:h=>f(h.target.value),onKeyDown:l,placeholder:te("common.filter.input_placeholder"),className:"flex-1 w-full h-8 bg-transparent outline-none placeholder:text-muted-foreground"}),b.jsxs(Pp,{children:[i&&b.jsxs(bs,{children:[b.jsx(xs,{asChild:!0,children:b.jsxs(qe,{variant:"ghost",onClick:()=>a(),className:"h-8 px-2 transition-all lg:px-3 text-primary",children:[b.jsx(Hv,{className:"w-4 h-4 mr-2"}),te("common.filter.reset_filter")]})}),b.jsx(rs,{children:b.jsx("p",{children:te("common.filter.reset_filter")})})]}),b.jsxs(bs,{children:[b.jsx(xs,{asChild:!0,children:b.jsxs(qe,{variant:"outline",size:"icon",onClick:p,className:"w-8 h-8 p-0 hover:bg-muted",children:[b.jsx(gL,{className:"w-4 h-4"}),b.jsx("span",{className:"sr-only",children:te("common.filter.button_add_term")})]})}),b.jsx(rs,{children:b.jsx("p",{children:te("common.filter.button_add_term_tooltip")})})]})]})]})]})]}),b.jsx("p",{className:"text-sm text-muted-foreground",children:te("common.filter.help_text")})]})})}const qze=()=>{const t=Us(),{pagination:e,globalFilter:n,isFiltered:r}=nm(),{data:s,isPending:i,isError:o,error:a}=qne({pagination:{pageIndex:e.pageIndex,pageSize:e.pageSize},searchTerm:n}),c=S.useMemo(()=>[{id:"id",accessorKey:"id"},{id:"id_article",accessorKey:"id_article"},{id:"catalog_name",accessorKey:"catalog_name"},{id:"description",accessorKey:"description",header:()=>b.jsx(b.Fragment,{children:te("catalog.list.columns.description")})},{id:"points",accessorKey:"points",header:()=>b.jsx("div",{className:"text-right",children:te("catalog.list.columns.points")}),cell:({renderValue:f})=>b.jsx("div",{className:"text-right",children:f()})},{id:"retail_price",accessorKey:"retail_price",header:()=>b.jsx("div",{className:"text-right",children:te("catalog.list.columns.retail_price")}),cell:({row:f})=>{const l=Oi.create(f.original.retail_price).object;return b.jsx("div",{className:"text-right",children:l.toFormat()})}}],[]),{table:u}=qN({data:(s==null?void 0:s.items)??[],columns:c,pageCount:(s==null?void 0:s.total_pages)??-1,initialState:{columnVisibility:{id:!1,id_article:!1,catalog_name:!1}}});return o?b.jsx(_f,{subtitle:a.message}):i?b.jsx(xr,{children:b.jsx(wr,{children:b.jsx(PN,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0})})}):(s==null?void 0:s.total_items)===0&&!r?b.jsx(TN,{subtitle:"Empieza cargando los artículos del catálogo",buttonText:"",onButtonClick:()=>t("/catalog/add")}):b.jsx(SN,{table:u,paginationOptions:{visible:!0},children:b.jsx(Wne,{table:u})})},Wze=()=>b.jsxs(ny,{children:[b.jsx("div",{className:"flex items-center justify-between space-y-2",children:b.jsx("div",{children:b.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:b.jsx(Mt,{i18nKey:"catalog.list.title"})})})}),b.jsx(qze,{})]}),Gze=()=>{const{data:t,status:e}=iL();return b.jsxs(zy,{children:[b.jsx(Uy,{}),b.jsx(By,{children:e==="success"?b.jsx("div",{className:"flex items-center",children:b.jsx("h1",{className:"text-lg font-semibold md:text-2xl",children:`${te("dashboard.welcome")}, ${t==null?void 0:t.name}`})}):b.jsx(_i,{className:"w-[100px] h-[20px] rounded-full"})})]})},Kze=({children:t})=>b.jsx(oy,{children:b.jsxs(zy,{className:"dealers-layout",children:[b.jsx(Uy,{}),b.jsx(By,{children:t})]})});function Yze({table:t}){return b.jsxs(M_,{children:[b.jsx(O_,{asChild:!0,children:b.jsxs(qe,{variant:"outline",size:"sm",className:"hidden h-8 ml-auto lg:flex",children:[b.jsx(Ype,{className:"w-4 h-4 mr-2"}),"Columnas"]})}),b.jsxs(Py,{align:"end",className:"w-[150px]",children:[b.jsx(UR,{children:"Columnas"}),b.jsx(Wv,{}),t.getAllColumns().filter(e=>typeof e.accessorFn<"u"&&e.getCanHide()).map(e=>b.jsx(IK,{className:"capitalize",checked:e.getIsVisible(),onCheckedChange:n=>e.toggleVisibility(!!n),children:b.jsx(b.Fragment,{children:e.columnDef.header})},e.id))]})]})}function Gne({table:t,className:e,children:n,...r}){const{globalFilter:s,isFiltered:i,setGlobalFilter:o,resetGlobalFilter:a}=nm(),c=u=>{const f=String(u.target.value);f===""?a():o([f])};return b.jsxs("div",{className:ie("flex w-full items-center justify-between space-x-2 overflow-auto p-1",e),...r,children:[b.jsxs("div",{className:"flex items-center flex-1 space-x-2",children:[b.jsx(vL,{className:"w-4 h-4 text-gray-500"}),b.jsx(F_,{placeholder:te("common.filter.input_placeholder"),value:s,onChange:c,className:ie("h-8 w-full transition-all")},"global-filter"),i&&b.jsxs(qe,{variant:"outline",onClick:()=>a(),className:"h-8 px-2 transition-all lg:px-3",children:[b.jsx(Hv,{className:"w-4 h-4 mr-2"}),te("common.filter.reset_filter")]})]}),b.jsxs("div",{className:"flex items-center gap-2",children:[n,t.options.enableHiding&&b.jsx(Yze,{table:t})]})]})}const Xze=t=>{const e=sy(),n=vu(),{pagination:r,searchTerm:s=void 0,enabled:i=!0,queryOptions:o}=t;return k$({queryKey:n().data().resource("dealer").action("list").params(t).get(),queryFn:()=>e.getList({resource:"dealers",quickSearchTerm:s,pagination:r}),enabled:i,queryOptions:o})},Qze=()=>{const t=Us(),{pagination:e,globalFilter:n,isFiltered:r}=nm(),{data:s,isPending:i,isError:o,error:a}=Xze({pagination:{pageIndex:e.pageIndex,pageSize:e.pageSize},searchTerm:n}),c=S.useMemo(()=>[{id:"id",accessorKey:"id",enableResizing:!1,size:10},{id:"name",accessorKey:"name",enableResizing:!1,size:10}],[]),{table:u}=qN({data:(s==null?void 0:s.items)??[],columns:c,pageCount:(s==null?void 0:s.total_pages)??-1});return o?b.jsx(_f,{subtitle:a.message}):i?b.jsx(xr,{children:b.jsx(wr,{children:b.jsx(PN,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0})})}):(s==null?void 0:s.total_items)===0&&!r?b.jsx(TN,{subtitle:"Empieza cargando los artículos del catálogo",buttonText:"",onButtonClick:()=>t("/catalog/add")}):b.jsx(b.Fragment,{children:b.jsx(SN,{table:u,paginationOptions:{visible:!0},children:b.jsx(Gne,{table:u})})})},Zze=()=>b.jsx(ny,{children:b.jsx(Qze,{})}),Jze=()=>b.jsx("div",{className:"flex min-h-[100dvh] flex-col items-center justify-center bg-background px-4 py-12 sm:px-6 lg:px-8",children:b.jsxs("div",{className:"max-w-md mx-auto text-center",children:[b.jsx("div",{className:"w-12 h-12 mx-auto text-primary"}),b.jsx("h1",{className:"mt-4 text-3xl font-bold tracking-tight text-foreground sm:text-4xl",children:"Oops, page not found!"}),b.jsx("p",{className:"mt-4 text-muted-foreground",children:"The page you're looking for doesn't exist or has been moved."}),b.jsx("div",{className:"mt-6",children:b.jsx(qe,{className:"inline-flex items-center px-4 py-2 text-sm font-medium transition-colors rounded-md shadow-sm bg-primary text-primary-foreground hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",children:"Go to Homepage"})})]})});function eBe(t,e={}){const{enableDragHandleColumn:n=!1,enableSelectionColumn:r=!1,enableActionsColumn:s=!1,rowActionFn:i=void 0}=e;return S.useMemo(()=>(n&&t.unshift({id:"row_drag_handle",header:()=>null,cell:o=>b.jsx(jLe,{rowId:o.row.id}),enableSorting:!1,enableHiding:!1,size:40}),r&&t.unshift({id:"select",header:({table:o})=>b.jsx(nx,{id:"select-all",checked:o.getIsAllPageRowsSelected()||o.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:a=>o.toggleAllPageRowsSelected(!!a),"aria-label":"Seleccionar todo",className:"translate-y-[0px]"}),cell:({row:o})=>b.jsx(nx,{id:`select-row-${o.id}`,checked:o.getIsSelected(),disabled:!o.getCanSelect(),onCheckedChange:o.getToggleSelectedHandler(),"aria-label":"Seleccionar fila",className:"mt-2"}),enableSorting:!1,enableHiding:!1,size:40}),s&&t.push({id:"row_actions",cell:o=>b.jsx(WIe,{rowContext:o,actions:i}),enableSorting:!1,enableHiding:!1,size:48}),t),[s,n,r])}var Kne={exports:{}};(function(t,e){(function(n,r,s){t.exports=s(),t.exports.default=s()})("slugify",pr,function(){var n=JSON.parse(`{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ō":"O","ō":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","Ə":"E","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Lj":"LJ","lj":"lj","Nj":"NJ","nj":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","ə":"e","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","ѝ":"u","џ":"dz","Ґ":"G","ґ":"g","Ғ":"GH","ғ":"gh","Қ":"KH","қ":"kh","Ң":"NG","ң":"ng","Ү":"UE","ү":"ue","Ұ":"U","ұ":"u","Һ":"H","һ":"h","Ә":"AE","ә":"ae","Ө":"OE","ө":"oe","Ա":"A","Բ":"B","Գ":"G","Դ":"D","Ե":"E","Զ":"Z","Է":"E'","Ը":"Y'","Թ":"T'","Ժ":"JH","Ի":"I","Լ":"L","Խ":"X","Ծ":"C'","Կ":"K","Հ":"H","Ձ":"D'","Ղ":"GH","Ճ":"TW","Մ":"M","Յ":"Y","Ն":"N","Շ":"SH","Չ":"CH","Պ":"P","Ջ":"J","Ռ":"R'","Ս":"S","Վ":"V","Տ":"T","Ր":"R","Ց":"C","Փ":"P'","Ք":"Q'","Օ":"O''","Ֆ":"F","և":"EV","ء":"a","آ":"aa","أ":"a","ؤ":"u","إ":"i","ئ":"e","ا":"a","ب":"b","ة":"h","ت":"t","ث":"th","ج":"j","ح":"h","خ":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","ش":"sh","ص":"s","ض":"dh","ط":"t","ظ":"z","ع":"a","غ":"gh","ف":"f","ق":"q","ك":"k","ل":"l","م":"m","ن":"n","ه":"h","و":"w","ى":"a","ي":"y","ً":"an","ٌ":"on","ٍ":"en","َ":"a","ُ":"u","ِ":"e","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","پ":"p","چ":"ch","ژ":"zh","ک":"k","گ":"g","ی":"y","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","Ṣ":"S","ṣ":"s","Ẁ":"W","ẁ":"w","Ẃ":"W","ẃ":"w","Ẅ":"W","ẅ":"w","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","–":"-","‘":"'","’":"'","“":"\\"","”":"\\"","„":"\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₸":"kazakhstani tenge","₹":"indian rupee","₺":"turkish lira","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial","ﻵ":"laa","ﻷ":"laa","ﻹ":"lai","ﻻ":"la"}`),r=JSON.parse('{"bg":{"Й":"Y","Ц":"Ts","Щ":"Sht","Ъ":"A","Ь":"Y","й":"y","ц":"ts","щ":"sht","ъ":"a","ь":"y"},"de":{"Ä":"AE","ä":"ae","Ö":"OE","ö":"oe","Ü":"UE","ü":"ue","ß":"ss","%":"prozent","&":"und","|":"oder","∑":"summe","∞":"unendlich","♥":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","¢":"centavos","£":"libras","¤":"moneda","₣":"francos","∑":"suma","∞":"infinito","♥":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","¢":"centime","£":"livre","¤":"devise","₣":"franc","∑":"somme","∞":"infini","♥":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","¢":"centavo","∑":"soma","£":"libra","∞":"infinito","♥":"amor"},"uk":{"И":"Y","и":"y","Й":"Y","й":"y","Ц":"Ts","ц":"ts","Х":"Kh","х":"kh","Щ":"Shch","щ":"shch","Г":"H","г":"h"},"vi":{"Đ":"D","đ":"d"},"da":{"Ø":"OE","ø":"oe","Å":"AA","å":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"større end"},"nb":{"&":"og","Å":"AA","Æ":"AE","Ø":"OE","å":"aa","æ":"ae","ø":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","Å":"AA","Ä":"AE","Ö":"OE","å":"aa","ä":"ae","ö":"oe"}}');function s(i,o){if(typeof i!="string")throw new Error("slugify: string argument expected");o=typeof o=="string"?{replacement:o}:o||{};var a=r[o.locale]||{},c=o.replacement===void 0?"-":o.replacement,u=o.trim===void 0?!0:o.trim,f=i.normalize().split("").reduce(function(l,d){var p=a[d];return p===void 0&&(p=n[d]),p===void 0&&(p=d),p===c&&(p=" "),l+p.replace(o.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,"")},"");return o.strict&&(f=f.replace(/[^A-Za-z0-9\s]/g,"")),u&&(f=f.trim()),f=f.replace(/\s+/g,c),o.lower&&(f=f.toLowerCase()),f}return s.extend=function(i){Object.assign(n,i)},s})})(Kne);var tBe=Kne.exports;const nBe=_u(tBe),tS=()=>{const t=sy(),e=vu(),n=S.useCallback(i=>`${t.getApiUrl()}/quotes/${i}/report`,[t]),r=S.useCallback(i=>`quote-${nBe(i.reference,{lower:!0,strict:!0,locale:"en",trim:!0})}.pdf`,[]),s={useList:i=>{const o=sy(),a=vu(),{pagination:c,status:u="draft",quickSearchTerm:f=void 0,enabled:l=!0,queryOptions:d}=i;return k$({queryKey:a().data().resource("quotes").action("list").params(i).get(),queryFn:()=>o.getList({resource:"quotes",quickSearchTerm:f,filters:u!=="all"?[{field:"status",operator:"eq",value:u}]:[{field:"status",operator:"ne",value:"archived"}],pagination:c}),enabled:l,queryOptions:d})},useCreate:()=>{const i=Dl();return UOe({mutationFn:o=>{const{date:a}=o,c=td.generateNewID().object.toString();return t.createOne({resource:"quotes",data:{...o,date:new Date(a).toISOString().slice(0,10),status:"draft",id:c}})},onSuccess:()=>{i.invalidateQueries({queryKey:["data","default","quotes"]})}})},useUpdate:i=>{const o=Dl();return Ol({mutationKey:e().data().resource("quotes").action("one").id(i).params().get(),mutationFn:a=>t.updateOne({resource:"quotes",id:i,data:a}),onSuccess:()=>{o.invalidateQueries({queryKey:["data","default","quotes"]})}})},useSetStatus:()=>{const i=Dl();return Ol({mutationFn:o=>{const{id:a,newStatus:c}=o;return t.custom({url:`${t.getApiUrl()}/quotes/${a}/setStatus`,method:"put",data:{newStatus:c}})},onSuccess:()=>{i.invalidateQueries({queryKey:["data","default","quotes"]})}})},useDuplicate:()=>{const i=Dl();return Ol({mutationFn:o=>{const{id:a}=o;return t.custom({url:`${t.getApiUrl()}/quotes/${a}/duplicate`,method:"post"})},onSuccess:()=>{i.invalidateQueries({queryKey:["data","default","quotes"]})}})},useSentTo:i=>{const o=Dl();return Ol({mutationKey:e().data().resource("quotes").action("one").id(i).params().get(),mutationFn:a=>{const{sent_date:c}=a;return t.custom({url:`${t.getApiUrl()}/quotes/${i}/send`,method:"put",data:{sent_date:c}})},onSuccess:()=>{o.invalidateQueries({queryKey:["data","default","quotes"]})}})},useOne:(i,o)=>pJ({queryKey:e().data().resource("quotes").action("one").id(i).params().get(),queryFn:()=>t.getOne({resource:"quotes",id:String(i)}),enabled:!!i,...o}),getQuotePDFDownloadURL:n,getQuotePDFFilename:r,useReport:()=>{const i=t.getApiAuthorization(),[o,a]=S.useState(void 0),{download:c,...u}=RH({headers:{Authorization:i},customHandleDownload:S.useCallback(l=>{const d=[l],p=new Blob(d,{type:"application/octet-stream"});return a(p),!0},[a])}),f=S.useCallback(l=>c(s.getQuotePDFDownloadURL(l),""),[c]);return{...u,preview:f,report:o}},useDownloader:()=>{const i=t.getApiAuthorization(),o=RH({headers:{Authorization:i}});return{...o,download:(c,u)=>{const f=s.getQuotePDFDownloadURL(c);return o.download(f,u)}}}};return s},rBe=()=>{const t=Us(),{toast:e}=tc(),{useCreate:n}=tS(),{mutate:r,isPending:s}=n(),i=S.useMemo(()=>({date:new Date(Date.now()).toUTCString(),customer_reference:"",customer_information:""}),[]),o=L_({mode:"onBlur",defaultValues:i,resolver:q$(ru.object({customer_reference:ru.string(),date:ru.date().required(),customer_information:ru.string().required()}),{messages:{es:Vne}})}),{formState:a,reset:c,getValues:u,handleSubmit:f}=o,{isSubmitting:l,isDirty:d}=a;lF({isDirty:d});const p=async h=>{try{r(h,{onError:m=>{console.debug(m),e({title:"Error",description:m.message,variant:"destructive"})},onSuccess:m=>{c(u()),e({title:"Cotización creada",variant:"default"}),t(`/quotes/edit/${m.id}`,{relative:"path"})}})}finally{}};return l?b.jsx(Yl,{title:"Guardando ajustes"}):s?b.jsx(Yl,{}):b.jsx($_,{...o,children:b.jsx("form",{onSubmit:f(p),children:b.jsxs("div",{className:"mx-auto grid max-w-[90rem] flex-1 auto-rows-max gap-6",children:[b.jsxs("div",{className:"flex items-center gap-4",children:[b.jsx(j$,{}),b.jsx("h1",{className:"flex-1 text-xl font-semibold tracking-tight shrink-0 whitespace-nowrap sm:grow-0",children:te("quotes.create.title")})]}),b.jsx("div",{className:"grid w-6/12 gap-6 mx-auto",children:b.jsxs(tA,{className:"md:col-span-4",title:te("quotes.create.form_groups.general.title"),description:te("quotes.create.form_groups.general.desc"),footerActions:b.jsxs("div",{className:"flex items-stretch justify-between flex-1",children:[b.jsx(qe,{size:"sm",variant:"ghost",onClick:()=>t("/quotes"),children:te("common.discard")}),b.jsx(_N,{size:"sm",label:te("common.continue")})]}),children:[b.jsx(sh,{required:!0,name:"customer_reference",label:te("quotes.form_fields.customer_reference.label"),description:te("quotes.form_fields.customer_reference.desc"),placeholder:te("quotes.form_fields.customer_reference.placeholder")}),b.jsx(cee,{required:!0,label:te("quotes.form_fields.date.label"),description:te("quotes.form_fields.date.desc"),placeholder:te("quotes.form_fields.date.placeholder"),name:"date"}),b.jsx(iu,{}),b.jsx(Ba,{rows:4,className:"row-span-2",name:"customer_information",required:!0,label:te("quotes.form_fields.customer_information.label"),description:te("quotes.form_fields.customer_information.desc"),placeholder:te("quotes.form_fields.customer_information.placeholder")})]})})]})})})},gD=(t,e=!1)=>{const{discount:n,tax:r,subtotal_price:s}=t||{},i=of.create(n||{amount:null,scale:2});if(i.isFailure)throw i.error;const o=i.object,a=of.create(r||{amount:null,scale:2});if(a.isFailure)throw a.error;const c=a.object,u=Oi.create(s||{amount:null,scale:2});if(u.isFailure)throw u.error;const f=e?sBe(t.items).convertScale(2):u.object,l=f.percentage(o.toNumber()).convertScale(2),d=f.subtract(l).convertScale(2),p=d.percentage(c.toNumber()).convertScale(2),h=d.add(p).convertScale(2);return{subtotalPrice:f,discount:t.discount,discountPrice:l,priceBeforeTaxes:d,tax:c,taxesPrice:p,totalPrice:h}},sBe=t=>{let e=Oi.create({amount:0,scale:2}).object;return t&&t.map(n=>{const r=JI(n);e=e.add(r.totalPrice)}),e},JI=t=>{const{quantity:e,unit_price:n,discount:r}=t||{};if(e&&e.amount===null||n&&n.amount===null)return{quantity:af.create({amount:e.amount,scale:0}).object,unitPrice:Oi.create({amount:n.amount,scale:2}).object,subtotalPrice:Oi.create({amount:null,scale:2}).object,discount:of.create({amount:r.amount,scale:2}).object,totalPrice:Oi.create({amount:null,scale:2}).object};const s=af.create(e);if(s.isFailure)throw s.error;const i=s.object,o=Oi.create(n);if(o.isFailure)throw o.error;const a=o.object,c=of.create(r);if(c.isFailure)throw c.error;const u=c.object,f=a.multiply(i.toNumber()),l=f.subtract(f.percentage(u.toNumber()));return{quantity:i,unitPrice:a,subtotalPrice:f,discount:u,totalPrice:l}},iBe=()=>{const{id:t}=rMe();return t},oBe=()=>{const{watch:t,register:e,formState:n}=qi(),{formatNumber:r}=A4e(),s=t("currency_code"),i=r(t("subtotal_price")),o=r(t("discount_price")),a=r(t("tax_price")),c=r(t("total_price")),u=S.useMemo(()=>{const f=au.createFromCode(s);return f.isSuccess?f.object.symbol:""},[s]);return b.jsx(xr,{className:"w-full bg-muted",children:b.jsxs(wr,{className:"flex flex-row items-end gap-2 p-4 border-t",children:[b.jsx("div",{className:"grid flex-1 h-16 grid-cols-1 auto-rows-max",children:b.jsxs("div",{className:"grid gap-1 font-semibold text-right text-muted-foreground",children:[b.jsx(ys,{className:"text-sm",children:te("quotes.form_fields.subtotal_price.label")}),b.jsxs(ns,{className:"flex items-baseline justify-end text-2xl tabular-nums",children:[i,b.jsx("span",{className:"ml-1 text-lg tracking-normal",children:u})]})]})}),b.jsx(iu,{orientation:"vertical",className:"w-px h-16 mx-2"}),b.jsxs("div",{className:"grid flex-1 h-16 grid-cols-2 gap-6 auto-rows-max",children:[b.jsxs("div",{className:"grid gap-1 font-medium text-muted-foreground",children:[b.jsx(ys,{className:"text-sm",children:te("quotes.form_fields.discount.label")}),b.jsx(nA,{scale:2,disabled:n.disabled,placeholder:te("quotes.form_fields.discount.placeholder"),...e("discount",{required:!1})})]}),b.jsxs("div",{className:"grid gap-1 font-semibold text-muted-foreground",children:[b.jsx(ys,{className:"text-sm text-right",children:te("quotes.form_fields.discount_price.label")}),b.jsxs(ns,{className:"flex items-baseline justify-end text-2xl tabular-nums",children:[o,b.jsx("span",{className:"ml-1 text-lg tracking-normal",children:u})]})]})]}),b.jsx(iu,{orientation:"vertical",className:"w-px h-16 mx-2"}),b.jsxs("div",{className:"grid flex-1 h-16 grid-cols-2 gap-6 auto-rows-max",children:[b.jsxs("div",{className:"grid gap-1 font-medium text-muted-foreground",children:[b.jsx(ys,{className:"text-sm",children:te("quotes.form_fields.tax.label")}),b.jsx(nA,{scale:2,disabled:n.disabled,placeholder:te("quotes.form_fields.tax.placeholder"),...e("tax",{required:!1})})]}),b.jsxs("div",{className:"grid gap-1 font-semibold text-muted-foreground",children:[b.jsx(ys,{className:"text-sm text-right",children:te("quotes.form_fields.tax_price.label")}),b.jsxs(ns,{className:"flex items-baseline justify-end gap-1 text-2xl tabular-nums",children:[a,b.jsx("span",{className:"text-base font-medium tracking-normal",children:u})]})]})]})," ",b.jsx(iu,{orientation:"vertical",className:"w-px h-16 mx-2"}),b.jsx("div",{className:"grid flex-1 h-16 grid-cols-1 auto-rows-max",children:b.jsxs("div",{className:"grid gap-0",children:[b.jsx(ys,{className:"text-sm font-semibold text-right text-foreground",children:te("quotes.form_fields.total_price.label")}),b.jsxs(ns,{className:"flex items-baseline justify-end gap-1 text-3xl tabular-nums",children:[c,b.jsx("span",{className:"ml-1 text-lg tracking-normal",children:u})]})]})})]})})},Yne=t=>{const{percentage:e,cancel:n,error:r,isInProgress:s,onFinishDownload:i}=t,o=S.useId();return S.useEffect(()=>{s&&!r&&e===100&&i&&i()},[e,s,r,i]),b.jsx(Ey,{open:s,children:b.jsxs(Bp,{className:"sm:max-w-md",children:[b.jsxs(Up,{children:[b.jsx(Vp,{children:te("quotes.downloading_dialog.title")}),b.jsx(C_,{children:te("quotes.downloading_dialog.description")})]}),b.jsxs("div",{className:"mb-4 space-y-2",id:o,children:[b.jsx(Gp,{children:te("quotes.downloading_dialog.progress.label",{status:te(s?"quotes.downloading_dialog.progress.status_in_progress":"quotes.downloading_dialog.progress.status_stopped")})}),b.jsx(J2,{value:e,max:100,getValueLabel:()=>te("quotes.downloading_dialog.progress.label",{})}),r&&b.jsxs("p",{children:["Error: ",JSON.stringify(r)]})]}),b.jsx(Hp,{className:"sm:justify-end",children:b.jsx(xE,{asChild:!0,children:b.jsx(qe,{type:"button",variant:"secondary",onClick:()=>n(),children:te("quotes.downloading_dialog.cancel_button")})})})]})})},aBe=({isInProgress:t,percentage:e,elapsed:n,cancel:r,error:s,className:i})=>{const[o,a]=S.useState(10);return S.useEffect(()=>{if(t&&e>0){const c=n/e*100;a(Math.max(0,Math.round(c-n)))}},[t,e,n]),!t&&!(s!=null&&s.errorMessage)?null:b.jsxs(xr,{className:ie("overflow-hidden",i),children:[b.jsx(Ni,{children:b.jsxs(ns,{className:"flex items-center justify-between",children:[s!=null&&s.errorMessage?"Error en la generación del PDF":"Generando PDF",t&&b.jsx(Upe,{className:"w-4 h-4 animate-spin"}),(s==null?void 0:s.errorMessage)&&b.jsx(jpe,{className:"w-4 h-4 text-destructive"})]})}),b.jsx(wr,{children:s!=null&&s.errorMessage?b.jsx("div",{className:"text-destructive",children:s==null?void 0:s.errorMessage}):b.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[b.jsxs("div",{className:"relative w-32 h-40 overflow-hidden rounded-lg bg-muted",children:[b.jsx("div",{className:"absolute bottom-0 left-0 right-0 transition-all duration-1000 ease-out bg-primary",style:{height:`${e}%`}}),b.jsx(zpe,{className:"absolute transform -translate-x-1/2 -translate-y-1/2 animate-pulse top-1/2 left-1/2 text-muted-foreground",size:48})]}),b.jsx(J2,{value:e,className:"w-full"}),b.jsxs("div",{className:"text-sm text-center text-muted-foreground",children:[b.jsxs("p",{children:["Progreso: ",e,"%"]}),b.jsxs("div",{className:"hidden",children:[b.jsxs("p",{children:["Tiempo transcurrido: ",n," segundos"]}),o>0&&b.jsxs("p",{children:["Tiempo estimado restante: ",o," segundos"]})]})]}),b.jsx(qe,{variant:"destructive",onClick:r,className:"hidden",children:"Cancelar generación"})]})})]})},Xne=({quote:t,className:e})=>{const{useReport:n,getQuotePDFFilename:r,useDownloader:s}=tS(),{download:i}=s(),{report:o,preview:a,isInProgress:c,...u}=n(),[f,l]=S.useState(void 0),d=S.useCallback(()=>{t&&i(t.id,r(t))},[t]);return S.useEffect(()=>{const p=setTimeout(()=>{t&&t.id&&a(t.id)},200);return()=>clearTimeout(p)},[t]),S.useEffect(()=>{if(!c&&o){const p=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(o):window.webkitURL.createObjectURL(o);return l(p),()=>{l(void 0),window.URL.revokeObjectURL(p)}}},[o,c]),t?c?b.jsx(aBe,{isInProgress:c,...u}):b.jsx(_4e,{file:f,className:"object-contain",onThumbnailClick:d}):b.jsx(xr,{className:ie("overflow-hidden",e),children:b.jsx(wr,{className:"px-4 py-6 text-center",children:b.jsx("p",{className:"mx-auto",children:"Select a quote"})})})};Xne.whyDidYouRender=!0;const ej=({onSelect:t})=>{const e=Us(),{pagination:n,globalFilter:r,isFiltered:s}=nm(),[i,o]=S.useState([]),a=(y,g)=>{console.log("handleQuantity",y,g),o(v=>{const x=[...v];return x[y]=g,x})},c=()=>{console.log("reset"),o([])},{data:u,isPending:f,isError:l,error:d}=qne({pagination:{pageIndex:n.pageIndex,pageSize:n.pageSize},searchTerm:r});S.useEffect(()=>{c()},[n,r,s]),console.log(i);const p=GOe(),h=[p.accessor("description",{id:"description",header:()=>b.jsx(b.Fragment,{children:te("catalog.list.columns.description")})}),p.accessor("points",{id:"points",header:()=>b.jsx("div",{className:"text-right",children:te("catalog.list.columns.points")}),cell:({renderValue:y})=>b.jsx("div",{className:"text-right",children:y()})}),p.accessor("retail_price",{id:"retail_price",header:()=>b.jsx("div",{className:"text-right",children:te("catalog.list.columns.retail_price")}),cell:({row:y})=>{const g=Oi.create(y.original.retail_price).object;return b.jsx("div",{className:"text-right",children:g.toFormat()})}}),p.display({id:"quantity",header:()=>b.jsx("div",{className:"font-medium text-right text-foreground",children:te("catalog.list.columns.quantity")}),cell:({row:{index:y}})=>b.jsx(F_,{type:"number",name:"quantity",defaultValue:1,min:1,className:"w-24",value:i[y],onChange:g=>{g.preventDefault(),a(y,parseInt(g.target.value))}})}),p.display({id:"row-actions",header:()=>null,cell:({row:y})=>b.jsxs(qe,{size:"sm",variant:"outline",className:"h-8 gap-1",onClick:g=>{g.preventDefault(),t&&t(y.original,i[y.index])},children:[b.jsx(mL,{className:"h-3.5 w-3.5"}),b.jsx("span",{className:"sr-only xl:not-sr-only xl:whitespace-nowrap",children:te("common.add")})]})})],{table:m}=qN({data:[...(u==null?void 0:u.items)||[]],columns:h,pageCount:(u==null?void 0:u.total_pages)??-1});return l?b.jsx(_f,{subtitle:d.message}):f?b.jsx(PN,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0}):(u==null?void 0:u.total_items)===0&&!s?b.jsx(TN,{subtitle:"Empieza cargando los artículos del catálogo",buttonText:"",onButtonClick:()=>e("/catalog/add")}):b.jsx(SN,{className:"bg-transparent border-0 shadow-none",table:m,paginationOptions:{visible:!0,enablePageSizeSelector:!1},footerClassName:"px-10 pt-2 border-t",children:b.jsx(Wne,{table:m})})},cF=S.forwardRef(({label:t=te("common.append_block"),className:e,...n},r)=>b.jsxs(qe,{type:"button",variant:"outline",ref:r,...n,children:[" ",b.jsx(mL,{className:t?"w-4 h-4 mr-2":"w-4 h-4"}),t&&b.jsx(b.Fragment,{children:t})]}));cF.displayName="AppendBlockRowButton";const uF=S.forwardRef(({label:t=te("common.append_article"),className:e,...n},r)=>b.jsxs(qe,{type:"button",variant:"outline",ref:r,...n,children:[" ",b.jsx(mL,{className:t?"w-4 h-4 mr-2":"w-4 h-4"}),t&&b.jsx(b.Fragment,{children:t})]}));uF.displayName="AppendCatalogArticleRowButton";const dF=S.forwardRef(({label:t=te("common.append_empty_row"),className:e,...n},r)=>b.jsxs(qe,{type:"button",variant:"outline",ref:r,...n,children:[b.jsx(Ope,{className:t?"w-4 h-4 mr-2":"w-4 h-4"}),t&&b.jsx(b.Fragment,{children:t})]}));dF.displayName="AppendEmptyRowButton";const lBe=({table:t})=>{const e=t.getSelectedRowModel().rows.length;return e?b.jsx("nav",{className:"flex items-center h-12 p-1 rounded-md text-muted-foreground bg-muted ",children:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsxs(bs,{children:[b.jsx(xs,{asChild:!0,children:b.jsxs(qe,{type:"button",variant:"ghost",disabled:!t.getSelectedRowModel().rows.length,onClick:()=>{var n;return(n=t.options.meta)==null?void 0:n.duplicateItems()},children:[b.jsx(Lpe,{className:"w-4 h-4 sm:mr-2"}),b.jsx("span",{className:"sr-only sm:not-sr-only",children:te("common.duplicate_selected_rows")})]})}),b.jsx(rs,{children:te("common.duplicate_selected_rows_tooltip")})]}),b.jsxs(bs,{children:[b.jsx(xs,{asChild:!0,children:b.jsxs(qe,{type:"button",variant:"ghost",disabled:!t.getSelectedRowModel().rows.length,onClick:()=>{var n;return(n=t.options.meta)==null?void 0:n.deleteItems()},children:[b.jsx(bq,{className:"w-4 h-4 sm:mr-2"}),b.jsx("span",{className:"sr-only sm:not-sr-only",children:te("common.remove_selected_rows")})]})}),b.jsx(rs,{children:te("common.remove_selected_rows_tooltip")})]}),b.jsxs(bs,{children:[b.jsx(xs,{asChild:!0,children:b.jsxs(qe,{type:"button",variant:"ghost",disabled:!t.getSelectedRowModel().rows.length,onClick:()=>t.resetRowSelection(),children:[b.jsx(Gpe,{className:"w-4 h-4 sm:mr-2"}),b.jsx("span",{className:"sr-only sm:not-sr-only",children:te("common.reset_selected_rows")})]})}),b.jsx(rs,{children:te("common.reset_selected_rows_tooltip")})]}),b.jsx(iu,{orientation:"vertical",className:"h-6 mx-1 bg-muted-foreground"}),b.jsx("p",{className:"text-sm",children:te("common.rows_selected",{count:e})})]})}):b.jsxs("nav",{className:"flex items-center h-12 p-1 rounded-md bg-accent/75 text-muted-foreground",children:[b.jsxs("div",{className:"flex space-x-2",children:[b.jsxs(bs,{children:[b.jsx(xs,{asChild:!0,children:b.jsx(dF,{variant:"ghost",onClick:()=>{var n;return(n=t.options.meta)==null?void 0:n.appendItem()}})}),b.jsx(rs,{children:te("common.append_empty_row_tooltip")})]}),b.jsxs(bs,{children:[b.jsx(xs,{asChild:!0,children:b.jsx(uF,{variant:"ghost",onClick:()=>{var n;t.options.meta&&t.options.meta.pickCatalogArticle&&((n=t.options.meta)==null||n.pickCatalogArticle())}})}),b.jsx(rs,{children:te("common.append_article_tooltip")})]}),b.jsxs(bs,{children:[b.jsx(xs,{asChild:!0,children:b.jsx(cF,{variant:"ghost",onClick:()=>{var n;t.options.meta&&t.options.meta.pickBlock&&((n=t.options.meta)==null||n.pickBlock())}})}),b.jsx(rs,{children:te("common.append_block_tooltip")})]})]}),b.jsx("div",{className:"flex items-center gap-2 ml-auto"})]})},cBe=S.createContext({attributes:{},listeners:void 0,ref(){}});function uBe(t){return t.isSorting||t.wasDragging?iee(t):!0}function dBe({id:t,children:e}){const{attributes:n,isDragging:r,listeners:s,setNodeRef:i,setActivatorNodeRef:o,transform:a,transition:c}=aee({animateLayoutChanges:uBe,id:t}),u={transform:Gl.Translate.toString(a),transition:c},f=S.useMemo(()=>({attributes:n,listeners:s,ref:o}),[n,s,o]);return b.jsx(cBe.Provider,{value:f,children:b.jsx(Qd,{id:String(t),className:ie(r?"opacity-60":"opacity-100","m-0 hover:bg-muted hover:focus-within:bg-accent focus-within:bg-accent"),ref:i,style:u,children:e},t)})}const fBe={droppable:{strategy:ry.Always}},hBe={keyframes({transform:t}){return[{opacity:1,transform:Gl.Transform.toString(t.initial)},{opacity:0,transform:Gl.Transform.toString({...t.final,x:t.final.x+5,y:t.final.y+5})}]},easing:"ease-out",sideEffects({active:t}){t.node.animate([{opacity:0},{opacity:1}],{duration:DO.duration,easing:DO.easing})}};function FH({columns:t,data:e,defaultValues:n,initialState:r,actions:s}){const[i,o]=S.useState({}),[a,c]=S.useState(),[u,f]=S.useState((r==null?void 0:r.columnVisibility)||{}),l=S.useMemo(()=>e.map(v=>v.id),[e]),d=NJ({data:e,columns:t,enableColumnResizing:!1,columnResizeMode:"onChange",autoResetAll:!1,initialState:r,state:{rowSelection:i,columnVisibility:u},enableRowSelection:!0,enableMultiRowSelection:!0,enableSorting:!1,enableHiding:!0,onRowSelectionChange:o,getCoreRowModel:AJ(),getRowId:v=>v==null?void 0:v.id,debugTable:!1,debugHeaders:!1,debugColumns:!1,defaultColumn:{minSize:0,size:Number.MAX_SAFE_INTEGER,maxSize:Number.MAX_SAFE_INTEGER},meta:{insertItem:(v,x)=>{s.insert(v,x||(n==null?void 0:n.items[0]),{shouldFocus:!0})},appendItem:v=>{s.append(v||(n==null?void 0:n.items[0]),{shouldFocus:!0})},pickCatalogArticle:()=>{s.pickCatalogArticle&&(s==null||s.pickCatalogArticle())},pickBlock:()=>{s.pickBlock&&(s==null||s.pickBlock())},duplicateItems:v=>{if(v!=null){const x=d.getRowModel().rows[v].original;s.insert(v+1,x,{shouldFocus:!0})}else if(d.getSelectedRowModel().rows.length){const x=d.getSelectedRowModel().rows[d.getSelectedRowModel().rows.length-1].index,_=d.getSelectedRowModel().rows.map(A=>({...A.original,id:void 0}));d.getRowModel().rows.length<x+1?s.append(_):s.insert(x+1,_,{shouldFocus:!0}),d.resetRowSelection()}},deleteItems:v=>{if(v!=null)s.remove(v);else if(d.getSelectedRowModel().rows.length>0){let x=d.getSelectedRowModel().rows.length-1;for(;x>=0;x--){const _=l.indexOf(String(d.getSelectedRowModel().rows[x].id));s.remove(_),l.splice(_,1)}d.resetRowSelection()}else s.remove()},updateItem:(v,x,_,A)=>{s.update(v,{...x,[`${_}`]:A})}}}),p=aje(O1(GJ,{}),O1(KJ,{}),O1(B$,{}),O1(H$,{}));function h(v){var A;let x=v.active.id,_=(A=v.over)==null?void 0:A.id;if(_!==void 0&&x!==_){let N=l.indexOf(String(_));if(d.getSelectedRowModel().rows.length>1)d.getSelectedRowModel().rows.forEach((T,E)=>{const P=l.indexOf(String(T.id));E>0&&(x=T.id,N=l.indexOf(String(_)),N<P&&(N=N+1)),s.move(P,N),l.splice(N,0,l.splice(P,1)[0]),_=T.id});else{const T=l.indexOf(String(x));s.move(T,N)}}c(null)}function m({active:v}){d.getSelectedRowModel().rowsById[v.id]||d.resetRowSelection(),c(v.id)}function y(){c(null)}function g(v){return a?v.filter(x=>{const _=typeof x=="string"?x:x.id;return _===a||!d.getSelectedRowModel().rowsById[_]}):v}return b.jsx(iLe,{measuring:fBe,sensors:p,onDragEnd:h,onDragStart:m,onDragCancel:y,collisionDetection:hje,children:b.jsxs(xr,{children:[b.jsx(Ni,{className:"sticky z-10 top-16 bg-card/90",children:b.jsx(ns,{children:b.jsx(lBe,{table:d})})}),b.jsxs(wr,{children:[b.jsxs(sN,{className:"table-fixed",children:[b.jsx(iN,{className:"sticky top-0 z-10 bg-background",children:d.getHeaderGroups().map(v=>b.jsx(Qd,{className:"hover:bg-transparent",children:v.headers.map(x=>b.jsx(aN,{className:"px-2 py-1",style:{width:x.getSize()===Number.MAX_SAFE_INTEGER?"auto":x.getSize()},children:x.isPlaceholder?null:b.jsx(MJ,{table:d,header:x})},x.id))},v.id))}),b.jsx(oN,{children:b.jsx(PLe,{items:g(l),strategy:RLe,children:g(d.getRowModel().rows).map(v=>b.jsx(dBe,{id:v.id,children:v.getVisibleCells().map(x=>b.jsx(hx,{className:"px-2 py-2 align-top",style:{width:x.column.getSize()===Number.MAX_SAFE_INTEGER?"auto":x.column.getSize()},children:KE(x.column.columnDef.cell,x.getContext())},x.id))},v.id))})})]}),ss.createPortal(b.jsx(SLe,{dropAnimation:hBe,className:"z-40 opacity-100",children:a&&b.jsx("div",{className:"relative flex flex-wrap",children:d.getSelectedRowModel().rows.length?b.jsx(gR,{variant:"destructive",className:"absolute z-50 flex items-center justify-center w-2 h-2 p-3 rounded-full top left -left-2 -top-2",children:d.getSelectedRowModel().rows.length}):null})}),document.body),!1]}),b.jsx(Yo,{children:b.jsxs(Pp,{children:[b.jsx(dF,{onClick:()=>{var v;return(v=d.options.meta)==null?void 0:v.appendItem()}}),b.jsx(uF,{onClick:()=>{var v;d.options.meta&&d.options.meta.pickCatalogArticle&&((v=d.options.meta)==null||v.pickCatalogArticle())}}),b.jsx(cF,{onClick:()=>{var v;d.options.meta&&d.options.meta.pickBlock&&((v=d.options.meta)==null||v.pickBlock())}})]})})]})})}const pBe={en:[{id:2000000098,code:"CAP_CLA_SEMI_SUSPENDIDO_EN",title:"Finish: MELAMINE / colour: TO BE DETERMINED",body:`Thickness block: 19 mm / Thickness complements: 19 mm.\r
|
||
Hanging rods: CHROME/ BLACK\r
|
||
Glass drawer fronts: STRAIGHT / "U" - FLOAT BRONZE C-424 \r
|
||
Drawer handle: xxxxx / Drawers: 4 DE 180 MM.\r
|
||
Shoe rack door: YES/NO / Profile finish: BLACK LACQUER / SILVER MATTE\r
|
||
Shoe cabinet door glass finish: FLOAT BRONZE C-424\r
|
||
Composed of:`},{id:2000000084,code:"CAP_FRE_ARM_ABATIBLE_EN",title:"CHARACTERISTICS OF THE FRONT OF THE HINGED WARDROBE",body:`Size of opening: 2275x1390 mm.\r
|
||
Model: ARGO / Finish: LACQUER / Colour: TO BE DETERMINED\r
|
||
Door thickness: 22 or 19 mm\r
|
||
Door finish: SMOOTH \r
|
||
Handle: KNOB TO BE DETERMINED\r
|
||
Hardware finish: CHROME OR ANTHRACITE\r
|
||
Perimetral doorposts: VISIBLE, REMETED OR COMBI TO BE DETERMINED.\r
|
||
Number of doors: 2 \r
|
||
Composed of:`},{id:2000000089,code:"CAP_FRE_ARM_CORREDERA_EN",title:"Size of opening: 2440x5180mm. ",body:`Model: PANORAMIC P.O. / Finish: LACQUER / Colour: WHITE\r
|
||
No. of listers: NO LISTELS / Panels finish: LACQUERED PANEL \r
|
||
Handle: \r
|
||
Perimeter frame: \r
|
||
Nº of doors: \r
|
||
INCORPORATED HYDRAULIC BRAKE (not available in lower doors of 650 mm.) OR INCORPORATED MAGNETIC BRAKE. \r
|
||
Composed of:`},{id:2000000092,code:"CAP_INT_ARM_FORRADO_EN",title:"Finish: MELAMINE / colour: TO BE DETERMINED",body:`Thickness block: 19 mm / Thickness complements: 19 mm.\r
|
||
Hanging rods: CHROME/ BLACK\r
|
||
Glass drawer fronts: STRAIGHT / "U" - FLOAT BRONZE C-424 \r
|
||
Drawer handle: xxxxx / Drawers: 4 DE 180 MM.\r
|
||
Composed of:`},{id:2000000109,code:"CAP_INT_EST_CRISTAL_EN",title:"Frames finish: BLACK ANODIZED",body:`Side frame panel finish: BRONZE FLOAT BRONZE GLASS C-424\r
|
||
Rear panel finish: BRONZE FLOAT GLASS C-424\r
|
||
Complements finish: MELAMIN / Colour: DENBER OAK M-242\r
|
||
Thickness of accessories: 25 mm.\r
|
||
Hanging bars: BLACK\r
|
||
Glass drawer fronts: STRAIGHT / "U" - FLOAT BRONZE C-424 \r
|
||
Drawer handle: xxxxx / Drawers: 4 DE 180 MM.\r
|
||
Composed of:`},{id:2000000095,code:"CAP_SEP_AMBIENTES_EN",title:"CHARACTERISTICS SEPARATION OF ROOMS",body:`Size of opening: 2450x3000 mm.\r
|
||
Model: LYN / Finish: ANODISED / Colour: BLACK\r
|
||
No. of crosspieces: 2 HORIZONTAL CROSSBARS\r
|
||
Panel finish: TRANSPARENT TEMPLARED \r
|
||
Handle: DOUBLE PER DOOR\r
|
||
Brake: DOUBLE PER DOOR (OPENING AND CLOSING)\r
|
||
Guide: VISTA (DOUBLE EMBELLECEDOR)\r
|
||
Number of panels: 2 SLIDING + 2 FIXED`}],es:[{id:54,code:"CAP_CLA_SEMI_SUSPENDIDO_ES",title:"Acabado: MELAMINA / color: A DETERMINAR",body:`Espesor bloque: 25 mm. / Espesor complementos: 25 mm.\r
|
||
Barras de colgar: CROMO/ NEGRA/ BRONCE\r
|
||
Frentes cristal cajones: RECTO / “U” – FLOAT BRONCE C-424\r
|
||
Tirador cajones: FRENTE BAJO / Cajones: 4 DE 180 MM. A DETERMINAR\r
|
||
Baldas deslizantes: X DE 145 MM. A DETERMINAR\r
|
||
Compuesto por:`},{id:52,code:"CAP_FRE_ARM_ABATIBLE_ES",title:"CARACTERISTICAS FRENTE DE ARMARIO",body:`Medida de hueco: 2275x1390 mm.\r
|
||
Modelo: ARGO / Acabado: LACADO / Color: A DETERMINAR\r
|
||
Grosor hoja: 22 o 19 mm\r
|
||
Acabado de hojas: LISAS\r
|
||
Tirador: UÑERO A DETERMINAR\r
|
||
Acabado herrajes: CROMADO O ANTRACITA\r
|
||
Jambas perimetrales: VISTAS, REMETIDAS O COMBI A DETERMINAR.\r
|
||
Nº de hojas: 2\r
|
||
Compuesto por:`},{id:51,code:"CAP_FRE_ARM_CORREDERA_ES",title:"CARACTERISTICAS FRENTE DE ARMARIO",body:`Medida de Hueco:2440x5180mm.\r
|
||
Modelo: PANORAMIC P.O. / Acabado: LACADO / Color: BLANCO\r
|
||
Nº de lístelos: SIN LISTELOS / Acabado paneles: PANEL LACADO\r
|
||
Tirador:\r
|
||
Cerco perimetral: \r
|
||
Nº de hojas:\r
|
||
FRENO HIDRAULICO INCORPORADO O FRENO MAGNETICO INCORPORADO\r
|
||
Compuesto por:`},{id:53,code:"CAP_INT_ARM_FORRADO_ES",title:"CARACTERISTICAS INTERIOR DE ARMARIO",body:`Acabado: MELAMINA / color: A DETERMINAR\r
|
||
Espesor bloque: 19 mm. / Espesor complementos: 19 mm.\r
|
||
Barras de colgar: CROMO/ NEGRA/ BRONCE\r
|
||
Frentes cristal cajones: RECTO / “U” – FLOAT BRONCE C-424\r
|
||
Tirador cajones: FRENTE BAJO / Cajones: 4 DE 180 MM. A DETERMINAR\r
|
||
Baldas deslizantes: X DE 145 MM. A DETERMINAR\r
|
||
Compuesto por:`},{id:2000000108,code:"CAP_INT_EST_CRISTAL_ES",title:"Acabado bastidores: ANODIZADO NEGRO",body:`Acabado panel bastidores laterales: CRISTAL TEMPLADO FLOAT BRONCE C-424\r
|
||
Acabado trasera: CRISTAL TEMPLADO FLOAT BRONCE C-424\r
|
||
Acabado complementos: MELAMINA / Color: ROBLE DENBER M-242\r
|
||
Espesor complementos: 25 mm.\r
|
||
Barras de colgar: NEGRA\r
|
||
Frentes cristal cajones: RECTO / “U” – FLOAT BRONCE C-424 \r
|
||
Tirador cajones: xxxxx / Cajones: 4 DE 180 MM.\r
|
||
Compuesto por:`},{id:50,code:"CAP_SEP_AMBIENTES_ES",title:"CARACTERISTICAS SEPARACIÓN DE AMBIENTES",body:`Medida de Hueco: 2450x3000 mm.\r
|
||
Modelo: LYN / Acabado: ANODIZADO / Color: NEGRO\r
|
||
Nº de travesaños: 2 TRAVESAÑOS HORIZONTALES\r
|
||
Acabado paneles: TRANSPARENTE TEMPLADO \r
|
||
Tirador: DOBLE POR PUERTA\r
|
||
Freno: DOBLE POR PUERTA (APERTURA Y CIERRE)\r
|
||
Guía: VISTA (DOBLE EMBELLECEDOR)\r
|
||
Nº de hojas: 2 CORREDERAS + 2 FIJOS`}]},zH=({onSelect:t})=>{const{i18n:e}=K$(),[n]=S.useState(e.resolvedLanguage||"es"),[r]=S.useState(pBe[n.toLowerCase()]);return console.log(n),b.jsx(QR,{className:"h-96",children:b.jsx("div",{className:"flex flex-col gap-2 p-4 pt-0",children:r&&r.sort((s,i)=>s.title.localeCompare(i.title)).map((s,i)=>b.jsx("button",{className:"flex flex-col items-start gap-2 p-3 text-sm text-left transition-all border rounded-lg hover:bg-accent",onClick:()=>t&&t(s,1),children:b.jsxs("div",{className:"flex flex-col w-full gap-1",children:[b.jsx("div",{className:"flex items-center",children:b.jsx("div",{className:"flex items-center gap-2",children:b.jsx("div",{className:"font-semibold",children:s.title})})}),b.jsx("div",{className:"text-xs line-clamp-2 text-muted-foreground",children:b.jsx("p",{dangerouslySetInnerHTML:{__html:s.body.substring(0,300).replace(`\r
|
||
`,"<br>")}})})]})},s.id))})})},mBe=({isOpen:t,onOpenChange:e,onSelect:n})=>Mne("(min-width: 768px)")?b.jsx(Ey,{modal:!0,open:t,onOpenChange:e,children:b.jsxs(Bp,{className:"w-full max-w-full md:w-9/12 lg:w-10/12",children:[b.jsxs(Up,{children:[b.jsx(Vp,{children:te("quotes.blocks_picker_dialog.title")}),b.jsx(C_,{children:te("quotes.blocks_picker_dialog.description")})]}),b.jsx(zH,{onSelect:n}),b.jsx(Hp,{children:b.jsx(qe,{type:"submit",onClick:()=>e(!1),children:te("common.close")})})]})}):b.jsx(T2,{open:t,onOpenChange:e,children:b.jsxs(k2,{children:[b.jsxs(D2,{className:"text-left",children:[b.jsx(O2,{children:te("quotes.blocks_picker_dialog.title")}),b.jsx(I2,{children:te("quotes.blocks_picker_dialog.description")})]}),b.jsx(zH,{onSelect:n}),b.jsx(M2,{className:"pt-2",children:b.jsx(lK,{asChild:!0,children:b.jsx(qe,{variant:"outline",children:te("common.close")})})})]})}),gBe=({isOpen:t,onOpenChange:e,onSelect:n})=>Mne("(min-width: 768px)")?b.jsx(Ey,{modal:!0,open:t,onOpenChange:e,children:b.jsxs(Bp,{className:"w-full max-w-full md:w-9/12 lg:w-10/12",children:[b.jsxs(Up,{children:[b.jsx(Vp,{children:te("quotes.catalog_picker_dialog.title")}),b.jsx(C_,{children:te("quotes.catalog_picker_dialog.description")})]}),b.jsx(ny,{syncWithLocation:!1,initialPageSize:5,children:b.jsx(ej,{onSelect:n})}),b.jsx(Hp,{children:b.jsx(qe,{type:"submit",onClick:()=>e(!1),children:te("common.close")})})]})}):b.jsx(T2,{open:t,onOpenChange:e,children:b.jsxs(k2,{children:[b.jsxs(D2,{className:"text-left",children:[b.jsx(O2,{children:te("quotes.catalog_picker_dialog.title")}),b.jsx(I2,{children:te("quotes.catalog_picker_dialog.description")})]}),b.jsx(ny,{syncWithLocation:!1,initialPageSize:5,children:b.jsx(ej,{onSelect:n})}),b.jsx(M2,{className:"pt-2",children:b.jsx(lK,{asChild:!0,children:b.jsx(qe,{variant:"outline",children:te("common.close")})})})]})}),vBe=({currency:t,language:e,defaultValues:n})=>{const{toast:r}=tc(),{control:s,register:i}=qi(),[o]=S.useState("dialog"),[a,c]=S.useState(!1),[u,f]=S.useState(!1),{fields:l,...d}=XAe({control:s,name:"items"}),p=eBe([{id:"description",accessorKey:"description",header:te("quotes.form_fields.items.description.label"),cell:({row:{index:_,original:A}})=>b.jsx(Ba,{readOnly:A==null?void 0:A.id_article,autoSize:!0,...i(`items.${_}.description`)}),size:500},{id:"quantity",accessorKey:"quantity",header:()=>b.jsx("div",{className:"text-right",children:te("quotes.form_fields.items.quantity.label")}),cell:({row:{index:_}})=>b.jsx(JLe,{scale:0,className:"text-right",...i(`items.${_}.quantity`)})},{id:"unit_price",accessorKey:"unit_price",header:()=>b.jsx("div",{className:"text-right",children:te("quotes.form_fields.items.unit_price.label")}),cell:({row:{index:_}})=>b.jsx(hC,{currency:t,language:e,scale:2,className:"text-right",...i(`items.${_}.unit_price`)})},{id:"subtotal_price",accessorKey:"subtotal_price",header:()=>b.jsx("div",{className:"text-right",children:te("quotes.form_fields.items.subtotal_price.label")}),cell:({row:{index:_}})=>b.jsx(hC,{currency:t,language:e,scale:2,readOnly:!0,className:"text-right",...i(`items.${_}.subtotal_price`)})},{id:"discount",accessorKey:"discount",header:()=>b.jsx("div",{className:"text-right",children:te("quotes.form_fields.items.discount.label")}),cell:({row:{index:_}})=>b.jsx(nA,{scale:2,className:"text-right",...i(`items.${_}.discount`)})},{id:"total_price",accessorKey:"total_price",header:()=>b.jsx("div",{className:"text-right",children:te("quotes.form_fields.items.total_price.label")}),cell:({row:{index:_}})=>b.jsx(hC,{variant:"ghost",currency:t,language:e,scale:2,readOnly:!0,className:"font-semibold text-right",...i(`items.${_}.total_price`)})}],{enableDragHandleColumn:!0,enableSelectionColumn:!0,enableActionsColumn:!0,rowActionFn:_=>{const{table:A,row:N}=_;return[{label:te("common.duplicate_row"),icon:b.jsx(pL,{className:"w-4 h-4 mr-2"}),onClick:()=>{var T;return(T=A.options.meta)==null?void 0:T.duplicateItems(N.index)}},{label:te("common.insert_row_above"),icon:b.jsx(dq,{className:"w-4 h-4 mr-2"}),onClick:()=>{var T;return(T=A.options.meta)==null?void 0:T.insertItem(N.index)}},{label:te("common.insert_row_below"),icon:b.jsx(dy,{className:"w-4 h-4 mr-2"}),onClick:()=>{var T;return(T=A.options.meta)==null?void 0:T.insertItem(N.index+1)}},{label:"-"},{label:te("common.remove_row"),icon:b.jsx(bq,{className:"w-4 h-4 mr-2"}),onClick:()=>{var T;(T=A.options.meta)==null||T.deleteItems(N.index)}}]}}),h=S.useCallback((_,A=1)=>{d.append({..._,quantity:{amount:100*A,scale:af.DEFAULT_SCALE},unit_price:_.retail_price,discount:{amount:null,scale:2}}),r({title:te("quotes.catalog_picker_dialog.toast_article_added"),description:_.description})},[d]),m=S.useCallback(_=>{d.append({description:`${_.title}
|
||
${_.body}`,quantity:{amount:null,scale:af.DEFAULT_SCALE},unit_price:{amount:null,scale:$Oe.DEFAULT_SCALE},discount:{amount:null,scale:2}}),r({title:te("quotes.blocks_picker_dialog.toast_article_added"),description:_.title})},[d]),[y,g]=S.useState(!1),v=[265,440,655],x=4;return o==="dialog"?b.jsxs("div",{className:"relative",children:[b.jsx(FH,{actions:{...d,pickCatalogArticle:()=>c(!0),pickBlock:()=>f(!0)},columns:p,data:l,defaultValues:n}),b.jsx(gBe,{onSelect:h,isOpen:a,onOpenChange:c}),b.jsx(mBe,{onSelect:m,isOpen:u,onOpenChange:f})]}):b.jsxs(LPe,{direction:"horizontal",autoSaveId:"uecko.quotes.details_layout",className:"items-stretch h-full",children:[b.jsx(z5,{defaultSize:v[0],collapsedSize:x,collapsible:!0,minSize:50,maxSize:90,onCollapse:()=>{g(!0)},onExpand:()=>{g(!1)},className:ie(y&&"min-w-[50px] transition-all duration-300 ease-in-out"),children:b.jsx(FH,{actions:d,columns:p,data:l,defaultValues:n})}),b.jsx($Pe,{withHandle:!0,className:"mx-3"}),b.jsx(z5,{defaultSize:v[1],minSize:10,children:b.jsx(ny,{syncWithLocation:!1,children:b.jsx(ej,{onSelect:h})})})]})},yBe=()=>{const{register:t,formState:e}=qi();return b.jsxs("div",{className:"grid gap-6 md:grid-cols-6",children:[b.jsxs(tA,{className:"md:col-span-6",title:te("quotes.create.form_groups.general.title"),description:te("quotes.create.form_groups.general.desc"),children:[b.jsxs("div",{className:"grid grid-cols-6 gap-6",children:[b.jsx(sh,{required:!0,className:"col-span-2",label:te("quotes.form_fields.customer_reference.label"),description:te("quotes.form_fields.customer_reference.desc"),disabled:e.disabled,placeholder:te("quotes.form_fields.customer_reference.placeholder"),...t("customer_reference")}),b.jsx(cee,{required:!0,label:te("quotes.form_fields.date.label"),description:te("quotes.form_fields.date.desc"),disabled:e.disabled,placeholder:te("quotes.form_fields.date.placeholder"),...t("date",{required:!0})}),b.jsx(sh,{label:te("quotes.form_fields.validity.label"),description:te("quotes.form_fields.validity.desc"),disabled:e.disabled,placeholder:te("quotes.form_fields.validity.placeholder"),...t("validity",{required:!1})}),b.jsx(Ba,{className:"col-span-2",label:te("quotes.form_fields.payment_method.label"),description:te("quotes.form_fields.payment_method.desc"),disabled:e.disabled,placeholder:te("quotes.form_fields.payment_method.placeholder"),...t("payment_method",{required:!1})})]}),b.jsxs("div",{className:"grid grid-cols-6 gap-6",children:[b.jsx(Ba,{className:"col-span-3",required:!0,label:te("quotes.form_fields.customer_information.label"),description:te("quotes.form_fields.customer_information.desc"),disabled:e.disabled,placeholder:te("quotes.form_fields.customer_information.placeholder"),...t("customer_information",{required:!0}),errors:e.errors}),b.jsx(Ba,{className:"col-span-3",label:te("quotes.form_fields.notes.label"),description:te("quotes.form_fields.notes.desc"),disabled:e.disabled,placeholder:te("quotes.form_fields.notes.placeholder"),...t("notes",{required:!1})})]})]}),b.jsx(tA,{className:"hidden md:col-span-2",title:te("quotes.create.form_groups.status.title"),description:te("quotes.create.form_groups.status.desc"),children:b.jsxs("div",{className:"grid gap-6",children:[b.jsxs("div",{className:"grid gap-3",children:[b.jsx(Gp,{htmlFor:"status",children:"Status"}),b.jsxs(d$,{children:[b.jsx(tN,{id:"status","aria-label":"Select status",children:b.jsx(f$,{placeholder:"Select status"})}),b.jsxs(nN,{children:[b.jsx(bg,{value:"draft",children:"Draft"}),b.jsx(bg,{value:"published",children:"Active"}),b.jsx(bg,{value:"archived",children:"Archived"})]})]})]}),b.jsx(sh,{required:!0,label:te("quotes.form_fields.lang_code.label"),description:te("quotes.form_fields.lang_code.desc"),placeholder:te("quotes.form_fields.lang_code.placeholder"),...t("lang_code",{required:!0})}),b.jsx(sh,{required:!0,label:te("quotes.form_fields.currency_code.label"),description:te("quotes.form_fields.currency_code.desc"),placeholder:te("quotes.form_fields.currency_code.placeholder"),...t("currency_code",{required:!0})})]})})]})},Qne=({id:t,onSentTo:e,disabled:n})=>{const r=()=>{e(t)};return b.jsxs(PL,{children:[b.jsx(Qge,{asChild:!0,disabled:n,children:b.jsxs(qe,{variant:"ghost",className:"h-10 gap-1 text-primary disabled:text-secondary-foreground",children:[b.jsx(Kpe,{className:"w-4 h-4"}),te("quotes.quote_sent_to_editor.trigger_button")]})}),b.jsxs(cR,{children:[b.jsxs(uR,{children:[b.jsx(fR,{children:te("quotes.quote_sent_to_editor.title")}),b.jsx(hR,{children:te("quotes.quote_sent_to_editor.description")})]}),b.jsxs(dR,{children:[b.jsx(mR,{children:te("common.cancel")}),b.jsx(pR,{asChild:!0,children:b.jsx(qe,{onClick:r,children:te("common.continue")})})]})]})]})},bBe=["draft","ready","delivered","accepted","rejected","archived"],xBe={draft:["draft","ready","archived"],ready:["ready","delivered","archived"],delivered:["delivered","accepted","rejected","archived"],accepted:["accepted","rejected","archived"],rejected:["rejected","accepted","archived"],archived:["archived","draft","ready","delivered","accepted","rejected"]},Zne=({type:t="button",status:e,onChangeStatus:n})=>{const[r,s]=S.useState(e),i=a=>s(a);S.useEffect(()=>{e&&s(e)},[e]);const o=()=>{r!==e&&n(r,e)};return b.jsxs(Ey,{children:[b.jsx(JL,{asChild:!0,children:t==="button"?b.jsxs(qe,{size:"sm",variant:"outline",className:"h-8 gap-1",children:[b.jsx(vq,{className:"h-3.5 w-3.5"}),b.jsx("span",{className:"sr-only md:not-sr-only md:whitespace-nowrap",children:te("quotes.quote_status_editor.trigger_button")})]}):b.jsx(S4e,{status:e,isEditable:!0})}),b.jsxs(Bp,{children:[b.jsx(Up,{children:b.jsx(Vp,{children:te("quotes.quote_status_editor.title")})}),b.jsx(RL,{}),b.jsx("div",{className:"grid gap-4 py-4",children:bBe.map(a=>{const c=!xBe[e].includes(a);return b.jsxs("div",{className:"flex items-start space-x-4",children:[b.jsx(TQ,{id:a,checked:r===a,onCheckedChange:()=>i(a),disabled:c}),b.jsxs("div",{className:"grid gap-1.5 leading-none",children:[b.jsx(Gp,{htmlFor:a,className:ie("font-medium",c?"text-input":"text-foreground"),children:te(`quotes.quote_status_editor.status.${a}.title`)}),b.jsx("p",{className:ie("text-sm",c?"text-input":"text-muted-foreground"),children:te(`quotes.quote_status_editor.status.${a}.description`)})]})]},a)})}),b.jsxs(Hp,{className:"pt-6 border-t",children:[b.jsx(xE,{asChild:!0,children:b.jsx(qe,{type:"button",variant:"secondary",children:te("common.cancel")})}),b.jsx(xE,{asChild:!0,children:b.jsx(qe,{onClick:o,disabled:r===e,children:te("quotes.quote_status_editor.submit_button")})})]})]})]})},wBe=({quoteId:t,className:e})=>{const n=Us(),{toast:r}=tc(),{useOne:s,useSetStatus:i,useSentTo:o,useDownloader:a,useDuplicate:c,getQuotePDFFilename:u}=tS(),{data:f,status:l}=s(t),{mutate:d}=i(),{mutate:p}=o(t),{mutate:h}=c(),{download:m,...y}=a(),{formatCurrency:g,formatNumber:v}=Dne({locale:(f==null?void 0:f.lang_code)||"ES"}),x=S.useMemo(()=>f?{subtotal_price:g(f.subtotal_price),discount:v(f.discount),discount_price:g(f.discount_price),tax:v(f.tax),tax_price:g(f.tax_price),total_price:g(f.total_price)}:{subtotal_price:"0,00 €",discount:"0",discount_price:"0,00 €",tax:"0",tax_price:"0,00 €",total_price:"0,00 €"},[f]),_=S.useMemo(()=>(f==null?void 0:f.status)==="accepted"&&!(f!=null&&f.date_sent),[f]),A=S.useMemo(()=>(f==null?void 0:f.status)==="accepted"&&!!(f!=null&&f.date_sent),[f]),N=I=>{d({id:f.id,newStatus:I},{onSuccess:()=>{r({description:te("quotes.quote_status_editor.toast_status_changed"),variant:"success"})}})},T=I=>{p({sent_date:LOe(new Date)},{onSuccess:()=>{r({description:te("quotes.quote_sent_to_editor.toast_status_changed"),variant:"success"})}})},E=S.useCallback(()=>{r({description:te("quotes.downloading_dialog.toast_success"),variant:"success"})},[r]),P=S.useCallback(()=>{f&&m(f.id,u(f))},[f]);if(l==="error"||l!=="success")return null;if(!f)return b.jsx(xr,{className:ie("overflow-hidden",e),children:b.jsx(wr,{className:"px-4 py-6 text-center",children:b.jsx("p",{className:"mx-auto",children:"Select a quote"})})});const k=I=>{h({id:I},{onSuccess(j){r({description:te("quotes.duplicate_action.toast_success"),variant:"success"}),n(`/quotes/edit/${j.id}`,{relative:"path"})}})},M=I=>{d({id:I,newStatus:"archived"},{onSuccess:()=>{r({description:te("quotes.quote_status_editor.toast_status_changed",{newStatus:te("quotes.status.archived")}),variant:"success"})}})};return b.jsxs(b.Fragment,{children:[b.jsx(Yne,{...y,onFinishDownload:E}),b.jsx(v$,{defaultValue:"resume",children:b.jsxs(xr,{className:"w-[390px] overflow-hidden",children:[b.jsxs(Ni,{className:"gap-3 border-b bg-accent",children:[b.jsxs(ns,{className:"flex items-center justify-between text-lg",children:[b.jsx("span",{children:te("quotes.list.resume.title")}),b.jsx(Zne,{status:f.status,onChangeStatus:N,type:"badge"})]}),b.jsx("div",{className:"flex w-full mr-auto text-foreground",children:b.jsxs("div",{className:"flex justify-between w-full",children:[b.jsxs(Pp,{className:"gap-0",children:[b.jsxs(bs,{children:[b.jsx(xs,{asChild:!0,children:b.jsxs(qe,{variant:"outline",size:"icon",disabled:A,onClick:I=>{I.preventDefault(),n(`/quotes/edit/${f.id}`,{relative:"path"})},children:[b.jsx(yq,{className:"w-4 h-4"}),b.jsx("span",{className:"sr-only",children:"Editar"})]})}),b.jsx(rs,{children:b.jsx("p",{children:"Editar"})})]}),b.jsxs(bs,{children:[b.jsx(xs,{asChild:!0,children:b.jsxs(qe,{variant:"outline",size:"icon",onClick:I=>{I.preventDefault(),k(f.id)},children:[b.jsx(pL,{className:"w-4 h-4"}),b.jsx("span",{className:"sr-only",children:"Duplicar"})]})}),b.jsx(rs,{children:b.jsx("p",{children:"Duplicar"})})]}),b.jsxs(bs,{children:[b.jsx(xs,{asChild:!0,children:b.jsxs(qe,{variant:"outline",size:"icon",onClick:P,children:[b.jsx(pq,{className:"w-4 h-4"}),b.jsx("span",{className:"sr-only",children:"Descargar"})]})}),b.jsx(rs,{children:b.jsx("p",{children:"Descargar"})})]}),b.jsxs(bs,{children:[b.jsx(xs,{asChild:!0,children:b.jsxs(qe,{variant:"outline",size:"icon",disabled:A,onClick:I=>{I.preventDefault(),M(f.id)},children:[b.jsx(uq,{className:"w-4 h-4"}),b.jsx("span",{className:"sr-only",children:"Archivar"})]})}),b.jsx(rs,{children:b.jsx("p",{children:"Archivar"})})]})]}),b.jsx(Pp,{children:b.jsx(Qne,{disabled:A||!_,id:f.id,onSentTo:T})})]})})]}),b.jsxs(wr,{className:"p-6 text-sm",children:[b.jsxs(lN,{className:"grid w-full grid-cols-2",children:[b.jsx(Qv,{value:"resume",children:te("quotes.list.resume.tabs.resume")}),b.jsx(Qv,{value:"preview",children:te("quotes.list.resume.tabs.preview")})]}),b.jsx(Zv,{value:"resume",className:"pt-4",children:b.jsxs("div",{className:"grid gap-3",children:[b.jsxs("div",{className:"grid gap-3",children:[b.jsx("div",{className:"font-semibold",children:te("quotes.list.resume.quote_information")}),b.jsxs("dl",{className:"grid gap-3",children:[b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsx("dt",{className:"text-muted-foreground",children:te("quotes.form_fields.reference.label")}),b.jsx("dd",{className:"font-medium",children:f.reference})]}),b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsx("dt",{className:"text-muted-foreground",children:te("quotes.form_fields.date.label")}),b.jsx("dd",{className:"font-medium",children:new Date(f.date).toLocaleDateString()})]}),b.jsxs("div",{className:"flex items-start justify-between",children:[b.jsx("dt",{className:"text-muted-foreground whitespace-nowrap",children:te("quotes.form_fields.customer_reference.label")}),b.jsx("dd",{className:"font-medium text-right whitespace-break-spaces",children:f.customer_reference})]})]})]}),b.jsx(iu,{className:"my-4"}),b.jsxs("div",{className:"grid gap-3",children:[b.jsx("div",{className:"font-semibold",children:te("quotes.list.resume.customer_information")}),b.jsx("div",{children:f.customer_information})]}),b.jsx(iu,{className:"my-4"}),b.jsx("div",{className:"font-semibold",children:te("quotes.list.resume.price_information")}),b.jsxs("ul",{className:"grid gap-3",children:[b.jsxs("li",{className:"flex items-center justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:te("quotes.form_fields.subtotal_price.label")}),b.jsx("span",{children:x.subtotal_price})]}),b.jsxs("li",{className:"flex items-center justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:te("quotes.form_fields.discount_value.label",{value:x.discount})}),b.jsx("span",{children:x.discount_price})]}),b.jsxs("li",{className:"flex items-center justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:te("quotes.form_fields.tax_value.label",{value:x.tax})}),b.jsx("span",{children:x.tax_price})]}),b.jsxs("li",{className:"flex items-center justify-between font-semibold",children:[b.jsx("span",{className:"text-muted-foreground",children:te("quotes.form_fields.total_price.label")}),b.jsx("span",{children:x.total_price})]})]})]})}),b.jsx(Zv,{value:"preview",children:b.jsx(Xne,{quote:f})})]}),b.jsx(Yo,{className:"flex flex-row items-center px-6 py-3 border-t bg-accent",children:b.jsx("div",{className:"text-xs text-muted-foreground"})})]})})]})},_Be=({status:t="all",preview:e=!1})=>{const n=Us(),{toast:r}=tc(),s=S.useId(),i=S.useId(),{pagination:o,globalFilter:a,isFiltered:c}=nm(),[u,f]=S.useState(void 0),{useList:l,useDownloader:d,useSetStatus:p,useDuplicate:h,getQuotePDFFilename:m}=tS(),{mutate:y}=p(),{mutate:g}=h(),{data:v,isPending:x,isError:_,error:A}=l({pagination:{pageIndex:o.pageIndex,pageSize:o.pageSize},status:t,quickSearchTerm:a}),{download:N,...T}=d(),E=K=>{f(K)},P=S.useCallback(()=>{r({description:te("quotes.downloading_dialog.toast_success")})},[r]),k=S.useCallback(K=>{n(`/quotes/edit/${K.id}`,{relative:"path"})},[n,r]),M=K=>{g({id:K},{onSuccess(V){r({description:te("quotes.duplicate_action.toast_success"),variant:"success"}),n(`/quotes/edit/${V.id}`,{relative:"path"})}})},I=K=>{y({id:K,newStatus:"archived"},{onSuccess:()=>{r({description:te("quotes.quote_status_editor.toast_status_changed",{newStatus:te("quotes.status.archived")}),variant:"success"})}})},j=(K,V)=>{y({id:K,newStatus:V},{onSuccess:()=>{r({description:te("quotes.quote_status_editor.toast_status_changed",{newStatus:te(`quotes.status.${V}`)}),variant:"success"})}})},L=S.useMemo(()=>{const K=[{id:"reference",accessorKey:"reference",header:()=>b.jsx(b.Fragment,{children:te("quotes.list.columns.reference")}),cell:({row:{original:U},renderValue:Q})=>{const ne=!!((U==null?void 0:U.status)==="accepted"&&(U!=null&&U.date_sent));return b.jsx(qe,{size:"sm",variant:"link",disabled:ne,className:"h-8 gap-1 px-0 text-left text-ellipsis",onClick:X=>{X.preventDefault(),k(U)},children:b.jsx("div",{className:"",children:Q()})})}},{id:"status",accessorKey:"status",header:()=>b.jsx(b.Fragment,{children:te("quotes.list.columns.status")}),cell:({row:{original:U}})=>b.jsx(Zne,{type:"badge",status:U.status,onChangeStatus:Q=>j(U.id,Q)})},{id:"date_sent",accessor:"date_sent",header:()=>b.jsx("div",{className:"text-left text-ellipsis",children:te("quotes.list.columns.date_sent")}),cell:({row:{original:U}})=>{const Q=xg.create(U.date_sent),ne=Q.isSuccess&&!Q.object.isEmpty();return b.jsx("div",{className:"text-left text-ellipsis",children:ne?b.jsx(kJ,{label:Q.object.toLocaleDateString("es-ES"),className:"text-green-800 bg-green-100 hover:text-green-800 hover:bg-green-100"}):b.jsx(b.Fragment,{})})}},{id:"date",accessor:"date",header:()=>b.jsx("div",{className:"text-left text-ellipsis",children:te("quotes.list.columns.date")}),cell:({row:{original:U}})=>{const Q=xg.create(U.date);return b.jsx("div",{className:"text-left text-ellipsis",children:Q.isSuccess?Q.object.toLocaleDateString("es-ES"):"-"})}},{id:"customer_reference",accessorKey:"customer_reference",header:()=>b.jsx(b.Fragment,{children:te("quotes.list.columns.customer_reference")}),cell:({renderValue:U})=>b.jsx("div",{className:"text-left text-ellipsis",children:U()})},{id:"customer_information",accessorKey:"customer_information",header:()=>b.jsx(b.Fragment,{children:te("quotes.list.columns.customer_information")}),cell:({row:{original:U}})=>b.jsx("div",{className:"text-left text-ellipsis",children:U.customer_information.split(`
|
||
`).map((Q,ne)=>b.jsxs("span",{className:ne===0?"font-medium":"hidden text-sm text-muted-foreground md:inline",children:[Q,b.jsx("br",{})]},ne))}),size:500}],V=[{id:"row-actions",header:()=>null,cell:({row:{original:U}})=>{const Q=(U==null?void 0:U.status)==="accepted"&&!(U!=null&&U.date_sent),ne=(U==null?void 0:U.status)==="accepted"&&!!(U!=null&&U.date_sent),X=(U==null?void 0:U.status)==="archived";return b.jsxs("div",{className:"flex gap-1",children:[b.jsxs(Pp,{className:"gap-0",children:[b.jsxs(bs,{children:[b.jsx(xs,{asChild:!0,children:b.jsxs(qe,{variant:"ghost",size:"icon",disabled:ne,onClick:G=>{G.preventDefault(),k(U)},children:[b.jsx(yq,{className:"w-4 h-4"}),b.jsx("span",{className:"sr-only",children:"Editar"})]})}),b.jsx(rs,{children:b.jsx("p",{children:"Editar"})})]}),b.jsxs(bs,{children:[b.jsx(xs,{asChild:!0,children:b.jsxs(qe,{variant:"ghost",size:"icon",onClick:G=>{G.preventDefault(),M(U.id)},children:[b.jsx(pL,{className:"w-4 h-4"}),b.jsx("span",{className:"sr-only",children:"Duplicar"})]})}),b.jsx(rs,{children:b.jsx("p",{children:"Duplicar"})})]}),b.jsxs(bs,{children:[b.jsx(xs,{asChild:!0,children:b.jsxs(qe,{variant:"ghost",size:"icon",onClick:()=>{N(U.id,m(U))},children:[b.jsx(pq,{className:"w-4 h-4"}),b.jsx("span",{className:"sr-only",children:"Descargar"})]})}),b.jsx(rs,{children:b.jsx("p",{children:"Descargar"})})]}),b.jsxs(bs,{children:[b.jsx(xs,{asChild:!0,children:b.jsxs(qe,{variant:"ghost",size:"icon",disabled:X||ne,onClick:G=>{G.preventDefault(),I(U.id)},children:[b.jsx(uq,{className:"w-4 h-4"}),b.jsx("span",{className:"sr-only",children:"Archivar"})]})}),b.jsx(rs,{children:b.jsx("p",{children:"Archivar"})})]})]}),b.jsx(Pp,{children:b.jsx(Qne,{id:U.id,onSentTo:()=>null,disabled:ne||!Q})})]})}}];return e?K:[...K,...V]},[e]),{table:H}=qN({data:(v==null?void 0:v.items)??[],columns:L,pageCount:(v==null?void 0:v.total_pages)??-1});return S.useEffect(()=>{H&&v&&(v==null?void 0:v.total_pages)>0&&f(H.getRowModel().rows[0])},[v,H]),_?b.jsx(_f,{subtitle:A.message}):x?b.jsxs("div",{className:"grid items-start flex-1 gap-4 sm:py-0 md:gap-8 lg:grid-cols-3 xl:grid-cols-3",children:[b.jsx(xr,{className:"grid items-start gap-4 auto-rows-max md:gap-8 lg:col-span-2",children:b.jsx(wr,{children:b.jsx(PN,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0})})}),b.jsx("div",{})]}):(v==null?void 0:v.total_items)===0&&!c?b.jsx(xr,{children:b.jsx(wr,{children:b.jsx(TN,{subtitle:"Empieza creando alguna cotización",buttonText:te("quotes.create.title"),onButtonClick:()=>n("add",{relative:"path"})})})}):b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"flex flex-col items-stretch flex-1 gap-4 xl:flex-row",children:[b.jsx("div",{id:s,className:"flex items-stretch flex-1",children:b.jsx(SN,{table:H,paginationOptions:{visible:!0},className:"grid items-start flex-1 gap-4 auto-rows-max md:gap-8 lg:col-span-2",onRowClick:E,activeRowIndex:u==null?void 0:u.index,children:b.jsx(Gne,{table:H})})}),e&&b.jsx("div",{id:i,className:"flex items-stretch ",children:b.jsx(wBe,{quoteId:u==null?void 0:u.original.id})})]}),b.jsx(Yne,{...T,onFinishDownload:P})]})},SBe=()=>{const t=Us(),e=iBe(),{toast:n}=tc(),[r,s]=S.useState("general"),[i,o]=S.useState(au.createDefaultCode().object),[a,c]=S.useState(E0.createDefaultCode().object),{useOne:u,useUpdate:f}=tS(),{data:l,status:d,error:p}=u(e),h=S.useMemo(()=>({date:"",reference:"",customer_reference:"",customer_information:"",lang_code:"",currency_code:"",payment_method:"",notes:"",validity:"",subtotal_price:{amount:void 0,scale:2,currency_code:(l==null?void 0:l.currency_code)??i.code},discount:{amount:void 0,scale:0},discount_price:{amount:void 0,scale:2,currency_code:(l==null?void 0:l.currency_code)??i.code},before_tax_price:{amount:void 0,scale:2,currency_code:(l==null?void 0:l.currency_code)??i.code},tax:{amount:void 0,scale:0},tax_price:{amount:void 0,scale:2,currency_code:(l==null?void 0:l.currency_code)??i.code},total_price:{amount:void 0,scale:2,currency_code:(l==null?void 0:l.currency_code)??i.code},items:[{id_article:"",description:"",quantity:{amount:null,scale:2},unit_price:{amount:null,scale:2,currency_code:(l==null?void 0:l.currency_code)??i.code},subtotal_price:{amount:null,scale:2,currency_code:(l==null?void 0:l.currency_code)??i.code},discount:{amount:null,scale:2},total_price:{amount:null,scale:2,currency_code:(l==null?void 0:l.currency_code)??i.code}}]}),[l,i]),{mutate:m,isPending:y}=f(String(e)),g=L_({mode:"onBlur",values:l,defaultValues:h}),{getValues:v,reset:x,handleSubmit:_,formState:A,watch:N,setValue:T}=g,{isSubmitting:E,isDirty:P}=A;lF({isDirty:P});const k=async(I,j)=>{m(I,{onError:L=>{console.debug(L),n({title:"Error",description:L.message,variant:"destructive"})},onSuccess:()=>{x(v()),n({title:"Cotización guardada",variant:"success"}),j&&t("/quotes")}})};S.useEffect(()=>{const{unsubscribe:I}=N((j,{name:L})=>{const H=v();if(L)switch(!0){case L==="currency_code":o(au.createFromCode(H.currency_code??au.DEFAULT_CURRENCY_CODE).object);break;case L==="lang_code":c(E0.createFromCode(H.lang_code??E0.DEFAULT_LANGUAGE_CODE).object);break;case(L==="discount"||L==="tax"):{const K=gD(H);T("subtotal_price",K.subtotalPrice.toObject()),T("discount_price",K.discountPrice.toObject()),T("before_tax_price",K.priceBeforeTaxes.toObject()),T("tax_price",K.taxesPrice.toObject()),T("total_price",K.totalPrice.toObject());break}case L==="items":{H.items&&H.items.map((V,U)=>{const Q=JI(V);T(`items.${U}.subtotal_price`,Q.subtotalPrice.toObject()),T(`items.${U}.total_price`,Q.totalPrice.toObject())});const K=gD(H,!0);T("subtotal_price",K.subtotalPrice.toObject()),T("discount_price",K.discountPrice.toObject()),T("before_tax_price",K.priceBeforeTaxes.toObject()),T("tax_price",K.taxesPrice.toObject()),T("total_price",K.totalPrice.toObject());break}case(L.endsWith("quantity")||L.endsWith("unit_price")||L.endsWith("discount")):{const[,K]=String(L).split("."),V=parseInt(K),U=JI(H.items[V]);T(`items.${V}.subtotal_price`,U.subtotalPrice.toObject()),T(`items.${V}.total_price`,U.totalPrice.toObject());const Q=gD(H,!0);T("subtotal_price",Q.subtotalPrice.toObject()),T("discount_price",Q.discountPrice.toObject()),T("before_tax_price",Q.priceBeforeTaxes.toObject()),T("tax_price",Q.taxesPrice.toObject()),T("total_price",Q.totalPrice.toObject());break}}});return()=>I()},[N,v,T]);const M=()=>{t("/quotes",{state:{id:e}})};return d==="error"?b.jsx(_f,{errorMessage:p.message}):d!=="success"?b.jsx(Yl,{}):b.jsxs(b.Fragment,{children:[(E||y)&&b.jsx(Yl,{title:"Guardando cotización"}),b.jsx($_,{...g,children:b.jsx("form",{onSubmit:_(I=>k(I,!1)),children:b.jsxs("div",{className:"mx-auto grid max-w-[90rem] flex-1 auto-rows-max gap-6",children:[b.jsxs("div",{className:"flex items-center gap-4",children:[b.jsx(j$,{}),b.jsxs("h1",{className:"flex-1 text-xl font-semibold tracking-tight shrink-0 whitespace-nowrap sm:grow-0",children:[te("quotes.edit.title")," ",l.reference]}),b.jsx(kJ,{label:te(`quotes.status.${l.status}`),className:"ml-auto sm:ml-0"}),b.jsxs("div",{className:"items-center hidden gap-2 md:ml-auto md:flex",children:[b.jsx(PJ,{label:te("common.close"),variant:"secondary",size:"sm",onClick:M}),b.jsx(_N,{label:te("common.save"),size:"sm",disabled:A.isSubmitting||A.isLoading||A.isValidating}),b.jsx(qe,{size:"sm",disabled:A.isSubmitting||A.isLoading||A.isValidating,onClick:_(I=>k(I,!0)),children:te("common.save_close")})]})]}),b.jsx(yBe,{}),b.jsx(oBe,{}),b.jsx(vBe,{currency:i,language:a,defaultValues:h}),b.jsxs(v$,{defaultValue:"items",className:"hidden space-y-4 ",value:r,onValueChange:s,children:[b.jsxs(lN,{children:[b.jsx(Qv,{value:"general",children:te("quotes.create.tabs.general")}),b.jsx(Qv,{value:"items",children:te("quotes.create.tabs.items")})]}),b.jsx(Zv,{value:"general",forceMount:!0,hidden:r!=="general"}),b.jsx(Zv,{value:"items",forceMount:!0,hidden:r!=="items"})]}),b.jsxs("div",{className:"flex items-center justify-center gap-2 md:hidden",children:[b.jsx(qe,{variant:"outline",size:"sm",children:te("common.discard")}),b.jsx(qe,{size:"sm",children:te("quotes.edit.buttons.save_quote")})]})]})})})]})},CBe=S.createContext(null),EBe=({children:t})=>{const[e,n]=xN();return b.jsx(CBe.Provider,{value:{pagination:e,setPagination:n},children:t})},ABe=({children:t})=>b.jsx(oy,{children:b.jsx(EBe,{children:b.jsxs(zy,{className:"quotes-layout",children:[b.jsx(Uy,{}),b.jsx(By,{children:t})]})})}),RBe=()=>{const t=Us(),[e,n]=S.useState("all"),[r,s]=z2e(!0),i=[{value:"all",label:te("quotes.list.tabs.all")},{value:"draft",label:te("quotes.list.tabs.draft")},{value:"ready",label:te("quotes.list.tabs.ready")},{value:"delivered",label:te("quotes.list.tabs.delivered")},{value:"accepted",label:te("quotes.list.tabs.accepted")},{value:"rejected",label:te("quotes.list.tabs.rejected")},{value:"archived",label:te("quotes.list.tabs.archived")}];return b.jsxs(ny,{children:[b.jsxs("div",{className:"flex items-center justify-between space-y-2",children:[b.jsxs("div",{children:[b.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:b.jsx(Mt,{i18nKey:"quotes.list.title"})}),b.jsx("p",{className:"text-muted-foreground",children:b.jsx(Mt,{i18nKey:"quotes.list.subtitle"})})]}),b.jsx("div",{className:"flex items-center space-x-2",children:b.jsxs(qe,{onClick:()=>t("/quotes/add"),children:[b.jsx(gL,{className:"w-4 h-4 mr-2"}),te("quotes.create.title")]})})]}),b.jsxs(v$,{value:e,onValueChange:n,children:[b.jsxs("div",{className:"flex flex-col items-start justify-between mb-4 sm:flex-row sm:items-center",children:[b.jsxs("div",{className:"w-full mb-4 sm:w-auto sm:mb-0",children:[b.jsx(lN,{className:"hidden sm:flex",children:i.map(o=>b.jsx(Qv,{value:o.value,children:o.label},o.value))}),b.jsxs("div",{className:"flex items-center w-full space-x-2 sm:hidden",children:[b.jsx(Gp,{children:te("quotes.list.tabs_title")}),b.jsxs(d$,{value:e,onValueChange:n,children:[b.jsx(tN,{children:b.jsx(f$,{placeholder:"Seleccionar estado"})}),b.jsx(nN,{children:i.map(o=>b.jsx(bg,{value:o.value,children:o.label},o.value))})]})]})]}),b.jsx("div",{className:"flex items-baseline justify-center mr-4 font-medium",children:b.jsx(BIe,{buttonText:"Ayuda",title:"Ayuda sobre el Estado de Cotizaciones",content:NBe})}),b.jsx("div",{className:"flex items-center gap-2 ml-auto",children:b.jsx(bZ,{"aria-label":"Show quote preview",variant:"outline",defaultPressed:!1,pressed:r,onPressedChange:s,children:r?b.jsxs(b.Fragment,{children:[b.jsx(mq,{className:"w-4 h-4 mr-2"}),te("common.disable_preview")]}):b.jsxs(b.Fragment,{children:[b.jsx(Fpe,{className:"w-4 h-4 mr-2"}),te("common.enable_preview")]})})})]}),i.map(o=>b.jsx(Zv,{value:o.value,children:b.jsx(_Be,{status:o.value,preview:r})},o.value))]})]})},NBe=b.jsxs(QR,{className:"grid gap-4 py-4",children:[b.jsx("p",{children:"El estado de una cotización indica su posición actual en el proceso de negocio."}),b.jsx("p",{children:"Los estados posibles son:"}),b.jsxs("ul",{className:"pl-6 space-y-2 list-disc",children:[b.jsxs("li",{children:[b.jsx("strong",{children:"Borrador:"})," La cotización está en proceso de creación o edición."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"Preparado:"})," La cotización está lista para ser enviada al cliente."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"Entregado:"})," La cotización ha sido enviada al cliente."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"Aceptado:"})," El cliente ha aprobado la cotización."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"Rechazado:"})," El cliente no ha aceptado la cotización."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"Arcivado:"})," La cotización ha sido guardada para referencia futura y ya no está activa."]})]}),b.jsxs("p",{children:["Utiliza estos estados para hacer un seguimiento eficiente de tus cotizaciones y optimizar tu proceso de ventas. El estado ",b.jsx("strong",{children:"Archivado"})," es útil para mantener un historial de cotizaciones pasadas sin que interfieran con las cotizaciones activas."]})]}),PBe=t=>{const e=sy(),n=vu();return{useOne:()=>pJ({queryKey:n().data().resource("settings").action("one").id("me").params().get(),queryFn:()=>e.getOne({resource:"profile",id:""}),...t}),useUpdate:()=>{const r=Dl();return Ol({mutationKey:n().data().resource("settings").action("one").id("me").params().get(),mutationFn:s=>e.updateOne({resource:"profile",data:s,id:""}),onSuccess:()=>{r.invalidateQueries({queryKey:["data","default","settings"]})}})},useUploadLogo:()=>{const r=Dl(),{mutate:s,mutateAsync:i,...o}=Ol({mutationKey:["data","default","settings"],mutationFn:a=>e.uploadFile({path:"profile/logo",file:a,key:"logo"}),onError:()=>r.invalidateQueries({queryKey:["data","default","settings"]}),onSuccess:()=>{r.invalidateQueries({queryKey:["data","default","settings"]})}});return{upload:s,uploadAsync:i,...o}}}},TBe=()=>{var A,N;const[t,e]=S.useState("profile"),{useOne:n,useUpdate:r,useUploadLogo:s}=PBe(),{toast:i}=tc(),{data:o,status:a,error:c}=n(),u=S.useMemo(()=>({contact_information:"",default_payment_method:"",default_notes:"",default_legal_terms:"",default_quote_validity:"",default_tax:{amount:void 0,scale:2}}),[]),{mutate:f}=r(),{upload:l}=s(),d=L_({mode:"onBlur",values:o==null?void 0:o.dealer,defaultValues:u}),{formState:p,reset:h,getValues:m,handleSubmit:y}=d,{isSubmitting:g,isDirty:v}=p,x=T=>{var P;const E=(P=T.target.files)==null?void 0:P[0];if(E){if(E.type!=="image/png"&&E.type!=="image/jpeg"){alert(te("settings.form_fields.logo.invalid_format"));return}const k=new FileReader;k.onloadend=()=>{const M=new Image;M.onload=()=>{const I=M.width,j=M.height,L=I/j===2;I<200||j<100||!L?alert(te("settings.form_fields.logo.invalid_dimensions")):l(E)},M.src=k.result},k.readAsDataURL(E)}};lF({isDirty:v});const _=async T=>{f(T,{onError:E=>{console.debug(E),i({title:"Error",description:E.message,variant:"destructive"})},onSuccess:()=>{h(m()),i({description:"Ajustes guardados",variant:"success"})}})};return g?b.jsx(Yl,{title:"Guardando ajustes"}):a==="error"?b.jsx(_f,{errorMessage:c.message}):a!=="success"?b.jsx(Yl,{}):b.jsx($_,{...d,children:b.jsx("form",{onSubmit:y(_),children:b.jsxs("div",{className:"mx-auto grid w-full max-w-6xl items-start gap-6 md:grid-cols-[180px_1fr] lg:grid-cols-[250px_1fr]",children:[((A=d.formState.errors.root)==null?void 0:A.message)&&b.jsxs(bL,{variant:"destructive",children:[b.jsx(fq,{className:"w-4 h-4"}),b.jsx(xL,{children:b.jsx(Mt,{i18nKey:"common.error"})}),b.jsx(wL,{children:(N=d.formState.errors.root)==null?void 0:N.message})]}),b.jsxs("nav",{className:"grid gap-4 text-sm text-muted-foreground",children:[b.jsx("a",{onClick:()=>e("profile"),className:t==="profile"?"font-semibold text-primary":"cursor-pointer",children:b.jsx(Mt,{i18nKey:"settings.edit.tabs.profile"})}),b.jsx("a",{onClick:()=>e("quotes"),className:t==="quotes"?"font-semibold text-primary":"cursor-pointer ",children:b.jsx(Mt,{i18nKey:"settings.edit.tabs.quotes"})}),b.jsx("a",{onClick:()=>e("legal"),className:t==="legal"?"font-semibold text-primary":"cursor-pointer ",children:b.jsx(Mt,{i18nKey:"settings.edit.tabs.legal"})})]}),b.jsxs("div",{className:ie("grid gap-6",t==="profile"?"visible":"hidden"),children:[b.jsxs(xr,{children:[b.jsxs(Ni,{children:[b.jsx(ns,{children:b.jsx(Mt,{i18nKey:"settings.form_fields.contact_information.label"})}),b.jsx(ys,{children:b.jsx(Mt,{i18nKey:"settings.form_fields.contact_information.desc"})})]}),b.jsx(wr,{children:b.jsx(Ba,{rows:8,placeholder:te("settings.form_fields.contact_information.placeholder"),name:"contact_information",required:!0})}),b.jsx(Yo,{className:"px-6 py-4 border-t",children:b.jsx(qe,{children:b.jsx(Mt,{i18nKey:"common.save"})})})]}),b.jsxs(xr,{children:[b.jsxs(Ni,{children:[b.jsx(ns,{children:b.jsx(Mt,{i18nKey:"settings.form_fields.logo.label"})}),b.jsx(ys,{children:b.jsx(Mt,{i18nKey:"settings.form_fields.logo.desc"})})]}),b.jsx(wr,{children:b.jsxs("div",{className:"flex items-center space-x-4",children:[b.jsx("div",{className:"w-[400px] h-[200px] border border-gray-300 flex items-center justify-center overflow-hidden",children:b.jsx("img",{src:o.dealer.logo?o.dealer.logo:"https://via.placeholder.com/200x100",width:400,height:200,style:{objectFit:"contain"}})}),b.jsx("div",{children:b.jsx("p",{className:"mt-2 text-sm text-gray-500",children:b.jsx(Mt,{i18nKey:"settings.form_fields.logo.requirements"})})})]})}),b.jsxs(Yo,{className:"px-6 py-4 border-t",children:[b.jsx(Gp,{htmlFor:"logo-upload",className:"inline-flex items-center justify-center h-10 px-4 py-2 text-sm font-medium transition-colors rounded-md cursor-pointer bg-primary text-primary-foreground hover:bg-primary/90 whitespace-nowrap ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",children:b.jsx(Mt,{i18nKey:"settings.form_fields.logo.upload"})}),b.jsx(F_,{id:"logo-upload",type:"file",accept:".png,.jpg,.jpeg",onChange:x,className:"hidden"})]})]})]}),b.jsxs("div",{className:ie("grid gap-6",t==="quotes"?"visible":"hidden"),children:[b.jsxs(xr,{children:[b.jsxs(Ni,{children:[b.jsx(ns,{children:b.jsx(Mt,{i18nKey:"settings.form_fields.default_tax.label"})}),b.jsx(ys,{children:b.jsx(Mt,{i18nKey:"settings.form_fields.default_tax.desc"})})]}),b.jsx(wr,{children:b.jsx(nA,{scale:2,disabled:p.disabled,placeholder:te("settings.form_fields.default_tax.desc"),name:"default_tax",required:!0})}),b.jsx(Yo,{className:"px-6 py-4 border-t",children:b.jsx(qe,{children:b.jsx(Mt,{i18nKey:"common.save"})})})]}),b.jsxs(xr,{children:[b.jsxs(Ni,{children:[b.jsx(ns,{children:b.jsx(Mt,{i18nKey:"settings.form_fields.default_payment_method.label"})}),b.jsx(ys,{children:b.jsx(Mt,{i18nKey:"settings.form_fields.default_payment_method.desc"})})]}),b.jsx(wr,{children:b.jsx(Ba,{autoSize:!0,placeholder:te("settings.form_fields.default_payment_method.placeholder"),name:"default_payment_method",required:!0,errors:d.formState.errors})}),b.jsx(Yo,{className:"px-6 py-4 border-t",children:b.jsx(qe,{children:b.jsx(Mt,{i18nKey:"common.save"})})})]}),b.jsxs(xr,{children:[b.jsxs(Ni,{children:[b.jsx(ns,{children:b.jsx(Mt,{i18nKey:"settings.form_fields.default_quote_validity.label"})}),b.jsx(ys,{children:b.jsx(Mt,{i18nKey:"settings.form_fields.default_quote_validity.desc"})})]}),b.jsx(wr,{children:b.jsx(Ba,{autoSize:!0,placeholder:te("settings.form_fields.default_quote_validity.placeholder"),name:"default_quote_validity",required:!0})}),b.jsx(Yo,{className:"px-6 py-4 border-t",children:b.jsx(qe,{children:b.jsx(Mt,{i18nKey:"common.save"})})})]}),b.jsxs(xr,{children:[b.jsxs(Ni,{children:[b.jsx(ns,{children:b.jsx(Mt,{i18nKey:"settings.form_fields.default_notes.label"})}),b.jsx(ys,{children:b.jsx(Mt,{i18nKey:"settings.form_fields.default_notes.desc"})})]}),b.jsx(wr,{children:b.jsx(Ba,{autoSize:!0,placeholder:te("settings.form_fields.default_notes.placeholder"),name:"default_notes"})}),b.jsx(Yo,{className:"px-6 py-4 border-t",children:b.jsx(qe,{children:b.jsx(Mt,{i18nKey:"common.save"})})})]})]}),b.jsx("div",{className:ie("grid gap-6",t==="legal"?"visible":"hidden"),children:b.jsxs(xr,{className:"h-",children:[b.jsxs(Ni,{children:[b.jsx(ns,{children:b.jsx(Mt,{i18nKey:"settings.form_fields.default_legal_terms.label"})}),b.jsx(ys,{children:b.jsx(Mt,{i18nKey:"settings.form_fields.default_legal_terms.desc"})})]}),b.jsx(wr,{children:b.jsx(Ba,{rows:25,placeholder:te("settings.form_fields.default_legal_terms.placeholder"),name:"default_legal_terms"})}),b.jsx(Yo,{className:"px-6 py-4 border-t",children:b.jsx(qe,{children:b.jsx(Mt,{i18nKey:"common.save"})})})]})})]})})})},kBe=S.createContext(null),DBe=({children:t})=>b.jsx(kBe.Provider,{value:{},children:t}),MBe=({children:t})=>b.jsx(oy,{children:b.jsx(DBe,{children:b.jsxs(zy,{className:"settings-layout",children:[b.jsx(Uy,{}),b.jsxs(By,{children:[b.jsx("div",{className:"grid w-full max-w-6xl gap-2 mx-auto",children:b.jsx("h1",{className:"text-2xl font-semibold md:text-3xl",children:b.jsx(Mt,{i18nKey:"settings.edit.title"})})}),t]})]})})}),OBe=()=>{const t=[{path:"/",element:b.jsx(oy,{children:b.jsx(tJ,{to:"/quotes",replace:!0})})}],e=[{path:"*",Component:Jze}],n=[{path:"/home",element:b.jsx(oy,{children:b.jsx(Gze,{})})},{path:"/catalog",element:b.jsx(Vze,{children:b.jsx(R1,{})}),children:[{index:!0,element:b.jsx(Wze,{})}]},{path:"/dealers",element:b.jsx(Kze,{children:b.jsx(R1,{})}),children:[{index:!0,element:b.jsx(Zze,{})}]},{path:"/quotes",element:b.jsx(ABe,{children:b.jsx(R1,{})}),children:[{index:!0,element:b.jsx(RBe,{})},{path:"add",element:b.jsx(rBe,{})},{path:"edit/:id",element:b.jsx(SBe,{})}]},{path:"/settings",element:b.jsx(MBe,{children:b.jsx(R1,{})}),children:[{index:!0,element:b.jsx(TBe,{})}]},{path:"/logout",element:b.jsx(Bze,{})}],r=[{path:"/login",Component:Fze}],s=CMe([...t,...n,...r,...e],{});return b.jsx(MMe,{router:s})};function Jne(t,e){return function(){return t.apply(e,arguments)}}const{toString:IBe}=Object.prototype,{getPrototypeOf:fF}=Object,YN=(t=>e=>{const n=IBe.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),nl=t=>(t=t.toLowerCase(),e=>YN(e)===t),XN=t=>e=>typeof e===t,{isArray:Hy}=Array,_x=XN("undefined");function jBe(t){return t!==null&&!_x(t)&&t.constructor!==null&&!_x(t.constructor)&&So(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const ere=nl("ArrayBuffer");function LBe(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&ere(t.buffer),e}const $Be=XN("string"),So=XN("function"),tre=XN("number"),QN=t=>t!==null&&typeof t=="object",FBe=t=>t===!0||t===!1,UC=t=>{if(YN(t)!=="object")return!1;const e=fF(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},zBe=nl("Date"),BBe=nl("File"),UBe=nl("Blob"),HBe=nl("FileList"),VBe=t=>QN(t)&&So(t.pipe),qBe=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||So(t.append)&&((e=YN(t))==="formdata"||e==="object"&&So(t.toString)&&t.toString()==="[object FormData]"))},WBe=nl("URLSearchParams"),[GBe,KBe,YBe,XBe]=["ReadableStream","Request","Response","Headers"].map(nl),QBe=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function nS(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,s;if(typeof t!="object"&&(t=[t]),Hy(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),o=i.length;let a;for(r=0;r<o;r++)a=i[r],e.call(null,t[a],a,t)}}function nre(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 ih=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,rre=t=>!_x(t)&&t!==ih;function tj(){const{caseless:t}=rre(this)&&this||{},e={},n=(r,s)=>{const i=t&&nre(e,s)||s;UC(e[i])&&UC(r)?e[i]=tj(e[i],r):UC(r)?e[i]=tj({},r):Hy(r)?e[i]=r.slice():e[i]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&nS(arguments[r],n);return e}const ZBe=(t,e,n,{allOwnKeys:r}={})=>(nS(e,(s,i)=>{n&&So(s)?t[i]=Jne(s,n):t[i]=s},{allOwnKeys:r}),t),JBe=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),e5e=(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)},t5e=(t,e,n,r)=>{let s,i,o;const a={};if(e=e||{},t==null)return e;do{for(s=Object.getOwnPropertyNames(t),i=s.length;i-- >0;)o=s[i],(!r||r(o,t,e))&&!a[o]&&(e[o]=t[o],a[o]=!0);t=n!==!1&&fF(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},n5e=(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},r5e=t=>{if(!t)return null;if(Hy(t))return t;let e=t.length;if(!tre(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},s5e=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&fF(Uint8Array)),i5e=(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])}},o5e=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},a5e=nl("HTMLFormElement"),l5e=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),BH=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),c5e=nl("RegExp"),sre=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};nS(n,(s,i)=>{let o;(o=e(s,i,t))!==!1&&(r[i]=o||s)}),Object.defineProperties(t,r)},u5e=t=>{sre(t,(e,n)=>{if(So(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(So(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+"'")})}})},d5e=(t,e)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return Hy(t)?r(t):r(String(t).split(e)),n},f5e=()=>{},h5e=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,vD="abcdefghijklmnopqrstuvwxyz",UH="0123456789",ire={DIGIT:UH,ALPHA:vD,ALPHA_DIGIT:vD+vD.toUpperCase()+UH},p5e=(t=16,e=ire.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function m5e(t){return!!(t&&So(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const g5e=t=>{const e=new Array(10),n=(r,s)=>{if(QN(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[s]=r;const i=Hy(r)?[]:{};return nS(r,(o,a)=>{const c=n(o,s+1);!_x(c)&&(i[a]=c)}),e[s]=void 0,i}}return r};return n(t,0)},v5e=nl("AsyncFunction"),y5e=t=>t&&(QN(t)||So(t))&&So(t.then)&&So(t.catch),ore=((t,e)=>t?setImmediate:e?((n,r)=>(ih.addEventListener("message",({source:s,data:i})=>{s===ih&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),ih.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",So(ih.postMessage)),b5e=typeof queueMicrotask<"u"?queueMicrotask.bind(ih):typeof process<"u"&&process.nextTick||ore,be={isArray:Hy,isArrayBuffer:ere,isBuffer:jBe,isFormData:qBe,isArrayBufferView:LBe,isString:$Be,isNumber:tre,isBoolean:FBe,isObject:QN,isPlainObject:UC,isReadableStream:GBe,isRequest:KBe,isResponse:YBe,isHeaders:XBe,isUndefined:_x,isDate:zBe,isFile:BBe,isBlob:UBe,isRegExp:c5e,isFunction:So,isStream:VBe,isURLSearchParams:WBe,isTypedArray:s5e,isFileList:HBe,forEach:nS,merge:tj,extend:ZBe,trim:QBe,stripBOM:JBe,inherits:e5e,toFlatObject:t5e,kindOf:YN,kindOfTest:nl,endsWith:n5e,toArray:r5e,forEachEntry:i5e,matchAll:o5e,isHTMLForm:a5e,hasOwnProperty:BH,hasOwnProp:BH,reduceDescriptors:sre,freezeMethods:u5e,toObjectSet:d5e,toCamelCase:l5e,noop:f5e,toFiniteNumber:h5e,findKey:nre,global:ih,isContextDefined:rre,ALPHABET:ire,generateString:p5e,isSpecCompliantForm:m5e,toJSONObject:g5e,isAsyncFn:v5e,isThenable:y5e,setImmediate:ore,asap:b5e};function Et(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)}be.inherits(Et,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:be.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const are=Et.prototype,lre={};["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=>{lre[t]={value:t}});Object.defineProperties(Et,lre);Object.defineProperty(are,"isAxiosError",{value:!0});Et.from=(t,e,n,r,s,i)=>{const o=Object.create(are);return be.toFlatObject(t,o,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),Et.call(o,t.message,e,n,r,s),o.cause=t,o.name=t.name,i&&Object.assign(o,i),o};const x5e=null;function nj(t){return be.isPlainObject(t)||be.isArray(t)}function cre(t){return be.endsWith(t,"[]")?t.slice(0,-2):t}function HH(t,e,n){return t?t.concat(e).map(function(s,i){return s=cre(s),!n&&i?"["+s+"]":s}).join(n?".":""):e}function w5e(t){return be.isArray(t)&&!t.some(nj)}const _5e=be.toFlatObject(be,{},null,function(e){return/^is[A-Z]/.test(e)});function ZN(t,e,n){if(!be.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=be.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!be.isUndefined(y[m])});const r=n.metaTokens,s=n.visitor||f,i=n.dots,o=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&be.isSpecCompliantForm(e);if(!be.isFunction(s))throw new TypeError("visitor must be a function");function u(h){if(h===null)return"";if(be.isDate(h))return h.toISOString();if(!c&&be.isBlob(h))throw new Et("Blob is not supported. Use a Buffer instead.");return be.isArrayBuffer(h)||be.isTypedArray(h)?c&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function f(h,m,y){let g=h;if(h&&!y&&typeof h=="object"){if(be.endsWith(m,"{}"))m=r?m:m.slice(0,-2),h=JSON.stringify(h);else if(be.isArray(h)&&w5e(h)||(be.isFileList(h)||be.endsWith(m,"[]"))&&(g=be.toArray(h)))return m=cre(m),g.forEach(function(x,_){!(be.isUndefined(x)||x===null)&&e.append(o===!0?HH([m],_,i):o===null?m:m+"[]",u(x))}),!1}return nj(h)?!0:(e.append(HH(y,m,i),u(h)),!1)}const l=[],d=Object.assign(_5e,{defaultVisitor:f,convertValue:u,isVisitable:nj});function p(h,m){if(!be.isUndefined(h)){if(l.indexOf(h)!==-1)throw Error("Circular reference detected in "+m.join("."));l.push(h),be.forEach(h,function(g,v){(!(be.isUndefined(g)||g===null)&&s.call(e,g,be.isString(v)?v.trim():v,m,d))===!0&&p(g,m?m.concat(v):[v])}),l.pop()}}if(!be.isObject(t))throw new TypeError("data must be an object");return p(t),e}function VH(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function hF(t,e){this._pairs=[],t&&ZN(t,this,e)}const ure=hF.prototype;ure.append=function(e,n){this._pairs.push([e,n])};ure.toString=function(e){const n=e?function(r){return e.call(this,r,VH)}:VH;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function S5e(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function dre(t,e,n){if(!e)return t;const r=n&&n.encode||S5e,s=n&&n.serialize;let i;if(s?i=s(e,n):i=be.isURLSearchParams(e)?e.toString():new hF(e,n).toString(r),i){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class qH{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){be.forEach(this.handlers,function(r){r!==null&&e(r)})}}const fre={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},C5e=typeof URLSearchParams<"u"?URLSearchParams:hF,E5e=typeof FormData<"u"?FormData:null,A5e=typeof Blob<"u"?Blob:null,R5e={isBrowser:!0,classes:{URLSearchParams:C5e,FormData:E5e,Blob:A5e},protocols:["http","https","file","blob","url","data"]},pF=typeof window<"u"&&typeof document<"u",N5e=(t=>pF&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),P5e=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",T5e=pF&&window.location.href||"http://localhost",k5e=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:pF,hasStandardBrowserEnv:N5e,hasStandardBrowserWebWorkerEnv:P5e,origin:T5e},Symbol.toStringTag,{value:"Module"})),Wa={...k5e,...R5e};function D5e(t,e){return ZN(t,new Wa.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,i){return Wa.isNode&&be.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function M5e(t){return be.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function O5e(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 hre(t){function e(n,r,s,i){let o=n[i++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),c=i>=n.length;return o=!o&&be.isArray(s)?s.length:o,c?(be.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!a):((!s[o]||!be.isObject(s[o]))&&(s[o]=[]),e(n,r,s[o],i)&&be.isArray(s[o])&&(s[o]=O5e(s[o])),!a)}if(be.isFormData(t)&&be.isFunction(t.entries)){const n={};return be.forEachEntry(t,(r,s)=>{e(M5e(r),s,n,0)}),n}return null}function I5e(t,e,n){if(be.isString(t))try{return(e||JSON.parse)(t),be.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const rS={transitional:fre,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=be.isObject(e);if(i&&be.isHTMLForm(e)&&(e=new FormData(e)),be.isFormData(e))return s?JSON.stringify(hre(e)):e;if(be.isArrayBuffer(e)||be.isBuffer(e)||be.isStream(e)||be.isFile(e)||be.isBlob(e)||be.isReadableStream(e))return e;if(be.isArrayBufferView(e))return e.buffer;if(be.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return D5e(e,this.formSerializer).toString();if((a=be.isFileList(e))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return ZN(a?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),I5e(e)):e}],transformResponse:[function(e){const n=this.transitional||rS.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(be.isResponse(e)||be.isReadableStream(e))return e;if(e&&be.isString(e)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(e)}catch(a){if(o)throw a.name==="SyntaxError"?Et.from(a,Et.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Wa.classes.FormData,Blob:Wa.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};be.forEach(["delete","get","head","post","put","patch"],t=>{rS.headers[t]={}});const j5e=be.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"]),L5e=t=>{const e={};let n,r,s;return t&&t.split(`
|
||
`).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||e[n]&&j5e[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},WH=Symbol("internals");function Ob(t){return t&&String(t).trim().toLowerCase()}function HC(t){return t===!1||t==null?t:be.isArray(t)?t.map(HC):String(t)}function $5e(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 F5e=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function yD(t,e,n,r,s){if(be.isFunction(r))return r.call(this,e,n);if(s&&(e=n),!!be.isString(e)){if(be.isString(r))return e.indexOf(r)!==-1;if(be.isRegExp(r))return r.test(e)}}function z5e(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function B5e(t,e){const n=be.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(s,i,o){return this[r].call(this,e,s,i,o)},configurable:!0})})}class Ui{constructor(e){e&&this.set(e)}set(e,n,r){const s=this;function i(a,c,u){const f=Ob(c);if(!f)throw new Error("header name must be a non-empty string");const l=be.findKey(s,f);(!l||s[l]===void 0||u===!0||u===void 0&&s[l]!==!1)&&(s[l||c]=HC(a))}const o=(a,c)=>be.forEach(a,(u,f)=>i(u,f,c));if(be.isPlainObject(e)||e instanceof this.constructor)o(e,n);else if(be.isString(e)&&(e=e.trim())&&!F5e(e))o(L5e(e),n);else if(be.isHeaders(e))for(const[a,c]of e.entries())i(c,a,r);else e!=null&&i(n,e,r);return this}get(e,n){if(e=Ob(e),e){const r=be.findKey(this,e);if(r){const s=this[r];if(!n)return s;if(n===!0)return $5e(s);if(be.isFunction(n))return n.call(this,s,r);if(be.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Ob(e),e){const r=be.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||yD(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let s=!1;function i(o){if(o=Ob(o),o){const a=be.findKey(r,o);a&&(!n||yD(r,r[a],a,n))&&(delete r[a],s=!0)}}return be.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||yD(this,this[i],i,e,!0))&&(delete this[i],s=!0)}return s}normalize(e){const n=this,r={};return be.forEach(this,(s,i)=>{const o=be.findKey(r,i);if(o){n[o]=HC(s),delete n[i];return}const a=e?z5e(i):String(i).trim();a!==i&&delete n[i],n[a]=HC(s),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return be.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=e&&be.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[WH]=this[WH]={accessors:{}}).accessors,s=this.prototype;function i(o){const a=Ob(o);r[a]||(B5e(s,o),r[a]=!0)}return be.isArray(e)?e.forEach(i):i(e),this}}Ui.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);be.reduceDescriptors(Ui.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});be.freezeMethods(Ui);function bD(t,e){const n=this||rS,r=e||n,s=Ui.from(r.headers);let i=r.data;return be.forEach(t,function(a){i=a.call(n,i,s.normalize(),e?e.status:void 0)}),s.normalize(),i}function pre(t){return!!(t&&t.__CANCEL__)}function Vy(t,e,n){Et.call(this,t??"canceled",Et.ERR_CANCELED,e,n),this.name="CanceledError"}be.inherits(Vy,Et,{__CANCEL__:!0});function mre(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new Et("Request failed with status code "+n.status,[Et.ERR_BAD_REQUEST,Et.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function U5e(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function H5e(t,e){t=t||10;const n=new Array(t),r=new Array(t);let s=0,i=0,o;return e=e!==void 0?e:1e3,function(c){const u=Date.now(),f=r[i];o||(o=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-o<e)return;const p=f&&u-f;return p?Math.round(d*1e3/p):void 0}}function V5e(t,e){let n=0,r=1e3/e,s,i;const o=(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?o(u,f):(s=u,i||(i=setTimeout(()=>{i=null,o(s)},r-l)))},()=>s&&o(s)]}const hA=(t,e,n=3)=>{let r=0;const s=H5e(50,250);return V5e(i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,c=o-r,u=s(c),f=o<=a;r=o;const l={loaded:o,total:a,progress:a?o/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a&&f?(a-o)/u:void 0,event:i,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(l)},n)},GH=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},KH=t=>(...e)=>be.asap(()=>t(...e)),q5e=Wa.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function s(i){let o=i;return e&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(o){const a=be.isString(o)?s(o):o;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}(),W5e=Wa.hasStandardBrowserEnv?{write(t,e,n,r,s,i){const o=[t+"="+encodeURIComponent(e)];be.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),be.isString(r)&&o.push("path="+r),be.isString(s)&&o.push("domain="+s),i===!0&&o.push("secure"),document.cookie=o.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 G5e(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function K5e(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function gre(t,e){return t&&!G5e(e)?K5e(t,e):e}const YH=t=>t instanceof Ui?{...t}:t;function Op(t,e){e=e||{};const n={};function r(u,f,l){return be.isPlainObject(u)&&be.isPlainObject(f)?be.merge.call({caseless:l},u,f):be.isPlainObject(f)?be.merge({},f):be.isArray(f)?f.slice():f}function s(u,f,l){if(be.isUndefined(f)){if(!be.isUndefined(u))return r(void 0,u,l)}else return r(u,f,l)}function i(u,f){if(!be.isUndefined(f))return r(void 0,f)}function o(u,f){if(be.isUndefined(f)){if(!be.isUndefined(u))return r(void 0,u)}else return r(void 0,f)}function a(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:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(u,f)=>s(YH(u),YH(f),!0)};return be.forEach(Object.keys(Object.assign({},t,e)),function(f){const l=c[f]||s,d=l(t[f],e[f],f);be.isUndefined(d)&&l!==a||(n[f]=d)}),n}const vre=t=>{const e=Op({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:a}=e;e.headers=o=Ui.from(o),e.url=dre(gre(e.baseURL,e.url),t.params,t.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(be.isFormData(n)){if(Wa.hasStandardBrowserEnv||Wa.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[u,...f]=c?c.split(";").map(l=>l.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...f].join("; "))}}if(Wa.hasStandardBrowserEnv&&(r&&be.isFunction(r)&&(r=r(e)),r||r!==!1&&q5e(e.url))){const u=s&&i&&W5e.read(i);u&&o.set(s,u)}return e},Y5e=typeof XMLHttpRequest<"u",X5e=Y5e&&function(t){return new Promise(function(n,r){const s=vre(t);let i=s.data;const o=Ui.from(s.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:u}=s,f,l,d,p,h;function m(){p&&p(),h&&h(),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 x=Ui.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),A={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:x,config:t,request:y};mre(function(T){n(T),m()},function(T){r(T),m()},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 Et("Request aborted",Et.ECONNABORTED,t,y)),y=null)},y.onerror=function(){r(new Et("Network Error",Et.ERR_NETWORK,t,y)),y=null},y.ontimeout=function(){let _=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const A=s.transitional||fre;s.timeoutErrorMessage&&(_=s.timeoutErrorMessage),r(new Et(_,A.clarifyTimeoutError?Et.ETIMEDOUT:Et.ECONNABORTED,t,y)),y=null},i===void 0&&o.setContentType(null),"setRequestHeader"in y&&be.forEach(o.toJSON(),function(_,A){y.setRequestHeader(A,_)}),be.isUndefined(s.withCredentials)||(y.withCredentials=!!s.withCredentials),a&&a!=="json"&&(y.responseType=s.responseType),u&&([d,h]=hA(u,!0),y.addEventListener("progress",d)),c&&y.upload&&([l,p]=hA(c),y.upload.addEventListener("progress",l),y.upload.addEventListener("loadend",p)),(s.cancelToken||s.signal)&&(f=x=>{y&&(r(!x||x.type?new Vy(null,t,y):x),y.abort(),y=null)},s.cancelToken&&s.cancelToken.subscribe(f),s.signal&&(s.signal.aborted?f():s.signal.addEventListener("abort",f)));const v=U5e(s.url);if(v&&Wa.protocols.indexOf(v)===-1){r(new Et("Unsupported protocol "+v+":",Et.ERR_BAD_REQUEST,t));return}y.send(i||null)})},Q5e=(t,e)=>{let n=new AbortController,r;const s=function(c){if(!r){r=!0,o();const u=c instanceof Error?c:this.reason;n.abort(u instanceof Et?u:new Vy(u instanceof Error?u.message:u))}};let i=e&&setTimeout(()=>{s(new Et(`timeout ${e} of ms exceeded`,Et.ETIMEDOUT))},e);const o=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach(c=>{c&&(c.removeEventListener?c.removeEventListener("abort",s):c.unsubscribe(s))}),t=null)};t.forEach(c=>c&&c.addEventListener&&c.addEventListener("abort",s));const{signal:a}=n;return a.unsubscribe=o,[a,()=>{i&&clearTimeout(i),i=null}]},Z5e=function*(t,e){let n=t.byteLength;if(!e||n<e){yield t;return}let r=0,s;for(;r<n;)s=r+e,yield t.slice(r,s),r=s},J5e=async function*(t,e,n){for await(const r of t)yield*Z5e(ArrayBuffer.isView(r)?r:await n(String(r)),e)},XH=(t,e,n,r,s)=>{const i=J5e(t,e,s);let o=0,a,c=u=>{a||(a=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:f,value:l}=await i.next();if(f){c(),u.close();return}let d=l.byteLength;if(n){let p=o+=d;n(p)}u.enqueue(new Uint8Array(l))}catch(f){throw c(f),f}},cancel(u){return c(u),i.return()}},{highWaterMark:2})},JN=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",yre=JN&&typeof ReadableStream=="function",rj=JN&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),bre=(t,...e)=>{try{return!!t(...e)}catch{return!1}},eUe=yre&&bre(()=>{let t=!1;const e=new Request(Wa.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),QH=64*1024,sj=yre&&bre(()=>be.isReadableStream(new Response("").body)),pA={stream:sj&&(t=>t.body)};JN&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!pA[e]&&(pA[e]=be.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new Et(`Response type '${e}' is not supported`,Et.ERR_NOT_SUPPORT,r)})})})(new Response);const tUe=async t=>{if(t==null)return 0;if(be.isBlob(t))return t.size;if(be.isSpecCompliantForm(t))return(await new Request(t).arrayBuffer()).byteLength;if(be.isArrayBufferView(t)||be.isArrayBuffer(t))return t.byteLength;if(be.isURLSearchParams(t)&&(t=t+""),be.isString(t))return(await rj(t)).byteLength},nUe=async(t,e)=>{const n=be.toFiniteNumber(t.getContentLength());return n??tUe(e)},rUe=JN&&(async t=>{let{url:e,method:n,data:r,signal:s,cancelToken:i,timeout:o,onDownloadProgress:a,onUploadProgress:c,responseType:u,headers:f,withCredentials:l="same-origin",fetchOptions:d}=vre(t);u=u?(u+"").toLowerCase():"text";let[p,h]=s||i||o?Q5e([s,i],o):[],m,y;const g=()=>{!m&&setTimeout(()=>{p&&p.unsubscribe()}),m=!0};let v;try{if(c&&eUe&&n!=="get"&&n!=="head"&&(v=await nUe(f,r))!==0){let N=new Request(e,{method:"POST",body:r,duplex:"half"}),T;if(be.isFormData(r)&&(T=N.headers.get("content-type"))&&f.setContentType(T),N.body){const[E,P]=GH(v,hA(KH(c)));r=XH(N.body,QH,E,P,rj)}}be.isString(l)||(l=l?"include":"omit"),y=new Request(e,{...d,signal:p,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:l});let x=await fetch(y);const _=sj&&(u==="stream"||u==="response");if(sj&&(a||_)){const N={};["status","statusText","headers"].forEach(k=>{N[k]=x[k]});const T=be.toFiniteNumber(x.headers.get("content-length")),[E,P]=a&&GH(T,hA(KH(a),!0))||[];x=new Response(XH(x.body,QH,E,()=>{P&&P(),_&&g()},rj),N)}u=u||"text";let A=await pA[be.findKey(pA,u)||"text"](x,t);return!_&&g(),h&&h(),await new Promise((N,T)=>{mre(N,T,{data:A,headers:Ui.from(x.headers),status:x.status,statusText:x.statusText,config:t,request:y})})}catch(x){throw g(),x&&x.name==="TypeError"&&/fetch/i.test(x.message)?Object.assign(new Et("Network Error",Et.ERR_NETWORK,t,y),{cause:x.cause||x}):Et.from(x,x&&x.code,t,y)}}),ij={http:x5e,xhr:X5e,fetch:rUe};be.forEach(ij,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const ZH=t=>`- ${t}`,sUe=t=>be.isFunction(t)||t===null||t===!1,xre={getAdapter:t=>{t=be.isArray(t)?t:[t];const{length:e}=t;let n,r;const s={};for(let i=0;i<e;i++){n=t[i];let o;if(r=n,!sUe(n)&&(r=ij[(o=String(n)).toLowerCase()],r===void 0))throw new Et(`Unknown adapter '${o}'`);if(r)break;s[o||"#"+i]=r}if(!r){const i=Object.entries(s).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=e?i.length>1?`since :
|
||
`+i.map(ZH).join(`
|
||
`):" "+ZH(i[0]):"as no adapter specified";throw new Et("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:ij};function xD(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Vy(null,t)}function JH(t){return xD(t),t.headers=Ui.from(t.headers),t.data=bD.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),xre.getAdapter(t.adapter||rS.adapter)(t).then(function(r){return xD(t),r.data=bD.call(t,t.transformResponse,r),r.headers=Ui.from(r.headers),r},function(r){return pre(r)||(xD(t),r&&r.response&&(r.response.data=bD.call(t,t.transformResponse,r.response),r.response.headers=Ui.from(r.response.headers))),Promise.reject(r)})}const wre="1.7.3",mF={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{mF[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const e6={};mF.transitional=function(e,n,r){function s(i,o){return"[Axios v"+wre+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,a)=>{if(e===!1)throw new Et(s(o," has been removed"+(n?" in "+n:"")),Et.ERR_DEPRECATED);return n&&!e6[o]&&(e6[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,o,a):!0}};function iUe(t,e,n){if(typeof t!="object")throw new Et("options must be an object",Et.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let s=r.length;for(;s-- >0;){const i=r[s],o=e[i];if(o){const a=t[i],c=a===void 0||o(a,i,t);if(c!==!0)throw new Et("option "+i+" must be "+c,Et.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Et("Unknown option "+i,Et.ERR_BAD_OPTION)}}const oj={assertOptions:iUe,validators:mF},qu=oj.validators;class hp{constructor(e){this.defaults=e,this.interceptors={request:new qH,response:new qH}}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=Op(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&oj.assertOptions(r,{silentJSONParsing:qu.transitional(qu.boolean),forcedJSONParsing:qu.transitional(qu.boolean),clarifyTimeoutError:qu.transitional(qu.boolean)},!1),s!=null&&(be.isFunction(s)?n.paramsSerializer={serialize:s}:oj.assertOptions(s,{encode:qu.function,serialize:qu.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&be.merge(i.common,i[n.method]);i&&be.forEach(["delete","get","head","post","put","patch","common"],h=>{delete i[h]}),n.headers=Ui.concat(o,i);const a=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(c=c&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let f,l=0,d;if(!c){const h=[JH.bind(this),void 0];for(h.unshift.apply(h,a),h.push.apply(h,u),d=h.length,f=Promise.resolve(n);l<d;)f=f.then(h[l++],h[l++]);return f}d=a.length;let p=n;for(l=0;l<d;){const h=a[l++],m=a[l++];try{p=h(p)}catch(y){m.call(this,y);break}}try{f=JH.call(this,p)}catch(h){return Promise.reject(h)}for(l=0,d=u.length;l<d;)f=f.then(u[l++],u[l++]);return f}getUri(e){e=Op(this.defaults,e);const n=gre(e.baseURL,e.url);return dre(n,e.params,e.paramsSerializer)}}be.forEach(["delete","get","head","options"],function(e){hp.prototype[e]=function(n,r){return this.request(Op(r||{},{method:e,url:n,data:(r||{}).data}))}});be.forEach(["post","put","patch"],function(e){function n(r){return function(i,o,a){return this.request(Op(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}hp.prototype[e]=n(),hp.prototype[e+"Form"]=n(!0)});class gF{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 o=new Promise(a=>{r.subscribe(a),i=a}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},e(function(i,o,a){r.reason||(r.reason=new Vy(i,o,a),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)}static source(){let e;return{token:new gF(function(s){e=s}),cancel:e}}}function oUe(t){return function(n){return t.apply(null,n)}}function aUe(t){return be.isObject(t)&&t.isAxiosError===!0}const aj={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(aj).forEach(([t,e])=>{aj[e]=t});function _re(t){const e=new hp(t),n=Jne(hp.prototype.request,e);return be.extend(n,hp.prototype,e,{allOwnKeys:!0}),be.extend(n,e,null,{allOwnKeys:!0}),n.create=function(s){return _re(Op(t,s))},n}const kr=_re(rS);kr.Axios=hp;kr.CanceledError=Vy;kr.CancelToken=gF;kr.isCancel=pre;kr.VERSION=wre;kr.toFormData=ZN;kr.AxiosError=Et;kr.Cancel=kr.CanceledError;kr.all=function(e){return Promise.all(e)};kr.spread=oUe;kr.isAxiosError=aUe;kr.mergeConfig=Op;kr.AxiosHeaders=Ui;kr.formToJSON=t=>hre(be.isHTMLForm(t)?new FormData(t):t);kr.getAdapter=xre.getAdapter;kr.HttpStatusCode=aj;kr.default=kr;const Sre=()=>{const t=Ko.getItem("uecko.auth");return t&&t.token?`Bearer ${t.token}`:""},lUe=t=>(t.headers.Authorization=Sre(),t),cUe=t=>Promise.reject(t),uUe=t=>((t==null?void 0:t.config).raw,t),dUe=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 fUe(t){return t.interceptors.request.use(lUe,cUe),t.interceptors.response.use(uUe,dUe),t}const Cre={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":"*"}},Ere=()=>fUe(kr.create(Cre)),hUe=(t,e=Ere())=>({login:async({email:n,password:r})=>{Ko.clear();try{const s=await e.request({url:`${t}/auth/login`,method:"POST",data:{email:n,password:r}}),{data:i}=s;return Ko.setItem("uecko.auth",i),{success:!0,data:i}}catch{return{success:!1,error:{message:"Login failed",name:"Invalid email or password"}}}},logout:()=>(Ko.clear(),Promise.resolve({success:!0,redirectTo:"/login"})),check:()=>{const n=Ko.getItem("uecko.auth"),r=!!(n!=null&&n.token);return r||Ko.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=Ko.getItem("uecko.auth");return(s==null?void 0:s.id)===(r==null?void 0:r.id)?(Ko.setItem("uecko.profile",r),Promise.resolve(r)):Promise.resolve(null)}catch{return Promise.resolve(null)}},onError:n=>(Ko.clear(),Promise.resolve({error:n,logout:!0}))}),pUe=(t,e=Ere())=>({name:()=>"AxiosDataProvider",getApiUrl:()=>t,getApiAuthorization:Sre,getList:async n=>{const{resource:r,quickSearchTerm:s,pagination:i,filters:o=[],sort:a=[]}=n,c=`${t}/${r}`,u=new URLSearchParams,{page:f,limit:l}=yUe(i);u.append("page",String(f)),u.append("limit",String(l));const d=mUe(a);d.length&&u.append("$sort_by",d.join(","));const p=vUe(s,o);p.length&&u.append("q",p.join(","));const h=gUe(o);return h.length&&u.append("$filters",h.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:o}=n,a=`${t}/${r}`,c=new FormData;return c.append(i||"file",s),(await e.post(a,c,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:o})).data},downloadPDF:async n=>{const{url:r,config:s}=n,i=await e.get(r,{responseType:"arraybuffer",...s}),o=i.headers["content-disposition"];let a="downloaded-file.pdf";if(o){const u=o.match(/filename="?(.+)"?/);u&&u[1]&&(a=u[1])}const c=new Blob([i.data],{type:"application/pdf"});return{filename:a,filedata:c}},custom:async n=>{const{url:r,path:s,method:i,responseType:o,headers:a,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 p={url:l.toString(),method:i,responseType:o,signal:c,...f,...Cre};switch(i){case"put":case"post":case"patch":d=await e.request({...p,data:u});break;case"delete":d=await e.delete(l.toString(),{responseType:o,headers:a,...f});break;default:d=await e.get(l.toString(),{responseType:o,signal:c,headers:a,...f});break}return d.data}}),mUe=(t=[])=>t.map(({field:e,order:n})=>`${n==="DESC"?"-":"+"}${e}`),gUe=(t=[])=>t.filter(({field:e})=>e!=="q").map(({field:e,operator:n,value:r})=>`${e}[${n}]${r}`),vUe=(t=[],e=[])=>{var n;return(n=e.find(({field:r})=>r==="q"))!=null&&n.value?[e.find(({field:r})=>r==="q").value]:t},yUe=t=>{const{pageIndex:e=wg,pageSize:n=T$}=t||{};return{page:e,limit:n}},{slice:bUe,forEach:xUe}=[];function wUe(t){return xUe.call(bUe.call(arguments,1),e=>{if(e)for(const n in e)t[n]===void 0&&(t[n]=e[n])}),t}const t6=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,_Ue=(t,e,n)=>{const r=n||{};r.path=r.path||"/";const s=encodeURIComponent(e);let i=`${t}=${s}`;if(r.maxAge>0){const o=r.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(o)}`}if(r.domain){if(!t6.test(r.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${r.domain}`}if(r.path){if(!t6.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},n6={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=_Ue(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 SUe={name:"cookie",lookup(t){let{lookupCookie:e}=t;if(e&&typeof document<"u")return n6.read(e)||void 0},cacheUserLanguage(t,e){let{lookupCookie:n,cookieMinutes:r,cookieDomain:s,cookieOptions:i}=e;n&&typeof document<"u"&&n6.create(n,t,r,s,i)}},CUe={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 o=s.substring(1).split("&");for(let a=0;a<o.length;a++){const c=o[a].indexOf("=");c>0&&o[a].substring(0,c)===e&&(n=o[a].substring(c+1))}}return n}};let Ib=null;const r6=()=>{if(Ib!==null)return Ib;try{Ib=window!=="undefined"&&window.localStorage!==null;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Ib=!1}return Ib};var EUe={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&r6())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:n}=e;n&&r6()&&window.localStorage.setItem(n,t)}};let jb=null;const s6=()=>{if(jb!==null)return jb;try{jb=window!=="undefined"&&window.sessionStorage!==null;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{jb=!1}return jb};var AUe={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&s6())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:n}=e;n&&s6()&&window.sessionStorage.setItem(n,t)}},RUe={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}},NUe={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}},PUe={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}},TUe={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]}};function kUe(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t}}class Are{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e||{languageUtils:{}},this.options=wUe(n,this.options||{},kUe()),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(SUe),this.addDetector(CUe),this.addDetector(EUe),this.addDetector(AUe),this.addDetector(RUe),this.addDetector(NUe),this.addDetector(PUe),this.addDetector(TUe)}addDetector(e){return this.detectors[e.name]=e,this}detect(e){e||(e=this.options.order);let 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.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(e,n){n||(n=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)}))}}Are.type="languageDetector";const DUe={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"}},MUe={translation:DUe},OUe={common:{required:"required",cancel:"Cancel",no:"No",yes:"Yes",save:"Save",save_close:"Save and Close",accept:"OK",discard:"Discard",hide:"Hide",back:"Back",upload:"Upload",continue:"Continue",close:"Close",more:"More",add:"Add",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",required_field:"This field is required",unsaved_changes_prompt:"There are unsaved changes. If you leave, you'll lose your changes.",edit:"Edit",remove:"Remove",archive:"Archive",duplicate:"Duplicate",print:"Print",disable_preview:"Disable preview",enable_preview:"Enable 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)",button_remove_all:"Remove all terms from filter",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."}},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:{home:"Home",settings:"Settings",dealers:"Dealers",catalog:"Catalog",quotes:"Quotes",orders:"Orders",search_placeholder:"Type here for search quotes and articles",user:{user_menu:"User menu",my_account:"My account",profile:"Profile",settings:"Settings",support:"Support",logout:"Logout"},logout_dialog:{title:"Confirm",description:"Are you sure you want to log out?",confirm_label:"Log out",cancel_label:"Cancel"}},login_page:{title:"Partner intranet",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",columns:{description:"Description",points:"Points",retail_price:"Retail price",quantity:"quantity"}}},quotes:{list:{title:"Quotes",subtitle:"",tabs_title:"Status",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:"Imp. total",actions:{edit:"Edit quote",sent_to:"Send to Uecko"}},resume:{title:"Quote",download_quote:"Download quote",tabs:{resume:"Resume",preview:"Preview"},quote_information:"Quote Information",customer_information:"Customer Information",payment_information:"Payment Information",price_information:"Quote totals"}},create:{title:"New quote",tabs:{general:"General data",items:"Quote items",preview:"Quote preview",documents:"Documents",history:"History"},form_groups:{general:{title:"General Data",desc:"General data and quote customer"},status:{title:"Status",desc:"Quote status"},items:{title:"Quote Items",desc:"Quote detail lines. Use the catalog to make it easier to fill in the content."},documents:{title:"Attached Documents",desc:"Attach documents such as photos, drawings, sketches, etc. to your quotation."},history:{title:"History",desc:"Quote history"}},edit:{title:"Quote"}},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",value_label:"Elapsed time in seconds {{elapsed}}"},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 complete your quote, you can default text blocks.",toast_article_added:"Text block added:"},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 is archived."}},submit_button:"Change status",toast_status_changed:"Quote status changed to: {{newStatus}}"},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:""},status:{label:"Status",desc:"Quote status",placeholder:""},lang_code:{label:"Language",desc:"Quote language",placeholder:""},currency_code:{label:"Currency",desc:"Quote currency",placeholder:""},customer_reference:{label:"Customer reference",desc:"Customer reference for this quote",placeholder:""},customer_information:{label:"Customer's contact data",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:"",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 price",placeholder:"",desc:"Percentage discount price"},before_tax_price:{label:"Before tax price",placeholder:"",desc:"Before tax price"},tax:{label:"Tax (%)",placeholder:"",desc:"Percentage Tax"},tax_value:{label:"Tax ({{value}}%)",placeholder:"",desc:"Percentage Tax"},tax_price:{label:"Tax price",placeholder:"",desc:"Percentage tax price"},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:"Dto (%)",placeholder:"",desc:"Percentage discount"},total_price:{label:"Total price",placeholder:"",desc:"Total price with percentage discount"}}}},settings:{edit:{title:"Settings",subtitle:"",tabs:{profile:"Profile settings",quotes:"Quote settings",legal:"Legal settings"}},form_fields:{image:{label:"Logotype",placeholder:"",desc:""},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_legal_terms:{label:"Legal terms",placeholder:"",desc:"Legal information to be included at the end of your 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"}}}},IUe={translation:OUe},jUe={common:{required:"obligatorio",cancel:"Cancelar",no:"No",yes:"Sí",save:"Guardar",save_close:"Guardar y Cerrar",accept:"Aceptar",discard:"Descartar",hide:"Ocultar",back:"Volver",upload:"Cargar",continue:"Continuar",close:"Cerrar",more:"More",add:"Añadir",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",required_field:"Este campo es obligatorio",unsaved_changes_prompt:"Los últimos cambios no se han guardado. Si continúas, se perderán.",edit:"Editar",remove:"Eliminar",archive:"Archivar",duplicate:"Duplicar",print:"Imprimir",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)",button_remove_all:"Quitar todos los términos del filtro",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:{LoadingIndicator:{title:"Cargando..."},loading_overlay:{title:"Cargando...",subtitle:"Esto puede tardar unos segundos. Por favor, no cierre esta página."}},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:{home:"Inicio",settings:"Ajustes",dealers:"Distribuidores",catalog:"Catálogo",quotes:"Cotizaciones",orders:"Pedidos",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",columns:{description:"Descripción",points:"Puntos",retail_price:"PVP",quantity:"Cantidad"}}},quotes:{list:{title:"Cotizaciones",subtitle:"",tabs_title:"Estados",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",actions:{edit:"Editar",sent_to:"Enviar a Uecko"}},resume:{title:"Cotización",download_quote:"Descargar",tabs:{resume:"Resumen",preview:"Previsualización"},quote_information:"Información",customer_information:"Cliente",payment_information:"Pago",price_information:"Importes"}},create:{title:"Nueva cotización",tabs:{general:"Datos generales",items:"Contenido",preview:"Vista previa",documents:"Documentos",history:"Historial"},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"},items:{title:"Contenido de la cotización",desc:"Líneas de detalle de la cotización. Ayúdese del catálogo para rellenar más fácilmente el contenido."},documents:{title:"Documentos",desc:"Añada adjuntar con su cotización documentos como fotos, planos, croquis, etc."},history:{title:"Historial",desc:"Historial de la cotización"}},edit:{title:"Cotización"}},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",value_label:"Elapsed time in seconds {{elapsed}}"},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.",submit_button:"Enviar",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}}"},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",desc:"Idioma de la cotización",placeholder:""},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:"desc"},notes:{label:"Notas",placeholder:"",desc:"desc"},validity:{label:"Validez de la cotización",placeholder:"",desc:"desc"},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:"IVA (%)",placeholder:"",desc:"Porcentaje de IVA"},tax_value:{label:"IVA ({{value}}%)",placeholder:"",desc:"Porcentaje de IVA"},tax_price:{label:"Imp. descuento",placeholder:"",desc:"Importe del descuento"},total_price:{label:"Total price",placeholder:"",desc:"Quote total price"},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",subtitle:"",tabs:{profile:"Ajustes de perfil",quotes:"Ajustes legales",legal:"Ajustes para cotizaciones"}},form_fields:{logo:{label:"Logotipo",placeholder:"",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:"IVA por defecto (%)",placeholder:"",desc:"Porcentaje de IVA por defecto en las cotizaciones"},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"}}},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."},form_fields:{}}},LUe={translation:jUe};Cs.use(Are).use(E2e).init({detection:{order:["navigator"]},debug:!1,fallbackLng:"es",interpolation:{escapeValue:!1},resources:{ca:MUe,en:IUe,es:LUe}});function $Ue(){const t=new yhe({defaultOptions:{queries:{retry:!1,staleTime:1e4}}});return b.jsx(P2e,{i18n:Cs,children:b.jsx(She,{client:t,children:b.jsx(HOe,{dataSource:pUe("https://presupuestos.uecko.com:13001/api/v1"),children:b.jsx(nhe,{authActions:hUe("https://presupuestos.uecko.com:13001/api/v1"),children:b.jsxs(jze,{defaultTheme:"light",storageKey:"vite-ui-theme",children:[b.jsx(LZ,{delayDuration:0,children:b.jsx(Une,{children:b.jsx(S.Suspense,{fallback:b.jsx(Yl,{}),children:b.jsx(OBe,{})})})}),b.jsx(gZ,{}),b.jsx(C4e,{}),b.jsx($ze,{initialIsOpen:!1})]})})})})})}wD.createRoot(document.getElementById("uecko")).render(b.jsx(oe.StrictMode,{children:b.jsx($Ue,{})}));
|